Installing HomeBrew without XCode

Since I have a SSD in my laptop, I am always looking after things that waste the precious space of my main drive. Although I have a 120Gb drive, I have to say it is rapidly filled at 80% (maven downloading the internet syndrome). On of the good thing owning a Mac is the Unix subsystem allowing to use almost every software written for the Unix world.

There is some package systems for Mac OS X, MacPorts, Fink, HomeBrew being the last one and the most convenient one. When I last switched to a Core i7 MacBook Pro, I migrated to HomeBrew and I have to say it is way lighter than MacPort. The only thing I find cumbersome is the need for a complete XCode install on drive, even though I do not develop using XCode. XCode is a heavy tool suite, weighting about 5Gb on your drive, only to get the tools needed for HomeBrew.

The nightmare is now over, Apple released Command Line Tools for XCode, that you can download on the official Apple Developer Site (you will need to log in with a valid developer id account, this is free don’t worry).

Here is a simple step by step guide to uninstall XCode and replace it by Command Line Tools :

  • Go to the Apple Developer site and download the dmg image of Command Line Tools
  • Open Terminal.app and run
  • sudo /Developer/Library/uninstall-devtools
  • Open the dmg image and install the tools

That’s all folks ! You can now install HomeBrew and enjoy your favorites open source software without the whole XCode suite.

Android : Detect AdBlocking

Developing for Android is really fun, as you have probably noticed if you want to have a wide user base you will have to give your application for free on the Android Market. From there, you have different way to monetize your application, you can limit features and unlock them in a payed version, display ads in free version and provide a way to disable ads (in-app purchase for example). In this article I will explain how to detect ad blocking in your applications.

Continue reading

HP Touchpad quick hacks

I am one of the lucky guys getting this hyped discontinued tablet from HP at the lowest price. I’ll sum up here few things I did on it.

First impressions

I am an iPad owner for almost a year now, so I have my habits and I now know that tablets are mainly useful for consuming content (producing content is not really convenient when you have to use the virtual keyboard). The Touchpad is really what you expect from a tablet, full web consuming, multitasking, flash support, at a really decent speed.
Continue reading

Convert a mySQL Database from latin1 to UTF-8

A frequent problem when it comes to internationalisation is proper handling of different charset. When you’re using Java and Maven it is relatively easy to set up source encoding to UTF-8, but the frequent point of failure is in the SQL database.


If you use mySQL, and you have latin1 tables, but you should have UTF-8 instead, use this little script to convert from latin1 to UTF-8 :

mysqldump --user=${USER} --password=${PASS} --default-character-set=latin1 --skip-set-charset ${DATABASE} > dump.sql;
sed -r ‘s/latin1/utf8/g’ dump.sql > dump_utf.sql
mysql --user=${USER} --password=${PASS} --execute=”DROP DATABASE ${DATABASE}; CREATE DATABASE ${DATABASE} CHARACTER SET utf8 COLLATE utf8_general_ci;”
mysql --user=${USER} --password=${PASS} --default-character-set=utf8 dbname < dump_utf.sql

Generally speaking, don't hesitate to always put the --default-character-set=utf8 on all the mySQL commands you execute.
Don't forget to add at the end of your jdbc connection url the following parameters : "useUnicode=true&characterEncoding=UTF-8" to ensure you connect using UTF-8.

IntelliJ + External Library + @PropertyKey How To

I am a daily user of IntelliJ IDEA to edit my Java code and Apache Wicket to write my web application. I decided recently to use IntelliJ’s annotations to make my code a little more robust by using @Nullable, @NotNull, @NonNls and @PropertyKey.
In this blog post I explain how to manually add annotation to an external library.
Continue reading