Showing posts with label glitches. Show all posts
Showing posts with label glitches. Show all posts

Wednesday, November 18, 2015

Trouble Ticket

A tech support guy (last name: Bundy) sent me an email that started with "Hi Orangutang, Are you able to reboot..."

The Trouble Ticket

Arrgh, broken office phone
Let's file a service request
You prefer the old designation:
A trouble ticket
Ah: musical notification
Open the unread mail
"Hi Orangutang,
Are you able to reboot... ?"
!!?

Oh, hell no.

Memories of childhood taunts
Visions of lynch mobs
His last name: Bundy!
You briefly saw red
At this monkey business
Clicked that Reply button
Far harder than it deserved
The sinews loosened
Keyboard avenger:

Believe me Sir,
I would never have opened
A service request
Had I not tried
Rebooting.
I am curious however
About your rendering
Of my name (below)
Am I to assume
Slips of the Freudian sort? ...

Stop

That furious reply
A firing offense
For you, right after that guy
Don't click Send
Take a deep breath
And a moment to reflect:

"Words are like bullets. When you release them, you can't call them back"
The boy who cried wolf, they didn't cut him any slack
You might well be criticized for a hair trigger tendency
Or unjustly fired for writing the word niggardly

Stew

Then
Just a few minutes later
Chimes sound again
The inbox darkens
Message quoted below
"My spell checker
fouled up your name!
Sorry about that!"
Great catch, I'll say
The mood lightens

Phew

That's clearly better
Don't hold back the nervous laughter
For indeed, would you really rather
Prefer Freud to an errant spell-checker?
Better the benefit of the doubt
Than yet another racial bout

So. Like your three year old daughter has began to say
In that amusing and delightful way
With that high-pitched, nasally voice
It's really the obvious choice:
"Awkward".

You remember incidentally
That you once wrote
That self-same case study
In that note
Titled Cultural Sensitivity in Technology
About this curious artifact of software modernity:
The occasional regret
of auto-correct

You are truly your father's son
You never, ever, jump the gun
"Remember: anger and the African man."
Pragmatism born of painful experience
There's even continuing historical evidence
That lesson of the United States of America
Always defuse tense moods with quiet laughter
And, above all, maintain that calm, level-headed posture

Still, it's really a curious situation
How one responds to real, and potential, provocation
The option is denied of righteous indignation
The fallback civility, a source of frustration.
Your tribe's peculiar daily dilemma:
Better neutered than six feet under.
Or, perhaps, with a little less drama,
In the twilight of this, the age of Obama:
The poorhouse, or staring at ceilinged glass.
Best not to prompt a human resource activity
To be followed undoubtedly with notoriety.
You're a Harvard man, don't be so crass
You don't want to be like that famous professor
A cause célèbre, but branded by some as the aggressor
And even requiring a presidential beer summit.
After all, it's merely a trouble ticket.

Your strategy for the incident report
Never mention it, simply avoid the court.
So. Delete your impertinent second sentence
That premature act of literary vengeance.
But keep the Sir designation
Your passive aggressive intimation
Or, should I say, capitalized rejoinder.
Also, delete the offensive text,
That implied reminder.
You don't want to hear later:
"He's not a team player".

This treacherous modern world to which you belong
The bewilderment in determining right from wrong
But do look him straight in the eye
If, and when, he deigns to come by.
The two of you might well have a laugh one of these days
Replace the veil, return to your mild-mannered ways

The reverse of the coin termed white privilege
That undercurrent, or rather subtext, of repressed rage
It's ugly, and surprisingly close to the surface
Even for you, there's a hint of coiled menace
You think of yourself as above the fray, literally mid-Atlantic
Yet for a moment there, you were about to get very frantic.

While you wait for your replacement phone
You'll navel-gaze and write a short poem
Choosing a typically idiosyncratic meter
And rhyming scheme, that occasionally peters
Out
And turns to, let's call it, doggerel.
But, hey, that's alright because well:

The resolution to this new trouble ticket:
Incident closed: operator error
A case of an errant spell checker.

"Just because a lizard nods its head, doesn't mean it's happy"
You smile at your rejected naming choice: Mister Bundy

Soundtrack for this note

Also: reboot a phone?

masks from Maame

Steps to reproduce
- Clean install of Mozilla Thunderbird (English)
- Compose an email with the name of the chief toli monger in the body
- Check Spelling
Result: Orangutang is suggested as a replacement
Workaround: add said name to the user dictionary
Proposed fix: add said name to the standard dictionary

File under: , , , , , , , , , , , , , , , ,

Tuesday, February 02, 2010

Black Sheep

Every feel unwanted? Ever feel like a pariah? What if your country starts disappearing from the global zeitgeist? When, I wonder, did Ghana start to fade from view? All right, let's get concrete here. Try this on your iPod Touch or iPhone (I was given a first generation iPod touch - now running iPhone OS 3.1.2 - a while back as a kind of consolation prize when my job seemed in doubt - but I shouldn't digress about the pathologies of corporate America). Anyway, where was I? Yes, take your i-something, open the Contacts App, create a new contact and add a new address. Alternatively just try to edit an existing address. Now try to change the country field to Ghana. Note, if you will, the result: Ghana is not in the list of countries. Search under "Africa (Western)" and you'll see nary a trace of Ghana. Heck, look through the entire list of countries and realize that we didn't make the cut. Ghana is not a country in the eyes of Apple.

