BlogPhotosContact

Topics

SFR, rois de l'arnaque

Pigeon SFR2008 s'annonce plutôt mal pour SFR et je m'en réjouis. Leurs mauvais résultats signifient peut-être que les gens se rendent enfin compte qu'il s'agit d'une société de voleurs et d'arnaqueurs, à commencer par leur service client qui est des plus déplorables et incompétents.

Sans compter leurs pratiques commerciales immondes qui consistent à vous faire croire au téléphone que tout est possible, par exemple avoir la clé 3G et l'abonnement téléphonique sur la même ligne, jusqu'à ce que vous vous engagiez pour une longue durée, comme ça il vous sera impossible de rompre le contrat, à moins de vouloir vous faire débiter plus de 700 euros d'un coup sans être prévenu.

Et pour vous empêcher de résilier le contrat dans les limites prévues par la loi, SFR prend bien soin de vous envoyer les éléments que vous avez commandé le même jour au compte-goutte et en plusieurs fois. Comme ça tout est bien flou et bien malin le client qui saura quand commence vraiment son contrat.

SFR est une société qui a une très belle communication et donne une image sympathique d'elle-même, mais l'intérieur est pourri, rongé par les magouilles, les arnaques, l'incompétence et les pratiques commerciales illégales pour lesquelles elle a déjà été sanctionnée à plusieurs reprises.

Oui, j'espère que ce billet leur coutera quelques abonnements. J'ai déjà prévenu beaucoup de monde autour de moi et partagé mon expérience. Je pense à ce jour leur avoir fait perdre quelques clients, une goutte d'eau dans l'océan... mais il faut savoir commencer petit :) Leur nombre de nouveaux abonnés baisse énormément cette année, je crois qu'il est passé de 70.000 l'an dernier à 14.000 cette année. J'attends le jour où ce chiffre sera négatif.

Donc si vous cherchez un opérateur téléphonique pour vos services de mobilité ou votre portable, n'allez surtout pas chez SFR, les autres opérateurs ont des offres équivalentes voire meilleures, peut-être les vendent-ils seulement un peu moins bien, renseignez-vous. En tout cas je vous aurais prévenu.
Comments (0)  Permalink

On the move

There was recently an interesting post about scripting languages by Steve Yegge. What I particularly liked are the hints on other languages he gives and his invitation to try new languages.

I have been programming PHP since 1999 and felt a need to learn something new approximately when they launched Rails a few years ago. But instead of learning Rails, because I don't usually follow the hype, I decided to learn Python.

So, recently, I have been learning Python, then Ruby and now the Lua programming language. Out of these three languages, my favorite is Lua and it is where I spend most of my time now.

PHP blobThey are all excellent languages to learn and in many ways, they are better than PHP. As I said in a previous post, I now see PHP as a big blob which along the years have been developing in too many directions and is now facing a lot of problems because a lot of things were implemented incorrectly and were not carefully planned. It is not obvious at first, but when you start looking at other languages, you understand how some things could have been done and you realize how wrong they are in PHP. I am thinking of all the stuff you find in SPL, create_function(), call_user_function(), ::, $this->, parent::, instanceof, is_a(), the way static are handled, etc, etc. It's all a mess. And it starts to look in blog posts. From time to time, I read things about how nice it would be to have closures, traits, anonymous functions, weak references, duck typing in PHP and some hacks on how to imperfectly implement them.

And because PHP is not idiot proof, you will find a lot of people there with little knowledge about programming. Like this week's post of someone who says "function in_array() sucks because it is slow"... The more I know about programming and the less I find the PHP community interesting. It's like all the interesting people here are doing things secretly and don't take the time to share their experiences (unless they write books).

And the last things I have started to dislike is the way a company like Zend is taking over the language. I have also recently very much disliked Oracle buying InnoDB and Sun buying MySQL, although I was not surprised for MySQL given the road they had taken lately, which is actually a lot like the road PHP is taking with Zend at the moment. With rumors about Microsoft, Oracle, IBM buying Zend, I start to feel the fear. Because in the end, who decides what goes where in PHP core?

Here is a list of programming languages that deserve a look soon:

Comments (10)  Permalink

Recursive copy with pattern match on Unix

For a new online shop I am working on, I needed to copy all the products images from the old site to the new one. The challenge is that both sites don't run on the same server and a product can have multiple images which are stored in different subdirectories. Furthermore, I am not interested in copying thumbnails since those will be regenerated with better quality and probably different format.

In order to perform such a copy, recursive and using a filter, here is what I found on the net:

$ tar -cf - `find . -name "*_xl.jpg" -print` | ( cd ../dest tar xBf - )

This will recusively copy all my *_xl.jpg files into a ../dest directory, while also creating the subdirectories when needed. Perfect !

Comments (0)  Permalink

Lpdf on Mac osx

Here is a quick reminder on how I built Lpdf, the Lua bindings for pdflib, on my Intel mac.

  • 1. First, installed the PDFLib binaries
  • 2. Installed Lua from source
  • 3. Didn't bother about the Makefile in Lpdf
  • 4. Used the following sequence
export MACOSX_DEPLOYMENT_TARGET="10.3"
gcc -I/usr/local/include -Wall -O2 -fno-common -c
     -o lpdf.o lpdf.c
gcc -Wall -bundle -framework Carbon
     -undefined dynamic_lookup -o pdf.so lpdf.o 
     -L/usr/local/lib -lpdf

At first, I forgot the -framework Carbon flag which lead to dyld: Symbol not found: _FSPathMakeRef.

Comments (0)  Permalink

Service des urgences, Hôpital Trousseau, Paris

Ce samedi, notre petite fille de 20 mois a été malade. 40 de fièvre, elle avait du mal à tenir debout, ce qui était particulièrement inquiétant étant donné son habituel enthousiasme pour l'action. Vers 10h, elle se plaignait beaucoup, mais impossible de savoir ce qui n'allait pas, jusqu'à ce qu'elle renvoie entièrement son petit-déjeuner sur le tapis.

Inquiets, nous avons d'abord tenté d'appeler un pédiatre, puis un généraliste, inutilement, ils ne travaillent pas le samedi. Nous avons donc appelé les services d'urgence pour une consultation à domicile. 3 heures plus tard, le médecin était là et nous a conseillé d'emmener notre fille à l'hôpital Trousseau directement aux urgences, un hôpital spécialisé pour les enfants.

A 15 heures, nous étions dans la salle d'attente de l'hôpital, avec six autres familles et leur enfant malade. L'inscription sur la liste d'attente s'est faite rapidement.

Le lieu lui-même est vétuste et sale, le plafond est noir de crasse et on se demande si les chewing gums collés sous les bancs seront encore là dans 100 ans. Les toilettes sont aussi sales que celles d'un stade de foot, on peut même voir des traces d'excréments sur l'interrupteur. Il y a des jeux pour les enfants accrochés aux murs, mais les traces noires indiquent qu'ils ne sont pas non plus nettoyés régulièrement. Bref, c'est dégueulasse.

Heureusement que notre fille, avec ses 40 de fièvre, ne pouvait pas courir partout comme elle le fait d'habitude. Elle est restée bien sagement, à moitié amorphe, sur les genoux de sa tendre maman en prenant son mal en patience.

Et de la patience il en a fallu car le personnel de ces urgences apparemment composé aux deux tiers d'étudiants a sû démontrer son incompétence. Ils ont commencé à ausculter notre fille vers 17h. Ils ont tout de suite pensé à une infection urinaire, ce qui est probablement légitime. Il a donc fallu attendre que notre fille urine dans un sac, ce qu'elle aurait probablement fait plus rapidement si on lui avait proposé de l'eau. Mais de l'eau à l'hôpital Trousseau, il n'y en a point. Du moins en libre service. Heureusement, il y a un distributeur payant à l'extérieur, 1 euros 50 la bouteille d'Évian. Prévoyez de la monnaie.

La petite commission faite, il est déjà 18 heures. Envoi donc au labo pour analyse. Une heure et demi plus tard, retour d'analyse: les échantillons d'urine sont troubles, impossible de donner un résultat. Ok, super, merci bien. Notre fille a toujours 40 de fièvre, elle s'est endormie sur le banc. On vient la réveiller pour lui faire une prise de sang. Elle n'a rien mangé depuis plusieurs heures. Je vais acheter des madeleines au distributeur payant, c'est le seul type de nourriture à peu près adapté aux petits enfants dans leur distributeur d'hôpital pour enfants.

La prise de sang est faite par une personne qui a l'air plus compétente et informée que les autres. Pour gagner du temps, et puisqu'il faut aussi refaire une analyse d'urine, ma fille a droit à un sondage de la vessie, qui malheureusement ne donne aucun résultat, pas d'urine trouvée, désolé.

Hop, je retourne acheter une bouteille d'eau au citron cette fois, ça passe mieux. Une heure et demi plus tard, toujours pas de pipi, mais une infirmière vient nous voir et nous dit que les résultats de la prise de sang ne montrent pas de signes d'infection urinaire. La fièvre est selon elle probablement dûe à un autre virus qu'elle aurait attrapée dans la salle d'attente du pédiatre que nous avons consulté pour son angine. N'est-ce pas le comble de l'ironie ?

Nous pouvons donc rentrer à la maison sereins et contents de la journée passée à l'hôpital Trousseau. Heureusement, il n'est que minuit et il y a encore des métros à cette heure.

