Why I like Uber

11 décembre 2011

In case you missed it, Uber is an application that lets you request a car from your smartphone (there is an iOS version and an Android version). Up until recently, Uber only worked in a bunch of US cities (San Francisco, New York City, Seattle,  Chicago, Boston and Washington DC) but now it also works in Paris. I was thrilled at this news, first because I can see myself using it someday in one of these two situations:

By the way there might other occasions but right now I can only see these two, given that the service is a little bit expensive.

But the reason why I have a thing for Uber is that I (with two other persons) tried to build a similar service once.

Back in 2008 I decided (with two friends: Souad and Safa) to enter an annual competition sponsored and hosted by Microsoft, called Imagine Cup. Each year there is a theme and in 2008 we had to come up with solutions for protecting the environment. So back in August 2007, we started brainstorming many ideas,  sketching them and after literally 3 months we had that *Eureka* moment when we thought about building a real-time carpooling solution.

Introducing PickMeUp

PickMeUp was a mobile application that let you request a ride in real-time. It worked exactly like Uber except for one thing: every user could become a driver, whereas in Uber you have to be an official driver. This is the main reason why we used the word carpooling when pitching our idea while Uber doesn’t. Apart from this difference, there were many similarities in the way the product has been designed:

Yes you have read that last sentence right, the app was really built on a Windows Mobile device. In case you don’t believe me, here is a short demonstration that we used as a proof of conceptfor that competition (full disclosure: this is the first real app I have ever built, don’t expect much from the UX nor the quality of the demonstration) :

A few things you may have noticed:

What I feel from this last point, is that it’s important to be at the right place and at the right moment. In 2007/2008, having a Smartphone that could run rich apps was a big deal and very few devices were capable of offering a correct UX (The HTC Diamond was one of those). I wish we had the possibility to develop a working prototype on Android or iOS and I wish we were in an environment that favorited entrepreneurship and risk taking.

But let’s face it, the execution that Uber made feels just right. The fact that the drivers are requested to obtain a licence from Uber removes all the security issues. The fact that you are required to link your credit card during the subscription and that the price is calculated by the service makes the experience easy for both the driver and the rider, who don’t have to manipulate money anymore.

If you want to see, what is like riding an Uber cab, you can watch this video from Loic Lemeur who is the first Uber user in Paris. I can’t wait to try it one day.  Folks, please, steal my wallet!!

Test your Android app on many devices

4 décembre 2011

A few days ago I saw two tweets from  Pamela Fox where she complained about how hard it is to make an Android application work on all the known devices:

She is right, even by following the best practices published by Google, you never know whether your app will perform the same everywhere until you actually test it on all the hardwares, all the resolutions  and all the Android versions. This fragmentation is what makes programming on the Android platform so hard.

Yesterday I have thought about a possible solution that would rely on Crowdsourcing. This is how it works: Testers register to the platform by listing all the devices they can test the applications on. Then for each test, they would have to answer to a set of simple questions written by the developer(s). Of course, the platform will reward the testers in one way or another (or each developer would reward the testers in their own way). Hopefully some solutions like this one exist like  The Beta Family. To be honest, it doesn’t seem like they have a lot of testers/developers relying on their service and there are certain things that I would do differently (like making sure that the beta can be downloaded immediately).  So it would be interesting to rely on other type of platforms.

In fact there are other cloud based solutions, where different devices are available for your tests on the Cloud. Good examples of these are: Perfecto Mobile and Device Anywhere.  I haven’t used one of these platforms yet, in fact I am not a test freak I just focus on testing on 3 different devices (3 completely different configurations, resolutions and Android versions) and I make sure to follow the best practices to deliver a high quality application. But if you have, please leave a comment and tell us what was your experience like.

Also, please drop comment if you happen to know other platforms/solutions to help solve that particular problem.

Thank you Stanford.

24 novembre 2011

Dear Stanford,

By this blog post, I would like to tell you how much I am grateful to you for putting all these classes online.  First you taught me how to program on iOS from scratch and now you are teaching me AI and Machine Learning.  I am so looking forward to following your different entrepreneurship courses  to start the year off right.

It doesn’t matter why you are doing this, I just wanted to say: Thank you!

Dear Reader,

Turn off the TV, and start taking one or more of these free classes:

Seriously, turn it off!

I am going to DroidconUK!

9 septembre 2011

Remember that last blog post where I talked about an Android event called Droidcon? The next one will take place in London and I am glad to announce that I have kindly been invited, as a Student, to attend this event.

This is very exciting, because:

The event will last for 2 days. Day 1 will be reserved for Barcamps where Android developers will gather to talk about different topics chosen by the attendees.  Day 2 is a multi-tracked conference. I HATE (in the positive sense of the term) multi-tracked conferences, I wish I were able to split myself in two in order to be present at different rooms at the same time, but let’s top ranting about this. Let’s make a choice!

This is the program I will be following:

  1. 10:10 : I’ll start the day in Room 2 to attend the Wireframing Like a Pro session given by Greg Taylor. I think this is a great way to start the day. Wireframing is one of the most important things to consider when it comes to designing a new product. I don’t know whether Greg will talk about tools or processes, but in any case I will certainly learn a LOT from his talk!

  2. 10:45 : I think I’ll stay in Room 2 to watch Nick Butcher talk about Excellence in the Android User Experience.  It is clear that a good user experience is crucial for the success of a Mobile application. Think about what all the top notch apps have in common? A good user experience, PERIOD! So hopefully, I’ll learn a bunch of tips form this talk that will help me build better and more successful applications. Finally, this talk is short enough to let me jump over another session when it’s finished.

  3. 11:35 : Room 2 again! Mustapha Isik will talk about building games for the Android platform. Back in 2003, I came into programming (for real) by building games in C++ (most of them were very simple though, Tetris, Snake, PacMan and a few failed attempts to build a RPG).  Although I’m not into this anymore, I’m very curious about what it takes to build games for the Android platform. And who knows this talk may revive the passion that I had for building games!

  4. 12:20 : Let’s move to Room 1 now. Why? Because Mark Murphy himself (same as Chuck Norris but for Android instead of kicking asses), will talk about Traceview and MAT for Fun and Profit. MAT stands for Memory Analyser Tool, which is an Eclipse plugin that helps you reduce the memory consumption for your app and helps you find memory leaks! Traceview is an Android profiler that I tried to use before unsuccessfully as you can see in this StackOverflow question that I asked before. Wait! 130 talented developers took a look at my question and none of them dared to answer? Hopefully, I’ll be able to answer it myself at the end of this talk! Note also that this is where I hate multi-track conferences the most. Because during this talk I’ll be missing another talk about game programming on Android given by Yosi Taguri and a talk about Test Driving Android Apps using Roboeletric given by Joseph Moore from Pivotal Tracker. But hey, c’est la vie !

  5. 15:06 : I stay in Room 1 to attend a talk given by Richard Hyndmann about Android Market for Developers.

  6. I just realized that the dice are already rolled here, since Room 1 hosts the longest talks in duration. However, there is one particular talk that I want to attend which is Massively Scalable C2DM with QoS and SLAs given by Dylan Boyd. So this is obviously about push notifications on the Android platform. I have been using C2DM for one of the projects that I have been working on and it works very well, but I still have a lot of questions about it and I hope this talk will help me answer them. So may be I’ll start moving back and forth from Room 1 to Room 4 starting from 15:40.

This will be very exciting, I can feel it! One last thing, I still don’t know where to sleep there! Do you, dear reader, have any good plan? Youth hostels are cheap but I have never experienced any before. The thing I am worried about is not having a good sleep because of roommates that come in at 4 AM or something. Generally I am not a heavy sleeper, I usually go to bed somewhere between 3 AM and 4 AM and wake up at 9 AM. But this time I want to sleep normal 8 hours in order to be fresh for the conference and for visiting London in good conditions!

Any good plan? Anyone looking for a room as well? May be we could take one BIG room at a youth hostel, for many droidcon attendees that are on a low budget as well, in order to reduce expenses?

Let met know, and I hope to see you soon at Droidcon UK 2011!

ZOMG, Droidcon 2011 London is coming!

22 août 2011

As an Android developer (yes for the last 3 months I have been doing a lot of Android development during my internship) there is one hell of a conference where I would love to go and that’s Droidcon. Droidcon, is typically a european based Android conference. Among all these Droidcons, the one happening in London on 6 & 7 of October 2011, is particularly interesting and well… intense!


Well, first let me tell you about the speakers:

Again, check the entire list of speakers here.

The talks are also various, ranging from very technical presentations (Game development, managing concurrency on multi-core processors devices, unit testing your app) to more generalist presentations (running a private beta on the Android market, Security etc.). The program of the conference can be accessed here.

Of course, we can watch these sessions later or via streaming but nothing can replace a physical presence to the conference where you could actually meet and talk to other developers, exchange ideas, find some business opportunities etc.

To finish, the registration is not that expensive (150£) and I have actually never visited London, sounds like a great occasion to do it!

What do you think? Did you go to Droidcon London 2010, was it worth the commute/money?

Tell me about it!

RubyConf 2010 – ZOMG Why is this code so slow?

5 août 2011

In this blog post, I am going to continue what I started earlier. In other terms, I keep watching Ruby & Rails related conferences videos on Confreaks, and summarizing them on my blog. Today, I watched a very interesting talk given by Aaron Patterson (aka @tenderlove) called ZOMG Why is this code so slow?. Aaron is the father of Nokogiry, and he is basically  the only one who is contributing both to Ruby and Rails (where he is the 4th top contributor)! He is also very fun to listen to, very comic but serious about the stuff he is talking about. (he actually reminds me of Scott Hanselman in the .NET world).

So the goal of this talk was to talk about the performance improvements that he made on ActiveRecord while rewriting ARel. Or no, wait! It was about the work he has done on ARel while improving the performances on ActiveRecord. Seems confusing? Actually, it is not. The goal of his talk was to explain how he fixed the performance issues on Rails 3.0.  Rails 3.0 has (or had) performance issues? Turns out, yes! In fact, ActiveRecord was 5 times slower than Rails 2.3! Now things are doing better thanks to his work, but what did he do exactly? Let’s go into that! Summary starts…

What’s ARel?

Are the performance issues related to Ruby?

When should we make our code faster?

How do we know that it isn’t fast enough?

What is the basic thing that we need to do when working on performance?

But, what do we need to measure?

  1. Post.find(id)

  2. ARel

  3. find_by_sql(id)

  4. execute()

  5. log()

At somepoint, Aaron decided to focus on the 3 top level layers (from find_by_sql to log). He needed to run some benchmarks to know exactly where the performance issues were really occuring. We will get back to that later.

What are the two things that we should optimize for when dealing with performance?

What do we need to reduce in our to gain in performance?

And turns out that when writing a clean code, the things to reduce are exactly the same. Therefore Performant Code == Clean Code.

What tools do we have to run benchmarks?

Which gives the following results:

user     system      total        real
fib      3.740000   0.010000   3.750000 (  4.009678)

For example:

require 'benchmark'

def fib n
  a = 0
  b = 1
  n.times { a, b = b, a + b}

Benchmark.bm(10) do |x|
  [1, 10, 100, 1000, 10000].each do |n|
    x.report("fib #{n}") do
      n.times { fib(1000) }

What does minitest add to the game?

Minitest is nice in the sense where it allows us to assert that a given algorithm occurs within a certain class of complexity. For instance we could assert that an algorithms runs in linear time, if someone changes it in the way that it woul run in polynomial time then the assert would fail.

From the previous stack, where did the change happen?

After running benchmarks using the previous tools and after plotting the results, Aaron realized that the changes occured at the log() method.

What do we do then?

What to do then?

Given that the find_by_sql part didn’t really change between the two version of Rails, ARel was the one that needed to be improved!

First strategy: make superficial improvements!

  1. Check for stack overflow.

  2. Pushing a stack frame.

  3. Copying arguments.

Rubyists tend to write the following code:

This could be instead written like this:

Benchmarking these two give the following result:

– Symbol to Proc is much slower than just using a bloc. But in 1.9 that’s not true. So we need to know who we target (know your audience).

– He did some Data Structure Analysis (using Graphviz), and he implemented a visitor pattern. The reason for using the visitor pattern is to be able to examine these data structures from the outside.

  1. There is a clear solution.

  2. Tests are numerous.

  3. Public API is limited.

After 6 weeks of work, the results were encoruaging:

He also implemented a new feature on ActiveRecord. Run the following : Model.where("id == xxx").to_dot and admire the graph that is generated and that shows the relation between all the calls that are made :).