ipod touch country list bug: Ghana must go

I came across this issue over Christmas when I was home and trying to enter new addresses in this, my conflicted glorified organizer thingimijig. It's just a bug of course, and presumably if I complain loudly enough or write up a bug report against Apple, it will get fixed. Whoever wrote the Contacts app is certainly not trying to whitewash Ghana from history. They just don't have many Ghanaians using iPhones, nor indeed testing the feature hence the omission slipped through the cracks, embarrassing as it may be. Moreover I've been on the other side of the fence, producing software that at times has been seized upon for subtle local insensitivity. I've even written in the past about the cultural difficulties that any piece of technology can elicit so I won't be calling for boycotts or apologia.

But wait, there's more. It seems that Ghana has been disappearing left, right and center from dropdowns and country selection boxes all over the web. I keep coming across this kind of ethnic cleansing in my browsing. Who decided that Ghana must go? It is one thing to be a literal exiled soul, a man of many countries but no home, but it's adding insult to injury to be cast into virtual exile. What gives? Why are form widgets all of a sudden slimming down and discarding Ghana? Why are even these fleeting elements of identity, that pleasing sight of Ghana nestled in between Germany and Gibraltar, being denied me and my countrymen. For example, in the past week I've been trying to buy gift subscriptions to some magazines for my uncles (Economist, Newsweek, New Yorker) and noticed that the online payment processors that these websites use simply don't feature Ghana in the list... go take a look: Gabon, Gambia, Georgia, Germany, Gibraltar. Where did Ghana go?

new yorker country list bug

newsweek country list bug

economist country list bug

I opened an investigation into this onset of web deportations but, first, let me tell a story...

My routine, ever since 1998, has been to spend my Christmas vacation in Ghana. As a fairly dutiful engineer son this means that 24 hours or so of my vacation is spent on tech support. I either bring new computers or coax the parental unit's setup into shape. They've tended to use Windows as their operating system so, as a matter of course, I would install or renew the subscription to Norton anti-virus or some software firewall or other, paying penance to the insecurity of the Microsoft ecosystem. Since 2005 however, I have been unable to renew the subscription with Symantec from Ghana. It's the usual thing, any credit card transaction from a Ghanaian or Nigerian IP address would fail silently with only a cryptic error message. I had a US billing address and yet my transaction would keep getting denied.

After repeated instances of this, I eventually worked out that the payment processor that Symantec uses had declared Ghana a nation non grata. Thus for the past 5 years, I would renew the subscription when I returned to the United States, or by using the corporate VPN (back when I was actually foolish enough to take a work computer with me on vacation) in effect pretending to be in the USA. Sidenote: the other alternative that most Ghanaians take is to simply install bootleg software or some open source or more wallet-friendly package (virtually no one actually pays Microsoft or other vendors for their wares).

Containers: cybercafe

Ghanaians have great difficulty using credit cards, PayPal, Google Checkout and the like. If we take ecommerce as one component of modern global citizenship then we are illegal aliens of sorts, and our participation is marginal at best. While remittances are a major part of our economy, we continue to pay a heavy price in all our financial transactions. Banks, wire transfer and check cashing joints salivate at the profits they make on our backs and yet the kind of routine monetary transactions that any idiot with a credit card can do in the West is a pipe dream.

