This week I dealt with a rather irritating little problem that wound up having a surprising source. Rather than try to explain it to my wife in technical terms, I went for the more prosaic form, but for those of you that are familiar with Java, it's all about this.
Congratulations! President Obama created a new Cabinet post, and you became the first Secretary of Pets! Your first task: managing and categorizing every pet in the United States: dogs, cats, budgies, snakes, it's your domain. You decide to identify every pet by giving them a unique nationally-assigned number. References to that number are the same as references to the pet and references to the pet are the same as references to the pet's identifying number. You create a huge central station just outside Lebanon, Kansas and process requests as they come in. Someone requests an identifying number for a Maltese cat in Michigan, they get 104558628. The next request is for a wire-haired terrier in Pasadena, CA and they get the next one: 104558629.
You've also been tasked with creating an abstract broad classification system. It's an odd classification requirement: you don't need to classify by species, number of paws, color, gender, geography or fangs, just something that lets you batch them up. So you create a classification based on the identifying number already given to the animals by declaring an animal's classification as the last two digits of the identifying number. So if your wire-haired terrier's identifying number is 104558629, its classification is 29.
So far so good, your central station is humming away, doling out identification numbers. One day your sister's cat goes missing, and she goes to the Lost Pet Center. She doesn't describe the cat, she just gives her cat's identification number 104558628, and a Lost Animal Ticket is stored in the National Lost Pet Database.
Remember when I said earlier that referencing a pet is virtually the same as referencing a pet by its identification number? Thanks to this you were able to build a Pet Identification Station in every town: put the animal up to a station scanner and, presto! It displays the animal's identification number.
Also in every town is a Lost Pet station. It's awesome: if you find an animal you don't even have to bring it to the station, you just supply its identification number. When you do, cogs turn, phones dial and the Lost Pet station connects to the National Lost Pet Database, and asks it: "Is this identification number in your Database?" If the response is no then it's not a lost pet, and if the answer is yes the cogs turn and phones dial. The Correct Authorities are notified and before you know it, your sister's cat is safely returned. In fact, she just told me so about an hour ago, and her cat's making all sorts of happy purrs. Do you like happy endings? I love 'em.
I bet you're a little sad that there's a National Lost Pet Database. Don't be sad - it's not a terribly large list, and it's certainly smaller than before you ever built your pet identification system.
But it's large enough that everyone wants it to respond as quick as possible. Nobody wants the National Lost Pet Database to be the source of delaying a pet returning to its home, particularly not the politicians, at least, not the savvy ones. But right now, how it works is like this: every entry in the database is a Lost Animal Ticket. The Lost Animal Ticket contains the identifying number of the pet as well as a piece of information about the owner to facilitate fast contact. When trying to decide if any pet is missing given its identification number, the system creates a prototype Lost Animal Ticket, and attempt to match the prototype ticket against every entry in the lost pet database. If the identifying number of the first entry matches the identifying number on the prototype ticket, it's considered a match. If not, it moves to the second Lost Animal Ticket entry in the database, and performs the same test. This repeats until a match is found or until the entire database is exhausted. It's a bit like trying to find a playing card in a deck by taking a prototype card from yet another deck and attempting to match it against the first deck through visual inspection.
So to make it faster, you come up with a Great Idea: split the database into several miniature databases. In fact, thanks to the classification system you designed, you can just split the database into a hundred mini databases, and in each mini database you only put Lost Animal Tickets for pets with the same classification number. So now you have one mini database for all Lost Animal Tickets for pets classified as '00', one for all pets classified as '01', one for all pets classified as '02', and so on up to '99'. This really works well because every mini database is about as large as every other, and even better, instead of search through every Lost Animal Ticket, you just search one of the mini databases in 1% of the time. Instead of searching through all the possible missing pets, you only have to search through the mini database for pets classified as '28', which as we know are the last two digits of your sister's cat's identifying number. In some ways this is like trying to quickly search a deck of cards by separating them based on their suit first.
All of this works and is predicated on three important things which may seem obvious: first, everything that tries to classify a pet must consistently perform the same step to get the classification number, which is to create a Lost Animal Ticket, read the identification number from it and use its last two digits; second, that whenever attempting to match one Lost Animal Ticket against another, this must be performed by matching the identification number on each of the two tickets; and third, those first two things agree that the identification number is what matters.
And here's the thing: what happens if any of those assumptions are wrong? For instance: one day you decide to categorize pets by the first two digits of the animal's identification number instead of the last. While your sister's cat's Lost Animal Ticket is sitting in mini database '29', everyone may look in mini database '10'. All of a sudden nobody can find your cat, or it's registered in two separate mini databases.
Here's something else that can go wrong: instead of comparing Lost Animal Tickets using the identification number of the animal, the system uses the identification number of the pet's owner. If your sister lost three cats and one is found, it's quite possible for the wrong ticketto be matched against the prototype ticket. Also consider instead a possibility where the criteria for deciding if tickets matched changed to being the same physical piece of paper. Doesn't make sense? If you and I both have a four of clubs, we could possibly agree they were the same card. (That's basically how the National Lost Pet Database works.) But if instead of playing cards, we had airline boarding passes, it would be safe to assume that if you were standing on an airplane with our own boarding passes, if they referred to the same ticket, someone may call The Correct Authorities, and if we applied that algorithm to the National Lost Pet Database, then pets would practically never be found.
Finally, your system will fail from a poor combination of the first two requirements: if your system's categorization calculation is inconsistent with its test for equality, the system may lose tickets. For example, while the first example of possible failure still used the pet's identifying number, what if classification was something more arbitrary, like the time the ticket was issued? The prototype ticket will have been issued at a different time from the lost pet ticket, and as such will likely be classified in different mini databases, and never be found, or only found due to something repeating the same error (Like the time nobody at the bank could locate my account until someone mistyped my name the same way as the teller who registered it on my behalf. That's another story.)
Luckily for your sister, you didn't make these mistakes. Your National Pet Identification System is a huge success, and President Obama has now tapped you to address the problems with our banking system, just like Moist Von Lipwig.
Keep in mind: if anyone plans to write a National Pet Identification System in Java, read Items 8 and 9 of this book. You may save someone both several hours of work and their wire-haired terrier.
Sunday, March 01, 2009
Thursday, February 19, 2009
Lost 316
Last night's episode, 316 was the worst episode of the series yet. Since I'm on the road, I watched it early this morning online. Here are some (mainly hypercritical) notes I took:
- So far ho hum.
- This Place Is Boredom.
- I have discovered the source of the whispers and it's Eloise Hawking.
- I'm renaming Eloise to Drama Queen. What's with the voice? Tell me: would that voice convince you to do anything?
- Granddad seems like a fairly healthy old dude with a limp. Why does he need assisted living? Why would a man with a limp try to escape with Christan's lace-ups? If I were Ray, in my 70's, beat down by the death of my alcoholic son, stuck in a home for people incapable of taking care of themselves I'd much rather wear Locke's laceless loafers.Locke's Shoes
Christian's Shoes - Given that until about 48 hours earlier, Jack was a pill-popping alcoholic, why would he, rather than his mother, be the primary contact for his grandfather?
- Damn, this is dreary.
- Wow. I'm watching this online, the episode sponsored by the Orange Juice Council. There were several commercials from the council, the first one having Tom Selleck talk about how they discover new nutrients for it all the time. Come back from first break without OJ commercial and the first thing I see is Jack pouring OJ for messed up Kate. Jack says "I poured you some orange juice." Fuck all if that wasn't on purpose because I thought, "Oh, that's good, it's full of nutrients." In case you thought that product placement wasn't possible on a show that takes place on an island, this proves otherwise.
- Ben is fully marginalized this season: "I've been sidetracked"?! How about the Ben we used to know who could be cool and manage to control shit? The dude who would just smugly say "Because, Jack, there's more going on than you know!"? Unless this panic is genuinely going to matter, fuck it all.
- Oh, fuck, Ben has been messed up. Maybe he could use some Orange Juice, it's full of nutrients!
- On the audio podcast, Darlton said that they could have changed the play order this episode and The Life and Death of Jeremy Bentham. I kind of doubt it at this point.
- Poor dead Locke.
... which reminds me of an old Jewish joke. - "Rest In Peace..." before you make him a zombie proxy"
- This dialogue is bad, but so is the heightened false sense of emotion. I blame the director for trying to inject excitement where there was none.
- This Episode Is Death.
- If it improves the episode, give Jack another tattoo.
- OK. Walt was told he could leave the island at the end of S2, so, okay, I'll give up on Walt. I should have realized this sooner. Sigh. Sorry.
- Write a letter on 8.5" wide paper. Put it in an envelope. Fold the envelope in half and then try to tear it open the way Jack did. Then remove the piece of the letter you tore.
- Frank Lapidus has no further role on the show. That he was the pilot was likely to entertain the group.
- Kate: if you plan to go back to the island, and tell Jack to get some hiking boots -- buy some fucking hiking boots. And some sensible clothes.
- I understand that all this episode did was return our fans to the island and create some questions: why doesn't Kate want to discuss Aaron? What happened to Sayid? What happened to Ben? But in the end I just don't care.
Sunday, February 15, 2009
Return To The Facebook
I used The Facebook for a few months in 2008, but I left last June.
Look, I had plenty of The Facebook friends, and plenty of coworker friends, but there were still very few real-life friends. Now, I like my coworkers, but I don't need The Facebook to be in touch with them; them I saw all the time. And I found this need to collect The Facebook Friends like some people used to collect Pogs Milk Caps. The Facebook was overhwelming.
And I left. I wrote about it on this blog, and the response surprised me. Not that there was a lot of it, I just expected something different - a little bit of conversation about time spent on The Facebook, the value of in-person contact versus living in small dialogue boxes, et ceterea. But mostly people were confused, as some occasionally are by things I write. Some took to mocking me, and one woman went so far as to summarize her opinion by repeatedly calling me a faggot to my face, a rare case where I would have much preferred the online version of the conversation.
For these last six months I had the distinct feeling of not missing out. Last month learned that many of my friends (the real ones, the ones I wanted to spend weekend time with) had joined The Facebook in the intervening time. All of a sudden there was this real value to returning to The Facebook, and so I have.
I like friends, and I even like coworker friends. Let's be friends! But this time I'm not collecting them for points, and let's keep out the surveys, snowballs and super pokes. I like The Facebook when I use it as a relationship supplement; not its replacement.
I must no longer be gay; my wife will be so relieved.
Look, I had plenty of The Facebook friends, and plenty of coworker friends, but there were still very few real-life friends. Now, I like my coworkers, but I don't need The Facebook to be in touch with them; them I saw all the time. And I found this need to collect The Facebook Friends like some people used to collect Pogs Milk Caps. The Facebook was overhwelming.
And I left. I wrote about it on this blog, and the response surprised me. Not that there was a lot of it, I just expected something different - a little bit of conversation about time spent on The Facebook, the value of in-person contact versus living in small dialogue boxes, et ceterea. But mostly people were confused, as some occasionally are by things I write. Some took to mocking me, and one woman went so far as to summarize her opinion by repeatedly calling me a faggot to my face, a rare case where I would have much preferred the online version of the conversation.
For these last six months I had the distinct feeling of not missing out. Last month learned that many of my friends (the real ones, the ones I wanted to spend weekend time with) had joined The Facebook in the intervening time. All of a sudden there was this real value to returning to The Facebook, and so I have.
I like friends, and I even like coworker friends. Let's be friends! But this time I'm not collecting them for points, and let's keep out the surveys, snowballs and super pokes. I like The Facebook when I use it as a relationship supplement; not its replacement.
I must no longer be gay; my wife will be so relieved.
Monday, January 05, 2009
Doctor Who on Big Finish Audio
Introduction
In July I participated in an American Cancer Society "Relay For Life", a typically social fundraiser. The mechanics of the event involve each team always having a team member on a walking path (hence, the notion of a relay.) To keep everyone entertained, the ACS provides music and fun events throughout the day, and late into the night.However, I didn't participate in any of the games, or play any music: I had only one walking shift, from 4-6AM, part of the small period during the fundraiser without any music, when almost everyone is sleeping, and where the only game is 'speak quietly.' So instead, I crammed podcasts in to my recently resurrected iPod, including several episodes of The Whocast, a weekly podcast about Doctor Who. Season 4 (aka Season 30) was coming to a close in the United States and I was looking for something else to feed my fix. I was new to The Whocast, and the relay provided me with a period of uninterrupted listening time. So at 4AM I relieved my teammate, put in my earbuds, and silently walked.
As it turned out, nobody was scheduled to replace me at 6AM, and my teammates were tucked in their sleeping bags, so I walked until 8AM.
I started with the earliest downloaded episode, Episode 67, which turned out to be the first episode with its two new hosts. Awesome, this was new for all of us. While one host was a bit dominating, there was more than enough information to keep me interested, and I spent most of the night listening to The Whocast, with a short break for the most recent episode of "Wait, Wait, Don't Tell Me!" By the end of the night, I was sold on The Whocast.
Besides dissecting Season 4 and a variety of interviews and whatnots, my hosts, Trevor and Tony, often reviewed new stories from Big Finish Productions, a source of Doctor Who audio tales starring earlier incarnations of The Doctor. They even dedicated an entire episode to Big Finish audio dramas. This caught my interest. I had until this point a passing interest in old Doctor Who, and new very little about some of the later early Doctors. This might be a good opportunity to get even more of my fix without having to look at a screen. Trevor convinced me to try Big Finish when he reviewed the story "Kingdom of Silver" in episode 95 [link to web page, broken], [link to mp3], describing it with particularly high regard.
Trying to select a Doctor Who story at Big Finish can be overwhelming. There are eleven different subsections for Doctor Who. As someone new, it's hard to find a single story just for the purpose of testing it out. The website sorely lacks a ratings system. Errors in the web server not only lack a human-readable description, the error pages display way too much of the web server's source code. That said, the site still delivers the MP3s, and that's what matters.
To start I selected two of the oldest stories, which were produced in 1999. I primarily went with older stories because they were less expensive: they cost $7.99 whereas newer ones cost $13.99. Presuming quality did not vary with age, older stories were almost half the price of newer stories. Additionally, I didn't want to listen to a story that relied on backstory from older Big Finish stories.
The Reviews
My brief reviews of those stories follow, in order that I listened to them:#6: The Marian Conspiracy (with Colin Baker as the Sixth Doctor):
My introduction to Big Finish, as well as my introduction to The Sixth Doctor was also the introduction of a new companion to the Doctor Who Universe, Dr. Evelyn Smythe, an older woman and educator. The Doctor and Evelyn travel back to the 14th century to investigate a temporal error related to Evelyn's ancestry and one of the favorites of British storytelling, Queen Mary.
While I tend to avoid stories regarding British history (I feel like it's overdone) the perspective they take here is fresh and presents Queen Mary as a more sympathetic and thoughtful character. I enjoyed the portrayal of Evelyn, even though she was portrayed as slightly more brash and bumbling than someone I would consider as a first-time time traveller. Smart companions stay in the TARDIS during their first trip. Their adventures just aren't turned in to audio dramas.
Nonetheless, the characters mattered and was an enjoyable story overall. It left me wanting to know more about Evelyn. As you'll see later on, I was severely disappointed.
#7: The Genocide Machine: (with Sylvester McCoy as the Seventh Doctor)
My introduction to The Seventh Doctor. The Doctor and his companion, Ace (also the Seventh Doctor's regular companion in the television stories) travel to the planet Kar-Charrat. Kar-Charrat is home to the Universe's Library of Congress, or something similarly enormous. The library engineers have invented a superior method for storing information, which catches the Daleks' single eyes.
I knew nothing about Ace, nor about the Seventh Doctor, and this was a fun self-contained story. My only complaint here was that it was a little difficult for me to tell apart the voices of Ace and the other major female character. A minor issue, easily managed by rewinding. Overall, fantastic and recommended.
#5: The Fearmonger (with Sylvester McCoy as the Seventh Doctor):
This has a fairly complex story with several groups of characters: two assassins, a political party candidate, a terrorist group, a talk-show host, an old friend of Ace, and there they are, The Doctor and Ace, right in the middle. Everyone's trying to stir up fear and anger. The longer The Doctor and Ace take to discover what's really going on, the worse the situation becomes.
Great story, straight through to the end. All the characters are interesting and true to their nature. My second favorite of the group.
#11: The Apocalypse Element (with Colin Baker as the Sixth Doctor):
The Doctor and Evelyn travel to a distant planet where a meeting of many sentient time traveling races is about to take place. The Daleks appear and all hell breaks loose.
Fundamentally, this is an action story. The characters quickly move from one crisis to the next, with very little time for character dialogue. It also (apparently) features the return of Romana, the former President of the Time Lords. I didn't have much problem with missing back-story, there really was just too much going on, and often, the characters in crisis spoke too fast to be understood. By the end I stopped trying to understand what was being said and waited for the story to end.
Now, back to Evelyn: here she had absolutely no role in the story other than to continue to be a mild novice, and mostly served as a character that could be used to forward the plot, of which there was a lot to be moved forward. This doesn't just apply to Evelyn's character, I felt this way about several of the characters. Often characters were portrayed with a certain behavior or ethic, and then that ethic had almost nothing to do with the story.
If you listen to this story, and like it, I'd love to know what you liked about it.
The only reason to listen to this story is because Russel T. Davies claims this is "one of the opening skirmishes of the Time War". (ref: http://en.wikipedia.org/wiki/The_Apocalypse_Element)
#112: Kingdom of Silver (with Sylvester McCoy as the Seventh Doctor):
The Doctor travels to planet Tasak on the verge of an industrial age, split into many factions. Thanks to a mysterious ancient technology, Tasak remains at peace. You know, right? Mysterious ancient technology? Can't be good.
I tried this newer story specifically because Trevor recommended it on The Whocast. He was on the money, and this was my favorite of the five. I appreciated having an interesting and nuanced storyline involving well-defined characters, even more so after The Apocalypse Element. Since this story has the Seventh Doctor without Ace, they were able to devode time to the other characters, several of which I am led to believe will appear in future stories. At least, I hope.
Kingdom of Silver also comes with an additional story titled Keepsake, an eerie coda to Kingdom of Silver.
Summary
So if you kept track, I recommend four of the five stories. Not a bad ratio. I will probably listen to more of these stories. Since I won't consume them like candy, I'll probably rely more on recommendations and reviews in the future.Which Big Finish Audio stories do you like?
Sunday, January 04, 2009
Nonsense post. Read at your risk.
I was sitting next to my wife while she talked with her father. Below, 'chew' refers to chewing tobacco.
Wife: Has Pat given up chew for New Year's?
Father-in-law: What?Wife: Chew.
Father-in-law: What?Wife: Chew!
Me: Bless you!Wife: [smack!]
Wednesday, December 31, 2008
Subscribe to:
Posts (Atom)





