15 May
2008

I was using the zope server to generate barcode images using PIL, and
found one of my PIL methods was throwing a python error when used in Zope (from an external method), but not otherwise.

The error is a follows:


Error Type: AttributeError
Error Value: 'module' object has no attribute '_save'

The reason for this is that JpegImagePlugin.py
called a module called ImageFile from the PIL library, but Zope also defined a (different) module called ImageFile. Argh!!

Fixing this (for me) involved going into JpegImagePlugin.py
and replacing the line "import ImageFile"
with "from PIL import ImageFile".

A quick fix that took a very long time to track down. This solution is provided here to help the next hapless soul who tries Googling for this error like I did. Now there is at least one solution out here, instead of just queries.

You can see the fixed method in action at

http://www.dudek.org/Barcodes/barcode_ean13.jpg

or use
http://www.dudek.org/Barcodes/barcode_ean13.jpg?s=0123456789012
to generate you own code, where the number after the s needs to be 12 digits for an EAN-13 barcode (the 13th checksum digit is computed automatically if not provided).



Posted by dudek at May 15 21:56 | Leave a comment | permalink link to this entry |
13 May
2008

The 2008 IEEE International Conference on Robotics and Automation will be taking place in Pasadena May 19-23, with open technical talks on the 21, 22 and 23rd. We are presenting a paper on Friday at 2:40pm entitled "A Natural Gesture Interface for Operating Robotic Systems" written by my students Anqi Xu, Junaed Sattar and myself.

Early in the week there are various meeting and workshops. With any luck, I'll be able to visit a friend living in Los Angeles.

Fridays's plenary talk is called Brain-controlled Robots by Dr. Mitsuo Kawato, Director of ATR Computational Neuroscience Laboratories and should be interesting. There has been a lot of work on direct human-machine neural interfaces in the last 5 or 10 years, and ATR is a leader for one exciting class of such research. I'll be sure to at least twitter about it.


Posted by dudek at May 13 21:24 | Leave a comment | permalink link to this entry |
12 May
2008

One of our intrepid people took a sensor node to the beach to collect some data underwater. Unfortunately, there was a leak in the housing. The salt water flooded the computer enclosure. If the computer is off in a case like this, then a quick wash in fresh water and a couple of weeks of drying out is likely to render things good again.

Unfortunately, in this case the person involved had the computer turned on, and left it as it was for over a week. Not a good idea, since salt water is corrosive to electronics. Worse yet, the computer was powered up at the time. Here is is when I got my hands on it.


Happily, some of the parts could be salvaged after being washed, but a lot of the gear was a write-off. That's an inevitable consequence of doing underwater research, but it still hurts.

Here at the tips to dealing with a computer if it gets liquid, especially salt water (or coffee) spilled into it:

- Remove power immediately! Tear off power wires if necessary.

- Pour out as much of the contaminant as possible, quickly.

- Open it up as much as possible, every connector, nook and cranny.

- Wash it thoroughly with clean non-salty water. Rinse well, but don't rub.
Spend up to 10 or 20 minutes rinsing, but not much more to avoid dissolving glues or paper wrappings.

- Resist the desire to use alcohol or other drying agents as they are solvents and can ruin connectors, plastic sleeves and other little organic bits.

- Let it dry afterwards for a LONG time. There might be water under a chip.
It usually needs 2 weeks or more. A dry place helps, but be careful of places
that are too warm, or which have warmth, but also condensation.

We have had some surprising recoveries.


Posted by dudek at May 12 18:52 | Read (1) or Leave a comment | permalink link to this entry |

Last week I gave an invited lecture at the Annual Huggins Science Seminar at Acadia University. My talk dealt with the current state of robotics for outdoor environments.

The Huggins Science Seminar is an event named after Charles Huggins, the Nobel prize winner who attended Acadia for his undergraduate degree. The seminar series brings in senior high school students from around the province to hear lectures on Science. The lectures are, by and large, delivered by scientists who are nominated, selected, and flow in for the lectures. I was impressed by the calibre of the students and the coordination of the whole event, and had a chance to meet Spencer Barrett over breakfast, a Canada Research Chair in Botany from the University of Toronto, who also gave a talk there.

Acadia is in Wolfville, Nova Scotia. It's a small town and very picturesque, being located right on the Bay of Fundy. I wish my trip had allowed more time to do some sight seeing or to contact local friends.


Wolfville NS in the evening
Wolfville NS in the evening




Posted by dudek at May 12 09:22 | Leave a comment | permalink link to this entry |


Science Blogs - Blog Top Sites Science Blogs - Blog Catalog Blog Directory ss_blog_claim=ba28543708770cfd47604f5a28eb15b0