Binary Tree November 16th, 2007
Binary tree is important topic in computer science, especially in data structures field. The important characteristics are fast insertion, retrieving sorted data rapidly. Binary tree can be described like this. Every node has two leaves nodes. One or both of these two leaves nodes maybe be empty or using computer science terminology, null. Some people like to call these two leaves nodes as children nodes. Every binary tree has one root node. So there is no ambiguity for choosing starting point. After that you will have two choices every time you want to continue your journey traveling down the tree, except when the child leaf is empty or null.
We can use binary tree as efficient data structures for sorted data. When sorted data is implemented with binary tree data structures, we can rapidly store sorted data and rapidly retrieve sorted data. If you learn C/C++ and Pascal, most likely you will encounter lesson sorting data using binary tree. In C/C++ the node is implemented with struct with three fields. The first will be holder for value/data. The second and third will be pointer to this struct type data. In Ruby you can use Struct or Class as node. You don’t have pointer in Ruby but you use object reference as replacement. Most likely you will not use binary tree as data structures for sorted data in Ruby. But there are some cases that make binary tree suitable for data structures in Ruby.
Read the rest of this entryGoodbye Firefox November 14th, 2007
I have been Firefox user for a long time. Maybe four years. Maybe I have used it since 0.8 version. Why did I choose Firefox as my main browser? Maybe I was opensource supporter. Maybe I liked the logo. Firefox is tremendous platform. You can install many extensions and themes. There are many useful extensions like Firebug, Web Developer, Swift Tab, Flashgot.
But right now I have to say goodbye to Firefox. The main reason is its sluggishness. It often lags. Sometimes it freeze. Sometimes you can not close the tab. Most of the time, it is not responsive. I can not tolerate this anymore.
So good bye Firefox. So what browser do I use? Internet Explorer is out of competition. It is Opera. The performance is superb.
What do I miss from Firefox in Opera?
Flashgot? Opera built in download manager is superb. It can resume very well not like Firefox. Sometimes after stopping download, resuming is not an option anymore. You must restart the download. If I have to download the big files, I just use download manager directly.
Firebug and Web Developer? Okay, these are the tough one. Opera has Developer Console. The function is similar with Firebug. But it is still in alpha phase.
Foxmark? Nah, I failed to use Osync. I got many errors. But Opera 9.5 supposed to have this feature built-in. Okay, I wait it.
No doubt. Firefox is more popular than Opera. It means there are some websites which display perfectly in Firefox but not in Opera. Okay, I tolerate this. Just like I tolerate website which display perfectly in Internet Explorer but not in Firefox when using Firefox.
Programming Languages Popularity In GnomeFiles.org November 7th, 2007
GnomeFiles lists apps (in source & binary) created for the GNOME X11 environment and the GTK+ multi-platform toolkit. All bindings, wrappers & their apps are welcome. I got that definition from Gnomefiles website. I am a software developer. It is normal for me to curios the programming languages popularity in GnomeFiles. A long time ago, I sent email to Eugenia, the admin of GnomeFiles. I asked why not put programming language attribute in project page. With that attribute, people can know what language binding is the most popular. She answered that it is not relevant to put programming language attribute for GnomeFiles website. The GnomeFiles website is for end users not developers. At that time she told me the most popular language binding is Python to answer my curiosity.
Time passed by. I decided to find out the programming languages popularity in GnomeFiles as opportunity to practice Common Lisp. My way to find out the programming languages popularity in GnomeFiles as you can see has many flaws. I use 1333 applications rather than full numbers, 1898 applications. I am too lazy to hunt down all applications. To find out what programming language the application uses, I extract the requirement part of application web page. The requirement usually tells us about programming language they use. For example, if the requirement tells us that it depends on gtkmm library, it means it uses C++. But there are applications using C++ as programming language but not use any binding. It uses pure GTK+ toolkit. My query will put these applications as C programming language applications. There are other flaws too. But I can tolerate with these all flaws.
Read the rest of this entryGetting Wet With Common Lisp November 7th, 2007
I have developed something with C, C++, PHP, Java, Ruby, Python, Delphi, Javascript from the first time I learned programming language. I am quite familiar with those languages. But I want to developed something with programming language which is very “different” with those programming languages I have mentioned. Those programming languages use algo-like syntax. There are Erlang, Haskell, Lisp, Scheme for very “different” programming languages camp. I choose Lisp or Common Lisp as first very “different” language to explore. Yes, in my colleague years, I have learned and developed something simple with CLIPS. But the programming language is constrained to expert system. I want to use very “different” programming language to develop something general. There are many reasons I choose Common Lisp as first very “different” language to explore. One of them is Eric Raymond. He said this:
“Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.” from http://www.catb.org/~esr/faqs/hacker-howto.html
Read the rest of this entryGetting Wet With REST And Rspec (BDD) November 6th, 2007
REST and BDD are hot topics in software development. So I want to get wet with these topics. So I learned and surveyed from the internet. Okay, I think I get it. To make it practical, I try to apply these topics to Rails. The newest version of Rails (1.2.5) has support for REST. As for BBD, you have to install Rspec Rails gem.
I decided to make a simple clone of my theatre website. I develop front end only. There is no admin interfacte. I just want to learn about REST and BDD not to develop functional website. But maybe later I will add the admin interface.
Read the rest of this entryFrom Linux To Windows XP November 6th, 2007
I have been using Windows XP full time for two weeks. It’s been so long time since I was Windows XP full time user. Maybe it has been four years. I have to tell you again that I am forced to use Windows XP because Linux does not support HSDPA USB Modem ZTE MF620. Somebody will say it’s my fault that I bought unsupported hardware. But sometimes you just don’t have luxury of choice. I move to a new place. I live in apartment which does not have internet connection. So you must find it from outside. The only practical solution is to use 3.5G wireless internet connection. Using cable based internet connection is not practical because I plan to move from this apartment. Using cable based internet connection means long term customer. Using parabola based internet is semi-practical. I don’t feel safe to put the parabola outside apartment. You can not move parabola as you like. Using 3.5G wireless internet connection only needs a small modem. Just plug to your computer then you can surf. It’s the most practical solution at this time with my condition. The only provider for this connection gave me the unsupported modem in Linux. Very nice.
Read the rest of this entryMoving To Bali October 21st, 2007
At last I can write this post. This post is about Bali. I am in Bali right now to live. Bali is my dream living place. I always want to live in Bali since third year of my colleague time (the second time I visited Bali). But the desire always been put off by many reasons. One of the reason was I have been framed to think that I must spend my all life in Jakarta because Jakarta has many programming jobs. Most of my family and my friends live in Jakarta. In Bali there is no one. Uhm, there is actually. One of my friends live in Bali. Why do I want to live in Bali? I fell in love from the first time I visited Bali. The beaches, cultures and etc. You name it.
So… There were one thing and another that burned my desire to leave Jakarta. Jakarta was getting crowded from time to time. Beside that I want to live alone without my family. As programmer I need ideal environment to work. My living place in Jakarta was an environment which had many interruptions. I could not stand on it anymore. Jakarta has been not a good place to live. And there were personal reasons too.
I landed my feet in Bali on 18th September 2007. For the first ten days I traveled around Kuta and Legian. Then I accompanied my friend coming from Jakarta to visit many places in Bali. Yeah, fun times. At that time I lived in my friend who lived here. After about ten days I moved to small apartment in Denpasar. Almost 3 weeks, I lived here without internet connection. I must walk about 200 metres to internet cafe in order to use internet connection. All I did at that time was learning programming, reading novels and planning my life in Bali. On 18th October 2007, I got HSDPA USB modem from Jakarta. My sister in Jakarta subscribed 3.5G internet account. So I use internet using her account. It is the only way to use internet here in my apartment without cables. Using internet with cables means asking problems. With 3.5G internet, you don’t need cable. Just plug the modem and you are ready to use internet.
But unfortunately, I got ZTE MF620 modem not Huawei modem. Huawei is supported in Linux but ZTE is not, at least for this time. That means I must use Windows XP to work as programmer. I have to accept this condition. I must be pragmatic. For two days I have setup my Windows XP environment so I can feel comfortable. I installed Thunberbird (replacing Evolution), Notecase, MediaMonkey (replacing the music player in Linux which the name is forgotten by me), TortoiseSVN (subversion), VirtuaWin (virtual desktops on Windows XP), Common Lisp. I upgraded Vim too from 7.0 to 7.1. But there is one thing I can not do in Windows. Developing Wallpapoz. But fortunately there was someone from Mandriva offering help to develop Wallpapoz. The plan is I will give him access to Wallpapoz repository tommorow.
Now I am ready to work as programmer.
Simple Ruby Constraint Satisfaction Problem Library August 13th, 2007
Constraint Satisfaction Problem (CSP) is a interesting topic. This was my thesis topic. CSP is something like this. Let’s say you have three variables, a, b, and c. Variable a has domain from 1 to 10 (integer). That means you can only give one of these values (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) to variable a. Variable b has domain from 5 to 15 (integer). Variable c has domain from 9 to 12 (integer). Domain is something like valid values for its variable. Then you have constraint. Let’s say we have two constraint. The first is a > c. The second is b is same as c. So we need to find the solution which need to satisfy these two constraints. Solution is described as process to give values to these three variables in one time. Giving a 2, b 7, and c 11 value is one of solution. But this is not a valid solution because it does not satisfy the first constraint. The a value (2) is lower than c value (11). The valid solution is giving a 10, b, 9, and c 9.
Read the rest of this entryThe Bourne Ultimatum August 13th, 2007
I have waited this movie for a long time. You can say this is the most anticipated movie in 2007. So I watched it in the first day release in Indonesia, that is August 10th.
This movie is awesome. Full packed with action stuff from the beginning to the end. There is a fighting scene one-to-one. Bourne fighted with Dash. Dash was in the same level with Bourne. Their movement was so fast. I can’t follow it 100%. Off course, Bourne won. There is a car chasing scene, motorcycle chasing scene, Bourne jumping from the top of the building to top of another building, entrancing the building with full security, Bourne beat all the agents guy (and Marocco policemen) by empty hand. Off course this movie has been packed with thriller too when Bourne try to sneak from spying system of CIA to meet his information source.
This movie is serious all the time. There is no joke like in Die Hard 4 movie. There is no love or sex scene. Action all the time. There is hottie off course. Yeah, Bourne’s girl was dead in the second of trilogy (The Bourne Supremacy). But this hottie is hotter than Bourne’s girl. In this movie her name is Nikki Parsson. I like her more than Bourne’s girl. She appeared in second Bourne movie. In this third movie, she is involved accidentally with Bourne. She helped Bourne to find the executor who will murder Bourne’s source of information. Because of that, Nikki was targeted by executor. Bourne saved her (beautiful, huh?!!). But after that, there was nothing between them. I understand. Bourne just lost her girl friend. If I were not mistaken, it was in previous week. It is not appropriate to do some romantic scene (especially having sex) when your girl friend was murdered a week ago. But from the conversation between Nikki and Bourne, it look like they have some kind of relationship back when Bourne is in program. So maybe in year later after Bourne found out who he was, Bourne find Nikki. And they live happily ever after.
Oh yeah, it is Julia Stiles who acts as Nikki.
So basically The Bourne Ultimatum is a heavy action packed movie. Director Paul Greengrass did a good job.
Rafaq Is Released August 13th, 2007
I know about Rails from the last year. I have bought the book (Agile Web Development With Rails first edition). Did the exercises. I also have read many articles about Rails. But I did not have a single complete Rails project. Back at the time when I was doing my thesis, I must write a program. So I used Rails. But the project was doomed because of the factory for the thesis had a very unclear requirements. The project was never finish. But my Rails skill was upgraded however.
But I still didn’t have a single complete Rails project. So in June or July, I started to write Rafaq so I can have a single complete Rails project. Yesterday the Rafaq is finished with its website. I host the project in RubyForge.
Read the rest of this entryExzoost Is Opensource Now August 9th, 2007
I started to make this software 3 years ago (November 2004). You can check about Exzoost in its project website. I always want to try Berlios opensource hosting. So I decided Exzoost is a good candidate. This is the first commercial software I developed. You know, everything first is always special.
From technical perspective, Exzoost is a java swing gui software. I developed it with Netbeans. Back in November 2004, the stable version of Netbeans was 3.6. But Netbeans version 3.6 was so ugly. So I used Netbeans 4.0 beta (I forgot the beta version). Every time Netbeans is released with new version, I upgraded Exzoost project to use new version of Netbeans.
Read the rest of this entrySelenium Takes Rails Testing to Another Level June 27th, 2007
Rails has already make testing web easier. Rails project directory has specific test directory, named surprisingly ‘test’. You want to make unit testing for model? You write it in test/unit directory. Testing for controller? test/functional directory. It has fixtures support. It means you have specific database purpose for testing purpose. Your development and production database will not be touched. It has mocks support to simulate external resources. What could you expect? Testing Rails project is a nice experience.
But Selenium takes Rails testing experience to another level. With Selenium you have user testing beside model testing, controller testing. It means you have dummy user for your Rails testing purpose. What I mean with dummy user is you have user to test your Rails web project just like you test Rails web project with browser your self. This testing type is called black box testing (external view of testing). You input data to your application and see the output. Does the output is as you expected?
Read the rest of this entryPorting C Code to Ruby June 22nd, 2007
I try to port fsplib C library to pure ruby library. What is FSP anyway? Quoting from the official site: “FSP stands for File Service Protocol. It is a very lightweight UDP based protocol for transferring files. FSP has many benefits over FTP, mainly for running anonymous archives. FSP protocol is valuable in all kinds of environments because it is one of the only TCP/IP protocols that is not aggressive about bandwidth, while still being sufficiently fault tolerant.” It is not popular option for file transferring protocol.
So why do you want to port it anyway? Because it is a good exercise for my ruby skill. I could use it as portfolio too. Another reason is I can use this as opportunity to contribute to opensource.
I decided to port it as pure ruby library rather than binding to C api because this library does need the performance but need more portability. This is second day porting the library. Here’s what I have learned so far.
Read the rest of this entryHaml Beautify Rails Code June 21st, 2007
Try Haml today if you use Rails. At first time, I feel reluctant. Isn’t rhtml is enough? But trying something with a little time is not a bad thing. So I jump to the boat. Here’s what I feel. It feels good.
Haml is alternative for rhtml. It is shorter. But what makes me using haml is it beatify Rails view. Usually using rhtml makes my html code (result of Rails view) cluttered.
Read the rest of this entryCakephp as PHP Framework June 15th, 2007
A year ago, I had a job to create company profile website for PT. Usaha Saudara Mandiri. At that time, I was Rails fans. So why not create the website with Ruby on Rails? Because the hosting does not support Ruby on Rails. So bye-bye, Rails. It means I need to use PHP. The version of supported PHP at that time was 4. I already knew that it is more convenient if you use framework than not. So I searched PHP4 framework which was similar with Ruby on Rails. I found it. Cakephp
The documentation is good but not so polished. It is similar with Ruby on Rails. So I don’t have any difficulties jumping to the Cakephp world. What annoying me is Cakephp supports MySQL only. I failed to use sqlite. What make more fun with Cakephp is they do not use any other library as dependencies. So installing and deployment Cakephp is easy.
So if you likes MySQL and Ruby on Rails but forced to use PHP (especially PHP4), CakePHP would be a good choice. The website which developed by me with CakePHP is here. Mirror is here.
Akbar