Generally, I’m not a fan of new year’s resolutions, but I think that this is important to make me move toward my short and long term goals.

My goals

  1. Master 2 or more design patterns. I begin to realize the useful of design patterns since I was trying to use singleton and factory, the most basic patterns of all.
  2. Learn 2 or more new programming languages. This is my responsible to stay on top of new technology. Python and Ruby are on top of the list.
  3. Improve my soft skills. Especially project management and communication. Being a good programmer is not all about coding honestly. You might screw up the potential project or even worst your relationship with people.
  4. Contribute to society. This world needs you. You don’t need a reason to help people. Do what you can as a programmer. Write and share your blog. Report bugs, contribute code or donate in open source project.
  5. More exercise. My abs is “united states” now. It is time to work out more frequently and consistently.
  6. Spend more time with family. Seriously, nothing is more important than your family. I worked at oversea through out the year. The time I spend with them was less than a month in a year. I should go back more often this year.

Dear readers, thanks for your supports in 2008. Here’s to a productive 2009. Feel free to suggest your resolution as well.

During the New Year’s Eve, I have received an air mail from Qingdao, China. There are 3 plastic shine effect aluminium Ubuntu’s sticker inside the mail.

Now my X60 got another piece of new “medal of honour”. Well done my buddy! I am counting on you again in Year 2009.

Ha, guess what? My IBM/Lenovo Thinkpad X60 suddenly threw the white tower few weeks ago. Hey, you not even serve me more than 2 years. Come on!

I was kinda frustrated. Perhaps I had pushing this little fellow too much. I guess? Alright, what now? Seriously, I can’t just live and spending my time watching TV during weekend.

Well, coincidentally there was an PC fair, SITEX during the weekend. As a result, I ended up so desperate and grabbed a Fujitsu M1010 netbook.

But guess what again? My X60 get repaired in 2 days. Damn, what is the point of getting a subnote if I knew the repair service is so efficient and fast? I suppose to get a decent watch like Tissot T-Touch Expert. Sigh, there goes my self Christmas present. T_T

A couple months back, I came across an interesting article about the futuristic user interfaces from Smashing Magainze. The concept that really caught my attention is the Futuristic Glass section.

It is a concept of the future of internet search may looks like.

This is really exciting concept to me but everything seem to be so unrealistic until I read about Wikitude AR Travel Guide on Android’s market. Now, we are actually a step closer to this concept. Well, at least on location based information I guess.

Aware that this is not a concept mockup that you had seen. This is the actual working application on Google Android G1. The application makes use of Enkin to “link” map and reality together. Amazing is it? It just a matter of time that we will have something similar like the glass or paper liked devices together with this navigation feature in near future. :3

Drupal 5 and above supports multiple databases connection but it does not distinguish the reads and writes among executed query. Although, this can be done by simple hacking within the Drupal core but you will have trouble when updating Drupal.

To do this without inside the application layer Drupal, I take a deeper look into MySQL Proxy. MySQL Proxy can be placed in between of Drupal and MySQL. This middleman is totally transparent to both parties. MySQL Proxy will forward the write queries to master database and redirect the read queries to slave databases. Imagine MySQL Proxy as a customer service operator who transfers your call to relevant department.

Now. Firstly, we need to install MySQL Proxy:

sudo apt-get install mysql-proxy

The good thing is there is a ready script, rw-splitting.lua, available with the MySQL Proxy to handle read or write queries splitting. So, we don’t really have to know how to write a lua script.

Then, we run the lua script with MySQL Proxy:

mysql-proxy --proxy-backend-addresses=192.168.0.100:3306 \
--proxy-read-only-backend-addresses=192.168.0.101:3306 \
--proxy-read-only-backend-addresses=192.168.0.102:3306 \
--proxy-lua-script=/usr/share/mysql-proxy/rw-splitting.lua

Change the our Drupal database connection’s port to 4040 in sites/default/settings.php:

$db_url = 'mysqli://username:password@127.0.0.1:4040/drupal';

Notice that the default port of MySQL Proxy is 4040. You may change to other port as you wish with –proxy-address=127.0.0.1:8080.

All go well during the installation. But when second node of Drupal inserted I got “Duplicate key” error.

I am out of luck and Drupal seem not running well with MySQL Proxy. The auto increment ids are all messed up and the node and node revisions relationship are falling apart. I am ready to get my hand dirty and drill into the rw-splitting.lua script. I enable the debug mode of the script to observe each query that actually take place.

I noticed that the script redirects the read of LAST_INSERT_ID to read-only database . Supposing last insert id should be returned from no others but master database. The bug happened at line 225 where LAST_INSERT_ID() is treated as TK_LITERAL instead of TK_FUNCTION

if not is_in_select_calc_found_rows and token.token_name == "TK_SQL_SQL_CALC_FOUND_ROWS" then
	is_in_select_calc_found_rows = true
elseif not is_insert_id and token.token_name == "TK_LITERAL" then
	local utext = token.text:upper()
	if utext == "LAST_INSERT_ID" or
	   utext == "@@INSERT_ID" then
		is_insert_id = true
	end
end

The bug can be easily fixed by replacing TK_LITERAL with TK_FUNCTION will fixed. Save the lua script and restart the MySQL Proxy.

