Monday, March 30, 2009

Passing Variable To SetInterval

Today, I need to rotate the background image using javascript. I use the function setInterval to acheive this. However, I can't pass variable to setInterval as several errors occur.

Here is some websites that talking about this problem:
http://www.bigresource.com/JAVASCRIPTS-Passing-variable-to-setInterval-E2H3OB74.html#Gf8cAgFL

http://alexle.net/archives/169

PS: better use anonymous function to deal with it
For example,
setInterval(function(){alert(variable_a);}, 500);

Sunday, March 29, 2009

Internet Explorer Collection helps you test your webpages in different IEs

Each IE version in the collection has already built in the IE developer Toolbar to help developers to fix problems.

Download link:
http://finalbuilds.edskes.net/iecollection.htm

Tuesday, March 24, 2009

Cheaters turn to Web to game certification system

March 24, 2009 — Don't judge a developer by his or her certifications. Cheaters are coordinated, and the answers to exams are easily located on the Web.

Websites, including certcollection.org, examcollection.com and (until recently) sadikhov.com, host forums where members share advice, experience, and even actual word-for-word Microsoft certification test questions known in the cheating community as "MS brain dumps."

Read on:
http://www.sdtimes.com/link/33359

Server Application Unavailable

I wrote this post on my blog on how to resolve the generic Server Application Unavailable message we sometimes get as ASP.Net developers:

If you have ever received an error message on a .Net application that simply stated "Server Application Unavailable" you might find this useful.

When you receive this error, make sure to check the event viewer on the server. This is found under administrative tools. Under the application event log, you will likely find an error that states: "It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration tool to run the application in a separate process."

An application pool is a process that responds to web requests under IIS. An application pool does not have a setting for what type of ASP.Net applications will be run in it. Instead, it loads the appropriate libraries when an ASP.Net application is loaded in the process. Because the libraries for ASP.Net 1.1 and ASP.Net 2.0 are similar, but not the same, the application pool cannot respond to requests for both types of applications at the same time. This can cause sporadic behaviour if you are using the server at the same time as another developer and you have applications using different versions of the framework in the same application pool.

Make sure that on your server there is an application pool dedicated to ASP.Net 2.0 applications and one for ASP.Net 1.1 applications. When you add an ASP.Net application to the server, make sure you select the right application pool for it.

http://forums.asp.net/t/1070357.aspx

Tuesday, March 17, 2009

TryParse, TryParseExact for conversion in .net

Today, I discover a userful function called TryParse in .net programming.

Previously, if we want to convert a string to integer, we will:
Convert.ToInt32(sampleString);

However, we need to catch the Exception if the variable cannot be casted into integer. With the use of TryParse(), it will return false if the variable cannot be parsed:
int.TryParse(sampleString);

It saves some work and makes the code nicer. Also, catching exception is consuming. So TryParse() is really a good tool to use.