Sunday, June 26, 2011

OSL JD vs Flash

Another great battle between 2 best players.
http://www.youtube.com/watch?v=DExusOePdSA&feature=feedu

Saturday, April 2, 2011

Paul Graham on Tablets

I think it is just a great read. Kind of showed how good hardware helps innovation. The PC world on the other hand used to be race to the bottom. Still remember how dyanmic ram wins over static ram Back when I read the first book on CPUs, I can't understand why people would save half the transistor count and make the product slower. However the use of SDRAM is a good choice, as that small performence is not as good as adding a accelerometer.

Monday, February 14, 2011

How different are you from a Christian

I compiled a list of requirements to be a Christian, most likely not complete. #6 and #8 is likely the most impossible, I will never give my bank account to my neighbor at least.

1. No idol worshiping
2. don't kill
3. don't steal
4. don't enoy your neighbor's belongs, including his/her wife/husband (2x2 metrix)
5. respect your parents
6. Respect the sabboth and don't work on that day. (Jew/Christian/Islam only)
7. Don't judge other people
8. love your neighbor as you love yourself
9. donate 1/10th to charity.

Thursday, January 6, 2011

Some Javascript basics

I used javascript for many years, did many things that solved hard problems at work. However I recently changed work, and this company used javascript heavily.

Through my recent debugging and fixing of the code, I found some old javascript tricks that I never know!!

1. === and !==. "===", the triple equal sign, means compare with type. So even though 2=="2" is true, 2 === "2" is false because their types are different. Same with !==. I found this one while I was reading jQuery code.

2. function closures.
(function(){
//do something without affect globals.
})();

2. call and apply.
Suppose you have a function doSomething(a,b). You can call itwith a new "this" by using call and apply. i.e

3. arguments
It is a variable made available by javascript that contains current function call's arguments.

function doSomething(a,b){
alert(this.id + ' ' + a + b);
}
var obj = {id:'me'};
var func = doSomething;
func.call(obj, 1, 2);
(function(){func.apply(obj, arguments);})(1,2);

the above code will show "me 12" twice.

Because I never know those before, the first time I saw them, I thought they are either typos or some home made functions!!

Friday, October 8, 2010

Nice jQuery tutorial

I have been doing mainly Silverlight recently, but here is a nice jQuery one (better than doing ajax myself).

http://dotnetslackers.com/articles/ajax/Using-jQuery-with-ASP-NET.aspx