Rob Eberhardt

cleverness ensues

skip navigation

 Saturday, April 23, 2005

Hm.. mixed feelings about participating in a meme, and moreso since the last few posts have been borderline shirking.

(But wait, how can I shirk?  Did I made an regular-original-content-creation-committment?!)

Anyway, it's a fun one via Ed Bott: load your entire music collection, randomize, and list the first 10 songs, uncensored. 

Here's what I got:

Porcupine Tree - Every Home Is Wired
Spin Doctors - Someday All This Will Be Road
Blind Guardian & Iced Earth - The Whistler
Flower Kings - Rumble Fish Twist
Earth Wind and Fire - Shining Star
The Fixx - Red Skies
Andy Grube - I Surrender
Audio Adrenaline - I'm Not The King
King's X - Mississippi Moon
Galactic Cowboys - Kaptain Krude

(Wow, rand()/fate was kind -- nary a Raffie or bubblegum pop song in the lot!)

4/23/2005 11:53 PM Eastern Daylight Time  #    Disclaimer  |  Comments [5]  | 

 Tuesday, April 19, 2005

"A modern computer is a magic box filled with ceremonial components that traps in a little evil spirit who is forced to work for you."

Nothing like a little Fenestredigitation, Open Sourcery, and Voodoo Debugging to start the day.

4/19/2005 10:02 AM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Saturday, April 09, 2005

 Wednesday, April 06, 2005

I thought I'd share some Small Business Server 2003 security silliness.  Following is a series of Internet Explorer dialogs when you setup VPN via the Remote Web Workplace:

---------------------------
Microsoft Internet Explorer
---------------------------
After you install Connection Manager, ensure that all users of this computer have strong passwords to protect the security of your Windows Small Business Server network.
---------------------------
OK   
---------------------------

---------------------------
File Download - Security Warning
---------------------------
Do you want to run or save this file?
    Name: sbspackage.exe
    Type: Application, 503 KB
    From: ---
---------------------------
Run   Save   Cancel
---------------------------
While files from the Internet can be useful, this file type can potentially harm your computer. If you do not trust the source, do not run or save this software. What's the risk?

---------------------------
Internet Explorer
---------------------------
The publisher could not be verified.  Are you sure you want to run this software?
         Name: sbspackage.exe
    Publisher: Unknown Publisher
---------------------------
Run   Don't Run
---------------------------
This file does not have a valid digital signature that verifies its publisher. You should only run software from publishers you trust. How can I decide what software to run?

---------------------------
Connect to Small Business Server
---------------------------
Do you wish to install the connection to Small Business Server?
---------------------------
Yes   No   
---------------------------

Notice the Big Red Flag??  Microsoft's SBS team never signed the VPN installer (sbspackage.exe), so IE on XPSP2 (and presumably 2003SP1 now) does its scary "don't take candy from strangers" warning.  (How long has Microsoft been touting executable signing now?!?) 

*sigh*

 

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

 Friday, April 01, 2005

I just asked a guru of advanced Object-Oriented Javascript, Douglas Crockford the following question.  For posterity, and for other possible takers, I'm posting it here too.

Also, for the record, this has nothing to do with IE's proprietary -- but wonderful -- setExpression method or CSS expression capabilities.  Those dynamic properties only apply to DOM objects, not custom Javascript objects.


Do you know of a way to define dynamic object properties in Javascript?

For example, VBScript lets us define classes such as this:

CLASS myClass
    PUBLIC phrase
    PUBLIC PROPERTY GET firstword    'get first word from phrase
        firstword = left(phrase, instr(phrase, " "))
    END PROPERTY
    PUBLIC PROPERTY LET firstword(v) 'set phrase's new first word
        phrase = v & " " & phrase
    END PROPERTY
END CLASS

This demonstrates two important features:
1. the firstword property can return dynamic results (depending on the current value of the phrase property). 
2. setting the firstword property can run other code (which dynamically prepends to the phrase property).

We can fully accomplish #1 (Property Get) in Javascript, by reassigning the toString method/property to a function like so:

function myConstructor(){
    var self = this;    //preserve object's context
    this.phrase = '';
    this.firstword = function(v){
        if(v){self.phrase = v + ' ' + self.phrase};    //LET
        return self.phrase.substring(0, self.phrase.indexOf(' ')); //GET
    }
    this.firstword.toString = this.firstword;
}

...But I've found no way to achieve #2 (Property Let or Set) in Javascript.  I can set firstword as a method, but setting the property value overwrites the method definition (and all subsequent GETs return that static value).

I've extensively searched, but found no answer (at least not before Javascript 2.0, which doesn't yet exist).  Any ideas from the experts?

Update: Douglas Crockford responded that he doesn't care for getter/setter properties, since "it allows simple assignment to have side effects, which I think works against reliability."  (I take that as a "No, it's not possible.")
    My current need is that I'm patterning my custom object after part of the DOM, whose objects certainly do have getter/setters.  I agree with Douglas that getter/setter side effects can be dangerous (esp. in the hands of a poor coder, as with any powerful code construct), but I think the use of methods -vs- getter/setter properties should be in the realm of "best practice" rather than a language limitation. 

4/1/2005 3:25 AM Eastern Daylight Time  #    Disclaimer  |  Comments [7]  | 

 Thursday, March 31, 2005