Wednesday, October 31, 2007

Scarier Day At Work Than Usual

I love Halloween at work - I get to marvel just how creative my coworkers are. I didn't, as usual, dress up, because, as usual, I didn't give myself enough time to put a costume together.

I'm adding a note to myself in Google Calendar, 6 months from now I'm going to research and prepare a costume to have ready to go for the Halloween.

Congrats to Chris, from the dev team, on winning funniest costume for his Bad Santa outfit.

--Ben

Update: My photo of Megan, as a Zombie, just isn't doing her costume justice. She definitely earned the award of scariest costume. The whole blood stains around her mouth - just too spooky.

Tuesday, October 30, 2007

Remote MySQL Tips

Last night I wanted to dump all the data from a MySQL table, edit it in Excel and then reload it back into the table. MySQL provides tools like mysqldump and syntax like SELECT ... INTO OUTFILE ... - however, they assume you have local access to the filesystem. Unfortunately, I didn't have this kind of access.

After a bit of poking around, I came up with the following commands to bulk extract and load remotely.

Remote Table Dump

--
-- Run from a shell (cygwin works) prompt
--
echo 'select <col1>, <col2>, ... from <table>' | \
  mysql  -h<remotehost> -u<user> -p<password> \
  <database> > outfile.txt

Note: This command is run from a shell command prompt, not from inside the database. In this case, outfile.txt will contain a tab separated file with the results of the query that was echo'ed into the mysql command.

Remote Table Restore

--
-- Run at a MySQL command prompt, assuming you're in the right database
--
LOAD DATA LOCAL INFILE 'outfile.txt'  
   INTO TABLE <table> (<col1>,<col2>,...);

This command is not nearly as sexy as the previous one. LOAD DATA is a SQL command MySQL offers. The tricky part is that you need to include the LOCAL keyword.

Did I mention that Postgres handles all this in a much cleaner and more consistent way?

Digital Bookmarks

I just had to return two books to the library I didn't get to finished. I'm leaving myself a few notes about them here so I can decide if I want to go back and pick them up.

------------------------------------------

Title: Too Lazy To Work, To Nervous To Steal

Author: John Clausen

What it's about: How to make enough money as a freelance writer so you can live the good life (as a freelance writer)

Why I picked it up: My interest in small business and the fact that the act of writing is similar to the act of programming. To be honest though, I the clever title probably was as much a reason as any.

Main lesson: Reuse, reuse, reuse. Find ways to take the same writing and republish it in as many contexts as possible (changing it to be relevant, of course). Also, be a generalist - write lots of different types of content to cast the widest net possible.

Worth reading? Sure, why not. Programmers like myself will probably find a lesson or two to take away. Writers, YMMV. I doubt this is the best book on the topic out there.

Rating: 7/10

------------------------------------------

Title: Debugging

Author: David Agans

What it's about: This is a book that attempts to teach the art of software and hardware debugging. It's programming language and environment agnostic. It's trying to teach the fundamentals of debugging.

Why I picked it up: I'm a programmer, debugging is what I do. I'm always up for learning new tricks.

Main lesson: Debugging isn't just a skill that takes years to master through trial and error. There are concrete rules a beginner can follow today to be better at debugging.

Worth reading? Great for beginners and anyone who hasn't had a lot of practice in debugging software. Even if you aren't a programmer, the lessons are invaluable. If you've been programming for years, there's probably less here for you.

Rating: 7/10

--Ben

Morning Linux Challange

What is this, Monday? I come and find that one of our dev wiki is down. I poke around and learn that the box is pingable but not sshable. Something is hosed.

I wander back to the machine room, where Phil and I find the physical hardware. The machine was running, but there was no video and the keyboard wasn't working. I hit the old reset button and watched the machine reboot. Just as it was showing me the prompt to log in, the screen went dark and the keyboard stopped responding. Crap.

Our first move was to swap out the keyboard, and reboot. That would have been too easy, and of course didn't fix the problem.

Here's what we did to actually debug the problem:

  • Boot into single user mode by following the instructions here
  • Once at a shell prompt, I changed into the startup scripts directory by doing: /etc/rc.d/rc3.d
  • We then listed every file that should be started in that directory by using command: ls S*
  • One at a time, we started up each service on the box by doing: ./S13portmap start.
  • As soon as we ran ./S56gpm start the console went dark the keyboard stopped responding. Aha - found it!
  • We ran: rm S56gpm and rebooted. Problem solved!

Apparently, a recent update of the Linux OS apparently installed a version of GPM which is incompatible with something. Either way, we don't use the console on this box, so ditching GPM was an easy decision.

Whew, back in business. OK Linux, what do you have for me next?!

Monday, October 29, 2007

You Did What?!?!

Gavin Purcell pointed me to this remarkable site: WeAreOnlyHuman.com. The goal: collect up stories from people who have messed up and are willing to share their stories with the world.

