This is not a blog. So sue me!


Crikey, things are looking up!

Sunday, December 30, 2007

Book reviews: compare "The Da Vinci Code" with "Quicksilver"

The Da Vinci Code by Dan Brown vs. Quicksilver by Neal Stephenson

Quicksilver:
Not recommended. This book was disappointing. All style and not enough substance. I was looking forward to something that would be informative or entertaining but it really dragged.

The idea is that in the late 1600's to early 1700's an imaginary individual called Daniel Waterhouse was involved indirectly and directly with all of the luminaries of the day; Cromwell, Charles II, various nobles, various proto-scientists of the Royal Society, or alchemists (Hooke, Boyle, Newton, Liebniz etc.) Of course, he lives in Cambridge with Newton, he assists Hooke with vivisection experiments and is somehow on the scene when anything vaguely significant or exciting happens in this time period. The Plague, Great Fire of London etc. etc. Plus, our hero founded MIT, as well as naming New York city. I mean, who writes this stuff?

An early cameo, which introduces Ben Franklin as a boy was, shall we say, a really obvious plot device...and this was page 8...a mysterious stranger meets a smarty-pants kid in Boston in 1713, the kid's called Ben...Oh, I thought...it's going to be Benjamin Franklin . Sadly, it was. One of those books that's grown out of the effluent of the creative writing courses so popular in the USA. "Imagine yourself meeting an important historical character..." Well, why not imagine meeting all of them? Sigh. At least with Ahab's Wife (Sena Jeter Naslund) which is of a similar vein, the writing was compelling.

The style of Quicksilver, is unfortunately, sorely lacking an editor's lash. We're not really sure why it's called Quicksilver, except that various characters are trying to poison themselves with it (mercury). Kind of a shame it didn't work faster, really. The few passages that read quite eloquently are usually abruptly followed with a short paragraph of jarring drivel. In addition the writer persists in following an especially irritating spelling scheme which feigns the language of the period - but only about once in a hundred words - adding in something like "philosophickal" or "fabricks". Together with a lot of modern-sounding expressions and occasional fairly modern puns, it just doesn't ring true.

The plot is unconvincing. There is occasional excitement to be sure, albeit a gratuitous and long drawn out encounter with pirates (Blackbeard no less, none but the best for our hero!) but again, I was unmoved. By the time this 440 page martyrdom was half done, I was ready to give up. Who cares about this...but, gentle readers, I persisted. Shame, it got worse if anything.

There are a number of gruesome depictions of everyday life in the period. Crap everywhere, toothless rabble, grotesque punishments (assorted hangings, brandings, nose removal, heads on pikes etc.) but again, unconvincing. Even the walk-on parts for actresses and whores (about the only female speaking roles) didn't have any life to them. Not to mention the laughably ungraphic sex scene, about page 418/440, which basically means a long wait for very little hide-the-sausage.

Don't waste your time with this book. When I got to within 20 pages of the end and realized that I'd have to wade through the sequel (and, of course, the obligatory last book in the trilogy) to get to a resolution of the plot, I decided that I wasn't going to waste any more time or money on this.

The Da Vinci Code:
One star, is that the lowest I can give? Too much for this junk.

I know it's popular but it's crap folks. Pseudo-scientific claptrap with ancient conspiracies, romance and a gripping thriller theme.

I mean, grow up, y'all. While the plot is OK, if you like that kind of thing (ripped off though), the characters are really poorly-drawn, with motivations about as obvious as if they had signs hung around their necks:
"I'm the masterly, athletic, scholarly hunk from the good ol' USA who's going to sort out this den of foreign rogues and charlatans." I mean have you seen what a literary scholar looks like after getting a PhD and spending years in the stacks? Not credible.

As for the improbably gorgeous French tart oo talks like zees and was mysteriously traumatized by seeing her grandparents shagging in front of a bunch of party animals; does anyone seriously believe this? Doesn't anyone edit this stuff anymore? This is a teenage wet dream, surely.

The crippled but wealthy British nobleman who appears to be a friend but is really a villain...that has to be to stupidest comic book characterization that I've read in many years. Anyone who didn't see this one coming is an idiot.

It's just the kind of thing that grown up fans of Harry Potter will love, but it's a bodice ripper. The sex scenes are well done, and the villains are pretty compelling. However, don't waste several precious hours of your life reading this, when you could be walking the dog or emptying the cat litter box. Don't buy it for heaven's sake. If you must, borrow it from the library. You'll have to beat 40 housewives and pensioners to get it, fer sure.

