Aug 23

I recently finished a book called “Object Technology: A Managers Guide” that my friend Max Porges recommended to me. In all it was a very nice high-level overview of what OO technology is and does. It certainly was not a nuts & bolts, syntax-level book (as the name probably confirms) but I still think it has value for programmers in that it reels in all the relevant concepts in a nice summary. I won’t summarize the content of the book as you can get that from amazon, but one example really gave me an “aha” moment and I wanted to cover that here.

I have always been awed by how UPS can successfully route millions of boxes each day to where they need to be. That feat alone is stunning but add ontop of that all the constraints they deal with limitations like physical volume of the various shipping vessles, the weight limitations on their airplanes, the fluctuating price of gasoline, right down to the changing road and weather conditions and blockages that affect their vehicles – how on earth do they seem to roll with the punches so effortlessly and choose optimal routes for each package? If you think about it, it’s an interesting challenge because there are infinite permutations of how to group the boxes and choose the routes and there may be multiple “right answers.” The amount of engineering that must be involved a system that accomodates this level of complexity and variance from that many unpredictable, real-world circumstances is incredible and I’ve had trouble conceiving of where I would even begin if I had to design such a system. That is until I read the above book… It’s actually a mind-blowingly simple concept made possible via OO design once you consider all the packages objects. Here is the key:

Each box is a greedy, self-serving object operating under freemarket conditions and abiding by a predetermined set of rules and priorities as far as tradeoffs with respect to price/speed/reliability. I think of it in terms of that one reality show that seems to be so popular (The Great Race?) -they give ten couples $100 and tell them each that they need to get themselves from starting point A to destination B in 12 hours and await instructions there. The couples have a ruleset they must abide by (both from the show’s producer and from society if you think about it – ie. carjacking should not be a viable option). They come up with the most effective strategy of getting from A to B given their resources at any given moment and this can change, they can even partner with other teams if the circumstances provide that such arrangement would be self-serving and mutually-beneficial. But it’s crucial that all decision-making capability is distributed to the level of the couples. If there were to be one central authority trying to call out the plan for best strategy for every couple at every given moment, first it wouldn’t be interesting but most importantly it would be a completely unmanageable mess.

According to the OO book above, UPS undoubtedly employs a similar strategy in how they route their packages. They make them into greedy, self-serving individuals trying to get to where they need to be as cheaply as possible and as quickly as possible. Let the packages figure out what route is best given the paramters and the conditions. If you expand this concept further, their planes are probably simultaneously calculating tradeoffs for optimal weight loading and space management given the destinations of the packages that have chosen them. And one level further, if UPS is like Southwest Airlines, there is some forethought and forecasting going into their purchase and allocation of fuel and they’ve probably done monte carlo simulations on the value of buying oil futures at any moment. Especiall w/ oil at $60/barrel and with a fleet of gas-guzzling machines as large as theirs, there is no doubt in my mind that they’ve invested considerable resources into building intelligence into the “selfish” fuel reserve object that determines the most effective way to buy and distribute their gas. Of course these are all just speculations on my part and I don’t actually even know anyone who works at UPS- I’m just a big fan of how smoothly their operation always seems to run given the complexity of what they juggle.

Read that book if you get a chance. There are some other examples in there which are equally as inspiring, that one just stood out for me as being the “aha” of the month.

© 2005 Lights Out Production – All Rights Reserved Worldwide

Aug 22

wow. you never realize how much you rely upon services until they’re both down simultaneously…


© 2005 Lights Out Production – All Rights Reserved Worldwide

Tagged with:
Aug 21

I always thought recovering deleted files from harddrives was something left up to forensic specialists you see on CSI and 24. It really is no more difficult than downloading this free program called PC Inspector and walking through their recovery wizard. I had the opportunity tonight to put this little app to use. My friend Tracy recently had her SD memory stick for her digital camera crap out on her during vacation. The flash memory apparently got corrupted when she tried accessing it from her computer. I used a USB SD reader and hooked it up to my PC. The card itself showed only 5 pics on it but after running PC Inspector and stepping through a few screens it was able to identify all 70 missing pics. Unfortunately the way it tries to piece them back together, only about half come out looking pristine. The others look like a mish-mash collage of duotoned photos like a crazy art major would do for a thesis. It would take a bit of photoshop work to restore them all but the data is all there. For a piece of freeware, not a bad little program to keep in mind of you hose your files. You can see below the interface and all the corrupted directories alongside the recovered files (circled in red).

© 2005 Lights Out Production – All Rights Reserved Worldwide
© 2005 Lights Out Production – All Rights Reserved Worldwide

Jul 27

