Thursday, July 24, 2008

My favorite store in Tombstone AZ

Sent via BlackBerry from T-Mobile

Feeling Like A 10 Year Old

So, one of my clients is having me write some software that's in the first responder industry - specifically, firefighting. Turns out, we have a major Fire Expo going on in Baltimore this week. So, because he couldn't make it, I decided I'd head up and scope out the competition.

I paid my $15.00 to get into the expo area, and was off and running.

Now, the last big show I was at was JavaOne quite a number of years ago. While times have probably changed, I'd still bet that you don't want to get into a my expo show is better than your expo show argument with a firefighter. At JavaOne they had fancy editors. At the Fire Expo, they had fire trucks. JavaOne, cell phone apps, Fire Expo, the Jaws of Life. I truly felt like I was a 10 year old, wondering around looking at all this fun stuff. If I had actually been a 10 year old, I probably would have gotten away with climbing on the trucks and trying on all the gear. But alas, I stuck to talking to the software vendors instead.

Here's a tip for all you parents - next time a fire show comes to town, drag the little ones to the expo and let them have a field day.

Lawn Surprise

It hits me yesterday that my new lawn guy, Ben hasn't called me or showed up to mow my lawn. He had promised that he'd get to it in two days, and this was the second day.

Then I started thinking that it had rained the day before, so perhaps his schedule was thrown off. Either way, I'd note the fact that he didn't do it on time, but I'd not worry about it for another couple days.

This morning, at 7:00am, I step outside and do a double take - holy crap, my lawn looks awesome. It's cut, trimmed and looking great. I then check in back, that's done too, and looking great. This camera phone image doesn't do his work justice:

I'm amazed - it just got done, no fuss, no need for me even to be involved. I assume I'll get an invoice and pay the guy at some point.

I was mentioning in my last post how Ben did some things that really impressed me - I'd say quietly exceeding my expectations should be added to that list.

Gotcha Of The Day - Skype Steals Port 80

This morning, I went to test some changes I've made to a customer's web app locally, and was greeted with a totally blank screen. I undid my changes. Still nothing. I tried another browser. Still blank. I then checked the Apache access log, sure enough, the web requests weren't reaching it.

I then remembered that I had this problem a few weeks ago, fixed it, but never documented it. Turns out, Skype will grab port 80 and use it for its own purposes. This meant that Apache couldn't start up. The issue is explained here:

To get port 80 back for your Webserver, either start the server before Skype, or more efficient, disable use of Port 80 by Skype in Skype's connection options! (Same checkbox applies for port 443)

Sure enough, in Skype, you can select:

I'm sure the good people at Skype have an important reason for stealing port 80, but still, I think that takes serious chutzpah to grab a port you have no business running on.

I wish I could recall how I figured out Skype was the culprit. I probably used the networking sysinternals tools to debug it. But I don't recall which tool I used.

Wednesday, July 23, 2008

Phillips Keychain Camera - Worst. Camera. Ever.

I've seen the Phillips Keychain camera at stores like Wal-Mart and CSV before, and its usually dirty cheap - something like $10.00 - and I'm always tempted to pick one up. Well, turns out I didn't have to. Today on his way out to work, David, handed me the camera and cable and muttered some story about how it doesn't work with Mac. Sweet, his loss, my gain.

David paid something like $2.00 for the camera, and I can I tell you that was still too much. This thing is an absolute disaster. Let's talk about the pros and cons. First, the cons:

  • No real viewfinder, the fake viewfinder appears to have no bearing whatsoever on the actual picture being taken
  • The device loses your pictures when the batter dies
  • The device doesn't work out of the box with XP, Mac or Vista
  • The menu system couldn't be any more cryptic if they tried
  • The image quality is in the gutter
  • The camera generates .bmp files instead of fancy shmancy .jpg's
  • The only way to get images off the device is through some random little app which appears to be from the late 1990's
  • The software/hardware managed to cause blue screens of death on both my Vista and XP laptops. The XP laptop needed to be reverted back to a previous date to get it to stop rebooting randomly
  • There's no way to selectively remove photos from the camera - it's either all photos removed, or the last one

Now the the pros:

  • It comes with a nice USB cable

Does this mean that I won't play around with the camera and waste my time trying to find a use for it? Of course not! Free hardware? How can I turn that down. If you're like me and want to dabble with this sucker, here's a few tips I've picked up:.

Installation

Like I mentioned above, installation was a disaster on both XP and Vista. I did finally get the camera to work on Vista. I did a couple of things. First, I followed the instructions here to actually find drivers. I got them from Phillips. When installed the drivers, I got a little app on my desktop named MY CAMERA. Clicking on this brought up an app that said that it couldn't connect to the camera.

I then started dabbling with the drivers. Essentially, I uninstalled (and checked the delete driver software check box) all the drivers that were discovered by Vista, until I had the following showing in my Device Manager:

I had big problems with my laptop crashing when I opened up MY CAMERA, and these problems went away once I removed all the drivers but the one shown above.

Using the Camera

There isn't a whole to know about using the camera. Check out this review of the camera which includes some interesting discussion. Someone even decoded the 2 letter abbreviations that are the UI:

