Showing posts from September, 2005

Python: Guido van Robot

One of my first jobs was when I was contracted by the College I went to write a Pascal program based on Karel the Robot, a method of teaching programming by programming a "robot". It was a pretty cool summer project that involved me writing a recursive descent parser in Turbo Pascal, complete with an editor, runtime debugger and graphical output.
So the Guido van Robot project makes me smile, especially since it is written in Python and wxPython and the robot language is in the Python syntax style. It's a cool way for kids to start learning about programming.

Politics: P2P filesharing is a gateway to shoplifting?

I'm embarrassed as a Canadian to see this in the Globe and Mail.
The music industry did a poll that they suggest that those who download music online are also like to cheat at schools and to shoplift. Not only does music file-swapping harm artists, but it also points to an erosion of respect for intellecutal property that threatens Canada's economy and values at the core of our society.Even if that were true, then the correct solution would be to force the recording industry to lower their prices for online music and to remove DRM restrictions since it is mostly for these reasons that people are using P2P to get their music.
In fact, perhaps the best solution to this "problem" is to tax everyone, give that money to artists (tracked by popularity) instead of having individuals pay for the music. Perhaps you could base it on the amount of sales the recording industry has made averaged over the last 20 years and just keep giving the artists that amount of money (indexed …

100$ Laptop

I kept thinking about the $100 laptop last night. I think if they do a software radio like GNU radio that would be very interesting. You could install an upgradable (via software upload) wireless system so that it can work in any country. Also you could design peer-to-peer network so that the computer classroom to hook up easily together. The professor could have a larger computer and could download the material for the week to each of the students.
I find myself sitting in front of a computer all day, every day - and loving it. Of course, most of that love is from the Internet. But I much rather see kids around the world reading and programming than sitting around doing nothing. And I know that if you get used to reading from these devices, people will continue to read and learn as they get older. You see too many kids, even in rich countries like Canada, that live in houses with no books in them. When the start going to school, they see a book and don't even know what …

Politics: FOX news agains OpenDocuments

There's an article on FOX that's just full of lies and deceptions. Basically, the State of Massachusetts decided that their documents should last a long time and should use open formats, and that Microsoft's format isn't open. Here are the lies and decpetions I found:

The policy promises to burden taxpayers with new costs and to disrupt how state agencies interact with citizens, businesses and organizations.
He doesn't explain how free, open source software would cost more. OpenOffice can read Word documents just fine.

Worse, the policy represents an attack on market-based competition, which in turn will hurt innovation. The state has a disaster in the making.
There is no vendor lockout with the decisision, if Microsoft starts supporting open document standards the state can buy M$ or any other software.

Agencies can turn to the marketplace?often to small state-based systems integrators?and receive bids for the best solutions at the best price to meet specific needs.…

Kids: What they learn

I have a four year old son. I try to teach him English but it's slow going (he speaks Brazilian Portuguese). What's really weird, is that I'll speak an English word with an English accent and he'll repeat the word with a Portuguese accent. For example "build" comes back as "bilge" or "mouse" comes back as "mousey" or "step" comes back as "steppa". It's like he's cut up the phonemes and put in Portuguesed versions of the English phonemes, adding letters if necessary - very weird.

I noticed another oddity today. He was playing an SNES game where the protagonist has a variety of weapons and shields (or pogo stick, helicopter, etc.). The character can use one type of weapon and one type of shield at a time. You select the action button to go to the screen, but instead of using the "cursor" keys they decided to use the X/Y and A/B buttons for up/down weapon, and up/down shield, respectively. …

Linux: USD$100.00 Laptop

I think Negroponte's $100.00 computer will help change the world.
The idea is to get a computer in every kid's hands, by basically, making it as cheap as possible.
He's also sensitive to the needs of third world countries that don't have a consistent supply of electricity and may need to run on battery power (or crank power) for long periods. The
specifications include:500 MHz which is slow by todays standards but should be fine for most purposes.1 GB of non volatile RAM (pretty small if that's the hard disk too)WiFi, since one WiFi access point is probably cheaper to setup than a bunch of wires and hubs. Also it may be possible to set it up so that if there's no Internet access, at least the kids can hook up to each other in a lan.Cell phone since WiFi may not be available, plus this could also be the families phone.1 megapixel (or about 1000x1000 resolution) which is pretty nice.
Will run on a version of Linux
I suppose the keys to this device is a cheap and low-…

Python: xml2ddl, new version released

I released version 0.3.1 of Xml to DDL One of my open source projects. Here's what it's about:
XMLtoDDL is a set of python programs to convert an XML representation of a schema into a database and vice versa. It can also examine the differences between two databases and emit the ALTER DDL statements required to bring the database up-to-date. This makes it ideal for storing the database schema into a version control system.With XMLtoDDL you can download and create the databases for PostgreSQL, MySQL, Oracle, and Firebird. XMLtoDDL strives to be database independant so that the same XML can be used for a variety of databases. This is great for quickly testing out a variety of databases for performance, for example.The XML is fairly rich and permits adding more documentation about the database than the database stores itself. For example, you may want to document that a column is deprate or what the columns previous name was.Although you can both upload and download the metadata,…

22 years ago Stanislav Petrov saved the world

22 years ago, Stanislav Petrovsaved the world.
"Any military commander who is honest with himself, or with those he is speaking to, will admit that he has made mistakes in the application of military power. He's killed people unnecessarily?his own troops or other troops, through mistakes, through errors of judgment. A hundred, or a thousand, or ten thousand, maybe even a hundred thousand. But he hasn't destroyed nations.

And the conventional wisdom is: don't make the same mistake twice. Learn from your mistakes. And we all do. Maybe we make the mistake three times, but hopefully not four or five.

They'll be no learning period with nuclear weapons. Make one mistake and you're going to destroy nations."
Robert Strange McNamara

Via Metafilter.

EcoSport car

I'm liking the new car. I found a powerpoint presentation that talked a little more about FlexFuel cars. With ethanol vs. gasohol you get 10% more power, 7% better torque but it uses almost 30% more volume of ethanol. Without a catalytic converter ethanol produces 50% less CO and HC and 20% less NOx. With a catalytic converter the differences are miniscule. Here's another article at treehugger.
I found the car to have very good low end torque, driving in the city is a pleasure. The throw of the stick shift is smooth and the gear ratios are just right. The brakes are unfortunately quite mushy and is my biggest complaint with the car. Also, the engine makes quite a bit of noise when it's laboring. On the other hand, it's super silent when idling.
The fatter tires and higher wheelbase made driving on our dirt road a pleasure. The good low end torque also helps get through the mud we had this weekend.
The car is quite roomy inside but the trunk is very small. Overall…

Brazil: Brazil has become a trailblazer in computer use

From KRT Wire they talk a little about Brazil and the computer field. I have done some work for the UFMG which is a federal university and can attest that the government is embracing open source software. It has become a political thing, where politicians are proud to show that they use OpenOffice or are sponsoring a project that's based on open source software. Also, I've read that there are probably more Brazilians using Orkut than from any other single country. Broadband is available in most larger cities and works reasonably well. I don't the US using Brazil for outsourcing like they use India, because of the language problem and because there's no time-zone advantage.
For one company I was looking at to work for, the president admitted that he doesn't like the employees learning too much, because they'll just learn and then leave. It goes without saying that he was in financial troubles as well. What he had said was so contrary to how I think that I w…

Linux: More notes to self

For some reason my USB iRiver device has become very slow when connected to Ubuntu and using the Nautilus manager. I tried my USB key drive too and it was embarasingly slow. It takes maybe 20 seconds for a window to pop-up, then if I double click on a folder you can wait for 15 seconds or more. I think the problem is with the Nautilus file manager. When I did my copying through the console (cd, cp, etc.) it was nice and fast. This may be the solution:
Jeff Waugh11-11-2004, 04:15 AMOn Thu, 2004-11-11 at 08:51 +0100, Soren Hauberg wrote:
> I recently upgraded to Hoary and all is better than ever, except...
> Nautilus has become very slow. By this I mean that that opening a new
> window takes more than 10 seconds. Before the upgrade this took about a
> second (I'm on a slow machine so nothings instant).
> Since Gnome usually becomes faster with upgrades I would assume that I
> have done something wrong.

When you upgraded, libgamin replaced libfam, but the gamin…

Linux: Bash Notes

Just some notes to myself, I can never remember what to put where:
~/.profile - this is a useful place to define and export environment variables and bash functions that will be used by bash and the programs invoked by bash. It is a good place to redefine PATH if needed. We recommend adding a ":." to the end of PATH to also search the current working directory (contrary to DOS, the local directory is not searched by default). Also to avoid delays you should either unsetMAILCHECK or define MAILPATH to point to your existing mail inbox.~/.bashrc is executed each time an interactive bash shell is launched. It serves to define elements that are not inherited through the environment, such as aliases.~/.bashrc is not called automatically for login shells. You can source it from .profile.~/.inputrc controls how programs using the readline library (including bash) behave. Consider putting this in the file.
# Ignore case while completing
set completion-ignore-case on
# Make Bash 8b…

Linux: Cool device

I find this device very compeling. What I like:
it's Linux based720x480 pixel screendual 200mhz CPU's with 64meg of RAMTakes SD cardsapparently runs 6 hours on 2 AA batteriesUSB 2.0Audio and TV out ports
costs £124.99 (about USD$225.00)
It even comes bundled with Mame, Quake and some other games. The only thing I think would be nice is a IR port so I could program it to be a universal remote control as well.
It's designed to be used mostly for playing games or for looking at a photo album, but since it's Linux, the sky's the limit.
Update, maybe not:
Looks like they have DRM support which means it must have parts which are closed source. Why do they do this? Probably the media moguls offered them a carrot and a stick (he's $100,000.00 to put in DRM, or our lawyers if you don't).
Via boing-boing

Ethanol as fuel

My new car will be flex fuel car. This means it can run on gasoline (petrol) or on alcohol (i.e. ethanol). Looking further on the two fuels I've discovered at wikipedia that:
Ethanol has roughly two thirds the energy of gasoline on a volumetric basis. It, however, is a more efficient fuel than gasoline for two reasons. First, ethanol has a much lower adiabatic flame temperature, meaning it burns cooler. Less heat, therefore, needs to be rejected through the radiator and wasted.
Second, ethanol has a much higher octane rating than gasoline (115). This allows engines running on ethanol to use a higher compression ratio and/or forced induction, both of which improve fuel economy.
Automobiles optimized to run on ethanol can travel further on a gallon of fuel than equivalent cars setup for gasoline.There has long been widespread acknowledgement that ethanol is a cleaner-burning fuel than gasoline. Ethanol has far fewer standard regulated pollutants such as carbon monoxide and hydrocarbo…

Politics: Bush, can I go pee, Condi?

Bush asks Condi Rice for for permission to go to the bathroom.

Links: Reuters, Snopes, via BoingBoing.

Joke: Katrina Joke

Q: What's George Bush's position on Roe v. Wade?
A: He really doesn't care how people get out of New Orleans.
via BoingBoing.

Web: CSS Table Gallery

I've been looking for something like this. It's a CSS Table Gallery of user submitted table styles. The only special class added is "odd" for the odd rows.
Via link.

Buying a car

Well it looks like we're going to buy a new car. It's the Ford EcoSport small SUV. It has the Zetec -Rocam 1.6 Litre Flex engine. Flex because it can take Alcohol or Gasoline (or both). Nearly all new cars sold in Brazil now offer the flex fuel option. From what I've read, the only real difference for these types of cars are some extra sturdy hoses and gaskets because alcohol is more corosive. Also, when you fill the tank with alcohol you get 20% more power!

In theory I don't like SUVs because they use more gas, but this one is quite efficient, since it isn't a real off road vehicle. We need a higher wheel base since we go to the farm nearly every weekend and the dirt road can get quite bad in the rainy seasons. The version we are getting doesn't have the 4x4 option (it's too expensive) but the beefier tires should help us out in the mud.
The other car I might have liked is the Honda Fit (aka Honda Jazz). This car has won two years in a row as "Bes…

Web: Six dumbest Ideas in Computer Security

Very interesting article about computer security. Here are the six dumb ideas:
Default PermitEnumerating BadnessPenetrate and PatchHacking is coolEducating UsersAction is Better Than Inaction
Read the article to understand what it all means. Basically what I got out of it is that white-listing should work better than black-listing.

While you're at it, read the Feynman article as well.


I released a FLOSS program called wxOptParse which allows you to run a Python program that uses optparse, which is a standard Python module that handles command line parameters with a GUI dialog instead of the command line.
Something like:
usage: [options]

-h, --help show this help message and exit
Enter a filename
-p PATH, --path=PATH Enter a path
-n NUMBER, --count=NUMBER
Enter a number
-m FLOAT, --float=FLOAT
Enter a floating point number
-b, --bool Switch to true
--nbool Switch to false
--choice=CHOICE Choice

One day I realized that I could do this with Python fairly easily. In fact the initial program just took a few hours to get working. There was a bunch of details that made it take a bit longer to finally release. The optparse module is great and makes a complicated set of parameters easy to code. Now …

Linux: DTP with Scribus

I just found another very interesting open source Linux program called Scribus. It's a desktop publishing program (DTP) good for designing brochures, panflets, books and so on. It's for serious publishing needs and it's all open source.
The part that I really liked is that the scripting language is Python.

Here's their blurb:
Scribus brings award-winning professional DTP to Linux and *nix desktops with a combination of "press-ready" output and new approaches to page layout.
Underneath the modern and user friendly interface, Scribus supports professional publishing features, such as CMYK color, separations, ICC color management and versatile PDF creation. Scribus was the first DTP application on the planet to directly support PDF/X-3 output, a rigorous ISO standard. Scribus did so by almost a year. Other features include PDF Import, EPS import/export, Unicode text including right to left scripts such as Arabic and Hebrew.

Politics: Reporters have had enough

There are two kinds of broadcasters, the ones that have gone stark, raving mad on air and the ones who will. Slate has an article talking about this and there's a video clip of a reporter going "stark, raving mad", although I saw the video and felt he (the reporter) was fairly cool.
But what I do like, is that I found the reporting very refreshing. Usually, guests can say whatever BS they want and the reported will nod and change the subject, so rarely do you see anyone actually confronting the guest. Well, that's not 100% true, if it's the FOX network and the person is a nobody, then they will confront them and tell them to shut up. But if you are a senator or someone slightly important, it's the nod and change of subject.
That's unfortunate, the reporters live and breath the news and can tell when a guest is spinning or lying, it would be so helpful if they called them on that when it happens. You might say that the guest would never come back if they…

Tech: Roll out screen

I'm sure you've seen this by now and here's my 2 cents.

This prototype leaves some things to be desired:
It's less dots per inch than a computer screen (about 82 dpi)It's black on gray, would have higher contrast if it were black on white.It's still expensive.It would be cooler if when rolled up it showed different information than when rolled out.
However, this really is interesting technology because:
It rolls up to be very compact. You could imagine it rolling out a lot more in the future.The technology doesn't require power to keep the display. This means that one AAA battery could work for weeks even if you used it every day (probably).They claim that it works well in daylight.The display has the possibility of being cheap to manufacture in the future.This is a key technology that is a requirement for the $100.00 laptop computer MIT and Nicholas Negroponte are pursuing. If you look at cell phones today they are quite powerful, the battery lasts a reaso…

Fun: puzzle game

I found a fun little game called Professor Fizzwizzle it's your classic block pushing blocks/puzzle type game, but very well done. I liked the fact that they have a linux version and it has a section that appears especially suited for kids. I played the game with Victor on my lap and he did quite well. They do a good job of teasing you to get you to buy the full version and hint that the full version will give you hours of fun. I still find $20,00 USD a little rich but almost right.

Update: I went ahead and bought it anyway. I can see why they charge 20,00 dollars, they called me long distance and sent 3 e-mails, it's all the credit card validation - why don't they use paypal? It's the perfect game for me and Victor, fun for me, fun for him no reading required, no punishment for getting it wrong. If we get too fustrated you can ask for it to show the solution. And it works in Linux as well, so I bought the Linux version.

Politics: NYT Can't-Do Government

The New York Times has a scathing Op-Ed on the government's handling of Katrina.
Before 9/11 the Federal Emergency Management Agency listed the three most likely catastrophic disasters facing America: a terrorist attack on New York, a major earthquake in San Francisco and a hurricane strike on New Orleans. "The New Orleans hurricane scenario," The Houston Chronicle wrote in December 2001, "may be the deadliest of all." It described a potential catastrophe very much like the one now happening.
First question: Why have aid and security taken so long to arrive? Katrina hit five days ago - and it was already clear by last Friday that Katrina could do immense damage along the Gulf Coast. Yet the response you'd expect from an advanced country never happened. Thousands of Americans are dead or dying, not because they refused to evacuate, but because they were too poor or too sick to get out without help - and help wasn't provided. Many have yet to receive a…

Web: Reader2

I'm a big user of which allows me to keep track of web sites I'm interested in or that I should blog about or that I'd like to keep as a reference. The neat thing about is that as I and hundreds of others use this for selfish ends, we gather data that is useful for us as a comunity. I can see what is popular at to find new sites that may be of interest to me.
Well now there's a new site, Reader2, that does the same thing for books. It allows you to keep track of your favorite books or books you want to read on their site. And as more people start to use this site (for selfish purposes) you can browse what other people are reading for ideas of other books to read.

Politics: More Katrina

Look's like I'm procrastinating today...
What Jon Chait said about Iraq last week is perhaps even truer about New Orleans. The hallmarks of the Bush/Rove governing philosophy ? partisan discipline, industry giveaways, and relentless lying ? work pretty well as long as you can disguise the results of your policies. When you can't, it suddenly becomes obvious even to your supporters that the emperor has no clothes. It's taken two years for a lot of people to realize that about Iraq. It's taken less than a week to realize it about New Orleans. link
"But perhaps the greatest disappointment stands at the breached 17th Street levee. Touring this critical site yesterday with the President, I saw what I believed to be a real and significant effort to get a handle on a major cause of this catastrophe. Flying over this critical spot again this morning, less than 24 hours later, it became apparent that yesterday we witnessed a hastily prepared stage set for a Presidential …

Politics: Don't buy Blu-ray DVD

I agree with Phillip Torrone that the Blu-ray promises to be lousy deal for consumers. It's a new DVD format that promises to be more difficult to copy and compliant players are supposed to be able to be disabled remotely! I think that DVD are already bad enough with it's regional encoding idiocy. I don't know if HD-DVD is going to be any better, but I know that consumers are going to be smarter. I think that consumers are going to go for the more open format even if they have less titles available (because Blu-ray is backed by Sony, MGM, Disney, and FOX). They'll just steal the movies they can't get.

Politics: Katrina

Where is the Red Cross? From the Red Cross site:
Access to New Orleans is controlled by the National Guard and local authorities and while we are in constant contact with them, we simply cannot enter New Orleans against their orders.The state Homeland Security Department had requested--and continues to request--that the American Red Cross not come back into New Orleans following the hurricane. Our presence would keep people from evacuating and encourage others to come into the city. I think the Bush administration really screwed up here. Took him two days to finally cut short off his 5 week vacation (during a time of war!) and was caught playing guitar. When he finally did speak it was awful. This reminds me of when the WTC towers were hit and the president continued reading "My Pet Goat" to schoolchildren. He's really clueless and needs his advisors to do anything, but they were also on vacation.
Perhaps the american people will start voting for presidents that ar…

Linux: Cheaper to run than Windows

If I've read this article correctly, and IBM sponsored study shows that the total cost of ownership (TCO) is 40% less for Linux that it is for Windows. For a while Microsoft has been trying to show that Linux is cheaper because it requires more hand holding etc. for people to setup. I can't see how Microsoft could be cheaper because:
Microsoft Windows XP costs about USD $300,00. Linux usually costs nothing.When you first install Windows you need to spend a great deal of time downloading updates. And hope and pray that you don't get a virus or worm before that time.You need to buy and install anti virus software (about $45,00) .
You need to buy and install Microsoft Office (about $400,00).
A great deal of time is now spent on the IS department protecting against viruses (and worms etc) and fixing machines that have been attacked by viruses.Windows users can easily do behavior that helps to spread viruses or that makes their computer more vulnerable.
With Linux all this money…