« August 2005 | Main | October 2005 »

September 29, 2005

Foople

From the point of view of a geek who likes to hack, the best part of Google Maps isn't just the stunning user interface, but also the cool things you can do with the Google Maps API. Recently, after a pleasant dinner appointment with friends, my digestive system had to face less than pleasant consequences. It wasn't anything serious and in any case, I really am not exposed to as much danger as my animal-eating friends. At that point, hopeless geek that I am, I was already itching to hack something up with the Google Maps API. Suddenly a project idea popped into my head.

Foople!

Foople combines location data from Google Maps and restaurant inspection data from the New York Department of Health and Mental Health to provide an overview of the hygienic practices of New York area restaurants. I used Perl to screen scrape Department of Health pages for restaurant inspection data and generate an XML data file with all this information. This data file is the input to some code that displays this information on Google Maps. I'll do a more detailed writeup about the various hacks I had to do to get Foople working. But before I get around to memoizing the hacking experience properly, I thought I'd push out this alpha version so people can play around with it.

Eat safely!

Posted by Vishy at 08:49 PM | Comments (0)

September 27, 2005

The legal system in Harry Potter

Avada Kedavra. Crucio. Imperio.

The Three Unforgivable Curses in Harry Potter's wizarding world. These three spells are the worst crimes anyone could commit in the society of wizards. Anyone who uses any of these spells is liable for the wizarding world's worst punishment, a prison term in Azkaban. Avada Kedavra, Aramaic for 'let this thing be destroyed', instantly kills its target with a green burst of evil energy. Some Harry Potter fan forums tell me that abracadabra is indeed the Anglicized version of this spell. The Muggle equivalent of this spell would be the act of murder. Crucio, seemingly similar to crucify, is used to inflict pain on someone until they lose their sanity. The Muggle equivalent of this spell would be the act of torture. The Imperio curse lets the perpetrator assert complete control over someone and make them behave exactly as they please. There isn't a direct Muggle equivalent to this curse. However, because a person essentially loses their own identity when under the Imperius curse and can appear to be someone else, its closest Muggle equivalent would be the crime of identity theft. In the Muggle world, the most serious felonies are murder, rape, robbery and aggravated assault.

So there you have it. The most serious crimes in our society are murder, rape, robbery and aggravated assault. In Harry Potter's wizarding world, the most serious crimes are murder, torture and identity theft.

It is worthwhile combining this observation about the wizarding world's legal system along with a few others to paint a picture of crime and punishment in J. K. Rowling's world of magick. From the scant contact wizards have with Muggles, it appears that the laws of the wizarding world are complete in themselves and are not an appendage to Muggle laws. If this is indeed the case, wizarding laws have serious deficiencies. Muggle society punishes its denizens for both crimes of commission and crimes of omission. In other words, an attempt to murder someone can sometimes, depending on circumstances, be as serious as say an inadvertent act of negligence during a surgery. In contrast, in the wizarding world, all the serious crimes are crimes of commission; there is no way these crimes cannot be committed intentionally. Because crimes of omission are effectively protected thus, a wizard could plausibly use this excuse to use serious spells that would otherwise be serious infarctions. Malicious wizards with a law enforcement function, such as disgruntled Aurors, could use serious spells instead of mild, protective hexes and claim to have overreacted in self-defense when they were startled by an enemy. There doesn't seem to be a safety net of procedural guidelines that would prevent Aurors from manufacturing 'encounters' with purported Death Eaters or other unwelcome elements of wizarding society. Likewise, Madam Pomfrey, the school nurse, can simply 'forget' to give Harry an essential antidote and let his condition worsen to a serious point. Not prosecuting crimes of omission as seriously as crimes of commission is a serious failing of the legal system of the wizarding world.

