Showing posts with label Jibran Jamshad. Show all posts
Showing posts with label Jibran Jamshad. Show all posts

Friday, March 6, 2009

Installing SQL Server Compact Edition on Wondows based Mobile device

Yesterday, i had some fun playing with SQL Server compact edition and installing it to my windows based mobile deivce, simple steps required to perform are:


1) Download SQL Server Compact Edition
http://www.microsoft.com/downloads/details.aspx?familyid=85e0c3ce-3fa1-453a-8ce9-af6ca20946c3&displaylang=en


2) Install it to your machine (Simple Installation Process)

3) Once it is installed, you are required to copy a three cab files to your mobile and install them (Engine & Query Analyzer)

http://msdn.microsoft.com/en-us/library/ms171875.aspx
http://www.christec.co.nz/blog/archives/253
http://msdn.microsoft.com/en-us/library/ms172361.aspx
http://msdn.microsoft.com/en-us/library/ms171773.aspx

4) To connect your mobile device to your PC you need ActiveSync software
http://www.microsoft.com/windowsmobile/en-us/help/synchronize/device-synch.mspx

5) On every step do visit the link posted under it.. Good Luck :)


Play with Query Analyzer on your machine, Connect your compact edition from SQL Server Management, BI and Visual Studio environments...
http://www.devx.com/MicrosoftISV/Article/34341

Tuesday, March 3, 2009

Semantic Web, What difference will it make ?


No doubt ! Web 2.0 has been a great turnaround in the history of web computing, technologies like AJAX, RIA, SOA, CSS, Silverlight, Mashups, Web Slices, RSS and XML have been the front runners for this newer version of web. Products and Services like Facebook, Flickr, iTunes, MapQuest, Windows Live, GoogleMaps, Virtual Earth, YouTube, Orkut etc have not been possible without the advent of Web 2.0.

However on the other hand it gives me a feeler that these Internet Applications, Community based websites, Photo Albums, Rich Maps, Blogs and Video based portals just gave the Web a great look and feel on both the application design and performance scales. However, they did not contribute towards the robustness and intelligence of the engine itself.

I am one of those learners of the modern web who claim Web 2.0 to be the “people oriented web” and Semantic Web to be the “machine oriented web”.

During your university coursework, you are convinced with thousands of examples which highlight the importance of the application of data mining, machine learning, software agents, logic based programming, constraint based Programming, P2P and grid computing in our computer program and systems. We all agree on how Machine Learning can find hidden patterns and discovers the facts which would never have come out of the terabytes of the data within an Enterprise. Grid computing can easily share the processing workflow amongst multiple physical machines and saves you cost and time. Software agents deployed on the target machines have the ability to learn and make decisions based upon logical reasoning without the knowledge base. When it comes to the real world application you will definitely find these implementations but in a limited scope and mostly on private systems such as an airline software, medical research tool, analytic software, a robotic solution etc. Hence, here one thing is pretty much clear that we have the concepts in grip and there is an implementation as well but the scope is pretty limited and is segregated.

However the case would have been strong if the scope had not been limited and such implementations would have been the part of the World’s largest and fastest growing network, which resides billions of web pages, targeting millions of users, catering thousands of businesses categories, developed using hundreds of various modern tools and technologies, the Internet. Unfortunately the current structure of the Web is targeted towards the people and focuses on rich, user friendly and robust applications but completely ignores the concepts such as data mining on the Web, which has been the core implementation coming out from the concepts of machine learning, logic based programming and software agents.

The current shape of web is quiet unstructured where it has various of web databases, service engines and representation formats which makes searching and comprehending the web a challenge. For the web to reach its full potential, we need to improve the service engines, develop data structures behind the code, align the data presentation formats, data mining and machine learning techniques are to be applied in order to search and find only the useful and relevant patterns, as only a small portion of web pages contain useful and required information.
In a nutshell, the Internet is the world’s largest data store and after typing your query in a search engine, within fraction of a second you are shown thousands and thousands of results, with no guaranteed reliability and success prediction because we have not laid any design and structure of our web portals and there is no machine level information exposed for web crawlers, on which any logical reasoning can be done. There is also a lack of automatically created directory structures, and semantic based query primitives are yet to be worked on.
Hence data mining on the Internet is a necessary ingredient of an intelligent web which works with logical reasoning’s, automated decision making and brings in more relevancy to search but unfortunately it is nearly impossible with the current version of web which is just a stack of HTML pages.