SE = self timer
CE = Continuous shooting mode
CP = compress mode
nP: non compress mode
AI: video function mode
OF: switch the camera to stand by mode
CL: delete the last photo
CA: delete all
Hr: high resolution format
Lr: low resolution format
F5: 50Hz
F6: 60 Hz

Amazingly, while this thing has all these detractors, I can confirm that it has a self-timer. I guess I should put that in the Pros above.

Apparently, to use the above features, you press the button on the front of the camera to choose the two letter code above, and then press the shutter button to cause it to take effect.

Here are some samples of what the camera can do. Finally, I can blame the hardware for my poor photography instead of my skills. Note, that last photo hasn't been processed with some funky filter - that's just how the photos come out.

Do I see any practical use for this? Well, you might think it'd be nice for kids - but it's way too much hassle for such poor results. Buy your kid a used 4 mega pixel camera off eBay for dirt cheap, not this junk. About the only thing I could see this being useful would be for some kind of photography game - everyone gets a crappy camera, the person who produces the best photo wins.

Hmmmm, crappycam.com and crappycamolympics.com are both available. I'd just need to write up some rules to the game, and toss them up. Then allow folks to upload their work, and ... (Must resist urge to start building the website).

Other than that, and wacky art projects, I think this is pretty much useless.

How To: Converting a Microsoft Word Doc to PDF

This may be common knowledge for y'all, but I had to explain to someone non-technical today how to convert a Word Doc to a PDF and it actually seemed a bit tricky to me. Here's what you do:

  • Header over to Adobe and either buy Adobe Acrobat or do 30 day trial. In this case, Adobe Acrobat isn't the same thing as Adobe Reader, which is free.
  • Download and install Adobe Acrobat
  • Bring up your document in Microsoft Word
  • Now here's the somewhat tricky part, go to File » Print. Ignore for a second that you don't actually want to print the file, but instead want to turn it into a PDF.
  • Select the printer named Adobe PDF:
  • Click OK to print your document
  • Adobe Acrobat will kick in at this point and may ask you some questions, like where you want to save the PDF file
  • And you're done!

Happy PDF'ing!

Add a text overlay in Windows Movie Maker

Today I shot a video for i2x (it's awaiting approval by our CFO, so I can't share it yet) and wanted to add our website address on top of the video of me yammering away.

It took me longer than I expected to figure out how to do this. Here's what I did:

  1. Went to Tools » Titles and Credits...
  2. Clicked on Title on the selected clip
  3. Entered my web address
  4. Clicked on Change the title animation
  5. Selected Subtitle
  6. Clicked Add Title

This added a clip to the Title Overlay section of the timeline, which I could then drag around.

While, for the most part, I'm enjoying MS Vista, I have to say the Help functionality leaves a bit to be desired. In MS Movie Maker, I clicked on Help and then searched for title overlay. Here's what I got:

I got such gems as Working with windows, Using your keyboard and Rename a network connection. Not exactly what I had in mind when I was looking for help on making a movie.

Video Tip: Try Posting On Vimeo

My first video experience reminded me just how poorly YouTube videos can look. What seemed fine on my desktop was turned into a poor sounding, blocky mess.

A while back, Shaun, from UpstateInteractive.com gave me some great advice - for posting videos on the web, check out vimeo.com. He claimed they post in higher quality.

Today, I gave it a try, and sure enough, the video quality is much improved. From Window Movie Maker, I said to Publish the movie for playing on my computer, which produced a 45 meg file. Vimeo was happy to upload a file of that size. I'd share the video with y'all, but it hasn't been approved by the editorial team (translation: Shira won't let me till she blesses it). When it's available, you know it will be online.

Vimeo is also an excellent example of a site that is incredibly polished. Uploading and processing video, in Net terms, is extremely slow. They made the process as smooth as possible by:

  • Starting the upload as soon as I filled in the file input box
  • The upload progress meter gave me constant feedback
  • While the file was uploading, I was encouraged to fill out details about my video, including changing pages
  • When the video was uploaded (all 45 meg worth), they told me how long it was going to take to process it
  • Whenever I viewed the video page, I'd get an update saying how long I had to wait before the video was processed
  • Finally, when the video was there, the page refreshed to showed it to me

If you're doing any sort of web app that needs to do time consuming operations, check these guys out.

Thanks for the tip Shaun!

Monday, July 21, 2008

Ray is out, Ben is in - More Lawn Care Adventures

It pains me to write this, but I have to - it's official, Ray, my lawn guy has been fired. Well, he actually fired himself. He was doing fantastic, and then just disappeared. I e-mailed, called and left voice mail, and yet, I've heard nothing back from him.

I don't actually know what happened - so it's quite possible that he has a good excuse for dropping off the face of planet. Personally, if he could give me a reasonable explanation as to why he vanished, I'd do business with him in the future.

OK, so Ray is gone - but today, I found his replacement, Ben (e-mail: handyben@yahoo.com, phone: 202-413-9292). While, I don't know anything about how well he cuts lawns, I am impressed with a few things he's done well so far. Including:

  • A highly geographically centric craiglist ad. I called him because he mentioned Arlington in the title (which was: $20.00 Lawn Care most yards in Arlington). By narrowing his focus, he caught my eye as being unique and standing out in the crowd.
  • When I called him, he was cheerful and upbeat and made it clear he was glad to have my business. There was just something nice about talking to someone who was genuinely glad you were calling them.
  • He promised he would be over in a few hours to give me an estimate, and most importantly, he was. This is key - before I had a chance to find someone else, or have second thoughts, he was over here following up and giving me more attention.
  • He was personable and made it clear that he could do more handy man services than just mowing the grass if I was interested (he could smell the I'm a programmer, I don't do hardware on me, no doubt). This came across less as an upsell, and more as a hey, I really hope to earn your business type of statement.

