The Ultimate Flexbox Cheat Sheet

Flexbox is a brand, spankin' new CSS layout module with suprisingly good browser support! Say goodbye to float frustration and hello to a brave new world of easy vertical centering, re-ordering elements and dynamically growing and shrinking layouts.

http://www.sketchingwithcss.com/samplechapter/cheatsheet.html

Ludei - We love HTML5

Deploy HTML5 apps and games to every mobile market with no code changes and with native performance and features.

https://ludei.com/

So you want to be a Unity3D game developer?

I’ve compiled an extensive list of resources at your disposable on your Unity3D journey, split up in to sections to allow you to target what you need

http://www.codeproject.com/Articles/682834/So-you-want-to-be-a-Unity3D-game-developer

Global Forest Change

Results from time-series analysis of 654,178 Landsat images in characterizing forest extent and change, 2000–2012. ‘Forest Loss’ is defined as a stand-replacement disturbance, or a change from a forest to non-forest state. ‘Forest Gain’ is defined as the inverse of loss, or a non-forest to forest change entirely within the study period. ‘Forest Loss Year’ is a disaggregation of total ‘Forest Loss’ to annual time scales.

http://earthenginepartners.appspot.com/science-2013-global-forest

Symfony Rest Json Datetime

The problem


I was making some improvements to the PlanIT project that I'm redesigning all the source code to work with AngularJS and Symfony.

In the project I have some date time forms parameters that are sent in JSON like this :

{"user":1,"name":"Test project #3","description":"Test project #3","begin":"2012-12-12 10:00:00","end":"2013-12-12 10:00:00"}

I wanted to use Symfony form validation to valid my fields and save the entity to database. I used the FOS Rest Bundle in my project to get the form parameters this way :

$project["name"] = $request->request->get('name');
$project["description"] = $request->request->get('description');
$project["begin"] = $request->request->get('begin');
$project["end"] = $request->request->get('end');

$form->bind($project);

if ($form->isValid()) {
    // Save entity
}

The problem I had is that the Datetime parameters was just ignored and transformed to null values.

The solution


After some researches online, I found that you need to generate the bound datetime form value in a different manner : the object should have defined the year, month, day, hour, minute and seconds separately in order to be bound successfully. So there is the solution I opted for :

$project["name"] = $request->request->get('name');
$project["description"] = $request->request->get('description');

$tmpDatetime = new \DateTime($request->request->get('begin'));
$project["begin"] = array();
$project["begin"]["year"] = $tmpDatetime->format('Y');
$project["begin"]["month"] = $tmpDatetime->format('m');
$project["begin"]["day"] = $tmpDatetime->format('d');
$project["begin"]["hour"] = $tmpDatetime->format('H');
$project["begin"]["minute"] = $tmpDatetime->format('i');
$project["begin"]["second"] = $tmpDatetime->format('s');

$tmpDatetime = new \DateTime($request->request->get('end'));
$project["end"] = array();
$project["end"]["year"] = $tmpDatetime->format('Y');
$project["end"]["month"] = $tmpDatetime->format('m');
$project["end"]["day"] = $tmpDatetime->format('d');
$project["end"]["hour"] = $tmpDatetime->format('H');
$project["end"]["minute"] = $tmpDatetime->format('i');
$project["end"]["second"] = $tmpDatetime->format('s');

$form->bind($project);

if ($form->isValid()) {
    // Save Entity
}


I hope that this will help you to bind date and datetime base JSON parameters to your Symfony form.

Greetings.

Most seen