Sunday, July 15, 2012

Sed performance issues on Mac OSX? Use GNU Sed!

I often use sed when developing, for example to clean some input files or extract useful information from logs.

I used to use the default implementation provided in Mac OSX (10.7.4). But this week I face a massive performance issue. One of my script simply takes forever to run.

Saturday, September 24, 2011

Throw an exception from a Java thread and handle it on the parent thread

Let say you want to compute a result in the background of a program. Usually it's achieved by encapsulate the task inside a Runnable object and run it in a new thread. If an error occurs during the process you want your program to be notified and handle errors. But unfortunately the run() method of the Runnable interface doesn't allow to throw exceptions.

In this post I will demonstrate a way to achieved that based on Callable and Executors.

Thursday, June 2, 2011

Run TcpDump from Android application and read output

Few month ago I start to write an Android application for an academic project, the aim is to build a network management tool for Android.


The first step to build this application is to intercept packets. To achieve that we use TcpDump. Run TcpDump seems easy at first, but actualy it's not. I will demonstrate in this post how we achieve that.

Tuesday, May 24, 2011

Implementation of the parallel odd-even transposition sort algorithm with Open MPI


Today I want to share with you my experiments with Open MPI, an open sources implementation of the MPI interface. Open MPI is a C library that allow you to write parallel programs and run them on a computer cluster.
I start my experiments during labs of the parallel programing course at ESIAL. We implements servals algorithm including the parallel odd-even transposition sort algorithm I will show today.




Saturday, May 21, 2011

Test root apps on Android Emulator



The Android Emulator provide a powerful way to test Android applications. But it not allow you to test root apps because you can't get root privileges via su on the Emulator, although it's possible via adb shell.
So if you want to test root apps you have to get a rooted emulator. It's mean a su binary and optionally the superuser app which allow you to manage root apps.



Here is the list of commands you have to run while the emulator is running : 

 adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system  
 adb push su /system/xbin/su  
 adb shell chmod 06755 /system  
 adb shell chmod 06755 /system/xbin/su