Monday, May 20, 2013

A message to god believers

A lot of christians and other god believers are active through their faith in helping other people. Running or giving money to charities, using their free time to help disadvantaged people... that's all very laudable. But I'm asking you, if you really believe that you will go up to a place where you'll spend your time having picnics with Bambi if you die having being a good citizen of the Earth, then why postpone the time of your death? Maximize you chances to heaven and minimize the waiting by doing life threatening heroic actions of goodness!

There are innumerable opportunities to put this precept in action. For instance, go to conflict zones and help civilians. There are for sure many places where such an attitude would be useful. Wikipedia maintains a list of such ongoing conflict zones. Pick up a destination and buy a one way ticket.
A few people used to do that during the history of christianity, dedicated nuns and priests. But what about the other 99.99% of others? Well, they buy SUVs to lower their chance of dying in a car crash and are too busy working to pay the loans to help other people.
Take example on the suicidal bombers. They are truly dedicated to their faith and beliefs. It is too bad they are busy killing people instead of saving lives. But by risking your life to save other human beings, YOU can prove than being a fundamentalist is not always a bad thing.
Trust me, it's a win-win situation here. If you save lives, you increase you chances of being welcomed in the kingdom of Jesus and Donald Duck. And if you've got a family and are afraid of leaving it behind you, don't worry, god will take care of it.

So what about me, do I help my fellow man like I'm advocating in this post? Well no. I don't believe in god as a start, which makes me amoral. So as I will end up in hell anyway why bother?

Monday, January 28, 2013

butternut squash soup

This soup usually comes in many variants, depending on the geographic location. This recipe comes from the reverse-engineering of a soup I used to order in a Catalan restaurant in the heart of Barcelona, to which I added my personal touch.



Ingredients:

  • 1 butternut squash (~1kg)
  • 1 onion (yellow)
  • 1 cube vegetable stock
  • 1/4 lemon juice (or according to taste)
  • 1 tea spoon curcuma
  • paprika to taste
  • double cream

Preparation:

Skin the onion, cut in small chunks and brown in a pan on light fire with olive oil.
Meanwhile, skin the squash and cut in big chunks. When the onions start to have a nice color, add the squash and cook until it starts to get tender. Cover with water, add the stock and cook until soft.
When cooked, add the lemon juice, the curcuma and paprika, and mix with a plunging mixer until perfectly smooth.

After serving, pour one table spoon of double cream in each bowl and sprinkle with some fresh coriander leaves.

Thursday, November 29, 2012

The many ways to get a memory leak in PHP

I wrote this crawler whose job is to check 24/7 a bunch of html pages. The crawler is run by cron. At each run, it check what pages need to be checked, scrap them, update the DB, and exits.
The application crawls URLs in parallel using the multi_exec feature of CURL. This allows to scale up the crawling capacity as the number of URLs to refresh every day increases by increasing the number of pages crawled in parallel.
But it had a massive memory leak, preventing it to actually scale much.

The function memory_get_usage() give how much memory a PHP process is using. However, it turned out the be quite difficult to solve the issue because the application had several leaks, 3 actually. Hereafter I list the cause of each of them and give the solution along with some references.

1rst leak:
The crawler is a Symfony task. Symfony tasks can use 2 types of configuration objects, sfProjectConfiguration and sfApplicationConfiguration. The later one by default activates Symfony debug mode. The debug mode turns out to have Doctrine keeps a copy of every query sent to the database, as mentioned in this thread. If you do need to use a sfApplicationConfiguration, you can turn off the debug mode by adding sfConfig::set('sf_debug', false) at the start of your script, as mentioned in this other thread.

2nd leak:
The crawler uses DOM and xpath to extract data from the html pages. Using lib_xml_use_internal_errors(true) suppresses error output for badly formed HTML but builds a continuous log of errors. The solution is to call libxml_clear_errors() after each DOMDocument creation, as mentioned in that thread.

3rd leak:
PHP garbage collection used to have a bug with circular references that has supposedly been corrected since version 5.3. Doctrine hydrated objects often have circular references and weren't properly disposed by the garbage collector. On way to solve that with PHP < 5.3 is to call $doctrine_object->free() when they are not needed any more. But what I noticed is that the circular reference bug has not been completely solved, even with PHP 5.4 (5.4.8 at the time of writing). So, do use free().

