My first Arduino

Yesterday my wife decided to buy yet another sewing pattern book and I decided to tag along.  As a Kindle user, there’s usually very little for me to do at a bookstore.  I usually just look around the IT section of the magazine rack and thumb through the amazing Ubuntu magazine, or Nikkei Linux.  This time though, a magazine called “Otona no Kagaku” caught my eye.



“Otona no Kagaku” is magazine that comes with some kind of sience related device inside that you can put together.  There were all kinds of projects from synthesizers to airplanes, all sorts of fun.  Kids today are so lucky, I wish I had a magazine like that when I was a kid.

Anyway I’m too old for most of them to be interesting but one of them came with an Arduino board (branded as “Japanino”).  Since the magazine cost about as much as a new pre-assembled Arduino + shipping I decided to buy it.  The magazine is filled with a bunch of projects other than the one on the cover and explains how to go about doing them.  It’s amazing all the cool things people are doing with the Arduino. One guy uses an array of Arduinos to electricute himself in the face it seems.  To each his own I guess.


The Persistence of Vision project was really simple to set up.  Just a few screws and the website had all the software you needed already.  Here’s what the finished product looks like.


The IDE is really simple.  It’s amazing how low the bar is to get code onto these things.  Way back when (circa 2005) I still had to build a cross-compiler environment.  The language is like a C version of Processing, which is really intuitive and gets rid of having to write a boiler-plate event-loop in the main function.

Now I’m thinking about what to do next.  At work I’ve been experimenting with a presence system based on bluetooth which automatically locks the computer when I’m out of range.  Unfortunately Bluetooth has a pretty long range.  I wonder if there’s any NFC shields for the Arduino.  It’d be pretty cool if you could use your phone as a smart-card via NFC.



Announcing Better Mail

About a year ago I bought the first Android phone available in Japan for the sole reason of making apps. Unfortunately I’ve had very few itches that needed scratching.

About a month ago that changed, because the built-in Gmail app has a fatal flaw.

The Problem

If you temporarily lose connectivity while sending an e-mail, the e-mail gets stuck in a “Sending…” limbo.  There’s no way to re-send the message.  It’s not even possible to edit the message.  It’s not in the outbox, and not in the sent folder.

When OhLife first started I spent 30 minutes writing my first journal entry.  Unfortunately I’ll never get to read that post again because it never finished sending.

Also the native app doesn’t support Japanese emoji.  Which means that sometimes I get what looks like blank e-mail from my wife or my friends which were actually just full of emoji.

I decided to do something about it.  So I started using the Gmail mobile web app which doesn’t have this problem. Pretty soon however I started to miss the integrated experience of the native app.

My Solution

Better Mail is a native android app with a WebView hardcoded to  But that isn’t all, it also listens to the same new e-mail broadcast as the Gmail app.  It will notify you of new e-mail without a constantly running background process.  It also includes a native menu so that you can navigate without having to scroll all the way to the top. Also, since Better Gmail is a separate application it stays in memory longer than a web-page would which makes it much less painful to use.  I also took the time to fix some of my pet-peeves with Gmail’s notification style. For example, I added a “Quiet Mode” feature that automatically turns off sounds and vibrations when you get new e-mail at 2 in the morning.

The Price

A buck.  Making this application wasn’t trivial, since I had to do some reverse-engineering.  While the die-hard Free Software nut inside me has some reservations about using DRM, it does improve performance a bit.  And performance is the biggest problem.

I have a lot of ideas in the pipeline that I could work on if there’s enough interest.  Eventually I would like to try injecting my own javascript code into the page to provide an even deeper level of integration.


I’ve decided to work on bigger and better things.  The code is now Open-Source (GPL) and available for free!

The Future

This app is definitely a minimum value product, there’s plenty of room to expand.  If anyone has a feature request let me know via e-mail or in the comments.

How To Get etags Working in Emacs

