Archive for: 2008 2007 2006 2005 2004 2003
Videos of Montreal Python 2
Videos of Montreal Python 2 are finally ready. A big thank you to Pior for his hard work behind the camera and in the cutting room.
Getting sound to work on a Thinkpad R60e
At job, we have a huge stack of laptops. Those are mostly used for training but when we go out for consulting, we get to pick from the stack. Since we let student rip the OS to shreds, the stack is always freshly installed with a recent GNU/Linux distribution. There is lot of hardware diversity in the stack; last time I went for a Thinkpad R60e, and sound didn't work.
Since I'm out for a few weeks, no sound would be a major hit on my moral. Here is how I got the sound to work on Kubuntu Gutsy Gibbon (7.10). There might be an easier way to do it but the following worked.
First, a word on the problem. The sound card is an Intel ICH7.
$ lspci | grep Audio 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
With the default install, kmix will see all the channels but nothing will play. Some applications, like Amarok, will report that the device is busy, others like ogg123 will work perfectly fine with the progress bar and everything except that you will hear no sound.
Code examples from Montreal Python 2
I just uploaded the code examples from my presentation at Montréal Python #2 on PyQt and PyOpenGL. I fixed the lighting and the positioning of the model but otherwise, the package contains exactly what was on the screen. You can also download the multiple alignment viewer that I presented from my bioinformatics section. Enjoy!
Tail call elimination is good in C too
All recursive algorithms can be converted into an iterative version. They teach that in school. They teach it as something that should be done, and it used to be true. However, we a living in a wonderful time and old wisdoms sometimes cease to be true.
Some algorithms are much more elegant when written recursively; the recursive version is also easier to prove. On the other hand, the iterative version will avoid many stack manipulation operations. Theoretically, any tail recursive function can be converted into an iteration transparently by the compiler without performance penalty compared to the hand written iterative version. Theoretically.
When I wanted to prove that Common Lisp had really fast implementations, I did my best to use the iterative version of the Mandelbrot formula. Unfortunately, there was no way around it, the iterative version would always run a bit faster. "So be it," I said to myself in resignation.
On the ultimate encoding
You would think that anyone doing business in Québec would have been bitten often enough by string encoding problems that by now, they would have standardized their pipeline on UTF-8. You would be wrong.
Seen at Canadian Tire.
If you write code, you should know that encoding must be explicit. You can't dodge this question. I would understand if you didn't want to specify the encodings all over the place. That's why as soon as a string falls under your control, you should convert it to UTF-8 and use only that internally. Go and sin no more.
Second Montreal Python Meeting
The second Montréal Python user group meeting is on 2008-04-10. Two talks this time: one on scripting Asterisk with Python by Cyril Robert, the other on graphical programming by me. My shameless plug reads as follow:
Python is a great language for fast prototyping and iterative development. It has a broad standard library, a wide variety of add-on modules, and its clean C API fueled the creation of bindings for essentially all the popular C and C++ toolkits.
In this practical introduction, I will put the slides aside and hack a simple graphical application using PyQt and PyOpenGL. I will try to do as much code as possible in 35 minutes then answer questions for another 10 minutes. If time allows, I might delve into the land of database access with SQLAlchemy, plug-in architecture with Setuptools, and unit testing with Doctest.
If you plan to show up, please help the organizers with the logistics by mentioning it on the wiki. Yes, there will be refreshments.
Doctorow on emails
Cory Doctorow, coeditor of the Boing Boing blog, recently wrote a really good essay on asynchronous communications.
With several million pieces of archived email -- and hundreds of non-spam messages arriving daily -- you'd think that I was kind of guy who'd carry an email-based mobile phone, a crackberry or Treo or iPhone or what-have-you. You'd think that I ran some kind of IM in the background, and picked up the phone a dozen times a day to chat.
You'd be wrong.
I'm a polyphasic sleeper; I'm writing this at 2AM as I wake up from my first evening sleep cycle. Asynchronous communication is the only thing that works for me. Perhaps it's the other way around: thanks to emails, I can enjoy taking naps all over the day.
Montreal police brutality protest
Right on time to object recent taser abuses, there was a police brutality protest this afternoon in Montréal. Unfortunately, after a few friendly snowballs, the police decided to charge.
After a hard day of running after protesters, policemen enjoyed pizza while the crowd was shivering.
Of course, Pior was right there with me testing his new camera.
Tripod
Here I am, in Québec City for a week, with not much to do but to eat poutine and to take pictures. I decided to get up early and to sneak up on some unattended roof in order to catch the sun rise. Well... It's quite fortunate that I discovered align_image_stack because it seems that I'll have to do without a tripod.
In case the glare prevented you from noticing, my crazy tripod lost its head.
Toward a better HDR pipeline
I hacked on my HDR pipeline. What I have now provides some automation but it's still really fragile and generally ugly. Nevertheless, I can now process a few gigabytes of pictures without clicking like crazy until I get RSI.
The first part was to automatically combine multiple exposure into HDR images. Discovering which pictures are multiple exposure of the same scene is theoretically quite easy. All the exif tags should be the same except for the exposure, which should be decreasing, and the time spawn of all the pictures should be no more than exposure time plus shutter lag. It gets complicated when you add the fact that my camera sometimes implements bracketing by decreasing ISO sensitivity instead of shortening the exposure time. That and PIL's miserable support for exif.
Quebec City
Back from Québec City where I visited my brother's brand new child, Charlie Gingras.
Thanks to the convenient location of the bus station, I had the occasion the take a few pictures of the Vieux-Québec.
This is my first serious panorama. I scanned the scene in program shift mode, compute the average exposure and shot with brackets in full manual mode. I aligned the images with autopano-sift, stitched with hugin, blended with enblend, tone mapped with qtpfsgui, and post processed with the Gimp. Be sure to have a look that the full size version before you decide if you like it or not.
I don't know how to get rid of the stitching lines in the sky; maybe I should just replace it with a gradient. I'm satisfied with the post processing but I have a lot of work to do on composition. Not too bad for a first attempt.
Lunar eclipse
Tonight, we had the last lunar eclipse until 2010. The sky was clear in Montréal but it was really cold. That was a great show. I was able to snap a few pictures but the low level translated in either noisy high ISO or in exposure so long that it captured motion blurred light trails. Ah well, that gives me two year to buy better equipment.
Video of Montreal Python 1
Thanks to Savoir-faire Linux, I was able to film the first Montréal Python User Group meeting. After lots of curses and struggle, I finally completed the editing and the encoding of the Montréal Python #1 video. Pior Bastida deserves a very special mention for finding the magic spell for mencoder.
First light
After many passionate conversations about photography with Pascal, I decided to upgrade my digital camera. I didn't feel quite ready, technically and financially, for the full power of DSLR but I definitely wanted to try my hands on the expressiveness of manual mode. I retired my Nikon L10 and I'm now the proud owner of a Sony H9.
It features a huge LCD and given it's zooming power, it's quite lite. It also has a bunch of manual controls. One thing that I really wanted was bracketing. I had tried to do HDR with my L10 but you need to fiddle with the control dial to change the exposure. There is no way you can to that without moving the camera and the slightest movement will ruin a HDR image; all my previous attempts where just a bunch of splotchy messes. Now, at last, I can do it. I mean, it just works, and the result is... Wow!
First Montréal Python user group meeting
Pythonistas of Montréal, rejoice! We now officially have a user group and our first meeting is to take place on 2008-02-07 at 18h30. It's going to be in Akoha's office: 3981 St. Laurent, suite 615.
There are two presentation slots; I think both are for 20 to 45 minutes. As I write this, both are still open. Who will break the ice?
Fract static gallery
Fract was recently mentioned in a review of cl-pdf. This reminded me that I had promised something: a static gallery of the most popular regions. Enjoy!
update: I just uploaded a bunch of fractal movies.
