Category Archives: 2864

Useful Wacom tablet

A couple of years I got a Wacom tablet. It was a gift – not really the type of thing I think I would’ve bought, but it was definitely nice to get. Since then, I’ve found it incredibly useful, and it’s become almost a permanent fixture in my bag.

For a start, it’s a great way of being able to ink up documents in ways that I can’t do with my regular laptop (I don’t own a Tablet PC, but inking is still useful from time to time).

tabletBut I also find that it’s really useful when I’m teaching or doing any kind of presentation. There are often times when I want to draw some sort of diagram. Having a diagram pre-canned can be useful, but it’s great to draw a diagram in front of the audience. Something about them watch you construct it helps them. If I have a regular whiteboard, then I’ll use that, but if it’s a diagram that I want to be able to refer back to, then I either have to find a part of the whiteboard which I don’t want to use again, or else I can pull out my Wacom tablet and pull up Paint.Net. The pen is touch-sensitive, so it draws a grey line if I’m drawing lightly and a black one if I’m drawing heavier. And I can always switch back to one I drew earlier, and add to it, correct it, whatever. I can even email the diagram to students who want it (but that’s not something I do regularly). It also goes really nicely with ZoomIt, which I use all the time to point out the detail in screens.

I do walk around a fair bit when I’m teaching though, and I notice it when I’m restricted (like when I’m using my Wacom tablet via a USB cable). My plan is to one day get one of the Bluetooth ones that Wacom have, and see if it’s different. I won’t be able to use it in aeroplanes, but I can imagine passing it to those students who don’t want to get up to write on the whiteboard (which I do from time to time in my classes).

Sidebar monitoring of SQL databases

A while back I discussed using the Windows Vista Sidebar to display useful information about applications. This led to other conversations, including one with fellow SQL MVP (and Leeds United fan – sorry to hear about the 15 points, mate) Jamie Thomson about monitoring important SQL database statistics using sidebar gadgets. I didn’t give it much thought, because I still had my PowerGadgets solution in place, monitoring all kinds of things based on my own queries. (Personally, I like using ‘union all’ queries. This lets me get a nice collection of numbers for showing in a graph. But I also find that I can easily have a number produced for displaying in a gauge.)

But Jamie has taken this further, and produced a Sidebar gadget to monitor various database statistics. It doesn’t use PowerGadgets, so it’s completely free. You can grab it from his blog at, or the original version from Great work, Jamie!

Cricket PowerGadget

I was thinking about PowerShell and how you can get it to do fantastic things. And I wondered how easily it could be used for scraping cricket scores.

So I threw together four lines of code to grab the cricket scoreboard from cricinfo and rip out the title.

$ret = (new-object Net.WebClient).DownloadString(“;wrappertype=mainframe”)
$titlestart = [Regex]::Matches($ret,”<title>”,”IgnoreCase”)[0].Index
$titleend = [Regex]::Matches($ret,”</title>”,”IgnoreCase”)[0].Index

Edited: This can be done easily in one line – Lars pointed out the use of Regex to grab the section between the title tags, which then means we don’t need to store $ret at all. It can now be:

[Regex]::Match((new-object Net.WebClient).DownloadString(“;wrappertype=mainframe”),”<title>(.*)</title>”,”IgnoreCase”).Groups[1].Value

It’s not particularly elegant, but it works nicely. I would’ve liked to have handled the HTML as XML instead, and just gone straight to the Title tag, but there’s stuff in there that won’t convert to XML, so I guess that option wasn’t available.

And the really nice thing about this is that I can put these four lines into PowerGadgets, and in all of 10 seconds have a floating gadget which I can use in XP as well as Vista, and (in Vista) put in the sidebar if I want. I’ve told it to refresh every minute, which won’t refresh as quick as some, but hopefully won’t stop working too quickly. It’s not quite as nifty as Darren Neimke’s gadget, but then again, this was really really quick to throw together.

And of course, I’ve left the advert for Cricinfo in there. I wouldn’t want to hide the source of the information. And if they ask me not to do this, then of course I’ll stop. Cricinfo have a great site, and I really don’t want to upset them.


Cricket gadget

Being English, I’m finding this Ashes series quite depressing. I updated the Wikipedia site to say that Australia had won the series 3-0, but took no joy in doing so. It’s not often you get to update Wikipedia with information about a live event – but this time I did.

I’ve been following the cricket by either listening to the radio, watching a TV-stream, or keeping half an eye on the cricinfo site which updates the score in the title of a browser window. Doesn’t work so well now that tabbed browsing is all the rage, but it’s still useful. Not as useful as having a Vista sidebar gadget do it for me though. So one day when I was at home during a test (must’ve been Perth), I played around at making a gadget that would display the cricket score. I could get the score easily enough by just putting a http-request in to the cricinfo site and pulling out the title. I had it displaying happily for a few minutes, and set about making it look nicer and making some sort of a settings bar to be able to follow whichever match was of the most interest, when it just stopped working. I guess cricinfo have something to detect screen-scraping which then stops the page being served. When you look at the page in a browser, it redirects to a framed version, and I guess there is something to make sure that the framed version is requested (along with all the right adverts) with an appropriate frequency compared to the page which contains the score.

At this point I stopped trying… I had other things to do like gardening.

