Posts

Showing posts from 2012

Dijkstra's Algorithm in JavaScript

Image
I happend to read through a series of blog posts by Nicholas C. Zakas here -  http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1 . These are really interesting thoughts. So I decided to take it another step by implementing the shortest span/path solution using Dijkstra's Algorithm. A beautiful explanation of the algorithm is available in YouTube at -  http://www.youtube.com/watch?v=8Ls1RqHCOPw  - so that I can stay focussed on the implementation part. Now, let me walk you through the steps taken to implement the algorithm in javascript. First of all, I need to define the graph that I am going to traverse. The best way to represent the graph is in metrix form, where each of the entry will indicate the weighted edge from one node to the other. To do this in JS, I created an array of arrays, with a header element at the first row. Figure 1. The above graph can be represented as follows.     [['A',

Convert your ASP.Net app to Windows Azure

Image
Introduction  If you are excited about Windows Azure platform and wanted to see how your web application behaves in new cloud environment, this article is for you to follow step by step process to convert your app and move to cloud environment.     Prerequisite You will need to have an account with windows azure to host the app. You may also try the 30 day free pass as described in my  previous article . A list of required software is also available  here  to work with Windows Azure development. Steps I have created a sample website - MySite - to start with the demo. Below are the steps to deploy the same to Windows Azure environment. Step1 . Open the solution in VS 2010. Step 2 . Now we need to add a new windows azure project to the existing solution. So, right click on the solution add a new project. Step 3 . Choose "Cloud" from the installed templates and select Windows Azure Project. Type in a name - MyAzureSite. Step 4 . You will be prompte

Windows Azure Platform 30 day pass

