How To Do It

leave a comment »

Woman programming a huge early computerPerl

There’s more than one way to do it

Python

There is one way to do it

PHP

I found a way to do it but it didn’t work. I’m just going to do it in WordPress

ColdFusion

You can do that?

.NET

There is one way to do it, but you can do it in any language you want

JavaScript

I know how to do it in jQuery. Does it have jQuery?

Clojure

First let’s do math!

Ruby

This is the right way to do it. All the other ways to do it suck.

Objective-C

Just do it like you’d think Steve would want it

C

Already did it

C++

It’s done, it’s just compiling.

Lisp

Once you’ve done it like this you will never be the same

 

Ok, that’s what I came up with. Got any more? Tweet them @muddylemon or comment on this post.

Written by Lance Cameron Kidwell

24 January 2012 at 4:08 pm

Posted in Coding

Shut up and take my money

leave a comment »

Caught this discussion on reddit between a few well-intentioned redditors asking for advice about a very early stage startup. I can’t promise to invest quite yet.

 

Written by Lance Cameron Kidwell

22 January 2012 at 4:36 pm

Posted in Miscellania

Dreamhost is incompetent

leave a comment »

This site was offline for three days due to the unbelievable incompetence of Dreamhost. There is no excuse for a company in the business of hosting websites to fail so miserably and so often. The reason for the outage is unclear, their infrequent updates would refer to different pieces of failing hardware. The backup server, which is oddly singular in their parlance, failed while restoring to a new server that failed for similar hardware reasons.

I’m off to the cloud!

 

Update: It took a couple days to move off of dreamhost due to more unplanned outages as well as a hacker accessing their authentication database requiring mass password resets. Srsly.

Written by Lance Cameron Kidwell

20 January 2012 at 3:54 pm

Posted in Miscellania

Online Audio Is A Poor Format For Learning Code

leave a comment »

Saw a link to a “radio show” about Advanced OO Patterns. I thought that was an odd format for a topic like that. Online audio presentations are great for ideas that live mostly inside your head, but code you usually need to write down. I clicked the link and found a flash-based audio player. No slides or video or text, just the audio. I thought I’d try it out and record my notes….

9:50 pm

Some guy  says he will be speaking about dependency injection, lazy initialization, and, possibly, if there is time, service locater patterns. I can’t place his accent. I don’t think he said his name.

9:56 pm

He is trying to encourage the people standing in the back to sit down.

9:58 pm

Apologizes for a poor performance he gave at a previous conference. Explains that the time limit of the previous conference made it hard to present a coherent presentation. Says he will never work with those conference organizers again.

10:00 pm

 He’s apologizing that he doesn’t have much time to cover his topic. Says he won’t have enough time to explain everything properly.

10:08 pm

Speculating that even if you don’t understand what he says he hopes this presentation might at least inspire you to look up the topics later. (Sell it man!)

10:14 pm

Now he’s pointing out that this talk is a waste of time if you don’t look at the code samples in his slides. Asking people to not talk or use their laptops and please follow the slides.

10:16 pm

Spends the next few minutes reading the code out loud. Makes a point of saying “Semicolon” loudly at the end of each line.

10:25 pm

Something in the code reminds him of closures. He asks if anyone is using closures in PHP 5.3. He forgot what he was talking about, is trying to find his place in his notes.

 10:28 pm

He’s apologizing for how complicated his code samples are. He is using code from real projects but hasn’t removed irrelevant parts. That didn’t stop him from reading those parts out loud.

10:32 pm

Asked the audience for examples of software patterns. Someone says “singleton.” He spends the next 3 minutes berating the audience member for using singletons. Concludes that we will learn why later.

10:37 pm

Asks if everyone is still awake. Says he should have ordered a coffee service. Jokes that maybe he should have ordered a beer service. Forgets what he was talking about; tries to find his place in his notes.

10:40 pm

Can everyone read the code on this slide? Asks if anyone can find something wrong with the code. Waits for an answer. No one responds. He asks again. Someone says that it isn’t testable, he snaps that isn’t relevant. Says in the real world no one wastes time with such things. Points out that the error is that it isn’t using dependency injection.

10:45 pm

