Monday, January 04, 2010

Oh, it really is the rich getting richer, after all

(Update, Jan 6, 2010 - Bad math corrected.)

I've heard the phrase "it's the rich gettin' richer and the poor gettin' poorer" often throughout my life, usually by old-timers discussing politics, social mobility, the decline of the middle class, things like that. Like most things people say when they're complaining about the government or "rich people", I didn't put much stock in it.

Each year since 2006 I have created a spreadsheet at work to calculate what my paycheck should be. You fill in how much you pay for insurance, whether you're filing as single or married, how many exemptions you're claiming, and your salary, and it outputs what your paycheck should be - give or take a couple pennies. To make it work correctly, I stumbled through figuring out how gross, taxable, and net income are calculated, what federal, state, and local withholdings should be, how exemptions work, how 401k and company paid benefits are calculated, what marital status really changes. Here are a couple examples to show how nuts payroll math can be:
  • 401k isn't tax-free. Medicare, Social Security, and the city of Columbus all tax your 401k contributions.
  • Saying you're married on your W-4 decreases federal withholding only, and only if you make more than $15,000. The state of Ohio doesn't care if you're married or not.
  • Employee-paid benefits (life insurance, for example) aren't really free. They count as a raise in taxable income that is deducted back off after withholding is calculated.
So today I started on this year's spreadsheet using the withholding tables listed on 2010's Publication 15 on irs.gov. The tables looked odd, making me suspicious, so I investigated and got all mathy. Usually as your pay rate goes up, your tax rate goes up. In 2009, for example, single people making over $10,400 annually were taxed at 15%. Those making over $36,200 were taxed at 25%. $66,530 = 28%, $173,600 = 33%, and $375,000 = 35%. This year was similar, unless you make between $84,450 and $87,700. In that range, your tax rate jumps up from 27% to 30%. After $87,700, the rate drops back down to 28%. Confused, I decided to run the 2009 tables and 2010 tables through for different pay rates to see what the real tax amount would be for each income level. As you can predict, that produced a pile of meaningless numbers, and my eyes quickly crossed. "OK, then," I said to myself "let's just subtract the 2010 tax from the 2009 tax for different income levels and see what happens". It took a few seconds of glancing at the results for me to loudly declare that yes, indeed, the rich are getting richer, and the poor are getting poorer. Not by much, but by enough to notice. If you make $10,000, this year you'll pay $113 more in federal deductions than you did in 2009. If you make $200,000 annually, this year you'll pay $1,000 $25.85 LESS in federal withholdings than you did last year. Here's a chart showing some sample incomes and change in withholdings, including the sweet-spot of $76,865 where the withholding is the same both years:

Wednesday, November 25, 2009

The screw-up, my eminent demise, and perfect clarity

Somewhere ages and ages hence:
Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference." - Robert Frost

The end is nigh.

My grandmother called me Sunday night. She informed me that God may take my daughter away from me because she was at home by herself before the age of 16. Either God, or my ex-wife's parents.

After getting divorced and re-married, I can no longer claim the "head of household" tax status, and Scout's mother can no longer receive as many college grants, or any government subsidies to pay for Scout's daycare. Living in sin, by contrast, is much more cost effective. The higher tax obligation and new funds requirement for little Scout coupled with other financial support of my family (both cars, mortgage, the usual home expenses) has drained me of disposable income.

Tack onto all that the downturn of the American economy, AEP did not give raises to anyone this year, and the loss of my long-time roommate. No raise, no help with the mortgage, no tax refund, and an unexpected $130/wk daycare expense. I have since drained my emergency savings account trying to stay above water.

Sunday, November 01, 2009

Indefinable Influence - Books that nurture the right-brain

"Lying on a stack of straw on the threshing floor, I had been reading for a long time – and suddenly I revolted. Once again reading all morning, once again with a book in my hands! And it’s been that way day in, day out, since I was a child! I’ve spent half my life in a world that doesn’t exist, among people who never lived, invented people, being as agitated about their fates, their joys and sorrows, as if they were my own, linking myself to my dying day with Abraham and Isaac, Pelasgians and Etruscans, Socrates and Julius Caesar, Hamlet and Dante, Gretchen and Chatsky, Sobakevich and Ophelia, Pechorin and Natasha Rostova! And how can I now distinguish between real and imagined companions of my earthly existence? How can I divide them, define the degree of their influence on me?" - книга("Book"), Ivan Bunin

