Posts Tagged ‘Work’

VBScript function IsNumeric

August 18th, 2009 No comments


Last night, we discovered that the VBScript function “IsNumeric” is a little more clever than you’d like, but there’s also no simpler version either.

Consider the following scenario.

We have the user input in a bit of text on screen. We need to process that (client-side), and part of that processing needs to find out if it is a number or not (i.e. if it’s a number, do this, otherwise, do that.)

Last night, we encountered a problem with the word “65d1” – clearly, it’s not a number (the “d” gives that away,) however, IsNumeric says that it is. If you CInt(“65d1”) you get 650. WTF?

A little more testing reveals the following:

CInt("65d0")  => 65
CInt("65d1")  => 650
CInt("65d2")  => 6500
CInt("65d-1") => 6

So obviously that “d” refers to “*(10 ^ following number)” – however, I can’t find a reference for that.

A bit of googling turns up this page , which shows that adding a space at the front doesn’t stop it from being classed as numeric.

The only real clue to what is going on is to read, and interpret, the MSDN reference page which states:

Returns a Boolean value indicating whether an expression can be evaluated as a number.

And there-in lies the answer – that expression can be evaluated as a number, not that it is a number.

Fortunately, there is an implementation listed on the first page which shows you an alternative way to get the job done.

I’m now wondering if there are other things that you can enter that will affect an number in that way. I tried


but that just errored. I’m wondering whether “e” has a similar effect.

Update: Yes, “e” (at first glance) appears to have an identical effect to “d”.

CInt("65D1") => 650
CInt("65D1") => 6500
CInt("65E1") => 650
CInt("65E1") => 6500

Debugging Client-Side VBScript

August 4th, 2009 No comments

Having used client-side VBScript for years at work, I discovered the joys of the Microsoft Script Debugger several years ago. Unfortunately, until now, I’ve been unable to get the debugger to invoke when I desired (rather than having to wait for a crash!)

Several times, I ran across web pages saying that you just type “debugger” – however that only works with Javascript and not VBScript. I also found loads of references to Server-side debugger with ASP.Net – again that doesn’t work with client side.

But, finally, today I managed to find an article which actually explains the process, and marvellously, it’s not difficult and it’s (logically) a one liner.

So I can reveal that to invoke the debugger in client-side VBScript, all you type is…..



Getting Fed Up With Word

January 8th, 2009 No comments

The past few weeks, I’ve had to use Microsoft Word a bit so that I can write up some specifications for other people to review, comment, enhance, reword, approve, you name it.

I am now soooo fed up with Word, it’s unbelievable.

The problem is, you can change things. There’s no structure system that you can use to force a document to do exactly what you want. Instead, you’re left with a series of stupid handling issues which lead to inconsistent documents across a department and people banging their heads on their desks in frustration.

Take, for example, my incident yesterday. Having reworked an existing specification from the ground up, I found cause to delete the final section of the document. This section was in landscape orientation, not portrait, because it contained some screen mock-ups (no complaint there). When I came to delete the sections, it changed every single section to be landscape, and changed the Page Header to be something completely different – in fact, it changed it to something that was not visible in the document to begin with, so I couldn’t even correct that.

I remember getting frustrated about this kind of thing before. That was whilst I was doing my final year project for my degree. I switched from Word to LyX.

Using LyX worked great for me, and I couldn’t have produced my final report without it, but I don’t think it would work in an office environment.

I think too many people are used to WYSIWYG, and not WYSIWYM (What You See Is What You Mean), and so would be constantly frustrated with the inability to see what your document looks like in Real-Time.

What I would love, is a cross between the two.

I would love to be able to create a rigidly structured document, where no one can change the text position, change the font, change the font size, mess with headers, etc – at least not without having to update a template. But as I’m typing, I’d love to see what that document would look like once printed, not the LyX modus operandi of “enter text, preview the DVI file”.

Couple that with a few more features, such as Word’s “Track Changes” and LyX’s far superior cross-reference and footnote handling, and you’re on to a definite winner.

Finally, just because you have to work with the rest of the world, some form of export to Microsoft Word format would be great.

Hey, Rich, feel like resurrecting “SLaTe”?


Ooh, apparently LyX now supports “Track Changes”. A lot can happen when you don’t use a bit of software for 6 years!

Categories: Computers, Work Tags: , ,

An Interesting Morning

July 3rd, 2006 1 comment

Well, I’ve had an interesting morning so far!

Mondays I get up at half five so that I can go to the gym before work. I got up, washed/shaved/etc, left the house, drove to the petrol station. As I was driving away from the petrol station, on my way to work, someone said on the radio “And there’s still a heatwave in the south today.”

That made me think “Hmmm, I was going to put a short sleeved shirt in for work.” Then I realised…. “Shit! I haven’t put a shirt in my car! Shit! I didn’t put any trousers in either!”. Had to turn around and go home again.

Then, when I got to work, my security pass wouldn’t let me in past reception. Fortunately, the Facilities Management Director walked past me. I said “Hi, Paul. Sorry to bother you, but my card won’t let me in”. He asked for my card, looked at the name and the picture on it, but his response amazed me:Oh yeah, we played around a bit with the system on Friday. We took you off.

I refrained from asking “Why? Why the hell did you do that??? And why, for god’s sake, didn’t you put me back on again!!!!”.

Strangely, neither of these two events have managed to destroy my insanely cheery mood today.

It gets better, the following day, I was delivered a brand new swipe card! Except the old one still works! Got two now! Woohoo!
Categories: Uncategorised Tags: ,

London to Brighton Bike Ride

June 19th, 2006 No comments


