Thursday, November 30, 2006

On Wealth Distribution

Paul Graham has an interesting article on wealth distribution:

Mind the Gap

For those who are impatient to read the whole (long) article, here are some excerpts that are relevant to our topic:

"With the rise of the middle class, wealth stopped being a zero-sum game. Jobs and Wozniak didn't have to make us poor to make themselves rich. Quite the opposite: they created things that made our lives materially richer. They had to, or we wouldn't have paid for them."
...
[snipped]
...
"If you suppress variations in income, whether by stealing private fortunes, as feudal rulers used to do, or by taxing them away, as some modern governments have done, the result always seems to be the same. Society as a whole ends up poorer."
Curiously, some people in this country still think wealth is only limited to tangible entities like land, batu seremban, and teh tarik. Thus, wealth division to those people is still similar to dividing a cake with you will take less if someone else takes more.

However, is this really true? Here is an interesting analogy I read somewhere:

Get a few friends, say 3 of them and form a circle.

Take out a $5 note and ask the person next to you to do you a favor, say give a massage, help to scratch your back, etc. and pay that person the money. The person who receives the money will do the same to the next person. This process is repeated until the money is circulated back to the originator.

Has anybody become a loser in this game? No! Each person has gotten something that he/she desired and the $5 note remains the same shape.

We have created a trivial $20 worth of wealth with everybody winning


In other words, people create wealth by providing conveniences and advantages to others (think Apple or Toyota), which in turn, will aid others to create wealth. In the process everybody is getting richer and has better living standard. Why can't Malaysia do that for a win-win outcome?

Should you have the courage to read something heart-sinking and discouraging, take a look a blog entry by Lim Kit Siang below:

Keris-wielding Hishammuddin the most divisive and polarised Education Minister in history

Tuesday, November 28, 2006

Time to Think

The following pictures are from Jeff Ooi's Homepage

Hishammuddin in 2005


Hishammuddin in 2006


Don't ask me when they want to do this


Note: In case you are not aware, Hishammuddin is our education minister.


Traditional Chinese Fonts below, translation follows.

我读了这篇社论, 感慨万分。 毕竟各民族生活在同个屋檐下, 理应同甘共苦, 为全球化的冲击作准备。 反观我们的所谓‘领袖’,在国家级会议上抡刀动枪, 不是为了抵抗外侮, 而是研究怎样更进一步的把同国的华族人士赶尽杀绝。 这事发生在已独立40年的国家,是一种堕落。

文中提到: “基於共同的前途,的的確確,應該要深沉思考了!”。 只怕现在我们要思考的,已不只“共同的前途”那么简单。

(星洲日報/夜雨晨風‧作者:鄭丁賢‧2006/11/17)

是時候做一些深沉的思考了。

有人在大會上說,不要怕流血。

有人說,希山慕汀的馬來劍甚麼時候才要“刺”出去。

有人說,行動的時刻到了。

真的有如此深仇大恨嗎?

族群之間,雖然文化背景不同,看法意見有差別,但是,只要是人,都會有差異;然而,差異絕對不應該是仇恨。

沒有!任何頭腦還清醒的人們,都會瞭解沒有仇恨;看看周圍,也確實沒有仇恨。

相反的,族群之間,實在有著更多的共同點,互相諒解、接納和協助。

我們不是在開齋節、農曆年、屠妖節都開放門戶嗎?我們不是在運動場上並肩努力嗎?我們不是一起拼經濟、拼治安嗎?

我們不是對外宣傳,馬來西亞是亞洲文化融合的匯集嗎?我們不是曾經引以為傲的說,這個國家是族群和平共處的楷模嗎?我們不是矢言要成為先進國嗎?

我們不是擁有同樣的一個國家嗎?

但是,就在一個大會,為了一個議程,這一切,都被拋諸腦後。

有人很輕易的辯解說,這只是配合一些特殊的需要,不需要在意。

然而,一個個鏡頭,透過電視現場廣播全國;一句句話語,透過報章的引述,傳給所有人民。

仇恨的種子,可能就此播下。族群之間的友誼、信任、合作,也許就開始變質。

