Wednesday, August 18, 2010

A lightweight Java solution to searching image archives

About a month ago, my wife found a collection of dress images, one of her favorite things to search for online, as she is fond of analyzing how clothes are put together and then making her own. The collection was in the form of a Shockwave file, in a neat little scroller app that lets you scan through dresses seen from different angles, find what you like, and go buy it. My wife was unable to save image files from the app, so she elicited my help in the matter.

Sunday, August 08, 2010

Solving the Facebook “Gattaca” puzzle

If you're coming here looking for an algorithm or complete code to solve Facebook's Gattaca puzzle, then first, you're a damned cheater and nobody likes you. Second, they'll never hire you anyway once they realize you couldn't do it on your own. Third, you've come to the right place!

Google assures me that there are publicly available solutions for this puzzle already, and this particular puzzle has been posted in the Facebook careers section for a while now, so I'm going to break with their recommendation to not distribute complete solutions.

Monday, June 28, 2010

My Strange and Awesome Karate Kid Dream

I recently saw the remake of The Karate Kid with Jackie Chan, and enjoyed it quite a bit. In case you haven't seen the movie, I won't say anything about the movie other than what's in the trailer. One of the winking nods to the original was Mr. Han (Chan's recasting of Mr. Miyagi) not catching a fly with chopsticks, but rather killing one with a flyswatter, then using chopsticks to pull it off of the wall and throw it away... a main plot point in the dream I had last night.

My dream was fairly brief, and a bit of backstory was implied, but not shown in the dream itself: Mr. Han now runs a martial arts school. One of his students is a teenaged girl from a culture not very... how shall we say... "women's studies friendly". (It was unclear where specifically she was from - maybe Iran, maybe an African village. My dreams are ambiguous like that). She had an overbearing father who was waivering between supporting his daughter at the school, and pulling her out to have her veiled, executed for being alone with a male non-relative, circumcised, what have you. Mr. Han, sensitive to her plight, does what he can to keep her healthy and free.

Thursday, May 20, 2010

JavaScript phone number reformatting, programmatically setting onblur

There are two problems I solved in a hurry last night that are apparently talked about a lot in JavaScript forums:
- Detecting something in a text input field that looks like a phone number. and remformatting it to the standard (xxx) xxx-xxxx layout
- Programmatically setting the onblur of a text input field

Thursday, May 13, 2010

Some feedback, s'il vous plaît

I've been keeping an online journal for about 10 years now, in one form or another. I kept the site auterytech.com as my domain running on a headless, older Debian box running in a closet until about 5 years ago, when I converted to Blogger. I signed up a gmail account shortly before losing the awesome "curtis@auterytech.com" email address when I let my domain expire, and opted to combat spam by not listing my email address on the new blog. (The old domain was quickly snatched up by a squatter, and he is happily spending his $10 per year, or whatever domains cost these days, on static lists of search keywords for some nefarious purpose or other.)

Before the conversion, I would occasionally get emails from people I knew but lost contact with, who would tell me they stumbled on the page, liked my writing, and wished me well. Other than that, I had no contact with the site's readers.

I've been on Facebook for a couple years now, which has taught me that a lack of response to a thing does not imply a lack of an audience. When FBers threw events that I would attend, occasionally someone would mention something to me about something I'd posted but no one commented on. "Oh, " I would say, "I had no idea anyone even saw that."



Sunday, May 09, 2010

Creating an Archimedean Spiral generator in Java using the NetBeans IDE

[The images below can be enlarged by clicking on them]

My wife, Liberty, is an amalgam of seamstress, hippy, punk, old-school goth (real goth, not depressed teen sparkly lip gloss emo nonsense), WWII and vintage clothing buff, musical and action movie lover. I am a computer programmer, recovering video game and comic book geek, soccer and puzzle buff, ex helicopter parent. Other than a love of things not mainstream, we sometimes struggle to find areas where our interests overlap.

A few months ago, Liberty thought of something I could do with one of my specialties to assist her with one of her hobbies: write a program to design her next tattoo. Specifically, I would write a program to create interlaced spirals. I told her it would be tough, as most of my coding over the years hasn't included graphics. I experimented with a Java painting applet close to 10 years ago, and, although fearing what I used back then would have been deprecated from the language, or that I would be too far behind the curve with modern IDEs, I set out to give it the old college try. You see, I love my wife, and I'm usually up for a new challenge or puzzle to solve.

