Rob Eberhardt

cleverness ensues

skip navigation

 Thursday, June 30, 2005

Next in my random song roll:

Transatlantic - In Held (Twas) In I
Audio Adrenaline - Glory
King's X - Over My Head
Ben Folds - Still Fighting It
Lit - Over My Head
Ray Charles - One Mint Julep
Galactic Cowboys - Not of this World
Crimson Glory - Cydonia
Metallica - Wherever I May Roam
Jars of Clay - Faith Like a Child

Wow, lotta prog rock this time...

6/30/2005 5:58 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Tuesday, June 28, 2005

I've installed SBS SP1 several times now.  It's an absurdly long and complicated process (yes, definitely "a process" more than "a patch"), and I just noticed this time the progress bar antics of step 4 ("XP SP2 for Client Deployment"):

It did this dance for several minutes.

...Gotta love those wacky patch devs!

6/28/2005 10:54 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

There's been a massive amount of cool software and web development lately involving maps.  I just want to nail down what I've seen in one place.  I'll try it as a timeline...

  • For ages there were the "classic web" map websites, which reloaded the entire page for every zoom, pan or other change.  MapQuest was one of the first (what, 10 years ago?), and has changed little since then.  In a word, "slooow".
  • Eventually some sites like Yahoo Maps and MSN Maps evolved some, using DHTML to dynamically swap the map image, without reloading the entire page.  This was definitely faster.
  • More recently, there was Google Maps, which actually slices the map into separate map "tiles", so that only the changed parts of the map are downloaded for each zoom/pan/etc (which is even faster).  Definingly-cool features include satellite maps, and the ability to "grab/drop" to move the map with your mouse just like you'd grab and move a real one.  This also put AJAX (aka "Remote Scripting") on the buzz map as a web development technique.
    Update: Don't miss the many amazing "remixes" of Google maps with other web apps, like phone books, housing ads, and crime stats).  Just Wow.
  • Then NASA released World Wind, a desktop application which does this same trick, but leverages DirectX to provide seamless zooming/panning -- a true 3D app, and very cool.  It's mouse-enabled much like Google Maps, but adds UI features like Tilting (which gives panning the sensation of a fly-over!) The focus is more educational/scientific reference than convenience (sorry, no driving directions to Wal-mart.)
  • Google Earth is the most recent, which is basically a combination of Google Maps with World Wind.  Its UI features are very similar to World Wind's, but it has more practical user features like Google Maps (how about Flying directions to Wal-Mart!).  (It also has some business features like demographic information overlays and the like, which puts it in the arena of Microsoft's commercial MapPoint software).
  • Update: A9 Maps is a new one.  It's a different interface, and sports "curb-view" photos of addresses.  ...Or says it does anyway, I can't find any around me, so I'm not sure what use that is.

All of these are free, by the way.

If you dig this kind of map stuff and/or astronomy, I recommend Celestia, a free 3D desktop app (like World Wind and Google Earth) for extra-terrestrial (as in "off Earth") virtual exploration.  It's a great reference and learning/teaching tool, and my 5yr old and I love it.

6/28/2005 12:59 PM Eastern Daylight Time  #    Disclaimer  |  Comments [2]  | 

Okay, I'm not really sure Microsoft invented AJAX, but I do know Internet Explorer had several asynchronous scriptable technologies and techniques long before any other browser.

To enumerate:

  • DSOs (ADC, TDC, RDS).  The TDC was pretty good, ADC was too heavy, and RDS was too much of a security issue, but they were all early ways to asynchronously data-bind elements at the browser.  They were also fully scriptable.
  • IFRAMEs - IE4/1997 or newer had IFRAMEs (Netscape 4 did have ILAYER, but Netscape 4 generally sucked).  I actually thought I invented this technique, and used it on many projects to much success.
  • Java - Meh, too bad about the JVM.  Same basic technique, though.
  • XMLHTTPRequest - Slightly more recent (circa IE5/1999 I think).  This object IS what modern AJAX code runs on.  Firefox, et al have only added similar objects in the last couple years.

"Remote Scripting" was Microsoft's term for this technique.  (Heck, here's an April 1999 MSDN article on the topic).

SO, I'm rather annoyed when well-known journalists say Microsoft is working "Not to be left out of any development trends...", or better yet, "Microsoft has decided [Ajax] is something it can't ignore... the Redmondians have jumped on the Ajax bandwagon.".