I was once a fulltime reader, a book nut who, in my sparsely furnished apartment, had an easy chair with a stack of books on both sides. The year was 1992, I was 21, living alone, and perpetually broke - but didn't really notice. I had no computer (save a beat-up and ageing Apple //c) and no television, just a CD player with which to play my Jimmy Buffett and Led Zeppelin, and a Half-Price Books habit. When I would get home from work, I would put on some music, cook and eat dinner, clean the kitchen, and then sit in the chair to read until I was too tired to continue. When I had finished a book, I would place it on top of the stack on the right side of the chair, and then grab the next book from the stack on the left.

Since then, life moved on, and I lost at first the time to read, and then the habit. Now I'm lucky to finish three physical books in a year. I have cheated on reading by listening to audiobooks in my car on long trips, or on the commute to work - a habit I picked up when I delivered pizza and got tired of the radio.

I stumbled across the above quote last week, and it really struck a nerve with me. I reflected for a while on the days of the simple apartment that I lived alone in, the chair, and the stack of books. And then I began thinking of my Hamlets and Dantes - Siri and Miles Teg, Fiver and Joseph Knecht - and the fantastic worlds opened to me from the stack of books, and the books read to me in my car. So like we geeks do, I made a list. Below are some of the more creative or personally influencing works I've come across. I expect everyone has heard of some of these, possibly most of them, but some of them are gems I stumbled across that I have never heard discussed, which is a shame, because they're all brilliant and everyone needs to read them.

Here, then, are my 15 recommendations of books worth reading. Ideally, you should read all of them, and we should get together at the local pub and talk about how awesome they were over brews and greasy food... but I'll take what I can get. I'll write some basic setting details and impressions, and I'll do my best not to ruin the stories by revealing too much plot.

1) Across the Nightingale Floor - Lian Hearn

Friday, October 23, 2009

News of the week

Puff makes friends

I worked from home yesterday so that Scout wouldn't have to go to daycare for the few hours between Liberty leaving for work and me coming home. The day was uneventful, Scout played quietly while I worked, I made her some lunch, she watched a movie, then I was done with work and we went out.

We went to Stacey's school to watch Stacey play in the annual Powderpuff football game between the 7th and 8th grade girls. Stacey's team won handily (34 to 6, I believe), and she managed to get a little muddy, a little banged up, but in good spirits overall. Scout was happily cheering for a little while, but quickly became bored with the game, and struck up a conversation with the 5 year old beside her. A transcript, F for friend, S for Scout:

F "I like your Hello Kitty shoes."
S "Thanks, I like your Hello Kitty necklace."
F "Thanks, my mom got it for me. Do you live on Greenwood drive?*" * - name changed, not actually Greenwood drive
S "No, we live in Westerville."
F "Are you in school?"
S "Yes, I go to dinosaur school."
(pause to hear my whispers)
S "Oh, right... I go to Nikou, it's a dinosaur school."
F "Oh." ... "I'm in kindergarten."
[lull in conversation]
(pause to hear more of my whispers)
S "What school do you go to?"
F "Mark Twain. Do you leave near Greenwood drive?"
S "We didn't drive, we walked."

Wednesday, October 14, 2009

Latest Tinkerings

Google Voice



About a month ago I put my name on the "send me an invitation" list for Google Voice. Yesterday I finally received my invitation, and set the account up today.

If you haven't heard of this before, it's a free phone number from Google, free voicemail, free SMS messages, but not actual phone service. It rings all your existing phones, or just the phone you tell it to. It can forward SMS messages to your mobile phone or not. It can give different callers different greetings, and block callers. It handles voicemails as an email with an audio attachment, and attempts to transcribe the message.

The above image shows Google's attempt to transcribe me leaving myself a voicemail. Those of you who have heard me speak know I mumble terribly. In fact, I'm barely comprehendable when I'm right next to you in a quiet room. I left myself a mumbly message and said exactly the following:

"Hi Curtis, this is Fred. Give me a call when you get a chance. See ya'. Bye."

Hearing "Curtis" as "Chris" I've been putting up with my whole life, so no surprise there. I kind of slurred together "See ya" as one word, so missing that is understandable, too, I just don't know how they got "Ciao" out of it.

Another cool thing you can do is put a "call me" link on a web page or email that doesn't expose the phone number, and you can delete it later. Looks like this is going to be a fantastic service, and I'm happy I signed up early.

Ebay Merchant Account

Several years ago I helped a lady set up a website to sell her handmade jewelry. She owned a domain name and had a web host set up, and a php-based e-commerce engine that had hooks into Paypal. The main purpose of her seeking me out was to have me add code to the php scripts that could handle county lookups by zip-code, and offer a choice of counties to the user if their zip-code spanned counties (like mine does: 43081 crosses the county line between Franklin and Delaware counties). This was all to handle a new Ohio tax law that required Internet sellers to charge the correct tax rate for destination counties.