Summary:
In summary, I think the Da Vinci Code is the better book, although it is crap. Dan Brown (and his editor) do a reasonable job of keeping the plot moving and you can't see the joins. Certainly it has more excitement, and cynical suspension of disbelief apart, is a much better read. At least it wasn't a struggle getting to the end, although I felt as guilty as if I had binged on a whole box of Turkish Delight. Quicksilver is a waste of time; should have been much more tightly edited. Stephenson has got some interesting turns of phrase here and there, but it doesn't work in the full-length novel form. Could do better.

Sunday, December 23, 2007

Loyalty in the workplace

I picked up a copy of some sheet music when I was a co-op student in IBM (1978, Havant U.K.)
These were of three old (1930's ) songs written for and about IBM. One of them here will give a taste. They were hilarious in the '70's, perhaps rather sad now, I think. Simpler days.

The idea that one would give up spare time to go and sing in front of a company rally is pretty funny. Wearing a company uniform? Hilarious. Aren't we all just wandering journeymen now? Well not exactly.

There is a lot of leverage in having a team that is loyal and in-harness so to speak. Very responsive to changes, willing, happy even. Most people will work like dogs if they are interested, engaged and have the respect of their peers. Even old farts like me will pull long days to get the job done, keep learning and try to be smart. And you do want your staff to be smart.

My observation, from working at IBM as a student in those long gone days (when that company prided itself on never having laid off a worker! lol) until now, is that the loyalty unit has got smaller and smaller. Sometimes to small companies, perhaps to teams, then to individuals. Obviously finally, to self. This subdividing of loyalty is not the most productive configuration. The power of one is, well, small.

There are some people, whom everyone respects, wants the respect of, and to whom people will be loyal. If you can hire and engage those folk, they will make it easier for other people to find reasons to work hard. They are not always the hierarchical team leads or ranking managers. They are not always the best designers or programmers. They are always smart. There's a light in their eyes when they get enthusiastic about something.

The rewards people get from their teams are simple. Respect. Sometimes it's just having someone you respect compliment you about something you've done. Sometimes it's being taken seriously when you want to discuss something. It's working alongside someone who can actually help you. Sometimes it's playing with a toy, or sharing a cool site or vid. It's about pleasure, sharing, joy and love .

We are exploiting the "belonging" slot in a person's mind. If we have to work, it is better than using goads! However it is exploitation at the end of the day, or manipulation at least. The question is perhaps, if the victims like it, is it wrong?

The test of a team is the reaction when the stress levels rise. When a team is stressed or has started to turn on itself (failures, layoffs etc.) there's often a mass-exit of the good people. The remaining people usually consist of the incompetent but politically savvy (can't find other jobs), and the competent but naive (don't know they should find other jobs), along with the usual group of turned-off and can't-be-arsed types who coast along regardless. The team binders' reaction is important. They can sometimes bring a team through a short crisis, even though the logical reaction would be for everyone to flee.

Saturday, December 22, 2007

User Interface enormity...guess who?

So, there I am at the office, with a mailbox in a work email account (on MS Exchange, feh) and an old friend sends me a cheery greeting. When I get home, I decide to reply to it and, instead of logging in to the VPN, Remote Desktop and all that jazz (which takes a couple of minutes to fire up and requires entry of the same password twice), I open up the POS grandly called "Microsoft Outlook Web Access". First mistake. Normally I only do this to look at incoming stuff and send quick replies, this time, I decided to compose a slightly longer reply.

'Swelp me guv'nor, I only took 5 minutes to reply, about 5 short paragraphs...how's the family... yak...yak...

I clicked the Send button. Second mistake.

What came back was the Web Access login screen. I floundered around a while, trying the back button, logged in again, (note it says "you replied to this mail..." on the original email from my friend). But my message was gone. Not in the Sent items, nor in the Drafts. Augh!

I was, and am outraged. Perhaps I've been working too hard or more likely my standards have been raised by using professional strength web applications. Losing the user's data in this way is unforgivable. I don't care if my session timed out, or if my administrator had put too short a timer on the app. I don't care if the note was just a personal "Hello there!" to a friend. They lost my effing data!

I will never use it again...Microsoft Outlook Web Access...and I will try to forward all my work email to a proper web app. Gmail or whatever...for example, if I click away from a Google compose mail form, I get a nice courteous dialog, saying:

"Are you sure you want to navigate away from this page? Your message has not been sent."

Now that's a real gent! Helpful, kind and giving me the opportunity to at least save my data.

Solstice celebrations

The rural Ontario folk around me are preparing their environment for the winter holiday. Indeed the whole of North America, perhaps half the world, is nuts. Pretty lights, buying crap made in China to give to their loved ones, which will end in a landfill within the year. It's infuriating that the world's resources end up being wasted like this. My thinking would be to buy something long-lasting, if you must, or give money to a charity* on behalf of someone else.

When can we get back to the true meaning of the solstice celebrations? The dark is going to lessen bit by bit over the next few months. The season is going to get worse but there is hope for a return of Spring. Celebrate the fact that we're alive, have good friends and that we can love our fellow man (at least until his wife gets home)**

Happy secular humanist winter solstice. And something from a favorite blogger. 'Nuff said.



* How about this one.
** Stolen joke alert! First heard by me in an old Doors' song: The Soft Parade.

Saturday, December 8, 2007

Silly Songs

Parodies of song lyrics are a weakness of mine...pathetic really.

My Generation 

 A tribute to the late '60's hit of the same name by The Who.

People want to put us d-down (Talkin' 'bout my generation)
Just because we can't get around (Talkin' 'bout my generation)
Things they say are awful c-c-cold (Talkin' 'bout my generation)
Like I didn't die before I got old (Talkin' 'bout my generation)


That was my generation. That was my generation, baby


It's how we all f-f-fade away (Talkin' 'bout my generation)
'Cos we can't hear what you all s-s-say (Talkin' 'bout my generation)
I'm not trying to cause a big s-s-sensation (Talkin' 'bout my generation)
I'm just talkin' 'bout my g-g-g-generation (Talkin' 'bout my generation)


That was my generation. That was my generation, baby


Old stupid and fat
To the tune of Nina Simone's late '60's hit "Young, gifted and black":
(I considered using the line "Old, stupid and white" but 'fat' scans even better than the original).

To be old, stupid and fat,
Oh what a sad and lonely dream.
To be old, stupid and fat!
I think you know what I mean.

In the wide world we all share,
There are billions of us out here,
Who are old, stupid and fat!
And that's a fact!

Old, stupid and fat,
We must begin to tell our young.
There's a world waiting for you,
This is a quest that's just begun.

When you feel really low,
There's a snack food calling you know.
When you get old, stupid and fat,
There's no way back!

Old, stupid and fat,
How I longed to know the truth.
There are times when I look back,
And I am haunted by my youth

Oh but my joy is of today,
We can all be proud to say:
To be old, stupid and fat,
Is where it's at!


Help me shovel through the shiteKris Kristofferson had a big one with "Help me make it through the night", but really he just wanted to get in yer pants...


Take the cat fur from your hair, sweep it up and out the door.
It's another lovely sight, like the puke stains on the floor.


Come lay down by my side, while they prowl through the night.
They're just taking our tomorrows; help me shovel through the shite.


Rolling down to old Meow-ee
Our cats:
  • Do not have telephones
  • Do not like plain crisps
  • Love cat food
They sing:
(to the tune of Rolling down to old Maui)

It's a damned hard life full of toil and strife,
We pussycats must endure.
And we don't give a damn when we're eating our spam,
What it costs you at the store.


For we're always going out that door,
And we're always coming in.
And we always say, when we're on our way:
Let me out, right now, meow-ee!


Let me out, right now, meow-ee, me boys!
Let me out, right now, meow-ee!
And we always say, when we're on our way:
Let us out, right now, meow-ee!

Friday, December 7, 2007

Self-customizing computer interfaces



Developers do a lot of arcane stuff on a computer. Building, deploying, content mapping, code repository check-ins, viewing/approving code fixes, bug tracking...and so on. All of this requires a set of tools, sometimes chosen by an employer, sometimes a collection whacked together as an ad-hoc suite in order to get the code done.

The use of these tools is often blindingly fast...you don't need to look at that menu or dialog box to know that you should click here...or here...you know the path to the particular group of files by heart...you don't read an entire file path, you grok it. Recognize it by sight. This is another kind of automaticity and is, probably, the same kind of thing that any craftsman does, whether it be building a house or machining a piece of metal.

Having learned to use a set of tools, with a habitual technique for performing various tasks, it is very irritating when the computer, or part of the software on it, decides in its wisdom, to reconfigure a menu, change a dialog box, change a familiar icon, or move all the shortcuts on the desktop.

Windows is dreadful for this. Unix didn't do anything remotely like this. It's clearly some kind of prank pulled on the unsuspecting public, in order to "help" someone who is a dope*. It is really bizarre, perhaps there are usability studies that say that this does help the hapless, I doubt it. Most people learn to use a windowing interface in a rather geographic way...the icon for a tool is a nice bright thing in the middle of the second column on the left hand side of the desktop for example. So when the computer is updated with some "security"** fixes, and the icon changes colour to a kind of wishy-washy wimpy thing and gets moved...well...steam emits from orifices, I'd say.

It's one thing to set up ones own machine and stop these things from happening, but when you go and use another machine, or have remote access to dozens of desktops, finding a way of achieving your objectives becomes a more interesting challenge.

This is like the negative billing of the software world; programs usually do this - without asking- and you have to find a way to turn it off. Eventually you give up, live with it and try to "f%ckin' stay awake" (to quote Billy Connolly).

However, when I suddenly got the error pop up above, and I found that Windows has rearranged the Right-mouse click menu on my machine so that the previous "Open with MyEclipse" is now just number 4 on the list (and double-click doesn't work the same as it did yesterday), I thought...why? Why do we do this? What possible reason could there be for the machine customizing my interface in any way? I've been doing it this way for months and it didn't interfere before. Did I do something stupid***? The arrogance of the people who decided to do this renders me, well, not speechless, more's the pity, but I'm left feeling that this is horribly wrong.

There's got to be a better way...how about a nice conversation?

"BTW, Sue, I've noticed that you use this thingy more than you use these thingies in this menu. Or you're installing something to do with this thing. Can I make it easier for you by putting this on the top of the menu, or by reminding you of the keyboard shortcut you so obviously need to remember?"

"No, get lost."

"OK! CU later."


* - only a dope wouldn't be disturbed by this behaviour.
** - unlikely, but now everything's about security apparently. The new 's' word.
*** - well, that goes without saying.

Tuesday, November 27, 2007

Two types of programmers

iBanjo's post and Jeff's about the 80-20 rule when it comes to indifferent-excellent programmers are a bit harsh IMO. It's an exaggeration to make a point I guess. I'm sometimes in the 20%, sometimes in the 80% - depends on what applications, environment, level of expertise, and interest.

However, it brings up something very interesting, which is programmer productivity. I do strive to improve my personal productivity, and tell colleagues about useful tools. As the tools get more and more capable, people get more productive - as long as they can be arsed.

For text, computers allow people to produce more than typewriters which were more efficient than fountains pens which were better than quills. At each step the productivity mapping against the cost of a skilled worker, was to the benefit of everyone (well...perhaps that is arguable; imagine the ink well-fillers laid off when the fountain pen was introduced. :-)

With programmers, a higher degree is not necessary to be able to write a program. We no longer have to enter every character in a form for a data-entry clerk to type in. Or use a card punch. We do our own typing and the systems give us far more leverage than they used to. At the same time, we are encouraged to become lazy with things like memory allocation or cleaning up comments (yes, children, there were systems that only allowed 1000 lines of code, comments included. You have never seen such a sad girl as when I had to strip out all my lovely comments to get that darn thing to take the rest of the code :)

So we are all the more productive, in theory, and there are a lot more of us, and we're producing more...but...a heck of a lot of it is ending up being thrown away. All these startups, perhaps one in a hundred is still going after 5 years*. Perhaps one in a thousand is flourishing**. Most code that is written is being discarded without earning a real penny (I don't count IPOs and other stock market artifacts, I mean real profit for code). I think my most long-lived code was for a hydroelectric plant...embedded in the display panels representing a switch yard, it will probably live longer than I will, but the company I worked for took a big loss on the project.

I am not sure what can be done, apart from contributing to open source projects. That does seem to be a way to give the useful parts of a project to some kind of posterity.


* - unsupported assertion
** - unlikely

The first spam in the world*

This is how I got a shiv in to one of the first spammers. There's a footnote to explain why I think spam should be punishable by the death penalty. This is going to be a long post, so get comfortable.

In the late '80's and early '90's, my children, I used a discussion network called USENET
in the same way people today use on-line forums, interest groups and social networking sites. I was a contributor to a couple of groups about recreational sailing. I owned a boat, had some experience and I was able to pontificate to the grateful and less-experienced masses.

All this changed, when spam started to load up my email inbox. Every post I made started to become the subject of a couple of lame attempts to sell things to me. It wasn't even sailing-related stuff. Eventually, the volume of spam became so large that got I fed up, changed my email address and stopped participating in the groups. It had been a pleasant pasttime, and I was very unhappy that it couldn't continue, as there isn't much sailing up here when the water gets hard.

In the couple of years between the arrival of the first spam and my surrender of my right to free speech (which is how I feel about it), I encountered a particularly hapless spammer. She (for it was apparently a female) had strung together a couple of email messages each containing advertisements for about six different products. (These were the days when there were few enough spam messages that I wrote indignant responses back to senders :-)

Among the products in her messages were these:
  • Printing company in North Carolina
  • Adult videos for sale somewhere unspecified
  • A sale at a lumber store in Raleigh
  • "Wedding party favors" and wedding services (whatever they may be)
  • Pet store
You get the picture.

I leaped into action...because the spammer had given out her customers' email addresses in each of the little ads, and the email addresses were all from the same domain name, I thought that a little direct action was worth trying. Of course...the sender of the spam had blocked responses, but her customers were relying on incoming email to do their business (I presume that was her pitch to them).

I sent a dozen little emails, along the lines of "your message is unwelcome because I am paying to pick up my email" (yes we did pay per byte in those days). The best one was like this:

Dear wedding party favors vendor,
I am shocked and appalled that I have received your commercial message along with that for a pornographic film purveyor, obviously from the same service. I would not use your company because you are associated with this service provider who is promoting unsavory and possibly illegal material.
Yours etc.
Sue W....

(slight emphasis on nice female persona, presumably a target for wedding party stuff.)

The reaction was gratifying. Within the day I received a choleric email from the spammer. This was nearly a thousand words of outrage, threats, denial of wrongdoing, denial that I could possibly be upset by a suggestion that I should consider her porn-vending customer's products, how could I stop her constitutional rights to free speech, etc. and in closing, with the fact that she had blocked responses from me in future. I guess it would have been excessive to ask if I was now off her mailing list...

It was a good day. I felt much better. Obviously she (or perhaps a disguised he) had been reamed out by some or all of the targets of my messages. Revenge is a confession of hurt, but it was sweet.

Footnote: Why I think spammers should be executed:

I do not think that the death penalty is right. I've lived in both England and in Canada and capital punishment hasn't been allowed in either country for a long time. However, I think that spammers and those that enable spammers should be taken out and shot. Nah...something more spectacular.

These people are clogging up the arteries of the Internet, costing millions, infringing on the rights of the digital commons, if you like, to sell me stuff I don't want, can't use, can't understand. They try to take over machines for nefarious purposes, but most of all, they have cost me and many others, their right to free discourse in such as USENET groups and many other forums. The fact that many sites require registration, login, visible-only code words and other tedious impediments is due largely to these scum. They know better, but do it anyway.

Off with their heads!


* - an exaggeration, and a downright lie.

Thursday, November 15, 2007

ActionScript 2.0 function to convert milliseconds to HH:MM or MM:SS

These functions are basically the same, convert a Number in milliseconds to a displayable time string HH:MM or MM:SS:

public function convertMillisecondsToHHMM (millisecs:Number):String {
    var hour:Number;
    var min:Number;
    var hourStr:String;
    var minStr:String;

    var lenMin:Number = millisecs/1000/60;
   
    if (lenMin == undefined || lenMin <=0) {
      return "00:00";
    }
    else if(lenMin > (99*60)+59){ // greater than can be shown in 99:59
      return "99:59";
    }
    else {
      // work out how many hours and mins and concatenate them for the time
      hour = Math.floor(lenMin/60); //get the number of hours
      min = Math.round(lenMin%60); //get the remainder 0-59 mins
     
      // convert to strings
      hourStr = hour.toString();
      minStr = min.toString();
     
      // if minStr is 2 character, leave it alone, if it's 1 char, pad it, if it's more than 2 make it "99"
      if (hourStr.length == 1) {
        hourStr = "0" + hourStr;
      }
      else if (hourStr.length > 2) {
        hourStr = "99"; // this is impossible!
      }
      // if secStr is 2 digits, leave it alone, if it's 1, pad it, if it's more than 2 make it "99"
      if (minStr.length == 1) {
        minStr = "0" + minStr;
      }
      else if (minStr.length > 2) {
        minStr = "59"; // this is impossible!
      }
     
      return hourStr + ":" + minStr;
    }
  }
 
  public function convertMillisecondsToMMSS(millisecs:Number):String {
    var min:Number;
    var sec:Number;
    var minStr:String;
    var secStr:String;

    var lenSec:Number = millisecs/1000;
   
    if (lenSec == undefined || lenSec <=0) {
      return "00:00";
    }
    else if(lenSec > (99*60)+59){ // greater than can be shown in 99:59
      return "99:59";
    }
    else {
      // work out how many minutes and seconds and concatenate them for the time
      min = Math.floor(lenSec/60); //get the number of minutes
      sec = Math.round(lenSec%60); //get the remainder 0-59 secs
     
      // convert to strings
      minStr = min.toString();
      secStr = sec.toString();
     
      // if minStr is 2 character, leave it alone, if it's 1 char, pad it, if it's more than 2 make it "99"
      if (minStr.length == 1) {
        minStr = "0" + minStr;
      }
      else if (minStr.length > 2) {
        minStr = "99"; // this is impossible!
      }
      // if secStr is 2 digits, leave it alone, if it's 1, pad it, if it's more than 2 make it "99"
      if (secStr.length == 1) {
        secStr = "0" + secStr;
      }
      else if (secStr.length > 2) {
        secStr = "59"; // this is impossible!
      }
     
      return minStr + ":" + secStr;
    }
  }

getDateString: ActionScript 2.0 function to make a readable numeric date string

The getDateString returns the present date/time in the form of a readable (just) string down to milliseconds e.g. 20061231135901999. It uses the leftFill function below:

//get the current date/time and make a string
//in the form yyyymmddHHMMSSmmm
private function getDateString():String
{
var today:Date = new Date();
var dateString:String = today.getFullYear().toString()
+ leftFill((today.getMonth()+1).toString(),"0",2)
+ leftFill(today.getDate().toString(),"0",2)
+ leftFill(today.getHours().toString(),"0",2)
+ leftFill(today.getMinutes().toString(),"0",2)
+ leftFill(today.getSeconds().toString(),"0",2)
+ leftFill(today.getMilliseconds().toString(),"0",3);
return dateString;

}//getDateString

// This function will take a string (1-3 characters)
// and right justify it with fill characters padded to the left for the width required.
// Designed for use with Date/time fields 1, 2 or 3 in length
// if it is called on the wrong size inString it will return the correct size field of fill chars
private function leftFill(inString:String, fillChar:String, fieldWidth:Number):String
{
//make sure the fill character is only one character long!
var fill = fillChar.substr(0,1);
if (inString.length == fieldWidth)
{
return inString;
}
else if (inString.length == fieldWidth-1)
{
return fill + inString;
}
else if (inString.length == fieldWidth-2)
{
return fill + fill + inString;
}
else
{
return ((fill + fill + fill).substr(0,fieldWidth));
}
}//leftFill

removeString: ActionScript 2.0 function to remove delimited strings

This function is quite useful.
It will remove strings that are delimited by known characters, any number of times from a target string. For example to remove all the markups in an XML node and just leave the text, call it with this snippet:
tempString = pNode.toString();
while (tempString.indexOf("<") != -1) {
tempString = removeString(tempString,"<",">");
}

function removeString(input:String, sDelim:String, 
eDelim:String):String {
var startIndex:Number = 0;
var sDelimIndex:Number = input.indexOf(sDelim);
var eDelimIndex:Number = input.indexOf(eDelim);
var endIndex:Number = input.length-1;

var output:String = "";

if (input == undefined ||
input == "" ||
sDelimIndex != -1) {
//get the substring before the delimiter, if any
if (startIndex < sDelimIndex) {
output += input.substring(startIndex,sDelimIndex);
}
if (eDelimIndex != -1) { // if any end delim
// get the substring after the delimiter, if any
if (eDelimIndex < endIndex) {
output += input.substring(eDelimIndex+1,endIndex+1);
}
}
}
else {
//nothing to be done
output = input;
}
return output;
}

Wednesday, November 7, 2007

Spam going down

Is it me, or has the level of spam gone down?

Gmail has a good spam filter (I've only had to mark 3-4 spam messages in the last few months). But I do scan the list of spam in case there are any false positives (only one, years ago). In doing so I had noticed that the level of spam was going up and up and the subject was largely what is delicately called "enlarging one's manhood".

As an aside, I have never, ever, had trouble enlarging a man's penis at will, by at least four inches (10 cm). And it only takes a minute or so, not four weeks...ahem.

Anyhoo, I was reading in the Economist that a second Russian spammer within a year or so had been assassinated (hooray!*). Guy was making a couple of mil a year spamming on behalf of dodgy on-line pharma-product outlets.

However, in the last couple of days, I have noticed the torrent of spam is less...perhaps it's just me, but in 3 days I have only 18 messages, and the profile is this:

Watches: 2
Penis enlargement: 7
Pharmacy: 6
Make money/loans: 3

So penis enlargement is definitely going down.



* I have never been, nor ever will be, an advocate for the death penalty, except for spammers. They are the worst kind of parasites and should be put down. More in another post.

Flash: You're _so_ modal!

It's interesting to pick up and try to use a technology after it's been around for a while. Back in the '90's I had the experience with Microsoft tools, but since then I have been working in Java web technologies starting from when they were fairly new.

I have spent the last few months digging into Flash development, learning the IDE (CS3) and ActionScript. The IDE is fairly strange and rather old-fashioned feeling. Perhaps it's just a different way of thinking from the "Dreaming in code" text-based world of conventional programming.

Flash is extraordinarily powerful in some respects but, in my opinion, lends itself to poor design decisions, less than easily supportable code and lots of maintenance headaches. All the more work for developers in the future, I think!

Some areas of the IDE have been neglected, the ActionScript editor and the debugger most prominently. Modal search boxes that have to be dismissed...grrr!

I have been guided by our new Flash designer, Derek. He can really do amazing things using Flash to create visual components and interactive demos etc. He's been working in this tool since the advent of Flash, focussed on the visual aspects, less on the programming ones. However, I would not have easily discovered some of the more esoteric things without him.

The most irritating thing about the whole experience, and this might seem petty, is that Flash is so...modal...everything that is does (publish, test movie, debug movie) takes control of the entire computer. It's all about you, isn't it, Flash? An incoming IM which takes focus in the middle of a Flash publish (compile/build movie) can crash the IDE! You cannot start publishing a big movie and switch to another window...Flash doesn't play well with others.

I'm told that until recently one couldn't run anything else on a development workstation except Flash. Resource hog...however we have an OS that can do multitasking windows and why should Flash be the one to say "Wait up everyone, I'm about to Publish a Movie! Stand back!!" Sounds like poor fundamental tool design to me. Very 1980's.

It's a clipper-ship technology. Huge, useful, really impressive, very elaborate and so on, but labour intensive, accident prone and inefficient. I hope there is a steamship coming up somewhere.

Derek's predecessor, Chris, who moved on to a better life in another place, tells me he is using some newer Adobe tool chains: Flex and ActionScript 3. More stuff to look into!

I have loaded ASDT into Eclipse and this helps a lot when editing ActionScript. However for the price that Adobe charges for their tools, am I wrong to expect more?

Thursday, October 18, 2007

Typing codes for special character symbols

The symbols for special characters can be typed on a normal keyboard by holding down the Alt key and typing the 4 digit decimal character code on the numeric keypad (with Num Lock on).

These are not the same as the key codes generated by the keyboard when you type, but are the Unicode (formerly ASCII) representation of the characters.

Some useful character codes:

© - 0169 (also hex 00A9)
® - 0174 (00AE)

à - 0224 (00E0)
ç - 0231 (00E7)
è - 0232 (00E8)
é - 0233 (00E9)
ê - 0234 (00EA)
ë - 0235 (00EB)

÷ - 0247 (00F7)
x² (squared) - 0178 (00B2)
x³ (cubed) - 0179 (00B3)
µ (micro) - 0181 (00B5)
¼ - 0188 (00BB)
½ - 0189 (00BC)
¾ - 0190 (00BD)

For full information about characters and codes see the Unicode web site.
The codes in PDF form are in the code charts section. The ones I use most are Basic Latin and Latin-1.

The proof-readers are a different bunch...

DOS commands for Windows

Some information about how to use windows command line commands. Some of this is actually useful.

For a Windows DOS-type command box (Start button | Run | cmd)

Windows folders, directories and filenames
The command line operates by default at a command line pointer, that is at a particular folder, on each drive. This is the command line prompt. Example, C:\temp>, commands will operate in this folder.

cd fred will change the directory setting to C:\temp\fred>
cd.. command moves up one directory level (back to C:\temp>)
d: command moves the command line pointer to the d drive (at the directory previously set for that).

Hierarchical folder (directory) names are separated by \ (contrary to Unix and web "folders").

/ is used for command switches for example: dir /w c:\t*

Most filenames have a three-letter "file extension" for historical reasons, file.txt for example.

*.* is the wildcard for file name match to anything (any name, any file extension).
*.txt for any file with extension txt

The following keys are sometimes useful in command line commands

Enter
submit the current command line to DOS and add it to the command line buffer at the end.
Left/Right arrow
moves cursor in the command line by one character left or right
Ctrl+Left/Right arrow
move cursor left or right to next word of cmd line (words separated by spaces)
End/Home
puts cursor at start or end of current line
Ctrl+Home
delete from current cursor position to start of current cmd line
Ctrl+End
delete from current cursor position to end of current cmd line
Delete
delete next character - that which is under the cursor
Ctrl+H/Backspace
deletes previous character - to left of cursor
Insert
toggle Overstrike/Insert mode. Overstrike will overwrite at the cursor. Insert will insert to the left of the cursor
ALT+ENTER
takes your command prompt to fullscreen mode and back again

Moving through the command line buffer
- repeating previous commands (or bits of them)
Up/Down arrow keys
move through the command lines buffer one line at a time.
Up goes to previous, Down goes to next (or nothing if we're viewing the last one)
PageUp
moves to first command in command line buffer
PageDown
moves to last command in command line buffer
F7
pops up your command history list, navigate with the up/down arrow keys and use Enter to select an entry
F9
brings up a dialog to enter the required number of the command from the buffer to be repeated
F1
brings up the next character of the previous command (starting at the first one)

Tab completion of commands is supported
For example, type edit *.ini then hit TAB to iterate through all matches.
Use SHIFT+TAB to move to the previous match.
This works for partial filenames as you would expect, and in all commands.

You can change the size of the command line buffer
Right-mouse on cmd.exe window title bar, then Properties | Options | Command history | Buffer size:

If a window output is going too fast to read, or a program is out of control
Ctrl+C will terminate the program (make sure you have clicked on this window to get focus!)
Ctrl+S will pause the output
Ctrl+Q will restart the output

Other stuff that has not been particularly useful
Ctrl+C clears the current command line
Ctrl+I insert a tab in the command line at current position
Ctrl+M Same as Enter key or CR (submit the current DOS command)
Ctrl+S Stop - ignores next keystroke

Continue (pagination shows --MORE--) Enter key (default is no pagination)

Copy and paste Window contents
Mark (right mouse, choose Mark)
start capturing a selection using the left mouse key & dragging.
End selection using Enter key.

Copy and paste into the command line
You can drag n' drop files or folders from an explorer window into a command prompt; this inserts the quoted path as if you had manually pasted it.
Ctrl+V does not paste into the command line, you have to Right click and select paste.

Dos commands help
help gives list of windows cmd line commands
help the_cmd give details about that command e.g. HELP DIR

Windows folders, directories and filenames
The command line operates by default at a command line pointer, that is at a particular folder, on each drive. This is the command line prompt. Example, C:\temp>, commands will operate in this folder.

cd fred will change the directory setting to C:\temp\fred>
cd.. command moves up one directory level (back to C:\temp>)
d: command moves the command line pointer to the d drive (at the directory previously set for that).

Hierarchical folder (directory) names are separated by \ (contrary to Unix and web "folders").

/ is used for command switches for example: dir /w c:\t*

Most filenames have a three-letter "file extension" for historical reasons, file.txt for example.

*.* is the wildcard for file name match to anything (any name, any file extension).
*.txt for any file with extension txt

Tuesday, October 9, 2007

IDEs: Eclipse and MyEclipse

My first Java IDE was a free version of JBuilder. After the dotcom/telecom meltdown, I spent 3 months with this IDE, learning Java while doing a pro bono project with a social worker from Northern Quebec. It was pretty good for the time.

When I started working for my current employers, they had standardized on IntelliJ-IDEA, which was a very good tool by comparison. However it cost a lot of money per person (some hundreds of dollars) and because we were cheap (or broke) we didn't upgrade at all. After a few years the tool was very out-of-date.

At that point 3 years ago, we decided to use Eclipse. IDEA would have cost too much when we had 10 developers. Eclipse had the tempting promise of being open source and more importantly free!

I must say it has lived up to the promise. It is a wonderful developer tool. The great thing about open source is that there are many plug-ins available that are really useful. Some are free, some are commercial, but relatively cheap.

The bad thing about open source is that things that work can get broken when you upgrade. For example I once had a really nice combination of Eclipse, Subversion (Subclipse) integrated with the Eclipse Navigator tool showing file decorations, version numbers, authors, dates, etc.. When I upgraded my Subversion client (Tortoise) a while ago, this all stopped working, in spite of many attempts to fix it. Pooh. Never mind.

One nice commercial integration is MyEclipse. I fell in love with this because of the jsp debugging (breakpoints!) and some nice XML editor features. Recommended. $30-50 per year and it's well worth it. They also bundle the full Eclipse download if you want it.

So, some free plug-ins I use quite often:
The paid-for plug-in (IDE suite):

Windows Quick Launch management and obsolete links

Our sainted IT person, Sean the Magnificent, removed a network drive from our Windows network and caused all the system desktops to go nuts, presumably hunting for the lost resource ad infinitum...

Over the course of 2 days, my system crept to a halt. Finally Sean told me to edit the registry to remove all the occurrences of the offending drive name...aack!

Using regedit to edit the registry is like going into an abbatoir in satin ballet shoes! No...perhaps doing brain surgery with a teaspoon... not to be undertaken by the faint of heart.

Anyway After deleting about 90 entries...and removing references in the "Network Places" thingy, everything was back to normal...or so it seemed.

After about 2 weeks I started tidying up the Quick Launch part of my Toolbar (being lazy I like to have about 40 items in here). Any obsolete shortcuts here that referred to the removed drive could not be removed directly via the Quick Launch icons. Clicking on the or right clicking on them caused the machine to go have a little think for a long while. And then did nothing.

Hmm...so we open up the C:\Documents and Settings\[your.name]\Application Data\Microsoft\Internet Explorer\Quick Launch "folder" and remove them there. Silly Windows.

Contributors

St Lawrence Rowing

Test content from SLRC