Image
Did you know that you can get access to Windows Azure Platform for 30 days for FREE? Here is how you would be able to secure a 30 days pass for Azure Platform (NO CREDIT CARD required).   Click here  to launch registration site. Select country and enter Promo Code " DPCE01".  If you choose country anything other than USA, use " CloudCover"  as promo code (with no quotes on both case).     Use your Windows Live ID and sign in to continue to complete the registration process (You may sign up for a Windows Live ID if you don't have one). You will be asked to enter some details in Next page; enter your details, accept the term and Submit.    The process will take 2-3 business days to issue the access. Once your account is enabled to access Windows Azure platform, you will get an email with details.  Check back in  http://windows.azure.com , login with registered windows live ID, enjoy learning azure. Before you start: You may need to make sure

Semi Magic Square - math puzzle/game for Kids

Image
I released a new chrome app; a semi magic square puzzle/game for kids. A kind of teaching aid; this will help one to  improve basic calculation skills, logical thinking and problem solving ability. Check out the game  here!  -  https://chrome.google.com/webstore/detail/coojopacdihgabdoifobmhppmgogiinh . Also, the game is available in this web page  http://games.manikkothu.com/home/semi-magic-square , if you don't want to install chrome. Note: Imported from my site  https://sites.google.com/site/dhtmlexperiments/blogs/semimagicsquare-mathpuzzlegameforkids  dated  Mar 14, 2011

IIS Express - Host WCF service over SSL

Image
In my  previous article , I described about configuring virtual directory under IIS Express. Here I am going to explore about setting up a WCF service using iis express and setting the transport security over SSL. We'll go step by step.  Setup SSL If you have experience with setting up SSL on IIS, it is very similar on iis express, except you don't have an GUI tool support, you will need to use proper utilities to do it manually. In a high level, we will need to perform following tasks to achieve this. Get an appropriate certificate. Create an HTTPS binding on the site. Create a secure WCF service. Test the changes. Get an appropriate certificate :  There are two ways to choose from, if it's not important for an end user to trust your server you could use a self-signed certificate created on your computer. If you want your end user to be able to verify the server's identity with your certificate, then you can obtain a certificate from one of the known cer

IIS Express - Configure local website

Image
Recently Microsoft announced release of IIS Express - a simple version of IIS - which you can configure to run websites locally. Microsoft also released a simple web development tool, WebMatrix, in which IIS Express is integrated to serve the purpose of development web server.  Benefits of IIS Express include:  It has got same feature sets as of IIS production server Most tasks can be done with out the need for admin privileges It runs on windows XP and later versions In part 1 of this article, I am exploring how we can manually configure IIS express to point to my local web pages in a directory. First we will see how we can make it work in plain http, and then next step we will create a WCF and will host it over SSL.  IISExpress is available for download  here . Once you download install IIS Express, you will see all related files in the installation folder - normally, this will be under " C:\Program Files (x86)\IIS Express"  folder if you are installing th

Chrome Webstore- II : Just for Kids!

Few weeks back I released an  HTML5 game app  in Google chrome web store. You can find the related post  here . After that, I was playing with multiple ideas where one could potentially attract more users through a chrome or mobile app. So just thought of publishing a mini puzzle absolutely meant for Kids who just learned to count till 10. I would need some feed back from little masters about the game/puzzle and connect some of my thoughts about how we can make useful web applications with simplest technology available on your machine.  You could visit chrome web store here -  https://chrome.google.com/webstore/detail/fmiefkckhkeeggkfjjaocnlljbnlmnok   - and download the Kid's puzzle/game. I would love your feedback if you installed and played it! Note:   Imported from my site  https://sites.google.com/site/dhtmlexperiments/blogs/yetanotherchromeappjustforkids  dated  Mar 3, 2011

Image editing - HTML5

Image
I just did some experiment with very basic image manipulation using HTML5 APIs and JavaScript. In a nut shell, here is what I am trying to do. Load image in cavas element.  Extract the pixels using  context.getImageData  method.  Iterate through the pixels and edit/change Restore it back to cavas using  context .putImageData  method. Let's go one more level deep into  ctx.getImageData  method. context.getImageData method returns an ImageData object containing a copy of pixel data for the image loaded in canvas context. For example, if you have an image of 10 x 10 size (10px wide and 10px height) loaded in a canvas, you get an array of pixels representing this 10 x 10 size image. There would be a total of 100pixels in this image.  Each pixel is further divided into four units of RGBA (red, green, blue, and alpha) values, and these four values combined will give unique color & alpha property to one pixel. Here in this case, the total units in the ImageData would

Chrome Webstore - I

My first app in chrome web store...  This is the same bubble shooter game I created sometime back, now just moved to chrome web store. Here is the link to the app;  https://chrome.google.com/webstore/detail/aaepbggmjnnhfnefcbfbenmkhmdfpbhf?hl=en-US  - install and leave your comments. Publishing your web app in chrome web store is very easy; with few simple steps you can achieve the same. If you are planning to host a web app in chrome store, you can refer google chrome developer portal for details (start here:  http://www.google.com/chrome/intl/en/more/webstore.html ), or I will tell you about the steps in a little bit later.  Enjoy!.  Oh! by the way be ready to spend $5.00 one time fee before you can start uploading apps to chrome store.. fair deal rt?  Note: Imported from my site  https://sites.google.com/site/dhtmlexperiments/blogs/chromewebstore-myfirstapp  dated  Feb 24, 2011

Geo locator approaches

Image
Geolocation is a way to identify the physical location of user who is browsing this (any) web site. There are multiple approaches by which a website can get the info about physical location of an online user. HTML5 specs proposes APIs to enable this, so that the user can allow a TRUSTED site to access info about his/her location.  API looks like this:  navigator.geolocation.getCurrentPosition(successCallbackMethod, errorCallbackMethod);  If current browser support geolocation API and if it got the location successfully, then successCallbackMethod will be invoked with position as the parameter. In case of an exception, errorCallbackMethod will be invoked.   In the success call back method, you may add code to retrieve and use it according to your requirement as follows:    function successCallbackMethod (position) {     var latitude = position.coords.latitude;    var longitude = position.coords.longitude;         . Another point to note here is that, the browser wil