Thursday, January 24, 2008

Easy solution on complex problem.

We call this "elegant solution". It is obviously very hard to achieve. One example of "Do things easy way" will be a book "The C programming Language by Ritchie and Kernighan." Reading this book several times is recommended. This thin book brought me new things each of three readings so far.
I admit that I used to be a spoiled programmer. "Jump on to the code without thorough thinking, busy in applying modern buzz worded technologies, proud of solving problems harder way than it supposed to be. Threaded, J2EE chasing, Fancy message passing methodology over MQ systems, Application Servers,.." Name it! I have tried many things on a lot of topics. Right, buzz words make my solution look fancier.
I remember a team when I was in AOL. It was my favorite team in my career so far. The team was handling 5000 servers directly, more than 15000 indirectly. To tell the truth, the best people that I remember are all them. Their solutions were very elegant. Berkeley DB was used for distributed storage. Socket was used, but home grown message router is involved in. No wonder that message router does not use any buzz word. Non-blocking IO is essential because of massive data size. But, most technical topics were pretty simple and basic. Only exception was Java WebStart. Grapher for analyzing data was written in Java Swing and it is distributed by webstart. That was convenient.

Elegant solution comes from thorough understanding of 1)nature of the problem, and 2)considering permutation of many possible subsolutions. Sloppy engineer doesn't have room to think alternatives. But, real guru can draw a complete solution in brain without touching a keyboard. And he enjoys several pictures of solutions and choose what will be the best. In this case, when he is using "global variable" (ah.. inevitable evil...), this really brings more convenience than complexity, with complete control. One example will be main() and PostmasterMain() of postgresql. It is beautiful piece of code.

Again, architecture is the key thing to make solution elegant. Do not just rush for a solution. Prepare a big chunk of brain for a complete solution. Key capability will be memory... Yeah. This is the train that I need to go for near future. Either I become a code monkey or I grow up as an architect. Things are not impossible. The best people that I remember are also 'human beings'.

Friday, January 4, 2008

simplest way for "ALT" key in xterm

After relocating to new place, Atlanta, with new work, my tasks are involved in many systems at the same time. In this case, using xterm is more useful than konsole. My konsole and emacs pair is generally one desktop, but multiple konsole or tabbed konsole for concurrent monitoring is annoying. So, working with many xterms on one desktop. xterm sucks when I need 'ALT' key. The easiest way is to replace xterm with rxvt. Here is my rxvt options:
rxvt -mod alt -bg black -fg white -vb +sb -fn 6x13

Bind this command with 'WIN'+x, then it is easy to bring up Xterm-like terminal emulator with 'ALT' enabled. If you are a fan of transparent background, Aterm is another good choice. I don't use aterm any more. First, transparency is obsolete since modern 3D based desktop manager(compiz-fusion/beryl) supports transparency for any type of win-frame. Second, more importantly, I am not a fan of transparency anymore.

One cool thing that I remember about transparent term is this. I made no-frame 100% transparent terminal with enough width. It is spawned with command "sudo tail -f /var/log/messages". It fakes like log messages flowing on Desktop directly.

Monday, December 31, 2007

Happy new year..

Unlike American culture, we Korean celebrate new year more than 'Merry Christmas'. In more detail, new year has two sorts. Solar (regular new year) and lunar ( aka Chinese new year ).
Anyway, for all of you who read this post, I wish truly your 'Happy new year.'

Monday, December 24, 2007

Emacs code folding with python

I tried out several packages. outline-mode, allout, ecb, and hide-show. hide-show was the only package that I can work with for 'code-folding'. By the way, it is surprising that ECB didn't have code folding mode, even for major languages like C/C++.

Using hide-show is very easy. No need to install extra package.
M-x hs-minor-mode will activate it.

The basic functions are:
hs-hide-block
hs-show-block

And, maybe this will be useful:
hs-show-all

It has a short cut, too. I am not used to it, at this time. Shortcut makes sense, but I call this by M-x. Maybe when I'm tired of function name, I will use their short cut key because I generally avoid my own short cut.

Tuesday, December 18, 2007

when thunderbird doesn't minimize to system tray,

issue 'kdocker thunderbird' when brining it up.

Monday, November 26, 2007

/proc/[pid]/smaps and Perl Linux::Smaps

Recently, I came across a topic about 'Memory usage'. In a doc of KDE memusage issue and a post from here, measuring memory usage is tricky especially when the process is involved with shmem and shared libraries. At the end of the doc, a reply is posted that 'from linux-2.6.14, smaps is supported.'
Okay... 2.6.14 was published in 2005. Catching up Kernel update should not be neglected like this. :) I definitely have been LAZY.
Anyway, smaps is very useful to see actual memory mapping with content of a process. Analyzing it seems awkward. So, I searched any useful tool at least making total of RSS. It seems like Perl people came up with something. ( I respect Perl hackers. ) Search for Linux::Smaps in CPAN.. Sounds very cool utility.

Wednesday, November 14, 2007

Result of new install

As mentioned, I recently wiped out my laptop and newly installed gentoo. ATI with AIGLX still has problem with Xcomposite (xorg). I thought 'well.. I will just wait and try 8.43 driver a few months later.' Right. I am no longer young and enthusiastic, but wait until someone fixes the problem.

Another issue is my Korean language pack. skim does not work with QT4, but Gentoo ships qt4 by default. I love newer version, always. But, going back to nabi for this was face-frowning situation. It's getting close to 10 years livinig in the US, I am using Korean less and less. I meet Korean people, but in the work, I use English mostly. More importantly, when I use computer, I tend to search more English websites than Korean websites. So, no Korean language until it is fixed with qt4. Again, I am getting old :)