He’s out of time. Says we should download the presentation on his personal website that he recites. It involves a lot of dashes and slashes.

10:50 pm

Asks if there are any questions and answers the one about when the next session starts. There is coffee in the lobby.

 

Conclusion: Online audio is the least of our problems

 

 

Written by Lance Cameron Kidwell

17 January 2012 at 10:30 am

Posted in Coding

Two Player Game

with one comment

80s Gaming Console from ColecoWhen I was a kid my dad bought us a video game system for Christmas. This was in the early eighties — the height of the Atari era.

We got a Coleco-vision.

It came with Donkey Kong. We were lucky that it came with a game because there weren’t any other games available. Literally. The Coleco-vision was discontinued and we’d already missed the closeout sales on Coleco games. I think any that were left were likely being used as a mulch over the buried ET Atari games.

A few years later we were introduced to the Nintendo. The kids who lived across the street had won a vacation to Guam.  The highlight of the trip was when Rusty, the younger sibling, had stumbled across a hundred-dollar bill on the beach. Rusty had kept the bill on his person for the entire trip, sleeping with it under his pillow. Upon their return this windfall was immediately applied to the purchase of a Nintendo Entertainment System.

Until that point our only exposure to Super Mario Bros. and Duck Hunt was in Nick’s house up the street. He lived in one of those oppressively decorated houses that always smelled faintly of peanuts. He was allowed to have at most one friend over at a time. We would sit quietly on their velvety couch and watch Nick play. We never got a turn. It was his Nintendo and he was going to play it. If we wanted to watch, that was fine, but he felt no compulsion to share the experience. Still, we could pretend we were playing. We’d sit behind Nick and twiddle our thumbs and wish Nick would actually try to go down that green pipe. “No,” he’d reply. He had done that already and it didn’t interest him.

You can imagine how exciting it was to have a Nintendo in the neighborhood not controlled by a sociopath. It wasn’t long before we discovered that NES could breed Machiavellian machinations that pre-pubescent boys are not ready to handle.

Rusty, the younger brother, had found the money. It was an open and shut case. Mickey was happy for his brother. Rusty, though generally a dull boy, realized instinctively what sort of leverage he had suddenly acquired. It was delicious. When we’d come over to play, Rusty was a gracious host. Anyone could play if they asked permission. He would set time limits. He would arbitrarily alter the limits. We would pray the he would not alter them further.

He was at times capricious and cruel and then suddenly generous. Pre-pubescent boys have limited social sophistication but all of us quickly learned how to curry favor, flatter and conspire.

All of us except Mickey.

As the older brother, and the oldest by a hair in the two block radius that defined our territory, he was used to a certain level of discretion and control. Being suddenly bankrupted, by his little brother no less, was more than he could bear.

Mickey seethed. He plotted. He used what leverage he had, his superior size and experience, to the best of his ability. Games got rough, accidents happened. Tensions rose. After a few weeks, he didn’t even come into the room. He’d stay in his bedroom making model planes or reading.

Afternoons in our neighborhood followed seasonal patterns. We spent the summers outside on our bikes and at the pool. We’d build bike ramps at the bottom of the big hill and test our bone strength and our mother’s nerves. When the weather worsened we’d move inside. Roaming from house to house we’d encamp in each other’s basements, living rooms and bedrooms. It was our customer after school to pick a house to gather at. Since the acquisition of the Nintendo, Mickey and Rusty’s house had become the default destination.

One rainy autumn afternoon, I went to Mickey and Rusty’s house and found it empty. I hopped on my bike and rode a soggy circle around the block. At the other end of the street I saw a pile of bikes in front of Phillip’s house. Phillip had a sweet little den in his basement. He’d set up some old furniture and milk crates into a makeshift lounge behind the stairs. It was an ideal hangout with proximity to snacks in their basement pantry. There was an unspoken rule at Phillip’s house that you didn’t go upstairs. I had been up there a couple times for particularly urgent bathroom breaks. Upstairs his house was dimly lit and smelled heavily of stale cigarettes. His mother was usually asleep on the couch with a loud television tuned to an afternoon soap opera.

