Saturday, December 12, 2009

Multitask in iPhone

Please Mr. Apple, stop looking at us like dummies. Why multi-tasking is allowed for Apple products but not for others?

Tuesday, December 8, 2009

Soccer training in Toilet?

What kind of training are we talking about here?


Wednesday, November 11, 2009

SfGuardUser sync with Google Apps

As I am working for a university, we have recently migrate all our staff to use Google Apps for Education and we plan to move all our students and alumni too later this year. Google Apps for Education is really a great tool (and free for us ;-), most of our users are really happy of the switch: it is reliable, fast and have so many collaborative features. Bye bye Outlook :-(, welcome to the Cloud :-)
The Education package is the same as the Business package, including API and a lot of good stuff. The online Google Apps tools to manage users and groups is easy and simple but quickly become too simple to use when you are dealing with thousands of users, you then need to develop your own tool to maximize your daily operation. The "official" PHP5 Google Apps library is GData from the Zend Framework, which make it a breeze to integrate it with Symfony.

a view of an admin generator with Google Apps account management (using sfAdminThemejRollerPlugin):

We are currently redeveloping our University Management System based on Symfony 1.2 and we plan to integrate most of our applications with symfony too, including a research project on a new social learning platform.

I developed a Symfony task (sf1.2+Doctrine) that take a csv file and create your local sfGuardUser as well as the corresponding Google apps accounts. The Google accounts creation is optional so the task can be used for a normal batch user creation with Symfony alone. A simple:

./symfony guard:batch-create-user your.csv

...will do the trick for you! I am not sure whether publishing the source code might be interesting for others (the Google API is only available for Premier and Education customers)...let me know. We will eventually publish our University management system as an open source project later for sure.

Here is a list of issues and recommendations while dealing with Google Apps Provisioning API:

  • Google Apps API error reporting: when you have an error while dealing with Google Apps API, errors messages are useless, you always get a 'server errors' message without more details, it is then very difficult to debug your code to find the issue.
  • Don't forget some of the basic Google Apps rules for account creation such as a password with minimum 6 characters otherwise you get back one of those unmeaning-full error message.
  • sfGuard is using sha1 as the default encryption method but it adds a grain of 'salt' on it therefore you cannot send to Google Apps the correct sha1 password. I had to overwrite the default setPassword() and checkPassword() to simply remove the use of the salt and make sure my password synchronization with Google Apps can work. I am not sure if it is a huge security concern though, any idea? Beside this you can also use md5 for your password but you will not be able to use another algorithm since Google Apps is only accepting sha1 and md5.

Monday, November 9, 2009

what's up on sfAdminThemejRollerPlugin?

I finally found some time to add new stuff on the unpronounceable plugin, and thanks to some new contributors more are to come (thanks JeremyB ;-). Here is the list of change:

  • As I mentioned in my previous post, I add a new config field named 'show' for the admin generator. I guess the meaning of this new option is quite obvious, isn't it? It adds the possibility to simply view one object details without editing it. It currently shows the list of fields like it is for the 'edit' view, meaning with a tab interface.
  • UI improvements (done by jeremyb): as you can see in the 2 screenshots below there are many improvements such as the new 'reset' button next to the filter button, the sort arrows, new css styles for object actions, new pager view and finally the batch action select box is now also supporting the theme roller

The top part looks like this:

  • notice the new 'reset' button next to 'filters'

  • the up and down arrow on the table column names

  • the new css style for the object actions

...and the bottom part (new paginator and the select box is also styled according to your roller theme):

the edit view (buttons are accessible both on top and button of the form, tabs are now vertical):

The current code is available in github only. It is not yet ready for a new plugin release, we are still missing some key elements.

Saturday, September 5, 2009

new version of sfAdminThemejRollerPlugin (v 0.1.4)

I have finally released a new version of this plugin with an unpronounceable name ;-) Here is the list of change:

  • I add a new field named 'show' for the admin generator. I guess the meaning of this new option is quite obvious, isn't it? It add the possibility to simply view one object details without editing it. It currently shows the list of fields like it is for the 'edit' view, meaning with a tab interface.

  • I also create a new class jRollerDoctrineGenerator to replace sfDoctrineGenerator if you want the default link (the one you create with the = sign before the field name in the generator.yml) to link to the 'show' view rather than by default going to the 'edit' view. So far this is the only added value of this class. Of course if you prefer to keep the link to the 'edit' view simply keep the default class sfDoctrineGenerator. To use it, you simply need to modify your generator.yml as followed:

class: jRollerDoctrineGenerator
theme: jroller

The source code is available on github for the moment, I want to finalize a few things before packaging a new plugin version. I also need to put the source code on svn.


Friday, August 28, 2009

Propel ORM is dying?

as we used to say in French: "Propel is dead, long live Doctrine!". Indeed it seems that Propel development as slow down to a point where the lead developer quit the project (see his post). Guys, there are no more excuse to not look at Doctrine for all your Symfony project (and more).

New version for the symfony jRoller admin theme

I have just released the version 0.1.3 of the symfony plugin named (take a deep breath ;-) "sfAdminThemejRollerPlugin". I fixed a few inconsistency and allow to change to your own theme without the need to install your own version of jQuery and jQuery UI. Within the plugin there is only one theme named "redmond" (what a bad idea to name a theme like this :-( but you can download one from and install it on your own web directory (see README file).
I have also uploaded it to and to the official symfony svn repository.
Taste it and enjoy it!


Monday, August 24, 2009

sfAdminThemejRollerPlugin: Symfony admin generator on steroid

It's been a while since I wanted to work on my own admin generator theme. In symfony 1.0 the default admin generator was not really nice, it became a little bit better in 1.2 but still not to my taste (purely subjective I must admit ;-). For example, one thing get me mad is the css for the table list and the filter, I believe that the table list should be maximized and filters available only when we need them.
I spent quite some time to modify some admin generator in some projects but you always end up doing the same thing over and over (see this screenshot of what I have done with the list view based on a standard admin generator) was time to make things more to my taste. I now have a pretty clear idea of things that I would like out of the box from my new admin generator. Let me be more specific with the complete list of things I would like:

  1. Change css style to a more modern style (again purely subjective ;-) that can be changed easily. For this I am using jQuery UI with their new theme roller system. The plugin is packaged with only one theme but it is extremely (too?) easy to change to your favorite theme (long term will be to use the upcoming html5 grid).

  2. The filter box is hidden by default with a button to show/hide a modal window with the list of available filters. This allows to have a larger space for the table list.

  3. In the new/edit views fieldsets are replaced by tabs (again jQuery UI).

  4. Add a show only view, it makes sense for some application to allow read-only access.

  5. filters ala iTunes smart playlist, meaning you select fields you want to filter and add them (nice to have but not so important, although useful if you have a lot of filter options)

  6. Print preview (configuration in generator.yml): simply a non paginated table easy to print with sortable column (javascript grid style)

  7. live search (configuration in generator.yml): be able to quickly filter the table list while typing a few characters, ajax style. I did that before for one specific module, I now have to make it part of the admin generator.

  8. export to CSV format: we could have a modal window to select the fields we would like to get and export them or simply a list defined in the generator.yml (which can include getters that are not database fields).

  9. export to PDF: does it make sense at all, I am not yet sure!

  10. Import CSV to database: to be able to simply upload a csv file of data to import through the admin generator.

The first 3 items are easy to do just by modifying existing admin generator templates and are indeed already packaged in the plugin. The rest need more work (still learning how admin generator are working deeply).

I am also trying as much as possible to keep all actions accessible without javascript and make sure that I do not break any default admin generator css classes and ids in case you need them.

"Stop talking and show us the code" you go! It is published as a symfony plugin at, meanwhile here are some screenshots:



How to install?

./symfony plugin:install sfAdminThemejRollerPlugin --stability=beta

When I say beta, it is beta ;-) I am not fully satisfied with the code and still thinking about the best approach for some features (not mentioning it's my first play with admin generator). Feel free to give me feedback.
I will publish the code on github later to ease collaboration if any of you are interested. Anyway, it's php right? so you can play with the code right now!

How to use it?

./symfony --theme=jroller doctrine:generate-admin

or if you have an existing admin generator, simply modify your generator.yml file with
theme: jroller
instead of theme: admin.


I currently package jQuery 1.3.2 and jQuery UI 1.7.2 to make sure it can work out-of-the-box, but it is also easy to specify in your app.yml file that you do not want to use those versions (or because you already include those libraries in your project) and include your own jquery and UI.
jQuery UI is using at the minimum: Tabs, Dialog (Drag and drop and resizable recommended).

# inside your app.yml file
web_dir: /sfAdminThemejRollerPlugin # specify specific folder where to pick your jquery stuff, ui and themes.
use_jquery: true # default. use the packaged jquery/UI
theme: redmond # default.
css_reset: true # default. reset default css (from Blueprint CSS)

What's next?

I will try to implement the rest in the coming months (I just found out that sfDoctrineAdminGeneratorWithShowPlugin start to implement some of my ideas), again feel free to contribute to speed up the process.

Bugs? no way!

  • I still have a pixel problem with the caption and tfoot of my table, if anyone knows how to solve it?

You will probably find bugs, please report them.

Friday, August 14, 2009

Symfony batch and i18n + pdf generation

A few months ago, I wrote a post about i18n in batch and pdf generation. At that time I could not find a way to manage translation in symfony batch (for example when you need to send email to customers, etc...). In Symfony 1.2, batches are depreciated in favor of tasks but my project is still in symfony 1.0 (and I guess the same can be applicable in 1.2). Anyway, I finally found a way to do it:
$I18N = sfContext::getInstance()->getI18N();
echo __('text to translate');

I am not sure if it is the best solution, but it definitively works.

On the pdf side, I was mentioning that in order to generate invoices in pdf, I created some pdf invoice templates with Open Office Draw. Following this step, I was able with Zend_Pdf to generate PDF files on the fly based on my templates. The big problem with this solution is that you have to positionned all your text at the pixel and cannot manage things like multiple lines text and so on. You end up writing a lot of stupid code and anything you want to modify you have to try again and make sure it works (and when you manage several languages it can even be more complex). Anyway I managed to do it like this for the billing system used in East-Timor but I always wanted another solution. I did find some promising project but nothing yet reach a usable state to my knowledge. However, I found to interesting projects:

  • odtPHP: it is not as such a pdf generator but it looks fantastic to generate open documents easily with a templating system. It is great and I am sure I will use it soon. Once you have an open document, it is a piece of cake for anybody to save it as pdf...even my grandma could do this ;-)

  • Podr: it's a kind of open office server to generate document on the server, including pdf. However it seems only working on windows and quite heavy installation, I am not sure if it is a good solution. Anyone using it?

odtPHP looks like a clean and nice php class and it should be easy to integrate in symfony. On the client side, if you do not have open office (or any odt compatible solution) you can simply install a plugin for Microsoft Office to support open document formats (it seems it is even native support in Office 2007 service pack 2): or

Wednesday, August 12, 2009

A Mac tool for MySQL: Sequel Pro 0.9.6

In the past month or so I have been using SequelPro ( for my local MySQL usage. At that time it was version 0.9.5 and it was quite interesting for local usage, however it was still missing quite a bit of information compare to a tool like phpMyAdmin and one big limitation (at least for me) was the connection type used: only on the MySQL port. There was no way yet to establish a SSH connection to connect to remote databases. Most of the time a goog MySQL server should not accept external connection, therefore a ssh tunnel is the only solution for such cases when you want to use desktop app.

Fear not anymore! Version 0.9.6 has been released and I must admit it is a huge improvement regardless of the limited increment on the version number. It has ssh support and much much more. I can now connect to all my databases servers around the world easily through only one interface. On top of the ssh connection they add support for foreign key, add new view such as 'Relations' and 'Table info' and history of your actions. This is certainly now the tool I am going to use, even more than phpMyAdmin.


Thursday, June 18, 2009

Are you tethering?

Connecting my laptop through the iPhone is extremely simple (go in Settings -> General -> Network) and a clear message is always available on top of the screen. Well done and very useful sometime.

What I found really useful is the landscape mode, when you need the keyboard is a big difference and a huge improvement for emails, blogging...

The last thing I tested so far is the copy/paste, this is a so basic feature but you end up using it a lot.
I'll come back as soon as I found new useful features...

-- Post From My iPhone

Wednesday, April 1, 2009

Charting Experiments

Data visualization on the web has been for a while an area without much innovation. You basically had 2 solutions:
  1. Generating a static image on the server side
  2. Using flash as a way to make more dynamic graphs
Unfortunately both solutions have their own limitations. For the server-side image generation it is obvious: the result is static. For flash: flash itself can be a limitation since it is not an open standard.
Since a year or so, we did see some simple solution based on canvas (html5) but now some groups are experimenting more advanced solutions based on web standard. 2 solutions that I really find interesting are Protovis from a Stanford University group and Processing.js from John Resig (Mr jQuery himself). They are still experimentation but they show a new approach with a real touch of innovation. Let's now wait to see if they will become more than lab research tools, I do believe!

Friday, March 6, 2009

(not) welcome to Macau

A drawing from South China Morning Post after a couple of HK residents have been rejected to enter in Macau (journalists, politicians...). Even China is accepting them...
Things are not really going well here related to human rights. There are more and more "VIP" people from HK rejected and nobody knows why. The local government did not explain anything...spring is going to be hot between Macau and HK ;-)

-- Post From My iPhone

Monday, March 2, 2009

Gmail on steroid

The guys in Google working on Gmail are not stopping their innovation while the crisis is around...and this is good for us! They have launched (in beta only, within the "labs") a couple of very useful features:
  • Tasks. You can simply add email to a todolist, it is simple but extremely useful. From there you manage your task (due date, completed, related email,notes...). I started to use it and did not stop.
  • Offline mode. This is a killer feature for sure! With Google Gears installed (while HTML5 is on the way) you can use Gmail even without any Internet connection. This is a big step forward to make Gmail a powerful tool. This offline is also available for Google Reader and Documents (Calendar is also coming). With those enhancements (plus a couple of smaller one), I gave up to use Apple Mail for my main pro email account, Gmail is really convenient.
  • Gtalk plugin. A few month ago Google release a browser plugin to add audio and video to your Gmail chat. Basically you got a skype replacement inside Gmail, this is great too.
There are many more new "Labs" features that could be useful for anyone, don't miss them!

Since I know that all those good guys in Google are reading my blog everyday ;-) I would like to request a few more things:
  1. please help us to easily manage multiple gmail accounts.
  2. If Google Gears was able to install in Mozilla Prism we could have a kind of desktop client for GMail...and first point would be already solved!