Along with another 26999 people (of which, 7 others were from my company), yesterday I successfully completed the London to Brighton Bike Ride!

We managed to cycle the 55 miles from Clapham Common to Madeira Drive in Brighton in about eight and a half hours, and I’ve personally managed a pleasing £150 in sponsorship for the British Heart Foundation!

Despite the fact that I ache like a bastard this morning, I’m definitely going to do it next year, and hopefully raise even more!

I was quite surprised how much I’ve actually enjoyed it, and how brilliant the whole atmosphere was. I was expecting it to be just people cycling, and cycling, and cycling, and …, but it wasn’t really. The best bit was realising people were cycling down towing loudspeakers attached to an iPod and playing out their CD collections – that really cheered me up! And a big thank you must go out to the kids that lined the streets and soaked me with their water pistols – it was welcome relief in the heat!

Categories: Uncategorised Tags: ,

I Now Know How Scott Adams Feels

April 7th, 2006 No comments

Scott Adams, of Dilbert fame, recently wrote about the hassles of moving office.

I now know exactly what he meant. Today is my last day in my current office.

Our whole company’s head office operation is moving from the two office blocks where we are currently, to two completely separate offices. The blocks are obviously newer, nicer, and will allow future growth (much more than we can at the moment). The move to one of the new offices is completed, and I’m in the first wave of people heading over to our new offices.

I don’t think I’m going to like the new offices though. They may be newer and nicer, but we lose all of the benefits of our current location. Let me give you an example of what I mean:

Current Office Benefits:

  • Reasonable offices
  • Ten minute walk from reasonable size town centre, which has many shops I need “everyday” – e.g. Woolworths, Boots, WHSmiths, card shops, supermarket, etc
  • Ten minute walk from gym
  • Reasonable traffic congestion in the morning, but no real issues
  • Free on site canteen serving full meals
  • Access to the people in other departments we work with
  • Can escape office at lunch time to town, just to look around
  • Plus many more

Compared to New Office:

  • Nice new offices. Too small for our large department though, will be sqaushed in
  • 20 Minute drive from town centre where the shops are
  • Can get to other shops easier, but they will be much more expensive beause of their location
  • No gym for miles
  • Nightmare area to get in to in the mornings, and out of at night
  • “Deli bar” serving cold food only
  • The people we need to work with, are staying on this site
  • No where to go at lunch time. It’s a commercial estate, so just office buildings
  • Other benefits? None really

Not sure I’m going to like this.

Categories: Uncategorised Tags:

The Grand National

April 7th, 2006 No comments

Well, it was time for the Annual “Office Grand National Sweepstakes” – for £2, you can pick a horse. Person who picks the winner, wins the money.

So, I’ve pulled a reasonable mount, “Jack High”, so I should at least do a little better than the last couple of times (I don’t think I’ve had a horse finish yet!).

Categories: Uncategorised Tags:

IT Graduates Not Happy With Courses

January 11th, 2006 1 comment

Apparently 46% (in this survey, at least) of UK IT Graduates are not happy with their courses saying that they failed to prepare them for working in “the real world”.

I would sit myself firmly in the 54% of the other Graduates that are happy with what I did at University. I think that may be the 46% were not aware of what they have been taught:Graduates were disappointed they were not taught Java and .NET – despite demand for them in the commercial sector.This makes me think that they have made an oversight. I was taught several languages at University, but only briefly touched on Java, and had no (at University, at least) experience of working with Microsoft .Net. The fact that both of these products (along with other, important, commercial products such as Oracle) are now available as a free download which these graduates could go to learn on their own, is not stated.

Even though I wasn’t taught them fully, I feel that I would not have a problem with switching to these languages. Why? Because I was taught how to program, not how to program in X, Y, or Z languages. The skills are very transferable, if you put your mind to it (incidentally, I am not stating that all programming languages are the same – they are not, but many ideas and concepts do, readily, transfer).

Let me put this into the context of an analogy:

Imagine that, at University, you were taught to drive a car. You were taught what all the pedals were for, how to steer, when to change gear, how to drive in traffic, the whole lot; except the only car the University had available for you to drive and to practice in was, for example, a Honda, and sometimes there was a Vauxhall on offer if you took the right course in your third year.

You then graduate from University, and start looking for a job, advertising yourself as a “driver”, as there is little need for a specific “Honda Only driver (with some experience of Vauxhalls)”.

When you get to your job, you are asked to drive a Ford.

When you immediately get into the car, most things are the same, and you can more-or-less start driving straight away. OK, every now and again, you forget where the windscreen washer is, or it takes you a bit of time to get used to the gear box, but after a while you are driving well. Could you then say that you felt disappointed because your University did not teach you to drive a Ford? Most things are the same, except for a few little levers and things, but the principles are all exactly the same.

University is not about learning specifics – it is about learning principles. The problem with principles though, is that you can’t use “principles”, you have to use an implementation of those principles, which may have included, changed or excluded those principles at will.

Ignoring those principles, and only absorbing implementation specifics is a unwise thing to do.

Categories: Uncategorised Tags: , ,

Christmas Is Over

January 5th, 2006 No comments

… at work at least.

We spent 5 minutes this morning tearing down the decorations, which will probably end up in the bin – we are moving offices this year, and we won’t have anywhere to store them until next Christmas, so we will probably have to buy a new set then too.

It seems to have gone incredibly quickly this year (or 2005 at least). Last year’s Christmas seemed to last forever, where as this time, its flown by. Must be getting old.

Categories: Uncategorised Tags: , ,

Office Gossip

December 21st, 2005 No comments

I love it when things get heated in an office. People run around trying to “solve” problems like it is a playground.


Categories: Uncategorised Tags: