Friday, September 07, 2007

My Airline Idea

Here's my suggestion for an airline: *everyone* flies first class. Seriously.

If I look closely at this first class experience, I see that what really mattered was: more leg room, all the snacks and drinks I could eat, and attention. Someone came by and asked me if I wanted anything, did I need more water?

Are these actions particularly expensive? Don't think so. Sure, they used a real glass and real strawberries (2 of them, to be exact) on my cereal this morning. But I could easily have lived without those and still considered it first class.

First class is as much about attitude (and leg room) as it is perks.

Independence Air lasted for like 24 months - I'm sure First Class Air would last longer than that.

--Ben

Flight Perks

Oooh, more first class perks: water from a *real* glass, free headsets
(skipping the outragous $5.00) and unlimited biscotti and cashews. The
seat in front of me reclined and I didn't squeal in pain from a crush
injury.

Not to mention, a great view.

I can't imagine it gets much better than this?

--Ben

First Class All The Way

Through a rip in the space time continuum, Shira and I ended up with First Class seats to San Diego this weekend.

We are taking advantage of all the perks of first class: ordering drinks while still at the gate, oggling all the coach passengers as they walk by and generally having blood flow in my legs because of the extra space.

I think I could get used to this. Especially the blood flow part.

--Ben

Tool Of The Day: Sitecopy

If you have to slog data back and forth between your local computer and an FTP server, you need sitecopy. Sitecopy allows you to quickly mirror your source code on an FTP server by running the command:

  sitecopy --update foosite

This assumes that foosite has been configured in your .sitecopyrc and contains goodies like the hostname to FTP to and authentication information. Having a trivial and reliable way to push updates to an FTP server is absolutely essential for nearly all web development.

One of the coolest aspects of sitecopy --update is that it will do The Right Thing and just update the files that have changed since your last set of modifications. It tracks what needs to be updated, so you don't have to.

Sitecopy is a command line utility, so it's easy to use from make or any 'ol shell script. I'm sure it was designed for Unix, though I have no problem running it on Windows Cygwin.

Sitecopy is also useful for pulling sites down to your local machine. Just do:

  sitecopy --fetch barsite
  sitecopy --synch barsite

Just make sure you read the Sitecopy manual page fully - sitecopy gives you enough rope to both climb mountains and hang yourself. So be careful, deleting your files is possible, though unlikely.

Thursday, September 06, 2007

Another Soy Find


Thanks Julie for this yummy tip - Whole Foods now carries soy whip cream.

Can you say ice cream sundae after hot dogs?

I so love soy.

Walking Errands

One of the things that I love about living in Arlington is how much is
accessible via walking. Tonight, Shira and I hit the bank, nail salon,
and two drug stores, all within reasonable walking distance.

Just for clarification - the nail salon was for Shira not me. Though
one day, she's gonna convince me to get a manicure....what a blog post
that will make.

Shira and I just marvel at how balanced Arlington is for us. Not "real"
city living like DC, and not too suburban/country like, say, Sterling or
Manassas.

But I suppose, it's all a matter of taste. Regardless, I'll take
walking errands over running them in a car, any day.

--Ben

Rafting Photos

Here are some photos from our rafting adventure:

From Dev Team Raft...
From Dev Team Raft...
From Dev Team Raft...
From Dev Team Raft...

And more here.

Note: all the photos with a finger over the lens were mine. Yeah, it's a gift.

Wednesday, September 05, 2007

Shoes...For Me?

I arrived home today to a fairly normal sight - a package from some Internet shoe store at our door. But here's where things get strange: on a hunch, I opened the package and found the neat black dress shoes ordered by Shira, were for me - not her.

But I already own a black pair of shoes, I explained to Shira. Why do I need another? She provided me with an answer, but I've since forgotten it, because it didn't fit my logical view of the world.

I think Shira's take a card from Dave's Wife's Play Book.

I'm not sure how to interpret this move. It's not "training" me, and it's not letting me do what I want. It's not nagging either. It's a practical solution to a problem I didn't even know I had. Odd.

9 years of marriage, and she still throws me curve balls.

--Ben

Conquered The River (and Lunch too)

We just finished lunch, after a fun ride down the Shenandoah River. The guide claimed we did a few class 3 rapids, but I think he was being generous. Let's just say we did plenty of paddling.