Don't forget that all those new features are provided in "Labs" and are still experimental.

Thursday, January 15, 2009

My view on CMS - the backend, part 1

CMS is a complex topic, everybody is talking about this and everybody has a different approach. I don't want to give my own concept here (should I have one ;-) but simply have a practical approach based on a project we have to do for one of our customer (largest casino in the world...). We did the first version of its CMS based on a typical Symfony 1.0/Propel/MySQL5.

We are now in the process to re-write the all application to make it useful for further projects and customers and optimize things based on our small experience. We decided to make the "big sf jump": symfony 1.2/Doctrine! It is not an easy choice since we did not have yet any experience neither with symfony 1.2 nor doctrine but we believed it was worth to make the jump specially due to the new admin generator and the form framework, not mentioning all the goodies from doctrine itself.

When you build a CMS, it is quite common to think first about the backend that will allow your customer to manage its content in an more-or-less easy to use interface. This interface is a key for a CMS success (along with its flexibility and extensibility). On my course to draw the backend interface I've tried to pick the best patterns (at least to me) from SPIP (a french CMS), Joomla and Wordpress. Thanks to Balsamic, I quickly draw what would be our CMS backend, at least for page management (the central part of the cms). See below for mockups.

List of pages

The list of pages should use symfony admin generator to keep its flexibility, therefore there is a lot of work on css and javascript fronts. A few things will become ajax (I will publish later my 2 cents jquery plugin to ajaxified a symfony admin generator list): pagination and the new live search.

