Archive

Posts Tagged ‘microsoft’

Building database and web service driven asynchronous google map application

May 22nd, 2007

Map API could help build very cool mashup websites.  Often times a back end database is the source of the objects to be drawn on the map and querying for those objects from the database based on the parameters the users choose on the website (e.g., state, city, search criteria) gets complex.  Also to improve the user experience, asynchronous map loading is desired so that while the next batch of objects is being retrieved from the server, the current ones on the map could continue functioning.  To address all these challenges and build a smooth database driven asynchronous loading map application, web service can serve as the bridge between the server side complex data model and the client side map drawing logic.  The following describes the steps of implementing such architecture and a sample code project created in Visual Studio (free version could be downloaded here).  This time, I played with Google Maps API.

ws_map.jpg

Firstly, set up a basic ASP.NET AJAX-enabled web site through the Visual Studio wizard.  You may need to download the AJAX extension from http://ajax.asp.net/.  Inside Default.aspx, add a div in the body like the following to host the map

<div id="map" style="width: 90%; height: 600px; margin-left:auto; margin-right:auto"></div>

Reference the google api javascript source and your own javascript file (e.g., gmap.js where the client side mapping code is located) in the head section.

Next is to prepare the data on the server side.  It is actually much easier to set up a relational database in Visual Studio by a just few clicks and there are tons of such examples on the web.  So here let’s try a slightly trickier scenario where we only have a static plain text CSV data file (e.g., exported from an legacy system or Excel spreadsheet) that contains various cities and the fun places in them to be drawn on the map.  Add that data file (e.g., mapdata.csv) under the App_Data/ folder in the solution explore.  Assume the data file has 3 columns State, City, and FunPlace.  Now create a web service (e.g., MapDataWebService) to extract the data from the CSV file and serve to the client side mapping code.  To add this web service, right click the project in the solution explore, select "Add New Item…", select "Web Service", and then rename the file name into "MapDataWebService.asmx".  The web service skeleton is automatically added under App_Code/.  Open it and add 2 web methods getAllStates() and getFunPlacesByState(string state).  The former is used to populate the dropdown on the web page to select a state and the latter is to get the fun places of the selected state.  Both methods connect to the data file through OLE DB and query the data using convenient SQL syntax.  To quickly unit test the web method, you could open MapDataWebService.asmx and press F5 to run the web service alone.

The return value of getFunPlacesByState(string state) would be an array of objects (type of class Place), each of which contains the latitude and longitude of the city and the name of the fun place in that city.  The class Place is the object oriented representation of this information.  The web service will return the objects to the JavaScript caller.  In order for the caller to get the consistent objects and dereference them the same way as in C#, the following directive should be added to the top of the web service code and a reference to the assembly System.Web.Extensions.dll needs to be added to the solution too.  If you don’t have this assembly already installed on your machine, you could download and install "ASP.NET Ajax" from http://ajax.asp.net/.


using System.Web.Script.Services;

    [ScriptService]
    [GenerateScriptType(typeof(Place))]
    public class MapDataWebService : System.Web.Services.WebService
    {
….
    }
    public class Place
    {
….
    }

After the data service is created, the getAllStates() web method could be used to build a data source to populate the dropdown list.  Drag and drop a dropdown list onto the Default.aspx, select to create a new data source from its context menu, choose object as the type, MapDataWebService as the business object, and getAllStates() as the SELECT method.  The data binding is automatically done.  Add an onchange event handler to this control to trigger the mapping function (e.g., drawMarkers) and we are almost done.

The last step is to implement the mapping method drawMarkers() in gmap.js.  It retrieves the state that the user chose in the dropdown and use it as the parameter to call the web service method getFunPlacesByState(state) asynchronously.  The callback function will receive the resulting list of Place objects and then use the Google maps API to draw them on the map.  To successfully make the web service call from JavaScript, it has to be registered in the Default.aspx like the following.

<asp:ScriptManager ID="ScriptManager1" runat="server">
    <Services>
        <asp:ServiceReference Path="~/MapDataWebService.asmx" />
    </Services>
</asp:ScriptManager>

