Thursday, December 27, 2007

iPod Touch Review

So, I got an iPod Touch (is it officially an iTouch?) for Christmas.  8Gig.  Given that in my history of listening to podcasts on my 60gig video I never went above 10gig, I think I can safely live with 8.  I have to admit that while I am highly impressed with the technology and the innovative interface, I continue to be disappointed with the lipservice that Apple pays to podcasting.  This is still very much an MP3 music player that can do other things, instead of a true personal media device.

First, some positives:

* The WiFi works great.  I was able to connect both at home (WEP) and at work (WPA) without problem.  I am happy to discover that sites like GMail work just fine, so I can check mail from the thing.  The browser (Safari) is very good, even handling multiple tabs/pages.

* The touchscreen is amazingly intuitive in ways you can't even imagine.  My particular favorite is the "two finger spread", where you literally just stretch the screen out and watch it zoom under your fingers.  Very nice.

* You can delete videos.  I've always wanted a delete button.  After all, with podcasts you typically listen once and you're done, so why go through the hassle of continually syncing it? 

...and that's about it for the positives.  I mean, everything else is fine.  The widescreen form is nice, but I was living without it.  And it plays music the same way it always has.

 

And now, the negatives.

* No offline storage.  With iPods as far back as I can remember there was a Notes feature which you could hack into storing text files.  With the Touch having Safari and a PDF reader, I was really hoping to store some PDFs and have a nice little ebook reader.  No such luck.  If you're not connected, you're not reading.  No idea why they took this out, I want it back.  True, with only 8gig you don't have as much storage to work with, but I can live with that.  I hear rumors that they're putting it back in.  (There is a hack floating around that allows you to do offline reading, but it only works for HTML files less than 100k.  Many ebooks out of Project Gutenberg are bigger than that.)

* Treatment of video is surprisingly secondary to the music player.  For instance, no video playlists.  You can watch movies and tv shows that you bought from itunes, or you can go through your video podcasts one episode at a time, but you cannot create a video playlist. 

* Then, it will always switch the widescreen, regardless of how you are holding the device (something that it can detect).  Which would be fine, except that the menu stays in regular mode.  So if you watch many video podcasts of short length you are constantly turning the device back and forth for no real reason. 

* You can delete videos, yes, but you can't delete anything else.  What's the logic there, exactly - that videos are bigger?  Because I'd bet that a 10second YouTube video of some fratboy getting punched in the crotch takes up less space than an hour long IT Conversations lecture.

* What's the story with a big honkin YouTube button on my main screen?  Don't care don't care don't care.  There's a dozen different video sites I'd rather go to.  Having something like that hardwired so blatantly in this day and age is like buying a highdef television with a big button on the top that says "DEMO".  It's fine when you're trying to make the sale, but the second you get it home it's useless and taking up space.

* Podcasts continue to be secondary, regardless of what Apple says.  Where are they?  Under the "Music" button.  It even says so in the manual - "Press the Music button to hear Music, Podcasts and Audiobooks."  Does that sound stupid to anybody else?  Reminds me of how Microsoft put the Shutdown button underneath Start.

* You can go to iTunes directly from the device, but hey look, no podcasts.  Just stuff to buy.  That should be pretty telling, there.  That's not a convenience for you, it's a portable cash register for Apple.

* Unless I'm doing it wrong, the iTunes button actually only lets you get music, not TV or Movies.  That rules it right out for me, I was actually willing to pull down some movies or something to try it out.  Oh, well.

* Once again, smart playlists don't work.  I have a playlist for strictly new podcasts using the "playcount=0" rule.  But as I listen to those podcasts, do they go away?  Nope, they stay in the way until I delete them.  This was broken once in an earlier version of the traditional ipods, too, so maybe that's an easy fix.

 

Overall I like it as a piece of technology, but if it wasn't given to me as a gift I think I'd still be fine with my old one.  If they give me video playlists so I can at least get back to watching how I used to watch, and then add offline storage so I can read PDFs at will, I'll change my tune completely and recommend it strongly.  But without those things, for me, it's really little more than the same old video ipod with a new screen.  I don't care about cover flow.  I don't care about YouTube, or about whether I can go directly to iTunes if I can't get podcasts and video. 

 

Technorati tags: , , , , , ,

Tuesday, December 25, 2007

iPod Touch : Magnify PDF on Safari

Just got an iPod touch for Christmas, and since I'm a fan of e-books I went right to the PDF reader, which basically means "Hit it with Safari."  The first thing I discovered was that the PDF will in all likelihood enlarge itself to display in the window, whether you are holding the device normally or rotated 90 degrees.  But what if the font is still not legible?  The double tap to magnify trick does not work - it just wiggles a little and stays where it is.

But you know what works?  The "two finger spread".  Put two fingers on the screen, and pull them apart.  The PDF will expand and zoom.  Up to you to figure out the best size for reading.

Friday, December 07, 2007

The Joy That Is Bubble Wrap

So I walk into the office yesterday, and over by the copy room is a roll of bubble wrap.  The kind with the big bubbles.  The roll is maybe 2ft in diameter.  I reverently pick it up, walk over to the office admin and say, "If you don't use all of this, the development team would like to play with it."

"Sorry, but I think I'm going to need it all," she tells me.

The CFO hears this and says, "If that will make them happy, we'll buy more."

The HR lady hears this and says, "You know what we could do?  We could mummify one of you in it, and then roll you up and down the halls and listen to the poppy noises!"

I volunteer the guy in the cube next to me.

"I'm in," he says, "As long as you don't kill me."

I assure him that, should this game come to pass, that we will leave airholes.

Later that afternoon there is a meeting in the room near the bubble wrap.  The CTO just goes ahead and rips a piece right off the roll and brings it into the meeting with him.  He keeps popping it while others are talking, until one of his underlings says, "Are you gonna share that?"  He apologizes for bogarting the bubble wrap and it is passed to the next guy. 

At one point I notice it lying unclaimed in the center of the table, so being in mid sentence, I slide it in front of my space so I can pop some when I'm done speaking.  As I'm talking the operations guy reaches over and steals the bubble wrap from me.

Later that day I'm speaking with the CTO about something in the hall, and the HR lady walks by. She is waving a strip of bubble wrap in the air over her head.  Apparently this has caught on, and people are just tearing personal sized pieces from the roll whenever they walk by. 

The admin is gonna be pissed :)!

Wednesday, December 05, 2007

Stupid Ruby Mistake

And by that I mean stupid thing I did.  The << notation is a great way to chain things together.  It's a little like +=, but it's flexible enough to work with strings or arrays and do the right thing.  When I need to build up an array or something I'll almost always do it like this:

ret=[]

Object.find(:all).each { |o|

 ret << o.value

}

and presto, I have my array.  Or when building strings:

url = config[:webserviceurl]<<"/controller/action?"<<params.join("&")

 

Oops.  <<, if you didn't know it, is destructive in the case of strings and arrays(*).  b = a << ", world"

Then not only does b equal "hello, world" but I just changed the value of a as well! 

 

That took me a little while to find.  Even worse, it was working fine for me in development mode for my Rails app.  It was only when I switched to production that it showed up.  Must have something to do with the string storage?

Anyway, just thought I'd blog it and save somebody else the stupid mistake.

 

(*) In the case of numerics, << means a completely different thing.  It's a bitshift.  So if a=1 then a<<2 is 4.

Tuesday, December 04, 2007

Why you don't go shopping with your technewbie father in law

Speaking of HD televisions, I was out this weekend with my father in law doing some errands when we decided to go pick up the TV (at Walmart).  He asks me out of the clear blue, "What's the name of that toy Kerry told me to look for?"

I have no idea what he's talking about.  We have three small kids so it could be a toy for them, or it could also be an electronic toy for Daddy.

"It's supposed to be the big thing, nobody can find it anywhere."

I am deliberately playing dumb because if the wife is getting me something as a surprise I'd rather not know what it is.

He ends up asking the TV guy.  "Nintendo Wii?" the salesman asks.

"Yeah, that's it!" says my father in law.  "Got any?"

The salesman laughs.

 

So apparently, if my wife and her spies can find it, I'm getting a Wii for Christmas.  Thanks sweetie!

She is unhappy that her father gave away the surprise.  But I tried to explain as nicely as I could that there's no way she's going to find one, so please don't be disappointed if you're relying on that for the big surprise.  "Then why did Karen [the neighbor] find one?" she said.  <shrug>  I guess it's possible?

Of all the variables to forget to track....

So I'm finally getting a HD tv.  I'm late to the game, but I always found something else to spend the money on.  My TV requirements are not large, I just want to upgrade the quality of the picture, not my entire lifestyle.  In particular I don't want to rearrange my living room.  That means fitting a television into the cabinet where we already have the rest of our stack.  Turns out I only have about 36" clearance in that cabinet, which means a 32" television.

