Everyone knew the Earth is round

November 29th, 2008

Pick up any decent history book that covers the discovery of America by Columbus and it will clearly tell you that all European navigators of the time were well aware that the Earth was round. Columbus thought he could reach Asia by sailing west when others dared not try, not because he was the only one that knew the Earth was round, but because he miscalculated the size of the Earth as much smaller than it actually was. He thought that Asia would be only 4500 miles to the west instead of the actual distance of around 12,000 miles. The only thing that saved Columbus and his crew from death at sea was that they ran into an unknown continent, a fact which even after three more voyages, Columbus never admitted. Which is why the continent was named after, Amerigo Vespucci and not Columbus.

I am frequently annoyed by the fact that we continually teach young children that Columbus proved that the world is round. I can’t understand why we do this and for the most part never correct it so that many adults also think that Columbus proved the Earth was round.

So I was not happy when my seven year old son came home from his expensive private school with the script to a play he was doing about Columbus and one of the first lines of the play was “Well, everybody knows the Earth is flat. What if we fall off?”. At my wife’s request, I refrained from making a big deal out of this and simply made sure my son knew better.

Our society seems to have little motivation to teach our children that Columbus was a bad navigator who discovered America by dumb luck, and not some scientific visionary who was alone in his knowledge of the Earth true shape. However, there has in recent years been a growing movement, mostly among those who would lean to the left politically, to paint Columbus as a man guilty of crimes against humanity for his treatment of the native Americans. Although the play my son’s class put on portrayed Columbus as a hero, the influence of this line of thinking is present in the foreboding final two lines of the play which take place after Columbus’s crew and the Taino natives agreed to feast together.

Sailor 1: I sure hope this works out all right.
Taino 1: I sure hope this works out all right.

All that being said, I did enjoy seeing my son in the play. Here is a video of it, my son played Sailor #1. He is the only one who memorized his lines and isn’t reading them from a paper.

OSGi article

June 24th, 2008

I wrote an article on OSGi for M2M Magazine awhile back that I now see has been published online. If you’re interested Check it out here.

Sending UDP packets in Linux

June 24th, 2008

In my work, I often have to work with UDP and at one time I knew of a linux utility to send UDP packets from the command line, which is incredibly useful for debugging.  However, I forgot what the utility was and no one I asked seemed to know what it was. Surprisingly I could not find it with a web search either. Recently I finally rediscovered it when I read a the following blog post. How could I have possibly forgotten the incredibly intuitive name “nc” which I now know is short for netcat. Slightly more intuitive, I suppose. I am convinced that a design requirement for the unix OS was that managers who happened to look over your shoulder would have no idea what you were doing.

When a MySQL trigger didn’t really

March 25th, 2008

I just when through a convoluted debugging session I felt was worth sharing. I have a Python application which inserts data into a MySQL database table. There are triggers on this table that then insert data into another table in a different database.

Whenever I tested the Python code, I could see that the data was inserted successfully into the first database, but the triggers seemed to fail to insert data into the second database. However, I could tell that the triggers were firing because one of the columns in the second database lacked a default value and generated a warning because I was not inserting any data in that column.

I turned on query logging in order to get the exact query that the Python code was executing. I then copied this query and ran it from the command line. Now everything worked. What the hell? It’s the same query and I am logging into the DB with the same credentials, why should anything be different.

After some thought, it occurred to me that while my command line session was set up to auto-commit, Python probably does not work that way and the code may not be doing a commit. However, if that was the case why was the data from the initial query not getting rolled back, but only the data inserted into the second database via trigger?

As it turns out, this was the case. The Python code was missing a commit. The reason that the insert persisted on the first database is because it was using the MySQL default type of MyISAM which is non-transactional while the second database where the triggers inserted data was using InnoDB which is transactional. So when the rollback was attempted, only the triggers could be rolled back.

The only question that remained is why I didn’t see any warning message. I have run into this exact problem before in a Java application, but there was a clear warning message indicating that a transaction had been only partially rolled back.

Flushing the DNS cache in Leopard

January 24th, 2008

This morning my macbook suddenly decided it didn’t want me to check my gmail, I quickly determined it was a local DNS problem and flushing the cache was in order, but I had never done this in OS-X before. After a little searching and failed attempts I finally found the correct command for Leopard:

    dscacheutil -flushcache

And now I'm reading my gmail again.

My Son’s Karate Instructor

January 22nd, 2008

My son has been taking Karate for about a year now at Excel Acadamy Tae Kwon Do. I have always been extremely impresses with his instructor, Miguel Valdez. His skill and teaching ability is exceptional by any measure, but all the more so if you know that he is extremely visually impaired, well beyond the point of legal blindness. He was recently asked to give a motivational seminar to disabled children and got a little news coverage. Check out this video:

A real zip utility for Mac

December 30th, 2007

Since I have switched to Mac, I am mostly very happy with the change. However, there are a few annoying limitations that I run into and am continually amazed at how Mac people seem to ignore them.  Foremost among these is the inability to browse the contents of zip and jar archives and extract single files from them. On windows you can do this natively as well as with every utility I have tried, but until now I was unable to find one for the Mac. Now I have, Betterzip has absolutely made my life better.

Birth Certificate WTF

December 15th, 2007

My wife is planning a ski trip to Whistler which is in Canada which under the new rules means she needs a passport. In order to get a passport she needs her birth certificate, which her mom lost years ago. So she went online to try to order it. She was born in Louisiana which requires that you use a company called VitalChek if you want to order online. So she went to their web form and started filling it out. She gets to the part where it asks for you parent’s names and runs into a problem. Her father is not listed on her birth certificate, certainly not the norm, but far from unheard of. Well, it is a required field on the web form, and there is no option for “not listed” or N/A or anything like that and they do check your submission against the records so you can’t enter incorrect information. So she calls on the phone and is told that this is a known issue and she will have to travel to LA and order it in person and it will take 4-6 weeks. Further inquiries reveal that there is an option to do it by mail and it will only take 3-4 months. Neither of these will allow her to get her passport in time for her trip. Luckily, her friend Jess apparently has unknown skills as a hacker and figures out the solution to get the online order to go through

.birthcert.png

The order goes through and we got the certificate in the mail a few days later. Why did this work? My guess is that the original paper document actually had “No Father Listed” typed in the space for the father’s name and they simply scanned it into their database and parsed it as a space delimited name. Undoubtedly there are a large number of people who are shown in the database as children of a Mr. N.F. Listed.

More with GeoRSS and Yahoo! Pipes

December 2nd, 2007

Since my initial experiments with pipes, the Pipes manager, Jonathan Trevor was good enough to leave me a comment pointing out that they were about to release a feature that would help with the username/password problem. The feature he was talking about was private field support and has since been released. It is now possible to publish pipes that contain sensitive information without making that information public. Also since then at Ublip, we have released an online demo which provides a good source of data that I can publish without any privacy concerns.

First, I published a very simple pipe consuming the demo feed and publishing the results to a map. As you can see, the username and password are visible as part of the URL in this pipe.

demopipe.png

Next, I used the new private field support to hide the username and password. I could have simply hidden the entire URL in a private string and used the URL builder to convert it into an URL. But to make it a little easier to modify, I moved the username and password into separate fields and a string replace module to insert them into the URL. I imaging that there is a more elegant way to do this, but I haven’t found one yet. Here is the resulting pipe:

privatefields.png

The only thing missing is the ability to use https, which still does not seem to work. I am still not quite sure if it is supposed to be supported or not. Some forum posts discuss ways to work around it while others seem to indicate success using it.

Gmail Hiccup?

November 29th, 2007

Something bizarre just happened to me. I was checking my personal Gmail via web browser and noticed I had several MySpace related emails, friend requests, new message notifications, etc. This is interesting because I do not have a MySpace account. However, they did not seem to be spam or phishing, all the URLs seemed legit. Then I clicked on another one and gmail took several extra seconds to load, and instead of a dozen or so unread emails largely of this myspace variety, I only had 4 from usual sources. What the hell happened here? Was I actually seeing someone else’s email for a few seconds until Google fixed some sort of problem? I suspect that I will never know.