Our guides were actually really cool and stopped the boats so we could try "swimming a rapid" ourselves. That is, jump from a rock into some whitewater and have it carry us through.

It was tons of fun, and the whole team took turns doing it - even though it looked insanely dangerous. I see now why we have to sign that waiver.

We had great time, and should all be mightily sore tomorrow.

Oh, I think I had the biggest injury. My leg was all scratched up and bleeding a bit. But don't feel too sorry for me, I did this to myself while leaving the changing room *after* the rafting. Who knew it was a class 5 changing room?

--Ben

Going Old School

No digital preview. No zoom. No white balance control. No ISO options. No batteries.

Just a cheap throw away camera, old fashion film and plastic housing. The perfect recipe for our rafting trip.

I'm actually fine with the whole film thing - it's the film processing I have an issue with. It's expensive and time consuming.

Though not as expensive as replacing a $400 digital camera.

--Ben

Update: Tonight I dropped off the film at CVS tonight. I asked them to skip the prints and just process the film and make me a CD. That should cut down the cost of the rolls from $11.00 for single prints and a CD to closer to $5.00. Still not as nice as digital, but less painful.

Every Great Journey...

...Begins with a trip on The Toll Road. OK, maybe not.

The dev team is off for one heck of an adventurous day - we are going rafting at Harper's Ferry, WV. Any team event that begins with signing a waiver is going to be fun.

Hopefully I'll be able to publish some photos of the day here. Though, I think blogging from the river is probably off limits. At least that's what my team tells me. Something about needing me to paddle, not blog. Whatever.

At this point, just arriving at the river will make me happy.

--Ben

Tuesday, September 04, 2007

A View From The Top (Of Arlington)

Yesterday was a no-blogging day. But Shira made an exception and allowed me to capture a few photos from one the little adventures we had.

Shira took me to the bar at the top of the Double Tree in Pentagon City. Not only does the bar have a really nice view of the area, but the room rotates, so it's always changing.

Between planes landing at National Airport, the Pentagon, the Air Force Memorial and traffic on 395, there's quite a bit to see.

There wasn't much vegetarian on the menu - but we made do with some tasty cheese quasodias quesadillas (geesh, how the heck do you spell that?!).

If I was a dating man (which thank heavens I'm not), I'd probably use this place as a first or second date locale. Of course, the fact that I'm recommending this, and haven't been on a first or second date in over 11 years, is probably reason enough to avoid this recommendation.

--Ben

Monday, September 03, 2007

A Quiet Monday For The Blog

If all goes as planned, you won't see any blog posts on today - Monday. OK, you'll see this one, but that's it.

Shira and I struck a deal - she would let me do what I wanted to do on Sunday, and she would have Monday.

So I lived it up Sunday - mowing the lawn, getting a run in and lots of blogging. She even took me out to dinner at Eli's Kosher Restaurant. Mmmm, Kosher meat.

But, today is now Monday. I doubt she has blogging on her list of things she plans to do today. She may take away my phone altogether, for that matter.

One big difference in our days - I had a written plan for what I wanted to get done, and crossed things off as it happened. She doesn't have such a plan. She thinks I'm crazy for having such a plan. She thinks I'm crazy in general.

See all ya'll Tuesday!

Sunday, September 02, 2007

Lookout The Onion - You've Got Company

Gareth is trying his first attempt at a self-described Onion-esque story. I think he did an excellent job, and look forward to reading more.

Between Fake Steve Jobs, The Daily Show and The Onion, it's quite possible that I've become a Fake News Junkie. I know, scary thought.

My How We've Grown

Hard to believe that when Teresa planted a little rosebush in our front "garden" area it would thrive so well.

It's now as tall as Shira and was in serious need of a thinning. So today, I took the clippers to it, to give it a haircut. I could have done 3 minutes of research to make sure I was trimming the right parts the right ways, but what the heck. That would take all the fun out of this project.

I was actually curious what would happen if I let the bush grow, and allow nature to take its course. This would be a little exercise in Darwin's survival of the fittest - assuming the plan would correct itself for its own growth. But, the plant appeared to be on its way to be growing both sentient and large enough to swallow the house. This is mishugas I so don't need.

Out came the clippers and ended was my experiment.

--Ben

Updating My Look

Shira and I are doing the classic American Holiday activity - shopping.

This time, I'm letting Shira dabble with changing my standard t-shirt, khaki shorts and jeans look that has sufficed, since, oh I don't know, elementary school.

We tried among other items corduroy shorts, and brown cargo pants. Seriously, I haven't worn corduroy since before elementary school.

All items were a flop, because...well, because they don't match my current look. How's that for circular reasoning?

Even after 9 years, Shira still has a lot of work left to do. Baby steps - at least she got me to try stuff on.

--Ben

Yet Another Mp3 Holder Hack

Here's another attempt to attach my cheapo mp3 player to my belt. This is useful to to turn my lawn mowing time into an MBA classroom. Today's topic - wisdom from great CEO's, thanks to CEO Exchange.

The hack involves 2 rubber bands and a chip-clip. The rubber bands secure the mp3 player to the chip-clip, and clip secures to my waistband.

I suppose I could buy a $5.00 case for my mp3 player - but there's just something entertaining about grabbing a handful of stuff from my kitchen to make a little contraption.

--Ben

Saturday, September 01, 2007

Mall Kiosk Surprise

Check out my new watch band. I know, not very exciting. Turns out, the interesting part of the band was the experience in buying it.

I stopped by a kiosk that sells cheap watches in the mall to pick up a new band. My expectations were set pretty low - I was going to flip through a plastic display case of bands, and settle no doubt, on an incorrectly sized women's band.

The kid selling at the counter, however, wouldn't hear of it. He took my watch and disappeared into a cabinet below the kiosk and returned with four options. He explained which ones were more casual and dressy. He ensured they fit the watch and were for the right gender. He asked me if I had the original buckle for the band, as it is a Movado watch, so the buckle has an engraved M on it (I don't, I lost the original band years ago). Finally, after taking the time to install the band he had me try it on to confirm it was The One.