J'espère que la rénovation de cet hôpital permettra d'améliorer les conditions d'accueil des enfants qui sont les premières victimes du manque d'hygiène, de compétences, d'attention qu'offre cet hôpital aujourd'hui. En attendant, prévoyez avant de vous rendre là-bas : de la nourriture, de l'eau, un moyen de transport, des jouets, vos propres médicaments (personne ne nous a donné de Doliprane), un livre pour l'attente, une couverture pour votre enfant s'il veut dormir (11 heures, c'est long).

Comments (0)  Permalink

Stop stealing, innovate

Today I saw this proposal for the Zend Framework. I wouldn't be surprised if this proposal was accepted. Zend Framework seems to be unable to propose anything innovative to PHP developers. The examples provided on this page look like they are copy/pasted from code available in PEAR that already is 5 years old.

I think Zend as a software company has a real problem with innovation. Not surprisingly, PHP suffers the same problem. Most of (if not all) the new features are stolen from Java, C, C++, PERL, ... but nothing seems to be invented here anymore.

Of course, I think HTML_QuickForm2, the project we have been starting to work on will be a lot more interesting than these Zend_Framework proposals. It will be invented here and it will stay in PEAR. PEAR is where the innovation is. Zend_Framework is just, well..., a framework ?

Comments (11)  Permalink

My experience with Python

During the last 5 months, I have been learning Python. I read a few books about the language and subscribed to various mailing lists, RSS feeds and followed Open-Source projects.


Learning Python was easy and interesting. My experiences with programming languages so far have been mostly with PHP (since 1999), Objective-C, some C, Javascript and Actionscript for Flash. So I was at ease with Python and everything seemed well thought and designed.


Compared to PHP, Python is pretty. Even the syntax is prettier. The obligatory code indentation is in my opinion an excellent idea to make sure your code is readable and respects some coding standards. Compare this with the code you can find in PHP apps libraries where each script has its own way...


Python seems to have been thought from the start. On the other hand, features were added to PHP one after the other in order to "solve the web problem". So compared to Python, PHP looks like an ugly fat blob. It borrowed from C, Perl, Java, C++... In comparison, Python looks more like a nice girl in a pretty dress. But as Rasmus Lerdorf said, PHP was never designed to win a beauty contest.


I started learning Python mostly because I was getting bored with PHP. I write PHP code almost every day, 10 hours a day, so I wanted to try something new. I had to do it on my extra time since PHP is our language of choice at work. I picked Python instead of Ruby because I didn't want to follow the hype around Rails. I was also interested in projects like Python for Series60 from Nokia and pyObjC, a bridge between Python and the Cocoa framework.


As my work consists mainly in writting web application, my first attempts with Python were to see if I could also use it for the web. Well, the answer is not definitive but it's closer to no. Python is not ready for the web. The community is working hard on web frameworks but they go in every directions and none of them is well tested. And none of them is near PHP in terms of ease of use, features and deployement options.


Still, I really wanted so I picked up a simple web framework called Colubrid and tried to find a template engine that would fill my needs. In the past I have been using HTML_Template_Sigma and was after something as simple. Well, without success. There are a lot of template engines in Python but they are either too big and do easy thing the hard way, or they are too simple and don't support the basic stuff you would expect. So I decided to simply port HTML_Template_Sigma to Python.


In a way, I managed. My version supports everything that HTML_Template_Sigma supports. It took me 2,5 days approx. But the experience made me see how a language that tries to win the beauty contest is limited compared to its ugly brother. Here are some of the problems I met:

  • No isset(). If you use a variable that is not bound to an object, Python raises an exception, even if it's in a comparison clause. And you have no way prior to this exception to check whether the variable was bound. Some people suggest to catch the exception... This is like the chicken and egg problem.

  • Too many array types. PHP has only one type of array even if it can be used in different manners. Whether it is associative or not, the PHP arrays share the same set of funtions. In Python, you get dictionaries, tuples, lists, etc. And they don't have the same API. Arrays are probably the most useful way to store information in my code, with Python I always have to remember which kind of storage I used.

  • Values added to dictionaries are not stored in any specific order. Dictionaries are like associative arrays. Except that when you iterate them, the items you carefully added to them are listed in no specific order. This makes them totally useless and even dangerous. And there are no other datatypes provided by default to take care of your data in an ordered way. You have to write your own.

  • No easy one liners. I use a ? a : b; quite a bit in my code since it makes it shorter and easier to read (at least for me). You can't do something as simple in Python, you have to use convoluted ways.


There are a lot of other things in Python I felt were missing or wrong compared to PHP. The opposite is also true, but I mostly do web development and in this area PHP is way beyond. I agree that Python is a prettier language but that's not enough. Beauty is a subjective thing and to stay pretty you have to stay slim. I expect a language to provide me with the tools and the syntax to be as productive as possible, eventually with less code.


Actually, a lot of Python users seem to be in love with their language. They even invented a silly word to define and label other people's code : "pythonic" and "not pythonic". It means pretty. For example, interfaces, from Java or PHP5, are not pythonic. I actually got amused by the number of things that were not pythonic.


"Pythonic" is a geek term. In fact, I think Python is a language for geeks. The majority of Python users have no idea about marketing, business, promotion, press, corporate... Commercial terms are dirty. Python programmers like concepts and programming challenges. Python is their playground, their moment of fun, their hobby. There are actually a very little number of Python developers that seem to use the language for their living. Python is often used for prototyping and testing concepts.


I am not a geek and what I am really after is a tool to help me get more productive at work. Unfortunately, Python didn't fill my needs. I was happy to learn it and it showed me some interesting concepts implemented in interesting ways. Now I can read and write Python code that is maybe not "pythonic" but that does the job. Thanks to my initiation, I also discovered Mercurial, a very good RCS written in Python and switched to it from Subversion. I didn't loose my time, I simply had to try.


Now I am learning Ruby and enjoying it so far. It seems to fit the bill, along with Rails as a potential replacement to PHP. There is also an Objective-C/Cocoa bridge called RubyCocoa. Nothing for the Nokia Series 60, but this will force me to use my new Python skills so it's ok. In terms of beauty, I think Ruby won the contest over Python a long time ago. I will report about my experiences with Ruby later on.

Comments (9)  Permalink

Using CSS and list to build a pager

This is one way to build a pager using CSS. A pager is most of the time composed of a Previous page link, links to Pages and a Next page link. It can also have First and Last page links. This can be boring to build dynamically and to have elements aligned correctly, we often use tables. If we could use html lists, this would make the pager more accessible and easier to place in a modern layout (Web 2.0 anyone ?). Well, here is the solution I came up with.

First the markup your pager will generate:

<ul style="pager">
<li><a href="/0"><<</a></li>
<li><a href="/1"><</a></li>
<li><a href="/1">1</a></li>
<li>2</li>
<li><a href="/3">3</a></li>
<li><a href="/4">4</a></li>
<li><a href="/5">5</a></li>
<li><a href="/6">6</a></li>
<li><a href="/3">></a></li>
<li><a href="/6">>></a></li>
</ul>

It's pretty straightforward.

Now, the css

ul.pager {
	margin: 0;
	padding: 0 ;
	list-style: none;
	text-align: center;
	white-space:nowrap;
}
ul.pager li {
	margin: 0;
	padding: 0;
	list-style: none;
	display: inline;
}

Feel free to remove the white-space:nowrap if you don't mind it if your links wrap when the container is too small to fit them all on one line. The text-align:center is here so that the links are centered in the ul container. The trick really consists in making the li elements inline instead of blocks as they usually are.

Result

Bitmap rendering in Firefox

Pager rendering

I am going to elaborate on this pretty soon and show how such a simple pager can be styled easily. In the meantime, feel free to post your comments about this technique and its compatibility in other browsers.

Comments (3)  Permalink

We are family

My father is PERL 5. My grandfathers are C and sh. My grandmothers are nawk and sed. Who am I ?

Answer: http://www.levenez.com/lang/history.html

First time I also here about a Gogol programming language. I wonder what the syntax is like...

Comments (2)  Permalink

Guide to PHP Security, small book review

I ordered Ilia Alshanetsky book - php|architect's Guide to PHP Security - about a month ago. I did so because php|architect said there would be books with Ilia's signature for the first ones being ordered. I thought it would be nice to have one, for the fun and because I enjoyed Ilia's speaks at the International PHP conferences (in Amsterdam).

Anyway, I received the book without the signature so I was a bit disappointed. I thought I misunderstood the ad. I did not really ordered the book for its content because I thought, with 6 years of PHP programming, I now knew enough about PHP security and stuff like that. I admit my first web applications really sucked in this matter, but now I think they should be ok.

As I take the underground everyday, I sometimes find myself without anything to read and having nothing to read in Paris underground is pretty boring, so I picked up Ilia's book for the ride.

Now that I reached the middle of the book (took me approx. 8 underground rides), I can say it's very good and I have discovered many ways to further improve my applications. I learned something new about PHP on almost every page. This book is not exactly for newbies, it sometimes goes into PHP internals and give you excellent tricks on how to improve both your scripts security and performance. The code examples are very short and illustrative. This makes the book very easy and fast to read.

Ilia definitely knows what he writes about and goes well beyond security by also giving you useful tricks on PHP performance and how PHP works internally.

The only thing I thought was missing is a chapter about backup strategies, because if your server gets compromised, the only recourse you'll have in most cases are your backups. It would be nice to have this as a free chapter :)

The good thing is that today (only), php|architect is making a special offer on the book.

Comments (3)  Permalink
Next1-10/24