From what I have seen of the legal code of the wizarding world, it is unclear whether there are legal deterrents against crimes of assault and exploitation against women, children and (possibly) other protected groups. In Muggle society, these groups typically receive major protections from the state. For example, it is much harder for a man to accuse a woman of raping him than vice versa. Usually, there are historical reasons for this subtle 'criminal affirmative action.' On the other hand, the legal system in the wizarding world is a lot less forgiving towards anyone who isn't a competent wizard. What protections are offered against the criminal assault or exploitation of someone like Argus Filch (who lives in the wizarding world but cannot do magic because he is a squib) ? The legal system of the wizarding world ostensibly doesn't have laws against aggravated assault, trafficking or rape of anyone, much less protected groups. If someone tries to pull any of these acts off with you and you are not a competent wizard, you're basically guaranteed the trauma of being on the receiving end of these crimes. Afterwards, unless you find a competent wizard friend to help you recover from an assault, you're on your own. Amid the vast (and crumbling) bureaucracy of the Ministry of Magic, there don't seem to be institutions to protect and counsel disadvantaged groups such as squibs to educate them better about guarding against and recovering from indiscretions more powerful wizards may commit against them. Perhaps this hands-off approach to protecting disadvantaged groups is intentionally meant to put the onus on talented wizards to protect themselves and as many others as possible, who cannot protect themselves. I can't help but fear that it would create wizard classes of varying talents, with the least talented ones at the protection of the more talented ones. It may well be just a tool to inculcate a sense of empathy and an urge to help those less privileged in the target audience of the Harry Potter books, which brings me to my next point.

The Harry Potter series has received a lot of flak from religious groups for its amoral portrayal and implicit espousal of the wizarding lifestyle. These groups contend that children's utter fascination with the series will make God seem superfluous in their eyes and therefore muddy their moral compass. If anything, I think the Harry Potter books take decidedly moral stands and unequivocally reward good and condemn evil. Implicit moral judgements are elicited for every character in the series by viewing them not only through the lens of their actions but also through that of their antecedents. Heavy emphasis is given to the wizarding family, if any, in which a wizard was raised. The legal system in the wizarding world, rather than being a system to mete out justice to both parties, seems to take on a moral character and judge things as implicitly good or bad. The legal system in the Muggle world provides scores of procedural protections and recourses to suspected criminals even when it is clear that they have probably committed a crime. It tries, as far as possible, to set only legal precedents (and not moral ones) by its verdicts. This approach comes across as pragmatic in the face of ever-changing morals. The legal system of the wizarding world, in contrast, is morally unambiguous and metes out punishments to criminals after considering their motivation for a crime, their antecedents and how important it is that they be taught a lesson. While it is considerably more elitist than the Muggle legal system in offering protections, it is also heavy-handed and morally unambiguous in offering punishments.

This paternalistic function of a legal system seems outdated at best in modern Muggle times. Nonetheless, it serves to highlight the conflict between good and evil ways every wizard faces daily in his or her heart. All wizards, and indeed all Muggles, have the capacity for good and evil within them but which path they choose is ultimately up to them.

Posted by Vishy at 01:13 AM | Comments (0)

September 18, 2005

The Rise of Javascript

If technology companies could pick a martial art to associate themselves with, Google would surely pick Aikido. Instead of blocking attacker's movements, Aikido chooses to deflect, control and redirect the attacker's energy. Likewise, instead of expending considerable energies to build a brand new Web application platform, Google merely wove together existing technologies such as Javascript and the XMLHttpRequest object to create Google Maps and GMail, now viewed as formidable threats to the traditional model of desktop software. This move by Google has spurred considerable interest in Web-based user interface innovation. The Javascript-XMLHttpRequest combination, now catchily christened Ajax (Asynchronous Javascript And XML), will form the basis of a new framework that will debut in Microsoft's ASP.NET v2.0.

Major Internet companies have also recently built or bought products that give a user greater control over their browsing experience using client-side extensions. A month and a half ago, Yahoo! bought a small company called Konfabulator that develops so-called widgets that draw information from web sites but look and feel like applications running on the local computer. Microsoft has developed a similar product called Microsoft Gadgets. The closest direct answer that Google has to these products is the sidebar in Google Desktop 2. The Greasemonkey extension to the Firefox web browser gives users considerable control over what they want to see on their pages, and has potential to be developed into a similar platform for client-side widgets. As it so happens, the original developer of Greasemonkey is in Google's employ.