I walked around his house to the sliding glass door in back. Inside was every boy in the neighborhood, including a bawling Rusty. I came in and asked a boy on the edge what had happened. “Rusty lost his Nintendo to Phillip.” he told me.

“What do you mean?”

“He bet Phillip his Nintendo that he wouldn’t… you know that mean old lady with the little grey dogs? He bet that Phillip wouldn’t pee on her porch.”

I considered this. “So he did it?”

“Pfft, he rang the doorbell and waited until she came to the door.” My eyes widened. “I think he got some on her shoes.”

Rusty had made a stupid bet. At the very least he was a poor judge of character. Phillip was the kind of kid who would eat a grasshopper for a dollar. More to the point, he was the kind of kid who would eat three grasshoppers and a worm on top of it just to make sure you didn’t welsh on the bet.

After the peeing incident, I was told that Phillip casually flipped the old lady the bird, zipped up and rode down to Rusty’s house to collect his winnings. Rusty responded with the only reasonable course of action available to him. He went to Phillip’s house to tell his mother. Phillip’s mother answered the door and listened to his story while dragging dramatically on her cigarette.

At the end of his story she asked, “So, what do you want me to do about it?”

“Make him give it back to me!” Rusty said.

“Why? You made a bet, didn’t you?”

Rusty blinked.

“Just think of it as a good lesson.” she concluded and closed the door.

That led to the meeting I had discovered. The boys in the neighborhood were divided. We could see the point that a bet is a bet and Phillip had more than satisfied it. However, we could also imagine what it would be like to lose such an enormous asset. Phillip was trading future game time for allies, mostly among the kids from his end of the street.

Rusty was far too agitated to make much of a case for himself. As the arguments escalated we suddenly felt a cold draft. Behind us Mickey had come into the basement. Without saying a word he walked up to Phillip and punched him square in the nose. Phillip collapsed as blood spurted down his face. Mickey reached behind the couch and picked up the Nintendo. He carefully wound up the wires on the controllers and the duck hunt pistol. He lifted the hood and checked the game inside. “Come on, Rusty. Let’s go.” He said.

We backed up and opened a path to the back door. Mickey walked out with Rusty silent behind him. Phillip’s friends poked at him and whispered. Phillip got up and pulled a roll of toilet paper down from the shelf above him. “Go home.” he said.

We left.

I stopped at Mickey and Rusty’s house and looked in the front window. They were sitting on the floor together laughing. They each held a Nintendo controller and were playing Super Mario Brothers. They looked like they were having fun. I didn’t want to interrupt them, so I went home.

Written by Lance Cameron Kidwell

10 January 2012 at 11:04 am

Posted in Miscellania

Shoulders

leave a comment »

A man crosses the street in rain,

stepping gently, looking two times north and south,
because his son is asleep on his shoulder.

No car must splash him.
No car drive too near to his shadow.

This man carries the world’s most sensitive cargo
but he’s not marked.
Nowhere does his jacket say FRAGILE,
HANDLE WITH CARE.

His ear fills up with breathing.
He hears the hum of a boy’s dream
deep inside him.

We’re not going to be able
to live in this world
if we’re not willing to do what he’s doing
with one another.

The road will only be wide.
The rain will never stop falling.

“Shoulders” by Naomi Shihab Nye, from Red Suitcase. © BOA Editions, Ltd., 1994.

Written by Lance Cameron Kidwell

5 January 2012 at 10:30 am

Posted in Miscellania

Lying At The Barbershop

with 2 comments

Photo of an old barbershopThe guy that usually cuts my hair wasn’t in today. I always wait for him when I go in. Not because he’s a particularly skillful barber, but because of an awkward moment that happened the first time I went to that barbershop.

I had gone in for a haircut after a two year hiatus. For one year I shaved my own head for reasons that I could never really articulate. At the end that experiment I just stopped cutting my hair. I had never had long hair before and being a married guy in his mid thirties with a stable job I couldn’t think of any reason to not take the time to see what I looked like with long hair.

One day having observed the inescapable conclusion that I looked like a homeless person with long hair I impulsively chopped it into what resembled a shoulder length Rachel.