To make it more fun and improve the user experience, during the async web service call, a spinning progress icon could be display indicating that the data is being loaded.  Overall, no whole page loading is done and web page looks better.  If you are interested the sample solution and code can be downloaded GMapExample.zip.  Before you can compile and run this web site, go to http://www.google.com/apis/maps/ to register your API key and replace the place holder "YOUR_API_KEY" in file Default.aspx and App_Code/MapDataWebService.cs.

By the way, a comment about Google Maps API.  The markers manager is a convenient way of aggregating all the markers, but removing objects from the manager seems buggy.  Whenever the map zoom level is changed, all the removed markers come back on the map.  The markers in the manager are not controlled by the map.removeOverlay() either.  Other than that, the API works pretty well.

Sample code download: GMapExample.zip

Web , , , , , , , , , ,

Difference in Paradigm: Open Source .vs. Microsoft

April 28th, 2007

One can enumerate hundreds of difference between software from open source community and companies like Microsoft.  There are fundamental things that cause the difference – the paradigm of programming, the architecture of software family, and development productivity, etc.

On the server side development platform for example, popular open source tools are the well known LAMP.  Four pieces are done by totally different groups of people, on different time schedule, and with different design style.  They are all good products without doubt.  They work together very well for sure too.  Coding something on LAMP feels super geeky, because you control everything from top to the bottom.  Commercial software makers like Microsoft have some different considerations.  For good manageability, installation, configuration, migration, and so on mostly have easy to use (at least try to) GUI.  For productivity, many of the routines are abstracted and hidden away from the application developers.  For example, in ASP.NET, post backs, event handler registration, page templating and all those kind of wiring work is hidden.  Writing server side code feels more straight forward like writing desktop application.  ASP.NET really evolves from a programming language up to a server side framework.  With the Visual Studio .NET’s help like IntelliSense, debug tracing on both server and client side, visualized server control customization with sample data, and so on, developers are more free to focus on the business logic of the software, which is critical for business.

Talking about the hot AJAX.  Interestingly this technology was started by Microsoft when building the outlook web access.  Because it is majorly for business rather than the consumers on the Internet, it didn’t surface that much until Google Suggest and Maps made the splash with it.  To code in AJAX there are a lot of plumbing work underneath to wire up the connections between the client side scripts and the server side handler, AJAX for ASP.NET wraps all these up and provide a few straight forward abstract controls to improve the productivity of the application developers.

There are debates in many companies and organizations about Wiki and SharePoint too.  Again like the comparison between PHP and ASP.NET, SharePoint is more of a platform that contains Wiki features and many other capabilities.  Wiki starts out to do collaborative web content editing, while SharePoint is designed to be the collaboration platform which integrates with Office suites, workflow, enterprise search engine, content management, SharePoint Designer (visual design tool), etc.

Open source software products are simple, developer-enjoyable, and inexpensive upfront.  Commercial products are more business friendly, enterprise infrastructure oriented, productiviey oriented (sometimes productivity and developer-enjoyable are not well aligned :) ), and more expensive upfront.  They have much difference in the fundamental design paradigm.  Comparing the two different types of products really depends on the specific requirements rather than a religious belief.

Tech , , , , , ,

Live Maps launches new version with Firefox support for 3D

April 3rd, 2007

clipped from liveside.net

A new major revision of Live Maps was released today, with a number of new features and enhancements. At the top of the list is Firefox (v 1.5 or later) support for 3D mapping. In addition, memory management and cache performance has been improved for the IE version. 3D support is now also included for the Space Navigator, a 3D controller made by 3dConnexion, a Logitech company.

  powered by clipmarks blog it

This release really has a few very desired new features. Not being compatible with Firefox is a popular complaint about Microsoft’s web services products. This is a good answer. Hopefully, the browser compatibility issues could be addressed at the very beginning of the future new product release, so that the public image of being IE-biased can be wiped off and gain more traction over the net.

This new release also enables inserting maps and driving directions into the emails and meeting appointments created in outlook. It is even considerate to block the driving time for the meeting too.

A feature that I have been longing for is the organization of scratch pad. However, still doesn’t seem easy to move the push pins over to a different collection.

Web , , , ,

InfoNow switches to Microsoft’s Virtual Earth

