I Kicked a Server – A Love story

Part the first: The What

The end of the first month of the year brings many things. Fiscal closings, abandoned resolutions, ruminations on groundhogs… For us however, it brings another, more insidious creature: Inventory.

And so, once again, changes need to be made to rickety old code that gets dusted off once a year. I pop open the PHP code to make a change here or there only to feel my heart sink at this blight of bytes. Quickly rebounding, my heart races, and I feel the rush of the possibility, “Rewrite” I exclaim! Alas, there’s no time for that.

My hopes dashed, I take a second look at the code and decide all that’s possible, all that can be hoped for is to leave the code better than I found it. Not so hard, I’ll just put it under git, and start making changes.

Woah! Not so fast. The Debian Noid is here, and he says that libc6 is out of date, and the only way out is to upgrade the kernal.

Tinkering, tinkering, toiling and typing, I get the system to an unbootable state in record time. At one point, I lamented aloud that I was in bootloader hell. Shortly thereafter, I introduce said machine to the leather on the underside of my foot. We both win. The computer feels no pain, and I feel a measure of relief.

Luckily (or is it unluckily?) I backed up the code. The team handed me the keys to a shiny new server, and soon enough it was ready to code.

Part the second: The Where

“Where” as a concept has been forever altered by our series of tubes. This code. Does it live on a server? Does it summer in New Jersey? Or does it only fully live in memory, both virtual and physical? It also has a “where” temporally. It was written around 2004, tweaked a bit each year and now settled into it’s current desolation.

Where? Where should the 2009 version of me come in and get this piece of code ready to be put through it’s paces (and I mean that in the simplest way possible. No unit tests, no QA, just hard-working folks doing a dry run). The code goes into git. I start first with the crux of the app &ndash: the code that takes an item and logs it into the database.

Abstracting and centralizing the database calls, cleaning out impossible to reach code branches, Un-repeating myself… I come up for air and realize that the store closed half an hour ago, and I’m stuck inside with high-tech motion detectors ready to betray me. It’s the first time I’ve gotten into the flow state with code I’m this disgusted by.

Part the third: The Why

Why did I do this? What have I learned here?

I could have just done a search and replace to get this code runnable for the test and ultimately the actually inventory, but that felt wrong this time. Not just a little wrong like it has every other year, but deeply and uncomfortably wrong. Instead, I took the long, scenic route to arive at a place I’m a little less ashamed of. And that, that has made all the difference.

Tiny Goals

In the coming days, I’ll be talking a lot more about goals and goal-setting (it is almost a new kastner-year), but right now I want to talk about a tiny goal I just set.

3 more feed items

Google Reader (43)

Only 3 items left and I’m down to 40 unread items (for those of you who would rather go shopping). I’ve been whittling this down for a little while now, and I’m getting very close. The problem is that I’ve long since blown through the “easy” items like Flickr photos, Makezine posts and Dropbox event notices. All I’m left with is great content by awesome people that I really want to savour.

Why this? Why now? Why only 3?

I should be in bed, working on stuff that matters or even knitting. But I’m staying up and reading these 3 items (actually, right now I’m writing about reading them, but when you read this, I’ll be long done – hopefully with both the writing AND the reading).

Some people even think reading feeds is a total waste of time. Even if I agreed (which I don’t, more on that later), I’d still want to hit this goal. I need a win right now. Any win will do. By hitting this, I get to go to bed knowing I accomplished something (no matter how trivial), and I reinforce the belief that I can set, and achieve goals.

As for why 3… well why not? I know how meaty each item I have left is, and 3 gets me to a nice round number.

Finally, a small request…

stop making cool stuff

Medium Business Blues

As I was heading to bed last night, I posted a question on twitter: “What should I blog about tomorrow”. My friend Joe Stump quickly came back with this:
What needs are not being filled by the web for medium size businesses?

It’s an interesting question that made it hard for me to go to sleep (thanks Joe). But I think I have an answer

It’s not just the web… it’s all of software

The web isn’t the problem. I think medium-sized (and a lot of small) businesses are really lacking in good software. Even worse, a lot of the software they use everyday makes what they do harder. Like most things, it’s partly social, partly technological.

Sally, the warehouse manager, gets a new piece of software, and because she’s always used other people’s stuff and never written her own, she’s used to “following the rules” on the computer, and ultimatly jumps through hoops instead of trying to find a better way. It’s not her job to try to figure out what the software should do. So she ends up copying & pasting into Excel. She figures out to wait one second before hitting enter in that form, or else it’ll beep and lock up. She uses the “location” field as the secondary inventory, because isn’t not being used.

It’s not your fault

Your core business is selling wine, not supply-chain management. Even if you could hire a coder or two to make your operations more efficient, you’d extract more value by streamlining the buying of wine than making your warehouse manager marginally more efficient.

Let’s take an example: Amazon. What’s their core business (or was a few years ago)? Selling?… Selling what? They started with books, but their core business was shuffling goods around. Supply Chain. So what’d they do? They wrote it themselves. Now they have teams of robots and the infrastructure to bring on new suppliers instantly.

