array_unique returns NULL

I am dealing with legacy code written by another team and someone asked me why his images were not showing up...

Took me an hour to dig that one out.

Simply because the optional second parameter to array_unique() was only added in php 5.2.9 and we were using 5.2.4 ... Therefore it was generating an error that was hidden (because of error_reporting) and returning null.

I removed the second parameter and VOILA!

Too bad the sysadmin does not allow us to upgrade PHP. :)

Lenovo "Stand By" Stuck (solved)

When I put my levono T500 in stand by mode, I sometime do it quickly and unplug my usb keyboard and mouse and my external monitor while it is still going in stand by. It took me some time but I made a co-relation between that action and the fact that the whole system just hangs forever while going in stand by mode, forcing me to hard reboot.

Since I changed my habit by waiting that the lenovo is in stand by mode before unpluging my USB devices or unpluging my external monitor, I no longer get that problem.

Indentation: Tabs vs. Spaces

This is one of these archaic question.

Short answer: Spaces, and only spaces.

Long answer:

Origins
The tab key on the keyboard seem to have first been introduced with typewriters and then with computers. The original idea was not about indenting complex code structure. A long time ago, some people started to use tabs for indentation because of the disk space it was saving.

Concept

Disable cache on Chrome

As a developer, I often need to clear the cache to see my changes.

The best is when the cache can be disabled completly.

There are many options but here are 3 options that I consider like the best of the options.

Google is gaining ground over firefox (for me)

I am using less and less Firefox because

  • It's slow to start/load
  • It's bloated
  • It's a memory pig

I just found a GREAT chrome application for developpers.

https://chrome.google.com/webstore/detail/hgmloofddffdnphfgcellkdfbfbjel...

This chrome app allow you to test REST calls and it's similar to the firefox POSTER extension.

Easy to use and shows your parsed JSON/XML content.

The only thing missing is the ability to see the REQUEST headers. Right now it only shows the response headers.

Doctrine considers empty string as null (I mean Oracle)

We are on the last stretch of our project and we need to deliver soon.

Sometimes, we have to make concessions and compromises in order to make sure to deliver in time.
This means coding something that is not necessarly clean.

We wanted to use a column that could have 3 different significations.
The column was already a varchar2 and we needed to keep it that way for legacy reasons.

Reading book: Zend Framework 1.8 Web Application Development

I am currently working on a PHP project which involves creating web services with Zend Framework.
I started reading the book "Zend Framework 1.8 Web Application Development" and I plan on doing a review soon.

Drupal in Africa

I recently had the pleasure and honour to help rebuild the BDA foundation’s website using Drupal.
I would like to thank Julie Hinse from Comptabilité Carrier who recommended me for this contract.

Drupal Camp Montreal 2009 over

What a Drupal Camp! That was a lot of fun.

Here are the camp's photos:
http://www.flickr.com/photos/roydeziel/sets/72157622610060732/show/

Enjoy!

(Special Thanks to Omar for inspiration on a successful camp!)

Selenium and popups.

I wanted to write a selenium test script to validate calculation done in a page to make sure they match those of another page. I used the store* functions to grab the values from the source. My problem was that the second page was actually a popup.

There have been some reported problems with selectWindow and selectPopup and waitForPopup functions. They are not always working with Firefox 3.x. They were not working for me.

So I thought that maybe I could have the page NOT popup when it's being accessed by selenium. That way I will not have to use these broken functions.

Syndicate content