Overall, I was really impressed with all this service. Here was a kid who could have blown off his lame job at the mall, but was instead treating me like I was buying a $2,000 watch, not a $20.00 band.

This kid will do well in sales, he's already figured out that you can impress customers regardless of the cost of the item, the brand or the store environment.

For the rest of us, it's a reminder that we have no excuses for not wowing our customers. (And we all have customers - bosses, peers, wives, etc.)

--Ben

Friday, August 31, 2007

Guess That Dish

I'm buying: vinegar, Worcestershire sauce, brown sugar and chili sauce.

What are we making?

The flowers role is easy - I'm trying shamelessly to impress Shira.

--Ben

Update: The answer: Sloppy Joe's. And boy was it good.

Surprise, All The Good Names Aren't Taken

Anyone who's ever tried to find a domain name for a website they want to launch has known the frustration of trying to find an available name to purchase. It sometimes seems like all the good ones are gone.

Gavin pointed me to a really impressive site that helps overcome a bad case of namers-block. Check it out: bustaname.com.

The idea is simple: give Bustname.com a few words, and it will tell you which combinations of those words are available in the form of a domain name. Bustname.com also lets you easily add synonyms and tune other options like whether it should find .com domains only, or branch out to other domains.

The site makes use of Web 2.0 style AJAX - and it does so beautifully. The interaction with the site is nothing short of remarkable. This is yet another site to review just for the UI alone, not to mention the cool service it offers.

Let's look at an example of how it might be used. Suppose I've messed up with Shira (I know, unlikely, but it occasionally happens) and I'd like to put up a website that's sort of the geek's version of buying flowers. I need a name domain name, but which one to choose? According to Bustname.com here are some options:

 veryregrettable.com
 wronghusband.com
 iamregrettable.com
 wrongiam.com
 sorrywrong.com
 wrongsorry.com

The site also offers a quick check facility for names - good news - wrong-and-sorry.com is also available.

Godaddy - you would be insane not to throw piles of money at this guy to buy his site. You'll sell way more domains if people have a really easy interface for finding them.

Hmmm, that apology website doesn't seem like such a bad idea now...

Thursday, August 30, 2007

Dinner With Lavine

Shira's out of town - but I'm not starving. Greg got me out on the town,
on a school night no less!

If all goes well, I should be seeing a lot more of Greg as he's just
moved to the area. He's thinking about settling down in Maryland, so I
have to talk him out of that decision.