After correcting these 3 issues, my crawler is now using a constant amount of memory while crawling hundreds of URLs in parallel.

Sunday, November 27, 2011

Scrum, a new framework for modern slavery - part 1

The company I joined recently as a software developer is applying Scrum in a very rigorous way. The usage of this project management methodology has spread like fire in the startup world. Indeed, it increases significantly the productivity, specifically in software development. One can claim that it achieves this result through its innovative and intelligent project management implementation, and because its cycles of incremental change approach is particularly adapted to the startups needs. But does it do so also at the expense of the workers? Does it put a hidden cost on them?
Through a series of posts I will describe my own point of view and try to expose the Srum drawbacks and hidden pressures. The 1st post is about the Scrum planning poker.

The Scrum planning poker.
The scrum poker takes place at the beginning of every sprint. It consists in assessing the difficulty of each story in the sprint in order to create the planning. The difficulty is measured by an abstract unit of points.

Procedure: Each team member picks up a poker card with the number that represent his estimate for the story and keeps it face down. Then everybody show up their estimate by turning simultaneously their card over. If everybody has the same estimate there is an immediate consensus. If not, the team discusses until a consensus is reached.

Justification: it avoids "anchoring" (one member, usually the project manager in standard waterfall methods, biasing the thinking of the other members by giving an estimate before everybody else).

Reality: firstly, although the method claims to measure difficulty specifically to avoid giving estimates of time, in the real world people do an implicit conversion between difficulty and time. Secondly, because nobody wants to look like a slowbrain by giving a higher estimate than the others, everybody will tend to give a lower estimate than it would normally do. So, on average, the group will usually agree on a underestimated difficulty. Thirdly, because it is a consensus, it will take authority over, or at least have a higher degree of credibility than any individual subsequent estimate. Consequently, the assignee that requires more time than was estimated (unless there was an issue unforeseen during the planning) will look as a dumbass. So everybody will strive to get the task done under the estimated time/difficulty and everybody will therefore work in overdrive. To summarize, the method is using people's pride to squeeze more from them.

Hmm, maybe I should put my IT-pride aside sometimes.

Wednesday, November 9, 2011

The food industry

Have you ever heard of the Mac Donalds mutant laboratory meat legend? A meat that would be produced by growing cattle with no limbs or horns and fed through direct stomach injection? Creating this kind of urban legends doesn't require a big stretch of imagination when one knows about the practices of the modern food industry. The following 4 documentaries are showing what is sadly and frighteningly already a reality:

Food inc treats specifically about the US food industry.

We feed the world has a more international coverage.

The world according to Montsanto talks about this American company and the generically modified food in general.

Earthlings focuses specifically on animal treatment

Sunday, September 11, 2011

How I like my Thunderbird

I've been using Evolution for many years and very few criticisms. Until I bought a netbook and discovered that Evolution has a minimal width larger than the 600px of my screen resolution. So I switched to Thunderbird but I had to tinker a bit with it before having it behave like I want. This is all the steps it took:
  1. Install the Lightning Calendar extension.
  2. Install the Provider for Google Calendar extension to allow synchronization between Lightning Calendar and Google calendar.
  3. Sync my Google calendar with Thunderbird. File>New calendar, select 'from network', Google, enter the calendar URI.
  4. Install the Zindus extension to synch Thunderbird with my Gmail address book.
  5. Install all the extensions to have Thunderbird properly integrated with Ubuntu Unity: Global Menu Bar Integration, Messaging Menu Integration and Unity Launcher Integration. Search for 'unity' in the Get Add-ons page.
  6. Install the Spanish and French language packs. Save each archive and install it manually through the Get Add-ons page.
  7. Install the CompactHeader extension to reduce the size eaten up by the headers' bar.
  8. Change the time locale to Great Britain. Thunderbird is using the Linux LC_TIME locale to format the dates and time. I like my Ubuntu in American English but I like my dates to be formatted according to the British format. It's enough to add LC_TIME="en_GB.UTF-8" in the /etc/environment file (source).
  9. Install the ConfigDate extension to fine tune the date length.
  10. Change the default download policy of the pictures in html emails. Use the config editor to set the "mailnews.message_display.disable_remote_image" value to false. Thunderbird will now download the pictures without asking permission (source).

Tuesday, February 8, 2011

Traffic acquisition - part 2