That part was pretty straight-forward; I just added a page that, if the destination state was Ohio, queried a lookup table (PostgreSQL, I believe it was... select county from lookup_t where zip = $input, something like that - after $input was sanitized, naturally), and prompted you if there was more than one hit. The hard part was understanding how it interacted with Paypal. To help me get that working, I signed up my personal account for merchant functions.

Long story short, I figured everything out, got the website working famously, and the lady who hired me never had enough sales to support the site. She contacted me a year or two later to retrieve the customer info from the database before the site was taken down. Bummin'. Although, now I can do this with my paypal account:

Bring a Bag of Awesome to your parties! (only $10, plus tax)

Hire Curtis and Liberty to come to your parties and bring their keen insight, skill at party games, clothing and computer repair, and optional bouncer services if the party gets out of hand. For each extra Bag of Awesome you buy, we'll bring some sort of treat - 6 pack of cider, pizza, hors d'eouvres, board game, paper mache sculpture, what have you. Buy now, we ain't getting any younger!






The above button is the result of me experimenting today. It's actually functional, so don't play around with it unless you really intend to send me $10. Plus tax.

Monday, October 12, 2009

A sane adult's review of the Twilight series

The heroine of Twilight, Bella, spends 90% of the narration and dialog navigating a love triangle between herself, a werewolf, and a vampire. She does this with copious pillowtalk that, to my 13 year-old daughter, sounds epic and dreamy. Bella second-guesses herself, doesn't realize she is in love with the competing lover until he forces himself on her and she has time to reflect on it. To sum up the pillowtalk of book 3, Eclipse:

Edward: "I'll wait for you to figure out what you want, but them werewolves is dangerous and you should stay away."
Bella: "Cool, but I'm going to hang with them anyway, because I'm mad at you for not having sex with me until we get married."

Jacob, after pinning Bella and kissing her roughly: "You like that, don't you, bitch?"
Bella: "No, damn it! How could you? Drive me home right now.... Actually, I liked it quite well; let's do that again before you go off to get injured in battle."

Edward: "Hey, if you want him instead, you know, knock yourself out."
Bella: "I don't know, you're both so big and strong, but you're in front of me right now, so I'm yours, bebbeh, as long as you promise to do me just before you turn me into a vampire."

There, with those adjustments, the book could be condensed to about the length of a short story, a novella at most. And here's the shocker: It would be fantastic. The mythology in this series is very impressive, much to my surprise. The characters are very close to psychological archetypes - Edward is an Arthurian knight, with a knight's noble love for the queen, just barely suppressing his manly urges, sacrificing all for the sake of duty and rightousness. Jacob is a Viking, fighting with his small group against stronger opponents with greater numbers, sure of the futility of his efforts, but valiantly fighting to his inevitable doom. Bella is the mystery of the void, a siren to the undead, immune to their magical powers, the pure being that both sides want to protect from the evils of the other. She is Thumbelina, smaller and weaker than the beings that fight over her, questing to find the right prince to marry so she can become Maia.

Saturday, October 03, 2009

Oldschool Mainframe/COBOL geek-out

Oldschool Mainframe/COBOL geek-out

So I logged onto my work's mainframe a few days ago (for an arcane project-related purpose I won't go into), and, as I am wont to do, I poked around in my directory to see what I was working on way back when. Last year, I did a lot of work in our mainframe developing a job-scheduling solution. This year, I've been hanging out mainly in Unix land, and haven't had any mainframe contact for several months.

I miss the mainframe, the misunderstood behemoth, with its OCOPY and BPXBATCH, its copybooks, its IDCAMS and LISTCAT, and, lastly, its COBOL. But on the other hand, it's insane, and has a lot of acronyms that are unfamiliar to most of the modern IT world, who are knee-deep in C#.NET, Eclipse, and Oracle, or maybe Linux, Python, and MySQL. In fact, in the late 90s when I was explaining to my NT Administrator buddy about working on a mainframe through a 3270 terminal, how the native character set was EBCDIC, not ASCII-based, and how synchronous comm like Bisync and SNA worked, he scratched his head in befuddlement at the queer, unfamiliar arcana.

So with that in mind, I suspect that no one I know who reads this will have any idea what any of this means, and so I will try to go slow, and attempt to explain all the fun I had taking my trip down memory lane. The punchline is this: Last year I played with COBOL in my downtime, to see what the fuss was all about. I used ROSCOE to write the code, to submit the jobs, to compile, to link, and to execute. And it was fun.

Step 1: 3270

Friday, September 25, 2009

Bread and Puppet

Bread and Puppet