How the Semantic web would likely work?
1. What are the world’s significant events in the last decade?
2. Dentists available on Tuesday’s in Parklane hospital?
3. Phone Number of KFC’s NYC branch?


Finding such an information in a local database is a game of few queries but what happens when you want to explore the whole web network to find your relevant information, how do you tell the web that KFC is a fast food restaurant and NYC is a place in New York which is a part of America, so kindly bring the phone number of this particular entity?. .. For this you need to have some sort of design and information presentation mechanism on web and that’s what Semantic Web has brought!

Key requirements for your web to be smart enough:

1) Provide information in expressions which can be understood and comprehended by the machine. The engine knows where the information for its use lies and what the format is so that it can be parsed equivalently.

2) Represent the data structures in knowledgeable formats such that when you want to express Area, it will be a sub class of City whose parent will be Country and so on, and assign data attributes to Area such as Name, Area, Population, Geographical Location etc.

3) Introduction of ontologies and Taxonomies such as a Software Developer and Software Engineer both fall on the same horizontal level in a Software house staff’s hierarchy and both report to a Project Manager. Computer can only know this if you present alternate words for the same thing in its knowledge format i.e. build ontologies and express the relationships between the different classes and their objects falling in a the hierarchical or vertical structures.

How we can actually achieve the above three requirements and how the presentation of the data and knowledge structures is done on the semantic web, and what tools and technologies will come in to action ? ...... stay tuned!

Handling ASP.NET Browser Refresh

Introduction

For years, most ASP.NET developers have been coming across the scenario where hitting the browser's refresh button or pressing the F5 key performs exactly the same steps last performed by their .NET code. To be short and simple, let's create a scenario where I have an ASP.NET application that has a form called Add Customer. This form has a button on it and when the user clicks that button, a customer is added to the file. If the user again hits the Add Customer button, another customer is added to the file. However, if the user presses a refresh button or hits F5 key at this point, exactly the same scenario will be repeated and one more customer is added, as well. Hence in ASP.NET whenever you hit F5, .NET repeats its last action. This happens even when the F5 event is not a genuine post-back event. Needless to say, developers want to get rid of this.

Background

The same problem was faced by my colleague a few days back. We tried a lot searching on the Internet, where we found a few solutions, but those were either just the pseudo-code -- i.e. not properly working -- or something like a hit-and-trial. A few of them jumped straight across the head. Unfortunately, there was not a single solution that could be easily implemented in ASP.NET and justify itself.

After two days of searching on the Internet, I came up with just a little clue, although I don't remember the reference. It suggested that we could distinguish between a genuine post-back request and the one generated by browser's refresh. All server-side events that get fired on the post-back get fired on refresh also, but fortunately there exists one event, onsubmit, that only gets fired when there is a genuine post-back request. It is the client-side event of the form placed on your web page.

Using the code

The logic of the following code is to have a hidden control on your web form and every time there is a genuine post-back request, the client script just appends one character to the existing value of that hidden control. At the server side, I take a shared variable that will retain its value through the application's life, i.e. it won't be written off on every page load.

The first time the page_load event is executed, I assign that shared variable the value of 1. As I've stated, the main task is to distinguish between the genuine post-back request and the refresh one on the Add Customer button. The simple logic is that if it is the first time the event has been executed, then my shared variable will be 1. If it is not the first time, then the character length of the hidden control will be one more than its previous length. I can easily obtain the new length of the control from len(control.value).

Then every time a customer is added, I assign the current control length to that shared variable. Hence, the next time a customer is added, your length should be one more than that of the last time. At every genuine post-back request, a value is appended to the current value of the hidden control in the client-side script, called upon at the onsubmit event of the form.

JavaScript

Visual Basic
Points of interest

This solution is appealing in that it is NOT asking you to play with complex things like HTTP headers, HTTP modules, setting sessions from the client, keeping unwanted checks on the code and database level, etc. It can also be applied to any scenario and in any version of ASP.NET where users are facing similar problems. Its solution is very simple and can be understood and applied even by a developer who has just started working with the technology.