\_o< ~ Mirmo Dynamics

Rien de grand ne se fit jamais sans enthousiasme.

To content | To menu | To search

Sunday 7 September 2008

Traîner pour sécher

Vendredi, on m'a offert une magnifique peluche champignon.

Sur l'étiquette on peut lire ceci:

All new materials. Polyester fiber. Wash separately without bleach. Hand wash in cold water. Hang out to dry.

Et c'est traduit comme suit:

Tous nouveaux matériels. Fibre en polyester. Se laver séparément sans le décolorant. La main se lave dans l'eau froide. Traîner pour sécher.

Ça se passe de commentaire.

Wednesday 13 August 2008

Démission

Alors voilà, j'ai remis ma démission hier à mon DT, qui l'a accepté. Je quitterais donc mon emploi le 12 septembre prochain, 4 jours avant de partir pour le japon pendant 2 semaines.

C'est une grosse page de ma vie professionnelle qui se tourne, et un nouveau chapitre qui s'ouvre, avec de nouvelles possibilités à l'horizon. Après deux ans et demi (world record wouhou !) chez Newsweb, j'ai ressenti (a nouveau) le besoin de progresser techniquement, ce qui n'est plus possible pour moi ici. Donc voilà, je commence un nouvel emploi le 6 octobre, qui devrait m'apporter beaucoup sur le plan technique, ainsi que sur d'autres aspects de ma vie professionelle sur lesquels je m'étendrais plus tard. Oh, et je serais aussi ammené à travailler avec des gens sympas (enfin au moins un, il me reste encore à découvrir les autres mais ça s'annonce plutot pas mal).

Voilà vous savez tout !

Monday 28 July 2008

The Eight Irrestitible Principles of Fun

http://www.eightprinciples.com/

(via pmog)

Wednesday 23 July 2008

La Défense / Puteaux a pied

J'aime beaucoup google maps, et pour fêter ça, et à cause des travaux sur le tram qui coupent la circulation entre la défense et puteaux, j'ai fait une map avec le trajet optimal (je pense) entre le parvis de la défense et la station de tram de puteaux.

Voilà c'était la minute je kiff gmaps.

Monday 14 July 2008

About the self keyword in static methods

While setting up a test server for some software I wrote at the office, I eventually noticed the following notice:

Notice: Use of undefined constant self - assumed 'self'

That surprised me, because 1) I though self were some kind of "superglobal" constant or a special token of the parser, always automatically available in a static method and 2) the code works. So what's up in there ? Let's make a simple test:

<?php

class foo {
	static public function bar() {
		var_dump(is_callable(array('self', 'foobar')));
		var_dump(is_callable(array(self, 'foobar')));

		var_dump(class_exists('self'));
		var_dump(class_exists(self));

		self::foobar();
	}

	static public function foobar() {
	}
}

foo::bar();

Executing the above code will yeld the following result:

bool(true)

Notice: Use of undefined constant self - assumed 'self' in /home/geoffreyb/test.php on line 6
bool(true)
bool(false)

Notice: Use of undefined constant self - assumed 'self' in /home/geoffreyb/test.php on line 9
bool(false)

What do we learn here ? Not much actually. It seems like self as a constant is only available when used with the scope resolution operator, aka double-colon or paamayim nekudotayim. When you want to use it in, for example, a callback definition, use a string representation of self:

<?php

is_callable(array('self', 'bar'));
call_user_func(array('self', 'bar'));

Which, while making absolutely no sense at all, works. Another way to get around this is to use the get_class() function that, without any argument, will return the name of the class you're currently in (foo in my example).

After a bit more investiging, I found out that there is nothing special about the self token, which is actually a string token. You can check this very easily with the following code:

<?php

class foo {
	static public function bar() {
		self::foobar();
	}
}

var_dump(token_get_all(file_get_contents(__FILE__)));

Somewhere inside the output, you'll find the following piece of text:

  array(2) {
    [0]=>
    int(307)
    [1]=>
    string(4) "self"
  }

And the token id 307 is resolved by token_name to string.

Thursday 10 July 2008

Rename directories to lowercase

Using a single (and somewhat simple) shell line, you can rename any directory to its lowercase version.

for i in *; do lcase=`echo $i | tr A-Z a-z`; if [ ! -d $lcase ]; then mv $i $lcase; fi; done;

Viva el chell !

Tuesday 8 July 2008

Where the hell is Matt ? 2008 edition

Au fait, je ne vous ai pas dit, mais la nouvelle vidéo de Matt Harding est dispo, et franchement ça donne envie. J'aurai du me filmer à danser en Suède tiens... ça me fait une bonne excuse pour y retourner :D

Tuesday 8 July 2008

La suède, un beau pays, épisode 1

Réclamé a corps et a cris par mon fan club en délire depuis trop longtemps, voici enfin le fameux, le seul, l'unique, blogpost sur la Suède. Alors les légendes urbaines sont-elles fondées ? Croise-t'on des blondes sulfureuse à chaque coin de rue ? Y-a-t'il des Ikea à chaque coin de rue ? Les villes sont-elles entièrement construites en bois ? Sont-ils réellement en avance des 50 ans écologiquement ? Réponses dans la suite du billet.

Continue reading...

Monday 7 July 2008

Nous accusons réception de votre réservation.

Aller : mardi 16 septembre 2008 Durée du trajet : 16h25

Départ :    12h20  Paris  Charles De Gaulle  (France)
Arrivée :    16h15  Helsinki  Helsinki-Vantaa  (Finlande)

Départ :    20h20  Helsinki  Helsinki-Vantaa  (Finlande)
Arrivée :    11h45  Osaka  Kansai International  (Japon)

Retour : mardi 30 septembre 2008 Durée du trajet : 14h35

Départ :    14h00  Osaka  Kansai International  (Japon) 
Arrivée :    18h10  Helsinki  Helsinki-Vantaa  (Finlande)

Départ :    19h30  Helsinki  Helsinki-Vantaa  (Finlande)
Arrivée :    21h35  Paris  Charles De Gaulle  (France) 

Thursday 26 June 2008

Apache and mod_rewrite to subdirectories

Naneau just poke me with a little problem he had with mod_rewrite when trying to rewrite to a subdirectory. Imagine you've got the following setup:

  • Apache's document root is /document_root/
  • You application's bootstrap is /document_root/public/index.php

You could come to the following rewrite rules quite easily:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php/$1 [L]

And you'd be horribly wrong.

The problem here is that when you hit / on your server, mod_rewrite will populate %{REQUEST_FILENAME} it to /document_root/, which obviously fails the !-d rewrite condition. By the magic of DirectoryIndex, you'll eventually hit /index.html (or whatever your directory index is set to), and there we go for another rewrite magic. At this point, things get a little messy, and if you're like naneau, you'll end up crying while rolling on the floor and calling for help on irc (that's quite a set of hard things to achieve at the same time).

The solution is not that simple, and actually, I've not found a fully satisfying solution yet (although naneau is satisfied with the partial solution). The quick hack is to simpy remove the !-d condition. The obvious drawback is that any existing directory will get rewritten, but you'll be able to access the files inside it. I'm still working on a more complete solution, but as it's not my main concerne for the moment, it'll wait a bit (unless someone posts a solution in the comments).

Wednesday 18 June 2008

Les Pates Vivantes

C'est le nom du petit restaurant chinois dans lequel j'étais hier soir. Honnetement, c'était surement les meilleurs nouilles que j'ai mangé de ma vie, faites à la main en live, vraiment délicieux, et pour un prix plus que correct.

Les Pates Vivantes, restaurant de pates, 46, rue du faubourg Montmartre, 75009 Paris (01.45.23.10.21)

Voir aussi: Tiens des pates

Friday 13 June 2008

De retour en France

Voilà, nous (avec mon supercopain Vaurent) sommes rentrés samedi dernier d'un voyage de deux semaines en Suède. Un pays magnifique, dont je vous parlais plus en longueur un peu plus tard (y'a tellement à dire que voila...), et puis si j'ai le courage y'aura aussi une création inédite, super drôle.

Sunday 20 April 2008

Destination suède

GOING OUT

From Paris (Beauvais) (BVA) to Stockholm (Skavsta) (NYO)
Sun, 25May08 Flight FR9502 Depart BVA at 09:50 and arrive NYO at 12:00

COMING BACK

From Stockholm (Skavsta) (NYO) to Paris (Beauvais) (BVA)
Sat, 07Jun08 Flight FR9501 Depart NYO at 06:50 and arrive BVA at 09:05

Allez hop ! Deux semaines en suède avec mon tcheum caribou, ça pourra pas faire de mal tabarnak (oui je m'entraine a parler québecois un peu).

Monday 31 March 2008

Zend Framework 1.5.1 PEAR package is available

A little late sorry, but ZF 1.5.1's package is now ready.

Monday 31 March 2008

Attention, April's fool is coming

N'oubliez pas que demain, c'est le 1er avril. Ne croyez pas tout ce qu'on vous dit. Oui je hais cette date.

Don't forget it's April's fool tomorrow ! Don't believe everything you're told of. Yeah I hate that date.

Thursday 27 March 2008

ruby: url_to_constant

A small bit of ruby to get a constant from an URL:

require 'uri'
def url_to_constant(url)
	return URI.parse(url).host.gsub(/^www\./, '').capitalize.gsub(/[^a-z][a-z]/i) { |m| m.gsub(/[^a-z]/, '').upcase }.constantize
end

Nothing exceptionnal here, just a pretext to post something.

Saturday 22 March 2008

Zend Framework 1.5 PEAR package is available

The long awaited 1.5 version of the Zend Framework has landed for some days already, and here comes its pear package. Please note the api version changed to 1.5 in this package.

Friday 21 March 2008

Sensations extrèmes

Ah ! J'avais pas chopé la vidéo à l'époque, mais maintenant que je l'ai, hop: mes débuts en chute libre, c'était l'année dernière en aout, mes premiers sauts du coté de Poitiers avec mon compère jérome (le deuxième a sauter). Pour ceux qui s'y connaissent un peu, j'ai un peu foiré mon saut :p

Vivement les prochains ;)

Friday 21 March 2008

Zend engineer certification, I has it

Just a quick note to say I successfuly passed my Zend PHP 5 Certification this morning.

Monday 10 March 2008

Plugin "related by tags" pour dotclear 2, deuxième

Après de longs mois d'attente, le related by tags nouveau arrive enfin ! Au menu des réjouissances, une interface de configuration, ainsi qu'un widget font leur apparition. Vous disposez donc désormais de deux manières d'afficher les billets liés, directement en modifiant le template comme avant:

{{tpl:include src="_related_by_tags.html"}}

ou tout simplement en activant le widget correspondant, que vous pouvez configurer comme vous l'entendez. Bien sur, ce widget ne s'affichera que lors de la visualisation d'un billet.

Au chapitre des fonctionnalités / bugfix manquant(e)s, on notera le bug lié à l'utilisation de postgresql, ainsi que la traduction française, qui sera pour plus tard.

Encore une fois, n'hésitez pas à poster tous vos commentaires ici même.

- page 2 of 37 -