So, while I'm disappointed that Ray went away, and I sincerely hope that he's OK - I'm glad to have met Ben. As I told him today, my business has more in common with the work he does than most other businesses. So, I'm always on the lookout to learn from others.

Stay tuned for an update as to whether or not he can actually cut the grass...

Video Review: The Flip Video Ultra Series

What a shame it would be to write up a review of a video camera using old fashion text. So here it is, a video review of my latest gadget - the Ultra Series Flip Video Camera.

Thanks to my Mother-in-Law for buying me this camera, and giving me a handy tool, which provides me with new and exciting ways to embarrass myself in front of perfect strangers!

Sunday, July 20, 2008

Go Away Day: Gettysburg

Today, Shira, Dave and I ignored all the responsible things we were supposed to do around the house (weeding, mowing, etc.) and had a Go Away Day. We jumped into the car and headed to Gettysburg for the day.

Dave and I both have fun memories of visiting Gettysburg as Boy Scouts. But that was years ago. Those fond memories, plus driving by Gettysburg on our way to Rochester and always saying we are going to stop, were enough of a reason to put it on our list of places to visit. So, today we just did it. It was a relatively short hour and a half trip from D.C., so it's really not even that far.

The Gettysburg park is big, and you've got a variety of options for seeing it. We ended up purchasing a $20 CD audio car tour, and following along with it. I was especially happy with this solution, as it allowed us to stop half way through without feeling as though we lost out. We'll simply go back next time we have friends or family in town (or are in need of another go away day), and finish it up.

As for the Gettysburg Battlefield park itself - it's just outstanding. A must see. Every American has a responsibility to see this reminder that not that along ago, this country nearly split in half. You think we've got issues now, they pale in comparison to us slaughtering each other.

The park is really a history buff's paradise. Not only does it contain plenty of monuments, it also contains plaques and rangers who want to give you the details of the battle. The sequence of events is remarkable - there are occasions where a few minutes one way or another, and we would need a passport to make it back to Virginia today.

After visiting our country's most bloody battlefield, what is one to do? Visit the outlets near by, of course. Duh. It's the American way.

What a fun day, and a wonderful site.

On Being Disabled

Today, at shul, we had a visitor praying with us who was blind. She was making use of a remarkable mechanical device that appeared to be generated one line of braille for her to read at a time.

As she zipped along, I just had to think: here's a woman who can read using just her finger tips - now, which of us exactly is the less able one here?

Friday, July 18, 2008

Making Firefox A Little Bit Like IE

Sure, we love to complain about Internet Explorer. However, one feature that it offers that I like is that you can have tabs open up beside the current tab you're viewing. This way, tabs of the same topic tend to cluster together. Not to mention, you don't have open up a new tab, and then hit Control-Tab half a dozen times to view it (for the record: at this moment I have 16 tabs open).

If you can't beat 'em, join 'em. That's what I did when I installed the Tabs Open Relative add-on. Now Firefox opens up tabs just the way I've grown to like.

Hosting A Micro Baby Shower

Today, at lunch, we hosted a micro baby shower for Erin and Ryan. It was basically a yummy lunch, and a chance for us to give them some additional essentials they'll need for the baby. Like a nice copy of Good Night Moon, and Butt Paste.*

Erin's big pregnancy adventure is just about 1 month from ending. And then the real fun begins! We're so excited for you guys.

I'm a guy, so I'm not supposed to do things like baby showers - but I have to say, this one was a lot of fun.

*I have been waiting my entire blogging career to mention Butt Paste on my blog, and I finally did it!

Thursday, July 17, 2008

Even More Fun In The Sun

It's that time of year again - Shira's yearly company picnic. Kosher hots, volleyball, tossing the football around, hanging out with great folks and of course, avoiding a regular day of work - what could be more fun?

Here are a few snapshots from the occasion...

Here's me, trying to setup the old volleyball net. It required a specific clincher knot - but I made do with the clove hitch of my Boy Scout days

I played on a team of mostly significant others of Shira's co-workers (we were collectively known as "the husbands") and believe it or not, we came in first place in the volleyball tournament. Tons of fun, and better than being in the dunk tank!

Shira, surrounded by picnic food. Classic, right?

Forget facials and cucumber slices on the eyes - from now on, it's the ball treatment. Just imagine how relaxed you'll be covered head to toe in colorful plastic balls? Coming soon to an Elizabeth Arden Spa near you.

I know, not our usual pose, but still, kinda cute. This snapshot is impressive when you consider it was taken by a 3 1/2 year old!

Wednesday, July 16, 2008

Review: Making Comics

I borrowed Scott Mccloud's Making Comics for a variety of reasons: a stellar review on CoolTools, my general interest in drawing, my hopes that lessons learned from it could be applicable to programming, and Just Because. I was handsomely rewarded for taking this chance - the book was fantastic, and absolute gem.

