Sunday, July 31, 2011

Reuse gettext gem to parse .po file

I am working on a translation service which requires translating .po file (ruby gettext gem). Spent hours to understand the rake tasks it provides and looked for methods to extract all String inside .po file. Finally found the parser and the method to do my job:


require 'gettext/tools/poparser'
require 'gettext/tools/rmsgmerge'

parser = GetText::PoParser.new
result = parser.parse_file("...../my_rails_project/po/en/text_domain.po", GetText::RMsgMerge::PoData.new, false)

the object representing the data structure is assigned to result.


In case you are also extending gettext library, check the gettext/tools directory. Most of the useful methods are located there.

Friday, July 29, 2011

Support website video in every browser

to make sure your video clip is running in every browser, read this:
http://diveintohtml5.org/video​.html


start from beginning if you want to know everything, or else start from "what about IE?". sample code provided at the end.

Introduction to Maven

Maven is a build tool which handles project dependencies and job automation. In most of my java and scala projects, I use Maven.


Especially in a team working environment, you need build tool like maven to synchronize version of modules and libraries between each developer workspace. So, one coder specifies what he needs for his module, commit the maven configuration file (pom.xml) to source code version control. Another developer pull down the latest pom.xml file from version control and then his local workspace knows that the module requires a new external library.


The next magic thing maven provided is the centralized library repository. So following the previous example, when the second developer builds the project, maven will automatically access the repository, which exists somewhere in the internet, and download the libraries. It saves everybody so much time to handle libraries versioning in each machine. There is a library search online: http://mvnrepository.com. Instruction to update your pom.xml is also included there.


Another magic thing you frequently use with maven is continuous integration. Maven handles dependencies and also able to run unit tests, packaging, deployment, code quality reporting, etc. So that developer can solely focus on coding instead of managing all those repeating mundane stuff.


Check out maven if you have never used it before. Google mvn archetype:generate, and then you will find some useful stuff to follow. Enjoy !

Playing video on website with all desktop and mobile browser supported

Once you started putting video on your website, you will soon find out that you cannot make every browser happy... IE, desktop browser, iPad tablet browser, iOS mobile browser, etc.


The usual solution is to use something like 'Video For Everybody'. but you still need some extension to handle Android one.


Here is the website which talks about the issues in each browser and provides a sample solution for that: http://diveintohtml5.org/video.html


If you are interested in knowing everything, read from the start. or else start from "what about IE?"

Friday, July 22, 2011

Upgraded my Mac Book Pro to SSD Drive and 8G RAM

this is really fast, booting the mac book is like waking up from sleep mode. awesome ~ I didn't measure the time difference, but I am sure you can find lots of proof from youtube. this post is just to reference the compatible SSD drive.


this is my Mac Book Pro model:
Model Name: MacBook Pro
Model Identifier: MacBookPro5,5
Processor Name: Intel Core 2 Duo
Processor Speed: 2.53 GHz

this is my new SSD drive:
PLEXTOR  PX-128M2S


please be aware that this one is SATA 3. I tried another Intel SATA 3 before which did not work on my Mac Book pro.

My Mac Book pro does not support SATA 3, so it will run as if it is SATA 2. However, I can still use it for my next machine. not bad.

Wednesday, July 13, 2011

Agile In Thought Sauce (slides by Jekyll and Hyde, at github pages)

Another Jekyll and Hyde presentation, this time I deploy to github pages directly.
http://thought-sauce.github.com/agile_in_thought_sauce.


The sharing is about Agile planning and Agile development in Thought Sauce. Will go to Octopus Cards tomorrow to share our experience.