Do everything with javascript

Author Archives: julian

When my mind is made up?

Just saw the video from hulu which is same as http://www.theartistsden.com/episodes/swellseason.shtml
When your mind is made up,
When your mind is made up,
There’s no point try to change it,
There’s no point try to stop it,
There’s no point try to talking,
There’s no point try to fight it.
So what have I made up~?
Have been working quite hard for the [...]

My damn last minute habit

星期日就要飛. 行理未拾, 房未拾, 野未買曬, data 未backup. 我應該都係會pk ga la……
May the god of last minute be with me!

It’s been a long time…

好像已經有兩年多沒寫下什麼. 之前blogger 的blog 都已經荒廢了. 今天又想從新再寫自己的事. 2009 年, 行屍走肉的一年. 工作上沒方向, 沒前進, 沒後退. 僵著腿站著, 一動不動. 生活更是不知所謂, 總是找一些東西讓自己沈溺, 什麼都不去想, 讓烏雲把自己遮蓋, 消失於世上…為什麼!? 我也不能明白….
現在座下來, 重新再思考自己的事, 感覺很不一樣. 久違了的msn….我再次看到frd list 上的朋友和他們的status, 找人聊天再次讓自己跟別人連繫上. 希望能把烏雲抺去一點. 希望再給自己一點動力, 重新上路.
還有一個星期就要到美國, 感覺有點像按reset button. 29 歲去一個完全陌生的地方, 帶住135磅肥肉同二三十公斤行李, 沒有其他… 現在還不算胖, 來一個up side down 的轉變, 應該可以吧.

Dumping Firefox XUL object

I am not sure is it correct to call it XUL object, what I mean to do is transversing javascript object. It sounds silly as we got firebug but it makes sense when working on firefox addon where the script debugger in firebug doesn’t work for javascript running in chrome.
There is a XUL reference in [...]

Rackspace cloud hosting (256MB Ram) and wordpress performance issue

Any one out there is using rackspace cloud hosting with 256MB Ram and hosting a wordpress? I was doing fine with it, but after I install the subversion on the Fedora VM, I found my apache become very very slow and take over 60s to serve a request….
Actually this is the second time for [...]

Nice way to check dom node className

It happen quite often to me that I need to check the element className in the event handler and to determine what function to trigger. element.className contains all the class name separated by space. e.g. “classA classB classCCC”. So it is bad to check the className like:
if (element.className === “classA”) {…}
or
if (element.className.indexOf(“classC”) > -1) [...]

Detecting page dimension with Javascript

I just come to a problem that need to create a canvas element the will cover on top of the whole page. This prevented me from using style.width and style.height as the drawing will become scaled by the style setting. So I have to calculate the exact page width and height then assign it to [...]

Just found i was wrong on MACD

It is common to see financial site providing MACD in (12,26,9). I was so confused on what those number mean and finally I resolved it today.
12 – is the 12 day moving average of the stock
26 – is the 26 day moving average of the stock
9 – is the 9 day moving average of the [...]

Using custom event on jQuery

When doing Javascript, it is common to handle different DOM event like click, mouseover, keydown… This is cool that with the DOM triggering those events, we can create custom handling / behaviors on it. Say, when user click on the button, a edit panel fade in. But this is not good enough when we have [...]

A classname to save, using negative magin to remove the "first" / "last" class in your list

It is common to create a list with a separator in between like this:
Item 1 | Item 2 | Item 3
One common way of doing this is create a list (ol / ul) then apply the border-left and add a class “first” to the first li setting the border to 0px. This is good, but [...]