Obviously I couldn’t walk around looking like a tranny who couldn’t afford hormone pills, so I headed down to the Southside Barbershop. I chose that shop because I knew the guys that worked there were the tattooed rockabilly type and I hoped they could do something interesting with my hair.

When I got there I found two barbers with customers in their chairs and a couple waiting on the side. I sat down and read the comics from the eviscerated weekday newspaper. After a few minutes one of the barbers got my attention and invited me up.

I hesitated.

Upon arriving I had already selected a barber in my mind. The other guy had a great beard. This guy, the one ready to cut my hair, was mostly bald with a wiry and patchy beard. Usually I would prefer the barber with worse hair as I assumed they cut each other’s hair and I’d want the guy who did a good job and not the one that did a bad job. This guy didn’t leave me much to work with. They both had beards and I figured the rules were reversed for beards. So I wanted the guy with the full lumberjack beard not Wiry McPatchyface.

So I said, in a manner that I hoped would hint that this was a long standing tradition, that I was waiting for the other barber, Tom.

“Oh, ok.” Wiry said and sat in his chair. I looked at the other two guys waiting.

“Do you…” I pointed, Vanna White style, toward the chair.

“No, ” said one, “I’m just here to hang out.”

The other guy shook his head. “I’m waiting for Tom.”

“Oh.” I looked back at Wiry who was sitting directly in front of me. I wanted him to know it wasn’t because I thought he was a bad barber. My mind raced and in a moment of cringe-inducing fail it settled on: “I, uh… I just think he has a better beard.”

“Yeah.” Wiry said. “That’s ok.”

We all sat in awkward silence until another customer came in the door and got Wiry busy again. Finally the door chimed. It was the mailman. A few painful minutes later the door chimed again. The guy looked at the three people waiting ahead of him.

“Is there a long wait?” he asked.

“No,” Wiry said, “I’m open.”

“Oh, I was…” the man hesitated. “I usually have Tom cut my hair. Are you all waiting for Tom?”

The guy ahead of me said yes. I considered changing my plans. I didn’t have a real reason for waiting for Tom before but now that everyone else was insisting on it I felt like I might be on to something. I nodded.

“I’ll come back later then.” The man said and left with a wave. Wiry went outside for a cigarette.

Since that day I’ve been committed to Tom’s craftsmanship out of sheer social awkwardness.

Today, however, Tom wasn’t there. Wiry was thankfully busy with someone else. Not wanting a repeat of my first visit I immediately accepted the invitation of a new barber I’d not seen before.

After getting through the first pass on my overgrown head the new guy, let’s call him Ponch, noticed my forceps scars. I have two small bald patches on either side of my head that stem from some aggressive forceps work by the doctor who delivered me. They’re not particularly noticeable and most barbers have seen them before. Ponch, however, seemed new to the razor.

An old barber cuts hair in Shiraz“What’s this man? You have a big scar up here.”

“Yeah,” I replied, “there’s another on the other side, too.” Ponch looked and confirmed this.

“What happened, man?”

“I was shot.”

“No way! For reals?”

“Yeah, it was a through and through. 9mm.” Ponch’s eyes grew wide.

“How’d you not die from that?”

“The doctors say it was a miracle.” I said. “It was a first for medical science. My brain actually ducked.” Ponch looked confused. “They don’t even know how it happened, but I had an MRI and the doctors could see some stress marks where my brain ducked to avoid the bullet. It only had to go down about an inch or so.”

Ponch put a finger on each scar and considered the trajectory. He whistled. “Wow, you were lucky. Who shot you?”

“My dog.” I said. Ponch stopped clipping. “She was scratching at the door of an old farmhouse we had rented in Vermont and knocked over a gun display. Apparently one of the guns was loaded and fired. It hit me right there on the skull as I was bending over to put on my shoes so I could take the dog out. My wife found me and got me to the hospital.”

“Oh my god,” Ponch said, “What happened to the dog?”

“That was the saddest part.” I said, “She felt so bad about what happened that she stopped eating. Would just sit by the back door and whimper. The day I got home from the hospital she had thrown herself against a bookcase until it came down on top of her and killed her.”

Ponch blinked. He finished my cut and I paid him, thanking him for doing a great job. A new customer came and settled in Ponch’s chair as I left. As the door closed behind me, I could hear Ponch saying, “Man, you have to hear about how the last guy got shot in the head!”