Central to the emergence of Ajax and client-side widgets has been the rise of Javascript. Javascript, born as LiveScript, was developed at Netscape Communications Corp. by Brendan Eich. Naming the language Javascript was partly a marketing ploy to whip up hype by association with the Java programming language, which was making waves all over the software community. It was also named Javascript to reflect its original intention -- to give Web developers with no formal Java training access to Netscape's Java engine and browser object model. In a sense, it was similar to the function of Visual Basic on the Windows platform. Just as developers on Microsoft's platform could avoid the arcane traps of C++ by writing in Visual Basic, Web designers could use Javascript to program for the Web while avoiding the barrier to entry that Java presented.

Javascript quickly grew to have a sophisticated object and event model. Unfortunately, it never had a powerful integrated development environment (IDE) or reliable cross-platform debugging because of the browser wars of the 90s. Programmers also perceived it as a simple-minded, second-tier language because it had a low barrier to entry and did not have features of industrial strength programming languages, such as compile-time checking. Javascript can boast of having several distinctive features of modern programming languages, such as function objects, dynamic typing, regular expressions and native support for compound data types such as hashes. Even after Java applets on client browsers withered away, Javascript's object model continued to be used in Dynamic HTML, a lightweight (read non-Macromedia Flash) technique of creating dazzling user interface effects on Web applications.

Thankfully, companies like Google recognized the tasks towards which Javascript's innate technical merits could be applied. By capitalizing on Javascript's versatile user interface event model and the power of XML to send data across the Web, it was possible to create a responsive user interface like that of Google Maps. Javascript seems to be experiencing a resurgence in the software community. There are a few things that Javascript always got right as a platform. Some of these lessons are valuable when considering what could make a new platform successful.

1. Lower barriers to entry. Make the language accessible to software types without requiring them to learn a new development environment and a new set of development tools. Structure the workflow of the language so that it is easy to create quick and dirty prototypes with it. In other words, make complex things simple to express and simple things even simpler. Dynamically typed languages work well for this kind of thing because the developer needn't worry so much about the formal type of a value as what type it should have when used in a certain syntactic context. Even if you provide a runtime environment that disallows raw memory addresses for security reasons, make it easy for developers to insert their own behaviors using concepts like events and function objects.
2. Embed. Embed. Embed. Embedding a programming language into another application gives the programming language an automatic raison d'être. There is a manifest platform against which programmers can begin coding immediately. Nobody has to come up with a conceivable use for the language because it has not been developed in a vacuum. Of course, the developers of the language should take care not to tie the language to the application in which it is embedded. Taking Javascript's case as an example, it shouldn't include native language features, such as keywords, that refer to browsers or windows.
3. Remove barriers between users and developers. Devolve control over the language's development and intended use cases to the users of the language. There should be no rigid one-way flow of technology from a privileged group of language developers to a larger set of users. The ideal goal of a platform's evolution should be to combine as much of the language's developer and user communities as possible. Passionate outreach and teaching will go much further towards this goal than traditional flashy advertising. A smart user may well come up with a use for your language that you never foresaw. Take advantage of the conversations that happen among the users in your market because users of a product can sometimes be a lot more passionate about changing it than developers who have adapted to some of its quirks. This principle may vaguely remind readers of the cluetrain manifesto. The lessons from the manifesto apply as much to technology platforms as to marketing the new wave of products.

It is said that the technology industry has matured to such an extent that completely new platforms must break through extraordinarily high inertia to make an impact. However, a smart platform still can, Aikido-like, redirect the energies of its users to propel itself to greatness.

Posted by Vishy at 01:10 PM | Comments (0)

September 14, 2005

A Shift in Microsoft's Code Names?

Microsoft's PDC has just begun. Today they demonstrated the upcoming version of Office. This version radically changes the user interface by making it task-oriented rather than command oriented. Menus and toolbars have been eliminated in favor of, well, a menutoollbar known as a ribbon. Add to this a vaguely iTunes-like brushed aluminum look and you have the makings of a major visual overhaul of the Office Suite. Yet, the powers that be at Microsoft have chosen to christen the project with the codename "12".

