Saturday, January 22, 2011

I fixed my own f1.4 EF 50mm!!!!!

Yes, this is a great day for me!!!

The lens that I loved most, the Canon f1.4, recently got stuck. I had it for 2 years now and I loved it, sharp images, fast shutter even when inside homes. Great for kids, and great for people like me who don't like flash.

And yet for several month now, the AF system only able to auto focus at one direction. And a week ago it finally got totally stuck, I can't adjust focus manfully.

Went online, and other people are complain about the same thing. The Canon f1.4 lens has a weak point, the front. If you push it too hard it could get stuck.

I was heart broken on this. The lens is expensive, and when it gone bad and I have to go back the the default lens, the difference is too big to accept.

Finally I went online and did some research, found this and this.

Initially I doubted my ability to fix the lens, but decided to give it a try. After about 1.5 hours, I finally did it!! Followed the second link, and the instructions are great!!! Some of the instructions I didn't understand initially, but I figured everything out with some practice.
Thanks to those authors.

Step 3, pop ears on he plastic protection piece in the mount was the hardest, what you need to do is push the ears toward the center and push the inner plastic ring outward at the same time.
I also had trouble removing the wires, pushed on the wrong piece lol.

Anyway, I am very very happy about this. Every since I decided to really believe in God, I have encountered multiple difficulties. First my old company started laying off and salary cuts, then the lens. But all was resolved in surprising manners. A recruiter called me and land me a better job, and now a quick fix and I am happy in multiple fronts!

Monday, January 17, 2011

Working part time

As you know I change job recently, trying to get a job with better security and pay. Well, my new job is very nice, pays better, but I am not sure about the security part. My new company is hiring too many people (or at least I feel that way), and I am a bit worried.

Lucky for me, my old company wants me work part time for them. With babies at home, spare time is in short supply, but I do need to keep in touch so I don't lose the relationship. When I was young I used to think that I am a good programmer and will never need to worry about jobs. But now I am older and need to support a family, this is a must.

Friday, January 14, 2011

Wonder Girls

I am about 2 years too late, but recently I found this amazing video on youtube.

If you have not seen this before, you will not be disappointed. Wonder girls are a Korean group, and I don't understand most of it except "Nobody nobody but you"!


Sunday, January 9, 2011

Gini Coefficient

I was watching a lecture and heard the term "Gini Coefficient". See A very interesting concept. Lecturer linked Gini with how developed the country is, the better (lower) the coefficient, the better the country is developed. The reason is simple, the system will became more efficient when people gets closer to their fair share of the game.

Actually, in a real world, the coefficient will never reach to 0. Also it will be inefficient if the coefficient gets to 0, because that means no one is getting rewards when they work harder. And I think that is one of the main reasons that even in the most developed countries, the coefficient is around 0.3.

However in a developed world, it should never be too high. The reason is if the place is fair, all people should have the same access to education etc, so with a even start, the majority of people should be around the same level.

It is also interesting to note that the lecturer noted that during the 1930's, when the Soviet Union was doing their X year progressive plans, the system works so much better that even the intellects in US think it is the way to go. However the system of government central planning didn't stand the test of time, and eventually the pitfalls shows up, the system is so inefficient that the Soviet union has to import food because of production problems.

Anyway, as I am from a communist country, here is from my high school political book "The system that gives better productivity will replace the less efficient ones". That was a rough translation. Only in the original book it was predicating communism will over take the world. Just amazing what 10 or 20 years of time can prove.

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.
//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( + ' ' + a + b);
var obj = {id:'me'};
var func = doSomething;, 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!!