一分鐘的激昂,抵銷了一年的努力;5天的集會,消磨了一個國家的願景。

為了“特殊”需要,值得嗎?

作為執政黨,任務是建設國家,塑造團結,這是人民的付託。國陣的架構是權力分享,協商共治,這是政府的基石。

如今,一幕又一幕的攻訐,讓一些人民情緒高漲,另一些人民擔心失望;對友黨的無情攻擊,力道不下於對政敵的廝殺,這讓友黨日後如何在國陣的旗幟下爭取支持和認同!

基於共同的前途,的的確確,應該要深沉思考了!

English Translation (Not verbatim translation, but the meaning is there):
After reading the following write-up, I can only relent. The fact that we, the Malaysian people, live in the same country, on principle we should help each other and cooperate to counter the impact of globalisation. However look at our so called 'leaders', in a national party assembly, they wielded the 'keris', a traditional Malay short sword, and acted as if they were going to a war. Their warring effort wasn't targetting any foreign invading powers, but instead towards the Chinese Malaysians who are hardworking and therefore better-off. It is shameful to let this incident to happen in a country that claimed independence 40 years ago.

In the write-up, it says "base on our shared future, it is time for us to ponder upon this issue seriously." Given the current political climate, I am afraid what we need to think is more than "our shared future".

(Sinchew Daily, by Zheng Din Xian. 17 November 2006)

It is time to think it through.

In the Umno party meeting, someone advocated not to afraid to shed blood.

Some inquired when Hishammuddin would really thrust out his keris instead of just holding and kissing it.

Some said it was the right time to fight.

Is there so much hatred among Malaysians? Or more specifically, among Malays and Chineses?

There are definitely inter-racial differences in terms of cultural background and world views, but no matter what, each person is unique and thus differs from the rest. Therefore differences should never be the source of hatred.

'No'! Any person with a rational mind will understand there is no hatred; look around us, really, there isn't any.

On the other hand, there are alot of similarities among us. We should understand, accept, and help each other.

Aren't we celebrating Chinese New Year, Hari Raya and Deepavali together? Aren't we cooperating and cheer for each other in the sports events? Aren't we working hard for our future and fighting crimes together?

Aren't we telling the world we are the melting pot of Asian cultures? Aren't we saying we are the model of harmonious multi-racial society? Aren't we vowing to be an advanced country?

Aren't we embracing the same country?

But for a party assembly and for some (personal) agenda, all the above were forsaken.

Somebody will try to argue all those were for a 'special occasion', and we should take that with grains of salt.

But all the actions were broadcasted live to the country through the TV; all the words were brought forward to the people through newspapers.

The seeds of hatred may be sowed. The friendship, trust and cooperation among races may start to mutate.

One minute of 'show time' destroyed the whole year's effort to unite the country. The 5-day assembly, killed the nation's vision.

Because of the very 'special occasion', does it worth it?

As the elected political party, its tasks are to advance the country and build up unity. This is the entrustment of the people. The framework of the National Party (in Malay, Barisan National) consists of sharing of power and ruling through negotiation with other member parties. These are the cornerstones of our government.

Right now, attacks after attacks to the member parties (which consist of Chinese and Indian parties) are stimulating certain race's sentiments but scaring and worrying other races. Forays against the friendly parties are as merciless as to enemies in field, how are all the member parties to unite after this?

Base on our shared future, really, it is time for us to ponder upon this issue seriously.

Sunday, November 26, 2006

Quest for Duck Rice

It was a lazy Sunday noon. After spending hours in front of the computer, I decided to take a break and drove to town for the famous duck rice in bookshop street.

As usual, the shop was crowded.

With a glass of ice tea, I gazed upon the crowd of people and let thoughts flowed through my head. "Such a long queue", I thought.

I started to ask myself questions.

Question 1: Why this stall is so crowded?
Answer: Because the roasted duck tastes good.

Question 2: As a customer, will I be happier if the food comes faster?
Answer: Oh yes, I am dead hungry.

Question 3: Why customers are waiting?
Answer: Overwhelming orders. The stall owner is preparing food non-stop.