On the last day of our trip to Vermont, Liberty, Scout, and I went with Dominique to the Bread and Puppet Theater museum, which houses giant masks, puppets, paper-mache sculptures, and artwork with which I am at a loss to classify. The work is, presumably, all from old shows and parades. Here is a link to some of the art in action:

http://www.fixcite.com/bp/perf.html

And here is a basic description of what the theater is, from Wikipedia (abridged):

The Bread and Puppet Theater is a politically radical puppet theater, active since the 1960s, currently based in Glover, Vermont. The name derives from the theater's practice of sharing its own fresh bread with the audience as a means of creating community, and from its central principle that art should be as basic to life as bread. The Theater participates in parades including Fourth of July celebrations, notably in Cabot, Vermont, with many effigies including a satirical Uncle Sam on stilts. The Theater was active during the Vietnam War in anti-war protests, primarily in New York. It is often remembered as a central part of the political spectacle of the time, as its enormous puppets (often ten to fifteen feet tall) were a fixture of many demonstrations.


There's more to the "bread" angle. The founder comes from a family that makes old world bread straight from rye berries. Thick, gritty, a meal. Not sissy bread. The shows try to indicate "This is what people used to mean by 'bread', and 'art' should feed your soul the same way."

I was amazed at what I saw, and as my bitter view of all things grows in midlife, there aren't many things I'm willing to say that about. Some of the simple slogans spoke to me in a way that generic leftist propoganda does not. "Art should be cheap, and not the pervue of the rich." "Resist the machine-operated details of life." And the one that really threw me, the most basic possible reproach of patriotism, capitalism, manifest destiny, etc., was this statement in reference to the constitution: "It's just a goddamned piece of paper!"

Tuesday, September 22, 2009

Vacation

"Talitha cumi" - Vermont, to my wife.

Liberty really came alive in Vermont on our recent two-week vacation to see her sister. In fact, I don't think I've ever seen her this happy. Dominique came down to Columbus with her husband and two children to see Eric and Zoe get married a few months back, and shortly after their return, Liberty pined for her lost Vermont very strongly, and I consented to drive up there with her and Scout in order to answer what was clearly a question of importance to her.

Liberty, and me, and Scout. And not Stacey. Middle school had already started for her when OSU's break between quarters started. To say that I was upset about leaving Stacey behind would be an understatement; I was, rather, beside myself with disappointment and fear of further pushing my steadily-growing-up daughter away from me. However, to miss this chance to help Liberty stay connected to her family and revisit the state that gave her the most happiness would have been unconscionable. Unforgivable. And so we went, I leaving my misgivings behind.



Friday, September 04, 2009

Fun with Base64

"I may be a sorry case, but I don't write jokes in base 13." - Douglas Adams

So I coded this new perl script... what, I lost you already?

If you're still reading, so I coded this new perl script to solve the problem of the day. My group was notified that some of our processes are filling up some webMethods server logs with what looks like debug messages. When you're dealing with an environment the size of our's, with dozens of code migrations each month, you run into things like this from time to time. "Oh, I left the test password in the SQL script, crap!" and so forth. You fix it and move on, and occasionally offer up a sacrificial lamb if there is a business disruption. We calls these "lessons learned" meetings.

Anyway, in this case we were able to check the timing of the log messages with the record of what services were called at what times, and found a match. The webMethods service at fault was invoking a java service that had as one of its lines:
output = Service.doInvoke( "pub.flow", "debugLog", input );

In theory this type of thing should be commented out or removed prior to code being migrated to production, but in the webMethods IDE, you have to sort of go out of your way to see raw java code, selecting each java service in turn, and visually scanning. There is no function in the IDE to search java code.

The question I wanted an answer to was "how many other services call debugLog this way?" The lack of a search feature in the IDE made this unanswerable, so we went to the filesystem to search the source code directly. Alas, the java services were XML files whose java sources were MIME encoded elements. Before I lose you completely, a little background...

Thursday, September 03, 2009

7 Creative Leaps in Zombiedom

To define the beautiful is to misunderstand it. - Fernando Pessoa



Zombies are pretty popular these days. Having been a fan of the genre long before it was as mainstream-popular as it is now (I was zombie when zombie wasn't cool, so to speak), I try to see all the zombie films I can when they come out, and lately I've even taken to reading zombie fiction. Most of it is great, and like bedroom antics, even the bad is pretty good. Not much of it, however, adds anything new that's truly interesting. Here are some exceptions:


Herbert West - Reanimator

Friday, August 28, 2009

Fun with typing

-Another nerdy post

Yesterday all the groups under my group's director (my boss's boss) met for an annual meeting to discuss statistics, politics, arbitrary administrative tasks, and a small bit of what I quaintly refer to as "real work". Like all such meetings, it started off with a "safety tip". This is where people with no medical, structural engineering, or injury prevention training give you unsolicited advice on how to behave both at work and at home, as though they were some sort of authority.