Welcome Greg - enjoy the humidity and traffic, there's plenty to go
around.

--Ben

Ben's Law Of Chinese Leftovers

No matter how secure you think a takeout container of Chinese food is,
it will leak all over the other food in your lunch bag.

Corollary: If you take additional time to store said food container in
its own secure plastic bag, it will under no circumstances leak.

--Ben

Wednesday, August 29, 2007

T-Mobile Wing Sample Photo

For the record, here's a sample photo I took while playing with the T-mobile Wing.

The quality seems quite reasonable - far better than my Sidekick, but that's not saying much.

As much as I kvetch about the Wing, it does have pretty much every feature I could ever ask for. Including a nice camera - a must have for mobile blogging.

T-Mobile Redeemed, Wing Played With

Good news - T-mobile is back on my good side. I stopped by another store this evening and spent a good 20 minutes playing with a Wing. When a sales person came over, he asked me if I had any questions. I told him I was mostly just playing - to which he asked if I wanted his opinion.

Did I every! This is what he told me: the Wing is slick, but basically painful (in his opinion) to use as a phone. Windows is simply painful to use. The switch from vertical writing mode to horizontal keyboard is accompanied by a noticeable lag of a few seconds. And, if you do leave the WiFi on, it will eat through your batteries in 4 hours.

I couldn't confirm the battery comment - but the rest of the feedback I had noticed in my 20 minutes of playing.

I so wanted to like the Windows UI. But, at the end of the day, it's a desktop UI crammed into a phone - what a mistake. There do appear to be a few keyboard shortcuts, but not as many as I had hoped for.

The only surprise was that the keyboard was nicer than I thought I was going to be. I could see learning to touch type on that sucker with a minimum of effort.

The clerk's recommendation was this: wait till late September and buy the latest Blackberry due out. It will have a GPS, 2.0 MP camera and a full keyboard.

I'm not in love with the Blackberry UI, but nothing is as bad as the Windows UI. As Shira told me - you'll adapt way easier to the Blackberry over Windows.

Someone, anyone, tell me my synopsis of the Windows Mobile User Experience is all wrong. Tell me that once I learn it I'll be flying all over the UI like I do on my Sidekick.

At the very least, my faith in T-mobile is restored.

--Ben

Tuesday, August 28, 2007

Mental Auto-Complete - Need to find the off button

I spend enough time around a keyboard that I've found once I start typing a familiar word, my brain goes into a sort of auto complete mode, typing out the rest of what I normally type. It's basically a muscle memory thing - I may know the word I want to type, but my fingers might type something else.

For example, if I've been working on a schema for the last few days, and I want to type a message about scheme, I find myself constantly typing: schema <backspace> e throughout the message.

Surely this is a common brain thing right?

Boy did it nearly get me in a heap of trouble tonight.

Shira's on travel, and I was IM'ing her a good night message. I wanted to say miss you tons - but there's a problem. I work with Tonya, and send her quite a few e-mails.

So what do you think my brain auto-completed: I miss you ton... to? I came awfully close to typing tonya, but ended up instead with tonys. Whew, that was a close one.

Shira knew exactly what I did. I really need to find an off switch to this feature before I really get myself in hot water.

Postgres Tip List

Here's a really handy list of Postgres tips. It takes just a few minutes to browse through it, but has quite a few gems to offer.

Here's an example:

Ditch All Output Of Query by xinu on Jan 12, 2005 10:25 AM

If you want to run a query or a function and ditch the output, you can do something like this:

xinu=# select my_void_function() \g /dev/null

So, if you want to redirect the output of a command you can say: \g /path/to/a/file instead of the usual ;.

T-Mobile Disappointment

I just attempted to go shopping for a new cell phone. I wanted to check out the Wing. I know it's a product of the Evil Empire, but it has all the bells and whistles. Not to mention, my Sidekick lasted less than 9 hours today before running out of battery juice. I'm getting desperate and not loving Danger.

So I headed over to a T-mobile store in the Balston Mall.

I could quickly tell they had a Wing in stock. Whew, didn't waste my time getting out here.

Then I asked to handle one. You know, before I spend like $400 on a phone I'd like to use it.