Fair enough.  I go hunting.  720p, 2HDMI ports, 5000:1 contrast ratio whatever that means.  I was looking at the Sony Bravia, but when it came time to get one I saw a Samsung for the same price and better stats, so I got that one.  Just got it hooked up.

And then I realized the variable I hadn't considered.

The television just fits into my cabinet, leaving maybe a half inch or a little more clearance on each side.

The A/V port #2 is on the *side* of the television.

I have no way to plug in a second device.  It just plain physically won't fit.

That's a pain.

Well, when the new cable box shows up and switches to HDMI that'll free up the A/V port in the back for something.  But, still, annoying.

Monday, November 12, 2007

The Nerd Handbook

You've probably already seen The Nerd Handbook on Digg, but just in case you haven't, go read it.  It's great stuff.  As a geek (I've always preferred geek to nerd) married to a non-geek, I'm always on the hunt for things that describe us (geeks, that is) that I can point to and say "See?  That's how we are."  Way back in the day, the Jargon File / Hacker's Dictionary came with appendices that described the typical hacker, the sorts of food they ate, music they listened to, and so on.

Then there was Seebs and his classic "Hacker FAQ" where we got the oft-quoted "managing hackers is like herding cats" and "if you get a hacker on a project he really likes, expect him to be 10x more productive than a normal worker."

The Nerd Handbook is different in that it is written for significant others.  It speaks of "The Cave" where your nerd/geek/hacker goes, and why you shouldn't touch his stuff.  Why he hates small talk, and loves a good puzzle.  If it works, the best part of this article is that the author offers advice for the SO on how to optimize interactions with the hacker ("advanced nerd tweakage").  In other words, don't stick your geek in normal situations and say "Be normal!"  Instead, figure out a way to position the "normal" situation as something that appeals to his geeky instincts.  Is there a puzzle to be solved?  Information to be learned?   

Sure, on the one hand it is totally patronizing - "Hacker shy.  Give hacker puzzle.  Hacker happy now."

But in a way, it's only fair.  Because in my experience, most geeks also happen to assume that they are the smartest person in the room, which means we're pretty damned patronizing too.  Start by assuming that no one in the conversation is as smart as you, and talk down to them.  If you sense that someone has some intellect, then immediately the game turns either into a pissing contest to see who is the alpha geek of the room, or else an immediate bond is formed and you've got a friend for life.  But either way, most of the bystanders are left by the wayside wondering what the heck the geeks are talking about.

Anyway.  If you want to see how patronizing the "give a hacker a puzzle" cliche is, try this.  Invite some friends over for a party.  Include a geek.  Now put an unfinished Rubik's Cube in the room.  Watch what happens.  It's like they can't help themselves.  I know I can't - I was just at a party last month where the host set the table around me because I couldn't put the damned thing down until I'd solved it.

Thursday, November 08, 2007

Facebook, IE and IFrames

I test my webapps so rarely in IE that when they break, I assume it is IE's fault.  I'm usually right.  Tell me if this has happened to you:  You're developing in an iframe situation where the master page is at a different domain than the inner page.  This, by the way, is exactly the situation for iframed Facebook applications.  You click on a link in your iframe, and then your frame blows up.

This is because IE's default "medium" privacy setting has an issue with cookies in that situation.  So whatever session you setup for yourself on that first page doesn't exist when you try to click through to the next page of your application.

The solution, as several sites have pointed out, is to set up a "compact privacy policy", or P3P header.  Google for things like "p3p iframe internet explorer" and you'll get all the hits you need for how to do it.

In my Rails controller I added this line:

before_filter  :set_p3p

which is a shortcut for "Before you do anything else, run the set_p3p method".  And, the method:

def set_p3p

   response.headers["P3P"]='CP="CAO PSA OUR"'

end

Presto, it should work.  Right?  Well, no.  At least, not for me.  It stayed broken, and that's where I got stuck, because everything I googled said that should work.

Here's where it got interesting.  Pull up the privacy policy for the page you're on.  IE7, at least, has this over on the far right under the "Page" button, "Web Page Privacy Policy."  This will bring up a dialog box that shows all the URLs that your current page has tried to access, and whether or not cookies are blocked for each.  And it's there that I found something very interesting.  One line - a reference to a Javascript file, of all things - was showing "blocked."  Odd, that, because all my other resources from my own domain were Accepted.

Know what it was?  The Javascript file in question actually didn't exist.  This was a bug that the designer had put in, an old reference to a file no longer used.  So something in IE was saying "You've asked me to include this file, I presumably got back a 404 on it, so I'm going to put it in the blocked category."

Since that file had nothing to do with my ability to login to my application I'm not really sure how it caused the crash it did, but when I took out the include, magically everything began working.  So perhaps IE has a policy that says "If any resources from this domain are blocked, then all are blocked."

Just googling for posterity's sake.  I didn't find anybody mentioning a ghostly blocking of cookies from non-existent javascript files.

 

Ruby Quickies

1)  Whenever you've got a method that returns an array, there's a design question of what to do on no results.  Do you return a zero element array, or nil?  Your code that processes the results will be cleaner if you can always assume an array will come back (that way saying things like "Foreach x in results {...}" will simply fall through if results is empty).  But does that mean that you have to do some ugly conditionalizing inside the method to check for nil and create an empty array?

In Ruby you've got the lovely "to_a" object method.  Run it on an array, you get back the array.  Run it on a single element, you get back [element].  And, best of all?  Run it on nil, and you get back [].  Exactly what you want.

 

2) This is actually a trick that dates back to Smalltalk, but Ruby can do it to so Ruby is cool.  I have a string in my UI, and what I would really like to do, for fun, is replace that with a random choice from N strings.  So instead of just returning "Are you sure?" for instance I might return "Really?" or "Do you want to think about that?" and the like.

Problem - Ruby's array class has no random method.

Solution -  Stick this someplace in your code:

class Array

 def self.random

   self[rand(self.length)]

 end

end

 

And now it does.  Congratulations, you've just extended a system class.  Now you can do this:

["Are you sure?", "Really?", "Do you want to think about that?"].random

and get back a different result each time.

 

 

Technorati tags:

Wednesday, October 24, 2007

So, How's It Going?

I am working on a Facebook application for my company, as my official project.  None of this under the table when you get a minute stuff.  My job is to get the app up as fast as possible.

Facebook API server is down at the moment.

Normally when Facebook goes down during the day, people *start* working :).  I have to stop.  So I've been wandering around bothering my coworkers.  :-D  Fun fun.

 

Technorati tags:

Tuesday, October 16, 2007

Fixing ORA-03113

I've got this stored procedure, a very simple little creature, that does a simple select into XML, and then returns the result as an XmlType.  Works fine...most of the time.  But for some unknown reason, when moving between machines, the procedure will suddenly begin through an ORA-03113 error, or "end-of-file on communication channel" error.  This is somewhat similar to the more drastic ORA-0600 error, in that it basically means "Something screwed up bad enough that I'm bailing out on you."

The annoying thing, though, is that it would work on other machines.  And sometimes a recompile, or a reboot of the machine, would fix the problem.  So it's not the SQL itself.  Even more proof - if I snip the body of the procedure out and run it directly?  Works fine.

In our case, at least, we seem to have nailed the problem down to one of trying to return XmlType.  One of our Oracle consultants said simply, "CLOB has been around a lot longer than XmlType, I trust it more."  So I modified the procedure to return its clob value, instead of XmlType.  Since I needed it to be XML, however, I added an XmlElement.createXML(...) wrapper around the final result.  Guess what?  So far, no more ORA-03113.  Not saying we've completely fixed it, just that it's a step in a positive direction.  Our consultant feels that maybe the error occurs when the stored proc, which runs in different memory space than just the straight SQL would, is forced to cast its return value into the XmlType.  By basically letting it say "Whatever's in here, I don't care, have a CLOB", we're getting around that problem.

Just documenting in case somebody else is in a similar situation and can say "Aha!  Let's try that."

UPDATE:  Apparently that was NOT the problem, as my QA guy reports that it just started happening again.  It looks like the act of recompiling the procedure was enough to make the problem go into hiding again.  I just confirmed that by making a non-trivial change to the code (that did not otherwise change what is returned, or the signature of the method), and presto chango, suddenly no 3113 bug anymore.  Not sure what that means, but part of our build process does involve potential updates to the stored procedures, so it is possible that there's some sort of "The error may or may not occur after a build" causality going on.

 

Friday, October 12, 2007

iPod Audiobook Bug?