The tip this time was about hand injury prevention, and, although I find the whole "safety tip" phenomenon lame at best (dangerous at worst), this one was pretty sensible. Use the right tool - a crescent wrench is a bad hammer, for example. Most injuries occur to your off hand, e.g., you hammer the hand holding the nail. And lastly, the reflection-inducing question: How much of your job could you do if you lost a finger? A thumb? A hand? As in, we type for money, we dial phones, we take notes, we draw on whiteboards, we sometimes wear shirts with buttons. Hands and fingers are pretty useful for all these tasks. This got me reflecting on some fun keyboard related things I've done over they years.

CompuServe

As members of CompuServe's tech support group, my ex-wife and I (we were engaged at the time) did a lot of case note entries. This is where you summarize what a caller's problem was, what you did to try to fix it, and where the problem stands now. In some cases, a caller has only one phone line, and can't connect to the service while talking to you, and after the call ends, you must take the next call in queue rather than call back later to check on them. Although this is a rule I broke frequently, most tech support people gave the customer the boot happily, and hoped that the customer would get another CSR when they called back saying the problem still wasn't fixed. "Here, try this init string..." flush! "Sometimes that goes away if you reboot..." flush! That sort of thing.

Wednesday, August 19, 2009

In defense of play

- In which Curtis samples a new board game

"Don't capitalize on an opponent's mistake, play better Go." - Aphorism on the "Go" board game.

This year I first heard the term "German-style board game", referring to the fantastic game "Settlers of Catan". I was looking for board games for the house, as the missus is fond of them, and spent some time perusing websites in search of one that was just right. Settlers was pretty highly rated, and I liked the description of it on Wikipedia and Amazon, so I bought it.

It turns out that the game has a large following, including a couple of my Facebook friends. The premise is basically city building. Different areas in the land you're settling produce different resources. If you collect enough brick, wood, what have you, you can build roads and settlements. Liberty and I played a game and enjoyed it, and some time later a friend and his wife brought over their copy for another game. Big fun.

A couple months later, the aforementioned man and wife, Herr and Frau Barrett, brought over Eurorails, which I had never heard of. It's a train game based on the Empire Builder rules, where you lay tracks and make deliveries of goods to cities based on cards you are dealt. You have goals such as building lines into so many major cities, and being the first to make so much money.

Wednesday, August 12, 2009

And with a perky grin, she said, "I'm a Mathematician"

Background
The high school I went to was a magnet school of what was then just "Worthington High School", but is now either Thomas Worthington, or Worthington Kilbourne, or perhaps it is a magnet of both. I don't really care enough about the current zoning of Worthington schools to fact check that. It was called the Linworth Alternative Program, and unlike other "alternative" schools, its function was not to house the ruffians who couldn't be managed by meek schoolmarms, it housed instead the hippies, punks, budding activists, and artists that couldn't be managed by closed-minded state employees who made their cheddar parroting textbooks and catering to sports enthusiasts and young Republicans.

There were roughly 200 kids at the AP. Teachers dressed casually and were referred to by their first names. Class schedules were determined with a sort of voting process: teachers put available times for classes and how many students could be in each on a bulletin board, and interested students wrote their names by the classes they wanted to be in. Classes included the standards: history, math, english, sciences, but also classes with social/political themes: "Current Events", "Science and Society", and "World Trade", and differing points of view classes such as Canadian History. Phys Ed was free-form; you just had to log 40 hours of athletic stuff you had done on a piece of paper and hand it in - the main effect of this was to encourage students to play pick-up soccer games after school and marathon hacky-sack sessions during free periods.

Free periods were free, neither study hall nor lunch; you could listen to your Walkman, take a nap, read, whatever. There was no cafeteria, so when you wanted lunch, you went to the office and signed your name on the "sign-out" sheet, and wrote down where you were going, and went there. Most lockers did not have locks on them, and in my 4 years at the AP there were only 2 reports of theft, one of which was resolved (catty girls playing out some Kabuki theater drama).

Friday, August 07, 2009

The Invisible, Undocumented Hack Which Was Nearly My Undoing

- In which Curtis reverse-engineers the good intentions of someone very familiar
"The best underlings will skim a little. If they're not taking a little, they're taking a lot. And if they're not taking a lot, they've got an angle, and they're dangerous." - Mob saying

I am not the type to take psychological baggage from work home with me, but a particular project has been my bane now for a couple of months, and I have taken to rambling about it at home. I have been fretting about it so much lately, that my dear wife has taken to asking me how work was, which she was never previously inclined to do. The problem? A well-meaning programmer at a vendor put a few undocumented hacks into some code to help us a few years ago, and then left his company.

