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

Monday, August 30, 2010

Beat "All In" in Brutal

I finally beat the last level in Starcraft II "All In" in brutal. I was having trouble despite watching youtube on how others did that, but theirs seems easier because the waves seems to contain less numbers.

So basically I used the mind control device (but I did make a big mistake, I put the devices in front of the island where the artifact is instead of put it at the rear, puting them more at risk), and at the last moments I moved all my units to the center. After that, I kind of just waited and win because there are so much going on I can't do much.

Friday, August 27, 2010

Jaedon!

vs light, this is very interesting!
http://www.youtube.com/watch?v=LRqS68D2TH0&feature=sub

Wednesday, July 28, 2010

Got Starcraft II (Update)

Install Starcraft II at places where you can't control firewall is not a good idea, but at my home it went very well. I got windows 7 64bit, and because I have to AFK from time to time, I didn't even notice the patch download. When I came back to the computer, Starcraft II was already playable.

This is my first impressions. First, the graphics is very good. Sound quality is very good as well, love the music (will be better if they mix in the original sound tracks from Starcraft I). I only played a short time, and the cut senses are pretty good in general (but some are not movies, look like real time 3D generation and needs some anti-aliasing, it could be my graphics card, which is ATI5770, with everything on ultra).

Another thing is, it looks like every time I start the game, I have to logon to battle.net. What if my internet provider went down (which happened several times)? Have not tried to play without internet yet.