The book gave me an incredible appreciate for comics themselves. I hadn't really ever thought about it - but it's absolutely remarkable that comics even work. In a movie, you've got thousands of frames of pictures, so telling a story seems quite possible. In a book, you've got thousands of words, so again, it's no surprise that you can tell a story there either. Now consider a comic - it has just a handful of frames, and a handful of words. Yet, it works. Not only that, but it can work exceedingly well.

Consider that just using a $2.00 black pen and a sheet of paper, it's possible to not only tell a story - but to get people to hear sounds, smell odors, and feel motion. McCloud couldn't have sold me on the story telling capability of comics any more if he had tried.

He actually got me thinking - if the beauty and power of comics can be expressed so clearly (in comics, no less!), then where's the equivalent text on poetry, opera and other forms of story telling? Think how remarkable it would be if you had a book on poetry, written in poetic form, that could spread this same message? Perhaps a book on programming written as a program? Hmmm, that seems to be going a bit too far. But still, something to consider.

As for lessons I'll take away from this besides the obvious ones - I think I'll be on the lookout for how some of these techniques can be applied to user interfaces. Perhaps mixing text and graphics can be a clearer way to get an interface across than one or the other. And his parting set of rules are definitely words every programming should live by:

  1. Learn from everyone
  2. Follow no one
  3. Watch for patterns
  4. Work like hell

I give this book a 10/10. It's a quick, informative read. If you do comics, you'll want to learn everything this book has to teach you. If you're like me, and don't do comics, then you'll get a rare glimpse into an impressive art.

Gotcha Of The Day - Setting The HTML Name Attribute Dynamically

I've now been bitten by this one twice: First, I created an iframe dynamically (by using JavaScript and the DOM) and for some reason, it wasn't submitting to the right target. And then last night, a set of radio buttons I created using the JavaScript DOM didn't work in IE. They rendered, but when you clicked on them, nothing happened.

I was doing something like:

  var r = document.createElement("input");
  r.setAttribute("name", "RadioButtonGroupName");
  r.setAttribute("type", "radio");
  r.setAttribute("value", "Whoo!");
  ...

It turns out, for IE, setting the name attribute dynamically isn't possible. At least not through obvious means. Instead, you have to do:

  var r = null;
  try {
     // For IE
     r = document.createElement("<input name='" + name + "'>");
  } catch(ex) {
     // For browsers that work
     r = document.createElement("input");
     r.setAttribute("name", name);
  }
  r.setAttribute("type", "radio");
  r.setAttribute("value", "Whoo!");

I know, how ugly is that? But, at least there's a work around that lets you stay in the world of DOM without hard coding things too badly.

More Online Whiteboard Tools

Here are some more whiteboard resources to go with the list I started earlier:

Did I miss any?

Update: Added in dabbleboard.com to the list of known services.

Monday, July 14, 2008

A Hydrox Moment

Thanks to Jerrie, for bringing this important story to my attention:

Remember Hydrox? AKA "kosher Oreos?" Well, after a long hiatus, these chocolate sandwich cookies are back for a limited time in honor of their 100th anniversary. The Kellogg Company, which produces Hydrox, have launched an "America's biggest Hydrox fans" essay contest, with a grand prize of a trip to New York and a six-month supply of cookies. The contest ends July 14; see Hydroxcookies.com for details.

Ahhh, Hydrox. I definitely remember them for being a substitute for, at the time, lard containing Oreos. I can even remember Rabbi Rose, announcing from the Bimah during a sermon that we should all take note -- Oreo had gone Kosher!

I get a bit verklempt just thinking about it.

Thanks for the news Jerrie!

That 70's Photo

This photo was included in a memorial slide show from this last weekend. I knew, the minute I saw it, it was a must-post-instant-classic.

From left to right: My grandpa, Me, Cousin Rachel, My Aunt, Cousin Lizzy, David, Josh, Mom and Dad.

If I had to describe myself in that photo, I'd say I was all teeth and socks. Austin Powers has nothing on me. Damn, I looked good.

Special thanks to Ralph for compiling the slideshow - it was beautifully done.

Sunday, July 13, 2008

The safety pin saves the day

People ask me why there's a safety pin in my wallet? For just these sorts of "emergencies." In this case, my sleep mask broke as we were preparing to take off. I didn't have any duct tape around to fix the problem, but I had my trusty safety pin.

While no life was at stake, the ability to get as good sleep as possible on the flight was pretty key - especially considering we left for the airport at 3:45am.

With my sleep mask repaired, a recording of about an hour of Groove Salad and my noise canceling headphones , I did well. I was asleep before the safety briefing and woke up when the plane landed.

--Ben

USAirways - is this efficiency I see?

All I have to do to sign up for the Dividend Airlines Club is send my name, e-mail and zip to an SMS number.

Is this actually efficiency? How cool. And how impressive.

Now, how come they can't make the rest of flying efficient?

SMS - fast, universal and technology my mom can master. It's a winner. I'll definitely be keeping an eye out for creative ways to use it.

--Ben

A Fitting Gift, Just For Me

Front of box: To Ben Simon, From CVS

Back of box: Special Delivery... A Fitting Gift, Just For You

Inside: Kotex Security Tampons, Kotex Ultra Thin Pad With Wings and Kotext Lightdays Individually Wrapped Liner.

