Thursday, October 11, 2007

I have updated the Drag and Drop tutorial code samples for the July CTP.  The samples can be downloaded here: link.

The tutorial pages can be found here:

  1. Introduction
  2. Declarative Drag and Drop
  3. Imperative Drag and Drop
  4. Dynamically Generated Drag Items
  5. Working with Dropzones

The July CTP can be downloaded here: link.

posted by J Ashley on Thursday, October 11, 2007 3:58:23 PM (Eastern Standard Time, UTC-05:00)  #    Comments [3]
 Monday, October 08, 2007

I originally wrote the prize-winning Interop Forms article below for code project.  The prize, an XBox 360 Elite system, was pretty sweet.  Even sweeter, however, was the nod I received from the Microsoft VB Team here: http://blogs.msdn.com/vbteam/archive/2007/06/01/so-what-does-lt-comclass-gt-actually-do.aspx and here: http://blogs.msdn.com/vbteam/archive/2007/06/04/interopforms-2-0-tip-1-font-property.aspx.

posted by J Ashley on Monday, October 08, 2007 9:52:05 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Saturday, October 06, 2007

janerussell

This fall programmers are going to be a little more sassy.  Whereas in the past, trendy branding has involved concepts such as paradigms, patterns and rails, principles such as object-oriented programming, data-driven programming, test-driven programming and model-driven architecture, or tags like web 2.0, web 3.0, e-, i-, xtreme and agile, the new fall line features "alternative" and the prefix of choice: alt-.  The point of this is that programmers who work with Microsoft technologies no longer have to do things the Microsoft way.  Instead, they can do things the "Alternative" way, rather than the "Mainstream" way.  In the concrete, this seems to involve using a lot of open source frameworks like NHibernate that have been ported over from Java ... but why quibble when we are on the cusp of a new age.

posted by J Ashley on Saturday, October 06, 2007 4:25:35 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Sunday, September 23, 2007

matrix

 

This past Tuesday I attended a Microsoft technology event at a local movie theater.  Ever since the Matrix, movie theaters are apparently the convenient place to go to get technology updates these days.  If you've never been to one of these events, they involve a presenter or two with a laptop connected to the largest movie screen in the building.  The presenters then promote new Microsoft offerings by writing code on the big screen while software programmers who have somehow gotten the afternoon off from their bosses watch on.

Jim Wooley presented on LINQ, while Microsoft Evangelist Glen Gordon presented on WCF.  The technologies looked pretty cool, but the presentations were rather dull.  I don't think this was really the fault of the presenters, though.  The truth is, watching other people code is a bit like watching paint dry, and seems to take longer.  Perhaps this is why pair programming, one of the pillars of extreme programming, has never caught on (failing to document your code, however, another pillar of extreme programming, has been widely adopted and, like Monsieur Jourdain, many developers have found that they'd been doing XP for years without even realizing it). 

Within these constraints -- that is that you are basically doing the equivalent of demonstrating how to hammer nails into a board for four hours -- the presenters did pretty well, although Mr. Wooley appeared to be somewhat nervous and kept insisting he was doing "Extreme Presenting" whenever he made a coding mistake and the greediest members of the audience would compete with one another to point out his failings.  Mr. Gordon didn't encounter any compile errors like Mr. Wooley did, but on the other hand he was following a script and kept referring to it as he typed the code that we were all watching.  Why you should need a script to write uninteresting demo code that ultimately just emits "Hello, world" messages is beyond me, but that's what he did, and he demonstrated that there could be something even less able to hold the attention than watching someone write code -- watching someone write code by rote.

But it is easy to criticize, and in truth I never got to see the presentation on Silverlight given by Shawn Wildermuth (aka "adoguy"), which for all I know may have been much more entertaining and might have undermined my mantra that coding is not a spectator sport, but I'll never know because I had to skip out on it in order to attend a company dinner.  How I got invited to this dinner I'll never know, because I wasn't really very involved in the project that the dinner was intended to celebrate.

I arrived fashionably late by an hour, and as I entered I realized the only seat left was squeezed in between my manager, the CFO of the company and the Senior VP of IT.  This is a dreadful spot to be in, and into that spot I deposited myself.  The problem with being situated next to one's uppers at a social event is that one spends an inordinate amount of time trying to think of something to say that will impress one's uppers, while simultaneously trying to avoid saying anything to demonstrate one's utter unfitness for one's position.  And here I was next to my boss, who was sitting across from his boss, who was sitting across from his boss.  And as I sat, watching what appeared to be scintillating conversation at the opposite end of the table, my end was completely silent with an air of tension about it.

So I picked up a menu and tried to order.  This was a steak and seafood restaurant, and judging by the prices, approximately twice as good as Longhorn or Outback.  I took the highest priced item, divided the cost by half, and ordered the crawfish pasta with a glass of wine.  Then I sat back to listen to the silence.  Finally someone struck up a conversation about insurance (my industry).  If you want to know how dreadfully dull insurance talk is, it's a bit like -- actually, there is nothing as boring as insurance talk because it is the sine qua non against which all boredom should be judged.  Listening to insurance talk is the sort of thing that makes you want to start cutting yourself for distraction (it's an old POW trick), and just as I was reaching for the butter knife I found myself telling the jazz story.

