Code Snippets

Hello World

As a computer software programmer, one must have learned and use these two words “Hello World”. It is unsaid theory to write a hello world program to start learning a programming language. You can read the “greatness” of hello world at http://en.wikipedia.org/wiki/Hello_world_program. Or get a Hello world program for your programming language from this collection Read the full article…




Setting/Resetting Auto increment value in MSSQL 2005

Once you create a table and what to reset autoincrement value of a table to your desire number, you need to set some system table values, which are not available for direct editing. To perform this you need to do following: SELECT OBJECT_ID,OBJECT_NAME(OBJECT_ID) AS TABLENAME, NAME AS COLUMNNAME, SEED_VALUE, INCREMENT_VALUE, LAST_VALUE, IS_NOT_FOR_REPLICATION FROM SYS.IDENTITY_COLUMNS ORDER Read the full article…


Calculating distance

With increasing use of Map service such as google, yahoo and MSN one often need to calculate distance between two location. This can be done many ways I suppose. However, to calculate the short distance we can perform calculation based on longitude and latitude values of those two location.  However, it is simply a math Read the full article…


How to remove all child movieClip through AS 2.0 Code

To remove all child from a given movie clip simple loop through its all object and remove the type of object you want. Following code does the same for related_mc.sp_related name movie clip: for (obj in related_mc.sp_related){ // root.mc1[obj] instanceof MovieClip same as typeof(_root.mc1[obj])==”movieclip”        if (typeof(related_mc.sp_related[obj])==”movieclip”){          related_mc.sp_related[obj].removeMovieClip();   Read the full article…