Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Saturday, March 28, 2009

2009 ESRI Developer Summit

ArcGIS 9.3.1 Server (ships after U.C.)
- New Optimized Map Service that is as fast as ArcIMS or sometimes faster.

- New Map publish toolbar in ArcMap that helps optimize mxds and rendering speeds, using the analyze tool. The analyze tool produces errors, warnings and messages to help you see what's slowing down your map service. It also creates a new optimized mxd file with a .msd extension, that is used for the new Optimized Map Service. During one of the sessions it took a map that rendered in 12sec and optimized it to .8 secs.

- New Silverlight API beta is released with some custom controls like automatic point clustering and rendering. The demos were really slick and fast. At one of the sessions someone asked what the limitations of the Silverlight API was. Art Haddad said he tested rendering 10,000 points with no problem. He says your bandwidth is now your bottleneck. For you JavaScript API folks out there, you know the pain and limitation of only showing 100 points before it brings your browser to a crawl. Also map rotation will be supported. I believe this will be ESRI's default web client.


ArcGIS 9.4 Desktop (ships late fall or early next year)
- New UI with dock able controls like Visual Studio

- Catalog has been added right into ArcMap

- Asynchronous geoprocessing (basically when running a toolbox tool it will not lock up your whole ArcMap session anymore)

- Side by side deployment (9.3.1 & 9.4 versions will be able to run on the same machine)

- High performance graphics

- Full python integration with script console

- Enhanced editing in 2D & 3D

- No support for IE6, VB6, VS2005, Oracle 9i, SQL2000, Win2000 & Win Server 2000

- VBA only available for legacy

- Python is now the default custom tool language

- New layers tab in ArcMap that groups the layers by there state. Groupings like Visible, Out of Scale Range, Hidden layers, and Selectable layers.

- New editing tools for ArcEngine that match the tools in ArcMap

- Search integration in all products

- New layer type called "Query layers" that limits displayed features using SQL syntax.


ArcGIS 9.4 Server (ships late fall or early next year)
- Web editing service provided in all web APIs.

- Support for native SQL, no ArcSDE required.

- Faster map tile retrieval.

- Query Layer support

- Access to standalone tables

- Improve map cache update workflow

- Full support for domains

- Support for native SQL



ArcGIS Explorer 900
- New feature lets you create presentations with fly over animations using your data. It also lets you import you PowerPoint slides.

- Virtual Earth data will be available.

- New ribbon interface and a custom settings file can be created to limit what tools are shown for custom user installs.



Other random items
ArcGIS Online (ships after 9.3.1) - Using your global account you can log in and share your data by uploading it. You can even create groups and secure them so that only certain people have access to the data. You can even create hosted maps from your uploaded data. No mention was said if this would be a free site or some type of paid service.

Layer Packages - These are basically compressed files that will include the layer symbology and data in one file. This will be used to upload data to the new ArcGIS Online.

Using Open Layers with the REST API - James Fee gave an interesting user session about modifying the open source project Open Layers to use the ArcGIS Server REST API. Right now it supports a subset of the REST API features but will support all functions possibly by Fall of '09.

ArcGIS Mobile 9.4 - Mobile will be supported on tablets and the SDK has been made easier for task based programs. The same program should work on handheld and tablet with no modification.


This year I would say the key jargon phrases for the summit are "Web Maps" and "Story". "Story" is taken from Microsoft and basically its a way to assign emotion to a product. It also describes the user experience. It was used in almost every session I went too. "Web Maps" is ESRIs way of saying "stop creating sites that mimic ArcMap on the web" and create more focused web map applications with the least amount of layers. I'm not really sure this is cost effective. Since most clients want to get the most bang for there buck and don't really want to pay you to create 5 focused sites when 1 light web gis viewer could do the same thing. I understand there shooting for the Google simple map app, but I don't believe in these financially
sensitive times that this makes sense.