The jazz story went over well and seemed to break the ice, so I followed it up with the Berlin mussels story, which was also a hit.  I drank more wine and felt like I was really on a roll.  I'd demonstrated my ability to talk entertainingly around my bosses and as the food arrived I was able to maintain the mood with a jaunty disquisition on men's fashion and how to select a good hunting dog.  But I grew overconfident.  Over dessert, I decided to play the teacup game, which is a conversation game my friend Conrad at The Varieties had taught me, and it was a disaster.  Apparently I set it up wrong, because a look of disgust formed on the CFO's face.  My manager tried to save with a distracting story about hygiene, but rather than leave things well enough alone, I decided to continue with the asparagus story, and pretty well ruined the evening.  Oh well.  Bye-bye annual bonus.

Which all goes to show, entertainment is a damnably difficult business.

eddie

I can probably improve my dinner conversation by reading a bit more P.G. Wodehouse and bit less of The New Yorker (which is where I got the fateful asparagus story) but how to improve a Microsoft presentation is a much trickier nut to crack.  How much can you realistically do to dress up watching other people code?

Then again, it is amazing what passes for a spectator sport these days, from Lumberjack Olympics to Dancing with the Stars.  Perhaps one of the strangest cultural trends is the popularity of poker as a spectator sport -- something that would have seemed unimaginable back in the day.  The whole thing revolves around a handful of people dressed up in odd combinations of wigs, sunglasses and baseball caps to hide their tells playing a card game that depends largely on luck, partly on a grasp of probabilities, and partly on being able to guess what your opponents are guessing about you.  Is there anything in this jumble of crazy costumes, luck and skill that can be used to improve a typical Microsoft presentation?

The truth is, even skill isn't so important in creating a successful spectator sport.  Take quiz shows, which once were devoted to very tough questions that left the audience wondering how the contestants could know so much (it turned out, of course, that often they were cheating).  Over time, these shows became simpler and simpler, until we ended up with shows like Are You Smarter Than a 5th Grader (which makes you wonder how they find contestants so dumb) and the very successful Wheel of Fortune (in which you are challenged to list all the letters of the alphabet until a hidden message becomes legible).  Demonstrating skill is not the essence of these games.

If you have ever seen National Lampoon's Vegas Vacation (fourth in the series, but my personal favorite), you will recall the scene where, after loosing a large portion of his life savings at a casino, Chevy Chase is taken by his cousin Eddie to a special place with some non-traditional games of luck such as rock-paper-scissors, what-card-am-I-holding, and pick-a-number-between-one-and-ten.  This, it turns out, is actually the premise of one of the most popular American game shows of the year, Deal Or No Deal, hosted by the failed-comedian-actor-turned-gameshow-host Howie Mandel.  The point of this game is to pick a number between one and twenty-six, which has a one in twenty-six chance of being worth a million dollars.  The beauty of the game is that the quick and the slow, the clever and the dim, all have an equal chance of winning.  The game is a great leveler, and the apparent pleasure for the audience is in seeing how the contestants squirm.

I had initially thought that Mr. Wooley's palpable nervousness detracted from his presentation, but the more I think about it, the more I am convinced that his error was in not being nervous enough.  The problem with the format of Microsoft presentations is that there is not enough at stake.   A presenter may suffer the indignity of having people point out his coding errors on stage or of having bloggers ask why he needs a script to write a simple demo app -- but at the end of the day there are no clear stakes, no clear winners, no clear losers.

The secret of the modern spectator sport -- and what makes it fascinating to watch -- is that it is primarily about moving money around.  Televised poker, Survivor-style Reality shows, and TV game shows are all successful because they deal with large sums of money and give us an opportunity to see what people will do for it.  Perhaps at some low level, it even succeeds at distracting us from what we are obliged to do for money.

And money is the secret ingredient that would liven up these perfunctory Microsoft events.  One could set a timer for each code demonstration, and oblige the presenter to finish his code -- making sure it both compiles and passes automated unit tests -- in the prescribed period in order to win a set sum of money.  Even better, audience members can be allowed to compete against the official Microsoft presenters for the prize money.  Imagine the excitement this would generate, the unhelpful hints from the audience members to the competitors, the jeering, the side-bets, the tension, the drama, the spectacle.  Imagine how much more enjoyable these events would be.

Microsoft events are not the only places where money could liven things up, either.  What if winning a televised presidential debate could free up additional dollars to presidential candidates?  What if, along with answering policy questions, we threw in geography and world event questions with prize money attached?  Ratings for our presidential debates might even surpass the ratings for Deal Or No Deal.

