Blog #I.T.

Which operating system to choose for a web developer workstation ?

I noticed that on most PHP-based projects i worked, Debian was the distro used on most of the customers servers. CentOS went down at second place during the decade, and now that Red Hat voluntarily killed it by turning it into a “development version of RHEL” and even ending prematurely its LTS support, I bet Debian will be even more dominant !

To answer the question asked in the title, the best OS (operating system) for a web developer workstation is an operating system that is as close as possible to that of the server !

Why ? Same package manager, and you can try / test the command line because doing it on servers. In addition, allow developers to better understand the functioning of their servers and the structure of their files …

But what if you are working for several projects and clients with different systems?

Read more

My modding experience on video games : Battle for Wesnoth

J’ai déjà parlé dans un précédent article du jeu vidéo Battle for Wesnoth, un jeu de tactique en 2D aux allures de jeu d’échec dans un univers heroic-fantasy.

Sorti en 2003, développé au départ par une seule personne qui voulait développer un jeu open-source avec des mécaniques simples, il a été en constante évolution depuis, enrichi et maintenue par des dizaines de personnes au fil du temps. Et malgé tout ce temps, la commuauté reste très active : il y a même une équipe qui travaille actuellement sur une version 2 basée sur le moteur de jeu open-source Godot.

Pour en savoir ceux qui ne connaissent pas, faites donc un tour sur le site officiel et ses formums, ou la page Steam du jeu.

Le jeu est totalement gratuit et open-source, et le restera. Ces circonstance, ainsi que le succès inattendu du jeu (qui se retrouve dans la plupart des “top jeux gratuit sur PC”), était bien sur propice au modding.

Lire la suite

Apprendre à utiliser les flexbox CSS (presque) en s’amusant

Un tutorial bien fichu qui fera enfin comprendre comment fonctionne les propriétés CSS de placement flex

http://flexboxfroggy.com/“>Voir le site : Flexbox Froggy

C’est mon prénonyme Thomas Park qui a eu l’idée de faire une appli web bien sympa, ou il faut placer correctement des grenouilles sur des nénuphars en éditant une propriété CSS et on voit en live le résultat. La dernière étape (24 !) est la seule un peu ardue, autant dire que la progression est plutot sympa, et le fait de répéter pas mal de fois les mêmes commandes aident a mémoriser les propriétés.

Have fun !

An alternative of Hungarian notation applied to PHP

For some cases, by example when you works on webservices or an ETL, you can be a little lost between all the variables you use, specifically arrays.
I developed a derivative of the Hungarian notation to prefix my variables and find myself there. This notation can be applied in php, but also to any other languages, especially non-typed.
There is the prefixing I use with PHP variables in that specific cases, depending on their type and design :

Scalar types prefix

  • $is, $b : boolean
  • $s : string
  • $i : int (unsigned)
  • $n : natural (signed int)
  • $f : float
  • $fd : float round to 1 decimals
  • $fc : float round to 2 decimals
  • $fm : float round to 3 decimals
  • $m : mixed.

Non-scalar prefix types

  • $o : object
  • $r : resource (PHP-specific)

Array, can be, by design, a collection of elements, or a single element. For me an “element” is an object-like data, stored as an associative array. While a collection if an array of elements.
So I can distinguish 3 different types for arrays :

  • $e : (array) Element (or Entry, or Entity) ; associative array containing data about an element.
  • $c : (array) Incremented Collection ; an array with auto-incremented keys containing elements. Means that the array keys don’t identify an element, event if the order to process it can be important.
  • $a : (array) Associative collection ; an array with associative & manually-assigned keys (like “hashes” in Perl ) containing elements.

For collections, I usually also put the variable in plural (or simply suffix with an s). I suggest to combine collection prefixes with the other prefix showing the values each entry contains :

  • $ca : incremented-collection of Associative collection
  • $cm : incremented-collection of mixed elements
  • $ae : associative-collection of array elements
  • $as : associative-collection of string elements
  • $am : associative-collection of mixed elements (each entry can contain different things)
  • $cbo : increment-collection of boolean OR objects. So we have to test if the entry is an object before processing it.

Semantic types :

  • $u : unsafe type or value, need to be checked or sanitized for security reason.
  • Can be combined : ie $us for unsafe string, with possible code injection.
  • $zo : string of encoded object
  • $zj : string of encoded json
  • $zh : string of encoded html entities, ie: ‘"’
  • $ts : timestamp (signed int)
  • $d : date, format ‘Y-m-d’ (string)
  • $dt : datetime, format ‘Y-m-d H:i:s’ (string)

I personnally try to avoid to prefix private members / functions with underscores.