March 29th, 2007

This is an important step of Microsoft’s Virtual Earth improving its branding awareness and could also potentially lead to more value added features to live local search. Virtual Earth comes later than MapQuest, Yahoo maps, and Google Maps, but it does has some nice features like 3-D view, 3-D building model, birds eye view, and my favorite feature Scratch Pad where you can store your favorite locations of restaurants, stores, and so on under different categories. This way you don’t have to type in addresses you may check on the map from time to time and you can also conveniently share interesting locations with your friends through email or blog posts. It also showes real time traffic data and road incidents, which could be viewed on your cell phone or GPS to optimize your driving. The push pin is a cute tool too to enable you to mark any location where there is no valid address. There are lots of aspects that Virtual Earth maps needs to improve too though. For example, once I check the driving direction. The route Virtual Earth gave me looks optimal and shorter than the the one I got from Google maps, however in reality the shorter route is mostly through very narrow streets with lots of stop signs. Obviously, the "convenience" of the the streets that are picked for the routing is not weighted enough in Virtual Earth. By the way, if you are interested you can try out the Virtual Earth plugin for MovableType. It’s fun to play with the 3D map on your blog.

read more | digg story

Web , , , ,

Zimbra – Offline Web Office and Collaboration Suite

March 28th, 2007

Zimbra Goes Offline With Zimbra Desktop

The history is once again recurring. Off-line application, then online application, and then "off-line application" again. But rather than circling, this is an evolution in a rising spiral style. When Google online web applications take on Microsoft Office and there is heated discussion about their comparison, this third approach is emerging. Although Google enjoys the buzz of its branding and pricing, web apps still has many limitations like rich UI, performance, security, difficult admin maintenance due to frequent incremental software change, and so on. Off-line ajax solution answered some very important challenges of web apps. For example, the not yet pervasive and stable Internet connection, page latency, and UI responsiveness. This helps narrowing the gap between the web apps and traditional desktop apps.

From server client model’s point of view. The same recurring phenomenon is going on. Single machines, main frame, distributed systems, peer to peer systems, web applications running on central servers, and now off-line web applications. The big difference is the placement of software components and the global computing environments and infrastructure – majorly Internet.

From hierarchical architecture’s point of view, the off-line web application is a more sophisticated caching model which involves not only static data like web pages and cookies but also software components and application states that run independently on the client machine without any help from the mother ship – servers. This has a load of benefits. For example, performance will improve a lot. "Off-line" is not only used when the network connection is off. Software components and state is cached locally and reduced a large portion of the server-client interaction round trips, especially those bulky post backs. Users data are better maintained locally and is immune to page load failure due to temporary connection problems.

Off-line mode is a significant innovation, but most of the rest of the system is more or less copy from Microsoft Office and/or Google Apps. But it’s always like that, new startups who come up with a product, 10% of which are new ideas, are regarded innovative, but the big guys who come up with a similar product are still regarded as copy cats :) The expectations for them are quite different. The world is flattening and so does the computer software industry. These emerging new products are pushing the software moving forward faster.

Web , , , , ,

Microsoft’s Vista-Live Strategy Already Impacting Google

March 22nd, 2007

Windows Vista is finally out and along with that Microsoft seems to have kick-started its Vista-Live joint initiative. This initiative aims to push Microsoft’s new web properties in tandem with their dominant Windows operating system – and so become a leader in the web industry as well. Basically this means that Microsoft makes its Windows Live web properties the default in Windows Vista PCs, where possible – for example Live Search is the default search engine in IE7 on new Vista machines.

 

Measuring Vista’s impact on Microsoft web properties

 

Live.com:

 
 

MSN.com:

 
 

Measuring Vista’s impact on Google web properties

 
 

As a final note, Alexa competitor Compete’s results are in parallel with ours. According to Compete, these giants all have an increasing trend in page views, but Google’s slope is apparently lower than those of MSN and Live.

  powered by clipmarks blog it

The users of Vista or IE7 not only can install the google tool bar with a single click when going to the google homepage, but also can easily add google as the default search provider without even visiting the google homepage or installing the google tool bar. As shown on the picture in this article, click the little drop down right next to the search button and you can "Find More Providers…", in which google is there. Simply click it and google is added and you can also set it to be default.