Does anybody else have this problem?  When I find a series that I particularly enjoy (mostly serialized podiobooks that are complete), I use a converter to cat all the MP3s together and convert it into Apple's audiobook, or m4b format.  Then when I put it on the ipod it shows up in the Audiobook section and, most importantly, responds to the "faster" mode and I can get more accomplished.

The bug is this:  Sometimes, by no discernible pattern (yet), the audiobook resets itself.  Say that I am 3 hours into a 5 hour file.  Normally when I pick it up again it'll go right where I left off.  Which is the whole point.  But sometimes it'll show like it's going to do that, complete with the progress bar that tells me my position, but then rather than starting to play, it resets back to the main menu like something went wrong.  When I go back in to that same audiobook again, I'm back to 0 position.

This is particularly annoying.  Can you imagine spinning that clickwheel for the equivalent of 3 hours worth of time?

I'm trying to decide if this is an ipod bug, or possibly something in the converter I'm using (but I doubt that).  It seems to be related to when I've synced the ipod.  I can go in and out of audiobooks at will, but once I connect back up to my PC and hten disconnect again, it may or may not do the crash thing on me.

 

Technorati tags: , , , , , ,

Thursday, October 11, 2007

Java Sucks

http://www.jroller.com/obie/entry/top_10_reasons_why_java

So I'm a little late to the party, but as a former Java guy myself, I found this (and the reaction to it) quite amusing. 

 

Friday, October 05, 2007

Elevator Hack?

I work on the ninth floor.  Yesterday I notice something strange, the door to the elevator opens by itself.  I expect maybe somebody is getting out, but no, it's empty.  It's then that I realize some jackass has pushed every button from 9 down to 1 (and presumably a few above as well).  So I'm going to have a slow ride down, stopping on every floor.

As we pass each floor, I hold down the close button to speed my ride up as much as I can.

And you know what?  After 3 floors of immediatley closing the doors again -- all the other lights went off.  So I stopped on 8, 7, 6...and then suddenly I had my choice again.  I pressed L and went straight there.  The elevator must have been programmed against such things. 

Wednesday, October 03, 2007

Quick iPod Tip

Not sure if this is common knowledge, but I just discovered it.  On the now "classic" clickwheel models (I have a 60gig video, black), holding down the "Menu" option for a second automatically jumps you back to the main menu.  This is particularly handy if you are a handful of menus deep into the notes, for instance, where a single click of the menu button can actually just move you back to the last page you were on.

Sidewalk Chalk FTW!

Walking across town today on the way in to work, I noticed that a pathway in the park had been scribbled in with sidewalk chalk.  "Perhaps somebody took a class on a field trip," I mused as I walked by.  There were flowers, and shapes, and a squid named "Sam."  Beneath the various pictures read the words  "Peace", "Heart", and my favorite, "PWNED".

I like that kid.

ProBlogger Birthday Bash

ProBlogger, one of the most popular and profitable blogs out there, is having a birthday bash and giving out lots of cool stuff!  I realize it's pretty blatant link building, but the fact is the prizes are actually very good, and it's all straight forward drawings, no pyramid style "earn credits and eventually get a free Nano" sort of thing.  I think it's a good deal.

Friday, September 21, 2007

Ruby, ActiveRecord and Database Functions

Here's a neat little trick you might not know.  Rails (well, ActiveRecord) tends to do all of your SQL for you, right?  So you don't have to write a bunch of selects and joins to get at your data.  Fair enough.  Well, what happens when you need to do a manipulation on that data?  I have a case right now where I need to get the date_of_birth field of out my model.  The only problem is that it is stored encrypted, and I need to call my companies internal decrypt() method on it. 

The find method actually has what you need already built in, by passing a :select param into it.  Normally you'd be selecting *, but what you want to do here is change it for your specific purpose.  So in my Document class I have this:

 

def dob

  Document.find(id, :select=>'decrypt(date_of_birth) as dob').dob

end

 

Done!  Now once I have  Document object, the dob property appears just like any other. 

I realize that this trick only goes half way in that it makes a find() call whenever you access the parameter.  In reality I should figure out a way to make this trick integrate directly with the main instantiation of the object so there's not a second call involved.  But for this project I'm working with a small number of documents, and the extra database hit won't hurt me.  Anybody else want to chime in with a better way to integrate it?

 

Technorati tags: , , ,

Wednesday, September 19, 2007

Know What I Hate?

I hate financial sites that track your login by IP address, and then forget who you are whenever you login from a new machine.  I appreciate the concept -- new machine could mean new person off on a stolen card number someplace.  But in reality I've got a laptop that I cart back and forth between work and home, and if I check the bank account from work, and I last checked it from home, I have to dig out my bank card again and re-enter my information.  It's a small pain, but it's still a pain.  I'd rather they just didn't claim to remember it at all and made me re-enter it every time, instead of every visit being a potential unpleasant surprise. 

Tuesday, September 18, 2007

DealDotCom.com vs Woot.com : How Blatant Can A Ripoff Get?

If you haven't seen it yet, be prepared for the onslaught of "DealDotCom.com" (no link for them, screw em) invitations to start swarming all your favorite blogs and social networks.  It's basically Woot.com -- one day, one deal -- only, with an affiliate program.

The problem with it is that it is an exact copy of Woot!, as if the only thinking they put into it at all was "How can we steal this?" and "How can we get the users to do our marketing for us?"  They copied the look and feel.  They copied the colors and the fonts.  They even copied the questions on the FAQ, and the answers!  Even the email addresses are copied.  Of course, all things are copied with just enough of a change to stifle the obvious copyright infringement charges:

  • Woot has Today's Woot, The Blog, The Community, Write Us, Your Account, What Is Woot.
  • The other guy has Today's Deal, Our Blog, Make Money, Talk to Us, Your Account, What Is This.
    • (Note the irony of how the bad guys have no community, only a place for people interested in making easy money....)
  • Woot's FAQ on privacy policy:
  • The other guy's FAQ on privacy policy:
  • The Woot Write To Us form asks "What have you got to say", "Who Are You" and "Got an email address so we can write to you?"
  • The other guy's form asks "What have you got got to say", "Who Are You" and "Got an email address so we can write to you?"
    • (Looks like somebody forgot to tweak the copy on that page! Bad scammers!  No cookie for you.)

 

  • Get the picture?

Seriously, people, this thing has bad karma written all over it.  Don't reward people who do nothing but steal the original ideas of others and add no value.  There are plenty of affiliate programs out there for businesses that actually put a little effort into it and aren't just trying to ride the other guy's coat tails.

I can't wait until they copy Woot's legendary "Bag of Crap."  I wonder what they'll call it so they can claim to be original? 

 

Saturday, September 08, 2007

I Am The Cool Nerd King

NerdTests.com says I'm a Cool Nerd King.  What are you?  Click here!

I love a good "What are you...." test. This one, "What *kind* of nerd are you", certainly caught my attention. I guess I'm glad I scored so low on the "dork" scale - should have taken it back in high school!:)

Wednesday, September 05, 2007

You Know You've Been Hacking Too Long

When your brain is so tired that you go through a particular piece of your XML code, changing all particular instances of < to &lt; and all accompanying instances of > to &rt; ... and then wondering why it doesn't work.

Because "lt" is not short for "left", thus "rt" for "right" makes no sense to the poor compiler.

It's lt for "less than", thus the other one is "gt", or "greater than".

D'oh.

I crashed XMLSpy half a dozen times on that one, actually.

 

P.S. - I've been dreaming in code, lately.  That hasn't happened since college, and it's pretty messed up.  I'm sitting there on the couch, trying to keep my eyes open while watching some television show, and suddenly my brain starts fitting the characters' actions into IF-THEN-ELSE structures and other things and visions of angle brackets begin dancing in my head.  I find it quite fascinating, almost like lucid dreaming.

 

Technorati tags: , ,

Friday, August 24, 2007

In The Zone

You know what I'm talking about.  Geeks have it.  Authors have it.  Athletes have it.  Psychologists have names for it.  "Flow".  "The Zone."  That time when it's like your entire existence is dedicated to nothing but that one thing, you discover focus like you never knew you had, and time just sort of dissolves around you.  One of the best ways I ever heard it described was, "When you're doing it, time stops."  If you've ever had the feeling, you know what I'm talking about.  It's awesome.

As a geek, what's yours?  How do you know when you're in it, and what do you do about it?

Part of the fun is having two machines going at once. I love it when I realize that I'm typing on two different computers, near simultaneously.