Now, I know what your thinking - CVS messed up and sent a guy feminine hygiene products.

You couldn't be more wrong.

CVS sent a husband a FREE Get-out-of-going-to-the-store-to-buy-feminine-hygiene-products kit.

Thanks CVS, you're a life saver!

--Ben

Meet Jersey, The Wonder Dog

This weekend we had Jersey, my cousin Barbara's dog, keep us company. Jersey, I have to admit - and I don't this often, if ever, with dogs - she is both cute, and fun to have around. If I ever have a dog, and I won't, it's this sort of pooch I'd have.

The most entertaining part, though, was when we took a dip in the pool. My mom was doing laps, and Jersey was convinced that she was in trouble. To save the day, Jersey would chase along the side of the pool as she swam, and then leap in with all the zeal of a Baywatch Lifeguard, in to save her. She then doggy paddled around, and eventually made it to the steps. She would let herself out of the pool, and then repeat whole process with as much urgency as the time before.

I was in the water, and had a hard time keeping up with her.

She was a welcome distraction to a difficult weekend.

(Photo by Brother David)

--Ben

Friday, July 11, 2008

Laid To Rest

Here's a snapshot of the beautiful memorial park we laid my aunt to rest at.

She will be sorely missed by myself and countless others. The lessons of love, and devotion to family she taught us through her life are ones that I will carry with me for a lifetime.

May her memory always be a blessing.

--Ben

Coming Soon? Eventually? To a book store near you

If you're ever in a book store, and see a book of poetry by an Arlington
taxi driver named Tim, I believe we met him this morning. On our 8
minute drive to the airport, he asked us if we wanted to hear some
poetry. Natch, we said yes. He then asked us for a topic. I mentioned
travel. He then rattled off a poem that consisted of 26 words, from
"Airport" to "Zeinith," and hitting every letter inbetween, in order.

I have to say, I was impressed. I only got slightly nervous as he
pulled out his bound book of poetry to show us his work, while he was
driving.

I almost wished we had a longer ride to learn more about this guy. And
more importantly, for me to explain that using Blogger he could be a
published author *today*, with an audiance of millions. Heck, he could
even publish the poetry over SMS - though I'd hoped he wouldn't do it
while driving.


--Ben

David's Travel Mojo Strikes Again

We get to the airport at like 4:45am, and I'm like "Dave, we are doing
so well - look, our plane is here, waiting for us."

And Dave says - "well, once my flight was delayed because the plane was
here, but a member of the crew was didn't show."

And what happened this morning? Exactly this.

A flight attendent on our original flight, and our fallback flight were
both 30+ minutes late.

The in-person customer service has been good. The phone customer service
was abysmal. The phone rep, who I called to reschedule while in line,
tried to explain to me that he couldn't switch my airline because the
flight was *delayed* not canceled. Even though from my perspective a
delay or a cancel was going to hose my travel schedule the same way.

The good news out of all this is that we got a direct flight to Chicago
instead of one with a stop over. And we still got an exit row. So, at
the end of the day, all appears to be OK.

That's my travel mojo mixing with David's.

--Ben

Heading To Chicago

Dave and I are off for a quick trip to Chicago. Unfortunately, it's not for the best of reasons - we are heading there to bury our Aunt. She just passed away after a long fight with cancer.

My Aunt was so warm, and so loving. From long ago recollections of trips to California, to recent talks we had on the phone. She always made it clear how important family was, and how much she loved and supported us. And she was a fighter. She kept her spirits up through an impossible roller coaster of diagnoses. She set an example that I hope to learn and emulate.

And then there are my cousins - who have now lost both their mom and dad. There are simply no words, no logic, nothing I can think of to make this even slightly right. I'll be there to give them my love, support and a big old hug. But even that seems like nothing, given their grief.

I'm traveling with David, which has thrown off my usual travel mojo. The good news is that I got the closest gate in the airport, instead of the farthest like usual. That's apparently Dave's thing. But, he also explained to me he's always late, and we are now all but insured to miss our 30 minute layover in Philly. Oh good.

As long as we get there, that's all that matters, I suppose.

--Ben

Thursday, July 10, 2008

Snippit Of The Day: MySQL SELECT INTO OUTFILE ...

Here's a handy code snippit from the MySQL manual. Use it to convert an arbitrary SELECT statement into a .csv file:

SELECT * INTO OUTFILE 'c:/temp/dump.csv'
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
  FROM <some-table>
  WHERE <some-where-clause>

I always forget how easy MySQL and PostgreSQL make it to get CSV data from a SELECT statement.

PHP: Dealing With Premature Session Endage