Academia would also be a wonderful place to use money as a motivator.  Henry Kissinger is reported to have said that academic battles are so vicious because the stakes are so low.  Imagine how much more vicious we could make them if we suddenly raised the stakes, offering cash incentives for crushing intellectual blows against one's enemies in the pages of the Journal of the History of Philosophy, or a thousand dollars for each undergraduate ego one destroys with a comment on a term paper.  Up till now, of course, academics have always been willing to do this sort of thing gratis, but consider how much more civilized, and how clearer the motives would be, if we simply injected money into these common occurrences.

posted by J Ashley on Sunday, September 23, 2007 3:38:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]
 Saturday, September 15, 2007

Vercingetorix

 

A city seems like an awfully big thing to lose, and yet this occurs from time to time.  Some people search for cities that simply do not exist, like Shangri-la and El Dorado.  Some lost cities are transformed through legend and art into something else, so that the historical location is something different from the place we long to see.  Such is the case with places like Xanadu and ArcadiaCamelot and Atlantis, on the other hand, fall somewhere in between, due to their tenuous connection to any sort of physical reality.  Our main evidence that a place called Atlantis ever existed, and later fell into the sea, comes from Plato's account in the Timaeus, yet even at the time Plato wrote this, it already had a legendary quality about it. 

....[A]nd there was an island situated in front of the straits which are by you called the Pillars of Heracles; the island was larger than Libya and Asia put together, and was the way to other islands, and from these you might pass to the whole of the opposite continent which surrounded the true ocean; for this sea which is within the Straits of Heracles is only a harbour, having a narrow entrance, but that other is a real sea, and the surrounding land may be most truly called a boundless continent. Now in this island of Atlantis there was a great and wonderful empire which had rule over the whole island and several others, and over parts of the continent, and, furthermore, the men of Atlantis had subjected the parts of Libya within the columns of Heracles as far as Egypt, and of Europe as far as Tyrrhenia ... But afterwards there occurred violent earthquakes and floods; and in a single day and night of misfortune ... the island of Atlantis ... disappeared in the depths of the sea.

-- Timaeus

Camelot and Avalon, for reasons I don't particularly understand, are alternately identified with Glastonbury, though there are also nay-sayers, of course.  Then there are cities like Troy, Carthage and Petra, which may have been legend but which we now know to have been real, if only because we have rediscovered them.  The locations of these cities became forgotten over time because of wars and mass migrations, sand storms and decay.  They were lost, as it were, through carelessness.

But is it possible to lose a city on purpose?  The lost city of Alesia was the site of Vercingetorix's defeat at the hands of Julius Ceasar, which marked the end of Gallic Wars.  The failure of the Roman Senate to grant Caesar a triumph to honor his victory led to his decision to initiate the Roman Civil War, leading in turn to the end of the Republic and his own reign of power, which only later came to an abrupt end when he was assassinated by, among others, Brutus, his friend and one of his lieutenants at the Battle of Alesia.  Having achieved mastery of Rome in 46 BCE, Caesar finally was able to throw himself the triumph he wanted, which culminated with Vercingetorix -- the legendary folk hero of the French nation, the symbol of defiance against one's oppressors and an inspiration to freedom fighters everywhere --being strangled.

Meanwhile, back in Gaul, Alesia was forgotten, and eventually became a lost city.  It is as if the trauma of such a defeat, in which all the major Gallic tribes were defeated at one blow and brought to their knees, incited the Gauls to erase their past and make the site of their humiliation as if it had never been.  Ironically, when I went to the Internet Classics Archive to find Caesar's description of this lost city, I found the chapters which cover Caesar's siege of Alesia to be completely missing.  The online text ends Book Seven of Julius Caesar's Commentaries on the Gallic and Civil Wars just before the action commences, and begins Book Eight just after the Gauls are subdued, while the intervening thirty chapters appear to have simply disappeared into the virtual ether.

In the 19th century, the French government commissioned archaeologists to rediscover Alesia, and they eventually selected a site near Dijon, today called Alise-Sainte-Reine, as the likely location.  The only problem with the site is that it does not match Caesars description of Alesia, and Caesar's writings about Alesia is the main source for everything we know about the city and the battle.

I have rooted around in my basement in order to dig up an unredacted copy of Caesar's Commentaries, containing everything we remember about the lost city of Alesia:

The town itself was situated on the top of a hill, in a very lofty position, so that it did not appear likely to be taken, except by a regular siege. Two rivers, on two different sides, washed the foot of the hill. Before the town lay a plain of about three miles in length; on every other side hills at a moderate distance, and of an equal degree of height, surrounded the town. The army of the Gauls had filled all the space under the wall, comprising a part of the hill which looked to the rising sun, and had drawn in front a trench and a stone wall six feet high. The circuit of that fortification, which was commenced by the Romans, comprised eleven miles. The camp was pitched in a strong position, and twenty-three redoubts were raised in it, in which sentinels were placed by day, lest any sally should be made suddenly; and by night the same were occupied by watches and strong guards.

-- Commentaries, Book VII, Chapter 69

posted by J Ashley on Saturday, September 15, 2007 7:12:09 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]