Friday, April 29, 2011

Is There Something Wrong with FreeCell in Windows 7?

I used to lose at FreeCell* all the time. But ever since I upgraded from Windows XP to Windows 7, I have yet to lose a game, which makes me think they removed all of the hard games from the randomizer. What is up with this? Discuss**.

*Background for non-geeks: FreeCell is a solitaire-like card game that is included in Windows XP and later. FreeCell games are enumerated by the random number seed that causes the cards to be dealt in a particular way. Okay, that wasn't much of a non-geek explanation. But you get the idea, right? There are only a certain number of possible hands that can be dealt, and each one has its own unique number.

** I recognize that I have no readers, and so issuing this directive is futile. But futility is the name of this game. Which game? Good question.

Sunday, November 28, 2010

If You Don't Have Anything Nice to Say...

... try one of the following:

  • Watch a bunch of elephants frolick about in the mud.
  • Find a Star Wars / Lord of the Rings marathon on basic cable and wonder what Christopher Lee is up to these days.
  • Lookup the names of dormant volcanoes and decide which one is next going to erupt on a Jewish holiday. (Full disclosure: my wife is Jewish, and we were married on sukkot. Which has nothing to do with volcanoes, but I'm disclosing.)
  • Scour the digits of pi for your birthday.
  • Locate the nearest haystack and plant a needle inside.
  • Launch an eBay storefront that offers a wide assortment of organic burlap bags.
  • Devise a plan to restore the Transformers lunchbox to its former 1980s-era glory.
  • Stare at something until you fall asleep.

There are many options.

Wednesday, November 24, 2010

Thy Cup Hath Been Poisoned

Several items on my mind as I watch a man with a gun pull into a gas station on an overcast day halfway through an anonymous stretch of the Middle of Nowhere*:
  • At what point do you have to justify your prioritization of tasks, people, events, dreams, needs, and desires to the bevy of stakeholders who all think they are the majority owner of your life?
  • How does one chop a salad while in free-fall?
  • Why does everything on television happen in New York or L.A.? And sometimes Miami?
  • There are five drunken tigers inside of this box. The box is decreasing in size at a constant rate of 0.38 cm³/s. You have a clothes hanger, $5.72, and the complete Michael Jackson discography. You are also a narcoleptic. What do you do?
  • Is the passage of timing really speeding up as I age, or do I just not care as much about how long it's been since I last did [x]?
  • To the cloud! Which doesn't exist!

*Isn't firing a gun at a gas station generally considered to be a Bad Idea?

Saturday, November 20, 2010

Two Sentences at 2:22am

Straining to see the most distant horizon through the thickest of fogs, you fail to notice the obstacle that will thwart your next step; relentlessly scanning the rugged terrain at your feet for hazards, you fail to notice how far off-course your current trajectory is.

A compass and a means to float above the fog solves both of these problems.

Saturday, November 6, 2010

How to Start a Paranormal Investigation Team

It's pretty straightforward, actually.
  1. Assemble Your Team. Your choice of team members is of paramount importance, as their individual personalities, attitudes, and backgrounds will collectively determine how well you are able to perceive and communicate with the spirit world. Your team must be small in number (no more than four or five) so as not to intimidate any ghosts that you may encounter -- remember, they're dead, and reminding them of this can be quite frightening. Generally speaking, the more dejected and/or morose your team members are -- black t-shirts, black jeans, and dyed hair (preferably black) are all pluses -- the more approachable the spirits will find them.

  2. Choose a Leader. Your team leader should have a strong, determined personality, but should also be vulnerable enough to scream like a little girl when the paranormal activity ratchets itself up a notch. (A testosteroney, unmarried man in his mid-to-late 20s with a triangular, barrel-chested build and a tiny head is ideal.) More importantly, the leader must have had a previous personal encounter with the supernatural (preferably during a vaguely-alluded-to troubled childhood), so that he or she has sufficient credibility to outsiders (i.e., greater than none).

  3. Choose a Bitch. One of your team members should be designated as the Bitch. The Bitch is employed (sometimes unwittingly) as bait to lure malevolent spirits into doing harm. Oftentimes, the Bitch finds him or herself locked alone in a morgue, left behind in an attic, or in possession of some kind of attire or object likely to offend the spirits. Be sure to select the most paranoid and/or insecure team member as the Bitch.

  4. Introduce Yourselves. Your team should introduce itself by having the leader complete the following sentences: "My name is ___________. I never used to believe in ghosts until _______________. Since then, I've been on a mission to capture what I saw on video, along with my trusted teammates _________, _______, and ________. Together, we are _______________."

  5. Choose a Location. There are many theories as to what circumstances lead to hauntings, and how to avoid them. In the end, you have to rely on word-of-mouth and your instincts to select a suitable location to investigate. This can be an exhausting and time-consuming process, but fear not: should you run short on leads, you can always fall back onto one of the following options. (1) Return to a location you've visited previously, citing unqualified accounts of "people" hearing disembodied voices speak your name. (2) Investigate a type of place that no one would ever think of as being haunted, such as an aircraft carrier, telephone booth, or furniture store. (3) Sit around and jovially recount investigations of yore while cracking inside jokes.

  6. Bring Lots of Gadgets. Your team should carry a wide-ranging variety of equipment to help you undertake and document your investigation of the paranormal. Night-vision cameras and digital audio-recorders should be a staple for each team member. Other must-have devices include sensors that detect changes in temperature and electromagnetic fields; ideally, they should be highly fault-prone and subject to report wild fluctuations in their readings, since these behaviors can easily be attributed to spirit intervention. But more importantly, your team must have at least one gadget that no one else has, no matter how ridiculous or implausible it is. Examples include: (1) A text-to-speech engine that periodically utters a word or phrase hand-picked by supernatural presences. (2) A white-noise machine attached to an auto-tuner, through which spirits can somehow communicate (with perfect pitch).

  7. Ascribe Things to Stuff. Throughout the course of your investigation, your team will be faced with a never-ending stream of ambiguous data and evidence. Make sure that you highlight and thoroughly analyze the information that can easily support the case for paranormal activity, and quickly disregard the information that cannot. For example, the grainy video that your night-vision cameras capture will frequently feature oversized dust particles and light anomalies; if these phenomena can be wrapped seamlessly into a narrative of unexplained chills and/or demonic possession, do not hesitate to do so. Likewise, your digital audio-recorders will be capturing hours of white noise. Whenever this white noise appears to form a semi-intelligible word (and they will be almost exclusively monosyllabic), be sure to interpret it liberally in your documentation -- e.g., "Rssssshhh" can easily be heard as "Get out, now!" Finally, whenever any of your team members feels cold, disoriented, or otherwise ill after hours in a pitch-black state of sensory deprivation, be sure to film their discomfort up-close while declaring that their "energy is being drained" and/or that they are possessed.

  8. Contact the Travel Channel, A&E, Biography, the History Channel, and National Geographic. Although it's unclear as to what paranormal phenomena have to do with world travel, pop culture, famous people, historical events, or moribund sub-Saharan tribal cultures, these media outlets will show a great deal of interest in your team's work. Be sure to take advantage of this interest to secure sustainable financial backing.
And remember, if all else fails, start a Ca$h 4 G0ld side-business. What could go wrong?

Friday, October 29, 2010

Waxing Nostalgic for IM Conversations of Yesteryear

A recent episode of the The Big Bang Theory reminded me of an IM conversation I once had with my now-wife several years ago, back before we started dating.

I remember this conversation fondly whenever a reference is made to text-based adventure games... You know, the types of games that all the nerdy kids (whaddup!) played on their Apple IIe's and Apple IIgs's back in the 80s. These games typically place you in a labyrinth of some sort, with various diverging paths to choose from, objects to interact with, and puzzles to solve as you progressed toward some nebulously-defined goal. You progress through the game by typing various free-text commands, such as "go north" or "pick up axe" or "kill troll." (If I recall correctly, there was even an adult-themed one my friends and I stumbled upon once, in which "Fuck Trent" was a valid command that unceasingly produced the response "Trent takes no particular interest in it, but you feel satisfied.")

At any rate, this particular conversation took place across thousands of miles in the wee hours of the morning. She was sitting in an airport somewhere (my money's on SFO), waiting for her red-eye, and I was, as always, burning the midnight oil for no particular reason. It began with a cryptic remark, completely devoid of any context -- something I would later come to recognize as one of her hallmarks -- and went like this:
Her: we are at a crossroads
Me: oh sure
Her: and those crossroads are necessitated by one thing
Me: paths lead north, east, and south
Her: one pivotal fact
Me: there is a flask
Me: what will you do?
Her: er. can I kill the ogre?
Me: there is no ogre
Her: damn!
Her: I will drink!
Me: thou drinkest from ye flask
Me: thou hast died
Her: damn it
Her: do over!
Me: but thou hast been revived as in immortal
Her: hurrah! now, to the north!
Me: you go north, but you trip over ye flask
Her: damn it
Excellent.

Monday, October 4, 2010

Since No One's Reading This, I Can Rant

...maniacally, using a series of random mathematical equations:

1 + 1 < 3.14159 YOU LYING SACK OF (sin²ϴ + cos²ϴ)!!!

Take your goddamn e^-iπ and SHOVE IT UP YOUR ϕ!!!! Golden ratio my ass.

All of you MORONS who continue to believe that δ²y/δx² = 0 are COMPLETELY λ'd!!! That's right:

λλλλλλλλλλλλλλλλλ


Hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha

Saturday, October 2, 2010

Tea For Two Minutes

I'm not a political blogger. I swear. I leave such a task in the able hands of people who actually follow and know or thing or two about this maddening realm of organized society. But I couldn't help but share this well-articulated -- and obviously left-friendly -- Rolling Stone article on the Tea Party movement (news of which terrorizes my sensibilities on a daily basis):

If you're only up for reading one paragraph, make it this one:

A hall full of elderly white people in Medicare-paid scooters, railing
against government spending and imagining themselves revolutionaries as they cheer on the vice-presidential puppet hand-picked by the GOP establishment. If there exists a better snapshot of everything the Tea Party represents, I can't imagine it.

We're treading dangerously close to Idiocracy territory, folks. Pay attention, stay informed, and don't forget to think.

Thursday, September 2, 2010

Enjoy the Silence. Because I'm a Creep.

Following up on the abrupt non-sequitur that derailed my almost-triumphant return to the blogosphere...

A few months ago, my wife asked me if I liked choral music (which would have been an odd question if her sister weren't a member of the 18th Street Singers in Washington, DC). I gave some characteristically cryptic answer along the lines of "Eh, only if it's nifty," upon which I was asked to elaborate. Stumbling and stammering for specific examples (as usual), I tried to explain that, while old-school church hymns, regurgitated Baroque compositions, and so forth were not at all interesting to me, I am a fan of (a) the sparse, creative, and/or unexpected use of a choral ensemble, and (b) choral arrangements of music that you wouldn't ever expect to be sung by a choir. (Glee almost qualifies as the latter, but it's technically a capella.)

"Oh sure?" said the wife, who then waved a magic wand and a bunch of assorted baked goods spontaneously materialize. I had failed to explain myself.

Well, as of a few days ago, a seismic example of case (b) smacked me in the face when I saw the trailer for The Social Network that I mentioned a couple of posts ago, which is set to a choral arrangement of Radiohead's "Creep" performed by the Scala & Kolacny Brothers choir. Although "Creep" has never really been my favorite Radiohead song, the arrangement completely floored me, and I stayed awake for another two or three hours listening to this all-female Belgian group. It turns out that they have several arrangements of 80s/90s/00s pop, some of which are complete earworms, and others of which are just kinda bleh. You can find many of their album recordings and performances on Youtube. (And oh yes, you can buy their stuff on iTunes.)

These five in particular I can't get out of my head:
Less catchy, but interesting in unexpected ways:
Anyway, this is why I haven't downloaded the latest Arcade Fire album yet... although I have to say, their interactive music video is an mesmerizing experience if you're rocking an HTML5-compatible browser (e.g. Chrome).

Footnote: For those of you who are curious, a prime example of case (a) occurred way back in 1997 with Final Fantasy VII. Imagine: there you are, sitting in front of your TV with your brand-new Sony PlayStation (the original) -- having slogged through 40-50 hours of one of the most convoluted and ambiguous video game plots of all time (think Lost), you have reached the final battle against a villain who's planning to crash a meteor into the planet so that he can become a god. (See previous comments regarding plot.) Just when you think you've defeated him, you suddenly find yourself in the middle of a ring of swirling clouds, and your nemesis descends from above in the form of an angel with a single bat-wing in place of his right hand, glaring at you and ready to fight some more. A new battle song starts playing, and after about a minute, as you're hacking and slashing and struggling to stay alive, you start to hear an ominous, disembodied choir chanting something in Latin -- holy shit, WTF is that?!

You have to understand: in 1997, video games didn't talk, not to mention sing, or sing in Latin. Pulling off a stunt like this, at the moment of highest tension, was a game-changer, for both the player and the industry. It also made the bad guy's mega-attack that destroys the entire solar system -- a two-minute animated sequence that is easily the most ridiculous move in all of video game history -- seem frivolous by comparison.

(Random-coincidence trivia: the name of this battle song, "One-Winged Angel," is also the name of a Scala & Kolacny album.)

Anyway, that's an example. And it appears that I have once again derailed myself.

Monday, August 30, 2010

Educated-but-uninformed Letters to Congress, Part I

I don't follow politics as closely as I used to, and there's a reason for it -- it's excruciatingly exhausting and endlessly frustrating. Thanks to the 24-second news cycle, an explosion of cable news channels that don't actually report news (and CNN's decision to follow suit), the rise of social media that no one quite knows how to utilize, and so on, and so forth, our legislative process has essentially degenerated into a schoolyard game of tag-dodgeball-foursquare, in which there are no one-handers, gobstoppers or fishies, and tagbacks are only allowed on Thursdays unless the ball hits you in the face while chewing on Red Hots, in which case you can give cooties to up to five members of the opposing team. (Yes, Teacher is present to preserve the general integrity of the underlying system, but inasmuch as s/he doesn't understand the rules, she is unable to police the game as it unfolds.)

As an adult who has reached the Age of No Credibility within the past year, it is no longer an effective use of my time to track every drop of sulfur that spews forth from the bottomless fountain of vagaries, platitudes, scandals, and hypocrisies that fill the 3000-bazillahertz of "news" spectrum everyday. Rather, I just try to stay informed on the issues that are going to matter in the long-run -- e.g. energy policy, caring for the environment, fixing Social Security/Medicare, unemployment/job growth (and yes, foreign policy, but it often makes my head hurt if it doesn't put me to sleep) -- and periodically check in on the status of how these issues are being addressed. Or not, as the case has increasingly -- maddeningly -- tended to be of late.

Do I know what it's like to actually work in Washington? Do I know what kind of micro-scale wheeling and dealing, arm-twisting, and general slithering actually needs to happen in order to pass legislation? Do I have any understanding of congressional hierarchy and the arcane procedural rules that govern both bodies? Absolutely not. But I'd like to think that I'm a fairly well-educated, intelligent person, who, not knowing any better about the nuts and bolts of what goes on inside the beltway, could make some helpful suggestions. (I realize that Obama probably felt the same way before we elected him to be eternally suffocated by pollsters and political consultants.)

And so, without further ado, here is the first installment.

Dear Members of Congress:

Please stop screwing around with Roger Clemens. Most baseball fans have long presumed his guilt with regard to the use of performance-enhancing drugs, and could care less whether his self-delusional lies constituted a felony deserving of 18 months imprisonment and a fine that amounts to 0.000011% of our nation's GDP. There are more pressing issues for you to address. Speaking of which (and of our GDP):

It's the economy, stupid.

People are not fundamentally unhappy because we're becoming a socialist state, or paying historically-low taxes, or continuing to take a self-contradictory attitude toward immigrants, or adding marginal amounts to record paper-money deficits that have been with us since the the early aughts. They're unhappy because they don't have a job, because their 401(k)'s (if they were lucky enough to have one) have been cut in half, and because it seems like everyone else is getting bailed out while they're being told to be frugal. Ask yourself: how many people in Middle America do you think would rather block the construction of a mosque at Ground Zero (conveniently disregarding the fact that there are already two within four blocks) than feel secure about their employment situation and financial well-being?

To Republicans, in particular: stop fillibustering everything. Not only is this a ludicrous waste of your own time, but wasn't it you guys who kept clamoring for a simple up-or-down vote on the Bush tax cuts (which, by the way, added $1 trillion to our national debt) and hinted at the "nuclear option" of eliminating the fillibuster itself? Look, it's pretty simple: if you were against the fillibuster then, certainly you must still be against it now (because you established in 2004 that changing your mind on an issue is unacceptable), so naturally you're voting for cloture 100% of the time, right? More generally, if you're so concerned with how egregiously damaging the Democrats' propositions will be to our nation's future, surely you have an intellectually-honest counter-proposal for each measure that you block for our collective safety?

To Democrats, in particular: if you're the party of change, let's see it. Since you've had control of the White House and both houses of Congress, you've:

  • Spent several months passing a healthcare-reform bill (which, by the way, was probably priority #4 on many of your constituents' lists) that, in your efforts to compromise with an uncompromising opposition and to ensure that the flow of re-election campaign dollars remained intact, became so watered down that it essentially became a government-mandated handout to the insurance industry (but hey, at least it doesn't kick in until 2014).
  • Passed a similarly diluted financial "reform" bill, in which many of the regulations that were repealed during the anything-goes 1980s and 90s remain repealed, and under which financial institutions are still free to become too big to fail (and to be bailed out at taxpayer expense), and for-profit stock exchanges and high-frequency trading systems can team up to knock 1,000 points off the Dow in five minutes. Meanwhile, banks are continuing to borrow money from the Fed at near 0% while not loaning it out to consumers and small businesses (which, you know, might, I dunno, stimulate the economy and create jobs?) because it's more profitable for them to invest those funds in treasuries and/or route them to their proprietary trading desks. How was none of this addressed?
  • Displayed a remarkable tendency to cower in the face of misinformation. If you have a good idea that you truly believe in, you should defend it. If someone puts out a press release saying that bill that cuts taxes for the middle class will raise taxes on 99% of Americans, you should put out a press release correcting that misinformation and calling out / into question its sources and motives. Just because someone is proclaiming the earth is flat louder than you are proclaiming it is round doesn't mean you should back down.

To everyone: You're adults. You're public servants. You're our representatives on the world stage. Act like it.

Sincerely,
The Captain


(Fair readers, please accept my apologies for running out of steam... I had like maybe five or six more points of discussion on my mind, but I'd actually like to have a life this evening.)

Thursday, August 26, 2010

I Do Not Need to Explain My Absence

Many events have transpired on or near the surface of the earth since I lasted posted. Most oddly, I've received 38+ comments (apparently authored by an army of Chinese webbots) on my previous post, for reasons I can barely fathom, even with a #2 pencil lodged in my skull. But, prehaps most significantly, I've become a homeowner. This quintessential part of The American Dream, which is not very easily realized (if at all) here in the Great Concrete Desert of the Northeastern United States, also happens to be a lot of work. Things break and need to be fixed. Other things need to be blown up and rebuilt, because they weren't the way you wanted them. And, of course, everyone wants a rocket-house.

"O Lord, bless this rocket-house and all who may dwell within the rocket-house." -- Homer Simpson

However ruinous the trials of homeownership (not to mention the mortgage-brokering and refinancing process, especially when people who never passed Remedial Counting are involved) may or may have not been thus far, they are not the reason why I have been absent for something like a year. Indeed, as Occham's Razor (the only Unified Theory of Everything you need) would have it, the reason is far simpler: I'm lazy. And highly prone to distraction, aimless ambling, and the drunken-man's tendency to inevitably fall into vat of carbolic acid.

OMG. I just saw a trailer for The Social Network, which should be all counts be a hilariously god-awful movie (a la Tokyo Drift), but this particular trailer is actually very well-done, strangely moving, and unexpectedly (unintentionally?) meaningful.

http://www.sonypictures.com/previews/movies/thesocialnetwork/clips/2300/

Set against a haunting, choral rendition of Radiohead's "Creep," what you see for the first minute doesn't resemble a movie trailer at all, but rather a series of all-too-familiar images, phrases, and clicks... And by the end of this minute, as the trailer loses its disguise, you start to wonder, within the contemplative, introspective realm that the song lyrics conjure up: "Has this been my life for the last six years? Has this been all of our lives for the last six years? What motives drive us to spend so much time doing this?" (Alas, I doubt that these are the questions about which this flick concerns itself.)

Anyway, I'm back. For now, at least. More to come. Theoretically.

Wednesday, August 25, 2010

Saturday, August 15, 2009

The Assumption of the Average

Every so often, it occurs to me that I've duped myself in the qualitative evaluation of something.

Today, in pursuit of simple and arbitrary pleasures, I decided to stroll over to the local Panera to grab a late lunch and some free Wi-Fi action on their open-air patio. (Yes, these are the things in life that make me happy.) I consider myself to be fairly well-versed in Panera's offerings, as my co-worker and I usually patronize the one on Route 9 in Natick every Monday. I don't really need to look at the menu (except to determine whether a favorite seasonal offering has returned), I just usually blurt out one of three or four of their sandwiches that I like and get it with a bag of chips and a salad (occasionally tacking on a smoothie or an iced chai latte). The cashier hands me a pager, and five minutes later, I've got my food.

Unfortunately, that's not exactly an accurate description of the Panera experience that I had today. After ordering my food (turkey sandwich, chips, salad, and an iced chai latte) and receiving my pager, I sat down at a table and waited for the pager to buzz. After five minutes, I wandered over to the specialty drink counter (no latte yet), and then continued over to the food prep area to monitor the progress of my order.

This is where things started to get strange. There were two people (likely college or high school kids on hiatus) assigned to sandwich- and salad-making duty, but what they were actually doing was far less clear. (From what I could tell, it involved slowly walking in circles while occasionally commenting about someone named Roy.) Five other people (including an extremely pregnant woman, who I'll call Claire due to her striking resemblance to Emilie de Ravin) who had ordered before me were also standing and waiting, their faces awash with a mix of concern and irritation. At some point, one of them looked over and noticed everyone waiting, and doing his best to conceal an expression that can only be described as the Universal "Oh Shit" Face (which I hereby trademark, along with the acronym UOSF) and tore off a chain of three or four order tickets from a printer device.

Clearly, I wasn't getting my sandwich anytime soon, so I wandered back to the beverage counter. Still no iced chai lattes in sight, and a thorough scientific analysis of the situation led me to hypothesize that this was because no one was working at the station. Claire wandered over at some point, looking physically distressed, and perhaps this triggered someone to actually pay attention, because it wasn't ten seconds later that the young lad who'd taken my order -- visibly sporting a UOSF -- was asking us whether we were waiting for anything. Claire, who looked like she was in immense physical pain and holding back tears (I didn't know whether it was my place to ask her if she was okay, but I nearly did) indicated that she was waiting for a frozen lemonade, and I reminded him of my iced chai latte. The young man nodded, murmured some excuse about thinking that "someone else already helped you guys," and got to work.

Meanwhile, back at the food prep counter, there were several plates assembled with various sandwiches and salads, but since none of them looked like my order (at least not within a 95% confidence interval), and since my pager hadn't yet buzzed, I figured that none of them were mine. However, seeing as how the sandwich-makers had returned to their walking-in-circles-while-discussing-Roy routine, I stepped up to take a closer look. Sure enough, one of the order tickets matched mine, even though there was a baguette instead of chips, and even though they'd never rung my pager. After badgering one of the so-called employees to exchange the baguette for chips, I returned to the beverage counter.

"Here you go, buddy," said the drink-maker. It was a strawberry smoothie. "Sorry I forgot about your smoothie."

At this point, correcting him -- again -- seemed to be the ultimate exercise in futility, so I took the damn smoothie and left to eat.

As I ate, the simple thought Wow, this Panera sucks crossed my mind, as I'm sure happens to many of us at the conclusion of a similar experience. But then it occurred to me to ask: was that necessarily true? Is it really this particular Panera that sucks, or do all Paneras generally suck except for the one that I happen to patronize on a weekly basis? What if the abysmal customer-service experience that I had just been through was, in fact, closer to the norm than it was an exception to the rule?

When we evaluate an instance of a particular object or experience for the first time (whether it be dining at a Panera restaurant, playing whiffleball, or riding in a hot air balloon), I think we have a tendency to presume that the instance we're evaluating is perfectly average and falls in the middle of the bell curve of all possible instances of the same object/experience. From a statistical perspective, this seems like a reasonable presumption: 68% of your impressions will be of an "average" instance, and 95% of the time you'll be evaluating a "roughly average" instance. It also makes sense from the standpoint of natural selection: if, the first time your little brother Grrglmmick tried to jump onto a sleeping T-Rex he got eaten, it's reasonable to assume (for the purposes of preserving your gene pool) that Grrglmmick's experience is what "usually" happens when you try to jump onto a sleeping T-Rex.

And yet, thanks to the beauty of statistics, there will still be many cases in your life where your initial impression of something is actually one of those outliers that resides within 2.5% of either end of the bell-curve. (Recall the saga of Red Sox pitcher Clay Buchholz who, in his second major-league start, threw a no-hitter, and then proceeded to be one of the worst pitchers in all of baseball for the next half-year until he was sent back to the minors.) It is cases such as these that cause you to recognize and question your natural inclination to give greater weight to your initial impressions of something, and doing this can feel a little unsettling, perhaps even humbling, as though you're realizing that you've pulled off a doozy of a con-job on yourself.

But if you ask me, it's an acceptable consequence of living in a universe that, in spite of being doomed to an eventual heat-death at the hands of entropic degradation, takes a thankfully (and thanklessly) unpredictable path toward its final destination.

Sunday, March 1, 2009

The Vampire Blood in My Wine Glass Speaks!

"There are too many bears that have fallen into bottomless pits with trapezoidal openings."

"The wheel upon which are all spinning -- it measures 392.7 meters across, even though Napolean's scientists incorrectly defined the meter as being 1/10,000,000th of the distance between the north pole and the equator, whereas nowadays it is simply defined as the length of the path travelled by light in vacuum during a time interval of 1/299,792,458 of a second. Morons."

"I was at peace with my current position in the space-time continuum, but then Locke let Ben move the island and now we're all randomly warping back and forth through time, occasionally suffering from a fatal nosebleed. Ah crap."

"When a child hunts for easter eggs, he or she does not expect the act of finding one to cause his or her basket to explode. Yet this happens all the time. Why?"

"1, 1, 2, 3, 5... Eureka! Awk! Pah-cuck!" (all birds speak chicken)

"You should get contacts because you can't see anything. I recommend a +1.25 for your right eye, and a link of hot italian sausage for your stomach."

"If cows could fly around and devour Billy Corgan, the world would become devoid of music that no one has listened to in over a decade."

"Sports teams playing each other is funny when the combination of the names of the participating teams and the result implies a balance of power that makes no sense in the natural world. For example: Eagles 27, Bears 3. In real life, it would be: Bears 4,398,186, Eagles 4."

"I am the Man in the Iron Mask, and I can shoot fireballs."

Wednesday, February 11, 2009

Internet Explorer Mobile and File Upload: Utterly Flimsy

Okay, a brief respite from the usual random babbling. This post has a mission. And if you're not a web developer, your eyes are about to glaze over.

Ready?

So, I just spent the entirety of my day yesterday trying to get one conceptually-simple thing to work. As part of an ongoing mobile web application development project, all I needed to do was to enable a smartphone or PDA user to upload a file from their device to a server. In today's alleged "Web 2.0" word, this type of file-upload capability is virtually ubiquitous across most interactive and community-based websites.

To enable file-upload in a standard desktop browser, all a web developer has to do is include something like the following code within a web form:

<form action="Upload.aspx" method="post" enctype="multipart/form-data">
   <input type="file" name="MyFile">
   <input type="submit" value="Upload!">
</form>

Additionally, if you're using ASP.NET as your development platform (as I am), you can just use this little snippet:

<asp:FileUpload runat="server" ID="MyFile">
<asp:Button runat="server" ID="btnUpload" OnClick="btnUpload_Click">

Continuing with the ASP.NET example for a moment, to actually process the upload, you write a handler for the btnUpload button's Click event, like so:

protected void btnUpload_Click(object sender, EventArgs e)
{
   if (MyFile.HasFile)
   {
       // Do something with the file here, such as:
      MyFile.SaveAs(Path.Combine(@"C:\Uploads", MyFile.FileName);
   }
}

Simple, no? (I bet even some of you non-coders were able to follow along...)

Indeed, in most cases, it really is that simple. For just about any modern web browser, whether it's Internet Explorer, FireFox, Chrome, or Opera, and whether it's running on your PC, PDA, or smartphone, this example will work without any hassle. Of course, having read the title of this post, you know that there's one browser that's a glaring exception to this rule, and that's Internet Explorer Mobile. (Strangely enough, another one is the version of Safari that runs on the iPhone.)

"Now, what just a minute!" you might say. "Mobile browsers are still fairly primitive creatures, and only recently have a scant handful started to support file upload. I mean, yes, if I were in charge of a team that was building a mobile browser, I'd make file upload a high-priority task, since of course most mobile application developers are going to want to be able to take advantage of their users' rapidly advancing photo and video-capturing capabilities..."

Well, yes, this is technically true. Many mobile web browsers are just achieving a basic level of usability, and there are many mobile browser vendors who openly state that their products do not yet support file upload. Microsoft, for its part, has stated that Internet Explorer Mobile running on Windows Mobile 6 Professional Edition (but not Classic) does support file upload. And while that is also technically accurate, their implementation of this feature is so utterly broken (and in such an asinine way) that you'd be hard-pressed to convince yourself that they're telling anything resembling the truth.

So, what's wrong with file upload in IE Mobile? To the casual debugger stepping through the ASP.NET code such as the earlier example, you may (or may not) notice one or more of the following symptoms:

  • The Click event of the Upload button never fires.

  • The Request.Files collection is empty.

  • The HasFile property of the FileUpload control is false.

  • In spite of the above, the Request.ContentLength property is larger than the size of the uploaded file.

  • The contents of Request.InputStream include the uploaded file's data, along with some (but not all) of the ASP.NET form values.

  • All ViewState information on the page is lost. (This seems to happen with any ASP.NET multipart/form-data postback, in my experience, regardless of browser.)

  • Many (but not all) members of the Request.Params collection are missing.


After spending many hours capturing, studying, and stepping through the raw HTTP requests and responses of a simple file-upload web application and a variety of desktop and mobile web browsers, I discovered that the following conditions will cause IE Mobile's multipart HTTP request to become corrupted:

  • The user uploads a file whose name exceeds 15 characters in length. (This length includes the file's ".ext" extension, but does not include any directory path that the user supplies.) For example, if the user attempts to upload a file called File1234.doc (12 characters), the upload request will succeed, but if the user tries to upload a file called File12345678.doc (16 characters), the upload request will become corrupted.

  • The <input type="file"> or asp:FileUpload tag appears on an ASP.NET page that uses a Master Page. This one baffles me. I can't even begin to think of why using an ASP.NET Master page would cause IE Mobile to corrupt the upload request. Does it have to do with the way ASP.NET names and renders a container's child controls with all of those funky dollar signs and such? I've read that it's because the Master Page form's enctype doesn't get set to multipart/form-data, but in my testing I did not find that to be true. At any rate, if anyone who knows the answer to this little puzzle, please provide your explanation in a comment to this post, and you'll rewarded with a gold star (possibly one gleaned from a Google Images search).


Of these two bugs, it's the first one that really gets me. 15 characters?! What is this, 1988 and MS-DOS 4.01?! My guess is that this is some kind of non-terminated string oversight, most likely because some nitwit declared and allocated a char* buffer that was 16 bytes long, but then forgot to check the size of the actual string he wanted to load into that buffer, causing some kind of memory corruption that cascades into the text of the HTTP request.

Given these obstacles, what's a mobile web developer to do to get around them? Well, keep in mind that Opera Mobile -- which is now the default browser on the Windows Mobile 6.1 phones that Verizon, Sprint and AT&T are offering -- handles file upload requests flawlessly. (In fact, when I compared the multipart HTTP requests of Opera Mobile and the desktop version of Internet Explorer side-by-side, I noticed virtually no difference.) So, really, all you have to worry about is dealing with IE Mobile.

Thankfully, IE Mobile has pretty good JavaScript support, and you can use this to your advantage when you design your file upload web form. One possibility is to have your web page inject a special JavaScript validation function if it detects that the browser is IE Mobile, and wire your Upload button to run this script when clicked. All the script has to do is check the length of the file upload control's text (making sure to strip the path from the filename), and if it exceeds 15 characters, warn the user about IE Mobile's limitation and prevent the form's submission.

Here's an example:

ASP.NET Web Form:

<script type="text/javascript">
function ValidateFile(ctlidFileUpload) {
   var fileUpload = document.getElementById(ctlidFileUpload);
   if (fileUpload) {
      var sFilename = fileUpload.value;
      var nLastSlash = sFilename.lastIndexOf('\\');
      if (nLastSlash >= 0) {
         sFilename = sFilename.substring(nLastSlash + 1, sFilename.length);
         if (sFilename.length > 15) {
            alert("Internet Explorer Mobile requires that the document's filename (including extension) be 15 characters or less. Please rename this file and try again.");
            return false;
         }
      }
   }
   return true;
}
</script>


Code-behind:

protected void Page_Load(object sender, EventArgs e)
{
   // Inject validation script if necessary
   if (Request.Browser.IsBrowser("IEMobile"))
   {
      btnUpload.OnClientClick = "return ValidateFile('" + fileUpload.ClientID + "')";
   }
}

As for the issues with Master Pages, well, think of your file-upload page as having the same role and function as an "Open File" dialog box would in a desktop application. Essentially, you're just prompting the user to select a file for some greater, more interesting purpose. Does the dialog box need to have the same look-and-feel as the overall application? Not really, and if you think about it, neither does your file-upload page. You can maintain a relatively smooth, continuous user experience by just including a few visual cues (colors, logos, etc.) from your Master Page on your file-upload page. Give it a try and walk through the application flow -- you'll be surprised.

Saturday, January 31, 2009

ERR-OR. Sentence Fragment.

On the eve of Super Bowl CCXCVII, let us take a moment to examine a particularly fascinating aspect of sports broadcasting, one that many people typically digest unaware, like the thousands-plus calories present in a typical McDonald's value meal.

Recall the last sporting event that you either watched on TV or listened to on the radio. Can you still hear the voices of the announcers and color analysts who were calling the play-by-play and providing commentary on the competitors' current winning streak, assist-to-turnover ratio, or ballpark-adjusted O.P.S.? Excellent.

Now, pretend for a moment that you were deaf, and were watching the same sporting event with closed-captioning on. What does the close-captioning feed look like? Perhaps something like this?

Allen to Garnett on the block. Better hurry. Kicks it out to Pierce and-- batted away by Iverson! Recovered by Perkins, but a 24-second shot-clock violation.

Or this?

Two out, bases loaded for Ortiz. Ortiz hitting .352 with runners in scoring position. This Yankee crowd getting a little uneasy. Sabathia into the stretch. The pitch. Line shot down the first-base line! One run in. Ellsbury right behind. Nady having trouble getting it out of the corner. Pedroia rounding third, the throw to the plate. Not in time! And the Red Sox take a 5-4 lead on a bases-clearing triple by David Ortiz.

Now, riddle me this: if you were to transcribe the play-by-play commentary for an entire sporting event and hand it into your high school English teacher, how many boxes of red pens would he or she have to buy (assuming Costco bulk quantities) to elevate the grammar to an acceptable level?

Indeed, most sports announcers speak in sentence fragments, and I think that this is something we easily accept because those fragments are mostly descriptive in nature and complement what we can otherwise plainly see (or hear) about the event and situation in question. There does appear to be some variation from sport to sport, however.

Referencing the above examples, I've found that most baseball commentators frequently omit the word "is" (and "there is") from their sentences, even in between plays when there is no action to describe and including the "is" would produce a complete, grammatically-sound sentence. (e.g., "Ortiz hitting .352 with runners in scoring position.") Basketball announcers, by contrast, seem to have a tendency to end their sentences in nouns that directly reference a rule of the game that has just been applied (e.g., "Recovered by Perkins, but a 24-second shot-clock violation" or "Roy drives through the lane, and a foul!") And although I haven't watched enough football to pick up on any patterns (maybe I can use Joe Buck's cross-sport announcing as a constant), tomorrow's Super Bowl may provide an ample opportunity if and when the Steelers find themselves up by 47 points.

In closing: if you're planning on taking the TOEFL, please be careful not watch any sports, because they will cause you to fail.

Next time: transcribing movie trailers, and the hilarity that ensues.

Saturday, January 10, 2009

Exercising the Right to be Arbitrary, Episode #391

Today, whilst purchasing a decanter at Ye Olde Crate & Barrel, I encountered a very large point-of-sale console that happily offered to process my credit card transaction. Its dimensions were approximately 16 inches wide by 12 inches tall, and it prompted me to sign for my purchase within a box that was approximately 10 inches wide by 6 inches tall. This seemed excessive, so I decided to draw a giant smiley face above my signature.

The cashier seemed amused. She asked me whether I did this all the time. I said no, this was the first time I'd done it.

Then I pillaged the Sweet Factory.

Monday, January 5, 2009

How to Make a Speculative Documentary About the Apocalypse

Well, this week is Armageddon Week on the History Channel, and as the owner of a month-old plasma TV, that means it's time to watch a bunch of fiery, high-definition explosions bathe my living room in a hearty warm glow. The week's lineup includes an in-depth analysis (and CGI re-creation!) of the events depicted in the book of Revelation, and exposé on The Bible Code, and no fewer than thirty-seven treatments of Nostradamus' verses. As a child who kept the crushingly vacuous boredom of church at bay by reading the Book of Revelation over and over, I am So. There.

Now, you'd think that producing a show about Armageddon could carry a hefty price tag, what with all of the CGI artists you'd have to hire to animate a lamb with seven eyes and seven horns, gravely wounded and bleeding profusely "as It had been slain" (Revelation 5:6), not to mention the crazy Bacchaen woman riding the Beast with seven heads and ten horns. (I mean, there's a lot of careful decision-making involved when it comes to allocating the horns across the heads. Does each head get a horn? Which heads get more than one horn? For the heads with multiple horns, are the horns symmetrically arranged?) Alas, it is not so. In fact, just about any ol' Joe with a digital camcorder and an iBook can easily throw together their own end-of-days TV special by following these simple guiding principles:


  1. Hire the most sinister-sounding narrator you can find. Test their worth by having them read Goodnight Moon and determining whether the child's head rotates a full 360 degrees in your mind.

  2. Include several shots of a modern U.S. city being hit with one or more fiery projectiles streaking out of the sky. Limit the voiceover content to vague descriptions of "absolute destruction" and "complete chaos" -- do not attempt to describe which city it is, what the projectiles are, or what is generally going on.

  3. Whenever you are filming something benign (e.g. some children playing Four Square), shake the camera violently to indicate that a massive earthquake is sweeping the entire planet as the Final Battle rages in the heavens.

  4. Occasionally punctuate the narration with a random Bible verse (not necessarily one from the Book of Revelation or having anything to do with Armageddon), preferably voiced by a retired Shakespearean actor.
    "For where two or three are gathered in my name,
    there am I among them."
    -- Matthew 18:20
    Ensure that the verse appears on-screen as it is read. Use wet, hand-written ink on a yellowed scroll if you can.

  5. Make at least one mention of Nostradamus, and show him to be an ominous-looking, age-worn man with a beard, a funny hat, and a crystal ball. Helpful hint: add pupil-less, glowing eyes for effect.

  6. Ensure that the soundtrack features a full-bodied choir chanting something ominous in Latin, Sanskrit, or some other ancient language. If you are unable to translate a phrase such as "four the horseman blacken the sky and sunder the earth," Google the language of your choice in conjunction with the word "phrases" and use whatever result you get by clicking the I'm Feeling Lucky button.

  7. Consult various subject-matter experts for their thoughts on the Book of Revelation, the current situation in the Middle East, nuclear arms races, and global warming, but do not mention or display their names, titles, or qualifications at any time.

  8. If at any point you feel that you are running out of material, keep cutting back to the shot of the anonymous U.S. city getting blown up by unspecified fiery projectiles. Show this scene in slow-motion or with negative coloration to lend it a sense of variety.

Saturday, November 29, 2008

Mark My Words

If it ever turns out that, for whatever reason, I'm unable to drop $109,000 on a Tesla Roadster, a new-build DeLorean will have to do.



In the event that it doesn't come with a Flux Capacitor, I'll have to settle for the iPod jack, heated seats, and bluetooth integration kit... maybe the backup camera too.

Wednesday, November 26, 2008

On the Rediscovery of the Red Savory

The other day, I found myself standing in the middle of a chessboard, where the following took place:

Knight to C3
Pawn B6 to C6
Rook A1 to A5
Fig Newton J1 to incisor L2

Then the grayfish proclaimed to all through my ear-trumpet:
All hail the great tree of the shrouded everyman
For its diaspora has spread to twelve continents
And is broadcast to the other five in 1080p

Indeed, it was a time of accelerated enlightenment that promised a bounty of further discovery with every passing millisecond, where old habits quickly and silently faded into the teeming switchgrass, and even older ones sunk into the gaping sandtrap behind the 6th green. Jonah's gaze absent-mindedly followed the tangled loops of his shoelaces, as he pondered the fact that his name would never again be mentioned beyond the bounds of this sentence.

Excelsior! We have transcended the anonymity of a misplaced black button floating in a distant cranberry pond.

From within the sarcophagus, I could hear this voice and the footsteps that preceded him: they had become numb from frequent immersion in chilled marmalade. As the voice continue to mutter to itself about the proper aging policies for non-liquid receivables, I wondered how it was that I became suddenly encased in a sarcophagus in the middle of a chessboard. To be sure, King Tut had recently appeared to me in a dream, but his incessant circumlocution on topics that bore no relevance to my rapidly-declining home value prevented me from waking up for 37 days. The sum of 3 and 7 is 10. Knight C3 to D5. As a child, Ancient Egyptian civilization captivated my imagination (often through such vehicles as Choose Your Own Adventure Books and Super Mario Brothers), and I knew that, someday, I would visit. That day was not now; it was last Wednesday.

By the time I had found the crowbar at my feet and pried the sarcophagus open with my elbow (after I had swallowed the crowbar), it had become phosphorescently clear that I had been checkmated by the ham-and-cheese sandwich parked at G5. The hour of ultimate defeat was at hand, for I had failed to obtain the secret 1-UP contained within the Level 5 Warp Zone, and consequently had no lives remaining in reserve. The sandwich lurched forward, sometimes erratically, sometimes delicately, and sometimes in a trumpet-accentuated figure-eight pattern, as the butter-like fabric of space-time melted cleanly and evenly into Jean Valjean's cosmic bowl of lightly-salted popcorn.

And so it came to pass that, at some point in time -- or perhaps never -- I was unexpectedly quashed from existence by a common lunchbox item. But at that meaningless point where the left-hand and right-hand limits of my consciousness diverged to opposite infinities, it could be summarily stated by an unidentified, omniscient third-person narrator that I felt more like myself than anyone else ever did or ever will.