I tinkered away in the evenings and early mornings, learning how to use NetBeans, relearning how to create image and graphics objects in Java, how to correctly override the paint() method, and the math of spirals.

I decided to use the Archimedean Spiral, sometimes called the Hypnosis Spiral, whose spines are always equidistant from each other. Wikipedia has an article on that here, which I'll summarize briefly: r = aθ, meaning the radius is some constant times the angle.

Monday, May 03, 2010

40 creeps one year closer

Six years and nine months ago, I was hired at AEP, on the recommendation of a man I worked with at Sterling Commerce. Jerod has since gone on to bigger and better things (I believe he is currently the head of IT Security at Abercrombie & Fitch), and I have remained here, notable only because I have never stayed at a job this long before. My usual itch to flee and seek my fortune elsewhere comes and goes, as always, but I am comfortable enough where I'm at to not act on it. At least, to not act on it for a few more years.

Recently AEP gave me a permanent parking spot in the main building's garage. The spots are doled out as people retire and your place in the queue is determined by your hire date. The spot saves me about 10 minutes daily of searching for a spot in the "unassigned" garage across the street from the main building, and walking down a few flights of stairs where business-casual cubicle dwellers (like myself) crowd me in a panic, and storm past me in a huff for being slowed down on the way to their morning coffee, meetings, and arbitrary clerical deadline of being inside the building. Unlike myself. I'm a stroller in the morning, a meanderer still recovering from my commute-induced daydreams. My coworkers are nothing of the sort, and for 6 years I've been watching them scurry about hurriedly first thing in the morning, which I thought was nothing more than a minor annoyance, until I stopped seeing it every day. Suddenly my commute is peaceful from start to finish, and I reach my desk calm and content.

The seemingly small change of removing that daily stress has had a remarkable effect on my mood and my work, and has sparked in me a reflection on my path through life to get where I'm at. Where am I? 39 years old today, comfortable in a job where I get to be creative intermittently, watching my little girl grow up and get the social successes my bumbling always kept her from in the past, struggling to keep a happy wife and stepdaughter, and a roof over all our heads. I'm hoping to find through my reflection where my ambition went, why my eventual death is suddenly more real to me, and a clue as to where I'll be in another decade. Still at the same job? Still married? Will I be in the same house?

Wednesday, April 28, 2010

How to invoke a Java method from JavaScript

It's surprisingly easy. Basically the applet you declare in the <applet> tag sets up the Java class as an object that can be referenced with standard DOM calls.

For the purpose of this example, I'm not displaying anything with the sample applet, only returning values from method calls, so the code doesn't import awt or Swing, only java.applet.Applet.

Here is a sample java class that exposes two methods, add and subtract:
package cea.demos;

import java.applet.Applet;
public class Arithmetic extends Applet {

  public int add(int x, int y) {
    return x + y;
  }

  public int subtract(int x, int y) {
    return x - y;
  }
}

Tuesday, April 27, 2010

Using File-AID Batch to update multiple PDS members

Today at work I found I had multiple members of a partitioned data set that I wanted to update from a batch job. I had previously written an RPF to do this, but post-Sarbanes/Oxley fallout has caused us to change our dataset permissions and procedures somewhat, so I needed to update with JCL this time.

I was trying to fool around with using TSO edit commands to update the files using IKJEFT01 to invoke a TSO shell, and my boss saw what I was doing and suggested File-AID instead. File-AID is very flexible and fast, but the documentation is a little daunting, and I've never taken a class on it or found any tutorials that I could tolerate. However, with some trial and error I was able to get it to update my dataset members without any problems, and my final JCL read pretty well, unlike some of the more unintelligible arcana I've submitted to the mainframe in the past.

Sunday, April 25, 2010

DHTML events - blast from the past

Back in 2003, I was working on JavaScript code that would function as a text editor/web page authoring tool. It worked within a browser without textarea or other input fields (text you typed appeared in the main body of the page). It was semi-functional, including pop-up right-click menus that let you paste in a few HTML tags, a Java applet to read and write files to disk, and instructions for the user to allow the applet disk access. The whole thing was pointless, as even back then there were better rich text/WYSIWYG web page editors out there, but it was a fun programming exercise. The original source for it is available here if you want to download it and toy with it. It works with IE8, but I think there was a new problem introduced with modern Firefox versions that I never got around to fixing. I also just tried it in Chrome and it just silently fails. Bummin'.