Now I could easily model this using queueing theory. To make life simpler, I assumed the arrival rate and processing rate as constants.
a: Arrival rate (traditionally called lambda)
b: Processing rate (traditionally called mu)
In front of us is a queueing system with one server. The queue was building up, obviously the load, defined as a/b, was greater than 1, i.e. a > b. This is an unstable system when the queue is of finite length.

The next question is: how to remove the bottle-neck?

There are 2 ways that I could think of: Increase number of people serving, or increase the processing rate. The latter doesn't seem viable, because I believe the stall owner will try to maximise profit by churning out as many outputs as possible, he has no incentive to drag. Therefore any effort to increase the speed may most probably result some extra flesh beside duck's meat on the plate.

We are left with option 1, which is to increase server number. The owner may want to save cost by not hiring any helpers, but does he really save money by doing that, or he will gain even more by selling more, making customers happier, while providing a job to some poor soul?

This is an interesting question. Let's stretch this even further: assuming the food quality doesn't deteriorate, he could open a few more outlets. At that time, what he needs to do is to ensure the quality of the roasted ducks remains the same. He may earn much more while doing less, because he hires others to do the donkey work. Market elasticity test may need to be carried out to ensure market is test for the optimum outlet size...

(My food arrived at this point and I forgot the rest of my thoughts)

Finally. Conclusion:

I am not doing this analysis completely for fun, there is a message within it: Opportunities to improve things abound, decisions are with us most of the time.

I invite you to do a deep retrospect, and optimize bit by bit. Have you found your bottle-neck lately?

It is addictive to do thought experiments like this.

Saturday, November 25, 2006

Team Building and The Push of Physical Limit

My company had a team-building event on Friday at Jerajak island. Jerejak island is about 10 minutes of boat ride from the Penang island. Despite the claim this island is 'rich with history' because the 'founder of Penang' Francis Light landed on it in 1786 before he found Penang, to me it looks just like yet-another-piece-of-island.

The day started with an annoying alarm call at 7a.m. Those who know me well are aware, 7a.m. is well helluva early for me, but to catch the boat to the island, I dragged my butt to the jetty _very_ reluctantly and got on the boat.

I took the boat to Jerejak Island from this jetty

The boat chuckled along the coast line towards Jerejak island, I gazed at the buildings with a blank mind, thinking to get a cup of coffee to wake up my mind. Boy, my brain was in hibernation mode.

At the island, we grouped in teams and had the typical drills for team-building: telematch, jungle exploration (also known as 'mosquito feeding sessions' or 'whack the bug activity') and wall climbing.


Grouping in front of the hotel

Rock Climbing:
One of the activities we had was rock climbing. Standing in front of us was an artificial wall around 20 feet tall with various protrubing holds. There were altogether 3 paths with varying difficulties. I conquered the normal one without much fuss. After 20 minutes, I thought I was ready for the hard one. Slowly I ascended with full confidence. Just 3 feet below the top, I found my hands and legs had involuntary fatigue spasms, I wanted to move on, but my body wass out of control and failed me. My body couldn't stop shaking. I was dangling at such height and I realized my very own limitation. Finally I just released the grip and let the training supervisor to lower me down using the rope attached to the safety harness. The lesson learned is: physical strength comes from training, not from wishful thinkings. For the Mount Kinabalu trip, i have a lot of catch-ups to do for training.



Everybody clamped inside one room

All the physical activities ended around 5:30p.m. and we had 2 hours of free-and-easy time before dinner. We just spent the time chatting and eating tidbits in the hotel room. We were all 'rotten' and said silly things, but it was quite fun to do all these once in a while, just to release tension in work.

The dinner and night proceeded without anything interesting. I relaxed myself and chatted casually with my newly-acquainted colleagues. The next day we had a treasure hunt. That was all of my team-building activity. Despite the fact the site was so near my office and Penang, going to a new place does switch the pace of life.

On the way back to Penang, well, this is the Penang island at my left side, if you turn right, it will be the Jerejak island. It is _that_ close to each other.

Wednesday, November 22, 2006

Analysis of Cost Reduction Through Natural Attrition

Today's topic is more on corporate study which is my first hand observation in my previous company.