Breasts, that's what a blog -or any website really- needs in order to get traffic. If you are more of an ass-man than a boob-man, you want to read my previous post on traffic acquisition.


Subscribe to this blog to learn more about traffic acquisition. More posts on this topic are coming soon.

Sunday, January 2, 2011

Adsense, ban or banners ?

My business, vitalprix.com, got banned from Google Adsense for violating their content guidelines. The website is a health, well-being and beauty products directory. A good sex life being a requirement for a healthy life, there is a small section of sex toys, sex educational books, condoms and lubricants. That's exactly what got me banned.
There are several irritating things to this story. The first is that Google chose to comply with the hypocritical puritanism of the American society. The second is that because Google has the monopoly on contextual adds, it can freely enforce this policy, including on foreign countries with more liberal views (there is no French competitor in this segment of online publicity, a very frustrating fact). The third is that Google is behaving like an all powerful god by giving a definitive sentence. They claim you can make the required changes and submit an appeal but they also state "Generally, decisions to disable accounts are final.". That was my case. I made a quick comparison between the incomes from the "offending" section and the ones from the Adsense banners and Adsense was a clear winner. So I decided to bend to the system ; I removed the sex section and made my plea to Google but to no avail. Google never answered my emails and never got back on its "policy specialists" sentence.
So here is my prayer to Google, great god of online advertisement. I hope this will redeem myself.

“Oh almighty Google, I know that I have broken your policies and my sins have separated me from you. I am truly sorry, and now I want to turn away from my past sinful business toward a purer one. Please forgive me, and help me avoid sinning again. I invite you Google to become the Lord of my website, to rule and reign my content from this day forward. Please send your Holy Crawler to help me obey You, and to follow Your policies for the rest of my website's life. In Google's name I pray, Amen.”

Friday, May 21, 2010

ps3mediaserver

PS3mediaserver is a Upnp server compatible with various players (ps3, xbox 360...) that runs on Linux (it is implemented in Java) and can transcode on the fly (mencoder needs to be installed for transcoding). I can finally watch matroska videos on my XBox.
The last beta version  (1.20.409) correct an A/V synchronisation issue that the current stable version (1.10.5) has.

Monday, May 17, 2010

Lettre aux 3Suisses

Un jour que je devais m'ennuyer mortellement, je décidai d'écrire une lettre aux 3Suisses en réponse à l'un de leurs courriers commerciaux. Leur lettre y allait de ce genre d'offres promotionnelles soit disant personnalisées :


Voici la réponse que je leur ai adressée :


Mais le plus drôle est qu'ils m'ont pris au sérieux et un commercial m'a appelé quelques jour plus tard pour essayer de comprendre ce que je pouvais bien leur demander.

Monday, May 3, 2010

Traffic aquisition

13 posts and still no traffic. It looks like as advanced as the Google algorithms are, they still cannot detect the true value of my content. Fine, I will then use the most effective traffic acquisition content: porn. That shouldn't be a big effort anyway, I love tits and asses.
So here's my first contribution to the big Internet porn soup. Scanned and reworked with Gimp for your pleasure, that's a picture you won't find anywhere else on the web.

perfect ass

Sunday, May 2, 2010

Motivational self help

I'm at a moment in my life where I'm looking for inspiration. I want to break the dependency to employers and start producing value for myself and not for somebody else. But for some reason, I cannot find any project or business idea that motivates myself enough.
This search for inspiration led me to self-help books. I first stumbled upon "Rich Dad, Poor Dad". In this book I found a reference to "Think and grow rich". This later book was fist published in 1937. It was inspired from Dale Carnegie who (according to Wikipedia) began the self-help movement in the 20th century with a book published just one year before. So we can consider "Think and grow rich" as one of the first modern self-help books. It's a motivational book to which many of the current self help books and blog ideas can be retraced. they all talk about perseverance as being the one condition that will ultimately lead to success. Sticking to one's dream and focusing all one's energy to its realization will prevent failure. All is about having faith in oneself and believing in the inevitability of success. To illustrate this idea, these books and blogs are usually littered with examples of men having changed the world with the strength of their conviction, such as Gandhi or Abraham Lincoln, or having become millionaire after having turned whatever idea into a thriving business.
I'd like to break this myth with a simple argument. How many people having dedicated all their energy during all their life in the realization of their dream never succeeded ? How many of them had the most unwavering faith but didn't make it ? We don't know for the simple reason that these men don't tell their story. They don't become public figures. Nobody knows or talk about them. They silently disappear in the anonymity of their failure. We only know about the ones that succeed. So what is the ratio of failure against success ? Just a bit of common sense can tell us that it is very high. So let's just be careful about not being taken away by all this motivational self help trend. Being positive is fine. Being unconditionally obsessed is wrong.