Overall I think the Dev Summit was good and I'm really looking forward to playing with the Silverlight API and the Optimized Services.

Wednesday, January 7, 2009

Asp.net MVC & jQuery the new standard

Wow its been a while since I'v posted something. Been busy at work and settling into the new house, holidays and every other crazy thing that happens around this time of the year.

But what I really want to talk about is the new ASP.NET MVC & jQuery and how this will be the standard way of building sites on the ASP.NET framework. I know its a bold disclaimer, but I fully believe it after using both on a couple of projects and coming away thinking.... why wasn't it always this fun to build sites in Dot Net!

To begin with the MVC part stands for Model-View-Controller. This is a very old concept dating back to 1979 which was described by Trygve Reenskaug, then working on Smalltalk at Xerox PARC(..I'm always surprised at the amount of ground breaking technology that went on at Xerox back than.).
In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.




You gain a lot by separating your website out like this. It makes it super easy to run Unit Tests against all 3 levels. You also lose the ViewState dead weight. No more limitation on just 1 form and the post back model goes right out the door. Now the down side is most server controls that use ViewState will not work. But MVC makes up for this with HtmlHelpers. Plus you get really nice looking REST like urls. Like so http://stackoverflow.com/questions/tagged/asp.net-mvc. Notice you don't see the ".aspx" ext or any extensions. You may think "who cares, so your url looks pretty". Yeah I thought the same thing also, but what makes this important is the url is self describing. It now has meaning and that meaning can be parsed and indexed by the all mighty GOOGLE search engine. You know what that means. Better search indexes, higher ranking and more eye balls finding your site!!

These nice urls are pointers to actions in your controller.
An action is basically a function waiting to be called by a url. And just like any function you can pass parameters to it and it can output data from it. This is huge because now not just your front end .aspx page have access to your logic, but so does anything that can communicate through http. This is what makes MVC such an easy fit for AJAX. You can call that action url right in Javascript and have it return some string information or better yet JSON objects.

This is where jQuery comes in handy.
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.




jQuery makes javascript fun again. Like when you first discovered all the cool little floating boxs and color changing scripts you can do with it. You can even make it snow on your web site with Javascript. But than all the different browsers decided, they knew the best way to implement javascript. You had to add all that browser checking code mixed in with your logic and boiler plate code....ahhhhhhhhhhhh!!!. No wonder most people ran screaming and called javascript a toy language. jQuery takes care of all that and comes up with a genuis way of traversing the DOM using selectors.

jQuery selectors are a combination of CSS 1-3 & XPath. Essentially, the best parts from both of these query languages were taken, combined, and used to create the final jQuery expression language.


What really makes jQuery shine is the fact that its very extensible. There are 100s of plug-ins on the site. From form valadation plugin-ins, auto-complete controls with ajax to a full Grid control with built in search using local or remote data, column resizing and ording.

jQuery was so powerful that Microsoft decided to include it with its ASP.NET MVC Beta release.

Just imagine the possibilities. I know its a different way of thinking and building a site from a .NET view. But this is the way all major web platforms are built. Ruby on Rails, PHP, Java..etc. It makes sense for the web and makes development life a lot easier.

If you want some tutorials on some of the topics I talked about ScottGu's Blog has some really nice posts that get into the details of ASP.NET MVC.

jQuery's site has a lot of nice documentation on what jQuery is and how it works.

Sunday, February 17, 2008

Seam Carving

Isn't it annoying when you re-size a web page with an image in it and it doesn't re-sizes with the page. Or when you need an image to just shrink and look good without contorting or looking squeezed and you have to whip out the old Photoshop to fix it. Well your wishes have been granted. You can thank Shai Avidan and Ariel Shamir for creating a new image resizing algorithm that fixes all that and a bag chips, its called Seam Carving. The algorithm is amazing. Its almost spooky just looking at it work. You can squeeze an image down to half the width and it still looks good and preserves all the detail. You can even stretch a landscape image and give it a panoramic look.

You just won't believe it until you see it in action.
Check it....


I can see every browser, photo-editing and even video editing software using this technology. By the looks of it I think it might be open source.

Here are some libraries and applications so that you can start using it with your projects.

Seam Libraries & applications

  • C Library

  • .NET Library

  • C++ Library

  • Resizor

  • Saturday, January 26, 2008

    Does Windows=Evolution?












    Windows gets a lot of flack for being this monstrous OS that is just constantly being patched and updated with security fixs and feature updates. But maybe this is the natural way of building a rebust and agile system. I come across this reliazation after reading this very good article over at SEED called Algorithmic Inelegance.


    In flies, those paradigmatic models of genetics and development, that process of elaboration has been carried to an extreme. Any algorithmic elegance in the ancestral arthropod has been lost in favor of detailed, segment-by-segment hardwiring of the specification of the body plan. If a fly were software, it's software that has been patched and patched, and patches have been put on patches, until almost all vestiges of the original code have been obscured in the tweaks. It's the antithesis of planning and design—it's ad hoc co-option and opportunistic incorporation of chance enhancements. It's evolution.

    Does this sound a little familar?

    Now I'm not saying that Windows is totally devoid of direction.
    Of course some would disagree with that. But the symalarties with evolution is scary.

    Thursday, December 20, 2007

    IE8 Passes the ACID2 Test!


    Well the word is out. The IE8 Team has just officially announced that they have rendered the "ACID 2 Face" in I8 Standards mode. This is HUGE!! Finally no more workarounds or hacks on your CSS. Passing the ACID 2 test basically means that the browser follows the W3C HTML and CSS 2.0 specifications. The announcement also talked about supporting the many different types of users and older web pages. I think the IE8 Team has another trick up its sleeve and will later reveal a backward compatibility mode for older sites so that standards and nonstandard sites will work in IE8.

    Good job IE8 Team!

    Tuesday, December 11, 2007

    SharpDevelop IDE

    About 2 years ago I went on a search for a zip library because the .NET Framework at the time did not have one. I found this really nice zip library that came from the SharpDevelop IDE project. At the time the SharpDevelop project was pretty basic and they were at version 1.1. Well things have really changed since then. They have added some really cool features such as multiple framework support, refactoring, Subversion integration and Mono support.

    Here's a list of some of the features...

    • Open source, LGPL licensed

    • Write C#, ASP.NET, ADO.NET, XML, HTML code

    • Forms designer for C#, VB.NET and Boo

    • Code completion for C#, VB.NET and Boo (including Ctrl+Space support)

    • Integrated NUnit support plus code coverage (NCover)

    • Multi-framework support (.NET 1.1 and 2.0, Mono, Compact Framework)

    • XML Editing (source and tree view) with XPath search

    • Subversion integration

    • Code template support

    • Easily extensible with external tools

    • Re-host SharpDevelop with SDA

    • Easily extensible with Plug-Ins





    If your looking for a Free alternative to Visual Studio or even a Windows Mono IDE this is a very good alternative.

    Friday, November 30, 2007

    Silverlight 1.1 upgraded to Silverlight 2.0


    Microsofts Silverlight is a cross platform and cross browser version of the .NET Framework. That's right folks it runs on Windows,Mac & Linux.

    First quarter of 2008 they will be releasing Silverlight 2.0. This release has so many new features that they decided to up the number from 1.1 to 2.0.

    Here is a break down of the new features...

    WPF UI Framework: The current Silverlight Alpha release only includes basic controls support and a managed API for UI drawing. The next public Silverlight preview will add support for the higher level features of the WPF UI framework. These include: the extensible control framework model, layout manager support, two-way data-binding support, and control template and skinning support. The WPF UI Framework features in Silverlight will be a compatible subset of the WPF UI Framework features in last week's .NET Framework 3.5 release.

    Rich Controls: Silverlight will deliver a rich set of controls that make building Rich Internet Applications much easier. The next Silverlight preview release will add support for core form controls (textbox, checkbox, radiobutton, etc), built-in layout management controls (StackPanel, Grid, etc), common functionality controls (TabControl, Slider, ScrollViewer, ProgressBar, etc) and data manipulation controls (DataGrid, etc).

    Rich Networking Support: Silverlight will deliver rich networking support. The next Silverlight preview release will add support for REST, POX, RSS, and WS* communication. It will also add support for cross domain network access (so that Silverlight clients can access resources and data from any trusted source on the web).

    Rich Base Class Library Support: Silverlight will include a rich .NET base class library of functionality (collections, IO, generics, threading, globalization, XML, local storage, etc). The next Silverlight preview release will also add built-in support for LINQ to XML and richer HTML DOM API integration.

    This should spur a major migration from applications that would have been built on the desktop to be moved to the web. I'm really interested in what kind of performance this new framework will have and how far you can push it in terms of size. I wonder if there is a built in asynchronous framework to handle calls to different web services.

    The blurry line between desktop application and web app has gotten a lot bigger.

    Sunday, November 4, 2007

    Single & Multiline TextBox with MaxLength Validation

    After doing a bit of searching online I couldn't find an easy way to control the character length in a text box and a multi line text box. Plus the limit is defined by the schema of the table in a database. So I did what any developer would do with this problem. I used it as an excuse to write some code!

    Here is one example of limiting characters in a text box or a multi line text box in a asp.net form. This example will also show how to add a dynamic warning message once the limit has been reached.

    This example has 3 parts.

    • A Stored Procedure

    • Some C# code

    • A Javascript function



    Lets get into the code!

    Create the stored procedure

    CREATE PROCEDURE [dbo].[GetFieldWidths]
    (
    @TableName nvarchar(40)
    )
    AS
    BEGIN
    SELECT COLUMN_NAME,
    CHARACTER_MAXIMUM_LENGTH,
    DATA_TYPE
    FROM
    INFORMATION_SCHEMA.COLUMNS
    WHERE
    TABLE_NAME = @TableName
    END
    RETURN

    Create a C# function to read all valid fields widths into a Generic Dictionary Collection.



    // helper function
    public static Dictionary FieldWidths
    {
    get
    {
    System.Web.HttpApplicationState ApplicationState = HttpContext.Current.Application;
    if (ApplicationState["cDatabase.Tables.tblUsers.FieldWidths"] == null)
    {
    ApplicationState["cDatabase.Tables.tblUsers.FieldWidths"] = cDbaseFunc.FieldWidths(tblUsers.TableName);
    }

    return ApplicationState["cDatabase.Tables.tblUsers.FieldWidths"] as Dictionary;
    }
    }

    // main function
    public static Dictionary FieldWidths(string Table)
    {
    //Load field types
    string[] aryStringTypes = new string[6] { "char", "nchar", "ntext", "nvarchar", "text", "varchar" };
    List StringTypes = new List(aryStringTypes);

    Database db = DatabaseFactory.CreateDatabase();
    DbCommand dbCommand = db.GetStoredProcCommand(cDatabase.StoredProcedure.GetFieldWidths);
    db.AddInParameter(dbCommand, "@TableName", DbType.String, Table);
    IDataReader dr = db.ExecuteReader(dbCommand);

    string FieldName = string.Empty;
    int FieldLength;
    string FieldType = string.Empty;

    Dictionary FW = new Dictionary();
    while (dr.Read())
    {
    FieldType = dr.GetString(2).ToLower();
    if (StringTypes.Contains(FieldType))
    {
    FieldName = dr.GetString(0);
    FieldLength = dr.GetInt32(1);
    FW.Add(FieldName, FieldLength);
    }
    }
    dr.Close();

    return FW;
    }

    Create the Javascript function that limits the characters and creates the dynamic message.



    function CheckCharMaxLenLimit(control,maxlength)
    {
    var ErrorMsgID = control.id + "_$MAXLENGTH_ERROR_MSG$";
    var ErrorMsg = document.getElementById(ErrorMsgID);

    var MaxLength;
    if(maxlength != null)
    {
    MaxLength = maxlength;
    }
    else
    MaxLength = control.maxLength - 1;

    var TextLength = control.value.length;
    if(TextLength > MaxLength)
    {
    control.value = control.value.substring(0,MaxLength);

    if(ErrorMsg == null)
    {
    control.outerHTML = control.outerHTML + MaxLength + " character limit!";
    }
    }
    else
    {
    if(ErrorMsg != null)
    ErrorMsg.parentNode.removeChild(ErrorMsg);
    }
    }

    The final step is too attach the javascript function to your text box control "onkeyup" event.
    You can do this in the code behind like so....
    this.txtUserName.Attributes["onkeyup"] = "CheckCharMaxLenLimit(this," + this.FieldWidths["Username"] + ");";

    Summary


    The nice thing about the C# function is that it caches the returning list of fields and widths into an Application State variable. If your tables schema changes allot you could always cache it in a session state variable. This reduces the hits to SQL server which improves performance.

    The character limiting and checking is handled on the client side using the javascript function. This function also supports the "maxLength" attribute of the text box control. The dynamic message is also created on the client side by using the DOM to attach a child element to the text box. This creates a very quick UI response. Lastly the dynamic message can be formatted using standard CSS.

    Like so...
    .MAXLENGTH_ERROR_MSG
    {
    color:red;
    }

    This method uses SQL2005 but I'm sure it could easily be used with any database platform. I hope this helps someone out there with the same problem.

    Monday, September 24, 2007

    Top 10 IIS 7 changes

    If you don't already know Microsoft uses there own applications while still in beta on there production servers. Right now www.microsoft.com is running on the beta 3 Windows Server 2008 and the beta 3 of IIS 7. The 2 products are very stable and are in a functional release.

    Here are the top 10 major changes in IIS 7...


    • Simple, Configurable Command Line Setup

    • Great Compatibility with older asp apps

    • No More Metabase!

    • Centralized Configuration

    • Delegated Configuration

    • AppCmd and Other New Management Options

    • Failed Request Tracing

    • Request Filtering

    • UNC Content

    • Output Caching of Dynamic Content




    IIS 7 Totally modular


    Get more details here..

    Wednesday, September 19, 2007

    SQL Server 2008 Spec sheets are OUT!!

    Well it looks like Microsoft has released the new spec sheets on SQL Server 2008 and man there is a lot of sweet stuff they have added.

    Here are the highlights..

    • Policy-based Management
      A framework that enables policies to be defined for explicit and automated administration of server entities across one or multiple servers.


    • New Language Integrated Query (LINQ) extensions
      This enables developers to be more productive by working with logical data entities that align with business requirements instead of programming directly with tables and columns.


    • Beyond relational data
      New data types such as a geospatial type, filestream type, 4 new data & time types and a Hierarchy ID type have been added.



    Another really cool feature that will help in the swelling of database sizes is the addition of Sparse columns. Its a highly efficient way of managing empty data in a database by enabling NULL data to consume no physical space.

    I'm sure all the GIS nerds out there are chopping at the bit to get there hands on the new geospatial functionality. Well its here and it looks very promising.

    Check out some of the features below...

    Comprehensive Spatial Support

    • Work with geodetic and planar data types
      Implement Round Earth solutions with the geography data type; using latitude
      and longitude coordinates to define areas on the Earth’s surface. Implement
      Flat Earth solutions with the geometry data type; storing polygons, points,
      and lines that are associated with projected planar surfaces and naturally
      planar data, such as interior spaces.


    • Build on industry standards
      Import and export spatial data in industry-standard formats, such as Well
      Known Text, Well Known Binary, and Geographic Markup Language (GML).


    • Perform spatial operations
      Use the methods provided by SQL Server 2008 spatial data types to write
      Transact-SQL code that performs operations on spatial data, such as finding
      intersections between geospatial objects and distances between locations.


    High Performance Spatial Data Capabilities

    • Store large and complex spatial objects
      Use the spatial types in SQL Server 2008 to accommodate spatial objects,
      regardless of whether the objects are simple or very complex.


    • Build high-performance solutions with spatial data indexing
      Enhance query performance by using indexes for spatial data that are
      integrated into the SQL Server database engine. Take advantage of accurate
      query optimizer cost assessment for spatial queries that can determine the
      optimal query plan and identify appropriate index selection.


    • Consolidate relational and spatial data in business applications
      Use the native support for spatial data types in SQL Server 2008 to
      seamlessly incorporate spatial data into line-of-business applications.



    Geospatial Application Extensibility

    • Build spatial solutions of any scale
      Take advantage of spatial support in multiple editions of SQL Server 2008,
      from SQL Server Express to SQL Server Enterprise Edition.


    • Use spatial standards support to integrate applications
      Leverage a .NET-based geometry library that supports OGC standards. Build
      applications that consume and manipulate spatial data. Integrate with
      geospatial services, such as Microsoft Virtual Earth™, to build
      comprehensive location-enabled solutions that render your spatial data for
      display.


    • Benefit from spatial community support
      Take advantage of spatial products and services offered by Microsoft
      partners that integrate with SQL Server 2008.


    These are just the highlights. There is a ton of additional enhancements and features they've added that's really worth looking at.
    Get more info here...SQL Server 2008

    Monday, August 13, 2007

    AJAX Loading

    Recently I was building an AJAX site and needed an animated gif. To show that something was processing in the background. I ran across this gem of a site that lets you create custom animated gifs. www.ajaxload.info You can pick up to 35 different kinds of animations and choose there background color and foreground color. Plus make them transparent.

    Check some of these out...









    Pretty cool!

    Sunday, July 29, 2007

    Singularity v1.0

    Looks like Singularity has reached the first release stage.
    This is a project that Microsoft has been working on for a while, since 2003.
    It’s basically a research OS prototype answering the question, "what if you built an OS with dependability and trustworthiness at its core from the ground up".

    Here are some of the items the Singularity team is working on.

    For example, Singularity uses type-safe languages and an abstract instruction set to enable what we call Software Isolated Processes (SIPs). SIPs provide the strong isolation guarantees of OS processes (isolated object space, separate GCs, separate runtimes) without the overhead of hardware-enforced protection domains. In the current Singularity prototype SIPs are extremely cheap; they run in ring 0 in the kernel’s address space.


    I think the best thing about this new OS is the SIPs (Software Isolated Process).
    Every program, device and system extension gets its own SIP.

    Imagine this scenario...
    You go out and buy some cheap ass web cam, printer or any external device and plug it into your machine. You install the drivers and restart your pc.....BAM!!! Blue Screen of Death



    Your new cheap ass device just killed your OS because drivers are first class citizens and have hooks into the kernel. This scenario could not happen in a Singularity based system. In a Singularity based system the device would have its own memory space. There is no memory sharing or modifying of its own code. Every SIP gets its own data layouts, run-time system, and garbage collector. If this happened, in a Singularity based system, it would just die in its own little memory space and the rest of the OS would not be affected. Once the system finish booting, the OS can just tell you which devices have not booted and would you like to uninstall them.

    I guess the other coolest part about this OS is the new language built for it called Sing#, which is an extension of C#. This language has first-class support for OS communication primitives as well as strong support for systems programming and code factoring.

    Too get more info on Singularity check out their page... Singularity

    Also here’s a really good white paper that goes into the specs of the whole system here.