I deployed a new app to a production server, and all was working great. Except, I noticed that after about 2 minutes of inactive, I'd be logged off. I've run into this before - PHP sessions ending prematurely, and it's always a pain to debug. Mostly, because it shouldn't be a pain to debug (there's really only one setting, and it should just work, right? Here's how I debugged the issue last night:

  • Put a page in place with a call to <?php phpinfo(); ?> in it. This was useful to confirm that session.gc_maxlifetime wasn't set to an absurdly small value.
  • Put the following test page in place:
    <?php
    session_start();
    
    echo "<pre>";
    echo "Session Save Path: " . session_save_path() . "\n\n";
    
    if(!g($_SESSION, 'x')) {
      echo "'x' not set....\n\n";
      $_SESSION['x'] = 'Hello World';
    } else {
      echo "'x' was found\n\n";
    }
    var_dump($_REQUEST);
    echo "</pre>";
    
    phpinfo();
    ?>
    I could <?php
    session_start();
    
    echo "<pre>";
    echo "Session Save Path: " . session_save_path() . "\n\n";
    
    if(!g($_SESSION, 'x')) {
      echo "'x' not set....\n\n";
      $_SESSION['x'] = 'Hello World';
    } else {
      echo "'x' was found\n\n";
    }
    var_dump($_REQUEST);
    echo "</pre>";
    
    phpinfo();
    ?>
    
    The first time you visit the page you'll be greeted with 'x' is not set. Hit reload again and it will say 'x' was found. I could then wait a few minutes and hit reload again - if it said 'x' is not set I know my session expired. This allowed me to test my environment without any of the complexity of the application getting in the way.
  • Put a large value for session.gc_maxlifetime in the .htaccess file:
    # Set how long sessions should stay valid: 1hr = 60sec * 60min = 3600sec
    php_value session.gc_maxlifetime 3600
    
    I visited my phpinfo() page to confirm that the setting took.

At this point, I was really scratching my head -- the sessions were set to expire in an hour, yet there were gone after two minutes. And while there are plenty of config values for sessions, none seemed to make the difference between sessions living and dying in that short a time.

Then I found this article which not only suggested setting session.max_gclifetime but also session.save_path. So, my debugging continued:

  • Connected to my server's cpanel, and using the file manager, created /home/<my-home-dir>/php_sessions/
  • Updated my .htaccess file to read:
    # Set how long sessions should stay valid: 1hr = 60sec * 60min = 3600sec
    php_value session.gc_maxlifetime 3600
    # Where to stash session data
    php_value session.save_path "/home/<my-username>/php_sessions"
    
  • Visited the phpinfo(); file page and confirmed that my setting took. I also visited my session test page and confirmed that a file was created in php_sessions.
  • Sure enough, after 15 minutes, the file was there and my session was still valid.

Problem solved - whoo!

If I had to guess what was going on, I'd suggest that on this shared server, someone or something was was deleting files out of the shared session folder on a very regular basis. Creating my own session.save_path bought me two key benefits: (1) those files didn't get deleted and (2) I could now closely inspect the creation and deletion of sessions, even downloading the session files and inspecting them manually.

Usually, php sessions Just Work - but it's nice to know that when things don't, there's a reasonably easy way to debug what's going on.

Ira Glass On Mastering Your Craft

Here's a wonderful clip I found on crooksandliars.com (it's not political, at all), where Ira Glass of This American Life talks about mastering the art of story telling.

It's sort of a Pep Talk + Discussion Of The Dip, and I have to say, it makes a heck of a lot of sense. His theory on one's ability, versus one's taste, rings true just as much for programmers as it does for others in the creative world.

Give it a watch:

Wednesday, July 09, 2008

Instant Online Collaboration - Skrbl

Tonight, I wanted to explain a design concept - but wasn't quite able to do it over the phone. A quick Google search, and I found skrbl.com. It's an online whiteboard that you can use without even registering. Just click here:

skrbl now

Sharing the whiteboard with someone else is as easy as IM'ing/E-mailing them the URL of your diagram. For example, consider this example, which you're encouraged to play with.

I have this sensation that Skrbl is a well known app, and I've just been out of the loop. But I have to say, this could be exactly what I'm looking for when it comes to running phone meetings. It's faster and more convenient that sharing my desktop, but still let's me get visual with folks on the phone.

Update: GE's white boarding app is also very slick. It's cleaner than skrbl and seems just as powerful. It's just lacking one thing - the ability to collaborate on a drawing in real time. Oh well. That feature's just too cool.

Life's Big Decisions

Mmmm....so much beer, so little time.

--Ben

Tuesday, July 08, 2008

Talkinator - Lightweight, Multi Site, Chat

Here's interesting concept from the folks who bring us Mailinator. While Mailinator provides you with a lightweight, disposable e-mail address, Talkinator gives you a lightweight, disposable, online chat session.

For example, if you type into the box below, you'll effectively be communicating with everyone else reading this same page. Go ahead and give it a try.

Even more fun is that you can drop the code for this chat box onto other pages, and by using the same chatroom name, they are automatically linked up. Go ahead and try it, the name of the box below is: chatsy. Grab the code here.

How is this a useful tool? I have no idea. But, it does seem like it could be handy.

If you're on the lookout for chat tools, you might also want to check out ChatInterpreter.com. It's a lightweight, translating (as in you type English, and French shows up on the other side), chat tool I built for an i2x customer.

10 Steps To Succeeding In Business

Here's a nice and concise guide to succeeding in business.

Ignore the fact that it relates to lemonade stands - that's a minor technicality.

Consider this excerpt that explains how subsidies work:

Sometimes somebody else nearby will be able to sell the same quality lemonade at a lower price than you can, even if you try to cut the cost of supplies. This may be because their parents are paying for everything and don’t care whether the stand actually makes enough money to pay for the supplies. In the business world, this is called a "subsidy," and if your parents don’t also "subsidize" you, you can’t compete. It’s not fair to you, but if you can’t match the price and you can’t find another good reason for customers to buy from you, you may not be able to stay in business. However, you can try to sell different products such as other drinks and food, as stated in one of the steps.