Today I see that Darren is asking the ABC for a cricket gadget. I think cricinfo could provide one too, and provide some competition here. It would be so simple for them to put together… alternatively, they could provide a web service that presented the information and let the rest of the world put it together (along with gadgets, RSS feeds of game milestones, etc), but I imagine that like most sports scores, there are licensing issues involved.

Application monitoring in 20 seconds with PowerGadgets

Performance Monitoring is great, but unless you’ve made a bunch of custom monitors, it doesn’t really tell you the health of your application. Well, not completely.

For example, take wHooiz – Cameron and Clarke’s profile tool. I’m sure they have various things running to to persuade them that their system is ticking along nicely. But that doesn’t tell them whether their marketing is working. It doesn’t tell them if their application is actually happy and successful. There may be no 404s in site, but if no-one is using the thing, then they’re failing. Luckily for them, they seem to be having a great deal of success. I’m sure if you go there, you’ll find out they’re giving away a Nintendo Wii soon. But wait until that competition is over before you start using wHooiz, because I want to win it.

To find out if they’re doing well, these guys run a query on their database which shows them how many people have registered. Currently it’s about 125. If the site is going well, it might be 130 by the time I’ve finished writing this, and 200 by the time you’re reading it. Or maybe my blog is really popular and you’re reading this while it’s only 131, who knows?… but Cam and Clarke should know. For the sake of their confidence in their application, they should be seeing a number tick over in the corner of their eye… maybe in their sidebar!

And this is where PowerGadgets comes in. And you don’t even need a sidebar to have PowerGadgets do its thing – it works just fine in XP as well, floating around the desktop, on top of your applications if you want.

So go and download (and install) the evaluation copy, and walk with me for a moment. Counting the seconds, we…

1… 2… find the “PowerGadgets Creator” in the Start Menu and click it… 4… 5…

Pick “Digital Panel” from the list presented in the screen that opens up, and then the SQL option in the next pane. (Don’t bother taking the time to notice that you can very quickly use maps, gauges, charts, or get your data from Web Services or PowerShell – that’s not part of the 20 seconds)… 8…

Enter the database connection details (all us developers know how to do this really quickly, right, but let’s assume it took you three seconds)… 11… 12…

Now paste in the SQL statement you prepared earlier, something like “select count(*) from dbo.PeopleRegistered”. 14…

Ooh, there’s the result of the query in a nice digital format… but we’re not done yet.

Let’s click the “Data Refresh Rate” button, and leave the default of “1 minute” (or whatever you want… 5 seconds if you want to see something happening more often).

15… Change the “Display in” option to Desktop, and hit Save. 17… Give it a name, 18…samplepowergadget

And you’re done. Take the remaining time to launch it and see your numbers happily changing each minute.

Ok, so you might want to explore the options some more, and take a whole minute over it. Alternatively, you might want to pipe the results of a PowerShell script straight into out-gauge or out-chart, possibly using the -configure option to give you more options when you do. Or then pipe the result of out-chart into an email, and see it arrive in your Inbox with a pretty graph!

It costs about US$300 for the tools to make this, which is probably worth it when you consider the time you’ll save. The licence to display a PowerGadget is about US$70, but if you can show someone this easily that their application is working (or that they’re making sales, or whatever), then I’m sure they’ll happily part with that too.

Whooiz my Friendz?

Observant people will have noticed a friend-list appear on the side of my blog. Changing my blog around is way overdue for me. I need to take a few hours out some time and work on the CSS. I still don’t have all the useful stuff that I had at my old blog site. One of those is a friend-list. I’ve never actually been a fan of friend-lists. I hate the idea of missing people out. And I think that’s where Whooiz can come in.

Whooiz is a start-up by Clarke (I want to call him Monkey, but I won’t) and Cameron, and the idea about it is to be able to keep your profile information in one place, linking to it as you require. It’s a nice idea – I know that I keep a list of places who know my address, so that if I move I can make sure that I let them all know. Whooiz might help for keeping profile stuff up to date. Of course, it would be nice if it could do it behind the scenes, so that you go to LinkedIn or FriendsReunited and just see text there as if you had entered it, except that it’s actually populated by a call to whooiz. That would work really well for me, although I’m sure those other sites would need to tweak their systems to actually allow it. Perhaps Whooiz could partner with them, and sites could start to be ‘powered by whooiz’.

Another thing I want is to be able to have full control over the display of my profile, friends list, contact information, etc. I’ve got my friends list appearing over to the side, and I’ve set the heading colour and background to be the same colour as the background that I have there. But what I’d rather do is to tell the heading not to display. I’d also like to change the font of the text which says who the people are, even have the names removed, replacing them with alt and title text for the images, or put them underneath the images… have the images in two columns perhaps, that kind of thing. All feasible with CSS. Even have Whooiz give me the details in XML, and then let me use my own JavaScript to place them. The list shows a random <some number> friends (friendz?) from my list, and it could be neat to have a call to give me a new random friend that isn’t currently displayed (I don’t mean making new friends, I mean just grabbing one of my existing friends for displaying). Then I could have a bit of JavaScript (or have Whooiz provide it) so that my friend list could sit their cycling through them. I could put them into a (or sidebar) gadget – kind of like a “how longz it been?” list, prompting me to catch up with friends I haven’t contacted for a while.

I like things like whooiz – the possibilities are cool. I just need to come with the starting ideas myself, instead of finding ways to help improve others’.