About Adam Young

Once upon a time I was an Army Officer, but that was long ago. Now I work as a Software Engineer. I climb rocks, play saxophone, and spend way too much time in front of a computer.

The Princess Bride Song

Second Scene, where Humperdinck Proposes.  This expands on the movie, using some details from the book.

The Princess Bride

Buttercup, far I have traveled

I’ve ranged this domain I command

Seeking a suitable Princess

To become the Queen of the Land

In the far corner of Florin

I heard the tale of a Girl

Possessing spectacular beauty

Unrivaled in all of the world

It may be that your birth is common

But by the most noble of Arts

I see the majestic potential

Encased in you delicate Heart

Buttercup hear my decision

It took not long to decide

The law of the land shall support me

Buttercup shall be my Bride

Hear me now People of Florin

one month from this moment here

Our Country will have been founded

Exactly 500 years

At sundown of that very evening

A Lady will stand at my side

Florin will have a new Princess

And I shall take her as my bride

Not long ago she was common

In A farm house she was seen

Now you will find she’s is Noble

And Regal as befits your Queen

Would you now like to behold her

The Joy overflows from my cup

The Princess that soon I will Marry

Behold Princess Buttercup

Buttercup your heart is empty

Consumed as it were by a flame

that burnt away all your ambition

and left you with nothing but pain

I know you claim not to love me

I hope that will alter with time

Someday your pain will diminish

One day you will cease to pine

Perhaps the fault lies in this castle

solid stone walls that surround

your home was open and verdant

You may crave to travel the open ground

A breath of fresh are will revive you

Comfort will find you outside

You’ll find your horse has been saddled

Buttercup please take a ride

As You Wish

This is my take on the Princess Bride as a Musical. I’ve written it as a light Opera: all scenes will be sung. I have melody lines and chords for most songs.  I’ll post each number individually.

Act One, Scene One:

As you Wish

(Narrator)
Buttercup was a beauty
With but two things to enjoy
Going horseback riding
And tormenting her Farm Boy.

Buttercup: Farm boy I require
More wood for the Fire
And then my horses saddle you will polish
Give it such a sheen
My face can be seen
And all you say is simply “As you wish.”

As the seasons pass
I more gently ask
Farmboy, would you please fetch me that dish.
And as I watch your eyes
I begin to realize
There may be something in that “As you wish.”

As you wish is all you say
But your eyes give you away
And my last bit of resistance seem to vanish
While you silently subserve
I can finally observe
What you really mean when you say “As you wish.”

This trip you must take
You’re fortune for to make
“I’ll always come for you”, I hear you say
And though you say its so
I ask you how you know
“True love doesn’t happen every day.”

“As you wish” I hear you say
As I watch you sail away
The horizon makes your vessel vanish
Once your gone I will abide
Know that I will hold inside
The echo of you saying “As you wish.”

Pirates Roberts took your ship
No survivors left of it
Condemning me to live on in anguish
For my love has passed away
I will never hear you say
Your quiet phase of loving
“As you wish.”

interface2addr

This little script will give you the ipv4 address for a given network interface, or list all of them if you leave the parameter blank:

#!/bin/bash

INTERFACE=$1

/sbin/ifconfig $INTERFACE | grep “inet addr” | cut -d\: -f 2 | cut -d” ” -f 1

Call it like this:

~/bin/interface2addr eth0

Hacking the Palm Pre from Fedora

My work machine is a Fedora 11 (F11) X86_64 system. The palm development SDK is distributed as a series of .deb packages, specifically targeted at an 32 bit Ubuntu 8 system. While I have the advantage of having a 32bit Debian system at home, so I was able to run through the setup process for development, ideally I would be able to attach to and control the Pre from my work machine.

The first step is to download the .deb files onto the F11 machine. I actually only needed the novacom deb, which in my case is novacom_1.0.38_i386.deb. Deb files are accessable using ar (happy talk like a pirate day!).