I bring my laptop with me, constantly.  While in meetings, I hack. I listen, and I contribute, but I hack.  Yesterday I did it for an hour and a half while sitting across from the president of the company.  He knows there's a launch coming up.  Between my desk and that meeting, I found myself typing as I walked.  I was curious if you could do that.  It's not easy.  (A coworker who read this said "It's easier to just run back and forth between your meeting," to which I say, "Running with the laptop implies closing it, which means on Windows it has to suspend / restart, which takes too long for me." :))

A good way to tell I'm in the zone is when people come to ask me a question, I can see it in their eyes that they can see it in mine, they'd best ask their question quick and leave.

You ever have that thing where you realize that you're no longer consciously sending signals to your fingers to type certain words, but they're just sort of doing the right thing on their own?  Love that.  As soon as you realize you're doing it, you normally cramp up.  But at periods it's great.  I love doing that to people who come into my office, I turn from the monitor and look at them, without ever stopping the typing.  They pause politely like they're waiting and I say, "Yes?  What's up?" and keep typing as long as I can.

During launch weeks I've been known to dream in code.  That's quite a treat.

And then, back at my desk, there's the music.  I have my playlist up.  I call it "Heavy."  Right now it's play "Dragula" by Rob Zombie, but it could just as easily be playing anything from Evanescence, Nirvana, Saliva, Drowning Pool....you get the idea. The real pounding stuff.  Headphones on, volume up just enough where it drowns out everything around me but not so loud I'm blowing my ear drums.

And then there's the rocking.  I can always tell when I'm in my own personal zone because I sort of rock back and forth while I think/work.  It goes back a long time ago to a college professor, Lee Becker, who made a passing comment in class when he'd asked us to work out some code in our heads.  He said, "I found it helps if you rock back and forth a bit."  He's right.

Well, put on the "heavy" playlist and that rocking back and forth becomes full-force, full-body, how-can-I-even-read-the-screen, keep-your-hands-on-the-keyboard-and-stop-playing-air-drums, oh-my-god-he's-going-to-break-something spasms, for lack of a more descriptive phrase :).  This is something I only do in my corner cube (I wonder what the guy across from me thinks?) and you can tell directly how involved I am in the code I'm writing by how wildly the rest of my body is moving. 

I actually quite enjoy it. It's like taking that infinite source of energy we all discover in that zone, distilling down into two parts -- the mental stuff goes into the code, and the rest turns kinetic and pours out through the rest of your body. 

I also realize what it is, for me, all of those things.  It's all ways to rule out everything between myself and my code.  The headphones rule out sound distractions.  The body rocking is an outlet for energy but it's also "I've turned off that part of my brain that cares what I look like".  Taking the laptop to meetings sayings "This is still my time.  You can only have the minimum amount of my attention you need, and I decide how much that is.  I have no obligations to you people, only to myself and to my project."  Even typing while walking says "Get out of my way, I'm not looking at you."

It's like a new universe comes into existence, and that universe consists of my brain, and my software.  I climb inside, and I'll come out when I'm done, thank you very much.   I may remember to eat.

This post brought to you during a pause when one of my coworkers confirms that he can build up the first phase of my project, and before I begin the second.  Back into the depths I go.

Monday, August 20, 2007

Curiosity Killed The Geek

So this morning I wander over to the big building next door to buy my Diet Pepsi.  I remember that I have a check to deposit, so I wander to the far end of the long minimall-esque building to the ATM.  I have no pen with which to sign, but I see that there's actually a bank pen at this one (the kind tethered to the desk) as well as what looks like a broken pen that someone left behind.  Well, the bank pen completely does not work, but luckily the pen in two pieces appears to work just fine.  It's actually quite a nice pen, very heavy.

Do you take the pen, or leave it for the next person?

A truly boring question indeed!  But wait, there's more.  I realized that the pen was, in fact, a USB stick.  That's why it's so heavy, and so easily sitting in two pieces.

Now what?

If you leave it, then whoever lost it may in fact be racing back over here right now to reclaim it.  That would be a good thing.  Leave it. 

Of course, if you leave it, chances are that the next guy to come along will go through the same question and might just as well take it.  Are you more honest than your fellow man?

You could take it, convincing yourself that by plugging it in you might find the person's contact information and thus let him know that he lost it.

Of course, that might just as well spring a virus on your company network.  Want to have some fun, walk up to your already harried and overworked sysadmin and say, "Hey, I found this random USB stick outside and I booted it on the network, is that bad?"

And besides, you know perfectly well that if you find a random piece of digital storage lying around, you're going to go snooping and see if there's anything good on there. 

I left it, telling myself that I'll go back over lunch and if it's still there, I'll bring it back to my office and see if there's contact information on it.  That location is not very busy in the breakfast hours.

What would you have done?

Update:  Went back over lunch, pen is gone.  Whether the original owner came to claim it, or someone else swiped it, I'll never know. 

Friday, August 17, 2007

TripAdvisor Buying Facebook Apps....Or Are They?

http://www.insidefacebook.com/2007/08/16/biggest-facebook-app-acquisition-yet-tripadvisor-acquires-where-ive-been-for-reported-3-million/

Having once worked there, naturally the headline that TripAdvisor was now responsible for the "Biggest Facebook app acquisition yet" caught my eye.  Rumor has it that they're buying mapping application "Where I've Been" for three million dollars.  TripAdvisor has their own similar application "Cities I've Visited".

My sources inside TA don't seem excited, however.  I quote:  "Dunno. Whatever.  Rumor.  No gossip in the halls."

I'm just sayin.  Seems very buzzworthy on the outside, and yet not even worth a mention to the troops on the inside.

Wednesday, August 15, 2007

Speaking In Public

http://www.pubcon.com/blog/index.cgi?mode=viewone&blog=1187123220

I'm not afraid to speak in public.  I actually quite enjoy it.  I might suck at it, but no one's ever come up and told me that.  In college I used to travel down to Washington DC with a group of students every year to present project work, and as part of the prep we formed a group that would sit in the audience while other students gave presentations, then take notes on how they did and hand them back in anonymously.  "Take your hands out of your pockets", "Stop looking at your notes", "Make eye contact more", that sort of thing.  "Stop saying Um."  The largest group I've done was for a Giga Research conference in San Diego a few years back, where I think I had around 200 people in the room.  Not huge by something like JavaOne standards, but not too shabby.

Recently when I was laid off and working with an outsourcing office, I took an MBTI test that came up "introvert."  The rep I was working with said, "That surprises me, based on what I've seen I would have thought extrovert for you."  I said, "I'm sure you did, but I can tell you why.  The only time you've ever communicated with me is when I'm the one doing all the talking, and I'm talking about myself. I have your complete attention, and I'm entirely confident in what I'm telling you.  If you stuck me randomly in a crowd at a cocktail party where nobody knew me or cared what I had to say, you'd see a completely different person."

That's what it's like for me at presentations.  Assuming that most of the people in the room actually care about what's being presented (remember my post on two kinds of demos?), I'm in my element.  You'll have to pull me away from the podium when my time is up.  Sure, I realize that there will always be a percentage of people in the room not paying attention, but as long as they're not the majority and I don't feel like I'm talking to the wall, I'm good.  I think I even wrote that in my earlier post about finding the people in the audience that are listening to you, and devoting your attention to them instead of wishing the guy in the front row would put away his Blackberry.

The linked article covers a wide range of presentation subjects, including all of the above (know your audience and don't worry about it), as well as details about how to structure your presentation, font size, graphics, and just about every little detail you can imagine.  Good stuff.  Now I just need an excuse to do more presentations!

P.S. - I'm like that in non-technical situations too, if you get me talking on a subject I'm passionate about :).

 

Technorati tags: ,

Wednesday, July 25, 2007

Ruby : Fall through if your closure is empty?

Today my designer asked me if there's an easy way to take something like this:

<% Thing.find(:all).each { |t| %>
  Your thing is <%= t.name %><br/>
<% } %>

and add something that says "And if there were no Things found, do this other thing."

Good question!  I googled around for a bit and tried a handful of things, but couldn't get it to work the way I liked.

I found one way to do it.  Not sure it's the greatest, but it works.  Maybe somebody can chime in with a more "right" way to do it:

<% Thing.find(:all).each_with_index { |t, @thing_index| %>
   Your thing is <%= t.name %><br/>
<% } %>

<% if @thing_index == nil %>
  You poor soul, you have no things.
<% end %>

If the loop does not execute at all, @thing_index gets no value.  I'm using @thing_index instead of just thing_index, because the latter would be local to that closure and no longer exist outside of the curly braces. 

 I am sure that my syntax leaves something to be desired, there's probably a much more compact way of doing the actual fall-through check.  I did it the way I did so that I could tell the designer "You fill in this block here" and have it clearly delineated.

Monday, July 23, 2007

There Are Two Kinds of Demos