You’ve been using Emacs for how long and you haven’t figured this out yet?

Yup.  Up until now I’ve never really needed to actually get etags working in Emacs.  I remember trying to figure it out long ago as a newbie and giving up.  It’s initially difficult because it’s not as simple as just saying “etags my-src-dir”, though once you have a couple of UNIX tools on your utility belt though, it’s practically as simple as “etags my-src-dir”.

Just show me the code.

Although there might be other more correct ways to do this, the following works fine for PHP:

    cd ~/src-code-top
    find . -name '*.php' -print | xargs etags

Woah find and xargs?

etags (unfortunately) only works on files and not directories.  Those files also have to be arguments and not stdin.  So we need to use find to give us a list of file names and xargs to convert each filename into an argument for etags.

Explain find.

find is a swiss army knife of file search but mostly you can just memorize “find . -name ‘*.filetype‘ -print”.  find needs 3 arguments, the directory to start looking in, some condition, and some action. The “.” tells it to look starting from the current directory. The “-name” part means find matching filenames (We use the single-quotes to keep bash from expanding). Finally -print tells it to print what it found one line at a time.

Explain xargs.

xargs takes lines from stdin and supplies it as the arguments to some other program.  Just what we need for etags. Although xargs is as versitile as find we don’t need to supply it with anything, the default behavior is fine.

Ok, now how do I use it in Emacs?

Just use M-x visit-tags-file and point it to your newly minted TAGS file.  After that you can easily find out where the hell that class/function is hiding just by doing “M-.” (You can also return to the file you came from by pressing M-*).  Of course “M-.” and “M-*” work in a stack like manner so you can keep “M-.”ing to dig as deep as you need to and easy get back by pressing “M-*” and equal number of times.

Integrating Qt3 programs in Ubuntu

If you’re like me and have discovered a couple of kick-ass Qt applications and are wondering how to make Qt programs look more like the default Ubuntu Human theme, I present you with a quick cheat sheet.

There’s luckily one KDE style available in the Ubuntu repositories that only depends on Qt, polymer. But the colors it uses are different from the Ubuntu colors, so here’s how to get them pretty close.

First you’ll need to install a couple of packages. You can either click on these links or search for them using synaptic.

Once you have them installed you can find qtconfig in System>Preferences>Qt3 Configuration.

First change the style to Polymer. Then click the Tune Palette. Here’s the colors that I used:

  • Background: Red: 239 Green: 235 Blue: 231
  • Button: Red: 245 Green: 242 Blue 239
  • Highlight: Red: 219 Green: 154 Blue: 86

You can change the color by clicking on the change color button when and inputing these numbers in the window that pops up.

Once you’ve changed those three, close the Tune Palette window and go to File>Save.

Now your installed Qt apps will blend in a lot better with your other GTK applications.

Here’s what it’ll look like:

Virtual Box OSE screenshot


I learned about this program from Sacha Chua’s blog. Workrave is a cool time-to-take-a-break-reminder program that doesn’t just lock your screen (like the default typing break program in Ubuntu). It has micro-breaks which are great to remind me to get back to working on whatever I was supposed to be doing.

I wonder how my life would change if I made a program for my Treo that would make it vibrate every couple of minutes to remind me to keep my attention where it should be.

Ubuntu users can use the following link to get APT to install it for you: Install Workrave

EMobile D01NE on Ubuntu 7.04 Feisty Fawn

The EM D01NE is a (I think) HSDPA PCMCIA card. The driver for the modem comes with Ubuntu 7.04 (Maybe before). I get about 2Mbps from it (max is 3.8).

Getting this setup in Ubuntu is easier than getting it setup with Windows. The only gotcha is that you have to install Gnome-PPP first, since it doesn’t come with Ubuntu. I’ll try later using gnome-network-settings and report it in another post.

  • First install GNOME-PPP using synaptic or apt-get
  • Run it and press the setup button
  • Press the detect button, it should find /dev/ttyACM0
  • Speed: 460800
  • Phone Line: Tone
  • Volume: High
  • In the Init Strings change Init2 to ATH0E1
  • Leave Init 3 alone
  • Leave Dial prefix empty
  • Username: em
  • Password: em
  • Phone number *99***1# (Some people have success with just *99#)
  • Internet!