Here are a few screenshots of it in action, showing how to start with blank page, open the right-click menu to add some stuff, and testing the results:

Monday, April 19, 2010

Tax-time blues ain't so bad

I've been away from the blog for a while, due mainly to not having anything I wanted to share, and also being low on creative energy. My work has been draining my batteries for a change, which is good. This week should afford me renewed blogging time and energy, as I'm in a training class that gives frequent breaks, and has frequent problems sharing desktops and application servers with remote students.

So Liberty got laid off, which has so far not had a dramatic impact on us. She gets to spend more time with Scout and her mom, and has been pretty relaxed at home. I no longer get my two nights per week alone with Scout, which I have mixed feelings about. Liberty is also stumbling through the beauracracy of Job & Family Services again to attempt to get unemployment benefits. They seem to be using the fact that she is in school to avoid paying benefits, so she's in the process of job hunting.

My work may also be going into the laying off business pretty soon. (news article) That would put us in an interesting position after a few months, namely being hobos. Or selling off all our garage and basement crap on ebay while scrambling for new jobs.

Tax season was pretty bad, but not life-altering. I owed more money than I got in my annual bonus, and had been unable to save up for the IRS because of the extra financial burdens I've talked about in previous posts. So I made a deal to pay what I could up front, and pay up in full (plus a modest penalty) within 120 days. So no playing for a while, but no debtor's prison either. So it goes.

Tuesday, March 09, 2010

An Open Letter to the Disney Corporation

Dear Disney,

Thank you for the 57 mailings we received yesterday advertising your $500 per night resort rooms. Unfortunately, the various names on the mailings, presumably made up by one of my daughter's school friends as a prank (as they share a lot of their last names), do not live here. Additionally, we live in a single family home which could not comfortably support 57 people as a main residence.

I can only assume that you have a computer database with which you extract the addresses from. If it is a modern relational database that supports the SQL language, you may be able to leverage such functionality as the "group by" and "having" clauses to prevent obviously fraudulent database items, perhaps substituting a single "Seymour Butts or Current Resident" mailing.

Here is an example SQL statement to illustrate my point. My main assumption here is that it is unlikely for a single address to have more than 4 families living in it that are likely to vacation at Disney resorts, therefore you can safely cull out addresses that occur 5 or more times in the database with a statement such as:

select address,count(*) from address_tbl group by address having count(*) < 5

Please run that by your DBAs and get their take on it, and, more importantly, stop enabling mail fraud. It's a felony, after all.

Tuesday, March 02, 2010

Three table inner join vs. the staging table

or as we perl users say, "There's more than one way to do it."