If you code for a living, chances are that you'll eventually have to do a demo.  If you're lucky it'll be one of the good ones.  Because, really, there's only two kinds of demo.

The first is a customer, or external, demo.  Maybe the customer is really "company executives who don't know you from a hole in the wall", but still, customer demos always go the same:

  • You want it scheduled as late in the day as possible, because it feels like you're never really ready for it.  You come in that morning thinking "I only have until 3 to finish this."  If it's put off for another day, you're excited about the extra time you get.
  • You're incredibly nervous during the whole thing that you're going to make a stupid mistake, because you know that's what they'll remember.
  • Customer demos are typically a team effort, where one engineer is selected to do the actual presentation.  This means that you're getting the heat if anything goes wrong, even if it was not your code that did it.
  • No matter how hard you work, nobody's really going to care.  Most of the people in the room don't want to be there and don't really understand what they're being shown.
  • 10 times during the demo you will seriously consider finding a new job, or perhaps just throwing up.
  • If anything catches anybody's eye it will be the animation or the fonts or the color, or some other shallow, trivial detail that has nothing to do with the architecture of what you built.
  • Chances are very good that you'll have to do it all again in a few weeks.

Compare to the internal, "prototype" demo.  This time you're demoing to your peers, and it couldn't be more different:

  • You're bouncing off the walls with excitement at getting to show off what you've done.  Your meeting is scheduled at 10, you arrive at 9 and it's frustrating to you that you have to wait an hour because you want to keep tweaking on the code.  If the meeting gets delayed you're royally pissed off because darnit you want to show it now!
  • You're a frickin rockstar during your presentation.  You are so confident in what you've built that when there are little snags you just say "oops" and move on to the next thing.
  • Your peers are actually listening, and can actually ask intelligent questions about how and why you did certain things a certain way.  And you're glad to answer those questions, up to the point where it starts to take away from your demo because you know that you're not going to have time to show off all of the greatness if they keep talking.
  • Peer demos are very often solo efforts, so it's entirely on your shoulders whether it works or doesn't. This somehow manages to comfort most engineers, who wouldn't have it any other way. 
  • The people in the room are going to acknowledge your hard work.
  • You actually don't want people to dwell on any one aspect as the "best" part because it's all good, damnit.
  • While talking you're also thinking up new features you haven't added yet, and solving problems that you hadn't yet solved. 
  • At the end of the meeting you offer to do it again in case anybody missed it.

For a period of time I worked at a big stuffy bank.  "We have 6 week deliverables," some random VP told me. Every 6 weeks an army of executives in white shirts and dark blue suits would parade over to our side of the office for their demo.  The night before I watched as the project manager got grilled by his managers, memorizing the script they'd worked out.  He regularly threw up before the demo.  And the most he ever got out of it was a list of things they hadn't gotten into the release (that were due for the next one, of course) and stuff that was broken that had to be fixed, and see you in six weeks. 

Then I went to work for a big company where marketing ran the e-commerce group and they liked them some demos.  True story, I once promised them a demo for a meeting, but the demo was incomplete when my boss came around to tell me the meeting was starting.  I was so pissed off at myself that I finished what I needed in the next 15 minutes or so, went upstairs and actually slipped my boss a note in his meeting that said "Demo's ready if you still want it."  They did, so I came in, did my demo, and then the marketing guy running the show said, "Well, Duane's the only thing that actually accomplished anything today, and I think it's going to be even cooler than we thought it was.  So I think that merits a round of applause."   A little appreciation goes a long way.

What's the point, other than to point out what we as software people already know?  I'm wondering if you can bridge the gap, and bring a little bit of the good stuff over to the dark side of the customer demo.  Let's see:

  • The schedule is what it is.  Once you've got something you agree is ready to demo, then put it aside, stop working on it.  Whether the meeting is at 9am or 4pm, if you keep touching it up until the last minute you're going to leave yourself in a bad situation because there's almost certainly going to be something broken or half completed in there that you have to explain at the last minute.  Don't do it.  Freeze it.  Check it into source control, tell your boss, and then go do something else until demo time.
  • In almost any room there are going to be people who are listening to you, and perhaps even interested, even if they don't know what you're talking about.  Find those people.  Then, concentrate your efforts on them and ignore the old bald heads who are checking their blackberries while you're talking.  The fact that someone is listening to you, will help remind you that you're not totally wasting your time.
  • If people want to be the most impressed with the way the form animated itself on submission, and don't seem to care about your n-tiered architecture, let it go.  They are either users, or they are representative of users, and that's the sort of thing that the user sees.  Save your architectural vision for your peers. 
  • Confidence in what you're doing goes along way toward doing it well.  Mistakes have a way of creeping up on you if you let them.  Slow down.  Breathe.  Pace yourself.  Focus on the parts that are going right, don't panic over stuff that might go wrong.  When you are among your peers you tend to do this naturally because you're not thinking your job is on the line if you make a mistake. 
  • The entire tone of your presentation will often come down to here's how much we accomplished, or here's how little we've accomplished.  It's entirely in your control how you spin it.  If you keep saying "We didn't get to this, and in the future we want to do this, and it doesn't do this yet...." you're leaving your audience with the wrong impression.  Your fellow engineers will hear such things as, "Yup, long term strategy, ok, makes sense, there's a bigger vision that he's working towards."  Customers, however, will hear such things as "What's that?  It's not finished?  Oh, well, let us know when it is."

You can come out of a customer demo with one of several outcomes:

  • I aced the demo, and they really seemed to like it.
  • I aced the demo, but they didn't really care one way or the other.
  • I got torpedoed when they started talking about things that were never supposed to be in the demo, so it looks like we blew it when we actually had something good.
  • We were totally not ready for that, that sucked.

Three out of four of those actually mean you did a pretty good job.  You might be frustrated by the results, but that doesn't have anything to do with how much you accomplished in getting your produtc ready.

Really there's only one thing to fear when doing a customer demo, and that is "If they don't like it, I'll lose my job."  If you feel that way, then you have to give yourself a reality check and ask if that's really the case.  Are you good at your job?  Is your team, in general, good at their job?  Is the fate of the company riding on this demo?  We hear all the time in the movies about advertising agencies who put everything into making one customer happy.  Who knows, maybe you really are in such a situation.  I don't think I ever have been.  If I blow a demo, the most I'll do is walk around the block to blow off steam, possibly even wreck the whole afternoon, and then come back in fresh the next day and try to do a better job next time.  Would you really lose your job over a bad demo?  If so, do you think maybe you should be looking for a better job?

Wednesday, July 18, 2007

TiVo Series 3 Lite Is Coming

Hurray, it looks like the high def Tivo "lite" is indeed a reality, and will come in at a much more attractive $299 price point. That's the major thing that's been holding me back from going high def in the house. I tried to explain this to my wife once who said, "Well then we'll just use the family room [hidef] tv for when we want to watch without Tivo." I paused for a moment, dumbfounded, and said, "I don't understand a word you just said. What the hell does "watch without Tivo" mean???"

read more | digg story

Sansa MP3 Player Doesn't Recognize Memory Card

I've written previously on the car jukebox I made for my wife and kids, which basically means I loaded up an MP3 player with their music, attached an FM transmitter and now they can listen to the music they want without fighting about what CD to put in next.

Well last night I was updating it with High School Musical, and I broke it.  All of a sudden the memory card was not recognized.  The player itself has a gig of regular memory, and then a gig SD card where I keep the kids stuff.  And it's not being recognized.  The song collection has dropped from 374 to 249.  That's not good.

Found the problem.  In moving the folders back and forth to the computer, I had accidentally moved over a Lyrics folder as well, that was full of TXT files.  That apparently was confusing the heck out of the player (presumably it auto scans all the files on the folder).  When I deleted that folder, everything went back to normal.  Phew!  I did not want to explain to my 3 yr old why she not only did not have High School Musical, but all of her music was now gone.

Just thought I'd blog that in case anybody else is experiencing the same problem.  If your memory card is suddenly not being recognized, scan it and see if there are any non MP3 files on it. 

Gmail Hack : Bulk Delete

I am lousy at inbox management with my Gmail.  I have over 5000 "unread" messages.  What that really means, of course, is that I'm ignoring 90% of what comes in.  And then, once it gets into numbers like that, the interface for deleting things is just unwieldy.  (Remember the early days when they tried to argue that there was enough space that you never needed to delete anything?  Sure I can archive, but I don't want to archive stuff I never read and never plan to read.)