I'm so going to use this as an outline during my next business/product analysis meeting.

Monday, July 07, 2008

Map Survey: Where Did You See The July 4th 2008 Fireworks?

I'm a little late with this post - but still, I'm curious if folks wouldn't mind sharing where they saw this last 4th of July's fireworks and how they were?

Click here to get started. When the map comes up, click Edit. Fiddle with it.

Don't forget to include a few comments about the view of the fireworks from that spot.

Yes, everyone on the planet can edit this map - but c'mon, we're all adults here. I trust you won't mess it for others.

Let me know if you have any questions via the comments of this post.

Garmin Geko Tips

I've really been enjoying my Garmin Geko. It's lightweight, reliable and sips battery juice. Here are a few tips that I've found helpful while using it these last few weeks. Some of these aren't so much Geko tips as they are GPS tips in general.

  • Get the first satellite lock of the day -- My biggest concern with the Garmin Geko was how quickly it would get a satellite lock and how reliably it would hold on to it. I learned from our last trip that if you give the device plenty of clear sky, and plenty of time, to get a lock first thing during the day, you'll be fine the rest of the day. Even in the narrow alleyways of Barcelona or Rome, the satellite lock held just fine. But it definitely needed a clear view to get that initial lock.
  • Don't forget about the measure distance feature -- The Geko is pretty much the same software as the eTrex with one handy difference. The Geko, from the map screen, allows you to measure distances between waypoints or your current location and waypoints. It'll even predict when you'll arrive at a waypoint. This was really handy to make sure we could make it back to the boat on time.
  • Gather latitude and longitude points directly from maps.google.com -- This a great hack from the folks at LifeHacker. What you do is setup right mouse click on any area of the Google Map and select Center map here. Then enter the following into the address bar:
    javascript:void(prompt('',gApplication.getMap().getCenter()));
    
    You can manually enter these coordinates in your Garmin, or as you see below, push them over in bulk. While not the fastest way to get waypoint data, it is nice to know that any Internet Cafe can provide you with waypoint data.
  • Use GPS Babel to quickly push waypoints to your Geko -- You can use GPSBabel to easily download waypoints from the Geko. It turns out, you can also use it the other way, to upload waypoints. Start off by filling out a CSV file like so:
    39.15201891687152,-76.72353610396385,Panera
    
    Put as many waypoints as you want in the .csv file. Then plug in the device and run the commmand:
    gpsbabel.exe -i csv -f upload.csv -o garmin -F COM1
    
    If you want to get fancy you can use the unicsv format which allows you to specify more data, such as the icon to use on the map.
  • TODO: Figure out a use for the streaming GPS Data the Geko can produce -- If you set the interface mode to text out and connect it up to your laptop, you can get a stream of live GPS Data: In this case I used ZOC v5 to connect to the device at 4800 baud and N81. I felt like I was 12 years old again, dialing up to a BBS...ahhh...but I digress. I'm not sure what to do with this live stream of data, but it's got to be used for something. It's just way too hackable to ignore.

Have any other tips I should add to the list?

Sunday, July 06, 2008

An Amazing Lunch

How did we go from us all playing together, to our kids playing together?

It was really fun getting the Amazing Media folks back together. True, we didn't have any design arguments, or plan our next product launch - but we did eat good pizza. And having the wives around was a nice touch.

A special congrats to Tonya, for completing nursing school. After dealing with whining computer programmers, and fussy web applications, she'll no doubt find sick people a nice change of pace.

Saturday, July 05, 2008

Most Underwhelming Fireworks. Ever.