"Natural Attrition" sounds deep, but in reality it means people leaving a company (hopefully) in a voluntary way. This topic reads as: A company will have less staff over a certain period of time due to people leaving 'naturally' (whatever this means). As a consequence of that, it saves cost.

A lot of companies now employ this strategy. Some reasons belo, listed in descending probability. Last item having probability asymptotically close to zero:
  1. Avoid possible law suits
  2. Avoid being smacked by unions
  3. No money to pay for severance packages
  4. Want to save face/corporate image,
  5. Want to treat employees nicely.

From the surface this sounds good, looks good and even feels good for those high above. Here, I want to argue why this logic is somewhat flawed.

First of all, this strategy will work as expected if the following conditions hold:
i. Employee population is homogenous in terms of competency
ii. (most important) Attrition rate is uniform across the homogenous population

If any of the above doesn't hold, the company is entirely in different path. I will illustrate this with a pseudo-story ('pseudo' because some of these are real):

Let's take a hypothetical company I as example. Company I is a multinational company making toilet bowl and flush. It has dominated that market over 3 decades with plants in US, Malaysia, China, Ireland, and India. However, recently another company, Company A, has developed a kickass product with two water-flushing cores (also known as dual-core flusher) and best of all, those flushers are much more resource saving and won't soak up user's pants. Now company I is in deep shit. Market share is shrinking, company is inhibited by useless employees who are only skillful to backstab each other, and product in the pipelines are all messed up.

The first in place is cost reduction measures, which include each employee is rationed with one roll of toilet paper each month and no more. Pencil erasers are replaced with saliva'ed fingers. Building service contracts are terminated and employees take turns to clean up the office buildings. Hiring? You are kidding. Company I doesn't want to lay people off because the management still thinks natural attrition is the best solution.

As work load builds up due to no replacement, pressure is proportionally mounting among employees. The entire corporate morale is dropping like stone. People start to look for a way out after fed up with numerous business update sessions which go something like: "This is yet another winning quarter for us with year-to-year income increases by 450% because US bombed the shit out of Iraq and they are toiletless and gotta order 30 million of seats from us. But for strategic purposes, we still won't give any bonus this year anyway. One more thing, we will heat up the left over from yesterday's breakfast as your lunch.... (the following is in quick continuation with no pause) Questions? No questions? Excellent!"

What kind of people will leave?
  1. People with real ability, who are capable and marketable
  2. People who dare to take risks and endure uncertainties
  3. People who don't care too much money on paper (stock options, share grants)
  4. People who just hate Company I's culture
Now by taking the negation of the above list, it is easy to see what kind of people will stay:
  1. Politicians or Jokers who are dead-idiots with close-to-none competencies (with exception of back-stabbing techniques)
  2. Risk aversing people who need job security, or simply don't want to take any risk
  3. People who don't want to give up the not-vested options and grants
  4. People who love the company (!!)
Note someone may in one or more categories above. A company that has people in even one of the non-desirable groups, will be in trouble.

Let's analyze, #1 is obvious, politicians and jokers will only add chaos in the company with no real contributions. In fact, they even will drive away those who are competent to secure their jobs. #2 is also close to useless. They may be apt for a tobacco company where business has been the same for the past and coming 100 years, but for a high tech company like I, they won't help much. #3 maybe, but these people are very calculative, they would reason the heavy workload was not justifiable for the pay they received, hence would jump already if they could, too. #4 is so rare that I have yet to come across one. If you have known any of #4's, please gimme a call so that I can send them to museum for preservation and added protections.

We can see over time, the company is left with a pool of mostly useless, incompetent employees. That company may achieve the size reduction it desires, but what is the cost? The right way should be to analyze and single out the low-performers and painstakingly lay them off. This is the golden time to trim the dead corporate branches and purge the idiots out. This was what Jack Welch did to GE when he just took over and won a notorious title of 'Neutron Jack'. However over the years, he was proven correct multiple times and GE was back as one of the best corporates in the world. Can Company I spring back to action? I doubt it.

Tuesday, November 21, 2006

What I feel

(Simplified Chinese Encoding below...)

还是用中文,身为华人写一个贴子也死都用英文,我觉得愧对自己的文化。