The major reason of course is that a large amount of 419 scams, advance-fee schemes and outright frauds seem to emanate from our virtual lands. Payment processors tend to filter with a broad brush and their geolocation heuristics often tar almost all IP ranges from Ghana. The same story goes with spam filtering and some ISPs are known to ban entire countries arbitrarily as mitigation measure (I've seen this applied to countries like Russia, China, Korea). I have lots of Nigerian friends and their emails are often consigned to the spam folder even in GMail whose spam filtering capabilities seem to be the most discriminating. I can recall a member of the security services in Ghana quipping that two thirds of the 419 scams in the world could be stopped if police could simply round up everybody at Busy Internet and other internet cafes in Accra at the right hour. Thankfully that broad brush hasn't been applied - think of the rule of law, false positives, and Minority Report a priori censorship. Still, the actions of an unruly minority are making life difficult for us all.

Busy Internet

What is most galling now is that even our Nigerian brethren in e-criminality are on the list of countries in the above 4 cases. We have the workings of a different bug. With tongue firmly in cheek, I would say that Ghana is uniquely blacklisted. If you live in America, you expect that you won't see North Korea, Iran, Cuba or the like in your commercial browsing since sanctions and embargos pertain. Why would Ghana be in such august company?

One hypothesis, for the websites at least, is that the bug is at the level of the payment processor: Entrust, or Visa, MasterCard etc. Or perhaps our unreliable postal system is at fault. Another alternative is simply that there is a canned type of widget that is being used around the web. I know how these things work: most programmers cut and paste code when they are developing their sites, I know I do that often enough. A cursory inspection shows that the Condé Nast sites are using the jQuery toolkit, a potential source of the bug, but it could be any of the other popular toolkits, Dojo, YUI, Scriptaculous etc. These are pre-canned form widgets and one can envision that a popular tutorial site or user interface toolkit has the bug and has been widely copied.

But, what about the bug in Apple's iPhone Contacts app, one wonders? That seems like an outlier unless it too was written as a web app using much the same widgets. Does anyone have any theories on the matter?

I won't get into how Orbitz and Expedia have now followed the lead of Travelocity in removing Accra from the list of places you can book travel to - this, even though major airlines like Delta, KLM and British Airways fly there. I know that my small country doesn't warrant much attention, I know my place. But this is different, all I want to do is enter some addresses in my organizer or send my uncles some magazines. Magazines that are ostensibly a dying business won't even let me send my hard earned money to them. Someone help me, I feel like a black sheep.

File under: , , , , , , , , , , , , , , ,

Wednesday, May 09, 2007

Briefly Noted

Deadlines are looming and it's also travel season, hence toli must be brief. Here then are some notes on the run...

I. Imperfect Analogies

Item: Before a certain column was published last Friday, a note I wrote used to be the top result for searches for IBM layoffs. I always worried that my musings might attract attention of The Authorities; thankfully, with Cringely taking the hyperbolical lead, they are now firmly (and hopefully permanently) under the radar... It's been almost two years and perhaps I should revisit the France IBM Connection. Back then, I predicted that despite the malaise in France, the French would re-elect the right after Chirac stepped down. Dig: Nicholas Sarkozy was elected president over the weekend in an election that saw record participation. French democracy is proving remarkably healthy. Although ostensibly elected on a mandate for reform, it is interesting that the old guard was the demographic group that voted for him en masse and put him over the top. In a similar vein I will not (cannot?) comment on rumours that IBM is about to decimate the ranks of its global services group and reform that business. One has to tread carefully in this lean corporate world, job (in)security and all that. I never answered the question later put to me: if IBM is France, who was it that was burning cars in the banlieues and would they survive? Implicit also was the issue of whether and how the French establishment would address the wider challenge, modernity and sundry taboos, or in the case of IBM, how it would deal with the web. My analogy was never perfect and I remain at a loss for answers on both fronts. Still, to mix a few sayings:
The stakes are high. Observers are worried. Closed due to computer problems.
closed due to computer problems

II. Special Treatment


Delta Airways recently (December 2006) began direct flights to Accra from JFK and Baltimore. By all accounts this has been a very successful endeavour for them. Their three weekly flights are fully booked. Clearly they are servicing pent-up demand. Ever since Ghana Airways went out of business, KLM and British Airways had been reaping the wages of monopoly pricing. It's not simply that Ghanaians are homesick or that we are now able to flex our economic muscles. The Nigerians, and others seeking convenient access to West Africa, are also patronizing these flights.

There is a little twist that I observed over the weekend. Delta has done their research well and paid attention to their market. They know all too well that Africans love luggage, what with Ghana must go bags and such, and will seek to haggle over the amount of luggage that they can check in and carry on board. Further, our crowds in airports are often unruly as fellow travelers will attest. Our relationship to authority and order was perhaps poorly served by having rogues rule us for a few decades.

Accra check-in

Thus I noted that there is a separate check-in area for travelers to Accra in the Delta terminal in New York. As I passed it on my way to San Francisco, I overheard a couple in the regular check-in area pointing and asking "What country is Accra in?" The reply: "I don't know, I don't envy them however". I looked over at the long line that was forming, the numerous bags spilling over, and heard the clamour arising from the check-in counters. The airline staff looked a little harried, and well, world-weary. Crowd control is a difficult thing especially when you are dealing with a culture that is all about conversation and the banter of marketplaces. Keep in mind that Kweku Ananse, the cunning and scheming spider, is Ghana's great cultural and literary gift to the world. They must have heard every story in the book, along with sundry inducements for bending of the rules on all forms of luggage, excess and otherwise. I was a little sad at first at our segregation, and embarrassed at being singled-out for cattle-herding. I thought it over for a while, rationalizing rather than wringing my hands, and then smiled: we have our own section, how many others can say that? Our people are being given the special treatment.

Accra check-in
Step right up
Baby steps, baby steps.

III. Triumph of the Penguin


A sidenote: a custom version of Redhat Linux is the operating system running the in-flight entertainment system on Delta flights. This was evident from the scrolling screen messages that we observed as the air hostesses had to repeatedly reboot the system so that the other side of the plane could get their 40 channels of satellite tv. It's heartening to see the spread of Linus' little penguin even if it is only visible when there are problems - the brief flashes of startup screens. The Pentium chip grew into the public's consciousness after its flaws with floating point calculations were exposed. Paradoxically Intel never looked back once it dealt with the initial fallout of that episode. Similarly, folks continue to photograph blue screens of death in machines running Windows say in ATM machines and the like. Again that is an ironic triumph, a display of the spread of Microsoft's software into areas that were formerly the lucrative province of others. As we observe the spread of Linux as core and ubiquitous infrastructure it is good that it is similarly an iconic brand. Infrastructure is normally invisible and only appreciated when things fall apart. In this respect, I should say:

I love infrastructure.
I love glitches.
Infrastructure

IV. Dark Brown


When I wrote my piece on Cultural Sensitivity in Technology, I alluded to a number of incidents involving glitches with Microsoft Word's dictionary or thesaurus. I never managed to track down a good reference to add before it was published. A few weeks ago however the perfect example came up, it concerned the colour dark brown. The headline read:

Offensive couch label traced to China

Toronto. Doris Moore was shocked when her new couch was delivered to her home with a label that used a racial slur to describe the dark brown shade of the upholstery.

The situation was even more alarming for Moore because it was her 7-year-old daughter who pointed out "n----- brown" on the tag.

The rest of the story is a tangled web especially apt these days as we all mind our P's and Q's and hold mock funerals.

It's a wonderful and layered example of the ramifications of small things. The fingerpointing that results in this globalized world of ours is also very interesting. Who is to blame? Is it the manufacturer of the software that translated 'dark brown' in Chinese to the n-word in English? Or is it the supplier of the upholstry that used said software? Or is it rather the furniture store that sold the couch? Who is ultimately responsible for making sure that such things don't occur? Who, if anyone, should apologize? Or are such things what we should expect, the logical endpoint of globalization?

So what do we have here? A simple glitch in the continuum of cultural sensitivity resulted in innocence lost all around the world. The Chinese companies are embarrassed and worried that they will lose business - they are furiously updating all their software, the furniture store is worried about being sued, the mother learned that you can't protect your kids from that thing known as race, the 7 year old learned what a complex world we live in, a world of words that hurt and can even kill.

I was also tickled by the huhudious claim of the Indian store owner that "I've been here (Canada) since 1972 and I never knew the meaning of this word". That is indeed as brazen as it gets.

The remaining absurdity lies in the visiting "friends over from St. Lucia" who "wouldn't sit on the couch." I wish I could meet said friends, they push this toli into sublime territory.

portia portfolio sunflower seed

A Brown Playlist


A soundtrack for this note, some music celebrating the darker shade... Liner notes to follow.

File under: , , , , , , , , , , , , , , , ,

Friday, March 17, 2006

Minutiae

A surprisingly large part of a software engineer's life is spent dealing with the little things. Much as I like to write about grand designs and architectural issues or people, processes and communities, all too often, the devil is in the details and I get lost chasing technological quirks. Herewith a sample of just the past week's minutiae, perhaps fodder for historians of science or anthropologists.

Boolean Identity Crisis


I was going over some code in my pet XForms processor implementation and wondering what was going wrong - incidentally IBM has written (at least) 6 forms processors in the past 4 years along with contributing to the Mozilla XForms effort but we won't get into that - I'll save that for a business school case study or something.

After an hour or so of head-scratching this was what I found. In XML Schema Datatypes, the lexical space of boolean values includes not only "true" and "false" but also "0" and "1". I assume the inclusion of 0 and 1 in the specification comes from the legacy of the C language and presumably that makes sense. But I ask, was that a wise decision? The designers of the specification chose a binary representation in a textual format.

The forms processor is written in Java. It turns out that in the Java language, the lexical space of boolean values is case-insensitive "true" and "false". So if you have a mapping layer that goes from schema datatype to Java you have to add special case code to deal with 0 and 1. Presumably also in the other direction, you have to make sure that you don't output "True" instead of "true". I had been linking to a library that hadn't bothered to implement this more robust logic and ran into this boundary condition. Oh well, I thought, I'll have to add an adapter around this library or rip it out and roll my own - an assignment for the weekend.

I vaguely remember Sam Ruby mentionning that this was one cause of interoperability issues between SOAP implementations and it stands to reason: we've codified an identity crisis.

Structured Data Footnotes


Jon Udell is a careful man whose
blog works differently from the rest of the InfoWorld blogs. The content is well-formed XML, and it follows certain self-imposed rules.
This discipline enables him to work miracles and regularly come up with lots of cool applications. But in the wider world, getting people to author structured data is an often intractable problem. XML is often structurally invalid; as an example the Google Reader team have reported that 15% of feeds on the web are not well formed and that is before considering the feeds' semantic validity.

Thus I was tickled by this footnote he wrote when playing with microformats.
The difference? I ran the page through HTML Tidy to get well-formed XML 2...

2   It wasn't entirely automatic, unfortunately, I had to wrestle with character encoding issues too.
Ladies and Gentlemen, I give you The Gruesome Twosome of Computer Science: Structured Data and Character Encoding. We call them footnotes.

Highlights, Lowlights


It started with an offhand comment, a report that one couldn't set the background color on text in the rich text editor in Mozilla Firefox. Every other command on the editing palette worked. You thought, "15 minutes tops, I'll take it".

So you look up the list of command identifiers in Internet Explorer and notice that the execCommand method has an attribute named BackColor which
Sets or retrieves the background color of the current selection.
You head back to the Midas spec for Mozilla and see that for the backcolor entry
This command will set the background color of the document.
Hmm... Your first thought had been that it was a case-sensitivity problem, "backcolor" rather than "BackColor", but the documentation notes that case doesn't matter. So the problem is rather what you highlighted, in Mozilla, backcolor applies to the document and not to the current selection. This means that you have to use a different identifier to achieve the same effect in Mozilla. You promptly notice one called hilitecolor
This command will set the hilite color of the selection or at the insertion point. It only works with useCSS enabled.
Okay, someone decided to not use the same command as Internet Explorer, fair enough, you've seen worse. As you change the code, you say, it's Mozilla and CSS is enabled by default so all I have to do is switch to using hilitecolor.

Of course that doesn't work. You then tell yourself that you'll just enable CSS with the useCSS attribute (you had looked more closely at the code and noticed that CSS styling had been deliberately turned off for some obscure reason).

Hmm, that didn't work...

So you go back to the spec and you notice a styleWithCSS attribute. Interesting... You try that instead of useCSS. Of course, you happen to be testing using a version of Firefox (1.04) that doesn't support that attribute so there's an exception. Presumably this attribute was introduced in Firefox 1.5 or something. Still it's a good thing that you are using an older version for testing otherwise this would have been another bug (feature doesn't work in Firefox 1.0 etc).

You bang around for a while and go back to the original Midas demo which seems to work correctly if you have the "use CSS" checkbox checked.

You view the source of the demo to figure out what could possibly be making it work and you notice that they are setting the useCSS property to false when the checkbox is checked. Huh? They set useCSS to false in order to enable CSS!

So you go back and look more closely at the documentation. First you notice that the useCSS property is deprecated. Hmm... the plot thickens. Then you read this
useCSS - value: true/false

Note: This command has been replaced with styleWithCSS. It takes the same values as styleWithCSS, but the meaning of true and false are inversed.
Up is down in other words. It's like Alice in Wonderland or something. Do note that there is no word on what version the replacement occurred. Nor indeed is there any footnote on why true and false are "inversed".

Anyway you've finally figured it out, you make the change to enable CSS styling only when applying the hilitecolor attribute, add some future-proofing to use the styleWithCSS attribute in case the deprecated useCSS attribute is removed in later browsers, submit the patches and 3 hours of your life have passed. It was frustrating but there's an object lesson somewhere. If you are building a robust cross-browser rich text editing application, you have some code that has to go through this rigmarole.

I have a confession. I recounted the above tale because I feel guilty: I could have prevented all this four years ago.

Internet Explorer was the first browser to introduce rich text editing. It was not pretty since they didn't want it to be as good as Microsoft Word, but it worked reasonably. IBM later contributed resources to Mozilla to beef up its rich text editing. Indeed four years ago, I was asked to review the resulting Midas spec by my colleagues who had been working on that functionality. The spec looked serviceable, pointing mostly to the Microsoft documentation since they wisely chose to follow the de-facto standard. I reported a few bugs with the intial implementation and we built a rich text editor around it. It's widely used on the web these days.

