A french/american blog with some hungarian spices…
English
Convert a week number to a date in perl
Jun 11th
Today I had to hack a quick script to convert a week number to a date in perl. To my surprise, the answer was not straightforward and I had to test and try a little bit before to get something working.
So here it is:
#!/usr/bin/perl use strict; use Time::ParseDate; use Time::Local; sub convert_week_to_date { my ($year, $week) = @_; my $ref = timelocal(0, 0, 0, 1, 0, $year); my ($s, $m, $h, $dom, $m, $y, $wd, $yd, $i) = localtime($ref); my $time = parsedate("+".$week." weeks", NOW => $ref); my ($s, $m, $h, $dom, $m, $y, $wd, $yd, $i) = localtime($time); $wd -= 1; my $time = parsedate("-".$wd." days", NOW => $time); my ($s, $m, $h, $dom, $m, $y, $wd, $yd, $i) = localtime($time); return (sprintf("%04d/%02d/%02d", $y + 1900, $m + 1, $dom - $wd + 1)); } print convert_week_to_date(2009, 1)."\\n"; print convert_week_to_date(2009, 52)."\\n"; print convert_week_to_date(2010, 1)."\\n"; print convert_week_to_date(2010, 22)."\\n"; print convert_week_to_date(2010, 23)."\\n"; print convert_week_to_date(2010, 24)."\\n";
Download this code: convert_week_to_date.pl
Hopefully it will help someone one day.
Trying timelapse
May 18th
Sunday Morning in San Francisco from Samuel Pasquier on Vimeo.
Music:
“U TERU S . Birth of Souls” by Loveshadow
http://ccmixter.org/files/Loveshadow/23570
Video: Samuel Pasquier
2700 images taken from from 9h to 12h
42th floor of the mandarin oriental hotel
Closing the gap
Nov 22nd
I got to find about Eric Sink’s blog today… Better late than never
He is writing about a lot of interesting topics related to software engineering.
My favorite column from his blog:
New photoblog
Jun 10th
I finally decided to start my own photoblog to show what I believe are my ‘best shots’. You can access it using the menu at the top of this page, or by clicking on the following URL.
Quotes of the day
Apr 24th