With names changed to protect the innocent, we'll say that I am the translator, the messaggero, if you will, between internal mafia bosses, and external contract killers. It's a dirty world we live in, friends. A dirty world. The mob system keeps its books in an internal database that we'll call "Corleone". The contract killers keep track of their info in a system we'll call "assassi-net".

When somebody doesn't pay up, or insults a boss, Corleone sends me an xml message with who to clip, where they are located, and a unique identifier for the request that, for lack of a better term, we'll call a "ticket number". I, in turn, take the request and reformat it to data that assassi-net can read, and then I open a "ticket" with assassi-net, and give the return info to Corleone, including their ticket number, and which hitman is assigned.

Saturday, August 01, 2009

kNN, Finding the k nearest neighbors of points on a Cartesian plane

So I'm obsessed with yet another Facebook engineering puzzle. After solving Gattaca before my last blog post, I worked on User Bin Crash (where you have to calculate the best selection of items to toss out of an airplane to keep it from crashing), which I solved a couple weeks ago with little fanfare. The current puzzle is "Small World", whose problem statement begins thusly:

As a popular engineer, you know many people in your home city. While traveling around town, visiting your friends, you realize it would be really handy to have a program that tells you which of your friends are closest based upon which friend you are currently visiting.


The problem translates to a "nearest neighbor" problem variant known as "kNN", or k Nearest Neighbors. There is a host of wikipedia and scholarpedia articles related to this, however I never found a source with a good plain-English problem description that didn't also claim one search method or other as "The kNN algorithm", rather than acknowledging more than one good approach. Here's a bad approach:

The naive approach

For each point, find the distance to each other point, remembering the best 3 distances along the way. I was able to whip up something without much trouble (in perl, naturally) that does just that. Discounting the routine that parses the file into variables, and the one that summarizes all the results, the rest of the code looks like this:

Sunday, June 28, 2009

Breaking the O(n^2) barrier... while drunk

(Complete solution in java to the Gattaca puzzle available here)

I had a pesky, seemingly insoluble programming task I've been dabbling with for about 3 weeks now in my downtime. Some fellow programmers have posted implications that they have created a correct solution, but until last night, I had been getting something wrong. I suspected my reading of the specs wasn't correct, my approach was skewed, or, God forbid, my choice of programming language was wrong. A little background:

Facebook has a "careers" link on its homepage, which I found one day when a grass-is-greener-on-the-other-side moment led me to poke around job app sites and see what was out there that may make me happier. [Predictably, nothing seemed more attractive or stable than AEP... at least, nothing that would let me stay in my current home]. On Facebook's careers page is also a link to "Puzzles". Curious, I investigated.

The Puzzles page has a list of programming languages (plus make and model, e.g., Gnu C++ version 5.2 instead of just C++) that their black-box puzzle evaluator supported, and a set of puzzles with input and output specifications for prospective programmers to try their hands at. Prominently displayed are a couple of pictures of smiling winners under the caption "solved and hired", implying that if I can write good solutions to all the puzzles, Facebook will fly me out to Palo Alto for a new, joyous life of coding for a social networking company.

After seeing that, I queried the missus "Hey, angel, want to move to Palo Alto?". "No." So that settled that, but some of the puzzles seemed interesting. One was a basic test to see if you can read a spec and write something that is no more complicated than a "Hello, World" program. Not being a tool, I skipped that and moved onto the next, which was reading an input file that had a number in it, counting from 1 to that number, and outputting one of three strings if the count was evenly divisible by 3, 5, or 15. A few minutes later I had some sample perl code to do that, submitted it, and later got an email back congratulating me on my working solution.

Then came the "Gattaca" puzzle. The bad news about submitting code for Facebook puzzles is that if your code doesn't pass their tests, they don't tell you why. It's all automated, and all the replies have the same text, to the tune of "sorry, that didn't work, try reading the specs or trying more test cases, and don't use any funny modules I might not have installed." Good advice, to be sure, but the one thing I've always had in all my coding jobs is good feedback. The error message. The log file. I've never been faced with mysterious, black box test cases, and no results other than a pass or fail. That's a real drag.

So I had been drowning in the shame of suddenly being sub-elite as my first four code submissions to the puzzle all failed, but contradictorily I was excited about all the cool optimizations I found in code rewrites. For example, an early version of the code took 6 minutes to handle a sample test of 100 genes in a 1000 character long DNA string, where my final version tackled the same set in a couple milliseconds.