For the list of filters, I wanted to make them less obstrusive, with some ideas from Google Docs search options (show and hide them) as well as Apple iTunes smartlist configuration. The latest will be a little bit more tricky to do...probably not for version 1!

For the need of a CMS we add the following elements to the default admin generator:
  • Live search will "ajaxly" filter the list according to a search on title and content of the page.
  • New batch actions such as "copy" and "move" pages.
  • A left sidebar to navigate in a tree way (based on nested set). This navigation will filter the table in the same way as live search (ajax as well).
As we use Doctrine, we will use of lot of out-of-the-box behaviors: Nested set, versioning, i18n and of course Timestampable.

Next step we will look at the page edition view...see you there!

Tuesday, January 13, 2009

Finally, bats can use Firefox ;-)

Mozilla Labs is a team of guys building the future of the web. They are doing a lot of amazing work (most of it only alpha or beta for time being) and open doors for radically new ways for our future interactions with the web. They have been working on Weave, Ubiquity or Prism. I really like those projects and want to use them in the future.

Here is a video to show how to make Firefox accessible for bats.

Ubiquity Tutorial: Turn a page upside-down from Aza Raskin on Vimeo.

Of course, it is useless for humans (except...Batman ;-) but it shows the power of this kind of technology.

Monday, January 12, 2009

New Apple product: I don't want it!

It's really fun and well done. Enjoy!

Tuesday, January 6, 2009

Invoicr (former CS-4U), what's new?

Long time I have not talk about my project that I used to name "CS-4U". As you might know, this web-based billing system for utilities, developed with my favorite PHP5 framework (should I mentioned it..symfony 1.0 at that time), is actually in use for about 3 years already in East-Timor for the electricity company.
I recently went back there to make an upgrade and add a lot of new features, this is what I want to share in this post.
This application was my very first project with symfony and when I dived again in the code for all those new features I realized how much I learned in the past years... There are lot of things that I would do differently today (and I am not even considering here the use of symfony 1.2)!

Here is a quick list of what has been added in version 1.1:
  • PDF support with Zend_Pdf. This allow to generate invoices and reports in PDF (mainly using templates). Zend_Pdf is stable and easy to integrate in symfony, the drawback of these kind of solution is their limitation and the cost of maintenance: you must draw everything per line and position each line on the page. I created some simple methods to right align or draw a simple table over several pages but it is really a pain! It seems some guys are working on improving Zend_Pdf (they actually released an alpha framework RE) to add to it some more advanced functions such as multiline content, table and so on. I hope it can come out soon...
  • A new receipt system. Basically the new receipt system will split a payment into sub-receipts over several invoices if necessary and still keep track of the "physical" payment main receipt. With this we clearly identify where is the money, there are no more "floating" money in the contract balance. All supplementary payments are made against the oldest debt of the contract and the system cannot accept payment over the total balance.
  • Some new modules: Fines & Products module to add one-shot cost in upcoming invoice for a customer. Some admin generated modules to easily modify some of the data (status, districts, categories...)
  • Barcode support. You can now add a barcode in the invoice pdf file to ease payment and avoid human errors. This is not yet use in Timor because they do not have yet barcode reader but they seems very interested by this solution.
  • Javascript switch: from Prototype to jQuery. To ease some development I simply switch to jQuery library instead of Prototype and we use a little bit more ajax call in the app when it make sens. I still want to add more in the future...probably when I start to migrate to sf1.2...not for tomorrow though...
  • New UI design. Not big changes but still an improvement compare to before. It is still very "light web style" since I am not yet convince to go to a more rich UI. I am kind of fan of "Google style".
  • More actions to give more flexibility to users to correct mistakes mainly: change tariffs, modify meter-contract relation information, re-calculate invoice...
  • Bugs, bugs, bugs.
What will come next (no particular order):
Business side:
  • new tariff system to allow more complex tariff calculation.
  • Dashboard. At login, user will see its own dashboard according to its authorization level. It will show some KPI and latest info/actions.
  • Reporting. Change the reporting into a more user-controlled solution where the user can define the report she/he wants and get it in pdf (no idea yet on this ;-) or OpenDocument format.
Technology side:
  • use of admin generator instead of manual dev for most of "master data" modules with a lot of ajax (more on this later as I am working on a new admin generator theme for this).
  • Messaging Service. To ease communication between users or from system to users with memo, task assignment or system message. This is a symfony plugin I want to do for quite sometime already (including an event/calendar system too).
  • Reporting. I want to make the reporting much easier and flexible for user to get the report he wants (not only pre-coded report). I also want to switch from the existing flash graph library to canvas based charts and/or open flash chart.
  • Migrate to sf1.2 and write unit and functional test.