...Microsoft built that bandwagon.

Update: Perhaps I'm not the only one annoyed they're not getting their due.
Scoble's got a good laugh over AJAX, and Scott Isaacs has thoughts on an AJAX (DHTML) framework.

6/28/2005 12:13 AM Eastern Daylight Time  #    Disclaimer  |  Comments [3]  | 

 Monday, June 27, 2005

Hack screenshot
So I played this game, half-a-lifetime-ago, called Hack.  It was a ASCII-graphical game for DOS, where you explore a dungeon, seeking the Amulet of Yendor.  You could play as a Wizard, Barbarian, or various other character types, and would of course fight monsters, gather treasures, and have various adventures along the way.

The user-interface was obviously very simple (even at the time), but the gameplay was amazingly rich.  I loved it, and spent many days of my life "in the dungeon," but eventually moved on to flashier graphical games.

So flash-forward 15 years to last week, I see this User Friendly comic mentioning "NetHack," and then another random mention of the game got me curious and googling. 

NetHack screenshot
Lo and behold, Hack is still alive and kicking! (great history writeup here)  15 years of development (and enrichment) has added a simple GUI (mostly easier on the eyes) and richer (but completely faithful) gameplay.  I'm not at all disappointed. 

I am tempted to say I want some sort of multi-player version, tho.  Especially considering a favorite game of mine: BattleZone, an early 80s arcade classic, which Activision did an amazing (groundbreaking) job resurrecting in ~1998 as a multiplayer FPS.  I'm still playing it 7 years later.

But for now, it's NetHack again.  It's nice when old friends visit.

6/27/2005 3:52 PM Eastern Daylight Time  #    Disclaimer  |  Comments [2]  | 

Stefan Koell just released RoyalTS version 1.3.  This takes care of the few obvious issues and makes it a fairly mature tool. 

It's still a great tool for Remote Desktop/Terminal Server administration (better than Microsoft's RDC or Remote Desktops snapin), and getting better.  If you control more than a couple machines, you should add RoyalTS to your toolkit now!

6/27/2005 2:49 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Friday, June 24, 2005

From a Kentucky neighbor (whom I found via GeoURL), Chris Vaught writes about How to Start and Keep Blogging.

Good as it is, I have little more to add by blogging...
about blogging...
about blogging.
I guess it's just that good!

(So does this count as using my English Major, Mike? :>)

6/24/2005 4:32 PM Eastern Daylight Time  #    Disclaimer  |  Comments [1]  | 

*sigh*, more comment Spam today -- 150 in a few minutes, despite my nice new .Text spam filters (they were all identical).

Unfortunately, I can't just go into blog_content and delete the range (since the comment count wouldn't be updated), and I didn't want to click [Delete], [Yes], [Continue] 150 times, SO: I just fired-up SQL Profiler, reverse-engineered a standard delete call, and slapped together a utility Stored Procedure to loop that call, for big cleanup jobs.

It takes IDs for the first and last comment spam which make it through, and wipes them all out with .Text's native blog_DeletePost stored proc.  Just paste this into Query Analyzer and run to install:

CREATE PROCEDURE re_wipe_commentrange 
@p_ID int,
@p_lastID int
AS

DECLARE @v_sql varchar(8000)
WHILE @p_ID <= @p_lastID
BEGIN
	SET @v_sql = 'exec blog_DeletePost @ID = ' + cast(@p_ID as varchar(5)) + ', @BlogID = 0'
	EXECUTE(@v_sql)
	SET @p_ID = @p_ID + 1
END
GO
(Note: this is for single user .Text blogs.  Multiple-user blogs will need fiddling with the embedded BlogID parameter.)

Then to use it, call like so in QA: EXEC re_wipe_commentrange 900, 1000.