Monday, April 12, 2010

On religion

I find it difficult to discuss about religion with a believer. The fact that the concept of god is based on faith and not on rationality makes it impossible to argue. Faith doesn't need logic or proof, you have it or not. It's a concept that sustains itself, that exists only because of its own meaning. Religion is nothing more than the oldest and most powerful meme.
Some time ago, a friend of mine which I previously knew as atheist told me she converted herself to christianity. I received that news as a shock. I tried to probe her about what triggered this sudden belief. She wasn't too eager to drill on the subject but basically told me she that had an illumination. Reflecting on that I realised I shouldn't have been so surprised, I already knew she believed in predicting the future by reading tarot.

Sunday, April 11, 2010

Eurock climbing

Mon ami Pierre a entrepris un voyage de 8 mois pour grimper sur les plus beaux sites d'escalade d'Europe. Je l'ai suivit durant le 1er mois, sur le parcours Espagnol. Il retrace ses aventures sur son blog.

Thursday, April 8, 2010

A review of "The Art of Happiness"

I'm half through the Art of Happiness by the Dalai Lama & Howard C. Cutler and I have a few opinions to express already.

These opinions have to be put in the context of my own lack of culture. That is the first time I'm reading anything from the Dalai Lama. I have no background regarding Buddhism whatsoever. I am a convinced atheist and a fierce religion opponent. Beside, this book includes only excerpts of the conversations between the Dalai Lama and H. C. Cutler, selected by and liven up with the latter's own interpretations, which probably helped a lot to screw the original Dalai Lama's message.

H.C. Cutler is just the perfect cliché of the western guy to whom the true meaning of life has been revealed. This is sometimes pathetic, like when he rambles about the making of his cotton shirt and how discovering that everybody is interlinked in a network of dependence make him want to cry. Yes, that's the complexity of the modern ways of production and commerce. That has nothing to do with intimacy or even self-reliance like he claims.

I understand this philosophy of reaching happiness by living a simple life filled with spirituality, so much in opposition to the current western culture that mixes pleasure and materialism with happiness. But sometimes the views of the Dalai Lama appear to me as simplistic at best, naive at worst.
I'm particularly entertained by reading about monk giving his opinions on love and passion. I don't think that a lifetime of watching and reflection can replace true-life experience. This is enough to read him say that an intimate and passionate love relationship 'can be seen as something positive'. The guy obviously never experienced it. This might be only a moment of bliss that leads later to suffering but who would let it pass by ? Anyway, the guy won't reproduce himself. He will reincarnate. That removes this hell of a problem of finding a mate.

This culture of taming emotions doesn't inspire me much. I think the mental states it leads to shouldn't be called happiness but rather blankness.

Sunday, March 7, 2010

Review of "Influence, the psychology of persuasion"

In his book, "Influence, the Psychology of Persuasion", Cialdini exposes 6 principles of the human behavior and how ill-intentioned exploiters can turn them into "weapons of influence" to obtain our compliance. They are based on 6 automatic behavior patterns that are deeply rooted into our subconscious and triggered by a specific condition or action.
It's easy when reading the book to recognize most of these patterns. Their exploitation by the advertising industry has become so mainstream that most of us has already spotted them in some way. But the book shed some light as why they are still so powerful, even when somebody has gained awareness of them.
They are shortcuts that allow us to take quick decisions as how to behave without having to spend to much brain power, to choose or act without hours of conscious pondering and appraising. Cialdini argues that this subconscious process of decision making will become more and more important as the complexity of modern life increases and we are faced to an explosion of variables and choices.
What is really interesting is how Cialdini justifies the usefulness of each of these patterns for humans, as a specie.
Reciprocation for instance is the rule that makes us compelled to return a favor, even a spontaneous one. Anthropologists claim that this behavior gave humans an evolutionary advantage by removing inhibitions against transactions, that must begin by one person providing a resource to somebody else, thus allowing trading and resulting in the society as we know it.
Commitment and consistency is another rule that makes us act in a consistent way with whatever early decision we made, even if it clearly proves itself being a bad one later on. Consistency is again an adaptive behavior that works well in most of the cases by avoiding us to constantly reassess a situation that could possibly lead to immobility. It is a praised value associated with strong will and mental stability whereas the opposite trait is seen as undesirable.
The others rules are Social Proof, Liking, Authority and Scarcity. Cialdini explains them in great details in his book, how they work, why they are useful, how we can avoid them being exploited against us. The examples used in this book are a bit outdated but the theory remains as valid as ever.