using UltraVNC Single-Click. This is clearly the coolest invention to come from the web since the Hamster Dance back in ’99. Basically if you’re running Windows and you need tech support from me, I point you to an executable on my site and it gives me VNC control over your system. What this means is no more 30min tech support sessions with relatives walking them through the process of troubleshooting a faulty device driver or some other obscure problem over the phone (“what do you see now?”). No matter what computer they’re working on you send them to a URL and take control of their system remotely and let them watch how you fix it. And if you want to take it a step further and preserve the solution as a movie so they can reference it later, use this cross-platform VNC2SWF screen recorder (like camtasia only for a VNC session). Single-Click VNC works just like regular VNC only with some additional benefits:

  1. No software to install on the recipient’s machine
  2. They run an executable which they can close down at anytime and it removes itself when the session ends
  3. It works through every firewall I’ve tested so far
  4. It works on computers that are running behind a NAT router
  5. It makes you look slick because you can private-label the launch screen and make it seem like a proprietary helpdesk technology you developed

Just like UltraVNC, it’s free, supports 128-bit encryption and now it allows direct file transfer. It was fairly easy to setup, the only requirements are that you have a static IP on which to install the listener (and actually, you could still run Dynamic DNS from a dynamic IP and it should work). Follow the instructions on their setup page. Basically, you’ll modify a config file, add your custom logos, generate a shared key and then zip/upload the files to this cgi script that then creates a custom exe for you which you can host, email or distribute however you like. I did encounter one gotcha that took some digging to figure out. For whatever reason they just don’t explain in the setup instructions that when adding the files to the zip that enable encryption in your exe, you need to rename MSRC4Plugin_NoReg.dsm file to MSRC4Plugin.dsm. This forum post explains the process clearly. Once I cleared that hurdle, I found this program works and it’s fast with no noticeable latency over residential broadband and I did sniff the packets with Ethereal and verified that they are in fact encrypted. The way I do my setup is to run the listener from my dedicated server and RDP into that and control other machines from there.

I had setup regular VNC in the past on my brother’s computer and used it to remote into his machine but it only worked on his personal computer, wouldn’t work through a firewall because I was initiating the connection and he had to learn how to start windows services. This solves all of that for him and the rest of my relatives that call me for support.

On a completely unrelated note, I’m finally into using Subversion for source control and I LIKE it. I successfully ported my blog code over to the latest release of Camden’s BlogCFC. It took a few hours because I’ve tweaked things and applied the aura skin but the whole process went smoothly. I’ll be versioning all my projects from now on. The next step is to setup OpenSSH on my server and then integrate my Tortoise SVN client w/ Putty to tunnel the connection to the repository. I’m setting this all up in anticipation of a surprise venture that is launching soon for developers called Grid 7. Stay tuned…

© 2005 Lights Out Production – All Rights Reserved Worldwide

Jul 12

Sounds like the final CS Lewis Narnia Chronicle… it’s the most cliched phrase in corporate america today. I refuse to even write it and I cringe every time I hear it come up in speech- “think outside the b*x!” It’s the flagship phrase on the armada of corporate crap-speak, but do you know the etymology of this phrase? It was coined by Mike Vance in 1995 in his book “Think Out of the box” (coincidently his son, John Vance was fraternity brothers w/ my brother at Santa Clara). The whole notion stems from this puzzle where you are supposed to try and connect a grid of dots with a series of four pen strokes without lifting your pen from the page. Most people get 8 of 9 dots connected but struggle with connecting that last dot because they are focused on “coloring within the lines” of the grid. The solution comes when you are able to realize that the page is larger than the grid and you can overstep the boundaries of the grid. The solution may be common knowledge to everyone now but I want to give my own take on this whole “boundary-less thinking” as it relates to programming and more generically, problem solving. I will illustrate with a brief story from my high school days.

Abe Lincoln once made the statement to the effect of “If I had eight hours to fell a tree, I would spend seven of them sharpening the axe.” With the advent of chainsaws, it’s rare that people now have the occasion to actually chop down a tree by hitting it with a sharp piece of metal. While Abe’s words of wisdom are still very relevant and powerful, until you’ve actually had to try and hack down a tree with an axe, you just don’t get the same visceral identification with his words. Back in the summer of ’93 shortly after my 18th birthday (and this is crucial because it meant I could no longer be tried as a minor), my friend Wayne and I were busted for underage drinking by rent-a-cops in his girlfriend’s parents’ backyard. Our sentence was deferred and instead of doing time in juvy, we were given 32hrs of community service beautifying our community. Those guys on the side of the road in the orange vests picking up trash… yeah, it’s about as fun as it looks especially during the summer in AZ. One of the many sisyphean tasks we were given during our stint at the Paradise Valley Police Dept. was to chop down a 25′ poplar tree that was growing in the median of their parking lot. The tools we were given: a rusty pickaxe each. If you’ve ever seen the gnarled roots of a mature poplar tree then you know this task is about as feasible as giving someone a pair of chopsticks and telling them to empty a swimming pool one water droplet at a time.