这些年来我大部分时间用英文来思考,来写作,有时真的对中文很陌生。 是时候啦,就算输入比较慢,也凑合凑合吧。:)

Translations:

Decide to use chinese characters, as a Chinese but keeps on using English for posting, I feel ashamed to my own very culture.

Throughout these years English has been my primary language for thinking and writing. Often I feel Chinese is totally alien to me, which isn't right. It is time now, even though the typing is slow, I will make up with that. :)

Monday, November 20, 2006

When Toys Become This....

Contrary to what the milk powder manufacturers and tuition centers want you to believe that consuming their products will make your kids smart and "so clever", we know not all kids will make it to successful and normal adulthood. No matter what brand of milk powder you feed them or what kind of conselling you provide, they just lapse into the social abyss.

Competition is fierce in every aspect of life, and it is no exception even for underground activities. To prepare them for these, we need this $14.99 GR8 TaT2 Maker by Spin Master Toys. The ad goes:

Open up your very own pretend play tattoo parlor. This easy-to-use tattoo maker kit includes an electronic tattoo pen and funky stencils. Using soft, safe pulsating action, the tattoo pen creates realistic, washable designs with dramatic effects.

This world is soooo weird. Beats me.

Sunday, November 19, 2006

Microsoft's Anti Linux Ad


This is an anti-Linux ad by Microsoft published in 2000 in a German magazine. I quote the original source on the meaning of the text, the source has a lot more on Linux and MS, an interesting read.

Microsoft's marketing focus on Linux's liabilities, bugs and 'unpleasant mutations' was made explicit in an advertisement in Germany's most prestigious tech magazine, c't, in October 2000. The two-page ad shows penguins with an elephant's nose, a frog's head and rabbit ears, with the caption: 'An open operating system does not only have benefits'. ('Ein offenes Betriebssystem hat nicht nur Vorteile.') The text continues: 'An open operating system sometimes just mutates. Conversely, Windows 2000 offers all services from a single source'.
References:
http://www.vandenboomen.org/wiki/OpenSourceArticle (Same as the 'source' link, just want to be formal on citations)

Friday, November 17, 2006

Chinese on Linux (Slackware 11)


This is the last piece that I need before I can ditch Windows completely: Displaying Chinese fonts on my Linux platform. Now reasons I boot into Windows will be to open MS Office documents or play games.

I will document the steps. Hopefully this will be of use to all others.

My system is running X Windows System version 6.9.0 on Slackware 11.

To start, you need to download the true-type fonts, can be downloaded from the following websites (one of them will do), I tried the first one wqy and it works:

http://wqy.sourceforge.net/cgi-bin/enindex.cgi (English)
http://unifont.freedesktop.org/wiki/Software_2fCJKUnifonts_2fDownload (English)
http://sourceforge.net/projects/freeunifont/

I downloaded some true-type fonts (they should have the .ttf extension) and dumped them into /usr/X11/lib/fonts/TTF.

Update the /etc/X11/xorg.conf, search for FontPath, you will see a 'Files' section. Add one more line pointing to the TTF directory, as shown below in blue.

Section "Files"

# The location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.
# Multiple FontPath entries are allowed (which are concatenated together),
# as well as specifying multiple comma-separated entries in one FontPath
# command (or a combination of both methods)
#
# If you don't have a floating point coprocessor and emacs, Mosaic or other
# programs take long to start up, try moving the Type1 and Speedo directory
# to the end of this list (or comment them out).
#
# ModulePath can be used to set a search path for the X server modules.
# The default path is shown here.
# ModulePath "/usr/X11R6/lib/modules"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/usr/X11R6/lib/X11/fonts/local/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
EndSection

Restart X-Windows.

If you are in runlevel 4 which only logs you off and show the login screen without quitting the X-Windows, you may need to restart Linux (not necessary, but easiest). Should you want Linux login to land on command prompt instead of windows manager, you can edit /etc/inittab and change the initdefault from 4 to 3. The next logon you will land on the command prompt. To start X-Windows, type 'startx'.


Thursday, November 16, 2006

On Research Integrity in Malaysia

This is an exception because I usually don't like to talk about politics. Well...