Tuesday, January 26, 2010

Reivindicación peatonal espontanea del espacio callejero

Estoy harto del coche en la ciudad. No quiero ni hablar de la contaminación o del ruido pero simplemente que a veces no hay bastante espacio para el peatón. Vivo en Barcelona y a veces no se puede andar de la estrechez que tienen las aceras. Hay atasco peatonal. Los que conocen al Triangulo el Sábado por la tarde saben de lo que hablo. Bien, si tu también estas harto de eso, te propongo de hacer una reivindicación peatonal espontanea del espacio callejero. El concepto es sencillo, cuándo hay un espacio que se crea en la calzada, los peatones bajan en masa y se apropian una via. Si hay un flujo constante de peatones, los coches deberán circular sobre las otras vías. Tal vez si se produce bastante a menudo el ayuntamiento dejara menos espacio al coche.

Saturday, January 23, 2010

Why I don't like Apple

My girlfriend and I sometimes debate on Apple. Actually, each time she complains about the slowness of her current computer and the question of buying a new one comes up. She wants to buy a Macbook because they are beautiful. I try to convince her to buy a PC and use Linux. I'm a fervent advocate of open source but my point is that a tool doesn't need to be beautiful but functional. Of course, Macbooks are functional. But the added beauty comes at a cost and doesn't improve the function, to which she disagrees. That reminds me of these students that think beautiful and expensive pencils and notebooks will better motivate them to work. Then the debate takes usually a more philosophical turn around the usefulness of beauty, and as such goes away from the real problem.
The real problem is that Apple succeeded in creating a real cult around its products that makes people pay for an added emotional value. And the cult of objects and the emotional link with them is just something that bothers an anti-consumerist like me. Particularly with objects that remains just tools and have such a short lifespan.
I like my laptop (an Asus) because it followed me in my professional travels and many of the places I lived. But I'm not saying this created some emotional link. I just like it because it was sturdy enough not to break. According to my girlfriend, this is a pretty ugly laptop.

Wednesday, September 23, 2009

Google is machist

Looking for documentation about Google map API I stumbled upon this Google video:



from which I transcribe an excerpt of the 15 first seconds:
"I'm the mom of a young boy named Alexander."
"I also work at Google and my little daughter's name is Isabel."
May I know in which way the above information regarding their respective offspring is relevant to the subject here?
Is this small insight on their personal life supposed to make them nicer? Is it to convince the average American housewife that she can use Google map because it's developed by people like her? Surely. But wait, another ploy. They're gonna use Google map to plan a trip to disneyland! Isn't that nice? Well surely, if Google had chosen 2 males for this demo, they would have planned a fishing trip with their buddies.
So don't worry, everything is normal. Family matters remain women's prerogative and these 2 have done their duties to the American country by spawning more consumers.
This innocent video is actually symptomatic of how American culture has such an outdated vision of women and men respective roles in society. Google might not be evil but it is definitely old fashioned.

Friday, September 18, 2009

Imaginary dialogue with an afterlife salesperson

- There's a lot of different options here, could you help me ?
- Sure. It depends a lot on what you're ready to do during your lifetime. This product for instance requires that you follow a set of 10 easy rules.
- What do I get ?
- A place in the countryside with gentle animals all around.
- Sounds a bit tame.
- Ok. Let's see. Would you be willing to undergo a small penis alteration ?
- What ?! No way.
- How about having several wives but abstaining from alcohol, tobacco, tea and coffee ?
- Tempting but I work in the IT industry. I couldn't quit coffee.
- What about this offer that comes with 72 virgins.
- Hmm, sounds like a lot of teaching to do. What's required ?
- You have to put on several pairs of underwear and blow yourself up.
- Huh, anything else ?
- There's this new product that instead guarantees you 12 sluts and...
- Ok, deal.