Archive for the 'tech' Category

New Flat and the Internet Gap

We slept in the new flat for the first time last night. As usual, at least in Germany, it’s going to take a few weeks to get DSL connected. In our case, DSL gets connected on the 30th. This used to be the time when I’d fall into a deep depression due to withdrawal issues. However, this time is different.

For the time being I’m using the awesome new feature in Android 2.2 for sharing a mobile internet connection. Impressed with how easy it is to set up. It’s as easy as turning the feature on and setting the access point name and passphrase. Once that’s done up to 8 computers can connect as they would to any wireless access point.

Unfortunately, my mobile data plan only allows up to 200MB at 3G speed after which it gets throttled down to GPRS speeds. But it’s better than nothing and once DSL is finally connected we’ll be rewarded with 50Mbits down and 10Mbits up. That’s about 8-9 faster than what we had in San Diego for only a little more money.

Introducing GMemory v0.1

For the last few weeks I’ve been working on a small concentration game called GMemory. This was done as a part of the Openismus trainee program.

Update: See below.

For those not familiar with the game Concentration, or Memory as I grew up knowing it, the basic idea is that one has a number of matching card pairs turned face down. The player(s) then attempt(s) to match these pairs by turning over two cards. If the cards match those two cards remain face up. Otherwise, the cards are returned to the face down position. This is repeated until all cards are face up. Here’s a screencast of GMemory being played.

As you can hopefully see, GMemory is currently in a playable state and it actual quite enjoyable if you’re into these types of games. However, there is a lot more to do to reach what I’d consider a 1.0 release. Besides some code reworking and some known bugs, I’d like to see a score tracker, multi-player mode, card animation and selectable themes.

The game is written in C using GTK+, GObject, Clutter and Cairo. In the course of writing GMemory I ran into a few bugs in clutter-gtk. The first bug was that no events were being received when using the embedded clutter gtk widget. You can find the bug report here. The second major bug I ran into was that once I got a version combination that gave me events, I always received double the events that I expected. This is a known bug and I’ve got a work around in the code for that.

There are also a number of known bugs. As you may have noticed from the screencast, the last card of the last successful match does not get shown before the statistics dialog box pops up. It seems the dialog blocks the drawing even thought the function to draw the card is called before the call to show the dialog box. Another bug is that once the game is over the playing area does not resize when the window is resized. I’ll tackle this once I’ve reworked the code some.

You can find GMemory’s git repository at Gitorious and the tarball can be had here.

Unfortunately, right now I’m building against the master branches of clutter and clutter-gtk. Expect breakage.

Btw, I'm attending GUADEC right now.

Update: After trying this on Ubuntu Lucid, I experienced none of the event-related problems with clutter-gtk. This seems to be Fedora 13 specific. Thus, I’ve removed the workaround for the double event issue and changed the configure.ac file to rely on the clutter and clutter-gtk versions shipped with Ubuntu Lucid. The new tarball is here.

Openismus

As I mentioned in an earlier post, I’ll be moving back to Berlin at the end of May. Making the move has become even more exciting after learning that I’ve been chosen as one of the new trainees for Openismus. Since Murray has made the announcement, I thought I’d introduce myself to the community.

First of all, I should state that I’m American despite what the umlaut in my last name would suggest. My last name was Wilson before taking my wife’s last name just before our daughter, Vada, was born a couple years ago. I met my wife in Berlin and am very familiar with the city, having lived there from October ’99 until late 2005. I love Berlin and am excited to be moving back.

In a few weeks I’ll be graduating with a BS in Computer Engineering from San Diego State University. While in school I interned at a small company programming mostly in C++. I learned a lot from my work there but feel like I’ve got lots more to learn.

I’ve been a long time GNOME user after being converted from KDE at about the 2.4 release. Before starting school I’d occasionally submit bugs for Ubuntu and GNOME. I even attended GUADEC in Stuttgart where I met lots of interesting folks and got really inspired. But, alas, school started and free time vanished. We then sprouted a family which is a timesink, but such a wonderful one. Having a chance to learn and contribute on the job is a chance I couldn’t pass up.

I’m very much looking forward to the opportunity that I’m getting at Openismus to learn about and contribute to the projects I’ve been following so closely for so long.

Thanks Murray and Openismus.

Senior Design Project

In order to graduate from the Engineering program at San Diego State University, each student needs to complete a senior design project with a team of between 6 to 10 students. The group that I’m apart of is working on building a system to localize nodes in a wireless sensor network (WSN). We do this by using signal strength and, when nodes are in line of sight of each another, ultrasonic transducers to measure the time difference of the received ultrasonic signal and the radio signal. This is a problem that has been tackled many times and I’m pretty sure we won’t be able to come up with anything novel in the short time we have, but the task of building the working system is what is important.

Partially populated node rototype board

Partially populated prototype board

I’m in charge of building the GUI and integrating the software side of the system. For the GUI I’m using Qt. I’ve used this before and found it pleasant enough although I still run into issues that cause me to waste more time than I’d like. The most important thing for me was that Qt is cross-platform and has great documentation. Having some high-profile applications such as Google Earth and Skype using it makes it easier to “sell” to the other team members as well.

For the WSN we chose Atmel Zigbit modules. These have a ZigBee wireless chip and an ATMEGA128 microcontroller embedded within. This module was chosen because much of the difficult circuitry was taken care of, previous good experiences with AVRs, and the low-cost of the hardware and development tools. Thus far we’ve created custom PCB’s to hold the Zigbit modules, a pair of ultrasonic transducers, and the accompanying circuitry. We are currently testing those so that we can get about 20 boards professionally made.

We’ve got less than a month to finish up and are working feverishly to get everything brought together and integrated. With luck we’ll have a working system in a couple of weeks.

Setting background color of SWT buttons in Windows not supported

Just wasted a while to figure this out only to find out that it’s not supported because it’s not supported in the Windows native widget.

xorg.conf for Ubuntu Gutsy tribe 5 on IBM Thinkpad t43 2668-75U

This is the xorg.conf file as generated from the Live CD.

# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
Identifier "ATI Technologies Inc M22 [Mobility Radeon X300]"
Driver "ati"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc M22 [Mobility Radeon X300]"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1400x1050"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
InputDevice "Synaptics Touchpad"
EndSection

Students, Sponsors: Beware of Pacific Nautilus

This is rant. You’ve been warned. This will hopefully be the last time I ever mention Pacific Nautilus on this blog. Also this is my personal opinion and may or may not be representative of the San Diego City College Robotics Engineering Club and its members. For background read my last post.

It looks like Pacific Nautilus is trying to assemble another team. Actually, when I say Pacific Nautilus it should be clarified that I mean Chris Carter. There is no one, to my knowledge that is still apart of his pseudo-organization. For a second year in a row, an entire team has left Chris. So when Chris writes “we” he is being optimistic. Let me detail why this year’s team left him.

During the first day of the competition Chris and I were the only ones actually at the facility from our team. The first two days are set aside for testing and is also when you have to actually qualify for a spot in the competition. Like many schools, we were having some problems. During this time, there were various people coming around to see what teams were doing and asking questions. While I was trying to trouble shoot the problems and eventually fix them he took every opportunity to tell each and every person that passed how “they”, meaning the team, “wouldn’t listen” to him and hadn’t “kept it simple.” After hearing this 5 times, I was extremely irritated. After 20+ times I was infuriated. Still, I said nothing. I wanted to keep everything as professional as possible. Basically, I was there for 12 hours trying and eventually getting the sub to work all while Chris stood around and talked shit about the work that the rest of the team and myself had put hours upon hours into.

The next day the sub was working and with a few quirks we made it straight through the gate to qualify. At this point Chris starts to change his tone. Instead of “they” he starts to include himself in the teams work by using “we.”

Now lets talk about sponsors. I had identified a source on the Internet for possible sponsorship of hydrophones. I gave Chris the information and he contacted the organization and eventually the guy in charge. This turned out to be a gold mind. The guy made us a set of 4 custom-made, matching hydrophones. he also sent us an adjustable pinger made to match what was used in the competition. Now, however, our team has no hydrophones nor a pinger. These are all in Chris’ possession and, although I’m sure the sponsor was donating them to “the team,” we have no access to these because instead of donating them to the Club they (we believe) were donated to Pacific Nautilus. The same thing happened to a $2500 camera that was donated to the team.

The main difference between Chris and the other team members is that he wanted to have ownership of everything. He wanted to have City College pay for as many things as possible (shirts, entry fee, etc) but he wanted Pacific Nautilus to own the Sub. I and many others wanted to be apart of a project that the next generation of students could work on. Chris hated the idea that what he started could later be controlled by someone else. I had the feeling the entire time that Chris would not be apart of a project of which he was not the leader. We had and have an extremely good team but Chris was never interested in being a team player and I therefore don’t consider him to ever have been apart of “the team”. He was interested only in being the leader.

So now let’s talk about the Pacific Nautilus website. There, Chris lauds the achievement of 2007 team for placing 11th out of 27th. I’d like to correct him. We actually placed 9th as the there was a error in tallying the final score. This will be officially corrected soon. He also lists a fictitious UCSD team which he has been talking about for a year. Chris uses area schools to make Pacific Nautilus sound more reputable. He falsely represents Pacific Nautilus as being somehow in cooperation with San Diego academic institutions. In reality, Pacific Nautilus acted as a barrier in the case of our team. City College was extremely wary of this outside organization that would offer no written agreements. The Club tried on several occasions to get Pacific Nautilus’ relationship with the Club formalized in writing. Chris never wanted this and it never happened. Having formal agreements didn’t allow Chris the flexibility to take his ball and go home. Now that we have completely broke with Pacific Nautilus (and I’m sure because of our success), the school is more willing to offer support.

After a certain point we, the team, all kinda decided that we would put off the politics in order to put together a working sub for the competition. We knew it wasn’t going to be pretty once we expressed to Chris that we no longer desired to have him in charge. We actually never got around to telling him that due to the somewhat dramatic conclusion to the competition.

Wow, this is getting long. Even though I have more to say, I think I’ll cut it short here.

In closing, if you’d like to join or sponsor one of the Autonomous Underwater Vehicle teams in San Diego, you’ve got 2 legitimate teams to choose from: The first team that broke from Pacific Nautilus – San Diego iBotics or the second team that broke with Pacific Nautilus (my team) – San Diego City College Robotics Engineering Club.

2007 Autonomous Underwater Vehicle Competition

Update: We actually placed 9th out of 27 teams. There was an error in the tabulation of the final scores stating we placed 11th. This will soon be changed on the competition website.

This year I and some friends from San Diego City College Robotics Engineering Club took part in the AUV Competition here in San Diego. For the uninitiated, this is an international event that has some of the top engineering schools in the country, and a few abroad, competing against each other. The goal is to build an autonomous vehicle that can navigate an underwater course and carry out specified tasks.

This year our entry, The Seahorse, did extremely well. While the final results have not yet been posted we heard from a good course that we were 11th out of 28. This is exceptional considering that the entries that placed around us had about $20,000 invested in their subs while we spent about $3,000. Additionally, we won the award for Most Improved entry. This year we easily passed through the gate almost every single time and came within inches of surfacing in the octagon several times. We are currently planning for next years event and are confident that we can place even higher.

Our team has also severed ties with Pacific Nautilus. After the close of the event, Chris Carter, who IS Pacific Nautilus, tried to usurp control of the sub although City College and our various team members have receipts for almost every part. After a slight altercation, the sub was taken by the event coordinators. Our Dean of Engineering contacted the event coordinators and the sub is, or very soon will be back in the hands of the school. Thus, it will be available to us for next year’s event. The one or two parts that may belong to Pacific Nautilus will be returned once ownership is clear.

Unfortunately, the products that our sponsors donated – the custom-made hydrophones and titanium underwater camera – are currently in the possession of Chris Carter/Pacific Nautilus. We will soon be in contact with said sponsors in order to let them know what has happened to the products that they intended for the team.

This is the second year in a row that Chris Carter has lost an entire team. The other team reformed as San Diego iBotics and competed in this years event as well. Although it is tempting to join forces, it is obvious that our teams have differing design philosophies. We do wish to cooperate with them in the future, however.

Top 30 Django Tutorials and Articles

As a response to the Top 30 Ruby on Rails Tutorials, I’ve compiled a list of the top 30 Django tutorials and articles. These links are in addition to the great documentation on the Django project site.

For those who don’t know, Django is a Python web development framework that makes development super fast.

The list in no particular order…

  1. Are you generic?
  2. Sending E-Mails via Templates
  3. Django admin for your PHP app?
  4. Hacking FreeComment
  5. the difference between ‘blank’ and ‘null’
  6. Using Django’s TemplateTags
  7. A Django website that took (a lot) more than 20 minutes
  8. Forms With Multiple Inline Objects
  9. Extending Generic Views
  10. Template context processors
  11. Custom SQL In Django
  12. How Django processes a request
  13. Write better template tags
  14. Extending the User model
  15. Django’s Undocumented contenttype app
  16. Django, gzip and WSGI
  17. Django for non-programmers
  18. Django Templates: The Power of Inheritance
  19. Django Templates: An Introduction
  20. Setting up Django on Dreamhost
  21. Django on Windows HOWTO
  22. Django Admin Hack – Fields varying with user permissions
  23. Some django gotchas
  24. Django Templates are not limited
  25. Develop for the Web with Django and Python
  26. An AJAX ComboBox Widget for Django
  27. Using Django’s Free Comments
  28. MochiKit and Django
  29. RSS made stupidly simple
  30. Installing Django on OSX

Note: keep an eye out at Django’s community page for new tutorials and articles.

Related Links

If you have an additional tutorial, put it in the comments.

digg story

Setting Up Tomcat 5 on Ubuntu 6.06

I had mentioned that I’d post a quick how-to on setting up Tomcat 5 on Ubuntu Dapper. So here it is and lucky for me it’s VERY easy.

Translations: castellano

First a quick overview of what we are going to do:

1. install software
2. change 1 line in a configuration file.
3. start the Tomcat5 service
4. go to http://localhost:8180

And now for the good stuff.

First we want to install the right packages. basically we want to install apache2, a java jdk and tomcat (duh). I’ve chosen to use Sun’s java implementation. To install this you need to enable the multiverse repository. See this section of the Unofficial Ubuntu Starter Guide for help with enabling additional repositories. To install Tomcat itself you will also need to have the universe repository enabled.

Note: For Tomcat you MUST have a jdk not just a jre.

So, for the basic install use the following command.

sudo apt-get install apache2 tomcat5 sun-java5-jdk

If you want a shiny Tomcat welcome page when we finally get that far then install the example apps by adding tomcat5-webapps to the end of the last command. For the Tomcat admin web interface add tomcat5-admin, too.

My final command looks like this.

sudo apt-get install apache2 tomcat5 sun-java5-jdk tomcat5-webapps tomcat5-admin

By default Ubuntu uses a free Java implementation. We now need to tell Ubuntu that we want to use Sun Java as the default. Run the following command.

sudo update-alternatives --config java

Then enter the number of the version of Java you want from the list when prompted. The one I wanted was /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.

Now we need to tell Tomcat where the jdk is. Open /etc/default/tomcat5 and change the variable JAVA_HOME to read…

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/

Make sure it’s NOT got a “#” at the start of the line. You can should now be able to start Tomcat5 with…

sudo /etc/init.d/tomcat5 start

Tomcat is listening on port 8180. So open up firefox and enter http://localhost:8180 in the address bar. Once the page loads you should see either a tomcat welcome page or, if you chose not to install the examples and admin packages, a fairly empty page with “Apache Tomcat/5.0″ at the bottom left. Congrats, you just installed a working Tomcat service. If you don’t see one of these pages, either you or I screwed up. ;)

If you installed them, the example apps can be found in “/usr/share/tomcat5/webapps/“. Also take a look at the configuration files in “/etc/tomcat5/“.

Hope that was helpful.

Update: Manolo Canga added a section in his Spanish translation of this tutorial that I’ve translated into English below.

Setting up an admin user

If you try to use the admin interface you’ll find you can’t because no admin user has been set up. To resolve that go into /var/lib/tomcat5/conf and edit tomcat-users.xml. You’ll see that 3 users have been created by default. We’re going to change the password of the user “tomcat” (<user username="tomcat" ) to something better than the default of “tomcat”. Duh!? Now we are going to give the user “tomcat” admin access. Add “admin” to the user tag’s roles attribute. It should look smilar to this.

<user username="tomcat" password="your_password" roles="tomcat,admin"/>

Now restart tomcat…

sudo /etc/init.d/tomcat5 restart

…and you’re done!