The site is all about publishing your experiences to help people avoid the same pitfalls you've had. Some examples: taking out stitches myself, sending my wife another woman's number (d'oh!) and trusting Apple Technical Support.

Plenty to learn here. It's sort of a tipbin for your screwups.

Read it for the advice. Or just read it to appreciate that your day wasn't that bad.

Now that's a screensaver!

Forget race cars, scenic shots and chicks in bikinis - this is a *real* screensaver. It's the GNU Emacs Reference card in all its glory.

My guess is that now the cleaning people will get to learn emacs, and once they do, take over our jobs. Yeah, emacs is that powerful.

--Ben

Update: It's worth mentioning that this was Beamer's screen at the office. Way to go Beamer!

Sunday, October 28, 2007

Paper Folding, Math Hacks and Yummy Geography

We had a great lunch with the boys. Some of the activities that kept us
busy included...

- Nibbling on toast until it was shaped like a US State (can you
identify: 2 Commonweath's of Virginia, 1 Rhode Island and a shoe?).

- Attempting to beat Briteny Gallivan's paper folding record [1]. We
got stumped at 8 folds.

- Spencer taught us a nifty hack for multiplying any set of two digit
numbers.

- I got trounced in the connect-the-dots-to-make-squares game (by a 9
year old, no less). At least I held my own in tic-tac-toe.

A fun time was had by all.

[1] - http://www.pomonahistorical.org/12times.htm


--Ben

My First Blidget

George just introduced me to the term Blidget. Basically, it's a Blog + Widget. In about 15 seconds, I made one for my site.

So, if for some sick and twisted reason you think you need a mini version of my blog on your website, you can easily get one here.

Here's what it looks like:

I suppose this whole Blidget ideal would be useful for sites other than mine, too. I could see how it would be handy to put your favorite RSS feed into a nice, neat, little box to shown your site.

Thanks George!

Haunted Manor - Ben's Ideal Level Of Scary

Last night we hit the Haunted Manor in Leesburg VA with friends. It was the first time in years (if ever?) that I'd been to one of these haunted spectacles, so I wasn't quite sure what to expect. It was basically a walk through various parts of a farm with costumed figures jumping out and attempting to get you to wet your pants. You'll be glad to know, I held my pee the whole night.

The good news is that that the event wasn't that scary, so I kept a tiny amount of dignity and won't be needing Post Traumatic Stress Disorder counseling. On the other hand, for $15.00 a head, I expected a bit more drama. Franky, I wasn't scared enough.

I did get to appreciate one of my defense mechanisms when I'm under stress though. Man, do I talk a lot. I must have attempted to carry on a conversation with every zombie and axe murderer that jumped out at me. I expressed everything from hope that they could get past their anger issues, to pleas to take the tasty morsel walking directly behind me (uh, that would be Shira). Hopefully it was entertaining for those around me.

I think this whole experience would probably be good for kids on the older side (like 13-14ish, maybe?). They'll appreciate that the gore, while knowing that it's all fake. As for adults, I would go in knowing that there's not much to be terrified of here.

As if to insure that at least older guys had fun at the event, they had a belly dancer / snake tamer on hand. Me, I was only interested in checking out the snake. Was there a young lady there holding it? I had no idea...

Friday, October 26, 2007

Winter Time

It's winter in DC. My proof? Our heat is on for the first time this year!

Apparently, the house dipped to a chilly 69 degrees, and to keep the pipes from freezing, Shira was forced to turn on the heat.

I just talked to my dad in Rochester. His house is 61 degrees, and no sign of heat even being considered.

--Ben

Dabbling With Forth

Want to give this whole Forth programming language a try? Check out myForth, a Java Applet that gives you instant access to a running instance of Forth.

Open up the Beginners Guide To Forth for help to get you started.

After a few false starts, I finally got down Hello World:

 : yo CR ." Hello World" CR ;
 yo

As a side note - what a blast from the past. This is a Geocities site running a Java Applet. What is this, 1998? It's amazing it runs as well as it does. If all Java Applets were this clean, maybe we wouldn't have had to abandon Java in the web browser?

Happy Forth'ing!

Thursday, October 25, 2007

Two Languages For The Price Of One

A while back I stumbled upon this very cool, and tiny, implementation of forth. Why learn forth? The introductory comments explain why quite elegantly:

LISP is the ultimate high-level language, and features from LISP are being added every decade to the more common languages. But FORTH is in some ways the ultimate in low level programming. Out of the box it lacks features like dynamic memory management and even strings. In fact, at its primitive level it lacks even basic concepts like IF-statements and loops.

The introduction goes on to explain that not only is forth minimal, but it also supports extending it in dramatic ways. If you are ever in a situation where a low level language is called for (say programming your robot legos), then forth should be your language of choice.

The tutorial also provides you with a working demonstration of another language: i386 Assembly. The forth interpreter is written in assembly, a language I've never really got comfortable with. One reason why, no doubt, is the lack of substantial examples. Well, that's no longer the case.

If I can fully understand the implementation I'll be a lot closer to understanding both these languages on a much deeper level.

I'm tempted to bust out my ancient HP 200 LX (aka Billy) and see if I can get the assembly to compile on it. Then I'd have a forth interpreter I could carry around with me. Exciting thought, isn't it?

Greg's Advice To Amtrak

My buddy Greg had a terrific idea tonight, so I thought I'd share. This one is for you Amtrak - so pay attention.

Greg's suggestion: along with dining cars, trains should have singles cars. That is, cars meant for people looking to meet that special someone.

Brilliant, no? Amtrak, you can send us a nominal fee to license this idea. Greg would probably volunteer to screen the participants. At least the cute ones, anyway.

Wednesday, October 24, 2007

Videos Of The Week

Here are two entertaining videos of note.

First, from my Brother David, a news clip about one of the Israeli Defense Force's techniques for producing high quality soldiers. I'm not surprised in the least.

And here's one from Adrants . It's a compilation of all the classic viral videos over the years, and it's done superbly. Test out your Internet history skills by following along.

Making The Switch

I just Switched - no, not between Windows and Mac, or Emacs and vi. From a clipped set of note cards back to a spiral notepad.

The note cards were a worthy experiment, but at the end of the day, not as useful as a notepad.

Two reasons finally pushed me back to a pad. First, I really missed the archival nature of notepads. With the index cards I found myself constantly pruning my stack of notes, which means that there were some notes and scribbling I lost. A notepad tends to get filled and archived.

The bigger reason to switch was that I found it just a bit to tricky to flip between a clean writing surface and previous notes. It involved me unclipping and re-clipping the stack, which was a handful.

Two aspects of the cards I really liked was their heavier stock and the fact that they weren't ruled. Because of this, I found them easier to sketch and diagram on.

What I'd love to find is a small (A7 size) sketchpad friendly notepad with say 70 sheets in it. And I'd like this mythical notepad to be nice and cheap too. Any suggestions?

--Ben

Tuesday, October 23, 2007

A picture is worth 1000 signs

We must be getting close to a local election, as my route to work is choked with signs highlighting candidates names.

This year, I've notice two changes to the usual smattering of signage. First, a few candidates have super-sized their signs, deploying mini-billboards instead of the usual smallish versions. This doesn't do much for me.

The second arrival I think is more impressive. If you look at the first photo, next to the big sign is a smaller one with a red trapezoid like shape on it. This red shape is actually a graph. It shows how much taxes have gone up during the "Connelly Years."

I have no idea who Connelly is, but I'm pretty sure taxes went up during his/her term.

I find this remarkable because all the other signs I've seen want to stress simple name recognition. This sign, on the other hand, wants to tell me a story - one that I can read an appreciate driving by at 30Mph - no less. And it works.

The lesson: pictures matter, stories matter, and one should use them. And when I run for office, I'm so hiring the guy who did this signage.

--Ben

Monday, October 22, 2007

End of the line

Our England trip is officially over! Just a few hours ago our luggage was delivered to us. It only took them 3 days.

Thankfully, they were marked "rush" - or they'd probably arrive in a week or two.

--Ben

Sunday, October 21, 2007

Getting fancy with Excel: vlookup

Mr. Excel got me on the lookout for ways I can leverage good 'ol fashion Excel formulas in my day to day work. Tonight I found my first scenario where Mr. Excel's advice came in handy. Here's the problem:

The Problem

My boss sent me a spreadsheet with a few columns of data. However, one column was missing. He asked me to fill in that column by using data from database I had access to. There didn't appear to be an easy way for me to query the database and drop the results into the column. It was looking like I was going to have to run a query and manually place each value in the correct row in the column. Yuck!

The Solution

Here's what the data looked like (scrubbed, of course) before I got started:

I started off by dropping the data from the database in another part of the spreadsheet. It's important that I kept that data as its own little table.

I did two things to the data. First, I lowercased all the names. I did this to make the data a little trickier to work with (you'll see how that works in a few moments). Second, I sorted the data in descending order. This step is required - things will break in strange ways if the data off to the side isn't sorted properly.

To actually fill in the missing column, I copied the following formula to each row in that column:

 =VLOOKUP(LOWER(B5),
          $G$6:$H$12,
          2,
          TRUE)

The key to this formula is vlookup, a function which will browse through a set of data and pull you back the appropriate value given a lookup key. In this case, the key to lookup is lower(B5) and the data set to check is $G$6:$H$12. The third argument 2 says which column to pull back when you find a match - the 2nd column in this case. The final argument, TRUE is there for reasons I can't explain. Without it, things don't work properly.

Here's the final result:

This spreadsheet is nice and maintainable. If the database values were ever to change, I could drop in a new lookup table off to the side and the sheet would automatically correct itself.

This was fun! I'm so keeping an eye out for more ways I can leverage Excel.

Back in the USA

We may not have 1000 years of history, but we do have free refills. And all the free water you can drink.

I love this country.

--Ben

Saturday, October 20, 2007

A Party To Die For

Ryan and Erin put on an awesome murder mystery and Halloween party tonight.

Pictured here is the victim that kicked off the night's mystery - Shira with a gunshot wound (oozing ketchup, no less). My team (go Rob and Julie!) worked tirelessly to figure out who killed Shira and why. We figured it out, but were a few minutes late in submitting our guess, and lost out to another team.

Next year I'm bringing a whiteboard. How can you solve a murder mystery without a whiteboard?

Between the jet lag and waiting to the last minute, I didn't come up with a costume and went as myself. As expected, others did and they looked great. On the bright side, I now have plenty of ideas for other parties this season.

Ryan and Erin definitely set the bar nice and high for Halloween parties. What fun!

--Ben

Update: Gareth also has coverage of the party. He and Teresa actually dressed up in costume, and looked really good. That's inspirational for me, next year.

Friday, October 19, 2007

Getting Home: Flying Snafu

Nice shot of our plane, no?

There's one itty, bitty, teensy, weensy detail that's worth noting. The plane is American Airlines. We were supposed to be flying United.

This is just the outcome of a typical international flying snafu.

As our boarding time got closer and closer, we noticed our flight had no gate. Finally, at 11:55am, for our 12pm flight we walked over to the info desk. Apparently, a bird flew into the engine, bringing our travels to a halt. Amazing, all this technology, and we can't keep out a bunch of friggin birds? Forget the terrorists, let's work on bird control.

Things went from calm to chaos as United Airlines scrambled to get people assigned to new flights. I watched two ticket agents wonder aloud what we were supposed to do about our luggage, and how they were going to handle the hotel arrangements. It's like this was the first time a flight had ever been canceled at Heathrow.

We nearly got on a Virgin Atlantic flight back to the states, but as the guy was keying in our ticket, a man came over and said there were no more tickets available. Argh.

We had to make that classic decision - fight to get home, or surrender and try again tomorrow.

We chose to fight. We had a bittersweet victory. We got a flight home tonight, which was good. But it's through Chicago, which is another 4 hours of flying time. And then there are the little annoyances: the plane doesn't have our kosher/veggie meal request, we lost our aisle/window seats, we lost our economy plus status, our luggage may arrive in a few days or not, heck even the movie I was planning to watch isn't being shown on this flight.

What a pain.

That's enough kvetching. To finish off this post, and this mostly to save my sanity, I'm going to list 5 great things about our situation.

1. I'm traveling with the prettiest, most intelligent, sexy and adorable traveling companion in the world.

2. I was just back by the bathroom, and there was this guy snoring incredibly loudly. I'm sitting nowhere near him.

3. They gave me the *whole* can of Coke when they served me my drink.

4. There are some interesting movies to watch that I've never heard of, which should be fun.

5. American Airlines has more leg room in their economy seats than United, so our Economy seats aren't half bad.

6. I'm vertical.

Editor's note: I hate not having an aisle seat, we will never get our luggage, we are flying west to go east, I just lost my miles on United towards my next premier status and I am sitting next to Mr. "Let's look on the bright side." I guess we all see the world differently.

--Ben

Update: After 24 hours of travel, we made it home safe and sound. 2 days later, there's still no sign of our luggage. Yeah, the adventure isn't over yet.

Homeward Bound

We are boarding in just a few minutes, and then it's 8 short hours back to reality. See ya'll in DC.

Cheers!

Thursday, October 18, 2007

Day 5: Kew Gardens and The Hunt for a Sacred Object

The main event today was making my way out to Kew, to visit Kew Gardens. It's 300 acres of stuff to see, so to say that it's impressive is an understatement. I basically did a 4.75 mile hike and still didn't see everything. The sun was out and it was an absolutely perfect day to be strolling through the garden. The guidebook gives Kew Gardens 3 stars, the same as Windsor Castle, and I'd have to agree with them.

One of my favorite gardens was the Japanese rock garden. Think my neighbors would mind if I pulled up my grass and put down stones. I'd have to rake the lawn more often, but at least mowing would be a non-issue.

My Fodors tour book promised me that the British Science Museum had Tim Berners-Lee's computer, back from when he was busy inventing the World Wide Web. I figured I had a responsibility to stop by and visit this sacred device. Unfortunately, the computer isn't there (or more likely, I couldn't find it). I was still treated to seeing a chunk of Charles Babbage's Difference Engine from 1832. One could argue that he's one of the granddaddies of all computing, so I still got to visit an important site. The museum had lots of other cool things to see, so I stayed longer than I planned to. Who could turn down browsing an entire wall of vacuum cleaners on display?

We finished up this evening by seeing Wicked - a musical that picks up where the Wizard Of Oz left off. It was really well done, and quite entertaining. I can safely say it's the best musical I've seen in years (and the only one, too). It just wouldn't be a trip to London if I didn't go to the theater.

This was our last fun filled day of adventure. Tomorrow, we get on a plane back to DC and reality. Come Monday morning, I'll be back to work again. I wonder if they'll recognize me at the office?

Wednesday, October 17, 2007

Day 4: Unique London Finds

Today, I had a chance to do more site seeing around London. I started off my day with a tour of Wesminster Abbey. Wow. It's a 1000 years of history in one location - I can't even fathom that.

The Abbey, along with being a working church, is basically a walk in cemetery. Every few steps you walk over a stone inscription, many of which have burials under them. Maybe folks are used to this, but this was totally foreign to me. Jews typically bury their dead in such a way that they can decompose and return to nature as quickly as possible. So, we wouldn't opt to bury them in buildings.

What I was really lacking to appreciate this tour was a history refresher course. I'm sure it would have been much more impressive to see Queen Elizabeth I or Mary Queen of Scots' burial if I could actually remember a detail or two about their reign. Luckily, there are plenty of tombs and monuments to more familiar persons, such as Charles Darwin, Charles Dickens, and the Tomb Of The Unknown Warrior, that I could appreciate.

Continuing the trend I started yesterday, check out what I found while I was around the perimeter of the Abbey:

That, ladies and gentlemen, is the oldest door in England. It goes along with my snapshot of the oldest licensed premises in London.

This afternoon I found myself at yet another unique location: the London Apple Store. Turns out, they have the largest Apple Store in the world. I'm not just goofing off listening to an iPod, I'm enjoying future history. One day, this spot will be written up in Fodors, and no doubt given a star or two.

Oh, and I'm way overdue for a snapshot of Big Ben on the blog. So here it is:

Sidekick Roaming Hack

I usually leave my Sidekick at home when I travel outside the US. The T-mobile data roaming rates are exorbitant, and if there's one thing the Sidekick loves to do, it's transfer data.

This time, I brought along my Sidekick. mostly for the SMS support which is still fairly cheap ($0.35 a message). There's a simple checkbox on the Sidekick (Main Menu >> Settings >> Network Options >> Allow GPRS/EDGE Data Roaming) to turn off data while roaming. My plan was to land in England, turn on the phone, say to not use data while roaming, and I'd end up with an old school SMS/voice phone.

My plan quickly broke down, when I landed, turned on the phone, and seamlessly got connected to UK T-mobile network. D'oh. The system worked too well. I was in a foreign country, and wasn't roaming, I was on my home network. As a result, regardless of the roaming check-box above, my phone was happily transferring data (and running up a bill, no doubt).

Off went the phone. How ironic is that because T-mobile is so established here that I'm having problems? Frankly, I don't see why data shouldn't be free, just like it is in the US. Aftermall, I'm on the T-mobile network, and I pay these guys. Why should I pay extra charges? But I digress.

Today, I got a great tip on how to solve the problem. I turned on my Sidekick, went back to the Settings >> Network Options. I think clicked on the scan for networks button associated with Network Selection.

The phone churned for a bit and then offered me a list of networks: T-mobile, O2, Orange, and others. Naturally, they expect you to choose T-mobile. I choose Orange. It connected me, and because I'm on an alternate network, it noticed I was roaming and off went the data.

I now have a cell phone that's capable of sending and receiving text messages, but won't slurp down data without my knowledge. I can now text message T-mobile with how disappointed I am in their service over here.

Update: I just got off the phone with T-mobile. They think I'm smoking something. According to them, it's not possible for me to be in London and connect to a network without being in roaming mode. When I see UK T-mobile on my screen, it's actually a totally separate network than I'm usually on. Gah! I'm so confused. I'm keeping my don't transfer data while roaming box checked, and hoping for the best.

Update: I restarted my phone, and sure enough, it came up on the T-mobile network and started exchanging data, just like I mentioned above. I called back T-mobile, and they confirmed to me (in two systems, no less) that I was indeed roaming, even though my phone said it wasn't. So, it looks like this is a glitch with the phone - it thinks it's local, even though it's roaming.

This is bad news, because it means I don't get free data exchange like I do back home. But, on a good note, I'm (a) not crazy and (b) the above hack still stands as a way to force the phone into thinking it's roaming.

Tuesday, October 16, 2007

Day 3: Getting Lost

I spent the majority of today working. When I was done reviewing code (that's right, the team gets no rest from me just because I'm in England), I had about an hour and a half to wonder around.

I asked the concierge where I could go jewelry shopping for you know who. He suggested I go a few blocks away to Convent Gardens Market, where I would find all sorts of stores. The advice turned out to be good from the perspective of finding a new part of London to explore. It was bad from the perspective of actually buying jewelry, as there were only two nebbish jewelry stores there (where's my UK version of Jared's when I need it?).

While there, I grabbed a bite to eat. My "sidedish" was a piece of fruit. This brings us to today's quiz: what type of fruit is pictured below?.

If you guessed apple, I think you'd be right. It tasted like an apple anyway.

I exhausted the shopping and still had plenty of time to make it back to the 3 blocks back to the hotel to meet Shira. I thought I might just wander back to the hotel using - don't laugh - my own sense of direction. What an absolute joke. I walked for a bit, then checked the map and realized I was nowhere near where I thought I was. I then pointed myself in the correct direction, and walked a bit more. Looked at the map and realized I was farther off course. I did this a few times, till finally, I took out the map and walked around like a Boy Scount working on his Orienteering Merit Badge. I made it back to the hotel with minutes to spare.

The street layout here makes Washington DC look like a organized. I suppose it's London's age that make it so that the streets twist and turn, with random dead ends here or there. If I could ever get over this driving on the left business, I'd still opt of driving in London just because of the nasty traffic patterns.

On the plus side, the nice thing about getting lost in London is that there's something historic to see around every corner. For example, I found both the Freemasons Hall and the "oldest licensed premises in London" all without trying. Today I plan to do more sightseeing and less work. We'll see how that works out.

Coping with IP Conflicts

I'm on holiday in Jolly O'l England, but wanted to get a bit of work done this morning. Specifically, I wanted to ssh to some boxes back at the office. This is easy - just connect to the free WiFi, start up the VPN and ssh over.

All went well, except for the ssh part. My ssh attempts all failed with a timeout.

After a bit of diagnosis, I realized that the free WiFi of the hotel was putting me on the 192.168.x.* network, and my work network was also 192.168.x.*. The result, when I tried to ssh to my servers back home, the packets were routed to the local network.

D'oh.

Solution #1

My first attempt to resolve this issue was to setup a ssh tunnel (howto found here) back to the office. The tunnel works by allowing me to ssh to a box that's not on the 192.168.x.* network, yet have all packets end up on the 192.168.x.* machine.

To start off a tunnel, you kick off a command on your local machine like:

    ssh -L 7777:destination.host.net:22  gateway.host.net  cat -

This ssh's to a gateway box and sets up a tunnel on port 7777 to the destination box.

It's a really cool technique and allow for easy defeat of a firewall (providing you have all the right credentials).

Unfortunately, various firewalls were getting in the way, and my attempt to open up ports on the gateway box failed. Besides, I didn't have the guts to tell my sysadmin that I had defeated the firewall, even if it was for wholesome purposes, like working on my vacation.

Solution #2

After a bit more thought, I realized that my problem was actually a packet routing problem. That is, I couldn't reach the right 192.168.x.* host because the routing was taking me to the wrong destination.

Windows (and Linux, but I'm on Windows here) has a route command you can use to view the routing table for packets. Turns out, this same command can be used to change the route.

I kicked off cmd.exe and entered the following command:

   # Assume VPN is started
   ipconfig
   # I noted the Default Gateway associated the PPP adapter
   route add 192.168.x.y <IP address of PPP's gateway>

The result is that I'm explicitly routing ssh requests to the box 192.68.x.y to my VPN connection, instead of letting the default routing mechanism figure it out.

The result is that my packets are routed to the right destination and my ssh command now succeeds. For better or worse, I'm good to go and can start working.

Update: Here's a cygwin shell script I wrote up which automagically sets up the proper routes according to IP addresses I have in /etc/hosts. After connecting to the VPN, I run this shell script and I'm good to go.

#!/bin/bash

##
## $Id: post-vpn-script.sh,v 1.1 2007/10/18 08:21:32 bsimon Exp $
##
## Setup the routing around the VPN
##

USAGE="`basename $0` "

VPN_IP=<IP address of your VPN goes here>

for ip in `grep 192.168 /etc/hosts | awk '{print $1}'`
do
    echo "Setting up: $ip -> $VPN_IP"
    route add $ip $VPN_IP
done

Monday, October 15, 2007

Day Two: Hampton Court Palace and London at Night

Today, Shira and I headed off to Hampton Court Palace for a day for more history and site seeing. Before we started though, we got a quick dose of the National Gallery which was also fantastic.

The sites here really are amazing. There's just a immense amounts of history. And after years of family vacations where the goal was to see as much history, and as many starred locations as possible, I'm basically in heaven.

Here's some snapshot from the day...

On our way back from the palace, I grabbed this night shot of London.

Sunday, October 14, 2007

Our First Day in London: One Site for Ben, and One for Me

Of course, as we got to London in the morning, our hotel room was not ready, so we boarded a train and headed out of town. The plan for the day was to see Windsor Castle. We had a great tour guide and it is quite impressive.

Upon returning to town, in order to be fair, since Ben got to pick a site to see, it was now my turn. So, off to London's newest casino we went. In the heart of a Leicester Square is a 6 month old casino that I felt it my cultural duty to try out as I visit casinos all over the world. This got points for being non-smoking. They will see me again tomorrow night, after we see another site of Ben's choosing!

Saturday, October 13, 2007

Locked and Loaded

They just told us - it'll be a "completely full" flight tonight.

The good news is that we are in Economy Plus, which is actually fairly
spacious.

Looks like this trip is really going to happen.


--Ben

Tally Ho!

Shira and I are about to start yet another adventure - this time to
England. When I wake up tomorrow I'll be in a strange land where the
metro is called the tube, French fries are chips and everything is
ludicrously expensive.

Sounds like fun, no?

I'm certainly looking forward to it!

See ya'll on the other side of the pond.

--Ben

Friday, October 12, 2007

Box #2

I'm so not making this up...

Shira just got the rush delivered Blackberry today. Only one small
detail - it was yet another empty box.

What are the odds?

--Ben

Thursday, October 11, 2007

Ruby On Rails vs. PHP, Java, etc.

Christian Cantrell passed me this fantastically funny video, which is actually part of a bigger series:

That's the Ruby on Rails vs. Java, which absolutely nails the issue of dealing with Java. But wait, there's more -- there's Ruby on Rails vs. PHP, .Net and ColdFusion -- all strikingly accurate in their humor.

These videos caught my eye for two reasons. First, what a terrific way to spread your message about your favorite programming language. Sure, you could make a bulleted list that describes the features of your language, but this approach was so much more effective.

Second, as Kelly was mentioning today, it's amazing how powerful YouTube is. Back in the dark ages, you'd have to buy air time to get exposure like this. Sure, Oracle could do this, but could MySQL or Postgres? Now the playing field is that much more leveled - not only is the technology of Open Source as good as commercial products, but the marketing venue is there too.

Here's a tip - along with creating screencasts for your favorite Open Source project, shoot a commercial or two. What a difference it can make.

Explaining The Appendix

OK, so clearly Gareth was less than impressed about the potential discovery of the use of the human appendix. But I have to say, I'm actually fascinated about the discovery. Here's a snippet of the explanation:

But sometimes the flora of bacteria in the intestines die or are purged. Diseases such as cholera or amoebic dysentery would clear the gut of useful bacteria. The appendix's job is to reboot the digestive system in that case.

The appendix "acts as a good safe house for bacteria," said Duke surgery professor Bill Parker, a study co-author. Its location _ just below the normal one-way flow of food and germs in the large intestine in a sort of gut cul-de-sac -- helps support the theory, he said.

And no, I wasn't just impressed because the author used the phrase reboot the digestive system.

I think this appreciation for the appendix comes from a general appreciation of all things bacteria, no doubt caused by the fact that my Dad's a Biology professor, my mom has a Master's in Biology and my brother is getting his Ph.D. in Immunology (right Dave?). Listening to my family sit around the dinner table and talk about the marvels of bacteria makes me appreciate them in ways I never thought possible.

My dad was just explaining to me that a new born baby's intestinal track goes from having no bacteria in it, to being fully populated in just a few hours. How remarkable is that?

Perhaps I'm easily impressed?

Wednesday, October 10, 2007

Sales Secret

This explains why Aaron from sales is always kicking butt - it's the open bottle of beer he has on his desk, at the ready.

It also answers my question: what the heck were you drinking when you promised _____ to the customer??

--Ben

Update: For the record, the bottle in front of Aaron is root beer. He's naturally a great salesman, he doesn't need a chemical advantage.

OLPC Hardware - Not Exactly Child's Play

I was motivated by the ASUS EEE Laptop to more closely examine its bargain basement priced competitor - the One Laptop Per Child laptop.

If you've never done so, you should really check out this list of unique hardware attributes of the device. Here are some of my favorites:

  • Folds into an E-book mode for easy on device reading
  • Fanatical attention to battery saving capability, such as allowing the screen to remain on while the CPU is powered down, using 1/10 the power of a normal laptop
  • Ruggedized case and keyboard, with no spinning hardware, fan or fragile connectors
  • WiFi that has better range/performance than most laptops
  • Touchpad that also serves as a tablet drawing
  • Audio jack can be trivially hacked to read in any voltage providing device, such as a thermometer or other cheap sensors

The software list is fairly impressive too, offering Logo, Python and Smalltalk as built in software options. Naturally, it runs on Linux.

It seems like an impressive device, especially considering the $100 - $200 price tag. I can't recall hearing about a laptop being this thought through for truly mobile activities. It seems like no feature was examined and re-examined to find maximum performance for the buck.

There's one more feature the OLPC laptop has that the AUS EEE laptop doesn't - you can buy one. OK, that's exaggerating a bit, you can technically get one in 2 days.

I think there's only one real catch to the OLPC device. It's so well designed to its audience, that my guess is, it really is designed for children. It's not just the childish look and feel that leads to me this conclusion. Smaller details, like making the keyboard child sized, and setting up the screen to be viewable from a closer distance, all have me thinking that an adult would (rightfully) be disappointed with the device.

What we really need is a One-Laptop-Per-Geek project, that takes all the work that's been done for the OLPC, and makes the laptop adult sized. I'd tweak very little about it - just get the details right for someone a bit on the more mature side.

I really applaud the OLPC for their incredible work - they found a way to to not only meet the intense demands of their project, but found a way to do it at a reasonable price. Dell, Toshiba and even Apple could learn a thing or two from these guys.

Tuesday, October 09, 2007

The Ultimate Print-Screen Setup

Who knew that the Print-Screen button on your keyboard could be so useful? In Windows, the ability to capture a screen shot at the press of a button is really handy. It's great for bug reports, blog posting, sharing with clients and even doing design work (thanks to Paul Arce for teaching me this one!).

The annoying part of the print screen functionality is that usually Windows just copies the screen capture to the clipboard. This means opening up some application to save it as a file, or crop it.

But not any longer. I finally got fed up with having to start Photoshop every time I needed a screen capture, and decided to look around for a better solution.

Without looking too hard, I found Gadwin PrintScreen. Gadwin just does The Right Thing. You configure it once, and then it hides away in your system tray. I initially set it up so that hitting the Print-Screen button would store a snapshot of the current window on both the clipboard and in a PNG file.

This was a good start, but I found myself wanting to open up the images and easily crop them. Gadwin allows you to kick off a program with the newly created file. I suppose I could have connected this up with Photoshop. However, the thought of opening up Photoshop at every screenshot seemed nothing short of painful.

I decided I wanted a much lighter weight solution - so I had Gadwin kick off IrfanView (a nifty little app). Because IrfanView is so tiny, it serves as both an image viewer and a crude editor. It's more than powerful enough that I can crop and be on my way.

See, check out this example that took seconds to make:

Perhaps the next level of coolness will come when I can rig saving the screenshot to a networked server, so I automagically get a URL to the image. That would save some time on the upload side of things. One can dream, anyway.

My Dad on His Mom

Yesterday, my Dad gave a beautiful and moving eulogy for his mom. He was kind enough to let me archive it here. To appreciate it, you have to understand that my dad's a biology professor. It took everything he had no, doubt, to not make use of PowerPoint slides and present a pop-quiz at the end of the talk.

I am a biologist and in many ways a religious man, and I find the two sides very compatible.

I tell my students we are prisoners – of our senses and of our perception of time and space. Both science and religion work to expand our limitations as we try to make sense about ourselves – our place in the world and the purpose we each have. Science uses a specific set of methods and has a set of principles – it is a process to build models about the world around us. No one has seen an atom – but we have good drawings and mathematical models. Religion, using a different methods tries to do the same – explore the structure in which we find ourselves.

Both Science and Judaism in particular agree on one thing – that in the vast context of the world we are poor insignificant creatures. For science we will be born, live and die – all within a short time. Compared with the 4.6 billion year span of life of this planet and the myriad of creatures that inhabit and have inhabited it – we are insignificant. And the psalmist knows this as well:

    “A mans origin is from the dust and his destiny is back to the dust, at the risk of his life he earns his bread; he is likened to a broken shard, withering grass, a fading flower, a passing shade, a dissipating cloud, a blowing wind, flying dust, and a fleeting dream.”

If this is true than where is the meaning – “is that all there is”

Both science and Judaism have the same answer – a profound NO. Our individual existence is given meaning because we are the product of those that came before us and we influence those who will come after us. For Biology we receive genes and pass them to the next generation, and we influence, educate, and encourage those who will follow us – even if they at not blood relatives. For the Talmud what is important is that we leave something after we go – have children, plant a tree, write a book.

Our importance is that we are a link in a chain. Even a chain of thousands of links fails if one of them breaks.

Therefore if you wanted to understand the importance of my mothers life, you would need to know a little something about where she came from, and a lot how she influenced those who remain here. And it is on this latter that I wish to dwell.


I like to think of what she left us in the next generation as “gifts” – things that we could learn from and bring to our children and those around us.

1. She was the poster-mother for marriage. She was a model supportive wife – 65 years of marriage. She was the daughter of a less than ideal marriage – but showed us the what marriage could be – a life-long loving relationship. A journey through easy and hard times, with joy and sorrow – but something to be treasured.

2. She taught us never to be judgmental and how to allow children to grow – She supported those she loved – her children in whatever they did and whoever they turned out to be. And she loved her grandchildren in the same way. The object of parenting is to help children become independent, functional adults, with their own lives. And this means they have to grow up and grow away. And she let us do this. And I cannot remember her trying to influence my choices, even when I later found out she had reservations.

3. She taught us what is was to be a close friend - I need to tell you a little about Madge and Miki. These were friends she met as a young girl, Madge in boarding school; and then Miki in grade school. These were the “hide in the basement, and smoke cigarette friends” that she was close to her whole life. All the many cruises she took with my Father, all their social activities were with these friends and their spouses. She was there for them in their good times and bad. Their lives were entwined, and the love they had for each other reminds us that to fully live life we have to make strong connections to other people. We have to take chances and open our hearts.

4. She taught us how to adapt and learn – even when we were old – while you might that imagine people of that age never did well with new tricks, you would be wrong. She was not a religious woman – hers was a different generation. Holidays were important family time, but her coming to Rochester thrust her into new “Jewish” waters. In the first few years I had a hard time explaining to her that the blessings after the meal – the Bircat – were not really services at my house. And yet with the years she not only came to expect them, but follow in the book, and I could occasionally get glimpses of her singing.

5. She gave us the gift of how to be a Mother-in-Law- (from my wife) “My mother in law was fantastic. She epitomized the saying “a mother–in-law is to be quiet, wear beige, and keep her purse open”. She never criticized me, she looked beautiful and she was generous. More important, she was fun to be with. I met mom when I was 16 years old. To me, she was my mother. Moving here 9 years ago, was a gift to me and my family. We finally had family in Rochester with whom to celebrate holidays and I had someone to shop with and do things with. Of course, I was finished shopping in 2 hours and she was finished in 10 minutes. But she just waited. When she got sick and I took care of her, it was never a hardship only a privilege. I loved her and will miss her every day. “


And there were many other gifts:

She showed us what it meant to volunteer – and help others – whether it was for an organization in Chicago distributing lox-boxes or whether she made calls for the Woman’s Center at Highland Hospital.

She imbued us with a remarkable sense of humor and in her own way, she could be very funny – There are many stories – but I will save them for you if you visit while we are sitting Shiva.

She gave her family the gift of Music – I mean Opera of course. We listened to opera growing up – Texaco Radio Theatre – only the schmaltzy stuff by the way. And thanks to my son David, her last days were filled with the nightly playing of the best of Verdi and Puccini.

She showed us there is to be Joy in Simple Things - I really shouldn’t talk about the gambling, but it is a big part of who she was. Aside from being a tough Mahjongg player – I mean she could leave a table with most of the winnings – perhaps a much as a dollar and a half, she loved slot machines. Sheri and I took my parents on their last trip to Las Vegas – and after we spent the day seeing Boulder Dam, we knew exactly where they would be – not resting in the room or at a show – but in front of the same .10/.25 cent machines. She loved going with my son David or Daughter in-law Shira to the local casinos. And it wasn’t the money in all this, but the sharing of time with others that brought happiness. Her playing partners, her husband at the adjacent machine, her grandchildren as they drove. Simple activities, simple pleasures, great joy.

The only other person who I am sure who would be as surprised as I am about this little speech would be my mother. This is certainly not how she, or anyone else, imagined life’s script would be played out.

In the last three months, she often asked “How did this happen?” As a good Biologist I tried to explain, “there was a drug reaction and this lead to something, which lead to something else” and she never understood. On returning to Rochester, her Primary Physician Dr. Mary Labonoski was asked the same question, and she gave a far better answer. She said “Harriette, Stuff Happens”. And Mom, I guess it does, we are in no position to understand God’s plans.

Mom, I am sorry it turned out this way – we all would have loved to spend more time with you. But you need to know that you were a great and important link in the chain that holds us all together. You have left a loving husband, 2 children, 6 grand children, 3 great grand children (and counting), and you have influenced hundreds of people in your time here on Earth. You have given us a big box with many useful and important gifts, and the world is a better place because you were here.

Monday, October 08, 2007

Shira's brand new Blackberry Pearl ...

box. Yes, box.

The handset speaker (or software that controls it) on Shira's Blackberry Pearl just randomly stopped working the other day. Poof, suddenly she can't hear people talking on the phone.

T-mobile was nice enough to ship her a new unit for free.

Today, we arrived home and found the new unit's box, minus the phone. D'oh.

T-mobile is again being great and shipping off a new phone, no questions asked.

I guess their customer service department got points and their order fulfillment department lost them.

--Ben

Heading to the Cemetery

We just heard beautiful eulogies from my family about grandma. We all agree - she was a remarkable woman. In so many ways she glued our family together and made us all better people for it.

We are now heading to the cemetery where we will complete the funeral. Then we will head home to do what Jews do on these types of occasions - eat.

--Ben

Sunny Day In Rochester

We just landed in Rochester for my Grandma's Funeral and was greeted by - surprise - a perfectly sunny day.

Huh, Rochester can look good. Surprising.

I won't hazard a guess as to what the symbolism of this. I'll just be appreciative.

--Ben

Update: The symbolism was explained to me. My grandma always like it warm. This is ironic of course, because Rochester, NY isn't exactly known for its tropical weather. How fitting was it, that she should be buried on an gorgeous 80 degree day sandwiched between two cloudy 68 degree days.

Sunday, October 07, 2007

Josh Turns 3

Today we celebrated Josh's third birthday - gosh he's cute. Pretty much everything he says and does is adorable.

I think he really enjoyed this birthday thing - cake, lots of attention and awesome presents. It's amazing how quickly he figured out the toys, learning how turn them on and off, and getting them to make the maximum amount of noise.

Given the difficult news of late, it was nice to be part of a simcha, even if it was just for a little bit.

--Ben

Another Must Have/Test Gadget: ASUS EEE PC 701 - $250 Laptop

Today, while browsing the Linux Journal I stumbled across the not yet released ASUS EEE PC 701. The EEE is a $250 laptop which competes with the One Laptop Per Child $100 laptop. However, the EEE is also targeted to grownups (and, unfortunately, lacks a crank).

For $250, you get reasonable specs: WiFi, USB ports (to add more storage), built in audio, and most importantly, a weight of 2 lbs. The device will run Linux from the start, too.

Hopefully, either the EEE or the OLPC device will become reality. How could I avoid picking up a laptop for less than the price of a new cell phone?

The goal here is going to be the same as the new Sidekick - resist buying it until others have proved the device is useful. Resist, I say. I must resist.

Quick How To: Get Started With Subversion

Getting Started

Subversion is a version control system which makes tracking versions of files easy. This becomes essential when you are working with a group of people and want to make sure you are all editing the most up to date files. Subversion also allows you to get back to any previous version of a file, which means you can get to a backup file if needed.

This article assumes that a Subversion repository is setup for you, and you are expected to use it. Before we get started, you'll need a few details. They are:

  • The URL to the repository
  • The username and password to log into the repository
  • Software to access the repository, specifically, Tortoise SVN. Grab it here

The person who created the repository should be able to provide you with the above info. Get that all together, and let's go to the next step.

Step 1: Checking out the files

Good news - you only have to do this step once, then you can forget about it. The way Subversion works is that you'll have your own copy of the project (the collection of files you're interested in). Suppose you have a developer and a designer working on a project - in theory, one needs only the code files and one needs only the design files. With Subversion, both individuals would check out the entire project. If you aren't used this, it might seem like a waste of space. Trust me, it's not.

To check out the files, follow the instructions here.

Once the files are checked out, you can go to work. Any changes you make will remain local until you follow one of the steps below - so go ahead, make all the changes you want - they won't effect anyone (yet).

Step 2: Update files

Subversion works by having developers go through regular cycles of picking up files from the repository, making changes, and then committing them back. The cool part is that this process isn't synchronized - developers can check out and check in files at whatever pace they want (or the team decides on).

To use Subversion you just need to master the art of checking in and out files. The first process we'll talk about is picking up files -- known as updating.

You can read about updating here.

By running a Subversion update, you are asking it to grab all the files that have changed since you last updated. Subversion will try to cleverly merge in any changes that have happened to the specific files you've worked on. If it fails, you'll end up with a conflict, and you'll need to manually sort out the mess. Regardless, Subversion will never remove or overwrite any work you've done - so it's always safe to do an update.

How often should you update? That depends - it can be anywhere from 10 times a day, to once a month. It depends on how active the project is and how quickly you want to incorporate other's changes.

Oh, and before you can commit anything to the repository you've got to be up to date. That's only fair, as your changes can't just work locally, but should work given the files in the current repository.

Step 3: Committing Files

At some point, you're no doubt going to be ready to check in your changes back tot he repository so that others can pick them up. This is known as committing.

To do a commit, follow the instructions here.

Remember, until you commit files, your changes won't be visible to others. Also, you'll want to work out a clear set of rules when your team should commit files. Do you commit on a regular basis regardless of how working the code is? Or do you commit only after the code is 100% working and tested? Or something in between?

Other Tricks

There's lots more useful things you can do with Subversion - like get diffs between the current files in your directory and those that have been checked in. Or find out which line of code was written by who (the so called blame feature). But, for starters, update and commit should be all you need. When you are ready, the whole story is here.

No go, develop in confidence. Know that your changes are both permanent and recallable. It's a good feeling, no?

Update: Looking for a Mac friendly solution? Check out SCPlugin. It appears to be just as easy to use as Tortoise SVN.

Saturday, October 06, 2007

Saying Goodbye To Grandma

Today, at approximately 9:45am my Grandma, Harriette Simon, passed away. While we were surprised that she left us this morning, she's been sick for quite some time, so this wasn't completely unexpected.

Shira, myself, and my whole family are going to miss her in a major way.

I learned so much from her, from what makes a successful marriage (65 years of marriage to a Simon man - yikes!), to surviving hardships (being away from her newly married husband for years, as he was off fighting in WWII), and giving back to the community (she was volunteering at the local hospital until a few months ago). She taught me about adapting to life, regardless at what it threw at her (she mastered e-mail years ago, and was a reader of my blog to the day she passed on).

We weren't ready to lose her. But alas, we don't have a choice in the matter.

And here's the ironic part - the best person in the world to help myself, and others, to get through this difficult time, would, in fact be, My Grandma.

--Ben

Update: Thanks to David for his wonderful addition to this post:

An amazing woman, with a heart capable of loving everyone she met. Her last night, we looked at the pictures from Hawaii (we hadn't been able to read the blog for a few days), read some letters from her great-grand children, and listen to IL Travatore (a beautiful opera). Even at the end, she would tell us every day how much she loved her family, and how proud she was of all her children and grandchildren.

Grandma lived like she gambled. she thought life should be full of fun, that you should spend it with family, and that even if you lost a little bit (she loved slot machines) you could always sit down and have a nice meal with the ones you love (who doesn't love the casino buffet).

I'll miss her as a grandmother and a close friend, I can only believe that she's up with her friends (Madge in particular), having a good beer and playing at the high roller table with the big guy.

Friday, October 05, 2007

Hanging around the zoo

video

These White-handed Gibbons at the Honolulu zoo definitely had us captivated. They had some amazing swinging skills. Of course we had to come back for the video, because as soon as the camera came out, they decided to sit still and do nothing for an extended period of time, but as you can see, their performance was worth the wait.

Wednesday, October 03, 2007

Oy, What A Mess

Today we practiced one of our more esoteric traditions at shul - beating
willow branches. The goal: get all the leaves off your bundle of willow
branches.

The meaning for this tradition isn't exactly clear. It definitely
relates to getting rid of those pesky sins. Learn more here:

http://www.torah.org/features/holydays/branches.html

One thing I do know it's one heck of a stress releaver. Not to mention,
mess maker.

The snapshot is the result of our beating...

--Ben

Tuesday, October 02, 2007

ERR5RS - A Scheme Middle Ground

The silence has been fairly deafening after the ratification of R6RS. What, to me, started off as a promising effort, turned into one where Scheme community was split and ended with (in my opinion) bittersweet results.

Nobody seems particularly excited about the ratification, and 35% of the electorate (some key members of the community) are downright against it.

Tonight, however, I stumbled on a project which is giving me a bit more hope - ERR5RS. And what is ERR5RS? Glad you asked:

The purpose of ERR5RS is to fill a gap between the R5RS (which was last revised in 1998 to reflect a near-consensus of the early 1990s) and the R6RS (which was ratified in 2007 by 65.7% of a consensus).

Another goal is to provide greater portability between the two incompatibly different kinds of Scheme programs that now exist. ERR5RS should make it easier for programmers to convert traditional Scheme code into R6RS libraries, and should also make it easier to convert R6RS libraries into ERR5RS code. To achieve this goal, ERR5RS should use a subset of R6RS syntax and semantics wherever possible, inventing new syntax and semantics only for essential features (such as dynamic loading of libraries into an ERR5RS top level) that were left out of the R6RS.

This seems to me to be a key move to unify a potentially splintering community. Rather than force developers and implementers to choose between R6RS, R5RS or making up their own solution, a middle ground is being proposed. This middle ground may be just enough to keep an already small community linked.

It's an effort I hope to watch closely.

ActionScript: Key Press Routing

The Disclaimer

I recently needed some fairly obvious functionality in ActionScript, but for the life of me, I couldn't find an obvious way to access it. So, with a sinking feeling, I went ahead and implemented my own code to solve the problem. What follows, is this code - if I've reinvented the wheel, definitely let me know. If I haven't, then hopefully I can save someone else so time.

The Problem

I was working in Flash MX 2004 with a series of movie clips. These clips represented different UI windows. What I wanted to do, was to add keyboard shortcuts to these movie clips.

The obvious thing to do is to make use of Key.addListener and do something like:

  Key.addListener({
     onKeyUp: function() {
         if(Key.getCode() == Key.UP) {
            volume_mc.increase();
         }
         ...
     }
  });

The problem with this code is that it will handle every Key.UP press the same way, regardless of the movie clip in focus. This is annoying - I might want Key.UP to raise the volume when I'm hovering over the volume component, and go to the next song when I'm hovering over the album graphic.

Naturally, this can be done by adding more code to the condition that checks to see if the Flash player should invoke volume_mc.increase(). But this is oh so ugly. Especially, because the different clips that want different handlers may not be centrally created. And what about modal windows? Suppose I pop-up a dialog window, the key strokes shouldn't get through to the windows below it.

The Solution

My solution was to create an object called the KeyPressRouter. It allows you to register movie clips and a corresponding handler to invoke. When the user presses a key, the appropriate movie clip (meaning: visible, with the highest depth and within the bounds of _xmouse,_ymouse) will have its handler invoked. If no movie clips match this criteria, nothing happens.

A sample snippet of code might be:

 // In some shared part of your code
 keyRouter = new KeyPressRouter();
 ...

 // In volume component
 keyRouter.register(this, function(target) {
     if(Key.getCode() == Key.UP) { target.increase(); }
     if(Key.getCode() == Key.DOWN) { target.decrease(); }
 });

 // In modal dialog window
 keyRouter.register(this, function(target) {
     if(Key.getCode() == Key.UP) { target.scrollMessageUp(); }
     if(Key.getCode() == Key.DOWN) { target.scrollMessageDown(); }
 });

Note: in the above code, the handler takes in target, which is a convenient way to get a hold of the original movie clip that the handler was associated with.

The Code

Grab the code here: key-press-router.tar.gz. It's still very rough around the edges. But, as I said, maybe it'll save someone some time in solving this same problem.

Kitchen Supply Request

Our kitchen at work apparently only needs two supplies: sponges and bandages. Sponges, I get, but bandages?

What are people planning? We have two first aid kits in the kitchen, did we clean them all out of bandages? What kind of hazards am I facing here that I'm not aware of?

This is spooky...

--Ben

Pearl Harbor - a must see

Since Ben and I went to Pearl Harbor on a Hawaii vacation several years ago, I didn't feel it was necessary to take photos. However, I then realized that first of all, this wasn't about pictures about Pearl Harbor, it was about being able to share my trip with Grandma, and, Ben did not have his blog back then, so at least these would not be duplicates. Also, I got to go on a tour that was more in depth than the regular "touristy" Pearl Harbor tour, so it included sites that not everyone got to see. So, I was convinced to take photos, and even to begrudgingly blog them! We started our tour at the Boathouse of the Commander in Chief of the Pacific Fleet. This is his boat. The one we took on our tour wasn't quite as nice. We got to see "The Forgotten Memorial." It is called this, because most visitors to Pearl Harbor see the memorial to the U.S.S. Arizona. The U.S.S. Utah Memorial is on an island which is an active military institution, and thus not readily accessible to members of the public. We were able to see it from the water. Here is the memorial. You can see the ship remains where it sunk. There is a tower featured in the movie Pearl Harbor starring Ben Affleck, where he fearlessly fights the Japanese. It makes for good Hollywood, but this tower actually was not built until the 1950's. Oh well. And here is the U.S.S. Arizona memorial, complete with rainbow, for our arrival. And, finally, me, aboard the U.S.S. Arizona Memorial, with the U.S.S. Missouri in the background.

Flower on the left, near to the heart, means you are taken

Sorry for the dark photo... The story goes that if you put the flower behind your right ear, you are available (single), behind your left, nearer to your heart, means you are "attached." Don't worry, Benj, I've been gone awhile, but the flower made it behind the left ear.

Monday, October 01, 2007

Tiny Tool: MiniAIM

The other day I needed to jump on AIM, but was away from my usual computers. At first I tried AIM Express, a web only version of AIM. Unfortunately, its use of plugins and related nonsense kept it from coming up on in my browser.

Good thing too, or I may never have Googled around and found MiniAIM. Weighing in at 64k, and not needing an install program, it just plain works. I was off an IM'ing in no time at all.

I quickly added it to my thumbdrive, as it passes the portable and useful tests.