Some of you may aware there has been a heated debate on corporate equity ownership by Malays. The government's figure is 18.9%, but an independent research body, the Asian Strategy and Leadership Institute (Asli)'s Centre, reports the percentage could be as high as 45%.

To cut things short, because of all the hu-ha's, the center's director Dr Lim Teck Ghee resigned to "defend the position and integrity of independent and non-partisan scholarship"

There is an interesting interview with Dr. Lim here

We have good news and bad news:

Good news is this guy looks really far and can see the real situation in our country. Bad news is no one is paying any attention to him. Most probably he will leave the country like many other bright and capable Malaysians, serving foreign countries.

Credit: News link from Carina's page

Tuesday, November 14, 2006

GnuCash on Slackware 11. Running!


Finally I got this baby to run after hours of struggling. But the time was well-spent, first of all: I made it. Yeah!

As cream on the cake, I got the whole Gnome package installed on my computer with lots of sexy programs to play with (hey, completed with source codes. How much more we can ask for?). I am impressed by the quality of some open source software, say Gimp. I was trying to do a screen capture of my desktop and the misconception of "Linux means more nerdy work" still stuck in my mind. I was planning if I got to write a program to access the display framebuffer, read off the bitmap data, convert the raw data to compressed data, and save the file. Fine, I am ready. Guess what, the Ctrl-PrtScr sequence we are so used to under Windoze works on KDE + Gimp! Not only that, Gimp even has dedicated function (under File->Acquire->Screenshot) for this very purpose. The whole process just took 5 minutes (with 4.5 minutes playing with Gimp settings). Cool.