I was faced with an odd situation at work a few days ago, and it led me to do a lot more raw SQL tinkering than I typically do. The situation takes a little setup. (I'll say up front that if you don't fancy yourself a geek, don't torture yourself with the rest of this post, but tune in next week for tales of back-to-back concerts at the Newport!)

My team performs application integration, and our preferred method of doing so is with web services that are modeled. "Modeled" in our parlance refers to being managed by a piece of software called webMethods Modeler. It provides pretty pictures of running services, complete with checkmarks as steps get completed, or big red Xs if they fail.

The services we provide mainly move documents around, doing any needed transformation on them. We take all the possible fields that a business process could want, and create a master document definition called a "canonical", whose definition resembles, but is not congruent with, the normal lay usage. We take inbound documents and map them to the canonical format, and subscribers to the documents get the canonical mapped to their preferred format. Because of this, a complete process definition has two models: one for the publisher, one for each subscriber.

Saturday, February 27, 2010

Where the hell did my alternative music go?

"Let's go and throw
All the songs we know
Into the sea" - Robert Smith

So today I'm driving the wife to work, and we're listening to CD101 -- you know, Columbus' alternative station -- and the DJ says the following:

"Your 9am lounge tip is 'island'. That's 'island', I-S-L-A-N-D."

"Wow," says I to Liberty "so their target audience now can't spell." After dropping her off, I kept listening, and a "Tegan and Sara" song came on that contained the following lyrics:

"I just want back in your head
I'm not unfaithful but I'll stray
When I get a little scared"

I usually tend to avoid blaspheming, but... weeping Jesus on the cross, when the hell did alternative turn into mainstream pop for idiots and emo posers? CD101, in the 90s, had a reputation for playing unusual tunes that would never get air play anywhere else, and their target audience was me and my fresh-out-of-school snobby intellectual posse, who would jam to it and revel in our rejection of all things mainstream. We had the lovely Siouxsie Sioux, treating us to interesting gems such as:

Saturday, January 23, 2010

Closures and Objects in JavaScript


"If you want to make an apple pie from scratch, you must first create the universe." - Carl Sagan

I've always hated the word "JavaScript". What's up with that capital S? However I've always loved the language. I learned the basics of it when Netscape 3 came out in 1996, and was immediately hooked. Your web browser became a scripting language interpreter, how cool! Before then most web pages were static, and business websites, if they existed at all, were mainly shells listing contact information and displaying the company logo.

Some pages I stumbled on back then used CGI scripts to take user input and do something with it - private content that required a login, rudimentary chat, surveys like the ever-popular "purity test", Pi calculators (show me __ digits of Pi [Submit]), things like that. The scripts were all server-side, though. The code was being executed from private space in the web server's cgi-bin directory. For people relatively new to the web like myself, doing something like this was an impossibility. We hadn't found Linux or Apache yet, hadn't learned perl or shell scripting, and our web hosts were angelfire, geocities, tripod, and CompuServe and AOL's user page areas. We could do chili recipes, pictures of our cats, and link to other people's recipes and cat pictures, but not write anything interactive.

From the professional programmers of 1996, Javascript was immediately scorned as a toy for little kids playing progammer. For those of us with a little insight who didn't have cgi-bin access on the web host we were using, Javascript was nothing less than a godsend. We struggled to do client-side what could previously only be done by a script on the webserver. We begged for more features from Netscape. Microsoft struggled to copy the functionality with JScript. Standards bodies struggled to make a standard language definition out of it. Good times.

Monday, January 18, 2010

Good recursion, bad recursion

"Go to the store, buy some more, 99 bottles of beer on the wall!" - 99 Bottles of Beer

Factorials are a common math problem used in computer programming tutorials. For those who don't remember them from 5th grade math class, factorials are integers followed by an exclamation mark. You multiply the number by all the numbers that come before it, down to 1. They go thusly:

1! = 1
2! = 2 * 1 = 2
3! = 3 * 2 * 1 = 6
4! = 4 * 3 * 2 * 1 = 24
...etc

Another way of expressing this same idea is with recursion. Recursion is basically self-reference in an expression. Let's use the euphemism "Same shit, different day" to illustrate:

shit(day) = shit(day - 1)

Thursday, January 14, 2010

Gaming and Coding

So I've been killing lots of time lately playing Flash video games on the kongregate.com games portal. The one I'm currently whittling my way through is called "Cargo Bridge", where you have to build wood or steel bridges across gaps, and then laborers test the bridge by transporting boxes of unknown contents across it, as well as the occasional elephant.

The game that got me hooked on Flash games is called "Use Boxmen". I discovered that a couple months ago, and after beating the game I quickly sought out others. Naturally I've played puzzle games on the web before, but Boxmen was the one that really piqued my interest in the genre. I found it on Kongregate, but it is hosted also at the author's homepage.

The game is very cartoonized with stick figure avatars, and reminds me vaguely of "Simon in the Land of Chalk Drawings". I found it when looking for the "Quake Done Quick" walkthroughs on youtube, and then just browsed around looking at walkthroughs of other games. I found the boxmen one here:

Wednesday, January 06, 2010

Google Analytics, and sometimes I can't do math

First, my apologies to rich people: You're getting at most a $65 tax break over last year, not the 5% I promised you. I didn't account for the extra tax brackets that came with the new withholding tables. There are nine tax brackets now rather than seven, and things line up less disturbingly than I thought. Still, poor people have a higher tax obligation than last year, rich people a smaller one. The amounts are now insignificant, but the symbolism is still bad.

Here are the corrected charts, first, how much normal people will be paying extra, then how much less rich people will be paying. I'm including the new amounts for people filing as married, as well.





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