The premise of the puzzle is that you have a string of DNA codes [ACGT], a list of the start and stop positions of possible genes, and a value, or "weight" for those genes. The genes may or may not overlap each other. The goal is to calculate a path through the entire DNA string that has the highest total genetic weight with no selected genes overlapping. The output is just the final total value. Here's an example, omitting the actual DNA string:
StartEndWeight
10155
122010
25303
35403
27375

Monday, June 01, 2009

"No, I just..."

First, from our friends at xkcd, a comment on complicated parties:


On Sunday I had the joy of adding a brother-in-law to my family, watching my kid sing karaoke, being conveniently available to assist in a variety of last-minute emergencies, and watching a ceremony with equal parts levity and warmth, packed with the love of family and friends. Zoe and Eric, you guys have been married in all but name for years, and everyone in attendance was well aware of that; in fact my brief scans of the crowd from my back-row vantage (I was an usher) showed no expressions of "good luck", "I hope they make it" or any form of anxiety, but rather "it's about time", "I'm looking at the perfect couple", things like that.

Friday, May 29, 2009

New Family

At the time of this writing, I'm a couple hours away from heading off to a cabin with my wife and daughter for the weekend. The occasion is Eric and Zoe's wedding. For those not in my circle, Zoe is my sister-in-law, and Eric is her fiancé, Liberty's former boss, and a budding friend to myself.

My other sister-in-law, Dominique, came down with her husband Willie, daughter Sequoia, and son Arlo and stayed with us for a few days. They live in Vermont, and came down for the wedding. Liberty offered them lodging, naturally, and I set about a day-long frenzy of getting the mainly unused downstairs bedroom and bathroom in tolerable shape to handle guests, washing dishes and clothes, cleaning grout, vacuuming, and stocking the house with food. During the early stages of that I managed to throw my back out, and I had previously told Liberty to go hang out with her sister and play while I did all the preparation. So it was very exciting when I was alone and faced with pulling mattresses and boxsprings out of the basement one handed while scooting myself slowly up the stairs, wincing in pain all the while - the ordeal reminded me of countless bad action movie sequences where the hero is injured and crawling slowly to the just-out-of-reach weapon while the villain rants and spouts soliloquies. Not being a big sissy boy, I got through it and the house was in tolerable shape by the time our "company", as we say down South, arrived.

Saturday, May 23, 2009

Guns Blazing

Things going on in Auterytown over the next few weeks:

- Going to the Asian festival Saturday, and then to see the much watched and hated Terminator: Salvation
- "Second Amendment Sunday": The Barretts, Liberty, and myself are going to the firing range to check out his .357
- Monday Dominique and her husband and brood will be coming into town from Vermont and staying with us for the week
- Tuesday I'm taking a day off work to go to the zoo with club Allerding
- next Friday and Saturday we're renting a cabin for a couple days to see Zoe and Eric's wedding plus festivities
- Wednesday the 3rd is Stacey's (possibly final) orthodontist appointment
- Friday the 5th Liberty is getting leg surgery
- Saturday the 6th is Stacey's soccer team's going away party
- Sunday the 7th is a canoeing outing with my mentee, Dave

And finally, later that week Stacey will be out of school, and begin her summer of resident camps and visiting extended family out of state. Somewhere in there library books are due.

This would cause a lesser man panic, a lazier man to forget something, or myself to send out scores of emails organizing everything while sippin' my Port.

Thursday, May 21, 2009

Does Recess improve classroom behavior?

First, read this, or just eyeball the charts for a few seconds.

This is from a blog I read (or skim) daily at work when I'm waking up and trying to shift gears from Spidey-sense mode (from the 5 or so brushes with death I have with early morning commuters) to code-monkey mode, which requires that your language centers are firing. This entry shows a study relating how much recess school kids are given and how well-behaved they are in the classroom. Although the results don't seem to me as significant as the author implies, it seems obvious that letting kids burn off energy a couple times a day is a good thing.

What struck me most was the first comment after the article, posted by Lilian, which echoes a sentiment of my own:
"It may also affect teachers' effectiveness in the classroom if they get a break too."

Tuesday, May 19, 2009

Oddities of the "How well do you know me" test

So I created this Facebook quiz the other day that seems to be a popular meme right now. The premise is simply a multiple choice test that asks your friends questions about you... what was your first dog's name, what's your favorite video game, whatever. In homage to Spinal Tap, I created a test with 11 questions, and tried hard to make reasonable sounding alternatives to the correct answers. For example, my first question:

Where does "Medicine for the sky" come from?
a) Sci-fi short story by Asimov
b) Engrish.com pic of Japanese storefront window
c) Hillbilly slang for bitter coffee
d) Theoretical huge machine to repair ozone layer
e) Comment my kid made about a sunset