The rep at the counter explained they didn't have a live one. I could play with a dummy phone. Excuse me? What about the live one secured to the counter in a Fort-Knox grade security device? He can't give me access to that one - against the rules.

I had no choice, I thanked the guy and walked away.

A cell phone is an incredibly tactile device, not to mention a complex one. How can I choose to buy one if I can't play with it? I need to feel its weight, notice the delay in the screen flip and shoot some video. What an absolutely absurd policy.

That's like going to a Toyota showroom and not being allowed to drive a Prius. Sure, you can sit in the one parked on the sales floor. But drive it? Please, that's against the rules.

It didn't help that when I asked him about the phone in general he said I needed to be more specific. Then I asked him if people had any complaints about it? Nope, not that he knew of.

This is a $400 computer we are talking about here - not a $30 cordless phone. Argh. I'm officially unimpressed with this shopping experience.

--Ben

Bow Tie Hack

About 10 minutes before we had to leave for Aaron and Michelle's wedding, I realized I had left the bow tie for my tuxedo on the floor of my bedroom. One small catch, my bedroom floor was 395 miles away from parents house, where I was getting dressed.

What to do?

I scrounged around looking for a bow tie - but had no luck. Shira's mom couldn't dig up one either. We didn't have time to stop at a store. Things were looking pretty grim.

Then I got a text message from my mom - the problem had been solved. She had one for me.

I arrived at the wedding, and sure enough, my mom handed me a black bow tie.

How did she pull this miracle off? She asked a waitress if she, or one of her fellow wait staffers had an extra. Sure enough, they did.

Brilliant! This is a hack I'm definitely going to remember. Just more proof - moms can fix anything.

Monday, August 27, 2007

Fairwell Scratch Pad - We Knew Ye Not

While Shira and I were in Rochester this weekend, the topic of the blog came up. My Mom, Dad, Brother and Shira all agree - the Scratch Pad, my Twitter feed, has to go.

Obviously, I thought it was a clever idea. I thought, hey, it'll give me yet another way to blog. Apparently, I was wrong - very wrong.

Opinions on why the Scratch Pad was so bad range from the fact that it is just noise, to the fact that it makes me look less intelligent. Ouch.

It's interesting to note, that while I've blogged about many topics, from relationship advice to Python style Generators, I've never had any opposition to any content from my family. But the Scratch Pad - yuck, useless.

The whole dislike of the twitter feed reminds me of a comment from Wired Magazine on the topic of why the Star Wars Prequels were such a bad idea:

Patton Oswalt: The prequels are like offering someone ice cream, then giving them a bag of rock salt and saying, "Eventually, you can turn this into ice cream." Star Wars is ice cream. Don't give us rock salt.

The Scratch Pad was the rock salt. Nobody cares.

Lesson learned. It's coming down in just a few minutes...

For those who enjoyed the Scratch Pad, you can still follow it on Twitter.

Aaron and Michelle's Big Adventure

Yesterday Shira and I had the pleasure of attending Aaron and Michelle's wedding. We had an awesome time - the ceremony was beautiful and it was great seeing old friends. It didn't hurt that they served two kinds of cake. Mmmm...cake.

We wish them all the best - they should continue to know the kind of joy we all shared last night. Mazel Tov!

I know it's Monday...

...because:

  • My sidekick crashed today, causing me to lose two blog entries I had written on the flight from Rochester to DC
  • The e-mail for my sidekick hasn't synced up properly after the crash because over the weekend T-mobile had a massive outage. Thousands of customers were without Internet over the weekend. I wasn't affected at all until my own crash this morning
  • For unexplained reasons we lost power at the office today for 22 minutes
  • A production MySQL reporting database crashed and wouldn't recover automatically. I ended up having to recreate the entire DB structure, and then had to restore from a mirrored image
  • The TCP/IP route to our Geo-Locator's API server is hosed and is causing ping times around 4 ~ 9 seconds, instead of less than 100 milliseconds

Luckily, I have just as many things to be thankful for.

  • While my phone crashed, my plane didn't. Heck, it wasn't even delayed
  • We left and arrived out of gates that were really close to the security checkpoint
  • Traffic from Baltimore to DC was fairly painless this morning
  • I learned about MySQL and how its databases are structured on disk
  • I discovered a routing problem with our Geo Locator API provider in about 30 seconds after looking at the problem
  • I'm still married to Shira
  • My uncle had an MRI that showed no tumor growth
  • Tomorrow is Tuesday

Anti Burn Strategy

Instead of walking back to my desk while toasting, and returning to find burnt remnants of lunch - I'm bringing my desk to the toaster.

As long as I don't melt any plastic, I should be good.

--Ben

Sidekick Nosedive

Uh, where's all my e-mail?

This morning, on my way back to DC, I was happily blogging on the airplane. I had a bunch of messages queued and ready to be sent when we landed.

As we started our descent, I popped out the SD card I had inserted to upload a few photos from. Apparently, my timing was bad because the phone locked up.

When I rebooted, the device had reset itself. Pretty much everything was gone: contacts, e-mail, etc.

The good news is that the vast majority of my settings and data are on the server. So, when the device finally syncs, things should return to normal. I'll have to recreate the posts from earlier, and I'm without e-mail till the sync is complete.

However, if all goes well, things should be back to normal soon'ish.

Annoyances like this are custom made for Mondays. Argh.

--Ben

Sunday, August 26, 2007

Hot Soup - In Summer?

Yes, it's true - I'm having hot soup for lunch, while wearing a fleece
jacket. Have I gone nuts?

Nope, I've gone to Rochester.

OK, it's not *that* cold here - it's a pleasant 76 ish degrees. Compared
to DC, though, this feels like fall. Yesterday in DC, for instance, it
had a feel like of 96 degrees at 8:00pm at night.

We're in town for under 24 hours. We are attending a friend's wedding,
and tomorrow AM it's back to DC.


--Ben

First Complete Sudoku

I just finished my first complete Sudoku puzzle, with Shira's help, of
course.

Normally, I have no interest in Sudoku, but I've found it's a wonderful
way to pass time on the plane as we taxi to and from the gate.

Usually, I get part way through the puzzle - but not this time. I so
nailed the easy one presented in the in-flight magazine.

I'm not exactly sure why Sudoku is such a hit on the plane. Obviously,
there's the practical matters. It requires no electricity and doesn't
require the same mental investment as reading or working.


However, I think there's more to it than the pragmatic reasons. When I
first started playing, I would manually scan each square looking for a
match. Now, I find myself in a near Flow like state where I'm just
scanning the page, and poof, something clicks. I then get a little
mental boost at every correct answer.

So, basically, Sudoku is a drug. The best kind of drug too, as it's
using the chemicals I already have in my body.

Mmmmm....instant gratification, feels good.

--Ben

One Productive Frosh

Another gem from my Mother-in-Law:

Armed with a soldering iron and energy drinks, a teenager who will soon be a freshman at Rochester Institute of Technology has developed a way to make the Apple iPhone available to a much wider audience.

From the Rochester Democrat & Chronicle

Let's see, as I was heading off to SUNY Buffalo for my freshman year of school, I was more concerned with picking classes, buying books and figuring out how to turn my vax username of VP24NYVM into an e-mail address (yes, that was my username - kids today have it so easy, what with their intelligible e-mail addresses and such).

Hacking the latest technology at the hardware level just wasn't on my radar.

If I were Apple, or better yet, Microsoft, I'd start wooing this kid today.

Friday, August 24, 2007

GPS Moment

I had to make an unexpected* trip to a store in Springfield, VA - a location I know really poorly - this afternoon. Luckily, I had my Garmin eTrex in the car to help get me there.