Now Wayne is no dummy (in fact he’s currently a rockstar lawyer with one of NYC’s top law firms) and I have an utter distaste for tedious, mindless work. While the other laborers launched into their own chores, Wayne and I took a few swings and then sat there staring at the tree, examining our puny tools and thinking to ourselves, “there has got to be a better way to do this.” Fortunately the week before my S10 mini blazer had been outfitted with a trailer hitch. It was parked in the space next to the tree and, like one of those cheesy movie scenes, the hitch glistened in the 120 degree Arizona sun and the light bulb hit us both simultaneously. We rummaged around the yard for a sturdy rope and found one immediately. It took us all of about three minutes to back my truck up to the tree, fasten the rope to the tree’s trunk and then to the hitch. In a glorious moment I will never forget as long as I live, I threw my truck into 4wheel-low and slowly plogged forward ripping this massive tree out of the ground while Wayne stood watching and chuckling in his classic half-smile “awww jeahh” look. I remember making my victory lap through the PVPD parking lot dragging this enormous mess behind my truck trailing dirt clods everywhere knowing that we would of course later be tasked with cleaning up the mess we created, but sweeping was WAAAAY better than swinging a pickaxe in noonday sun!

How does this story relate to programming, web development or problem solving in general? Think how many times have you been handed a project that felt similar to this. I’m sure we’ve all been given a mindless piece of work at one point or another- I know I have and I loathe doing these types of projects. The key is how you choose to solve it, though. Do you put your head down and start immediately start hacking away with your pickaxe or do you take a few steps back and see what other tools are potentially at your disposal? Can you write a routine to automate the mindless portion? Has someone else already created a component that does 95% of what you’re trying to do? Are there tools perhaps written in other languages that accomplish the same thing but might be out of your periphery because they don’t end in “.cfm?” Depending where you fall on the continuum of corporate vs. independent consultant, your tool belt may be constrained by various factors (namely monetary and political), but with so many kickass opensource tools for other languages available, as well as ones like CFOPEN, CFCZONE and the newest addition COAL for CF- you really have no excuse for claiming that you don’t have the appropriate tools for the job. And if by chance you are operating under some draconian corporate policy of not being able to install apps on your own machine, then run them from a USB drive. The point here is that it is SOOOO much more satisfying to spend a little time sharpening the axe and solving the problem creatively rather than launching into a brute force attempt with crappy tools- not only does it grow your skill set, expand your confidence as a developer but it also makes the job like a treasure hunt or a good MacGyver episode.

*UPDATE – I just found this picture of Wayne and myself doing our “hula hoe” chores in front of PVPD- awesome.

Jul 09

Hopefully this will save someone the three hours of heartache I went through yesterday troubleshooting this problem w/ my Treo. The culprit ended up being that the Treo 650 shipped with a crappy hotsync cable. The connections on it apparently are faulty and the result is that it will intermittently throw an "unknown usb device" error when you try and sync.

I had been using mine successfully since February to sync contacts and other info w/ Outlook as well as a wireless modem for my XP laptop. Yesterday morning it started failing. When I researched the error on PalmOne forums, I found a handful of others who posted about the usb sync problem on their Treo 650. The solution that had worked for someone was to run the support hamster maze with phone tech support and get a new cable shipped. Before trying that I reinstalled the Palm Desktop and drivers, did a hard reset on my Treo, deleted the old USB devices from the device manager just to be sure- nothing fixed it. So I called Cingular and pleaded my case for receiving a new cable. Instead of them apologizing for their problem that cost me the entire morning, the lady points me to the CYA (ahem) Cingular Wireless device compatibility page indicating the Treo 650 is not compatible with any operating system. "Hrmmmm… so you’re saying that nobody with the 650 is using it to connect to their computer? That’s funny considering it’s worked for me the past six months and I wouldn’t consider buying a phone now that couldn’t talk to my computer."

Bottomline, get a second opinion always. I went to a physical Cingular store and explained my problem. The guy gave me a new cable to try and sure enough, it fixed the problem. I belive what happened was that Cingular may have been inundated with support requests for this exact problem and (like the automobile dealers that determine that litigation is cheaper than performing a recall) they decided to claim no OS’s are officially supported rather than ship new cables to people that complain. This is pretty silly in my opinion. I’m just happy that the problem is now resolved- it’s a naked feeling you have when you come to rely heavily on a device like I have with the Treo and suddenly it’s toast.

Tagged with:
preload preload preload