Ruby is a powerful dynamical programming language. You can easily use it to build large and complex software. However, there are times when you just want to use it to make a basic script to automate your workflow, and simply run it by typing: ruby your_script.rb. The problem comes when you want to let your Read More →

Recently, our filtering worker that I wrote in Java, kept getting connection errors. The worker uses JDBC to connect MySQL server and do some queries. The errors are like this: [ERROR] Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. [ERROR] Caused Read More →

Recently, I’m trying to implement a real-time notification feature to our Rails application. Socket.IO from Nodejs is really a good choice, and since I’ven wrote pretty much code using Eventmachine, it’s really not hard to understand it. Turns out the real ‘bitching’ part is how to share sessions information and do authentication between rails and socket.io. Firstly, Read More →

Gisgraphy is a free opensource geocoding and webservices solution. It is a greate alternative to google’s geocoding API, which has lots of limitation on usage. Gisgraphy can provide the best relevance of geocoding, since it combines both geonames and openstreetmap dataset. In fact besides geocoding, Gisgraphy can be used for Reverse geocoding / street search, Street search, Find nearby, Fulltext search, Address parser. I’d recommend you go to their demo site Read More →

There are three classes in Ruby that handle date and time. Date and DateTime are both from date library. And there’s another class Time from its own time library. Both DateTime and Time can be used to handle year, month, day, hour, min, sec attributes. But on the backend side, Time class stores integer numbers, Read More →