Dennis Forbes on Pragmatic Software Development
Subscribe to RSS
 
Wednesday, October 19 2005

Just a brief entry today as time is short.

I got a lot of great feedback for yesterday's entry - OPTGROUP and the Pace of Standards. It was a mixed set of responses that were both educational and entertaining. I love the feedback, so if you have a comment please feel free to drop me a line (I might post an entry about your comments, though I won't quote you without your permission. Note that I do monitor referrals, so if you make your comment on a blog with a link, it will be noted just like a trackback).

It is remarkable how quagmired the base foundation of the web, HTML, has become. We live in the most dynamic software world that has ever existed, yet much of the infrastructure is the same artefacts from the 90s duct taped together in precarious (and grotesquely redundant) ways.

Tuesday, October 18 2005

OPTGROUP is a grouping element that can be used in SELECT elements. For instance instead of...

Which Web browser do you use most often?

...you might see...

Which Web browser do you use most often?

(That sample courtesy of the OPTGROUP page above, which is why the browser list is obsolete. I'm too lazy to update it)

Whether you see those or not depends on your browser (some ancient ones dislike form elements that aren't in a form), and the visual styling of the group headers will differ.

It's a pretty useful little addition to HTML, and has been around for quite some time. Remarkable, then, that it has seen negligible use in the real world. This despite the fact that it is eminently useful, clear by the fact that lots of sites are doing exactly this sort of thing manually: Adding custom hacked in groupings, where the group headers themselves are selectable but not really selectable (it'll be script-overridden or refused by the form handler if it is selected by the user, which is confusing from a UI perspective) for things like grouping states and provinces by country, and so on.

Of course my point here wasn't to evangelize OPTGROUP, though I do think that it's underused. The profound thing to me, brought to mind by the power of this trivial and underused element, is how marginal the advances in web technology (specifically HTML) have been over the past several years. Everyone is busy doing grossly redundant scripting and hackery for the most mundane of things, trying to use the coarse paintbrush available to build a subpar pseudo-fat client. Maybe they're spending weeks trying to replace their table layout with DIVs to satisfy the XHTML pedants.

How many lame derivatives of combo-boxes have been hacked out? How many intolerable scripted spell checkers? How many hacked out date/time selectors? Every one of them a mystery-meat to unwilling web victims.

Doesn't it seem reasonable that these things could be a part of the basic toolset of HTML by now, allowing rich clients to use their power to present it in the most intelligent way possible?

For that matter, why haven't we made the leap to "databound" controls? Would it really be that difficult to standardize some of the standard "AJAX" type functionality into declarative HTML 5.0? Not only is AJAX far from new, but the fundamentals behind it have been understood since the nascent days of the web. This is painfully obvious stuff.

Is it really that difficult?

Of course, it absolutely would be that difficult. Once a standard is entrenched, it becomes more and more difficult to change through consensus.

History is rife with examples where someone hacked something together and unleashed it on the world, and it was good, and it was revolutionary. The rate of innovation quickly slows, though, as more and more people get involved, and their vested interests and aversion to change takes hold, to the point that the most ridiculously trivial and profoundly necessary of changes take years to see the light of day. RSS feeds are just barely gaining traction, yet already many evangelists have their feet firmly stuck in the concrete, unwilling to even consider trivial changes. For instance alternatives to the absurd RSS/XML icon (who knew that people could get so defensive over a 36x14 icon). RSS will eventually rust, until some new disruptive standard comes along and eats its lunch, and then it will repeat. It is the way these things tend to go.

Oh well, I hear that they're developing Duke Nukem Forever using XForms.

Monday, October 17 2005

[NOTE: For fun and giggles I updated this "tool", creating a "story" home for it, which you can find here: yaflaGUID - Create Sequential GUIDs in SQL Server]

As discussed in the entry on using GUIDs in your database, GUIDs in SQL Server 2000 are, at least from the user's perspective, "random". This can lead to a fragmentation and splits in your data, and it's a common reason to avoid GUIDs in the first place.

leaves2

Of course, like most problems, there are a number of possible solutions. SQL Server 2005 offers a solution in the form of NEWSEQUENTIALID() (though it's limited to being the default on a table, among other limitations).

Coincidentally I happened to be mucking around in the disassembly of rpcrt4.dll today, trying to once and for all nail down the current algorithm used for UUIDCreate (which is used behind the scenes for CoCreateGuid, which itself is used by NEWID() and System.Guid.NewGuid()), when I noticed UUIDCreateSequential in the exports. I'd never noticed this function before, and the docs verified that indeed it does create GUIDs the old sk00l way, starting with the unique MAC+time foundation, and then sequentially incrementing on each generation.

"This is like 3-lines and a minute or two to create an extended stored procedure!" think I, even though I infrequently use or advocate the use of GUIDs. Before I did that, though, I thought I'd look around to see what exists, and sure enough someone solved this problem before.

Nonetheless, for such a trivial component, especially for something that can adversely affect the stability of SQL Server, I'm prone to not trusting binaries from micro-outfits on random pages on the web. I looked for the source, and for whatever reason the source to XPGUID isn't released. I cannot overstate how ridiculously trivial this is (even adding some padding functions to make it seem more substantial). In essence it is two credible lines of code over and above the VS.NET 2003 Wizard created extended stored procedure project.

As such, I've made this available for download, source-code and all, at http://www.yafla.com/downloads/yaflaSQLGUID.zip. In it you'll find the source and a compiled Release binary, yaflaGUID.dll. You can place this (or a new build that you made yourself) in your SQL Server \binn directory and run the following command

EXEC sp_addextendedproc 'xp_yaflaGUID2005', 'yaflaGUID.DLL'

(of course you can remove it with sp_dropextendedproc)

If you want, wrap it in a User-Defined Function for some inline scalar goodness.

CREATE FUNCTION dbo.SNEWID()
RETURNS uniqueidentifier AS 
BEGIN
  DECLARE @uuid uniqueidentifier
  EXEC master..xp_yaflaGUID2005 @uuid OUTPUT
  RETURN (@uuid)
END

Voila, the old style of quasi-sequential GUIDs, with far fewer page splits (the value still does jump around, but for any closely time-related sequence of GUIDs it is sequential). Theoretically the generation of the GUID should, on average, be faster given that many are just sequentially created, however the extra indirection of the XP makes it slightly slower from a pure execution time perspective than NEWID(), but you should easily make that up in the DML calls.

  SQL 
Monday, October 17 2005

I try to avoid acting as a link-propagator, but I think Nicholas has penned a very intriguing entry. Definitely worth a read. Note that he didn't say immoral, but rather he said amoral.

Skip the existential stuff at the beginning if it doesn't interest you and jump right down to The Cult of the Amateur.

  Blogging 
Monday, October 17 2005

For those who don't remember this long-defunct product, or never had a chance to experience it, PointCast was a multi-media push-technology news feed that took off back in 1996. Allowing the user to select a variety of channels from a number of sources (albeit all aggregated through PointCast central), along with stock tickers and customized weather, PointCast took the stage whenever the screensaver kicked in. It turned idle PCs across the land into customized news terminals, earning revenue for its corporate masters by displaying time-spliced advertisements amongst the news.

PointCast's rich graphics, generous content, and clean aesthetics made it a winner. Corporations were clamouring for PointCast caching servers to offset the 1000s of workstations all polling for updates and overwhelming their networks. Its success led many to proclaim that push technology was where it was at. Microsoft and Netscape immediately engaged in a war of push (both integrating their own technologies - Microsoft created CDF, with Active Desktop as its canvas, while Netscape created a conceptual relative of RSS...called RSS. Both stagnated when the push ferver died down, though of course the modern RSS rose from the ashes several years later).

At the height of it all, in early 1997, PointCast was offered a staggering $450 million dollar buyout. Feeling that they could do better, they held out. Not long after they were sold for a less than $10 million. This was a mini-.COM bubble popping, and should have served as a foreboding warning of the technology market implosion of the early 00s. Imagine how regretful the group who decided against the $450 million offer must have felt (and probably still feel).

I still look back fondly to PointCast. It, along with You Don't Know Jack - The Net Show, seemed to promise such a remarkable new internet world of rich content. And they managed to pull it off when most of us were lucky to have 2 KB/s connection (I now get 600KB/s).

It is amazing how much we have technically achieved, with both PCs and connections 100s of times faster, yet rich content has in many ways wallowed.

* - PointCast wasn't really push. Indeed, neither is client-side RSS. Instead they're both polled/scheduled pulls. Contrast this with SMTP, which actually is push: When ServerA has something for ServerB, it actively connects to and "pushes" the message. Pedantic point for sure, but I thought it worth making.

  Blogging 
Sunday, October 16 2005

ISBN: 0316346624

3.5 Stars

Okay, this is more like a mini-review. I'm not going to pad this up with chapter lists and summaries, or point-by-point examples.

Colour Trio

I finally got around to reading The Tipping Point, a book authored by Malcolm Gladwell. While this is a very popular work in the software/management/entrepreneur realms, and has been out for several years, I always seemed to have something more important at the top of the pile (Biztalk Server 2004 Unleashed was a real page-turner!).

This 304-page book kicks off with an example of a balanced system that became unbalanced: Syphilis in Baltimore in the 1990s. This communicable disease was a relatively low-level problem, with a fairly constant number of cases per year, until suddenly it became an epidemic: Over a short period of time the number of new cases increased dramatically. Several theories are presented to explain this - for instance that budget cuts in public treatment and education upset what was previously a precariously balanced system. Syphilis had "tipped".

Much of the rest of the book provides theories on why some ideas or memes tip (often presented in an almost instructional manner - e.g. learn from this to know how to make your ideas tip, which explains why the book is so popular), often juxtaposing it with the syphilis epidemic. Intermixed with this are some basic, overly generic social profiles of the types of people who are instrumental in making ideas tip. These profile types are often supported by the contrast of the ride of Paul Revere to that of William Dawes, where the former was purportedly a connected, influential individual presenting information in the right context, and the latter was not so much.

Ultimately I wasn't entirely satisfied with the book. I often felt that it was taking divergent ideas and trying to shoehorn them into the tipping metaphor. I also got a feeling that some facts were simplified, or perhaps presented out of context, to make them fit his case. The book also gave me the feeling that it needed a few more revisions until it achieved a more uniform, smooth presentation: Instead of a constant expansion and refinement of the central theme, this felt more like a series of papers on a common topic, with some token shout-outs to the common theme to try to pull it together.

Is it a worthwhile read? Absolutely. It's an interesting, entertaining read, and provides a lot of superficial sociology water-cooler expertise. However if one were looking for a better, more supported and consistent read on the fascinating topic of human psychology - in a manner educational to both the compliance practitioners and their victims - I'd instead recommend the excellent Influence: The Psychology of Persuasion (ISBN: 0688128165). I suspect that it heavily influenced The Tipping Point, so you might as well go right to the source first.

Saturday, October 15 2005

This blog is ugly.

It started off with one of the stock Radio Userland templates (which, I think, are pretty much universally ugly) and I modified slowly from there, working towards the rather utilitarian vision that I have for this site. I find the sight of frequently used templates - particularly the ultra-cliched common ones (like the typical WordPress templates) - really tiring after a while.

Nonetheless, I've been attempting to update some of the styles as I get the time and inclination, and hopefully it's at least marginally less insulting to your rods and cones. I can confidentally say that it at least passes as legitimate HTML 4.01 Transitional now.

Of course style is completely subjective, and to make the subjectiveness of blogs (or any content page for that matter) a subject of a rant, one of the hacks of HTML that I'm not a huge fan of is the fixed-pixel-width blog - someone made some sort of banner graphic, or had it in their template, so it is thus solidified - their blog is exactly 612 pixels wide. Here I am reading it at 1600x1200, with gigantic swaths of blank space on either side, with the actual content (supposedly the purpose of the blog) filling a relatively tiny panel in the center. Smaller still given that the 3-column format, such that you see here, is often shoehorned into that miniscule 612 pixels.

To add to the insult, the font is usually huge and line spacing cavernous.

  Blogging 

Earlier EntriesLater Entries

Dennis Forbes - Dennis Forbes is a Toronto-based software architect and technology writer