Might save someone a few minutes (even with writing and posting it here, I think I'd still be clicking delete right now).

Time to consider a way to implement MT-Blacklist...

6/24/2005 2:32 AM Eastern Daylight Time  #    Disclaimer  |  Comments [2]  | 

 Monday, June 13, 2005

Yes, this sounds like an all-too-familiar "Intro to Web Scripting" class or article, but I haven't actually seen these more advanced scripting topics compared before, so I wanted to nail it down in print. 

feature Javascript VBScript
Object-Oriented: Very powerul and easy to create custom object classes Now supported with version 5+ CLASS construct, but is comparatively less powerful and syntax is much more verbose
Object-Based: More object-based, wraps core functionality in intrinsic objects like Date, Math, Number, String, and Array Less object-based, dumps functionality into global functions
Optional procedure arguments: Supported Not supported! (hence kludgy workarounds)
Getter/Setter properties: Not supported! (yet?) Supported
Dialog/User-input support: None built-in, depends on the current object model (e.g. window.alert/prompt/confirm, or WScript.Echo/popup). Has powerful native Msgbox and Inputbox functions.
Convenience tools (aka synactical sugar): Few (escape/unescape?) Plenty (Explicit Conversions, Formatting, Dates, Strings)
Date Manipulation: Difficult (hence the need for a Javascript Date library Easy (see convenience tools)
Leftovers/Quirks:
• Has ternary operator (e.g. var foo= true ? 'bar' : 'grep';
• No ternary operator and no IIF function like VB (but a custom IIF can be added).
General strength Powerful, more "nuts&bolts" Easy-to-learn, more common functionality built-in
General weakness Some common tasks are much too inconvenient Verbose, disorganized, weak OO capabilities
key: good  bad  eh..

Yes, of course it's my opinion, based on experience (and frustration!)  Feel free to proselytize me otherwise, but back it up!

My perspective is this: scripting languages are about convenience -- quickly whipping out something that works, is readable, and is maintainable.  If you want perfect academic code, or fastest performance, get another tool!  For scripting languages, the less code and reference to accomplish a task, the better.

Interestingly, different scripting languages reach convenience by different routes.  For example, where VBScript chooses a "simple" route of a bunch of unorganized global functions, Javascript groups them as methods of intrinsic objects.  Normally I prefer simple, but Javascript's better organization makes me more efficient: I don't have to remember 90 or so distinct global functions -- if I can simply remember the object (Date/Array/whatever), then I'm set, because VS.net's Intellisense will help me quickly find the method I need without cracking a reference.

(Aside about Intellisense: it reminds me of the tabs -vs- spaces debate: I say tabs all the way.  Any decent code editor should be able to display tabs how you like.  Fewer characters to store/send, and less arrowing around pays for itself.  And yes, a coder should be using a decent code editor!)

To be clear, I favor neither VBScript or Javascript as a rule -- each has its time and place (goal of this chart).  Ideally, I'd like to marry them for the best of both.  Both Classic ASP and WSCs can use both in the same context, which rocks.  Too bad ASP.net lost this feature, but it matters less since it now runs full-fledged programming languages.

Finally, for entertainment, here's a hilarious thread on the "JS-vs-VBS" subject.  My favorite quote: "IF JScript was a movie, it'd be Citizen Kane, or The Shining. VBScript would be the Mariah Carey movie, or possibly 'Sgt Pepper's Lonely Hearts Club Band' starring Peter Frampton and the Bee Gees."

Update: added ternary/IIF note to chart 'leftovers'.

6/13/2005 5:45 PM Eastern Daylight Time  #    Disclaimer  |  Comments [3]  | 

Now that I'm color-coded, I may start a regular feature here where I publish smallish code bits I've written...

For WSH scripters out there, here's a handy one I wrote...

To explain, for GUI-type WSH scripts (usually run under the WScript engine), VBScript has a native Inputbox function, which prompts for user input via a dialog box.  Command-line-type scripts (running under CScript) have no command-line equivalent, though -- yes Inputbox works, but a GUI dialog doesn't really fit a command-line script.

So to fill that gap, I wrote this:

' Name:		InputLine
' Desc:		like Inputbox, but for use with cscript
' Author:	Rob Eberhardt, www.slingfive.com
' Params:	prompt as string, default value as string
' Returns:	user's answer
' History:
'		2005-06-13	added default param
'		2005-02-28	created original InputLine function
FUNCTION InputLine(p_strPrompt, p_strDefault)
	call Wscript.Echo(p_strPrompt & ":")
	IF p_strDefault<>"" THEN CreateObject("WScript.Shell").SendKeys(p_strDefault)
	DIM strInput
	Do While Not WScript.StdIn.AtEndOfLine
		strInput = strInput & WScript.StdIn.Read(1)
	Loop
	WScript.StdIn.skip(2)
	InputLine = strInput
END FUNCTION

Example usage:

DIM strChoice
strChoice = InputLine("Enter favorite color", "Red")
call WScript.Echo("You entered: " & strChoice)
...which would look like this from a command-line:
Enter favorite color:
Red
You entered: Red

For bonus points, you can detect if the current engine is CScript or WScript, and use InputLine or InputBox appropriately (like if you're note sure what engine will run your code):

DIM strChoice

'detect CSCRIPT context & use InputLine
IF Instr(lcase(wscript.FullName), "cscript")>0 THEN	
	strChoice = InputLine("Enter favorite color", "Red")

ELSE	'detect WSCRIPT context & use native InputBox
	strChoice = InputBox("Enter favorite color", "Color?", "Red")

END IF

call WScript.Echo("You entered: " & strChoice)

Hope someone can use it.

Note: I would have absorbed this engine detection logic into a single smart InputLine-like function, if only Javascript supported Inputbox, or VBScript supported optional arguments.  But, InputBox's optional 2nd "Caption" param makes no sense with InputLine, and unfortunately the languages leave no room to gracefully work around that.

6/13/2005 3:46 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Thursday, June 09, 2005

, and 90% were spam.

But I just got me a nice new .Text Anti-Comment-Spam SQL Trigger (in addition to the Anti-Referral-Spam SQL Trigger I've had the whole time!).
  ...Looks good so far!

6/9/2005 7:53 PM Eastern Daylight Time  #    Disclaimer  |  Comments [4]  | 

Trying out the new Windows Update v6 (now called "Microsoft Update").  Cool that they've finally integrated Office Update and other products (SQL Server for instance).

A few observations, though:

  • It took several ActiveX installs, plus closing and restarting IE for it to actually load fully.
  • Windows Update has been slooow for me lately (before this version even). Dunno why, but it still is. 
        Update: same slowness on sparkling fresh XPSP2 and SBS 2003 installs.  It ain't me.
  • Still a ton of French Spell Checker updates?? (2 for Office, 1 for Visio, 1 for Project) I saw this a lot with Office Update too. I have no French anything on any machines, so what's the deal?.

About time to reboot...

6/9/2005 3:14 PM Eastern Daylight Time  #    Disclaimer  |  Comments [4]  | 

 Tuesday, June 07, 2005

My friend Mike Butler posted a thought-provoker about blog self-censorship and choosing topics.

I've struggled with that dilemma too.

One one hand, I want my family, friends, and strangers to be able to read my blog without being offended or bored.  On the other, I need to express myself freely.  I realized early with this blogging venture that I have a habit of putting on personas for each situation.  That bugged me since it seemed disingenuous, and it was making me second guess myself.  I think I settled on making my blog just For Me (at least as far as topics) -- including the tech-geek, the father, the immature Jr. High dork, the business man, the music-fan, the navel-gazing philosopher, etc.

If a subject bores or bothers someone in real life, they have to grit their teeth.  Here at least they can ignore me without worrying about my feelings :>

I think my goal is no longer about avoiding boring/scaring people away, but rather trying to attract people by giving each of my facets a balanced representation.  For example, Me-the-father hasn't really posted yet (mostly due to the sheer magnitude of the thoughts I want to distill into a post), so there's a whole audience I've missed so far. 

Good food for thought.  Thanks Mike.

6/7/2005 2:56 PM Eastern Daylight Time  #    Disclaimer  |  Comments [1]  | 

 Friday, June 03, 2005

HTTP Compression is a wonderful idea.  Unfortunately, its implementation in IIS 5 was deeply flawed

Besides the usual issues, I've also found that HTTP Compression breaks Data Source Objects (DSOs) and Tabular Data Controls (TDCs) in IE (wonderful features for client-side data-binding in web apps).  IE loads the data (showing "XX items remaining" counting down in the status bar, and eventually "Done"), but it never data-binds to the table template or gives any error messages, leaving an empty table.  My guess is that IE uses a different mechanism for requesting DSO data resources from a webserver than it does for normal resources (pages and their referenced files like scripts, stylesheets and images).  I've never seen this issue documented by anyone else, which I attribute to the relative obscurity of DSOs and TDCs (they were never marketed to devs enough).

So you can imagine it was a big pain figuring this out the first time...

When IIS 6 came out, I heard a lot of excitement that it fixed HTTP Compression, so I was excited too.  Well I've recently/finally moved into IIS 6, enabled HTML compression, and then just got confused all over again today because my TDCs were broken.  Grrr...

Sure enough, turning off "Compress Application Files" (and restarting IIS) fixed it.  At least IIS 6 gives separate compression settings for dynamic and static files, so now I'm just compressing static files (e.g. HTML, CSS, JS, VBS, HTC), which should still help a bit (of course those files are cached by the browser anyway...).

Apparently Jeff Atwood has also found other big issues with IIS 6's HTTP compression.   He's got a lot of good info, plus a handy metabase snippet to help fix those problems.  Check it out.

6/3/2005 4:23 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Thursday, June 02, 2005


It requires modifying the installation CD (just two bytes), but for the brave: HOWTO Change Windows XP Home to Windows XP Pro - Gizmodo

Lessee, judging by Microsoft's Windows XP Comparison Guide, that should get you:

  • System Restore
  • NTBackup
  • Fast User Switching
  • Offline Files
  • Remote Desktop
  • hardware support (Dynamic Disks, Multiple Processors)
  • security (Access Control, EFS)
  • IIS, and
  • domain support (Group Policy, Assigned Software Installation, Roaming Profiles, RIS).

Of these features, everything but IIS and domain support can be useful to many home users.  In particular, there's no way the first three -- System Restore, NTBackup, and Fast User Switching -- should have ever been left out of XP Home -- ALL users could benefit from them. Whoops, had some bad info before I checked the XP Comparison Guide (and I was caught editing, so I can't just erase it now!  Good catch Ed!) -- It looks like FUS and System Restore are in XP Home. My opinion stands for NTBackup and Remote Desktop, tho.

For those less venturesome (or unwilling to reinstall), it is possible to install NTBackup on XP Home.  See Ed Bott's "The amazing hidden backup program".

6/2/2005 3:29 PM Eastern Daylight Time  #    Disclaimer  |  Comments [8]  | 

I've implemented Dean EdwardsStar-Light for code-formatting here.  It's an awesome (and useful!) demonstration of the power of DHTML Behaviors.

Oh, and it's free (just a Creative Commons license).

And it works in both IE and Firefox*.

All it takes is a linked stylesheet and a CSS class on the target code section (specifying the language of the code), and Star-Light dynamically formats and colors it in the browser.  For example, this code:

<pre class="vbscript">
' this is a "comment"
'' so is 'this'
DIM string
string = "' string '"
call msgbox("Hello ""Dean""!")
FUNCTION getText(a, b, c)
	getText = a + b & cstr(c)
END FUNCTION
</pre>

displays thusly:
' this is a "comment"
'' so is 'this'
DIM string
string = "' string '"
call msgbox("Hello ""Dean""!")
FUNCTION getText(a, b, c)
	getText = a + b & cstr(c)
END FUNCTION

The supported languages are CSS, HTML, Javascript, PHP, and XML.  (For fun, it can also enhance plaintext conversation text: emoticons into images, *bold* into bold, /italic/ to italic, _underline_ to underline, plus enhancing ">" quoted sections.)

Coolest of all, though, it's highly extensible via language modules.  I glanced through the code to see if I could make it support VBScript.  The engine is pretty complicated, but each module is a simple HTC file.

From there, it was easy to create a new module for VBScript and plugin the appropriate keywords straight from Microsoft's Windows Script 5.6 Documentation.  I sent my VBScript module (working above) to Dean -- he made a couple improvements, and said he'll include it with the rest soon.  (I may also create modules for VB6 or VB.Net, but there's a lot stuff to those languages...)

I don't mean to gush, but: Very Cool.

Unfortunately, Dean hasn't yet documented how to do write your own module (I figured it out on my own), but it's pretty easy for someone who knows HTCs and has a language reference to copy/paste.

* Another gee-whiz bit: despite the coolness of DHTML Behaviors, they are normally only supported by Internet Explorer.  But Dean's done a wonder, and written a Mozilla XBL wrapper which makes Mozilla/Firefox support DHTML Behaviors too! (which is of course wrapped into Star-Light).  This situation should be the poster child for the de-facto standards camp -vs- the slow academic W3C types, but more on that another day.  Meanwhile, I'll sit back and regret my rationale "DHTML Behaviors are IE-only anyway, so I'll go ahead and use all this other IE-specific code." Like, uh, VBScript..... (dough!)

6/2/2005 2:38 AM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  |