Posts

I'm Liking Mercurial

Image
I've been a longtime user of subversion for source control, and with Google's Project Hosting , that was the only choice. For a new project I'm working on I decided to try mercurial , instead. I think I'll stick with mercurial from now on: It's very close to subversion for most commands. It's incredibly fast. I can perform commits without an internet connection. It uses only one hidden folder for the whole tree. The only issue I've found so far is that the default Mercurial version for Ubuntu is before version 1.3 which allows you to store the password in a ~/.hgrc file. So, for now, I need to type in the password every time I do a push.

First Wave Robot

I took advantage of the fact that some wave developers were passing by our office and wrote a wave robot during a jam session. This robot monitors what is being typed and makes it easy to convert to different units. If you type "100kg (? lbs)" it will replace the ? with the correct value of 220 after you type the closing parenthesis, for example. I went a bit further and tried to be sensible with the significant figures. I didn't want it say '220.462262 lbs. So I examine the number of significant figures from the original number and try to duplicate it in the result. If you say "100 kg" it'll put "220 lbs". If instead you enter "100.0 kg" it'll put "220.5 lbs". Test revealed, however, that this wasn't good enough. If I put in "1 inch" in would convert this to "3cm", a 18% error. I put in an extra rule to increase the precision if the error was greater than 10%, which got these corner case...

Grub Could be A lot Simpler

Today I reinstalled Windows XP on my son's machine (my old machine). Ubuntu works perfectly with sound, video, and internet, but Windows... In Windows, I had no sound, no internet, and problems with the video card. Then when I tried to update, it said I can't use and English version of XP in Brazil! So I reinstalled with a Brazilian version of XP which blew away the boot sector (and thus the menu for selecting Ubuntu is gone). There are some good instructions here on how to restore grub, but jeez, such a simple program has to be so much work: sudo␣grub find␣/boot/grub/stage1 root␣(hd0,1) setup␣(hd0) Worse, it's even picky about spaces, you need to put a space (shown above as '␣') or you'll get an error message, you've got to be kidding me. If you forget the sudo, it gives you useless error message instead of mentioning that running as root is probably a good idea. I suggest they fix grub with tab completion so that I can just press " r " and...

Speakers Housing Part II

Image
Today's a holiday ( Tiradentes Day ) , so I finished off my speakers! This time I even tested them (last time I was so exhausted that I didn't even want to know if they worked or not). I ended up putting the screw covers on with contact cement - I don't know how long they stay up there. One project completed!

Speaker Housing

Image
This weekend I finished my speaker housing so I can have some sound on the veranda. It was a lot more work that I had hoped, I'm still sore. My reciprocating saw didn't survive the experience either. Unfortunately, I still have some work to do: put some edge strip laminate in the missing parts plane down this piece so that it's flush. Hide the screws. I bought some covers, but I realize now they won't work, all my screws are flush and they must be protruding.

How I'd Improve the Nintendo Wii

Image
Nintendo is coming out with the Wii MotionPlus , which improves the already revolutionary controller. It started me thinking on what else Nintendo could do. For instance, one or two cameras could be mounted on the TV pointing to the players. This has been done before and makes for some fun games. It also could be used to improve the playability of the games. Imagine a sword fight where you can physically jump out of the way of the sword! Today if I want to play a quick game on the Wii Fit, I have to: Drag out the Wii Fit platform and turn it on. Find the Wii Fit DVD. Eject the game that's already in the console, hope that my son saved his game and put the DVD somewhere. Put the Wii Fit DVD in the console and restart the console. Move and click the cursor to select the Wii Fit game. Go through several screens and warnings. Select which player I am. Start playing, whew! It could be a lot easier. Putting in a DVD to select a game seems sooo 2001. I can't remebe...

Wake on lan works

I previously tried to get wake-on-lan to work and had no luck. I was never sure if my code was wrong, or if a firewall was filtering the command of if my motherboard just doesn't support it (probably the latter). Today I got a new computer and the old wake-on-lan.py worked! So here's the program that works for me. #!/usr/bin/env python import socket import struct import sys def wake_on_lan(macaddress): """ Switches on remote computers using WOL. """ # Check macaddress format and try to compensate. if len(macaddress) == 12: pass elif len(macaddress) == 12 + 5: sep = macaddress[2] macaddress = macaddress.replace(sep, '') else: raise ValueError('Incorrect MAC address format') # Pad the synchronization stream. data = ''.join(['FFFFFFFFFFFF', macaddress * 20]) send_data = '' # Split up the hex values and pack. for i in range(0, len(data), 2): send_data = ''.join([send_data, ...