I just found a trick I'm quite happy with that should help take care of some of that bulk:

  1. Search for a string that's unique for what you want to delete.  Typically this would be the sender's entire name, but if you want to get creative, go for it.
  2. Gmail will tell you how many conversations matched, and show you the first 20 or so.
  3. Select all.  You'll get those 20.
  4. In the status message that tells you "20 conversations selected", there'll be a link that says "Select all conversations that match this search."  Click that!
  5. Now, hit Delete.  Gmail will warn you of what you're about to do.  Go for it.
  6. Tada!  Potentially hundreds of old emails wiped out, without having to page through months of messages 20 at a time.
  7. Optionally, go into Trash and do a "delete forever".  Otherwise all you really did was move them from one place to another.

Unless I'm mistaken, you can't sort gmail by sender, and this is exactly why you'd want to do that - bulk deleting.  At least with this trick if you can identify it as something you want to bulk delete, it's only a few clicks away.

BONUS  TIP - Trying to figure out what to delete?  Hit that "Oldest" button in the lower right corner to jump to your oldest conversations, and start there.  The stuff on the front page is still new enough in your mind that you're thinking about whether to keep it.  But the oldest stuff might go back months or longer, and you'll find yourself saying "I forgot I even had that" for things that you can now happily blow away.

 

Technorati tags: , , ,

Tuesday, July 17, 2007

Podshow : Continuing to Suck, Unfortunately