He finally finishes the talk by these two words of wisdom:

– We emphasize the art of code, but we should not forget the science.

– Learn the specific but embrace the generic.

I could not agree more!

As you can see, this talk was very informative and contained many tips about how we should approach performance problems. He introduced some benchmarking tools and explained the process by which he went through to make Rails 3.0 beta as fast as Rails 2.3.

RubyConf 2010, NO – The Polite Programmer’s Guide to Ruby Etiquette

22 mai 2011

I have to admit something, I have developed a new addiction over the past few days and it’s called confreaks! Confreaks is basically a repository for Ruby/Rails related conferences that are happening all over the world.  I browsed the events page and I had a OMG moment thinking about the tremendous amount of content/information provided there. I need to watch them all, I said! Mind you, I just have 24 hours a day (I am sure it’s not true for everybody, some people are cheating with time I know it, I am sure about it, don’t try to convince me they’re not), so I’ll put some priority here and first watch those that could  help improve my skills as a developer. But I also need to be wise here, I know myself better than anyone else, and I know that if I just watch a given presentation and don’t take notes somewhere, and if I don’t structure those notes, summarize them, write them and publish them then it’s not going to be that worthy and it would be like: Pisser dans un violon which, if you don’t speak french, means:  Pissing into the wind.  So this is what I will do here, I will write the information that I am taking from these presentations down and publish them here! Hopefully, other people will pass by and enjoy those notes as well…

No more talking, time to act!  Let’s start with this presentation that I watched this morning called: *The Polite Programmer’s Guide to Ruby Etiquette* which was presented by Jim Weirich the father of Rake, Ed Summerfield and Chris Nelson. The PPGRE is about teaching people how to write Ruby code that doesn’t break other people’s code. Which is by the way very important, specially if you are starting writing a gem.

Here are the notes, tips, informations that I took from this presentation:

* When using hook methods make sure you are delegating to the previous implementation of the method.