I obviously was a bad reviewer because I certainly didn't notice that there was a change in the semantics of the backcolor attribute from "current selection" to "document" nor indeed that a new attribute, hilitecolor, had been introduced in Mozilla. There is absolutely no reason for these discrepancies. Nor do I want to go down the forensic trail that explains why you can't have a background color on text if you don't style with CSS. That's a rathole of its own.

So what do we have here? A de-facto standard was implemented but someone took the liberty to change one aspect of it for whatever reason - semantic purity or something. I suspect I won't be the last developer to waste an afternoon on this or indeed the last user to be cursing about why I can't add a background colour to a piece of text. I hope that Opera and Safari, if and when they have their rich text editing implementation in place, will do a wholesale copying of Internet Explorer's behaviour. I don't want to be chasing these lowlights again. I often see criticism of Microsoft's inconsistent approach to standards but everyone can be as guilty as them on occasion.

Which Side Are You On?


Stefan Tilkov recently asked what's wrong with Javascript? The answer of course is nothing really, it's a fine language as evidenced by looking around current thinking on the language. Indeed Brendan Eich's biggest admitted gotcha about the language is automatic semi-colon insertion. Thus there is no reason it can't be used in environments outside the browers in which it is most widely deployed as glue - I've played with Rhino on the server-side without any problem.

From what I understand, Jotspot, which incidentally I consider a cunning plan to showcase the Dojo toolkit, uses Javascript as the scripting language on both the server and client. All power to them. Of course with Javascript from the same document executing in both environments, you can get very confused. The answer to one of Jotspot's most frequently asked questions, "Why isn't my Javascript function being called?" is that "your code is not running where you think it is" ergo, you're expecting that the current code you're looking at is server-side rather than client-side, or vice-versa. This is especially true since the object model is likely to be different, the browser DOM is a deliberately constrained environment whereas on the server side you'd want to allow your plugins to do more.

Thus there is a little impedance with using Javascript everywhere. Perhaps it's less confusing to use a different language and syntax for server side code - a tag library in jsp, or embedded java, php, asp or whatever. Or maybe clever syntax coloring in your editor or IDE would do the trick to remind you of the context. Needless to say, you have to decide what side you're on...

I've been working on a project in which the others on my team are seasoned PHP gurus and are occasionally petrified of Javascript - the reason of course being the continued brittleness of the browser platform. When I started work, this bias showed and their initial recommendation was to do as much as possible in PHP on the server-side. They recognize however that that we are living in an age of interactivity so we need that shine that comes with moving intelligence to the client. Still when you start doing data-binding and automatic JSON serialization of PHP objects, you get constructs on the browser client that you wouldn't normally use if you were a client-side person. As someone who's very comfortable with both client and server side code (perhaps more comfortable with Java than PHP), I keep running into such peculiarities all the time. Of late I find myself prototyping code in client side Javascript even if it will eventually morph into server side code. Perhaps I need to get more into Python or that Ruby bandwagon. Still you tend to develop a split personality when you develop for the web.

The Null Hypothesis


I got the note: "you can't append a column if you click on a cell in the last column of a table in Internet Explorer".

Huh? I attempted to reproduce the bug and, sure enough, that was the case. Vaguely at the back of my mind I recalled from painful experience in K-station that there were special APIs in the HTML DOM for dealing with tables. Thus I searched the codebase for insertRow and insertCell. Hmmm those functions were nowhere to be found. How were they doing the column insertion, I wondered? My guess was that this was either some innerHTML tricks or simple standard DOM manipulation. Thus I had to dig through the code and eventually encountered the Node.insertBefore conundrum.

Now insertBefore is a method on the Node interface that is part of DOM level 1 specification. Every browser claims at least DOM level 1 support.

It turns out that in certain versions of Internet Explorer the second parameter to the insertBefore call can't be null, you get an Invalid Argument exception. Mozilla handles this condition as one would expect in their Javascript binding; Internet Explorer chokes. [Obscenity]. There was too much code to change to use the HTML-specific methods so I just hacked special case code that ensures that I don't pass a null to Internet Explorer - 3 hours of my life perhaps.

Now this doesn't amaze me really, thinking back on it, this is probably the reason that somewhere in the bowels of every Javascript library that deals with dynamically adding a new option to a select control, you'll find code like the following:
function appendOptionElement(select, newoption){ if(is_ie) // test for internet explorer somehow   select.add(newoption); else   select.add(newoption, null); }
The browser is a fragile place and hopefully the frameworks that are being developed will shield you somewhat from such issues, but it is telling that you can't rely on core DOM functionality. Even if these quirks are fixed in Internet Explorer 7, this patched-up code will have to hang around for another 5 years before users will no longer use older versions of the browser. We're in a world of pain in the browser world.

Nulls however are problematic throughout computer science. The arguments around them may sound like angel and pinhead discussions but they are fair questions. What indeed is null? What is zero for that matter? For centuries and throughout the Dark Ages of the West, there was no concept of zero, it took Arabic Algebra to spread that notion. Why should one expect that programmers would have internalized the null concept? Reasonable people can and do differ on how to treat null.

Just now, reading through the latest Dr Dobbs journal, I noticed the following in an article about Consuming .NET Web Services in Oracle JDeveloper
The ATL Server SOAP handler generates an xsi:nil="1" attribute when the element's value is null, or when the array is null or zero-size. Unfortunately, Apache SOAP fails to deserialize UDTs whose fields contain the xsi:nil="1" attribute and expects zero-size arrays to be represented as XSD arrays with the dimension parameter set to zero.
The author then proceeds to outline a variety of workarounds. Now I happen to not be a fan of the SOAP style of programming (in the past I've called it Crusty Old Architecture pronounced SOA with a silent P) but as a developer, I feel the pain. The article is a catalog of kludges and likely mapping errors that have to be worked around - the word "unfortunately" is used entirely too often.

I started my career doing graphical programming thus I perked up when Raymond Chen recently outlined the consequences of invalidating the null window and his anecdote is worth quoting at length.
If however you end up passing NULL as the window handle to the InvalidateRect function, this is treated as a special case for compatibility with early versions of Windows: It invalidates all the windows on the desktop and repaints them.

Even more strangely, passing NULL as the first parameter to ValidateRect has the same behavior of invalidating all the windows. (Yes, it's the "Validate" function, yet it invalidates.) This wacko behavior exists for the same compatibility reason. Yet another example of how programs rely on bugs or undocumented behavior, in this case, the peculiar way a NULL parameter was treated by very early versions of Windows due to lax parameter validation. Changing nearly anything in the window manager raises a strong probability that there will be many programs that were relying on the old behavior, perhaps entirely by accident, and breaking those programs means an angry phone call from a major corporation because their factory control software stopped working.
The null hypothesis strikes again.

Camel Humps


Even when you get past these details, you get into matters of syntax - a longstanding pet topic of mine. Consider the separators that people use for readability. Some people like to use Hungarian notation, others prefer hyphens... well I've already written a hyphenated parable so I'll skip that aspect. Anyway, assume for some insane reason that it makes sense for your spec to have an attribute named "windowTop". There'll undoubtedly be people who will write it "window-top", "window.top" or with some other variant of case, "WindowTop"? If you're dealing with XML where case matters, things will fail. You say potato, I say pubDate anyone?

I've been playing with a product that is essentially a wiki and it turns out that by convention, camel case (or should I write it as CamelCase) is significant in the wiki world as denoting a "WikiWord". I even had to spend half an hour writing glossary entries for these concepts since in our system, user names and page names had to be in that format.

You can imagine however the kinds of issues that arise when you have an html editor that allows you to enter HTML and Javascript along with php code and a specialized wiki syntax - since for some reason, it was decided not to use angle brackets in this product. The most complicated piece of code is going to be the parser. As currently implemented, the parser is a mass (or should I say, a morass) of regular expressions and all kinds of things I'll never understand. There's even special case code in there to handle nested comments in Javascript. What was never forseen however was that you'd have to deal with user-entered script code. What would happen if camel case is used for variables inside of said script? Well it wasn't pretty when the wiki engine jumped in and treated script as wiki words, let's just say that someone had to come up with a solution.

There's this concept known as McCabe Cyclomatic Complexity which is basically an application of graph theory to software and is often used to pinpoint potential problems. The basic insight is that if there are too many decisions or paths through your code, it will be buggier, harder to maintain and test. A good guideline is that anything with complexity greater than 15 in this scheme is ripe for refactoring. Luckily I have access to some tools that can generate reports and provide some numbers to validate that nagging sense that a piece of code is getting harder to understand. What worries me is that I keep running into code that laughs at such guidelines - after the latest change the parser code just hit 41 (to give some context, values between 21 and 50 indicate "a complex, high risk program" and with the 50 barrier looming, we are verging towards that notable status of the "untestable program - very high risk"). I'm sure it didn't start out this way and that the steady accretions have been solutions to real problems. Still, technical arteriosclerosis continues its inexorable spread...

Ruby on Rails and the Zend framework for PHP are founded on favouring convention. We had this code that automatically created the schema for what amounted to a database table. We never actually told users that this was what was going on. Of course once a wider audience started to play with the product, we had to fix the bugs that arose to enforce the convention so that databases would be named as the code expected. A classic case of leaky abstractions I suppose. You can guess the complexity the additional error checking added.

Moving up a level, you get politics - the most aberrant of which have been the feed wars of the past few years perhaps best summarized hilariously by Shelley Powers. Truly, Jesus wept.

Bill de Hóra in an aside wisely noted that
Programmers would rather squabble about minutiae - it seems this transcends community or language choice.
But even when you move beyond whiplash and abrasive personalities, who would have thought that the Atom working group would have spent so much time on the concept of dates. When I saw dissertation-length essays on the various types of dates that might be used in publishing systems, I was content to continue lurking in that community. The thing however is that these details do matter and they are best dealt with up front. The aggregate waste of programmer effort in pursuit of minutiae might keep the profession in business but it surely isn't sustainable.

The East Australian Singularity


I'll conclude by noting that acts of God (or in this case, his flawed proxies: politicians) can come into the picture. Thus I read the following this week: Eastern Australia: Java applications impacted by the change to daylight savings time dates
The running of the Commonwealth Games in Australia in March and April 2006 has resulted in an extension to daylight savings time in the eastern states of Australia, which includes New South Wales, Victoria, South Australia, Australian Capital Territory and Tasmania.

Rather than the clocks being put back an hour at 03:00 on Sunday 26 March 2006, they will now be adjusted at 03:00 on Sunday 2 April 2006. The IBM Software Development Kit (SDK) or Java Runtime Environment (JRE) is not currently aware of the one-time change to the daylight savings time extension. An interim fix is required for your application to have the same time as your operating system.

This change applies to all of the Java environments, irrespective of their setup, whether they are set up to use the operating system time zone information, or the user.timezone custom property that can be set for the SDK or JRE.
I assume television schedules were behind this change to the time/space continuum since the Commonwealth games have just begun. Or perhaps the politicians were concerned about athletes missing their events or something. Still imagine if you're the Java programmer who has suffered through the badly defined date apis in Java 1.0 a decade ago, adapted to the improvements in succeeding versions and finally, finally gotten a robust application deployed. Then your manager walks in and tells you about the East Australian Singularity. You're going to have to rework everything since bank transactions might be messed up and there are likely to be blinking clocks etc. We live in a global village so you have to worry about what happens if some mission-critical application that you rely on is being run in Eastern Australia. You can't even have the special case restricted to that country, it's only a sub-region that is affected. At such times I'd prefer being the poor Eastern Australian sheep or lamb, their lot is much easier.

What a way to make a living, if it isn't one thing it's the other. And then there's version hell. Lord help me.

File under: , , , , , , , , , ,

Thursday, July 28, 2005

Flickr's Godfather

The 3,000th photo I uploaded to Flickr is a howler. Well at least I think it is, let's have a look (full size image).

flickr-sopranos-dhtml-bug


A little context is in order...

I, and countless others, had complained about Flickr's excessive use of Flash. First I had inveighed about rendering and accessibility concerns in Cultural Sensitivity in Technology. Then I used Flickr's Flash buttons as a prominent example in The Unloved HTML Button and other Folktales.

In any case, 2 days after the folktales were told, Flickr finally switched from Flash. They no longer use a wrapper for image display - allowing native browser image rendering, and they changed their button toolbar from Flash to DHTML. I'd like to think my snarky comments were the tipping point but I won't flatter myself. They now only use Flash where it's appropriate, for drag and drop organization of photo albums, the kind of job that Flash or applets are particularly well suited for. Now of course they didn't use unloved html buttons in their toolbar but we'll take what we get. DHTML has greater reach than than Flash and accessibility concerns are more easily addressed on that front. Also there are an evolving set of design patterns for dealing with unobtrusive DOM scripting and forms.

So there I was, pleasantly surprised by their responsiveness, and going about uploading a little comic image to punctuate some later toli essay. You'll notice from the image that there were a bunch of glitches on the first morning of the big switch. The icons for some of buttons of the toolbar weren't showing up. Oh well, we'll ignore that but simply note that if they were standard HTML buttons, there would be no images to download. Moving right along...

Then I noticed a couple of typos, I had tagged the photo as sopronos instead of Sopranos and the image's title mentioned Godfarther which tickled me somewhat.
Flickr's Godfather or Flickr Goes Further?
Well anyway, Flickr implements a Click-to-Edit feature, a little unobtrusive DOM scripting that allows you to edit in place, so I corrected the title and hit the save button that appeared. That's when this error message came up and I took the screen capture

flickr dhtml error on editing title


Taking a step back for a moment, let me just say that I love glitches. They expose the interesting aspects of complex systems and, much as we aim for simplicity, software tends inexorably towards complexity. As users of software we see lots of glitches daily. As an engineer, I am always interested in the first few days of a new deployment. You can test all you want but all bets are off when you get contact with real users and the real world. As an example, Technorati's recent makeover exposed lots of unforeseen glitches and they have had to work hard to address most of them in the past month. I was chatting recently with Dale Schultz, globalization architect at IBM and noted that I have a standard set of user names when I test new pieces of software, I make sure to have hyphens (hence I use my surname), ampersands (Sun & Sun is my canonical company), and, of late, accents (Rokia Traoré) because I've been bitten by various curses in the past in the software I've written. My former team has a José López test user for the same reason. Sam Ruby uses the word Iñtërnâtiônàlizætiøn as his proving ground in the same vein. We got to discussing the tyranny of patents at IBM and I pointed him to the Prior-Art-O-Matic for a laugh. Dale is obviously many steps ahead of me and of course he tried entering a euro symbol and immediately noted that that CGI application was broken and couldn't handle euros. Glitches often tell you a lot about application internals and the things that the developers tried to foresee or, as the case may be, ignored.

But back to Flickr's Godfather, what can we say about the glitch?
  • Flickr is passing xml back and forth in their API calls.
  • They are likely using XMLHttpRequest to do the voodoo of incremental loading without refreshing the page.
  • There's an API key, probably tied to the user's identitiy that is likely passed around in every call. Sensible enough.
  • They have to implement a Javascript layer to catch API errors and display something to the user.

Now I could have determined a lot of this and more by poking around and doing the View Source investigation. At the time, I wondered if I would have done any different and concluded that my implementation would have been much the same.

I have to say that like many others I'm highly impressed with Flickr, they had defensive programming and had appropriate error messages. Most people wouldn't have bothered dealing with these boundary cases. I haven't seen similar glitches since that first day thus the teething pains were temporary and they continue to add nice features to their service.

In any case, the juxtaposition of Silvio growling and in full bloom, the Godfather typos and the error message that popped up under Silvio's hands certainly made for a little amusement then and even today and now has occasioned a short blog entry. It reminded me of an advertisement for Fosters beer I believe that goes "It touches the parts other beers fail to reach". I guess the analogue in this case is "Flickr Goes Further".

As to why I had uploaded that particular Sopranos image, well let's just say that there's a famous quote from that scene and that's for some later toli.

[Update] I tried to cross-post this to my internal IBM blog only to find that the post was chopped off at Ruby's Iñtërnâtiônàlizætiøn magic word. Thus ironically as I was pointing out glitches, I just got bitten by one. I believe BlogCentral is based on Roller software and I suppose that I'll have to figure out whether the problem is in IBM's additions or in the core framework. The interesting thing about bugs with special characters is that sometimes you can't write the issue up because the software can't handle the characters in question. Perhaps BlogCentral needs a Godfather.

File under: , , , , , , , , , , , , , , , , , , ,