We had the most underwhelming 4th of July fireworks ever. As you can see in the included photos (which I didn't take, thanks Leah!) there's a cloud of debris in the center of the fireworks area.

As the fireworks went on, and on, this cloud got larger and larger, to the point where we couldn't see a thing. It must have been the perfect combination of heat and humidity that made the fireworks totally flop. Of course, we could see other counties' fireworks shows without a problem - it was only the big DC show which was hosed.

I just felt bad for the folks who had been sitting there since 3pm waiting to see the show, only to be treated to the radio of fireworks.

Friday, July 04, 2008

Grilling Action Shot

Mmmm....two grills full of food...

Dave, you rock!

--Ben

A Real 4th Of July

With David in town, our typical 4th of July of veggie burgers or perhaps
hot dogs has turned into the real deal - burgers, hot dogs, kabobs and
chicken cutlets are on the menu. And wings are ready if we need them.
Oh, and they'll be beer. More beer than the Simon house has ever seen.

I was in charge of a propane run, which I'm on now - all appears to be
going to plan.

We're really going to live it up this year.

Thanks Dave, and happy 4th all!

--Ben

MySQL Find: concat_ws(...)

I'm working with a database table that contains city, state and country. The values are all nullable, so it's possible to have:

 Arlington
 Arlington - USA
 VA - USA
 Arlington - VA - USA

I thought it would be handy to add a column to the view that table which was the location the user was in. This location field would be properly formatted so my code wouldn't need to be filled with if(r.city) { ... } ....

Turns out, writing the code to format the location was really tricky. I ended up with a massive CASE statement and various IFNULL(...) clauses.

This morning, while browsing the docs for another reason I found: concat_ws (meaning: concat with separator).

It does exactly what I want. My SQL statement just turned into:

 SELECT ...
     concat_ws(', ', city, state, country) AS location
  ...

How cool is that? Every once in a while MySQL pleasantly surprises me.

Thursday, July 03, 2008

The 10th Anniversary Trip Photos

Shira finally completed the exhausting task of uploading, editing, sorting and captioning our photos from our 10th Anniversary Vacation. She did a most excellent job of telling the story of our trip in photos and captions.

Here's a link to the album:

10th Anniversary Vacation

Here's the whole slideshow:

Busting A Gut and The Secret To A Successful Dr's Appointment

So I got confirmation today from a surgeon, to news I learned about a couple weeks ago - I've officially busted a gut. As in, I have a very common, and small, hernia. I wish the hernia had a great story, like I was doing some heavy lifting - but in fact, there's no real event I can trace it back to. Chances are, I was born with the defect that made it possible.

The good news is that the surgeon fixes tons of these, and he seems like a really nice and intelligent guy.

I also learned the secret to a successful Dr's appointment today - bring your wife along. This was a brilliant move. First, she filled out all the paper work - and did it more accurately than I would have. She knew all the details of the insurance. She knows our schedule, so we could pick a day to do the surgery. And finally, she'll remember little details like that I'm not supposed eat from midnight to the surgery.

So far, I have to say, if you have to pick something to go wrong with your body, a hernia seems like an ideal option. If all goes to plan, I'll get months of excuses like, "How can you expect me to take out the garbage - I just had hernia surgery!?"

Update: Oh dear. Shira did some searching on the internet and found this website with way too much information. Not only does it have diagrams, but it has flash videos that outline the whole procedure. I'm pretty cool with it all, except for the warning "In men, painful swelling of the scrotum or testicles occasionally occurs. This may require further surgery." Oh great.

I'm also a bit nervous that now Shira thinks she knows enough about the procedure that she'll just want to do it at home, herself, and save on the insurance co-pay.

Wednesday, July 02, 2008

Bicing - Zip Car Style Bike Rentals

Paul's comment about Barcelona reminded me of a service we saw there, which I think is just too cool. It definitely falls into the why don't we do that here? category.

Throughout Barcelona, we noticed people zipping around on the same generic bikes. The bikes appear to be offered by Bicing. Unfortunately, their website is in Catalan and not Spanish, so Google won't translate the site for me. This means I'm still a bit sketchy about the details of the service.

From what I can tell, you can use a key card to pickup and drop off bikes at any of hundreds of drop off points. The only thing I can compare it to are the Zip Car drop off and pickup points. But, rather than a single vehicle waiting around, there's dozens.

This idea strikes me as absolutely brilliant for a few reasons:

  • It solves some of the most annoying parts of owing a bike: where do I store it and how do I maintain it? Both of these issues easily solved for you.
  • The bikes look sturdy enough to be used for both errands as well as a day out riding in the park with the family.
  • The bikes were absolutely nothing fancy, which means that they were no doubt cheap to buy. And because there's only a single model to service, they are no doubt cheaper to maintain.
  • Here, in the US, going green is quite trendy - I'm sure you'd get people to sign up with the service just so that they could be part of the crowd.

So why doesn't Arlington offer this kind of service? Is it because our roads aren't bike friendly enough? Still, it just seems like you could make it this such an affordable service, that it'd be hard to resist taking advantage of.

This just seems like the ideal project for a green entrepreneur.

When Good Gummy Bears Go Bad

I so don't remember chemistry lab every being this intersting. I'm sure if we were blowing stuff up, I'd have taken more of an interest.

Thanks Dave for letting me know about this one!

IT Hilarity

The video below isn't family (or work) friendly - but it is absolutely hilarious. Having done my share of server diagnostics, I can truly say - It's funny because it's true.

Thanks Jenna for the find!

Tuesday, July 01, 2008

Review: Pompeii

Pompeii, by Robert Harris was both my entertainment and source of
education for my trip to Italy. Harris writes historic novels that
bring already exciting topics (like the WWII code breaking effort) to
even more life by laying a plausable but fictional story on top of
them.

Pompeii was a recommended book, because, well, I was visiting Pompeii.
It served it's purpose well: not only was the book a fun read, but I was
able to put Roman life into better perspective.

Personally, I wouldn't have thought that a story about an Aquaduct
Maintainer (an Aquarius) would have been that interesting, but I would
have been wrong. Harris knows how to create a fast paced stories with
lots of twists. The educational aspect is thinly vailed enough that
it's clearly there, yet manages to add to the story.

Pompeii is definitely not a replacement for a detailed guide to the
ruins themself (not that it claimed to be). It's excellent at putting
you in the mood and letting you get the right perspective.

I give this book a 9.3/10.0 - action and history, and a story where the
geek (no doubt, the Aquarius was the equivalent of the geeks of today)
is the hero - how can one go wrong?

--Ben

US Based OLPC Case Studies

Here are two OLPC case studies. They are particularly interesting because they both take place in the US instead of some distant 3rd world country.

Check them out:

The NPR report is especially interesting because it raises the question of how valuable a skill learning to program is for these kids. That is, why is it so exciting to program a story when they could just as easily draw the story with crayons. It's an excellent question, I really like the teacher's answer.