Could not embed GitHub Gist 985434: API rate limit exceeded for (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

* When you are using `method_missing` make sure you are implementing your own definition of `respond_to?` .

Could not embed GitHub Gist 985436: API rate limit exceeded for (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

* Make sure you are not overriding the `method_missing` of the inner class, by making an alias of the `method_missing` definition.

Could not embed GitHub Gist 985425: API rate limit exceeded for (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

* Alternatively, instead of putting method missing directly under the class that you are monkey patching, create your own module and put your `method_missing` method in there. In that case you are delegating up to the inheritance tree.

Could not embed GitHub Gist 985430: API rate limit exceeded for (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

* Never test or call private methods (via `send`) unless you have a strong reason to do so.

* Put a `# :nodoc:` comment at the top of a private method definition, in order to tell rdoc not to generate documentation for this method.

There you go, that is all for this presentation. If you want to know more about PPGRE, I suggest you to go the official website.

Comment coder plus vite en Rails avec Vim !

13 mars 2011

Comme tout bon développeur  Rails,  il m’arrive assez souvent de regarder les excellents Railscasts de Ryan Bates  et la première chose qu’on remarque dans sa façon de coder c’est son utilisation de raccourcis/macros qui lui permettent de générer des blocs de toutes sortes (form_for,  if/else, each do etc.).

Ma première réaction par rapport à tout ça a été : need this! (productivité FTW). Seul petit problème, Ryan Bates utilise TextMate et a un Mac. Je me suis donc dirigé vers le site d’Apple pour…(Non j’ai pas fait ça, je repasserai plus tard pour l’excuse qui me fera acheter un Mac et puis j’ai pris un Nexus S récemment, ma carte de crédit est de mauvaise humeur :)). Je me suis donc demandé si mon bon vieux Vim ne pouvait pas, via une extension, reproduire ce genre de performances et j’ai très vite trouvé grâce à snipMate.

snipMate.vim aims to be an unobtrusive, concise vim script that implements some of TextMate’s snippets features in Vim. A snippet is a piece of often-typed text that you can insert into your document using a trigger word followed by a <tab>.

Donc en gros snipMate définit un certain nombre de raccourcis pour nous. A la base plusieurs langages sont pris en charge et chaque langage est défini dans un fichier de type *.snippets dans le répertoire:


Le seul problème c’est que l’écosystème de Rails n’était pas pris en charge. Après une petite recherche j’ai trouvé mon bonheur sur le repository GitHub de Mike Farmer, qui propose une collection de snippets pour snipMate dont: Ruby/Rails/Rspec/Cucumber/Shoulda etc.

Donc, si vous voulez être encore plus productif avec Vim en codant en Rails:

Ceci installera tous les snippets nécessaires dans le répertoire snippets de Vim. Et ça marche à la perfection :).

Preuve en images (cliquez pour agrandir):

Tadaa ! Prends ça dans ta GUI Textmate ! A moi la productivité maintenant, je vous laisse j’ai du code à écrire :)

[Rails 3] Méfiez vous du gem mysql !

10 mars 2011

Récemment, j’ai eu à faire face à un problème d’encodage des caractères accentués à deux niveaux:

Tous mes caractères accentués ne s’enregistraient pas correctement, mais cela était du à un simple problème de configuration au niveau du fichier de database.yml. En effet il fallait ajouter la ligne:

encoding :utf8

Une fois le premier point réglé, mes caractères accentués étaient bien enregistrés par contre j’obtenais le message suivant à chaque chargement de page:

 incompatible character encodings: UTF-8 and ASCII-8BIT 

Un rapide passage sur StackOverflow m’a mené vers l’article suivant où il est mentionné que le gem mysql n’est pas compatible avec l’encodage UTF-8. Et effectivement un passage au gem mysql2 a corrigé le problème !


1/ Ajout dans le Gemfile de la ligne:

gem "mysql2"

2/ Mise à jour des paquets de gems:

bundle update

3/ Changement de l’apdater dans le fichier database.yml:

 adapter: mysql2 

Voilà donc petite note pour moi et pour les gens qui feront face à ce genre de problèmes.

En finale du concours ID Mobile Alten !

27 janvier 2011

Allez ne perdons pas de temps pour inaugurer ce blog et annonçons la nouvelle, nous sommes qualifiés à la finale du concours ID Mobile organisée par la société Alten. Qui ça nous ? Qu’est ce que ce concours ? Qu’est ce qu’on y gagne ? Je vais tenter de répondre à toutes vos interrogations…

Concours ID Mobile d’Alten ? Octobre dernier nous recevons un email interne à l’école, qui nous informe de l’organisation d’un concours de développement mobile. Le principe est simple, vous formez une équipe, vous réfléchissez à une idée/concept et vous la développez sur la plateforme mobile de votre choix !

Qu’est ce qu’on y gagne ? Celle là, je vous la fais en image..

The Golden Gate Bridge - San FranciscoiPaddrone parrot

Le premier prix était réellement le facteur WaW qui m’a fait bondir de ma chaise et qui m’a définitivement convaincu de participer. Etant passionné de technologies et d’entrepreneuriat, il est évident que je considère San Francisco comme une sorte de Mecque. Et c’est qu’en plus on y va pas juste en simple touristes mais pour assister, au choix, à la conférence Google IO ou MacWorld. Bref, le rêve! Les deux autres prix sont assez sympas aussi :).

Nous ? je participe à ce concours en compagnie de deux autres étudiants de l’ISIMA, Joan ORTEGA et Maxence SCHMITT.

Notre projet ? Bon c’est assez secret pour l’instant, on est un peu pudiques de ce côté là ! Mais je vais quand même vous donner un indice: elle permettrait de résoudre un gros problème que l’on rencontre surtout dans les grandes villes. Voilà, c’est dit ! Faites travailler votre imagination débordante, vous devriez pouvoir toucher dans le mille :). Dans tous les cas, j’en parlerai très certainement très bientôt de manière plus explicite !

Sur quelle plateforme ? Android.

Le futur ? On sera encadrés par notre parrain chez Alten et une journée Kick-Off sera organisée bientôt pour nous permettre de le rencontrer, de rencontrer les autres participants et de bénéficier d’une formation Scrum et également de développement mobile (au choix iOS ou Android).

Bref, que du bonheur en perspective mais aussi beaucoup beaucoup de travail qui nous attend si nous voulons allez loin dans ce concours et réaliser un bon produit !

Cela à priori, devrait bien se passer…

Je vous tiendrai au courant !