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 of [...]
Posted on May 5th, 2008 by Sumit Gupta
Filed under: Code Snippets, Links, Programming | No Comments »
Recently I was given a task to make LightBox and VideoBox work on same page, where we have Images and Video to show. However, Videobox is inspired by Lightbox as per developer, they are not compatible with each other. The reason I found is that they share few variable and hence they are breaking each other’s code. [...]
Posted on April 11th, 2008 by Sumit Gupta
Filed under: Code Snippets, Javascript, Programming | 25 Comments »
Often we need to take quick backup of database with data before we can make changes in table. for this I create the image of table within same database, as it is the fastest method. It is one of the reason why one need to create image a table.. or copy one table from another.
It [...]
Posted on January 2nd, 2008 by Sumit Gupta
Filed under: Code Snippets, SQL | 1 Comment »
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 BY [...]
Posted on December 17th, 2007 by Sumit Gupta
Filed under: Code Snippets, Programming, SQL | No Comments »
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 formula [...]
Posted on November 10th, 2007 by Sumit Gupta
Filed under: Code Snippets, Javascript, Links | 1 Comment »
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();
    }
}
this loop through all child of related_mc.sp_related and remove the instance if its [...]
Posted on August 22nd, 2007 by Sumit Gupta
Filed under: Code Snippets, Flash | No Comments »
Some time reporting tools are too heavy to use with a small application. Something similar happens with me, I need to print a Single page text information for this I cannot use any Heavy reporting software although this information is fetched from XML/Database. So I opt to use in built .NET feature and having following [...]
Posted on July 10th, 2007 by Sumit Gupta
Filed under: .NET, C#.NET, Code Snippets, Programming, VB.NET/VB | Comments Off