In terms of search relevancy, I still think google is better, especially when I look for coding related reference materials. Google is faster in the time it takes to index a newly created web page and more frequent and sensitive in adjusting the rankings. Live search however is better in the overall search experience. For example, the color theme looks more comfortable. The "related searches" on the right side of the result page is very helpful. The image search is very nice with infinite scrolling bar and scratch pad. In the academic search, users can adjust the level of detail in snippets. The 3D map is also impressive. (try adding 3D maps to your Movable Type blog using my plug-in) At this moment, for average users, a little bit less performance in relevancy might not be that obvious but the overall search experience and the richness of the features might be more attractive.

It will be a very tough job to compete with google in search engine market. They quietly accumulated 5+ years of experience before they became the hot company and search is their major business. Brand recognition is also on google’s side. Keep up improving, Live Search! Competition makes the industry advance more rapidly. If you are interested, you can check my Internet Dashboard page where I’ve aggregated some search engine comparison real time diagrams and I’ll keep adding more related charts and diagrams there.

Search Engine , , , ,

Possible Google Phone?

March 14th, 2007

More Pictures Of Possible Google Phone?

Wireless platform would be the next battle field of searching. The day of "technology" is past. In those days computers and software were invented to help people do more things faster. Those things is mostly about information processing. Given a bunch of input and the computers will follow the instructions embedded in the software and produce the expected results. When network was invented to connect computers, it was about transmitting information faster on a much wider scope.

Today, with the already advanced computing and world wide web as the infrastructure, almost all computer technologies are about information and people. Finding the right intelligence and talents. Sitting in front of a desktop or looking for a Wi-Fi hot spot for laptop connection is not efficient enough. A more mobile and slim device is more desirable, so that information is right at the tip of people fingers. Integration of wireless devices and Internet services would be really attractive. I’m imaging the future information searching is pervasive. For example, when you are talking with your friend on the phone and trying to set up a time to go lunch together in a new restaurant. The wireless phone will extract keywords and address from your conversation and you could ask the phone to create this appointment by either pressing a button or saying some voice command. After confirming this appointment, map and driving direction is created too. And you could use it as a GPS to guide you to the venue.  With search-enabled wireless phone, you can also ask the phone to find the closest drug store or coffee shop just by talking.  The search-enabled phone could also be your assistant when you are talking with your friends.  When you do not agree with some ideas in your conversation, ask the phone to do a search on the fly and join your conversation by telling you what it found.

Like partnering with computer manufacturers to pre-install search tool bars on the new computers. Wireless is another competition field. Moto Q with Microsoft Windows Mobile is out there. But I think there is still a lot that can be improved to integrate with Internet services. I look forward to seeing what google phone will bring us.

Tech , , , , ,

Search for pioneering computer scientist called off

February 20th, 2007

MercuryNews.com | 02/17/2007 | Search for pioneering computer scientist called off

Per Jim’s Search blog, the 3 week search is called off with no clue what happened to the database researcher. Thousands of volunteers helped searching Jim through spy planes, satellite maps, Amazon mTurk, etc. Jim is a Turing Award winner due to his distinguished contribution in database research. He also did a lot of interesting research of indexing the astronomy objects in the vast space. I still remember attending his talk on spatial indexing of the sky in the university and he is an extremely nice person to talk with. I wish him the best of luck. Hope miracle will happen.

Tech , , , ,

Windows Vista and Office 2007 launch

January 29th, 2007

Live at the Windows Vista launch event – Engadget

One day earlier than promised, the long waited Vista was launched today in NYC. When the kids pushed the big button, all big screens on the Time Square are displaying Vista. Thousands of balloons fell at the same time on the MS campus celebration party. Congratulations! It’s not a easy release.

The new version does improved in lots of areas. No need to repeat. You can see them here 100 reasons. The usability is basicly amazing. For example, in Outlook or Windows, type in a search term. The result come back almost at the same time when you are done typing. If you type multiple terms, it rolls out results on the fly while you are typing. This is the best part I like. Go vista!

Tech , , , , ,