PHP test – #1

What happens with the following code:

<?php
for($i=a;$i&lt;=z;$i++) echo("$i\n");
?>

And what’s the difference with?

<?php
for($i=a;$i&lt;z;$i++) echo("$i\n");
?>

Why is the result different? and How?

Worst:

<?php
$i=a;
while(strcmp($i,z)<=0){
echo($i."\n");
$i++;
}
?>

Gives exactly the same result as the second exemple.

hints:
http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion
http://www.php.net/manual/en/language.operators.comparison.php
http://www.php.net/manual/en/language.types.string.php

Coding Dojo

@ São Paulo University http://www.dtsato.com/blog/wp-content/uploads/2008/06/sato-codingdojo.pdf
Session process:

Problem choosing (5 min)
Problem discussion (10 min)
Coding session (1h)
Retrospective (10 min)

2 Style of coding sessions:

Randori dojo
Prepared Kata

Session roles:

Moderator: Moderating the discussion, conducting the retrospective
Organizer: Room Reservation, setting up computer, projector, sending reminder, preparing the program, cleaning the room
Scribe: Publishing and sharing the result of the meeting, taking photo, video…
Participants: [...]

Quechup is selling (let steal) e-mail adresses: honey pot #1 triggered

My subscription to quechup was used for spam mail such has:
Cindy Foster – CindyFoster1533@live.com
to quechupxxx@xxx.sbw.be
H! I find your post interesting. I am pretty chick. I am moving to your area from russia
I am looking for a good man to show me around and may be more ;)
Could you please kindly reply to me at [...]

Clean and efficient mysql ssh tunneling (on linux)

ssh -L 3307:localhost:3306 <user>@<remotehost> -f sleep 10; mysql -u <mysqluser> -p -P3307 -h 127.0.0.1

ssh -L 3307:localhost:3306 –> create a 3307 listening port locally that will be forwarded to a 3306 port on the other end of the ssh tunnel
<user>@<remotehost> –> user allow to connect via ssh on the remote host
-f –> go in background
sleep 10 [...]

Google longitude

CSS Sprite bug on google :P

python on mac os x 10.5

I’m quite new to mac’s world, but I’m quite old from linux…
So here is my short note about python on macosx

Install the XCode 3.0 additional disk that came with Leopard
Install macport
set in your profile (/Users/yourname/.profile) the following lines

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0
export MANPATH=/opt/local/share/man/:$MANPATH
export EDITOR=vim

Install port python (with django): sudo port install py25-django
Install port ipython: sudo port install [...]

macport: port list * is slow

I’m just wondering why port list *mysql* is so slow.
It just do exactly the same than port list | grep mysql but need 5x more time.

Mac OSX vim terminal page up, page down, home, end working

in Terminal > File > Preferences
change the following keyboard settings:
Home: \033[4~
End: \033[1~
PageUp: \033[5~
PageDown: \033[6~
To write \033 just press ESC button, for [ it’s MAJ+alt+5 and finally for the ~ it’s alt+n
then do not forget to assign the default value to this particular settings format
update: or use iTerm

Virtual servers on ubuntu 8.10 intrepid

I tried xen… and I failed, so… here is a good tuto:
https://help.ubuntu.com/community/KVM
basically:
sudo apt-get install ubuntu-virt-server ubuntu-virt-mgmt
+ a linux iso ready