Jeff Attwood (by way of Joel Spolsky) wrote about core business coding in Programming is Hard, Let’s Go Shopping!. The conclusion is that even if the software is out there, doing it yourself gives you an opportunity to have a unique advantage.

It is our (the computer folks’) fault

When I started at the Wine Library, there were about 20 employees and a really rickety old POS system. That POS system did inventory, registers, (very very basic) accounting, and exporting to the web. After 7 years, a lot has changed, but we still don’t have great software for ANY parts of our operation.

Software is hard. Let’s fix it

How do we get to there from here?

I think the Agile methodologies point in the right direction. Amazing folks like Amy Hoy are helping lead the way towards user-centric, easy to use software that can solve problems, and make everyone happier and more productive.

But, I’m a freelancer…

So? Find a local business that’s big enough to need you, and small enough to really dig the savings they’d get by having some major part of their day-to-day easier and nicer. Not a UX person? Find someone to team up with. Coding is the last step in the process. Drawings, storyboards, talking, paper-models, all that “touchy-feely” stuff is how great software gets made.

Eat the dog food. Use this “great” thing you’ve built and see where the sticking points are

Observe the people who know more than you do about this part of the business. See what’s hard for them. Just because you know how to navigate a form by keyboard, doesn’t mean they should have to.

What about the Web?

None of this stuff precludes the web. All kinds of formerly desktop software is moving over (and has been for years). Why can’t supply-chain or call-center software do the same? Just be smart! Use SSL where appropriate, don’t store credit-cards, try to break your software with bad input.

Why Summer School Rocked

I almost stayed back a year in high school.

There was a very good reason… One I can’t fault the administration for: I didn’t do any homework. My mom tried (bless her heart did she try… and try…. and TRY). Nothing worked. I just found it all so boring and pointless.

I wasn’t one of those overachievers that went to Summer School to get ahead

I went because I had to. I fought so hard and made life hell before I got there. What I realized after a week or so was that I was having a great time. I always had my work done. Finished everything first. Was engaged… a star.

What happened?

Was it that the work was a bit easier than “normal” school? I doubt it.
How about knowing that my butt was on the line, and it was this or repeat a grade. Not likely.
Super amazing teacher? Nope (she was good, don’t get me wrong).

The power of focus

Surprise, surprise, I have ADD. Old school, missing the “H”, honest-to-goodness ADD. What made me a star at summer school was that it was ONE class, with one subject for a stretch. I could put the weight of my mind on a single problem at a time and focus till it was done. No distractions from other subjects… No getting overwhelmed by the crush of homework from everything else.

So what?

By now, you dear reader, may be asking, “So what? Why do I care? How does this help ME”. Here’s how:

ADD, ADHD, Aspergers or just plain lazy, it’s easy to get overwhelmed. We’re in the age of GETTING THINGS DONE, with action lists, next items and TO-DOs. If you can isolate one thing at time, and here’s the key, block out everything else. Ignore the rest of it, you’re much more likely to get it done, and feel a whole lot better in the process.

Feedback

Let me know what you think. Leave a comment, or just tell me on twitter… You don’t need a whole new TO-DO here. Just “@kastner You’re so wrong it hurts”, or “@kastner I was stuck in the bathroom at summer school… the entire time. (my zipper got stuck)”

New Theme, new day

I have a new theme!

After migrating my blog to a different corner of my server, I forgot to put my theme back (A custom version of K2). I’ve also had this grand plan for a while to make the theme of my dreams.

Instead of just waiting around for me to “find some time” (not going to happen), I decided to bite the bullet and use someone else’s theme.

The theme is Rusty Grunge from Chris Wallace.

I love the theme, and how easy WordPress made it for me to get everything set up the way I wanted. However, this is how happy I am about needing to use someone else’s code:
long hair

The problem with Girl Talk

Out of nowhere, I had the need to hear Nothing Compares 2 U. After grabbing it and listening, I keep expecting to hear Stuntin’ Like My Daddy.

The same thing happened to me back in the day on a commercial for Modern Rock (from time life) if I remember correctly. To this day I can’t hear “Der Kommissar” without expecting “tainted love” to come in during the hook.

This happen to anyone else?

redirecting to a wordpress post based on custom fields

Over at Wine Library TV, we number each episode (episode #608 just went live). To make this happen on the WordPress side (beyond just the title), we take advantage of WordPress Custom Fields (a really awesome feature).

Recently, I had the need to take in an episode number and redirect to that episode’s post page. For example, if they enter 608, they should go here: http://tv.winelibrary.com/2009/01/15/the-wines-of-bierzo-spain-episode-608/. I did a little bit of searching and didn’t find what I was looking for, so here’s the script (more or less) I ended up writing.

(If you can’t see it, visit it here: http://gist.github.com/47701)

It’s pretty simple. I take the post number and do a lookup in the wp_postmeta table for an entry that has the meta_value of the number and meta_key of “episode” (our internal name, sneaky huh?). Then I make a call to get_permalink using the returned post_id. If all goes well, the visitor is redirected.