I printed out directions from Yahoo, and made sure to visit GPS Visualizer (http://gpsvisualizer.com) to get the latitude and longitude of the store's address. I then punched it into the GPS when I got to the car.

The Yahoo maps got me to the area, but it was really the Garmin that allowed me to find the place. The lat/long steered me to the very front of the store (hiding in the back corner of a shopping center).

Sure, the eTrex is as basic as it gets. But I love the fact that it sips batteries, so it's always at the ready. It's no replacement for a real car GPS that provides verbal instructions, but it makes a terrific durable backup. Its basic map gave me just the info I needed to see I was headed in the right direction.

If you don't own a GPS, it might be a fun one to try on the cheap.

----

*Unexpected in the sense that Shira only told me a few times this week and I kept forgetting about it

--Ben

Holding a Program in One's Head

Here's another great Paul Graham article, on the topic of programming:

http://www.paulgraham.com/head.html

As usual, it's more propaganda than how-to, but it's certainly a good, fun, read. If you are a programmer, you'll either love or hate his opinion. I happen to enjoy it immensely.

My big question is, how much programming does Paul do these days? I wonder if he's in danger of talking the same talk as always, even though he's not in the trenches anymore.

Hope he's still hacking lisp late into the night.

--Ben

Update: I'm not particularly in love with my quick synopsis of this article. I think it was a bit too hasty. Paul actually does layout quite a few concrete things you can and should do to write great software. I'm also a believer in the fact that a few, expert programmers, can far outdo a large group of mediocre programmers. And, naturally, I agree with this bottom up (read: lisp friendly) approach.

One point where I might depart from Paul is that it isn't an organization vs. hacker issue that keeps great software from being written, but The Dip. It's easy to blame organizations, because, well, they are often to blame. But, even in an ideal environment, a programmer needs to cope with The Dip.

Thursday, August 23, 2007

Charcoal Snack

Rule #1 of using the office toaster: don't put something in and walk away. If you do, you'll end up with charcoal.

Rule #2 of using the office toaster: don't stand around watching the toaster, it'll never heat up with you staring at it. If you break this rule, you'll end up with cold food.

I opted to break rule #1. Mmmmm....carbon. Just like Ma used to have a reputation for making.

--Ben

A New Hope

Yesterday, a battery I ordered off eBay to fix my battery woes finally arrived.

At the moment, I'm at 90% battery life from charging all night. Hmm, it's been unplugged for just a few hours - that seems kinda unimpressive, no?

Is there some sort of ritual I should be going through to condition the battery? Perhaps some voodoo or a misheberach?

For now, I'll let it full drain then fully charge it a few times.

--Ben

Out Gunned

Yesterday, as Beamer walked into my office, I decided to show him who was the real gun slinger around here. I pulled my cell from my holster.

The result, he had his out faster, and mine was on the ground in three pieces. Defeated. He even had his at the ready to snap this photo.

Beaten at my own game.

--Ben

Wednesday, August 22, 2007

Request: Chocolate out of fabric?

I have this friend, we'll call him Gen. Gen is a real slob and keeps spilling food on himself. Of late, he keeps getting bits of candy, mostly chocolate on himself and his surroundings.

How can he get the stains out?

So far, he's tried: rubbing really hard, rubbing really hard with a damp cloth, and anger. No luck so far.

Please, for Gen's sake - how can he remove these blemishes.

I, uh, I mean he, will be forever in thankful for such a solution.

--Ben

Adding Generators - A Language Comparison

Generators - Kinda like Iterators, but Not

Recently, the topic of adding Python style generators to both Java and Scheme has come up. It's interesting to compare the two approaches taken.

Before we jump into the details - what the heck is a generator anyway?

Generators are an approach to encapsulated iteration, much like a java.util.Iterator object is. Here's a trivial Python example:

from __future__ import generators

def foo():
  print 'hello'
  yield 1
  print 'world'
  yield 2

Calling foo above will return a generator back. You can then call next() on that generator (much like an Iterator in Java) to return the values that are associated with the yield statement. Think of yield as being the same as return, with the benefit that calling next() will resume there again.

Why add generators to your language, especially if it already has iterators? Generators simplify your life: rather than manually tracking which value to return next, you have the interpreter handle all the details. This is much like garbage collection - you could manage memory manually, but isn't it nice to have the interpreter do all the book keeping for you. It is.

The Approaches

Here's a description of technique to add generators to Java used by infomancers:

It works by using Java 1.5's facility for hooking user-defined class inspectors/transformers into the classloader, and rewriting the bytecode of a yieldNextCore() method containing calls to yieldReturn(foo) so that its local variables are promoted to members of an anonymous inner class, which also maintains the state of the iterator/generator.

Wow that's slick. Who would have thought to use user-defined class inspectors/transformers to re-write bytecode on the fly? here's a sample of how to use it:

public class PredicateIterable
    implements Iterable {
  private final Collection coll;
  private final Predicate pred;

  public PredicateIterable(Collection coll,
      Predicate pred) {
    this.coll = coll;
    this.pred = pred;
  }

  public Iterator iterator() {
    return new Yielder() {
      public void yieldNextCore() {
        for (Object nextItem : coll) {
          if (pred.evaluate(nextItem)) {
            yieldReturn(nextItem);
          }}}}}}

The Scheme approach was written iteratively, starting off by using the primitive call/cc operator and finishing up by using control.ssand a syntax tweaking macro. Here's the final implementation:

(require (lib "control.ss"))

(define-syntax (define/y stx)
  (syntax-case stx ()
    [(_ (name arg ...) body ...)
     (with-syntax 
         ((yield-name (datum->syntax-object stx 'yield)))
       (syntax
        (define (name arg ...)
          (define (yield-name x)
            (control resume-here
             (set! name 
                   (lambda ()
                     (prompt (resume-here 'dummy))))
             x))
          (prompt body ...))))]))

Here's a sample Scheme usage

(define/y (step) 
  (display "hello\n")
  (yield 1)
  (display "world\n")
  (yield 2)
  'finished)

Lessons Learned

Here's the lessons I took away from this...

In Java, where there's a will, there's a way. It's pretty dang impressive that Java allows you to re-write bytecode on the fly. It may be a relatively crude way to extend the language, but it works.

In Scheme, mere mortals can add experimental concepts to the language. In about the same space it takes to describe the Java solution in English, you can actually write it in Scheme. The implementation doesn't require any low level hacking - just understanding a particular library of control operators, or, if you prefer the basics of how call/cc works. This lowers the bar for adding new language constructs and means that you can bend the language to your project's needs, instead of the other way around.

Scheme's macros allow you to make the new concept blend seamlessly with the language. Comparing the Python and Scheme samples, there isn't a whole lot of difference. Not only can you add new concepts to your language, but you can make them convenient for the programmers who will be using them. Again, the language bends to project, not vice versa.

What concept do you wish your programming language had? Have you tried adding it in 20 lines of Scheme code?

Tuesday, August 21, 2007

Beamer The Cowboy

Beamer's got a new phone - but more importantly, he's got a new hip holster.

He demonstrated his quick draw skills. He's good, and has obviously been practicing in front a mirror.

Surely, he will now be irresistible to the ladies. I stand in awe and will have to do some practicing later tonight myself.

--Ben

Monday, August 20, 2007

Romance Tip Of The Day

Try this with your significant other...

  1. Visit rot13.com
  2. Type in some cute or lovey messages. Maybe something from O'l Willy.
  3. Hit the Cypher button
  4. Send the encrypted text and the link to website to your significant other via e-mail or IM
  5. Sit back and wait for the points to roll in

I'm not exactly sure why the above is a good idea (I think it has to do with both showing effort and a bit of mystery), but I'm pretty sure it should work. If it doesn't, there's always plan B.

Here's a sample:

Fuven,

Lbh ner zl gehr ybir. V'z fbeel gung V'z fhpu n cnva va gur ohgg naq gung V fcraq fb zhpu gvzr oybttvat.

Yvsr jvgubhg lbh vf n yvxr n freire jvgubhg ENZ.

Depending on the fallout from this post, this may very well be my one and only Romatic Tip Of The Day post...ever

Cell phone holder hack

Here's the Cell phone holder I just ran with. Two rubber bands to keep my mini cell phone stuck to my hand. Considering it's all I had on short notice, I'm happy with the solution.

Deep Thought Of The Day

Be prepared to appreciate what you meet
-Fremen saying

From Dune.

Here's an entire list of quotes from the book - many of them quite cool. It's like reading a novel with chunks of Pirkei Avot dropped in between the chapters.

Sunday, August 19, 2007

Sailing Adventure: Skipper Shira

I give you Captain Shira at the wheel. And first mate Jenna dozing.

Shira runs a tight ship. She's yet to make me walk the plank, but we aren't docked yet.

--Ben

Sailing Adventure: Getting our sail on

Having a great time on Dave's boat as we cruise around The Bay.

I'm happy to report that to date Shira has not gotten sea sick. She's been a total trooper. It's even been a bit choppy and she's holding up.

Justin and I helped out Dave with tacking, and Jenna and Shira were spotters.

This whole sailing thing is quite relaxing - throw in a few beers and some Jimmy Buffet music and I could get used to this.

--Ben