Written by Lance Cameron Kidwell

27 December 2011 at 3:40 pm

Posted in Miscellania

The Once A Year Card

leave a comment »

Are you the sort of person that never remembers to buy cards? Birthdays, Christmas, Get Well…. it just doesn’t occur to you.

It’s not that you don’t love the people in your life, you’re just not the sort to express it by buying stationery.

Here’s your solution: The Once A Year Card

It’s a card that very directly and clearly states that I am sending it to the recipient because I want them to know that I occasionally think of them, that I feel empathy when they’re sick and I sincerely wish them the happiest of birthdays on whatever date their birthday may actually be. If they got married recently then “Congratulations!” If they had a child then, well… “Congratulations” for that too! Unless one of us is Jewish in which case it is more fun to say “Mazel Tov!”

As far as Christmas goes you’re free to assume my family had an awesome enough year. If anything particularly important happened you read about it on Facebook. That is, if it was any of your business.

Some people need to receive decorated paper inscribed with a poem or a joke that expresses the feelings that I am at least pretending to have. That is a reasonable demand and to accommodate your quaint but perfectly valid expectations I offer you this, The Once A Year Card.

Merry Whatever and Have A Jolly Humbug!

Written by Lance Cameron Kidwell

21 December 2011 at 7:44 pm

Posted in Miscellania

For You Mamasita

leave a comment »

Corpo de Mujer

Cuerpo de mujer, blancas colinas, muslos blancos,
te pareces al mundo en tu actitud de entrega.
Mi cuerpo de labriego salvaje te socava
y hace saltar el hijo del fondo de la tierra.

Fui solo como un túnel. De mí huían los pájaros
y en mí la noche entraba su invasión poderosa.
Para sobrevivirme te forjé como un arma,
como una flecha en mi arco, como una piedra en mi honda.

Pero cae la hora de la venganza, y te amo.
Cuerpo de piel, de musgo, de leche ávida y firme.
Ah los vasos del pecho! Ah los ojos de ausencia!
Ah las rosas del pubis! Ah tu voz lenta y triste!

Cuerpo de mujer mía, persistiré en tu gracia.
Mi sed, mi ansia sin límite, mi camino indeciso!
Oscuros cauces donde la sed eterna sigue,
y la fatiga sigue, y el dolor infinito.

Vente poemas de amor y una cancion desesperada - Pablo Neruda, 1924

Body of a Woman

Body of woman, white hills, white thighs,
you look yourself like a world in your attitude of surrender.
My rough peasant’s body digs in you
and makes the son leap from the depths of the earth.

I was alone like a tunnel. The birds fled from me
and the night enveloped me with its crushing invasion.
To survive myself I forged to you like a weapon,
like an arrow in my bow, like a stone in my sling.

But the hour of vengeance falls, and I love you.
Body of skin, of moss, of eager and firm milk.
Ah those goblets of the chest! Ah those eyes of absence!
Ah the roses of the pubis! Ah your voice slow and sad!

Body of my woman, I will persist in your grace.
My thirst, my unbounded desire, my uncertain road!
Dark river-beds where the eternal thirst follows,
and tiredness follows, and the infinite ache.

Twenty Love poems and a song of despair - Pablo Neruda, 1924

 

 

Written by Lance Cameron Kidwell

18 December 2011 at 12:01 am

Posted in Culture

Christopher Hitchens Lived

leave a comment »

I always knew there was a risk in the bohemian lifestyle… I decided to take it because it helped my concentration, it stopped me being bored — it stopped other people being boring. It would make me want to prolong the conversation and enhance the moment. If you ask: would I do it again? I would probably say yes. But I would have quit earlier hoping to get away with the whole thing. I decided all of life is a wager and I’m going to wager on this bit… In a strange way I don’t regret it. It’s just impossible for me to picture life without wine, and other things, fueling the company, keeping me reading, energising me. It worked for me. It really did.

– Christopher Hitchens 1949 – 2011

 

Written by Lance Cameron Kidwell

16 December 2011 at 4:10 pm

Posted in Culture