These instructions come from (Japanese)

Ubuntu 7.04 Installation Notes

I added a new page to my website with some of my notes on installing Ubuntu 7.04 “Feisty Fawn” on my iBook G4. Even though PowerPC computers are no longer supported by Canonical I’m impressed with how little I had to do this time to get it working. Kudos to the Debian and Ubuntu communities. I especially want to thank the xorg ati driver developers for getting 3d acceleration working, you guys seriously rock. I’m going to try this summer to get the changes listed on my page into Ubuntu for the next release.

As for my thoughts on this release, I have to say that I’m genuinely impressed. Linux has Vista beat in every front in my book. (Even in the game department! ) With desktop-effects and virtual desktops we have a more functional 3D desktop than Vista and we are at least 6 months ahead of Apple’s next version of OS X. Plus all the bells and whistles fits into 256MB of RAM, while Vista needs 512MB of RAM minimum just to run in it’s most basic mode. Ubuntu definitely wins in terms of preserving your computer’s value.

I’m really proud to be a (small) part of this community. People everywhere are doing amazing things with Linux, and while Apple maybe be doing some pretty innovative stuff to OS X it’s not even close to the out-of-the-box (computer) thinking that is happening in the Free Software community.

Ubuntu 06.10 Edgy Eft

I’ve upgraded Chiaki to Ubuntu 06.10.  I did a clean install this time because my 06.6 installation was pretty old, and had a good number of custom packages installed.  Luckily for me I found out that a lot of people have been having problems doing dist-upgrades.   I think 90% of those problems are because of people using non-official packages.  Perhaps apt should be a little smarter about alien packages and ask the user to delete them before performing the upgrade.

The installation went nearly flawlessly.  The only thing I had to do this time was install and configure 915resolution to get it to do widescreen.  The broadcom drivers work a little faster this time, but still have a sucky range.  That really sucks because I want to use WPA but my orinocco card driver doesn’t support it. Also the network manager applet wasn’t installed by default… I can’t remember if it was installed by default in 06.6.  It really should be.

Of the upgraded programs I have to say Gaim 2.0 beta 3 is the worst.  Although 1.5.0 is old and buggy, but it’s way too early for Gaim 2.0 still.  I have to give the gaim developers some negative karma for not keeping their stable release usable.

Firefox 2.0 is pretty good however, it boots up faster than 1.5 and pulls off it’s new theme while not looking out of place with the rest of the desktop.

On a side note I’ve been looking for new music recently, and have been checking out Jamendo There’s some pretty good stuff there.  It’s really nice to see how big it is.  I love websites who use open-source software to do good (Bittorrent, eMule, Ogg vorbis).

Also in other news I bought a rice-cooker today.  It was really expensive but it works great!

Wobbly windows in Dapper

There were a lot of upgrades today in Dapper. And it turns out compiz is one of them. So I installed it and xserver-xgl. Here’s how I got it running.

First install the xserver-xgl and compiz packages using apt-get or synaptic

(Originally taken from the instructions at

Then edit /etc/gdm/gdm.conf-custom

and make the empty [servers] section look like:


# Override display 0 to use Xgl.

name=Xgl server
command=/usr/bin/Xgl :0 -fullscreen -ac -accel xv -accel glx:pbuffer

then add “compiz –replace gconf decoration minimize move place resize rotate scale switcher wobbly zoom cube” and “gnome-window-decorator” in sessions (under System>Preferences).

Then ctrl+alt+backspace and pray! Only the basic things work for me. I can’t do the cool cube effect for example. But the windows sure do wobble, and the switcher work just fine.