Crossing my figures. Hooray, it works!. Now, I got my Drupal running with reads and writes on separate machines. Again, this is actually run and tested on AWS. :3

Once again, another anime festival was held at Suntec. And again, together with Giliam and her sis, we swarm into. Before went into battlefield, I filled myself with a big St. Louis pork ribs at Plaza Singapore. No bad but just a little bit too sweet to me.

I pre-registered for a 2 days pass a month ago but I only went there one day. Too lazy to go again on the next day even there is my lovely May’N mini concert.

UPDATE 1: Seem like somebody went to Changi Airport to welcome May’N arrival :3

UPDATE 2: Someone had secretly recorded May’N concert as well >_<

This is the entrance of AFA 08 where the crowd started.

Just around the corner, I saw Kon from the Bleach. It will be cuter if getting a kid to put on those. Nice angle! o_O

Yeah, I love you Haruhi. “A shy pose please!”… I was stoned and looked at one of the phonographer. -_-” Come on, don’t be so pervert guys!

Animax is 1 of the main sponsor of this festival.

Say cheese to pretty!

Interesting to look at this if you have time to fool around.

She is proven herself “useful” to show how big the model is. Below is the Gundam Exia cosplay. Ya, the right hand side is costumed version, as you can see it is a little bit “fat” or “out of shape”.

Unexpected doujin booths have appeared in this event with I always thought in Japan.

Shana want a melonpan here. Oishii desu?

The Mospeada does bring back a lot of memories.

Code Geass is another anime must watch for this year. Of cause the cosplay is nice too.

Gundam. A lot of Gundams.

Super duper cute Nendoroid and Tachikoma from Good Smile Company.

LaMB storyboarding from Yasufumi Soejima. You can get his autograph on the limited poster that day.

Overall, this festival is better than the previous “toy fair” that I attended few months ago. By the way, it seems like locals don’t feel the pinch of economy crisis at all. People still spend like… well you know. This makes me feel like the news is bullshitting all the time or just people already get used to such lifestyle?

Again, I buy nothing for myself even though the figurines are so tempted and adorable. Looks like my angel wins again.

描写未来,人类早已因新种病毒灭亡,剩余的人类因而捨弃了肉体,以人体数据(META-Body)化储存入的量子伺服器(Quantum Server)里。而因为人类的数据太过庞大,所以每半年就要Reboot一次。这时所有人的记忆就会被倒回到初期,除了已觉醒的的人类,Celebrant,除外。

由于人类完全是数据资料,要在现实世界里活动,只能藉由人形机械,才能在虚拟世界里操控现实的战鬥,有点类似骇客任务(Matrix)。虽然此动画内如Gundam等有人形机械与战斗场面,但这些并非此片重点。

此动画是继攻壳机动队(Stand Alone Complex)之后,被埋没的科幻动画钜作。也许这部动画并不是很受欢迎的主要原因,是用了许多相当艰深的概念,如Quantum Physics,甚至是许多哲学上的思辩,需要另一种更深层的思考,如生命的存在价值。结局方面,也有让观众想象空间,比起其他老套结局一幅大合影来得好。

总结,这是一部适合愿意动脑,物理资讯哲学神话融合的作品,能接受丰富的架空世界的人观看的动画。本人强力推荐,而在落笔前,送上此作迷人动听的片尾曲 “Little Goodbye リトルグッバイ” MV。

Last weekend was my first attendance in open source conference, FOSS.my 2008. I traveled all my way from Singapore during the midnight 12:30AM and reach Kuala Lumpur in morning 5:30AM. It was very tired, I swear! But, I was so exciting and can’t wait to see it.

We got awesome speakers in this conference. We got Jaya Kumar - one of the great Linux kernel contributor, Toru Maesaka - one of the memcached developer, Pia Waugh - the director of OLCP Austrialia, Pamela Fox - one of the Google Map API developer and much more.

Who say no chick in OSS? Dare you say it again!

Aizat Faiz talked about building the awesome Jabber Bot.

Toru Maesaka unveiled the scene behind mixi.jp and talked about memcached.

Pia Waugh presented us with the OLPC, deployments and communities.

I got my first hand on experience with OLPC. Pia Waugh said we can request a unit of this little machine. To try, to develop, and to hack.

Our cute little penguin grab away a OLPC just because of her reason “I want!” 囧

I really enjoyed and learned a lot from this conference. I begin to feel like contributing to the open source rather than just being a user or bug reporter.

There is a BarCamp next month in JB. I will defintely attend it.

About this blog

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros. Aliquam pharetra.

Advertisments

  • teonator: @Jasmine: I would suggest you get an Amazon Kindle instead. or any reader that with WIFI. There are [...]
  • Jasmine: Hi, this is Jasmine here. I'm thinking to buy the same reader, what is your comment on this reader? [...]
  • teonator: @Pablo: Hi sorry for late reply (very late one). Hope you are doing fine there. I am not using MySQL [...]
  • Pablo Cerda: Hi, we follow the steps described in your post to handle que drupal queries via Mysql proxy. If we t [...]
  • 三吉: wa...isnt a games?.... [...]