I'm disappointed that Podshow never made a bigger splash in the whole podcasting space, given that it's the brainchild of Adam Curry, who pretty much put podcasting on the map in the first place.  I'm sure podshow's doing great things, but honestly, it's just a non-starter in my podcast listening.  They attempted some sort of audiobook (Shadowlands, or something?) that I disliked so much I didn't make it through 3 chapters.  They had a deal with Sirius radio that I never understood (I thought the whole gimmick of podcasting was that it better than radio?), causing me to drop some podcasts (including Adam's), which fell through anyway.  And they stick assorted advertisements in some podcasts I listen to, that I've learned to tune out. 

And now they've got their whole "help Podshow suck less" campaign going.  At first I was excited, because as I said, I'm disappointed that Adam didn't really continue to break new ground in this new space.  So naturally I went to check it out, and I'm sad to report, they still suck.

Here's a list of the information that Podshow wants from me, before I'll be allowed to offer my opinion:

Email, Name, Address.  Phone number is optional, surprisingly, because nothing else is.  Gender, Marital Status.   Am I Latino?  What's my race?  Level of education, number of children I have, whether or not they live with me, and when they were born.  Employment status, job industry, and household income.

Adam, are you nuts?   Why not just say "Look, we want to know where to target our advertising"?  My opinion is only as valuable to you as my marketing data represents.  That's ridiculous.  The age of my kids has nothing to do with how much I think you suck.  It has something to do with whether I'll buy baby strollers, of course, which is really all that matters here, right?

And to add insult to injury, the homepage contains a graphic (blinking, no less) promising that you can "earn POINTS, and earn valuable PRIZES!"  Oh come on.  Who falls for that nonsense?

The Solution is "Non-Trivial"

I absolutely love this post over on The Fishbowl about how engineers define the degree of difficulty in a problem, ranging from "trivial" to "impossible" and how "non-trivial" fits into the mix.  Many times I've sat in a room and described a problem as non-trivial, and I know what was going on in my head as I said it, and the author just totally nails it.  If I know it to be impossible I'll say that.  But if it sounds hard and I don't have a clue, I'll say "Non trivial."  What a great engineer expression.  It means, in an instant, "Most other problems, to me, are trivial.  This one is only a little harder."  When in actuality it means "As of right now, I have no idea how I'd solve it, but I'm still sure that it can be solved."

Once upon a time I worked in financial services as a technical architect, and we used to rate projects on two scales of 1-5:  difficulty, and time.  Although I can't speak for anybody else, my definition typically was that "difficulty" referred to my own mental energy needed to think of a solution (including prototyping time), and "time" referred to "other resources, including people."  So a 1-1 project was what we typically think of as "cherry picking", something so quick and easy that it's almost not even worth doing, please throw it into the mix when you get a second.  A 5-5 on the other hand, was another way of saying "impossible."  It would take an undetermined amount of time and effort to complete.  I won't tell you it's impossible, because no engineer likes to say that (and no manager likes to hear it), but I'll make you think twice before telling me to go for it. 

A 5-1, something that is very difficult but requires almost no resources, is somewhat akin to the "non-trivial" concept.  It means "The burden of solving this would be entirely on my ability to come up with something, but when I do it should be ready to go."

A 1-5, on the other hand, would be used for a bureaucratic mess.  The equivalent of saying "Can we make the default font Helvetica instead of Verdana?"  The programmer has to change one style sheet, but the decision can only be made by 20 people arguing about it for 3 weeks.

(My current boss has his own version of the impossible/5-5 rule.  For projects he doesn't want to do, he estimates 200 person hours.  That backfired recently when the president himself came down and asked why it was so hard, and then redefined the problem on the spot until the estimate was more like 150 hours ;)).

Monday, July 09, 2007

E-Book Reading

Once upon a time I had a "Rocket eBook Reader" which was one of the very early dedicated devices for reading ebooks.  It was cool, but really only in a gadget sort of way.  If what you really want to do is tear through books of any sort, at any time and pace you want, then you need a ubiquitous device, and most dedicated e-Book readers are anything but.

Lately I've been carrying a Palm device.  Not a Treo, not a cellphone, a traditional "sync it up to your PC" PDA.  It's a model Tungsten C, the one with Wifi and keyboard.  But realistically over the last few months it's become an ebook reader for me.  I can dump PDFs and text files onto it, and whenever I have a minute where the iPod/podcasts aren't appropriate, out comes the PDA.

Well, the thing finally died on me today.  I guess my kids dropped it on the floor one too many times.  So now I'm left pondering just how much I like reading ebooks, and whether it merits getting a new device.  I don't feel like spending $400 on something.  I'm tempted to get the cheapest Palm device I can find and calling it a day, but then I wonder, are there any other dedicated ebook readers out there that are any good?  I'm not talking about the new $300 Sony thing, which I'm sure is pretty cool and all.  I'm talking about something pocket sized, barely more than a dumb text/PDF reader.  Something that I could get for maybe $100 or so.

I figured I'd throw it out there, see if anybody knows anything.  Maybe there's an online market for older ebook readers that have gone out of favor (ala the Rocket) that still have a hacker's market?

 

Technorati tags: , , ,

Friday, July 06, 2007

T-Mobile Hotspot@Home

I've been with T-Mobile for years.  I mean, seriously - my SIM card still says "Omnipoint".  I buy new phones and the kids in the kiosk look at it like "What the hell is this?" 

Anyway, I'm perfectly happy with that service other than the fact that I never get the cool phones.  So I was particularly interested when the same week as the iPhone came out, T-Mobile rolled out a fascinating new bit of technology called Hotspot@Home.  Basically they've figured out a way to do a seamless switchover from cell to wifi.  So when your new cellphone comes into range of a wifi point, it will switch over presumably to a VoIP call - and you stop using your minutes.  It's the seamless part that really makes it fascinating, and a quantum leap over something like a Skype.  If it works, then your T-Mobile coverage just got a whole lot better.  Forget about the free minutes thing for a minute, I never burn all my minutes anyway.  I'm more interested in the coverage.  For example, my wife's only complaint about T-Mobile is that there's no coverage in one very specific area, her parents' house.  She's there often, and her cell phone never works.  But hey, guess what?  With this Hotspot@Home thing, we could at least in theory just set them up with Wifi (which they don't have now) and she'd have perfect connectivity.  That's nice.

Now unfortunately comes the downside.  And there's two of them.  First, you have to buy a new phone.  I suppose that only makes sense, but they only offer 2 phones with this system, $50 each, and both I'm quite sure will force you down the "Psych! You bought a new phone, you just re-upped your contract for 2 years again!" path.  What if you like your current phone?  I like my USB and Bluetooth and MP3 ringtones.

Second, the service is an extra $10/month.  I hate the nickel and dime stuff, the cell phone companies are getting as bad the cable companies.  So not only did I have to pay for a new phone and extend my contract, now I'm paying more money per month for the service.  Is it worth it?  No, of course it's not worth it!  How does it save me any money?  Basically I'd have to be regularly going over my minutes every month to the tune of $10.  And I'm not even close to that.

So do I want to go through all that trouble just so I can reach my wife when she's at her parents' house?  Nope.

Still, though, I do like the technology.  Maybe after a generation or so it'll be a standard feature in all phones and services.

 

Technorati tags: , , ,

Wednesday, June 27, 2007

Visual Studio Debug Windows

I'm always accidentally closing windows inside of Visual Studio and forgetting how to get them back.  Here's a little tip for anybody else that's having the same problem. Within Visual Studio, the concept of "windows" is managed from at least three different places that I can find:

  1. View menu.  The logical place where you might go first.  There you'll find many "explorers", several "views", a "toolbox" and even a submenu for "Other windows" (which sort of implies that the other things on this menu are also windows, doesn't it?), which contains things like a call browser and a bookmark window, things I don't think I've ever used.
  2. Window menu.  Another semi-obvious choice.  However, all this menu does is control how to manage your existing windows - shortcuts to jump to them, and various ways to tab and cascade them.
  3. Debug->Windows.  Aha!  The Debug menu has its own Windows menu.  Inside that menu you'll find breakpoints, watches, locals, and all that sort of thing.

It's typically the Debug windows that I kill by mistake.  Glad I finally figured out how to get them back.

Tuesday, June 26, 2007

PowerDock : Goodbye, Windows Taskbar

http://www.punksoftware.com/rocketdock

For a brief time at my last job I switched to OS X.  One thing it had that was very cool was the dock, a combination of customized quickstart buttons for your favorite apps as well as a system tray where apps went when you minimized them.  The windows task bar is really nothing but the latter - it'll tell you what's open, but it doesn't give you the chance to open new things.

RocketDock, linked above, is exactly that and it's very good at what it does.  Create yourself a dock, put the apps on it that you need, and you're good to go.  Perfect example of good software.  Small, light, and very good at what it does.  If I could get the task bar to just go away completely, I don't think I'd miss it.

I Did Not Marry A Geek

This past weekend over dinner, I was explaining to my wife the theory about how if PI represents an infinite, non-repeating string of digits, and if all letters of the alphabet can be encoded as digits, then it is mathematically provable that the complete works of shakespeare can be found in the digits of PI.  "So you've got the first digits, 3.141592653..."

"What was that?" she asked.

"PI?" I answered.

"You know more than 3.1415?"

"Yes?"

"Why?"

"Because it's PI???"

"Oh.  Ok.  Continue."

She would have loved the guys in college that memorized a thousand digits or more.

Geek Humor

This morning a friend emails me this story about a "half a petaflop" supercomputer, adding the semi-obligatory joke "Let's calculate PI!"

"Old joke," I respond.  "Have you heard about the new Cray supercomputer?  It can calculate the sum of digits from 1 to infinity in 4.5 seconds."

A polite smiley followed.

"Wait," I responded to myself after a pause, "Isn't the sum of digits from 1 to infinity just infinity squared? Hell, that didn't take me 4.5 seconds either.  I think I told the joke wrong."

:)

Monday, June 25, 2007

Rubik's Cube : The Search for God's Number

http://www.boston.com/news/globe/health_science/articles/2007/06/25/the_search_for_gods_number_in_a_rubiks_cube/

I had no idea that the Rubik's Cube fad was back, but as a geek I have to appreciate the algorithmic approach to solving the problem.  God's Number represents the minimum number of moves it would take to solve even the most difficult of the puzzle's 43 quintillion possible combinations.  The current proof is apparently at 26, which is just insane if you think about it.  No wonder the world record is 9 seconds.

Way back in high school I was one of the kids that could solve the thing.  Classmates would bring me their cubes, I'd solve them and give them back.  I signed up for a competition once.  I got there are everybody began pulling out their books for some last cramming and memorizing, apparently.

Who knew you could use books?  I never used one.  Taught myself.  Reading the book was basically cheating, to me.

No, I did not win the competition.  But I did walk away from it with this odd sort of confusion about how you could actually care about winning if all you really did was memorize a book that told you how to do it in the first place.

Thursday, June 21, 2007

XmlStarlet : Command-Line XML Processing

As a general rule, I love XML.  I've been using it for a good 10 years now, and it's never failed me.  Except when I hit that wall of whether to deal with it as an XML file or a text file.  After all there are a million text utilities out there for searching, replacing, counting, analyzing, editing and so forth.  With your XML file, once you take it out of its application context you're left with either treating it like a fairly wordy text file, or else loading it up into a dedicated XML editor.  Even then, it's hard to accomplish bulk tasks like "Transform these 300 XML files using this style sheet" or "Extract out all the different values for Career/Title that are used". 

XmlStarlet gives you the ability to manipulate your XML files directly from the command line, and it is awesome.  Here's just some of the things you can do:

  1. XSL Transformations. 
  2. Search and extract.  Far more useful than just grepping for your text, you can use XPath to go exactly to the element (or elements) you want.
  3. Editing.  Insert/delete/move stuff around.
  4. Validate against a DTD or Schema.

Remember, if you can do it from the command line, you can do it from a script.  Highly recommended app.

 

Technorati tags: ,

Wednesday, June 20, 2007

Stop Summer Brain Drain

I've got three kids who are going to be 5, 3 and 1 this summer (well, the 1 is already 1).  The 5yr old in particular is getting to an age where she can appreciate the computer in more than just "moving the mouse around" ways, and I want to find time to encourage that.  She's also begun asking questions of the "why is the sky blue" variety, so it's good to see that she's inquisitive and I want to encourage that, too.

http://www.macworld.com/weblogs/editors/2007/06/summer/index.php?lsrc=mwrss

Macworld has a surprisingly not-very-Mac-centric list of stuff to do with your kids over the summer. I really have to get in the better habit of letting my daughter play with the computer instead of sitting in front of the tv.  The problem is that the 3yr old demands equal time, so it's hard to find things that will occupy them both without being too trivial for one and too complex for the other. 

Tuesday, June 12, 2007

Is this irony? Or just coincidence? I'm never really sure anymore.

So today I get one of many unsolicited emails from a headhunter asking if I want a job.  This one is for 6 months in Chicago working on Java, ATG Dynamo, etc... on Solaris.

This one, though, caught my eye.  You see, this one is for DeutscheBank.  In 1999, when DeutscheBank was still called Kemper and Scudder had just bought it, I went out to Chicago for a month and trained them in how to use ATG in the first place.  My team from Boston had created the "enterprise architecture", and their group was "application development."  Of course, that's the story I tell that has the punchline "I engineered myself out of a job," because when the time came around 2002 for the layoffs, they threw all of us Boston folks out on the street and kept the Chicago team.

So...I trained them....I lost my job, they kept theirs....now apparently there's an opening on that side that I might be able to fill?

Call it what you will.  Damn you Alanis Morrissette for forever screwing up anybody else's chances to incorrectly use the word ironic!

(Of course this could be an entirely different team that I have no association with at all, but I'm pretty sure that my project introduced ATG to the company and they never expanded beyond that group.)

Wednesday, May 30, 2007

ColdFusion / .NET Integration

 

.NET Feature — ColdFusion/.NET Integration — As both a .NET programmer and ColdFusion developer, I always wondered how I could leverage the world of .NET in ColdFusion. Both platforms come with powerful features and using them together might be a wonderful friendship, if one could only make them cooperate. There are two worlds out there and none of them is an island.

Hey, very neat article from .Net Developer's Journal.  And great timing, as I'm right in the middle of converting our company's main product from ColdFusion 7 to .Net.  I'm actually quite impressed with this article for a few reasons:

  1. It doesn't take the easy route and say "Just do web services" (although it does throw that idea a mention right on the first page).
  2. It's not just an advertisement for ColdFusion 8 (Scorpio) which is apparently going to have even more .Net integration.
  3. It shows how to integrate with .Net 3.0, so it's right up to date with the latest technology.

I've already forwarded it to my team and look forward to printing it and reading it in more depth on the train to work tomorrow.

Technorati tags: ,

Optimizing Rails on Oracle

Many of my articles are about working with Rails, particularly on Oracle.  It's nice to see that Oracle has their own page on optimizing the two.  I especially like that it breaks down how Rails creates the SQL statements behind the scenes, and then looks at ways to optimize that SQL. 

 

Technorati tags: , , ,

Tuesday, May 29, 2007

Ruby Regular Expressions

Aha, another quick lesson learned.  In Ruby, the regular expression is an object unto itself with its own syntax.  So to do a simple search and replace you do something like this:

"The quick brown fox".gsub /brown/, "purple"

which replaces the results of a match with regular expression "brown" with the string "purple".

But what if you wanted to do something more dynamic, like, say, matching a color based on a variable?  You can just as easily do this:

color="brown"

"the quick brown fox".gsub color, "purple"

And it will work.  Ay, though, but here's the rub -- it's no longer matching it as a regular expression.  Try this test:

input = "start:   data"

data = input.gsub! "start:( +)", ""

that should strip off the start: as well as one or more spaces, right? Nope.  It fails to match.  That's because since I'm passing a string it's not evaluating it as a regular expression.

Wrap that first element in a constructor for Regexp:    Regexp.new("start:( +)")  and you'll get the right answer.

 

Technorati tags: ,

RegExp : "Lazy Star"

Hey, I learned something new today.  Cool.  I'm trying to scrape some HTML so that I can produce an XML document out of it, and I came to this piece of logic.  I want to get rid of <a> links and just leave the text.  So if I have  "Blah blah <a href=foo>bar</a> something else" then I would just be left with "Blah blah bar something else."

First attempt (this is in Ruby, by the way):

line.gsub! /<a href=(.*)>/, ""

line.gsub! /<\/a>/, ""

In other words just a brute force attempt to chop out the tags, leaving the middle.  This appeared to work.  Except when I had nested tags.  In a case like this:

<th class="header"><em>This is a <a href="link">link</a></em></th>

I would end up with this: 

<th class="head"><em>This is a

Because it turns out the first .* was being greedy and going all the way to the last occurence of the > character (the one with the th) and eating the whole line.

I recalled the term "greedy regular expressions" from lessons I used to get from a coworker (Hi SteveO!) so I went googling and came across this rather lovely reference page which told me exactly what I wanted.  Namely that a single star is "Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is not matched at all.", and that there is a syntax *? called the "lazy star" which is "Lazy, so the engine first attempts to skip the previous item, before trying permutations with ever increasing matches of the preceding item."

Perfect.  Changing my regular expression to:

line.gsub! /<a href=(.*?)>/, ""

Did exactly what I wanted, finding the first > and stopping.

I knew about the typical use of ? as a "0 or 1" matcher (as well as + for "at least one") but this was the first time that I'd had opportunity to use the * in conjunction with ?.  Learn something new every day.

 

Friday, May 18, 2007

How To Do Clouds In Photoshop

This post appears to have been removed, the link is broken. I don't know why. Sorry about that.

http://www.impulze.net/v3/portfolio/9/22/

I'm not much of a Photoshop user (the Gimp is the closest I come), but I am a fan of watching clouds.  I've always wanted some software that would generate random clouds for me, something I could use as wallpaper.  I like meditating by finding interesting scenes in them (and I'm not just talking about "hey that one looks like a dog"). 

So I was pleased to find this tutorial specifically on creating "realistic" clouds.  When I get some free time I'm going to see if all the techniques work in the Gimp.  Hey, does somebody want to script something up for me that regularly regenerates a file of clouds that I can attach to my desktop? :)

 

Technorati tags: , , ,

Biggest Myths About The Workplace

Update: Link fixed, thanks Rob.

Guy Kawasaki has up an article by Penelope Trunk on 9 "myths of the workplace".  I disagree just a bit with #2 (job hopping will hurt you) and #6 (you need a good resume).  Yes, if you're saying that "you absolutely must not jobhop" and "you must have an awesome resume" otherwise you will never get any jobs, ever, then yes, of course that's stupid. 

But realistically, the resume and the employment history do matter.  I used to interview at a place that was pretty hard to get into, the sort of place where you ran a gauntlet that required writing (and being quizzed on) source code, all the way up to getting the blessing of the company president.  We turned away way, way more resumes than we accepted.  Very rarely did we get somebody in by way of personal connection.  Typically this was because our technical requirements were so specific that either nobody knew someone that fit them, or else they were afraid to send their friends in who were not a perfect match for fear of being blamed for wasting everybody's time.  I always wondered about the coincidence that the last person I ever interviewed for the place turned out to be not even close (I was the first interview and did not ask the necessary weedout questions, apparently).  I was taken out of the interviewing loop immediately after that.

Penelope's right, I wouldn't be too worried about which verb to use (did I lead the project, or did I spearhead it??).  But I guarantee that at some places you are going to get thoroughly quizzed on what you say you did.  You say you've got skills in Smalltalk?  Great, tell me what you did.  Don't lie to get yourself in the door. Since I interview and hire technical people, one of the rules of thumb I've always used is, "If you list it as a technical skill, then you'd better show me in the work history where you used it." 

As for the job hopping, that's a hard one.  You don't want to tell people they have to stay in a horrible job for a year just so it doesn't look bad on the resume.  What looks bad is a pattern of that.  Fine, you left one job because it wasn't a right match, or because the boss hated you, or you got a better offer. But if you did that 5 times in 3 years?  I'm going to have to wonder whether you'll do that to me, too.  If you're having that much difficulty finding a job you like, then how am I supposed to know if the job I'm offering you is going to be any different?

Don't be afraid of the great big working world.  There's room for everybody, and almost nothing that you can do will be such a black mark that you'll never work again.  But by all means treat your career like one big entity, not just a series of jobs.  What you do with your life says something about you.  You're not getting a clean slate every time you end one job and start a new one.  You need to be able to explain why you made the leap that you did.  There's a certain level of accountability there.  Your new job expects you to be accountable for your actions, and that resume and interview are really the only things they've got to base their decision on. 

Thursday, May 17, 2007

Jobacle.com Career Questionnaire

Over at Jobacle.com Andrew's doing a "Career Questionnaire", so I thought I'd throw my two cents in:

Worst Boss

Two of my children were born during my time at one company, and both times I had to send out my own email because my boss "dropped the ball".  Not sure that makes him the worst, but it was pretty lame.  I suppose the worst was the manager who used to come into my office and fish the Coke cans out of my trash.  One day I asked him, "Oh, is that like for a boy scout fund raiser or something?" and he said, "No, just mad money for me to buy toys."  The guy who decides how much of a raise I should get is digging for nickels in my garbage?  Eeesh.

Best Boss

I liked David.  He was as close to a business mentor as I've ever gotten.  He always had the right mix of "I'm your friend and I can hang out with you after work" and "I'll give you a long leash to work on what makes you happy", coupled with an ability to say "If you screw up I'm going to tear you a new one" while not making you feel personally humiliated.  Does that make sense?  I could drink a beer with the guy, get yelled at in a meeting, and then drink a beer with him the next day, no hard feelings.  Separating work life from personal life was a very important lesson.

Most Innovative Colleague

Some of the engineers at my last job were brilliant coders.  A couple of them left you with no doubt that if necessary, they could code the entire product themselves.  In a weekend.  And still take a break to play frisbee.

Most Rewarding Task

My first job out of college was working on a medical device to detect osteoporosis (ever see a commercial for Fosamax?  I worked on those clinical trials).  So I suppose that preventing little old ladies from falling and breaking their hip is pretty high on the list.  Now I work at a place helping kids get into college. 

Best Item You "Permanently Borrowed"

When I got laid off from one job they seem to have forgotten that I had an IBM Thinkpad.  A few months after the fact I actually ruined it by spilling soda in it, and one of my contacts that was still at the company let me swap it out for another one of the machines in the office :).  Very nice.

Most Embarrassing Moment

I was in a meeting discussing the planning for a particularly large project.  A meeting which, for some reason I can't remember, included people like the head of sales and the president of the company.  My boss was always telling me about how much of an idiot the head of sales was, so as he babbled I found myself smirk and shaking my head.  I can't even remember why. But I do remember the president of the company pausing the conversation to say, "We have laughter in the corner over here.  Do you have an opinion?"  Ummm....ahhhh......eeeeeeep!

Lowest Pay

When I was in high school I was a bagger at the supermarket.  The minimum wage was $3.35/hr.  Does that count?  I remember going to a union contract meeting where the representative basically said "this contract is fine for everyone except the baggers."  So when the voting slips came around I wrote No on mine. The guy next to me, a cashier, saw it and called me an *sshole.  I think I was 14.

Worst Holiday Gift or Bonus

I worked at a place where we used to get a turkey for Thanksgiving, that was fun.  For worst, though, I'm gonna give this one to my dad.  His whole career (40 years) he worked as a meatcutter at Stop and Shop.  One year they said that there'd be a bonus for Christmas.  On Tuesday a Stop and Shop television commercial ran that ended with an animation of Santa Claus writing, "From all of us to all of you, Thank You.  Merry Christmas."  That was it.

Bonus: Your Typical Day

Everybody knows about my commute.  When I get in I check the email and scan a couple of key technical feeds to see if anything interesting is happening, or if any relevant tutorials have shown up on .Net or Rails.  Every other day or so I'll have 2-3 meetings for project planning. Mostly, though, I'm writing code.  Visual Studio, C# code.  If I'm lucky I get to work in Ruby for some projects.  Sometimes it's data mining which means working in shell scripts and other Unix loveliness.  I'm out the door around 4:40 so I can catch a train home in time to help my wife get dinner on the table.  Once the kids are in bed I'll get back on the computer around 9pm or so and do a little work depending on how much needs to get done.  Sometimes that's just wrapping up some emails or some documentation, sometimes it's continuing long running jobs that weren't done yet.