Symfony 2 serializing nulls or not on demand

Symfony is pretty new to me and i’m learning new stuff everyday. Building this api where i work made me learn that sometimes you may want to have the null serialized and sometimes not. So by default, let’s say you activate it, when you want to deactivate it on the fly, the best way is just to turn on/off the null serialization strategy.

$this->get('fos_rest.view_handler')->setSerializeNullStrategy(true);

IMO, it’s best to simply always serialize nulls as not all end users will be able to deserialize missing properties or not. If a property is not set, it should still be serialized by default but with a null. It’s a matter of taste i guess, but tecnically speaking, i’d always do that!

A host only network interface you’re attempting to configure via DHCP already has a conflicting host only adapter

Using Vagrant on a new machine on Ubuntu 14.04 this morning cause me quite some trouble when doing a simple “vagrant up”. The message:

A host only network interface you’re attempting to configure via DHCP already has a conflicting host only adapter with DHCP enabled. The DHCP on this adapter is incompatible with the DHCP settings. Two host only network interfaces are not allowed to overlap, and each host only network interface can have only one DHCP server. Please reconfigure your host only network or remove the virtual machine using the other host only network.

This led me on a search to understand the problem and find the following simple answer, remove the DHCP server on the machine by doing:

VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0

Support a sick friend, buy a cool coder t-shirt!

One of my friend is sick with leukemia LAL a special form of leukemia that cannot be cured with standard medication. Sadly, that non-standard medication is not covered and she doesn’t have enough cash on hand to pay for it. She’s doomed unless we poll together.

I created a teespring campaign with a cool t-shirt for coders, all profits will go to her fund raising to help her pay for her treatment:

http://teespring.com/keep-calm-let-the-coder-do-it

Thanks in advance!

Offloading dependencies to third party users, right or wrong?

I’ve been working at a big business for the last year and a half and i have seen my share of bad practices since i started. Nothing new here, big businesses usually don’t sport a lot of high end talent and the development is usually highly disorganized. But at least, one would think that correct application infrastructure was a must for large business like those. Today, i want to talk about application intercommunication and the best and worst practice you can do on that part.
Continue reading Offloading dependencies to third party users, right or wrong?

Tips from a PHP expert, public speaker and trainer