Saturday, April 29, 2006

Bye Bye Blogger...

Yeah, I've moved to a new site -- suksit.com (That's my first name ^^). Because I miss some features that Blogger does not provide so I just create my own blog using Drupal.

However, thanks to Blogger for providing me a place to start blogging :)

Sunday, April 23, 2006

Emacs and X.Org rgb

Due to Blognone Tech Day 2006 effect, I came home and installed Emacs to try it out. emerge -av emacs went fine without any errors but when I try to start emacs from Terminal, here's what I got:
$ emacs
Undefined color: "black"
Googling around, I found that Emacs was looking for "rgb.txt" which did not exist on my system.

This is because I'm using X11R7.0 -- a completely modularized X Window System, and it doesn't come with all the tools like X11R6.x package. So I have to manually emerge -av rgb to get the rgb application.

After emerge finished, I tried to run Emacs again and still got the same error. Another google search, it suggested I should take a look at /etc/X11/xorg.conf for RgbPath. In my xorg.conf, it reads:
RgbPath "/usr/lib/X11/rgb"
But "rgb.txt" wasn't there, so where is it? I typed in locate rgb.txt and found that the file was in /usr/share/X11. Then I modified xorg.conf according to the path that locate told me:
RgbPath "/usr/share/X11/rgb"
Restarted X, called up Terminal, typed "emacs" then hit Enter... and wheeeee! Emacs popped up! Time to check it out!


ps. Now I know one Emacs command -- C-x C-c :P

Saturday, April 22, 2006

Blognone Tech Day 2006

Today I went to Blognone Tech Day 2006 seminar at Kasetsart University from 1.00pm to 5.30pm. The concept of the seminar was "Developer's Exchange", which was a mixed of various topics.

Each topic was described in a short and easy-to-understand way -- mainly to give the concept/overview about the topic and to introduce the presenter whom the audiences can contact later if they need more details.

Here're the topics covered today:
  • Ruby on Rails by Polawat Phetra
    I was late and by the time I arrived the presentation was almost finish. However, I still had a chance to see some demos and was impressed to see that your can create an AJAX-ed webpage with only a few lines of Ruby code.
  • Python on Zope by Sugree Phatanapherom
    Couldn't really catch up the details because I was sitting in the far back and could not see well. However, I think it's more difficult than RoR, and Sugree said there are not many hosts that support Zope. So just knowing that "Zope" exists is enough for me :)
  • Mono: Open Source .NET Framework by Wiennat
    A nice presentation about .NET Framework architecture, why Mono was developed and its features. BTW, Mono = Monkey XD
  • Emacs: Hacker's Text Editor by Poonlap
    Brief history of Emacs and introduction of its features. I've never seen a text editor that is capable of playing games, surfing internet, checking emails or even providing an AI to talk to. I just came back and emerged emacs right away, gotta try it!
  • IP PBX using Asterisk by Dome Charoenyost
    Completely lost about what the presenter said (out of my field, I guess). But we sure did enjoy the presentation and laughted a lot ^^
  • Linux Virtualization using Xen by Somphol Boonjing
    Shows another solution for virtual hosting on Linux. But I still think VMWare is better...
  • Game Theory by Jittat Fakcharoenphol
    Describes the Nobel Prize-winning theory of John Nash (there is a movie about him -- A Beautiful Mind). There were a bunch of examples, but I'm still not clear about how can it be used in real life =.=
  • Emerging Technology 2006 by ปรเมศวร์ มินศิริ
    Shows that the world is walking towards Web 2.0. In the future, all applications will run on internet and will be platform-independent.
  • Thai Word Breaking using ZWSP by Wason Liwlompaisan
    An idea of how to break Thai words correctly e.g. "ตากลม" can be separated into "ตา-กลม" and "ตาก-ลม" and both words do make sense. Lew's solution is to have a special Unicode character -- "ZWSP" (I guess it stands for something like "Zero-Width Space") -- inserted between each word. It seems to be an elegant solution but I still wonder how can we manage to input this special charecter between each word we typed?
Phew!... Quite a lot of topics in just 4 hrs and a half, right? However, it helps opening my vision about programming and new technology a lot. And I just love the Blognone t-shirt!! Hope there will be a seminar like this again :)

ps. Too bad I didn't get the Ubuntu Stickers :(

Tuesday, April 18, 2006

DOS vs UNIX line breaks

I was writing a shell script to parse some data in csv format generated by Microsoft Excel and was wondering why the script didn't work as I expected.

I took a look at the .csv file using more command and it looked OK to me...

Half an hour passed by and I still cannot figure the problem out, I used vi to open the csv file and saw that there were additional ^M characters everywhere in the file.

After googling around for a while, I found that the ^M's were there because the csv file contained "carriage return (\r)" characters, which is the default line break character in Windows, instead of "new line (\n)" characters as it should be. To fix this problem, I have to execute the command
tr "\r" "\n" < inputdata.csv > gooddata.csv
to remove all ^M's and after that my script worked just fine.

Xfce 4.4 beta1 released!

Image from Xfce Diary
Xfce is a lightweight desktop environment for various *NIX systems. Designed for productivity, it loads and executes applications fast, while conserving system resources.
Xfce 4.4 beta1 was released yesterday. Here are some new features:
  • Thunar File Manager a new file manager that replaces xffm.
  • Desktop Icons the most requested feature is now implemented.
  • Panel is completely rewritten. You can now add/remove as many panel as you wish, panel plugins can be downloaded at xfce-goodies, including xfapplet which allows you to use GNOME applet on Xfce panel.
  • Others
    • Preferred Applications allows you to choose default application for web browsing, mail reading etc.
    • Mousepad a notepad-like application for Xfce
    • Orage a calendar application for Xfce. I'll just use Google Calendar anyway ;)
More info and screenshots are available at Xfce Diary. Give it a try! And you may never want to use GNOME or KDE again XD