2010
02.06

Life, early.

I usually work at night, like most programmers I know. But recently, I wake up early, i.e., before sunrise, and somehow I can accept it. Isn’t it a sign of old age?

2009
10.18

FIXME and TODO

Usually, when I write code, sometime I put comments with TODO and FIXME, the former one means that this fragment of code is just a temporarily one, kind of quick fix or patching the balloon. I know I need to do further, but the priority is low. The later one, I know it might has some possible bugs, but I believe it’s not crucial or rare to occur. So, just leave it there and take my chance.

How about life? how many TODO and FIXME we’ve placed along the way? I’ve plenty, I know. Question is, when should I fix those TODO and FIXME, well, it should not be another TODO… Otherwise, it’ll be infinite loop of TODO, which is very bad.

Try to resolve your TODO and FIXME as soon as possible, both in your code and in your life. Your life is shorter than you think and your code can break earlier than you think.

2009
10.12

No code

Haven’t written any program for sometime, I believe I’m more sensitive now. Why?, you may ask, I guess it’s because when I write code, I become more logical, deterministic and autonomous. In essential, without code, I lose my Von Neumann side and gain human side; humane, instinct-driven and lovable (ewww!). I consider these properties are too dangerous for me, so I should read more code then.

Programming bug is relatively easy to find and solve, relationship bug is unsolvable.

2009
03.24

Me, EEE and GMail


My EEE has 1024×600 screen. The height of 600 is not a big problem because we have scroll bar. But the width of 1024 is too short for all google-service-you-want-to-use, my gmail address, “New stuff in Labs!”, some icons, “Older Version”, and something else. So, that top line is broken into two lines, which use more space on width (It’s ok for now, remember? we have scroll bar). But, Google, can you fix this? remove either “Older Version” or “New stuff..” and I can live peacefully with my 1024 width screen.

2009
03.24

Py-XChat-Twitter 1.3.0

The new version of Py-XChat-Twitter is at the google code project page. With this version, you can dm or rt the others. Next major version (1.4?), I will implement some kind of python thread, so XChat won’t get freezed when you post (or retreive) tweet.

2009
02.28

Ok, this is the third revision of my XChat/XChatAqua python plugin for twitter. Actually, I create a google-code project for this script, so it might be a good idea to visit the google-code to get the latest code/update. Anyway, I will post the update to the code at this blog also (otherwise, it will be too quiet here, ha ha ha).

In this version, a new command, /replies , is added to retrieve your @replies list. Also, the update on friends’ timeline with your name inside will be marked with red, to make it easier for you to see someone try to talk with you.
I’m thinking what to add for the next version, any idea?
2009
02.20

Ok, this is the second version of my python twitter script for x-chat. You can see the first version here. In this version, two features are added:

First, the ability to redirect the output of twitter to a particular channel. In the previous version, the messages from twitter will go to your current channel. In this version, you can specify the channel you want to redirect messages to in the configuration file, like this:

[twitter]
username = yourusername
password = yourpassword
interval = 300
channel = yourchannel

Don’t put # in front of your channel name.

Second, a new command, /replies , can be used to retrieves the replies list.

You can download it from here. And again, the license is WTFPL, so do what ever you want to do with it.

2009
02.18

Erlang toolbar

Very useful set of command for developing software for erlang.

toolbar:start().

2008
12.18

Tripitaka in XML

I’ve produced an XML representation of the Tripitaka (Kingdom of Siam version). It can be access here. The  XML scheme in used is DocBook, so it should be easy to process. If you need more information in Thai, please go to this page.
2008
10.23

Twitter Script for X-Chat

The situation

Ok, the problem is I’ve to many programs opened at the same time in my Macbook. One for IM, i.e., Adium, one for IRC, i.e., X-Chat-Aqua, and one for twitter, i.e., Twhirl, which is not good. In Ubuntu, Pidgin will handle whole thing beautifully (yeah, you need mbpidgin plugin for Pidgin). Unfortunately, Adium can’t do that so I’ve to find another way out.

Then, I found this page on Internet discussing how to write a python script for posting tweet from X-Chat. Then, I combine it with the code from the sugree himself for syncing twitter and NokNok. Finally, I got this code for posting tweet to and retrieve updated from twitter within X-Chat.

First, you will need to install simplejson and python plugin for X-Chat. Then, put the code into Plugins directory of X-Chat, in my case, it is /Applications/X-Chat Aqua/Plugins. Next, you need to create a configuration file, called .xchattwitt.cfg in your home folder. Inside, put your twitter username/password and update interval like this

[twitter]
username = myname
password = mypassword
interval = 300

The interval is in second. Finally, restart your X-Chat or load the script into your X-Chat. Then, you can tweet by typing “/tweet This is my message” in any window. The updated tweets will be shown on your current window, with Twitter user name. If you don’t like any of this behavior, you can change it from the code.

Code:
You can download the code from here.

License:
The code is distributed under WTFPL.

Contact:
@pruet

Thanks:
Ryan Paul and @Sugree