In retrospect, the road to this milestone (if it were really one) has been thorny and buggy, and I virtually touched all parts of the system. What I can pull off my head include:
  • Bad kernel include file. A program is using something only available in 2.6 series kernels (Solution: I pulled that header off 2.6 kernel and stuck that in my 2.4 kernel. It just works. ;) )
  • Pkgconfig problem (Solution: export the proper file path)
  • Docbook2html problem (Solution: Hack the docbook2html function to point directly to openjade, but a nasty hack because I didn't take care of some switches)
  • Guile and Slib problem (Solution: Hack the config file, as posted earlier)
  • Makefile problem (Solution: Manually add library load path on each Makefile)
  • Gnome installation problem (Solution: Clear the garnome cookie and force rebuild)
  • Crappy program Epiphany (the Gnome web browser) showing very useless error message:
    error: "mozilla" flavoured geckos aren't tasty enough!
    Ok, you can be funny, but you still need to provide more information on what the hell your program is expecting. Aren't tasty enough means WHAT??? All other issues are fair game to me, this one really pisses me off. (Solution: Just skip this crap. I have my dear firefoxy with me, I no bird it)

Nerd Score

Ok, after viewing F.Stream's nerd score, I also planned to give it a shot.

The result isn't that good, because it proves I have no life. Gah, I post it here:

I am nerdier than 98% of all people. Are you nerdier? Click here to find out!

Sunday, November 12, 2006

Slackware 11 and the Adventure with GnuCash & Gnome

I have read quite some rave reviews on the open source financial management package GnuCash. Since I have my Slackware 11 machine up and running, I thought installing this package will be something like 'a walk by the country side'.

There are a few reasons why I am looking around for accounting software. Currently I am doing my balance sheet on an MS Excel spreadsheet but it is still lacking in many ways as an accounting package. On top of that, after spending RM300 on the Windows XP home edition, I am not interested to fork out any more money to MS to get MS Office suite. Time to give GnuCash a try.

Despite this software is built on top of the Gnome environment which is not supported by Slackware 11, I still thought it would be relatively easy to iron out the differences. Well, it is totally out of hand. Until now, I have encountered roughly 20 major or minor build issues (some of them related to Gnome) on my journey to compile this. "Why don't you just download the pre-compiled binary and run it?", yeap I did, but the dependencies of Gnome is nothing trivial either. I will document the major ones that I remember:

Guile vs. Slib
Packages in question: guile-1.8.1, slib3a4

This was the first problem when I ran 'configure'. The error message was cryptic. As a background introduction, guile is a scheme interpreter while Slib is a scheme library. Guile provides a library binding for slib (slib.scm) so that Slib functions can be invoked through Guile. In return, Slib itself also provides a init script for guile (guile.init) for the same purpose.

In the configure script, test for the presense of Slib is done through

guile -c "(use-modules (ice-9 slib)) (require 'printf)"
Explanation:
guile is the program, the -c switch instructs guile to evaluate the statement after the switch (similar to the -e switch for perl). The use-modules directive will ask guile to load the slib module in the ice-9 directory. After the use-modules statement is evaluated, it will proceed to call functions available through Slib, namely require and printf. The apostrophe (') is used to quote printf as a symbol so that guile will pass it to Slib.

The statement above should return no error. However upon running this, there is an error message:

ERROR: Unbound variable: slib:features
After over 10 hours of debugging, I found out Slib changed the function name from *features* to slib:features and thus obsoletes the library binding of Guile. With this in hand the solution is simple and straight forward: either hack the configure and change that line to:

guile -c "(load "/path/to/slib/guile.init") (require 'printf)"

or you could copy guile.init to the ice-9 directory, replacing slib.scm. Some editing is needed on the guile.init file to make it work though. More specifically you need to change the first line to

(define-module (ice-9 slib))

I am not sure if this copy and paste method will break anything. You are warned.

Saturday, November 11, 2006

Making D-Link DWL-G510 to Work Under Slackware 11

[Updated Nov 12, 2006]
  • If during insmod or depmod the system complains of 'missing wireless_send_event', this means the Wireless LAN option is not compiled in. Just reconfigure the kernel and enable that, no need to select any other specific wireless driver under that option though.
I have been busy tinkering with my Linux box these days, and I am planning to write two blog entries to document my findings.

First will be this one, on how to make the DWL-G510 rev. C wireless card work under the 2.4 kernel of Slackware 11. If there are enough requests (pls drop a line at the blog comment field for that purposes), I will work on the 2.6 kernel also.
Second article will be on compiling GnuCash, I already settled the issue with guile and slib after 2 days of wrestling with it.

Back to the wireless card: I browsed the web and from this link I learned the rev. C card is using Ralink chipset. This piece of information is all I need to get started.

Before we start, here are my system specs:

- Slackware 11.0 running kernel version 2.4.33.3
- LinkSys WRT 54G as my router
- Wireless network is protected by WPAPSK with TKIP as encryption method
- My ISP doesn't require any authentication for network access
- My IP is static (WRT54G doesn't seem to work well with Linux, I can't get the DHCP to work)

Since you are using Slackware, I am assuming you have a healthy dose of background in Linux and knows how to untar files and invoke a compiler. But I am happy to add this info if there are requests.

Before you start, you need to:

Steps:
  • Untar the driver tar ball
  • cd to the 'Module' directory and read the 'readme', yes, it is important to read it.
  • [Optional] It seems the people in Ralink are using windows to edit the source codes (or the version control software automatically save files in Dos format). We need to rectify this or else 'make' will complain and choke. We can clean up the mess using the dos2unix command (if your system has it), or we can issue a perl one-liner, as documented below.
  • Command sequences:
  • cp Makefile.4 Makefile
    make
    perl -pi -e 's/\r\n/\n/g;' *
    mkdir -p /etc/Wireless/RT61STA
    cp rt*.bin /etc/Wireless/RT61STA/
    cp rt61sta.dat /etc/Wireless/RT61STA/

  • You will get a kernel moduel rt61.o, this is what you need
  • Edit the rt61sta.dat according to your need, if in doubt, please consult your service provider. The readme has a pretty decent explanations on the parameters.
  • Do a sanity check, no error should be seen:
  • /sbin/insmod rt61.o
    /sbin/ifconfig ra0 inet 192.168.1.2 up
    /sbin/route add default gw
  • Try to ping your router or any system in your subnet. If it works, then your wireless card is up.
  • Now to make it fully automatic, we need to integrate this into our system. Make the following directory: mkdir -p /lib/modules/`uname -r`/rt61, then copy the module in.
  • Execute depmod: 'depmod -a'
  • Edit /etc/modules.conf, add the following lines (I assume it is empty, or you need to adjust accordingly):
  • keep
    /lib/modules/`uname -r`/rt61
  • Next edit /etc/rc.d/rc.inet1.conf, edit the profile for wlan0 and replace accordingly with the following:
  • IFNAME[4]="ra0"
    IPADDR[4]="your IP"
    NETMASK[4]="your net mask"
  • Reboot the machine. You should be all set.

Tuesday, November 07, 2006

Trip to Tempurung Cave

Last Saturday I explored Tempurung cave with F. Stream. The cave is around 200 kilometers away from Penang.


This trip was interesting on two fronts: first, there were initially 10 people: I, F. Stream, and his 8 colleagues, but for some weird reason, all those 8 people suddenly couldn't make it at the day before with almost the same reason. Nice, only left I and F. Stream for the expedition, I still decided to go on anyway. The second front was on myself, I regard this as a challenge on planning and plunging into the unknown.

6:45 a.m.

Morning street in front of my apartment

7:00 a.m.
My breakfast
7:15 a.m.

Penang bridge in the morning sun

Braving the sun!

Scene on the way to the cave
10:00 a.m. - 10:45 a.m.
Upon arrival, the local tour guide told us the 'grand tour' had a minimum requirement of 8 ppl., so we were short of 6 and the cut off time was 11 a.m. We waited for more potential explorers to come. People flew past us, small children, young couples, old folks, foreign visitors, local teachers, but we couldn't make a match, most people just preferred the easy, dry routes and avoided the 'grand tour' which was wet, strenuous, and muddy. However we decided to fight the real war, so we kept waiting. Luck was with us finally, 6 nice fellas from LogicaCMG came along and we had a team. :)

11:00 a.m. - 2:30 p.m.


Somewhere in the cave

2:30p.m.
At the exit of the cave, yes, we were at the middle of a stream

4:00 p.m.
Heavy downpour on my way back....

Raining scene as seen through my side window

View through my windscreen
7:00 p.m.


Arrived Penang exhausted. But I still dragged myself to get a Logitech keyboard. Well, for gaming purpose. Gotta bomb da snail. :P

Lessons Learned in This Trip:
  • Plan for the worst, hope for the best
  • Break things in smaller, logical entities and conquer them one by one
  • Things aren't as tough as they seem to be, attacking will make them easier
  • Taking actions is always better than keep thinking of the consequences

Monday, November 06, 2006

Negation of Good Software Engineering

While I was reading some random blogs, Stevey's blog on good and bad agile programming caught my eyes. That article is a long-winded one, touching on the agile programming methodology.

As an example of good programming practices, he quoted Google. What I found amusing was everything we did then was exactly the negation of what is being done in Google. The up-side for me is all these things I realized were unproductive and complained loudly to the management. Even though nothing was done and I left, but I am glad at least I tried.

Here are some examples (as according to Stevey):
  • Most Google managers code at least half-time
  • Schedule pressure is minimum, at least there is no Gantt chart floating around
  • Developers are encouraged to spend 20% of their WORK hour on their own projects. Please note I high-lighted 'work' to signify these are real working hours, instead of weekend or evening hours
  • There aren't many meetings
  • The work space is quiet

Saturday, November 04, 2006

A Boring Annual Dinner

Friday night I was invited for our company's annnual dance and dinner party, however I will say the outcome is disappointing. First the food, except the cold dishes, sucked big time, second, the performances were arranged such that there was not even a minute without music and more generally, noises. Although the theme of this dinner party was 'for bondings among colleagues', but with music volume so high, definitely I couldn't talk to the person opposite the table, for those beside me, I had to yell at their ears. I really doubt if any bonding could be done.

Wednesday, November 01, 2006

How To Be a Manager, Part I

You can always learn how the best management practices from Dilbert

Original comic link is here

System Is Back Up

My system is back running more smoothly. After reinstalling everything, the mic is working now and I will stick with whatever software version comes with my Intel motherboard, as long as it works, I am happy. Upgrade too aggressively really landed me in deep trouble.

My dual boot system in action

My skype is back to business now. Random calls welcome.