I must tell this story a lot, because everyone who has taken the test so far has correctly identified the last answer as the correct one. Either that, or some other psychological thing is going on - it sounds cooler than the others, maybe I wouldn't mention my kid if that wasn't the answer, something like that. For those who haven't actually heard the story, it's over on my CQ blog: Here

What I found most interesting in combing through everyone's answers was *how* they got certain questions wrong. For example, most everyone incorrectly assumed my high-school nickname was Stretch. Predictable, but boring. One person, however, guessed the worst possible answer from my list, "Klepto". Why, I ask, would someone think that? Was it a blind guess? Was it them being funny? Or did they assume I had a reputation as a shoplifter when I was younger? I did, mind you, but it wasn't notable enough to be nickname worthy.

My nickname was Stork, from one particular kick of a soccer ball during an after-school pickup game. I chipped it with my arms extended, and the effect was very stork-like. The following year a fellow classmate, Terry Cook, also tall and occasionally odd-looking when kicking a soccer ball, acquired the nickname "Emu", sort of a derivative of mine.

Tuesday, May 12, 2009

Hulk Smash

I'm about 3/5 through Malcom Gladwell's "Outliers", and it's an equal to two of his other books that I really enjoyed, "Tipping Point", and "Blink".  I just finished the chapter discussing the 18th century European "culture of honor" among small herding families who lived in the hills, and how necessary it was to be prepared to fight to defend your herd, and hence your livelihood.  If there was any threat to your herd, you had to take very prejudicial action, and having other families be afraid of you and your overreaction was a boon for you, and may just keep your family from starving to death.  So you end up with insecure feeling and loud and proud acting people all living up in the hills, away from large cities, away from the rule of law.  Yes, there will be blood, as the saying goes.
That mentality, and some of those families, made its way to Appalachia, where it was hard for a European to do much besides goatherding, and eventually gave us several blood feuds that could have started as something significant, like which side of the Civil War your family fought on (think Hatfield/McCoy), or seemingly meaningless things like a social cut or cheating at cards.  The culture of honor demands men who answer insults immediately and strongly, to maintain the family reputation, to scare off any threats to your herd... except the mentality stayed strong through those families' descendants, who may not have been herdsmen.
Fast forward to the present day, and you still find remnants of the culture of honor.  In search of this, "Outliers" reports of a study conducted of how different groups of young men react to insults.  Those who reacted the strongest all had one thing in common.  I'll summarize with a line from the article:  "Call a southerner an asshole, and he's itching for a fight."
Here's a link that discusses the study in detail:

Thursday, May 07, 2009

How to be awesome like me

-- a whimsical manual, in blog format
I've been toying around with this idea for a while now of a sort of self-help book.  It will mix the ideas of how to succeed as nonconformist in the corporate world without making people hate you, which I have gotten really good at over the years, and how to write pragmatic code, non-buggy code in the shortest time possible, which I have also gotten pretty good at.  I have no real direction of where the book should go, or if I should write it at all, or if I should turn it into a blog that I'll update whenever the mood strikes me and play the rest by ear.  I'm not sure yet if I'm going to actually start the blog or not, because, well, it's pretentious. Even by my standards.
Here's a sample paragraph from what would have been the first entry, where I'm introducing the concept of the proper way to object to things to improve your position.  The concept is, like many of my thoughts on life, stolen directly from a movie.  In this case, Kevin Pollak tells us to "object once to get it on the record" in "A Few Good Men" (the one with Tom Cruise, not the gay porno, which Wikipedia assures me exists, but with which I am otherwise unfamiliar - in this case, I could not handle the truth, not at all).  Anyway, here is said paragraph:

Tuesday, May 05, 2009

To-do

This year's birthday was tolerable.  I had some well-wishing from the family down south, Eric and Zoe invited us over for dinner, my high-school chum Chris has invited me out drinking this Saturday, and I did the usual melodramatic reflection on life.  You know, alternating between wondering where you went wrong and how you got so lucky.
At least, hopefully you know.  I'd hate to think I'm the only one out there suffering through that roller coaster.  Is it a flaw in thinking or a natural extension of empathy to be able to better bear pain that you know other people also bear?  Or maybe that's a throwback to being a little kid and being obsessed with "fair", where you win the spelling bee at the expense of your peers, and "unfair", where you are caught pulling April Cornelison's hair and get publicly chastised by Julie Smith, her best friend.  Poor April.  I'm so sorry, honey.  I hope you know it was because I was madly in love with you, and, well, that's just how little boys are.
So after taking stock of where I am in life, I took stock of stuff I've been meaning to get around to, and it turns out I'm slowly accumulating quite the to-do list.  Here is the abbreviated version:
Read: