Wednesday, May 17, 2006

Something to play with Friendster

My good brother had just taught me something interesting about friendster tonight (to be accurate this morning) .

Firstly, I would like to introduce these two links:
The cubancouncil has set up a form-like interface where you can set your friendster profile fonts, background, links format. Instead of taking the old default interface, you can make your profile more colorful (or more colorless which ever you like). The best thing of all, is that you do not need to have any skill of CSS. By filling up the form (maybe you will feel bit frusrated when you try to fill in the forms which is quite detailed), just click preview code button and voila - a sample of friendster preview page appeared as new window and the modification code is displayed.

Once you are satisfied on the results, copy the code. Then login to friendster, go to edit profile then click the customize tab (you won't missed since its labeled *new). Under advanced users, paste your code on the textbox. Scroll down, click the save button. Done, you have new looking profile already.

The second link is useful when you want to upload your own image as background image in your friendster. The imageshack lets you upload your picture online. And display all required links which you could easily copy it and paste on any where you see fit. Oh ya, for the cubancouncil, to upload image as backgroud image. Paste your image direct link to background image textbox.

Well, that's all.
Now I just want to show off my newly created background image :P

Free Image Hosting at www.ImageShack.us

Sunday, May 14, 2006

greedy method

Greedy Method

1) Making Change
Greedy method selects the largest change nearest to the required amount.
For example :
change: $10, $5, $1
required amount: $18
Greedy method will first choose $10, then $5 and lastly 3 $1

2) Fractional Knapsack
For this part, you can just tear the notes and throw it into the dustbin.
Download the knapsack.ppt at mmlscyber (it contains some pages of the textbook)

Following the slide (knapsack.ppt) example:
We first calculate the ratio priority
p/w for each chapter. (p->importance value, w->pages)

Knapsack selects the pages from the chapter following the priority ratio. From the highest ratio to the lowest. So knapsack with select the pages from chap4, 1, 2, 5, 3.

However adding all the pages from chap4, 1, 2, 5 already accumulates total 560 pages. The required amount is 600 pages. So we could not add all of the 200 pages from chap 3. Instead we pick 40pages from chap3.

You can refer to the slides mentioned to study how to calculate profits.

Saturday, May 13, 2006

heap sort

I absolutely agree that the person who developed the heap sort algorithm is a genius. Not only a complicated (well complicated for me, I’m just a simple-minded people) but it could have faster run time than other sorting method.

However, heap sort manipulates binary tree to do the sorting. I draft the tree in order to understand its complexity (and hopefully could at least memorize its algorithms). I take a sample of 15 random numbers and placed them in a binary tree. Then try to “heapify” (according to the tutorial solutions) the tree. It is actually quite simple; I just need to make sure that each root of the sub-trees is larger or equal than its children (by swapping the parent with the largest child). Then I faced the next step – “siftdown”. Argh, by simply delete off the root and push it in the array, then place the right-most node on the root. My “heapified” castle collapsed and I need to “reheapify” all over again.

I continued till I get the 4th largest number. I gave up. The whole A4 paper is full of trees and I messed up some nodes. Children become orphans. It is a messed. Fortunately I finally gasped its concept. Although I don’t know why it has faster run time, I will manage to answer some how.

P/S: Speacial thanks to cs.wisc.edu which makes my heap sort life easier.

Friday, May 12, 2006

Gathering scattered memories - Chat notes

After more than one month of restless and chaotic moments, we finally survived from the terrible “war” time. Now, retired from the army and from the hectic days, most of my team-mates resolved to soak in their entertainment mode (good rest, watch drama, etc), however I strangely ended up cleaning both my room and my pc. I wondered how long did I stayed in this dusted-filled room. My room looks like a miniature jungle at one corner (my roommates corner looks absolutely fit for normal gal to live in while mine is well is much like ‘jungle’). And my poor pc with only 20G space had been used up till remaining 1.8G space, is packed with all types of heavy duty software. Just imagine I need to wait for 10minutes just to start up my pc~!

Using up my remaining energy (with only 4 hours sleep is never enough), I cleared all the “rubbish” on the table. I have not seen the table surface for ages. It is covered with rough papers, notes, stationary, receipts, eye drops, lozenges and wires. At the same time, I uninstall all the software which I would never need to use it again after the war time. However I only managed to uninstall one gigantic compiler suite. It takes up around 3G of space! Once the un-installation is complete, I have already cleared my table, swept the floor and even mopped it clean. Now my pc may finally response faster then before.

Ok, clean pc mission done, clean room mission complete. Now is to gather back all my precious notes and placed it in correct arrangement. Notes arrangement is time consuming, and tiring (probably now energy low). While clearing up my files, I found one interesting piece of chat-notes. Chat-notes are me and my friends’ faithful time-killers for boring lecture session. We write our messages, plans after class and woes on a piece of paper. The chat-notes mostly contain dialogs of two people or more. However, this memorable chat-note contains poem-novel like dialogs. I wonder whether my friend remembers what she wrote.

Below is the content of the chat-notes:
在下着雨的那一天
我心里想着一个人
突然电话响起了
有种不想听的冲动
惯了电话继续注入我的梦中

* It is raining on that day; phone alarm rang but lazy to wake up.

我把纸交给她,开始听课
这堂课,明明应该是精彩的
但是

* I passed the chat-notes to her and try to concentrate.

雨停了,已没有心情去想
他不会知道我的想法,
也不可能知道我的想法
放下心情专心听课吧!

* I have tried to persuade myself to concentrate

嗨,又开始乱乱思想了
又不专心了
想家想床

* My thoughts lingered off. I’m thinking of my comfortable bed.

心中隐隐作痛的
为什么呢?
为什么会发生这样的事情呢?
有些不甘心,但又能如何呢?

* Wondering why must I attend this class

嗨,只过了一个钟
还有半个路程,
怎样也要坚持下去
不能放弃
只有一个钟

* An hour had passed and left another hour to go, fight-o!

我想逃,逃得远远的
但事实告诉我,这是不可能的事情

* I want escape, but it is impossible.

突然我被解放了
* Class over? Can leave now?

不,结局还没完呢?
没那么容易的

* Cheh, still is not over yet.

他骗了我
* I’ve been cheated.

放弃他,别在执迷不悟了
对你没有好处的

* Don’t put too much hope on him. It will do you no good.

我时常那么想
但是每一天
我都不知不觉地
希望他会改变

* I know that. However, every passing day, I wished he will changed.

Monday, May 01, 2006

Feeling Better

Feeling much better already. Most probably thanks to the dark-green colored cough syrup and yellow-ish flu tablets. What happened to the sore-throat tablets? Strangely after that painful night, I woke up and realized that my sore throat is gone. It's a miracle.

However, I returned back to my "war" plan again. Have you ever watched the variety show named "Peach Protein" when they interview the artist Lee Hom? He say his instruments (those musical instruments and other type of things which assists him to compose his songs) are always near by his bed, so everything he wakes up, he can straight away do his job. I, unwillingly, seems to be following his footsteps. Normal people would have the routine of wake-up>washroom>breakfast, but for me is wake-up>computer>breakfast(also facing computer).

Can't talk much now. I still have a dozen of keywords to identify and another dozens of symbols to matched. Adious!