How lame!

The starry-eyed Microsoft, who chooses code names for projects before they have even begun, comes up with this?! What happened to the mystique of Chicago, the promise of Memphis and the Pacific Northwest's culturally relevant Whistler and Longhorn?

Recent delays in product cycles may have taught Microsoft to be less ostentatious with their code names. Much touted operating system releases such as Longhorn have been delayed for so long that their code names themselves started to command some brand equity. In the old Longhorn Developer Center pages, the code name has been used in several places completely idiomatically, not even including so much as a pair of quotes. The name "Longhorn" may not fit with the marketing vision that Windows seeks to portray to its customers. Yet, viewed purely as a product name, "Longhorn" isn't entirely bad for an operating system release. It is perhaps as whimsical as the seemingly unoriginal "Vista", which will be the official name of the Windows release formerly code named "Longhorn". Microsoft kept promising (and later cutting) so many features with Longhorn that it has come to be associated with failure to execute and deliver products on time. Even early betas of the operating system were so delayed that the code names became de facto release names. Yet, a plausible sounding name that had gained some brand equity of its own had to be buried and obliterated completely from public memory.

As if learning from this mistake, Microsoft has deliberately picked a lame code name for the next version of Office. A code name that's just a mundane number downplays the impression that much more effort is put into marketing a Microsoft product than into developing it. It would be a lot less painful to dispose of should delays in development cycles correspondingly delay the choosing of an official product name for Office. Code naming the next version of Office with a number puts considerably less cultural stock in the name and may be telling Microsoft's customers that they are doing away with such niceties in favor of focusing on getting the release out the door. Perhaps it may just be that because Office is to be released along with Windows Vista at the end of 2006, the code name wouldn't need to survive for as long as Longhorn did; the marketing department may have just taken the easy way out.

What are they going to call it eventually anyway? Office Vista?

Posted by Vishy at 12:58 AM | Comments (0)

September 10, 2005

Object Lust #3: A floating globe

One of the most vivid memories I have from childhood is when my dad explained how different parts of the world have daytime and nighttime simultaneously. With only our inflatable globe, a flashlight and two matchsticks, I saw how different parts of the world had different times of the day at once. I think this knowledge even predates my realization that the earth revolves around the sun, rather than vice versa. I have always been fascinated by globes, maps and any models of the earth, really. My fascination with these probably arises as a combination of my interests in geography and human-artifact interaction. (When I heard that geography becomes optional in the U.S. school system at a very early stage, I was appalled that anyone would not want to learn more about our world. Anyway, I digress.)

I spotted a web site dedicated solely to the production of custom globes (thanks, BoingBoing) that are installed at various locations around the world. See their catalog for a few examples of what a powerful education medium a simple sphere with our world drawn on it can be (warning: many images; can take long to load). I inquired with them about how much one of these globes would cost if I custom ordered them. I was particularly interested in #41, "The World at Night". A cheery representative apologized for the delay in replying and said they were a bit short on those globes right now, but that they could be custom made for a paltry $3,300. Moving right along...

Later, I came across another web site dedicated to globes, where I spotted this thing of beauty. It's an 8" (20 cm) diameter globe with black oceans and continents in vivid colors. It comes with a pedestal having electromagnets along a vertical axis. When plugged in, the globe floats in midair between the electromagnets and can be spun freely as it just hangs in space. Talk about an accurate model of the earth floating in the solar system! The pedestal has a handsome cherry finish and the whole thing would look incredibly classy on any desk or in any apartment.

They seem to be selling these off at a 20% discount from their usual price of $79.95. Combined with free ground shipping from JustGlobes.com, I definitely want to get my hands on one of these.

[The Floating World Globe; http://www.justglobes.com; $59.95 ($79.95 regular)]

Posted by Vishy at 01:20 AM | Comments (0)

September 07, 2005

The Newwwww Jerseyyyyy Guy

This posting is about a phenomenon on my commute up from Brooklyn to midtown Manhattan that I encounter frequently enough to be annoying. I looked around the discussion boards at the Straphanger's Campaign and the New York rants and raves section on Craigslist. Even in such a voluminous corpus of complaints about the subway, I couldn't find any mention of the Newwwww Jerseyyyyy Guy.

The Newwwww Jerseyyyyy Guy, whom I'll refer to as NJG for the rest of this post, is a conductor who works the uptown (west/northbound) 2 subway line in the morning. In older subway cars used by other subway lines, the conductor of the train has to announce the next stop at which the train will stop over the public address system. The 2 trains, on the other hand, have the most modern subway cars in the New York subway system. These cars, also shared by the 4 and 5 lines, have automated announcements regarding the upcoming stop and the transfers available at that stop. The conductor's job in these new trains is reduced to making announcements about transit changes and emergencies. These announcements from real human beings are preceded by a distinctive ding note that passengers have learned to associate (unpleasantly) with upcoming trouble or inconvenience.

NJG, like so many annoying people, loves the sound of his voice. His really annoying offense, however, is that he uses every opportunity to refer to the Oil and Petrochemical Refinery State as "Newwwww Jerseyyyyy". His announcements usually go as follows:


Good morning' Manhattan, good mornin'. The next stop on this train will be 14th St. Transfers are available to the 1, F, L and V trains and the PATH trains to Newwwww Jerseyyyyy. That's right. Transfers are available at the front of the train to the 1, F, L and V trains and the PATH trains to Newwwww Jerseyyyyy. Have a nice Tuesday!

The Newwwww is sing-songed on a long rising note and the Jerseyyyyy on a long falling note. Fearing that his announcements have pissed off the subway gods, he puts on the automated announcers immediately after he has finished his childish prattle just so they can say exactly the same thing. Every so often, he says other useless things like "Pay attention to the red and white subway signs. They tell you about changes to subway service this weekend." It is clear that he comes on air (preceded by the dreaded emergency note, no less) just so that he can say Newwwww Jerseyyyyy. Perhaps NJG has the noble goal of livening up a thousand morning commutes. He fails miserably, though. On numerous occasions that I have ridden the train with NJG, I have made eye contact with a fellow commuter and we have both rolled our eyes together when NJG comes on. After you hear him a few times, you almost feel like he's a cretin who just can't say it without sounding like an eight year old.

MTA, hear my plea! This guy clearly feels trapped in his subway conductor job. With his infectious (-ly annoying) spirit, he could do so much better being the chief DJ of a radio station. In fact, I hope you relieve him so that he can find such a job pronto and cynical, jaded New Yorkers like me can revel in their insipid morning commutes. Have a nice Tuesday!

Posted by Vishy at 02:03 AM | Comments (1)

September 05, 2005

Vishy's Useless Factoid of the Day #19: Hurricanes and other tropical storms

With all the recent coverage accorded to the aftermath of hurricane Katrina, I thought I'd put out a few useless factoids relating to hurricanes and other tropical storms around the world.

Low-pressure storms marked by high winds and circular cloud patterns that converge upon a central eye are called hurricanes in North America. They are named for Huracán, the Carib god of wind and storms. The Spanish conquistadors picked this word up from the original inhabitants of the Caribbean islands, who worshipped Huracán to escape his horrible temper. In East Asia, such a storm would be called a typhoon. This word is said to originate from tai fung (Cantonese, "big wind"). There is a similar sounding word in Hindi, toofAn, which is said to be unrelated. ToofAn came to Hindi through Arabic, which, in turn, got it from the Greek tuphon. In India, a storm resembling a hurricane would be called a cyclonic storm. 'Cyclonic' derives eventually from the Greek kuklos (circle), a versatile word that is linked to something as unrelated as a white supremacist group. Cyclonic storms frequently hit Bangladesh and the Indian state of West Bengal from mid-April to mid-June. These storms are called kal baisakhi (lit. the dark face of Baishakh, the second month of the Indian calendar) and routinely claim far more people each time than Katrina ever could.

Hurricanes began to be named in the United States starting in 1950. Currently, there is a list of names that is repeated every six years. Names of particularly destructive storms are retired to avoid unpleasant associations in the future.

Posted by Vishy at 11:15 PM | Comments (0)