Monday, March 30, 2020

Blog migrated to new home


After multiple attempts, I have finally gotten around to migrating my blog from Blogspot.com. It only took 15 years!

Going to leave the older blog up - till Google decides otherwise.

New blog is hosted at https://blog.aunlead.com

Saturday, April 24, 2010

The NoSQL movement & MongoDB

Michael Kennedy from DevelopMentor has written an excellent introductory article on the NoSQL movement and MongoDB (It's a document oriented database)

You can read it here -
http://www.michaelckennedy.net/blog/2010/04/22/TheNoSQLMovementLINQandMongoDBOhMy.aspx


@Bhushan - Does this give you chills? :-P

Saturday, March 20, 2010

How long would it take to copy 19MB on WinXP?




How about more than 5 HOURS!!!!


Was copying 43,000 files, whose average size was around 30kb. I never thought 5 hours later i would be just half way through!!

Thursday, March 11, 2010

PC Game Wishlist

Always wanted to make a wish list of PC games i would like to play & now here is one -

  • Portal 2 [Link]
  • Crysis 2 [Link]
  • Assassin's Creed: Brotherhood [Link]
  • Grand Theft Auto IV [Link]
  • Football Manager 2009 [Link]
  • Assassins Creed II [Link/Link]
  • Battlefield: Bad Company 2 [Link/Link]
  • Napoleon: Total War [Link/Link]


Last Updated: 11/04/2011

My Flipkart wish-list [Link]

Friday, February 12, 2010

Visual Studio Team System 2008 Test Edition - Web Test error

I have been playing around with Visual Studio Team System 2008 - Test Edition for past couple of weeks. It’s a good tool for regression testing, automated testing (we can record macro's) and load testing using IIS (more on this later).

The issue I faced was when I ran web test (macro recording), visual studio would throw this error –


Request failed: Could not run Web test 'Login' on agent 'AGSPC00124': Method not found: 'Void Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext..ctor(System.Collections.Generic.Dictionary`2, Int32, System.String, System.String, Int32, Int32, Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel)'.

at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseContext..ctor(WebTestCaseVariation variation, Int32 webTestIteration, Hashtable runContextParameters)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation..ctor(WebTestElement webTestElement, Hashtable runContextParameters)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestElement.CreateVariation(IRunContext runContext)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestRunner.StartupVariation()
at Microsoft.VisualStudio.TestTools.WebStress.WebTestRunner.PlaybackThread()



I could successfully record web tests but could never execute them!

Solution -
The issue was because the web test agent couldn’t reference the Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext correctly. It was resolved when I installed (actually reinstalled) the Visual Studio 2008 SP1 Link. Hope this helps someone.

Tuesday, February 09, 2010

Operation aborted error message in IE while using jQuery's BlockUI plugin

Recently we had this nagging issue with MS Internet Explorer 7 - On opening a page we would get an "Operation Aborted" alert message followed by a page not found error.

We had implemented TONS of jQuery function & plugins on the page and after painfully commenting and isolating each one, we found the culprit - a BlockUI function call! (or at least that's what we thought).

When the page was loading, we were calling a Ajax method which was supposed to populate the page with some data. During the call we used BlockUI's block page function to display a loading message to the user.



It was this call which caused IE to spurt operation aborted error.

On further investigation we found that it was an issue with IE. In fact IE versions -
  • Microsoft Internet Explorer 5.5
  • Microsoft Internet Explorer 6.0
  • Windows Internet Explorer 7


In fact, one solution suggested by MS KB was - Upgrade to MS Internet Explorer 8!!

Fortunately, another KB had more information about this error -

To quote Microsoft -
This problem occurs because a child container HTML element contains script that tries to modify the parent container element of the child container. The script tries to modify the parent container element by using either the innerHTML method or the appendChild method.

Source -
http://support.microsoft.com/default.aspx/kb/927917

This error was caused because we tried to modify a DOM element before the DOM was completely loaded. We could have avoided this by adding our code snippet inside $(document).ready() but that was not possible. So we took another approach.

Instead of blocking the entire page, we wrapped our page content section inside a DIV. And after </div> we added our BlockUI function call. So modifying our earlier script -



This fixed operation aborted error!

Wednesday, February 03, 2010

Using jQuery's grep to parse JSON data

jQuery's grep() is a powerful and underutilised filter method. It's a simple method which helps in searching/filtering data in arrays. Grep() is quite helpful when we have to parse JSON data. It's return type is an array.

http://api.jquery.com/jQuery.grep/
Description: Finds the elements of an array which satisfy a filter function. The original array is not affected.

Sample usage -

TO extract all employee ids.



ANother example on how to use grep() on JSON.

Consider sample JSON -


Suppose we need to extract only active employees from above JSON, we can filter the same using grep() and look for Active = True

Complete sample -