In a new and empty directory, run
ar -vxf ~/novacom_1.0.38_i386.deb

And you will see the three contained files:

control.tar.gz data.tar.gz debian-binary

Extract the data file using tar

tar -zxf data.tar.g

This will add a usr directory with the binaries in

usr/local/bin/novacom{d}

Novacom is a two piece effort: a daemon an a client. First make sure you can run the daemon.

First, lets see the file type:

file novacomd

novacomd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped

Let’s see what libraries it requires:

ldd novacomd
linux-gate.so.1 => (0x008f1000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0078a000)
libusb-0.1.so.4 => not found
libc.so.6 => /lib/libc.so.6 (0x00110000)
/lib/ld-linux.so.2 (0x006ae000)

Note that the USB library is missing. I have it installed on my system, but only the 64 bit version. To get the 32 bit version, first, figure out what the 32 bit vversion is named.

yum search libusb

libusb.i586

And install

sudo yum install libusb.i586

F11 and the RHEL based approach for running 32bit apps on 64 makes this fairly easy to do. Unlike Debian based system which pretty much require you building a chroot if you are going to run a significant amount of 32 bit binaries, Red Hat based systems put 64 bit libraries into /usr/lib64 and 32 bit libraries int /usr/lib, so they don’t conflict. Now lddd shows we have everything:

ldd novacomd
linux-gate.so.1 => (0x00262000)
libpthread.so.0 => /lib/libpthread.so.0 (0x008a5000)
libusb-0.1.so.4 => /usr/lib/libusb-0.1.so.4 (0x00770000)
libc.so.6 => /lib/libc.so.6 (0x00263000)
/lib/ld-linux.so.2 (0x006ae00)

And we can now run this. Since it is talking straight to hardware, it insists on running as root:

./novacomd
[2009/9/22 11:40:48] novacomd version novacomd-62 starting…
[2009/9/22 11:40:48] novacomctl socket ready to accept
[2009/9/22 11:40:48] need to run as super user to access usb

so:

sudo ./novacomd
[2009/9/22 11:41:11] novacomd version novacomd-62 starting…
[2009/9/22 11:41:11] novacomctl socket ready to accept
[2009/9/22 11:41:11] sending rst
[2009/9/22 11:41:11] sending rst
[2009/9/22 11:41:11] sending rst
[2009/9/22 11:41:11] going online
[2009/9/22 11:41:11] novacom_register_device:188: dev ‘e851588c804e8caa722490a0314ce9782dd4d9a4’ via usb type castle-linux

No we turn our attention to the client piece.

file novacom
novacom: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
[ayoung@ayoung novacom]$ ldd novacom
linux-gate.so.1 =>  (0x00173000)
libc.so.6 => /lib/libc.so.6 (0x006d2000)
/lib/ld-linux.so.2 (0x006ae000)

So we are ready to run.  There is no novaterm in this deb.  Instead, you run novacom in terminal mode.  A little noted line in that I will make big here is:

./novacom $* -t open tty://0

Fun with Unicode

I’m on IRC with a Coworker in Israel. While my Hebrew is pretty poor, I have attempted to communicate short sayings with him like:

בוקר טוב

And of course

שלם

However, his response are getting garbled. I blame his IRC program (mIRC) since it is running Windows, but I’d like to confirm that this is our problem. Eventually I’ll sniff the packets on the wire, but what should I look for?

I took the word שלם and dumped it into open office, and then saved the file as straight text. A hex dump of it looks like this:

hexdump -C ~/Documents/shalom.txt
00000000 ef bb bf d7 a9 d7 9c d7 9d 0a |……….|

Just the letter ש looks like this

hexdump -C ~/Documents/shin.txt
00000000 ef bb bf d7 a9 0a |……|

A File with just the letter ‘a’ in it looks like this:

hexdump -C ~/Documents/a.txt
00000000 ef bb bf 61 0a |…a.|

To check the file type of these:

file ~/Documents/a.txt
/home/ayoung/Documents/a.txt: UTF-8 Unicode (with BOM) text

The value 61 is the ascii value for ‘a’, so we know where to look. Note that this file is one byte shorter than the other two. This aligns with UTF-8. The letter ‘a’ maps directly to the ascii value for ‘a’, where as the Hebrew characters us the ascii expansion scheme. I’ll translate this raw binary back to the Unicode value:

If shin dumps to d7 a9

D7a9=1101 0111 1010 1001

110 Means it falls into the range of U+0080-U+07FF And is translated from the Unicode value by the pattern 110yyyxx 10xxxxxx

So yyy= 101 and xx xxxxxx = 11 101001

Note the yyy. The max this portion can be is 7, so you left pad it with 0 to get 0000 0101

And the rest becomes 1110 1001. This is the hex value 0 5 E 9, Which is in the range U+0590 to U+05FF as expected.

Earning the right

I recently read a complaint that the Ushers at Michael Jackson’s funeral wearing what appeared to be West Point Full Dress uniforms was insulting.

Men’s fashion has always been derived from military uniforms. Look at many hotel employees, SGT Peppers Lonely Hearts Club Band, or any Gum Shoe that walked down the street wearing a WWI era trench coat. In the days of horses, gentlemen wore long tall boots, long stockings and short breeches, all of which were driven off the cavalry needs to not get caught up in your stirrups. High hats with plumes came from the uniforms designed to make the front rank look taller. The original designs were practical for military purposes, the later often mimicked the form without providing the function.

Jim Peckham ran a wrestling camp where the motto was “Earning the Right to Win.” I like the concept that a Right is something that can be denied to those who haven’t met the minimum standard. Yes, life, liberty and pursuit of happiness are the right of all, but victory is the right of the one who has earned it.

If you earned the right to wear the uniform and then dishonour it, that is insulting. If you never earned the right to wear the uniform and wear clothes that look like it, it is merely that same sincere form of flattery shown by a younger brother that wears his older brothers Jacket. If the ushers claimed to be Active duty military, that would be inappropriate, probably illegal, but even then it would not be insulting.

In the days when gentlemen carried sabres, and were expected to protect their honour at the risk of their life, it was understood that a Gentleman could only be insulted by another gentleman. While the modern USA is an egalitarian society, I still reserve the right to select who is entitled to insult me. You have to earn that right.

Technology Overload

Here is the current list of technologies on my horizon, not all of which I am completely clueless:

  • JBossAS5
  • OSGi
  • Qpid/AMQP
  • JSF
  • Facelets
  • Seam
  • Git
  • Jopr/RHQ
  • Maven
  • EJB3/Hibernate
  • Portlets
  • Struts and Tiles…did this before but it has been a few years.
  • Jepp
  • JNA/JNAerator

Of course, there are also my completely unrelated side projects cpp-resolver and the bproc work, both of which go in completely differnt directions.    My brain hurts…but it is a good kind of hurt.  And yet, strangely, in my brain these all fit together into a single consistent whole.

cpp-resolver

I’ve finally created my own open source project.  I’ve taken the cpp resolver code and posted it on source forge.  Let the bug reports commence!

http://sourceforge.net/projects/cpp-resolver/

I’ll probably copy the articles describing it over there at some point as well.

Dogfooding

When I was contracting at Sun, someone sent out a memo using the phrase “eat our own dog food.”  Scott McNeally sent out a response to the effect that Sun did not make dog food, “We Fly our own airplanes.”

In the software world, the phrase has become so used that it has been verbed; If you work at a software company that uses its own products in house,  you are Dogfooding.

Since so much of my professional work has been on Red Hat Enterprise, I’ve tended to run Debian based systems for my desktop, to keep abreast of what is happening in both worlds.  At Red Hat, I’ve finally had reason to run Fedora as my desktop machine, and have been enjoying the experience.  The vast majority of the Software I run now is distributed by the company I work for, and is Open Source.  It really is an amazing feeling. I am now running Fedora 11 not only on my work laptop, but my wife gave me permission to blow away the Windows install on her eeepc and install it there as well.  Fedora makes a great Netbook OS.

However, one tenant of Software Development is to develop on the platform on which you are going to ship.  For Red Hat, that is RHEL5, and so I need access to a RHEL5 install, and in fact need both 32 and 64 bit, since the world has not completely moved to 64 bit yet.  I’ve used virtual machines in the past, but always from VMware.  Now I am running QEMU/KVM on my Laptop.  Like most things Linux-y, the command prompt method of controlling the virtual machine subsystem is a first class citizen:  I don’t need a visual console to start up a VM.  I realize this is old hat to some people, but It is new to me, and I am enjoying it.

That is the wonderful thing about the Open Source development model:  you very quickly take ownership of the software that is essential to you.  Whenever a user becomes a contributor, that software is no longer just something out there.  It has become personal.

Anyways. As I Fly the Red Hat virtualization airplane, I’ve learned a few things.  The GUI, Virtual Machine Manger, is great for getting over the learning curve.  The command line is virsh.  These tools are a  part of the libvirt project.  There is a command to start Qemu based vms directly, but his seems to bypass the libvirt infrastructure.  Rnning qemu-kvm allowed me to start a VM saved in /var/lib/libvirt/images, but was not able to talk to the kvm subsystem.  One thing that threw me was that connecting to the virtual shell and running the list command did not show my virtual machine;  by default, that only shows running virtual machines, and you need to add the –all option to see non-running VMs..important if you want to only run them occasionally as I do.  To connect to the system, run:

sudo virsh -c qemu:///system

There is also another URL qemu:///session that I am not yet familiar with.

Working with VMware, I was comfortable with the split of the info into a vmdk and vmx files for binary data and configuration information.  IN KVM/Qemu/libvirt land, the equivalent of the VMDK is  a boot image.  This seems right to me, in keeping with the fearless Unix way of not inventing a new technology if an existing one makes sense.  The Analogue of the vmx file is in /etc/libvirt/qemu/.

One thing I would like to get set up is bridged networking for my VMs to the corporate lan.  The base install takes the conservative view that the network should be confined to the local system.  I’ve seen some write ups to getting TAP interfaces set up to allow your virtual NICs to get packets to and from the physical NICs, but haven’t done that yet.  The configuration for the host local network can be viewed from the virtual machine manager, and it shows the range of DHCP address given out to the hosts.  It contains a wizard for adding new networks, but I am not sure if the VMware paradigm of a bridged network maps cleanly to the Linux view…I suspect not.  I see under advanced options when creating the VM that I can set the Network to bridged, but it doesn’t seem to find my DHCP server to PXE boot.  As an aside, I’d like to understand how this operates in an Ipv6 environment, as Uncle Sam is now dictating IPv6 for all new Software purchases.    So many things to learn!

Importing JBoss Application Server 5 code into Eclipse Take 2

I wasn’t super pleased with my results yesterday, so I kept plugging away.  Better results today.

  • Checked out sources.  This time, I made a backup copy.
  • ran mvn install in the jbossas directory
  • ran mvn eclipse:eclipse in the jbossas directory
  • imported the projects into eclipse.  Saw about 100 errors.
  • I had to exclude  a couple of things from the source paths by hand.

In two cases, I had errors that showed different versions of standard Java classes regarding CORBA and JAAS.  To get these to build correctly, I went to the Build Path popup and selected the Order and Export tab.  In both cases, the JRE directory was the last one listed.  I moved it to the top of the list.  I suspect that some scripting is in order to reorder these in all of the .classpath files.  However, once again, I have a project with no errors.

I notice that most of the projects refer to the jar files built from previous projects as opposed to depending on the projects themselves.  Everything has been installed in M2_REPO, and is fetched from there as well.  This is astep above installing in /thirdparty.