Thursday, December 30, 2004

Back to Reality

Just got back from a few days in Plymouth. Went down to be jolly for a bit (since 'tis the season).

Did some cool stuff, saw plenty of friends and family and whatnot. Now I've got a few more days until I go back to work. Feels a bit weird today, though. Apart from anything else, I can't type any more, it seems. What a bugger. What can I say, nearly a week away from a keyboard really takes it out of you.

And I guess it being a ver boozy week doesn't help. Think I woke up with a week's worth of DT's this morning. Yow.

Wednesday, December 22, 2004

My true love has a bigger house than me

Actually, that's not true. My true love lives with me.

But really, if on day 1 my true love gave me a partridge in a pear tree (gee, thanks hun!), and then on day 2 gave me 2 turtle doves (eh?) and another partridge, in another pear tree, I'd be getting suspicious. And cramped.

But what the heck am I going to do with:

12 Partidges (all in their accompanying pear trees)
22 Turtle Doves
30 French Hens
36 Calling birds (just think of the racket!)
40 Gold Rings (Okay, the ones I can't pawn, I can melt down)
42 Geese-a-laying (lucky old geese!)
42 Swans-a-Swimming (Where? Who's got a pond big enough for a flock of swans?)
40 Maids-a-Milking (No cows though. Best leave that one there, I think...)
36 Ladies Dancing (Now you're speaking my language!)
30 Lords-a-Leaping (36 ladies + 40 maids, and only 30 Lords. I like those odds!)
22 Pipers piping (The neighbors are going to have something to say about this...)
12 Drummers drumming (...And this!)

I can't fit them all in my flat. And who's going to pay for the upkeep? I mean, most iof the birds I can just feed seed, but Lords? They'll be wanting proper food for sure. Okay, I'm thinking in a while I'll have a surfeit of geese, but that'll take a little while to come through.

Drummers and pipers? Dammit! Do you reckon I can retrain them? Wouldn't it have been better to just give me 34 multi-skilled labourers? They can give me a hand cooking for the 106 other people I've got cluttering up my 1-bed flat.

A bit of forethought next time, I think.

'My True Love'. Hah! You don't know me at all, do you?

Just wanted to share.

Tuesday, December 21, 2004

Flamewars R teh 5uxx0rz

After having a quick flick through Peter Torr's firefox entry this morning, and seeing some of the slashdottery its attracting, I was reminded of this page about language and the web.

Monday, December 20, 2004

Another release of Paint.NET

Another release of Paint.NET 2.0 is out.

I love Paint.NET. I have great fun with it. Of course I don't use it for anything productive. I use it to illustrate stupid things I say at work. Or stupid things that roll around in my head. You see a trend here?

Yes. I am Stupid. NO!! That's not the trend I was thinking of. I don't use PDN for anything useful. I just use it for buggering about.

But I love it, though. I can do things so much cooler than with bog-standard paint.

And it's a student project. That's my favourite part. A Student Project! That rules, man.

Juust wanted to share.

Doh!!

Yes. I admit it. I got sucked in. I went to the FireFox website, downloaded it, installed one or two extensions, and am happily enjoying the slightly (only slightly, mind) nicer user experience it gives of surfing the web (Except for Rory's site. It still doesn't like it.)

What a fool I've been. Fool, Fool, Fool, I tell you.

And this is why.

Quick Distraction

Now for the past week or so I've been plagued with a problem at work with some analysis I've been doing.

I've been looking at how people's giving has varied over 12 months (e.g. Has person x giving more or less in the past 12 months than in the previous 12 months?, that sort of thing.) In theory it's quite simple, make up a couple of views, one or two functions here and there. Job done. There was only one problem.

I had to use Access.

Normally I wouldn't be concerned about this. I use Access all the time. I grew up on it. But unfortunately, Access doesn't do things very quickly (if it does it at all) and neither does it enjoy long-running processes. It just locks your machine up and won't let it go until it's damned well good and ready.

This data I was working with was just using a single table, of some 500 000 rows. This caused one or two problems from the outset...

The number-crunching involved a function, 'Status', which was based on several factors (How much the supporter had given this year, how much last year, when the first started donating, stuff like that). Now I had a choice for this, neither options particularly appealing:

  1. Try to assemble this function in Access SQL using a whole bunch of nested IIF statements
  2. Do it with a VBA function
Well at first I opted for writing a VBA function. Boy was I misguided! What I hadn't taken into account was that actual cost of running a VBA function. It's just never been high enough to worry me before.

Draft 1 of this function was very bad - The function even needed to read data from the tables, so for every row, it would have to:
  • Compile the function
  • Start running the code
  • Open a connection to the database
  • read some data
  • Close the connection
  • Do some maths on the values pulled in
  • Finally spit out a result

Whoops. I didn't even try to time it. It was taking forever. I figured one of the big costs (at least one of the costs I could eliminate) was these calls back to the database, so I jigged abut with it, and added all the values it was reading as parameters. Fine. That made it a lot faster than it was before. Cool.

But not fast enough. It still took bloody ages to work through the table.

So I had an idea. 'Why not', I thought 'create a table from the resultset using an in-memory recordset?' So I did. I rewrote the code, so that it loaded up 2 or 3 recordsets and then (because as far as I know I can't use ADO.NET from VBA) go through iteratively and for each record do the maths and add the result to a table. 'Whoah!' I though. 'Just look at that performance boost. Lightning quick, that!' I manged to get the processing time down to a very nippy 30 mins. Woo Hoo!

30 minutes. That's just silly. I can't wait for 30 minutes for something to happen.

So I skived off work one afternoon (while everybody was at the office christmas party. What a geek!) and redid the whole thing on SQL Server. It rocked. Muli-statement Stored Procedures rule. User Defined Functions also rule.

And not just from a performance point of view, either. One of the big problems was trying to validate my queries. Making sure what was being produced was what I thought was being produced. Not that difficult, just a pain in the behind when you've got to wait 30 minutes to find out every time (and this was 30 minutes if I wasn't trying to use my machine at the same time. Longer otherwise!). Sprocs? No problem - I can go through my sproc and pull out the bit I'm trying to validate. Run that, and see if all is well. Takes seconds. Sweet.

And I've noticed something very fishy about Access' query designer. If you've got a nested subquery you're doing a join on, then it runs fine. Open it up in Design View, that works fine too. Your subquery appears in there as a table, same as usual. HOWEVER open the bugger up in SQL view, and you'll find Access has done something very very strange to it...

Well, it's not strange at all, just irritating because it stops it from working.

I started with this:
SELECT DISTINCT ThisYear.[Constituent ID], ThisYear.YearValue
FROM (SELECT Data.[Constituent ID], sum(Data.[Gift Amount]) as YearValue FROM Data where Data.[gift date] > #09/30/2003#
GROUP BY Data.[Constituent ID]
) AS ThisYear INNER JOIN (Select data.[Constituent ID] from data where data.[gift amount]>=100 AND Data.[Gift Date] > #10/01/1998#
) AS BigGivers ON ThisYear.[Constituent ID] = BigGivers.[Constituent ID]) LEFT JOIN [September 04] ON BigGivers.[Constituent ID] = [September 04].ConsID
WHERE ((([September 04].ConsID) Is Null));


Ugly, but the only way I could figure of doing it in a single SQL statement (rather than a series of separate queries). Open it up in the query designer, though, and this is what you get:
SELECT DISTINCT ThisYear.[Constituent ID], ThisYear.YearValue
FROM ([SELECT Data.[Constituent ID], sum(Data.[Gift Amount]) as YearValue FROM Data where Data.[gift date] > #09/30/2003#
GrOUP BY Data.[Constituent ID]
]. AS ThisYear INNER JOIN [Select data.[Constituent ID] from data where data.[gift amount]>=100 AND Data.[Gift Date] > #10/01/1998#
]. AS BigGivers ON ThisYear.[Constituent ID] = BigGivers.[Constituent ID]) LEFT JOIN [September 04] ON BigGivers.[Constituent ID] = [September 04].ConsID
WHERE ((([September 04].ConsID) Is Null));

Spot the difference. It took me a while to notice it, but the subqueries are losing their brackets. The surrounding '()' is being replace by '[].'. However Access doesn't notice this change until you edit the text. If you just open it in this view, and re-run the query, it works fine.

Edit the text, however, and you have to remember to change the brackets back to how they were initially, otherwise it throws an error.

Grrr. Like I said, it's more of an annoyance than anything else.

So that's what I've been doing lately. Sorry about the very long, very boring post.

I can get back to making my blogger client now...

Just wanted to share.

Sunday, December 19, 2004

A Public Apology

Whoops.

I would like to take this opportunity to apologise unreservedly for any offense caused by my previous artist's rendering of Carl Franklin with Geoff Maciolek's hair.

My brain at the time was running wild. The nice doctor people have since talked to me, and explained the error of my ways. Illustrating their arguments with the use of diagrams and electrodes, they have demonstrated to me that I was wrong to do what I done.

In true ET re-release style, I have re-worked the offending image:


Sorry.

Tuesday, December 14, 2004

Stop it children!!!

I don't know if it's because my parents didn't get divorced until I was 17 or if it's because I never win arguments, but I can spot a pointless argument when I see one.

The pointless argument I see happening at the moment is between Google's Desktop Search and Microsoft's MSN Toolbar suite.

Now while I'm all for technology that helps you organise your life (hell, I could do with a little of that myself), I just don't get the point of this competition. If there was some real commercial stuff (ie cold, hard cash) at stake, then sure, there's every reason for one company to outdo the other. And we, as consumers, would go with whichever product was right for us. Based on a whole load of different factors. Who made it being just one of them.

But the fact of the matter is that nobody's going to lose out on anything. Apart from anything else, both products are in beta, so neither of them are complete. Also, they're both free, so nobody's making money off them as yet.

Picture the scene in a little while. One of the 2 companies decides to release a paid version. Now there's one of 2 things that can happen.

  1. Everyone switches t the product that's still free
  2. Everyone just keeps using the Beta, or eval, or whatever you want to call it, free version, except for a few (and I'm guessing it'll be a very few) businesses who decide to pay for the license
So whoever starts charging for the software first will lose out, I reckon. Once that balance as shifted, if the other one starts charging, only then will there be any kind of level playing field, and by then, everyone will most likely just carry on using whichever they were using before.

So that's what I think. I think that nobody will win. Nobody will make any money off their search utilities, so which is 'better' is a moot point.

2 quick notes, though...
  1. I don't have either installed - to be honest, I don't have enough documents and email to warrant it. It would take me longer to find something with a swanky software widget than it would to just find it by looking for it
  2. I don't want to even think about wither com[any deciding that advertising revenue is the way forward. The thought of my computer being used to advertise stuff at me even more than t already does fills me with untold dread. I get enough of that on the web. I don't need it while I'm trying to work too...

Just wanted to share.

Monday, December 13, 2004

2 things...

I don't usually combine blog post subjects, but just for a change, I am today.

Firstly, Happy Birthday Mrs Mawoo. It was my girlfriend's birthday yesterday, so we both had a nice relaxed day in, she was istening to her new iPod mini (I got her the pink one) and getting that all sorted on my machine. And then we went out and had a rally nice meal. Lovely.

Secondly, I got this damned XML thing sorted. Admittedly it was a bit of a cop-out. The problem was that I couldn't work out how to pull a set of key-value pairs from the XML returned from a Blogger API method call.

Well I sorted it out with an XSLT. The XSL transforms the XML returned from Blogger to a format I can understand. Bit of a cop-out, I know, but such is life. I'll write about it at a bit more length shortly. Need to get the rest of it working before I get too excited...

Just wanted to get these things out of my head.

Friday, December 10, 2004

Been a bit quiet of late...

Well, no I haven't been quiet of late at all. I've been frantically blogging my heart out, but just about useless stuff.

In fact, I've had a look through my blog entries, and it would seem the last .net related post was nearly a fortnight ago!

I haven't stopped coding. In fact, I've just been working over the past couple of weeks on a client for the Blogger API. It's been quite slow going, though. It uses quite a few things that I just haven't really used before. Well. It uses one thing I haven't really taken the time to really look at. How .NET handles XML.

Although I like XML, I haven't really played about with it in itself. Sure, I can read my way through a file and get what's going on. I can even (at a push) knock up a simple XSL file to churn out some templated xml. When it comes to actually using the thing in an app, that's where the mystery begins...

If you take the time to look through the Blogger API, the returns from method calls look really weird! Here's a snippet:

<value>

<struct>
<member>
<name>url</name>
<value>http://stuff.foo.com/biz</value>
</member>
<member>
<name>blogid</name>
<value>2997323</value>
</member>
<member>
<name>blogName</name>
<value>Blogger Biz Dev</value>
</member>
</struct>
</value>

Now reading that's pretty straightforward. You've got a Struct element, inside a Value element, which contains a number of members, each of which has a Name element and a Value element.

Easy, huh?

For some reason, though, running that through an XML reader and parsing that down to a set of Name-Value pairs so I can create an object from it seems to be really hard! I dunno. I think it's just a heady combination of me not knowing enough about it, and the whole thing just hitting a blind spot in my head (Anyone else get them?).

The soution I've been trying to make work is by using nested XPathNodeIterator's to read through each member element, and populate a HashTable with the names and values, and create a BlogUserInfo ojbect from that.

Unfortunately I just can't get my head around whereabouts in the loop the values should be read off and the ojbect created. I'd post code, but it's really ugly. Once I get it working, then I can make it look pretty, but until then it's just a mess of temp variables and suchlike.

Oh well. Mrs Mawoo's off out tonight, so I should be able to have a bit of a sit down and spend some real time on the problem. No doubt, when I get it working, I'll let y'all know (I'll be that damned happy!).

Otherwise might just lose my patience over it and spend all night playing with SQL Server Analysis Services. I'm trying to get to grips with that at the moment. Lots of cramming. Lots of reading. Quite good fun, though.

ust wanted to share.

Thursday, December 09, 2004

Shameless Plug

Okay, so this has nothing to do with .NET at all. Not even a tenuous link to anything even .NET related.

It's just a shameless plug for a friend of a friend's website HagsHarlotsHeroines. It's a place for short stories that feature strong female characters.

check it out. And if you know any closet feminist writers, then get them to check it out too!

Just wanted to share.

Shock News!!!

This just in.

The shock revelation that 1/4 of us british men want to get broadband so we can have quicker, better quality and just plain more pr0n.

But I just wanted it for managing my household budget and maybe email now and again (fnar fnar!).

Wednesday, December 08, 2004

Pimp my Presenter

Now and again, some strange things happen in my head. There are some connections made in there that no one on god's green earth should ever make.

So I was listening to this week's Mondays. And this week, Carl Franklin was saying that he's got no style. And Geoff Maciolek (he of the fantastic hair) was saying a whole bunch of stuff about all sorts of things. And I thought.

Carl no style.

Geoff great hair.

Carl no style.

Geoff great hair.

And my addled and enfeebled brain came up with this mental image:



I am truly sorry, but it's been sat in my head all day...

EDIT: If you've come here from Carl's Blog then there's a wholehearted public apology here.

Can you make espresso with normal cooking coffee?

No. Eugh!

Monday, December 06, 2004

Going wit' da Flow

Roy Osherove and Scott Hanselman, to name but two, have recently blogged their list of tools they couldn't live without.

I also have lots of tools I couldn't live without. Here are my top must-have's to bear in mind, particularly coming up to the festive season...

  • Wreak havoc with the right tools!Screwdriver - Want to pop the back off your case because it's started making that horrible whining sound again? Need to take out an IDE drive to give it another tap on the side of the desk? What better tool to use than this functional beauty. Whips components out of a cheap box in literally just a few minutes. The perfect tool to help you while away a long rainy afternoon.

  • Need some time to think?Coffee grinder - Waiting for your friendly supplier to deliver that new drive to replace the one lying in bits next to your desk? Give your hands something to do with a fantastic Coffee Grinder. Works for all varieties of coffee, plus as an added bonus, drowns out the horrible whining sound you just tried to fix, but which seems to have got worse.

  • Quick - Hide it before anyone notices!Long-Nosed Pliers - Dropped something small but expensive-looking into the one area of your 'quality' case that you can't bend out of shape to find? (It's OK. With these modern wafer-thin tinfoil cases, you can pop it right back in!) Well not no more, with a pair of long-nosed pliers. Just a lick of the wrist and you can have the front end of them straight through the side exposing the lost object. Bonus Bonus!!!! Improves ventilation WHILST making your machine more accessible. Who could argue with that?

  • Sorts singed things.Glass of Water - Seen a bit of fire leap from your new case vent onto the carpet? Minimise injury or loss of property with a cup of water. Beautiful.

  • Do you think anyone'll notice?Glazier's Putty and Glass - Need to replace a computer-sized pane in your window? Nothing's more useful than glass and putty. It's almost as if it was made for it!

  • Keeps you nice and toasty!Sleeping bag - Not going to be allowed back in the house for a while? Need to wait for your significant other to change the locks back/cut you a new key? Stave off hypothermia with a nice snuggly sleeping bag. N.B. You might also need a rollmat and bivvy bag, depending on the season - There's nothing like being caught short with a sodden sleeping bag in the rainy season.
So they're my most useful tools. I wouldn't go anywhere without them.

Just wanted to share.

Saturday, December 04, 2004

New Blog to Check Out...

Actually, it's not a new blog at all. I've been reading Raymond Chen's blog for a few months now, and he's always good!

You ever see Kill Bill 2? Imagine Pai Mei, sat in an office, with nothing more pressing on his time than to blog. That's Raymond Chen.

I've never read a post from him that hasn't captivated me. I love his writing style too (that's what reminded me of Pai Mei!). Raymond Chen, I salute you!!

Just wanted to share.

Friday, December 03, 2004

So what's your brand like?

I've just been reading this article about managing your brand in real life.

Now I'm not quite sure what my brand is like. I act fairly consistently, I guess, but what bits of me are the bits that people are actually taking away? When People think 'Benjimawoo' what are they actually remembering?

I get the feeling round the office that I've been branded a bit of a nerd. And sadly I don't work in an office where they value nerds as highly as they should.

Oh well. Such is life. Guess I'm just going to have to start flogging my own brand of... erm... Something. Underwear? I guess. 'My other willy's a monster', that style of thing.

Just wanted to share.

Good things to do before you ask for help

Scott Hanselman's written a quick list of do's and don't's to go through before you ask for help.

It's something that I see quite a lot, not so much in newsgroups (I don't really subscribe to any) but more in the ASP.NET forums (where I've been a bit quiet of late. Mostly because of this).

Debugging's something that's easy to not do. I know there have been times when I've been confounded by something strange happening, pondering it for ages before stepping through my code and finding I'd made some sort of silly mistake (typos usually).

The one step I'd add, which I guess comes after debugging, but before asking for help is googling it. Whatever the problem is, it's very unlikely to be something that nobody's experienced and solved before.

Just wanted to share.

Thursday, December 02, 2004

Another reason why I won't be moving to Spaces just yet...

I just tried to show Mrs Mawoo the joy of blogging. I think MSN Spaces is quite well suited to people like Mrs Mawoo.

I'm afraid I'm with Scoble on its current shortcomings. Mrs Mawoo isn't, though.

She doesn't care about playing with CSS, HTML and all that. She just wants something she can set up in 2 minutes, drag some elements about the page and type away. Job done.

I know it's still only in Beta, and I know when it's unleashed on the world in toto it'll be much slicker than it is right now, but damn, it's slow to load. I tried to show her my blog (I have a blank Spaces blog up there at the moment, in case I ever do fancy moving) and by the time the page loaded she'd lost interest.

Oh well. I'm sure I'll convert her someday!

MSN Messenger beta

I'm sort of ashamed to admit it, but I use Windows Messenger quite a little bit. Some people hate it, and Mrs Mawoo just can't see the point of it when I have not one, but two phones at my disposal.

however, one of the things that really bugs me about Windows Messenger looks lkike it's being sorted out in MSN Messenger beta. Finally I can sign in to Messenger without anyone knowing, and set my status beforehand.

I know it'll take a little while before it propagates down to the embedded windows version of Messenger (no matter how similar they are, I don't really want to install the MSN version). But still, it'll be nice. (Pinched from Mike Gunderloy)

Well Whaddya know?

Schizoid, eh? I'll give them schizoid!

Check it out. How screwed up are you?

DisorderRating
Paranoid:Low
Schizoid:High
Schizotypal:Moderate
Antisocial:Low
Borderline:Low
Histrionic:Low
Narcissistic:Moderate
Avoidant:Moderate
Dependent:Low
Obsessive-Compulsive:Low

-- Personality Disorder Test - Take It! --


Just had the irrational need to share.

I've been thinking about this for a while...

... But Blogger was down yesterday and I'd forgotten about it when it came back up.

For those of you who don't know, I work for a charity in real life, and one of the things charities in general get asked about is how much of their donation income goes to admin costs. I was reading an article in a magazine the other day about supporter services, and this guy called up a charity to ask how migh their admin charges were. The conversation went something like:
Caller: So how much of your donation income goes towards admin?
Charity guy: About 7p in every pound.
Caller: so about 7%, then.
Charity guy: Oh no, I don't think it's that high...

The caller was then put on hold and tranferred to 2 different departments before someone finally confirmed that yes, 7p is, in fact, 7% of a pound.

Just made me chuckle, that's all.

Spoilt for choice...

Hmm. I've just checked out MSN's Spaces, and Oh My are there some nice features on it!

  • Draggy droppy bits

  • Media albums and stuff

  • 'Custom Lists' (whatever they are)

  • Enough options and settings to keep me playing for hours.

  • Integrated site stats

I don't think I'll change, though. I kind of like Blogger's simplicity. I like having a template that I can just change in the HTML. And I like that they're not too fussy about having tools on there from other sites (things like comments and site stats).

And (granted it's like Blogger in that respect. But it's workaround-able) you have to sign in to leave comments on your blog. I really hate that. Okay, I can sort of understand it for somewhere that attracts a lot of comment spam, but my blog isn't one of them.

Having said that, though, it's still only in Beta. Who knows what tricks are still tucked away up various people's sleeves. I might revisit it at some point, but who knows...

Just wanted to share.

Wednesday, December 01, 2004

Helping out Rory

It would seem that les grandes fromages at Microsoft Towers aren't convinced by Joe Stagner's appeal for traffic.

Rory's having to do it as well. Oh well. Clickety Click. I'm a believer, even if MS management aren't.

Would have posted it sooner, but Blogger's been down all day...

Dammit!

Someone nicked my idea!

Well I still think it's cool. Doubt if I'll be getting a WMC PC for a while yet, though...

Tuesday, November 30, 2004

New language features

There's an overview of the new language features in VB.NET 2.0 on MSDN.

Looks very interesting. There are some really cool features in there, like:

  • XML Commenting
    I've already used his to a certain extent with the VBCommenter powertoy and find it quite cool. I find it really helpful. I'm a bit of an inconsistent commenter, and this adds a bit of structure and a bit of consistency to my commenting. And I'm a cheap toy whore. It's really handy to use it with NDoc for making nice MSDN-style documentation as well, though.

  • TryCast
    Not too much to say about this, apart from cool! What's that you say? No need to wrap all my casts into a try/catch block? No need to typecheck every object that gets passed into my methods? I'll have some of that!

  • Operator Overloading
    Ah yes. Operator overloading. Very handy. Eliminate whole swathes of code with a single operator. Sweet!
It's not all good, though. There are a couple of things in there that, certainly at the moment, I can see being really heavily abused.

Some of them include:
  • Partial Types
    What? Split the same class over several files? Although I can see some potential for this being quite useful, I also envisage people using it to implement some sort of weird file-based architecture to their code. Namespaces? We don't need no stinking namespaces! I have visions of something like this:
    File: SavingMethods.vb
    Partial Class Widget
    Public Sub SaveToDB(Thingy as IWidget)
    'Lots of DB Code here
    End Sub
    End Class


    Partial Class InheritedWidget
    Public Sub SaveAsXML(Thingy as IWidget)
    'Lots of XML Code here
    End Sub
    End Class

    Eugh!
    Note to self: You've said it now. I can guarantee you'll catch yourself doing it at some point. Remember to slap yourself silly for it when you do!

  • Default Instances for forms
    Yes. Here's an idea. Let's try and make VB.NET just like VB6. Forms you don't have to instantiate? Yeah! I'm sure it fits in nicely with the rest of the entire sodding language. Do I want an exception to that rule? Of course I do! I want to have to instantiate every reference type except one. I'm sure I'll never trip myself up.(</sarcasm>)
OK, so I don't have to use any of the stuff I don't want to. If I want to put my classes all together, then I can (and probably will). If I want to skip the line "Dim theform as new Form1" then I will.

It's just some things that were occurring to me as I was reading about it. All in all, though, I'm really looking forward to getting to play with VB.NET 2.0, and VS 2005. Sad, I know.

Oh yeah, and another note to self: If you're going to have an image illustrating how XML Comments appear in intellisense, you'd better have an image that shows the comments being shown by intellisense.

Sorry about the length. It was just on my mind and wanted to get off.

Friday, November 26, 2004

Some things bother me...

And this is one of those things.

Do you ever see something, or read about something that for no apparent reason sticks in your mind and won'g go away? Well this is one of those things.

It all started many years ago, when I first saw the movie WarGames, with Matthew Broderick, Ally Sheedy and the guy from 9 to 5.

At one point, all the main protagonists are holed up in the top secret military bunker place, with Maurice out of Northern Exposure. As the tension mounts, and nobody's sure whether there really is a full scale nuclear bombardment headed into America, or whether it's just a figment of a big computer's imagination, they raise their military status thing from DefCon 3 to DefCon 2. Very Tense. Only one step away from all out global war. When the status changes, the bunker locks itself down. I'm assuming automatically. One of the big things that happens is that a huge (and I'm talking HUGE) big metal door (presumably proofed against every Bad Thing known to man) closes and locks. Hardcore. Nothing's geting in or out of that place until the door opens again.

Now, I'm assuming that they keep this door locked for the duration of the war, as well as until any fallout's cleared. In short, they could be there for some time.

Since this giant, heavy, computer-controlled very locked dor is the only way in or out of the bunker, I'm sure everyone who works there knows exactly how hard it's going to be to get out. They know that if they hear the Big Door close, it's time to call the wife and tell her that they might be a few years late for dinner (and I'm guessing let her know that if it all goes tits up, they loved her, and there were so many things they wanted to tell her, but there just wasn't enough time).

Now, as the door's closing, one guy runs in to catch it before it's locked altogether. He's quite a young guy, in a uniform, carrying a sheaf of papers. The thing that's beenbugging me for the past 11 years or so is:

WHAT WAS SO IMPORTANT THAT IT COULDN'T BE FAXED OR PHONED IN IN THOSE PAPERS?

That's it. I just wanna know what was so important that, in the event of a potential Buck Rogers-style nuclear holocaust, he had to run to catch the door before it closed for an indeterminate amount of time, sealing him off from his family and miscellaneous extra loved ones for the rest of their lives.

It's one of those insomnia inducing questions that rears its ugly head when I'm just about to nod off for the night and keeps me up until 3am when my body finally gives up pondering it.

My bet is that he's some sort of accountant. 'I don't care that there's nobody on the planet left to pay. You still have to sign off these invoices!' That sort of thing. I hope that in the event of a real war, his mother's last thoughts were 'Well at least Simon's been saved by doing his duty for his country.'

Either that, or it was some top-notch pr0n that he wanted to save from vaporization.

What do you reckon he needed to dive into the bunker for?

Thursday, November 25, 2004

Bandy Wagon

Bandwagons are great. When I grow up, I want o be on every bandwagon going. I want to:

  • Protest about things I know nothing about
  • Get morally outraged about things because the newspaper told me to
  • Subscribe to whatever wacko diet is current, because some D-list celeb says it helped him/her lose a few pounds
To this end, I've started already.

Joe Stagner's having trouble convincing his bosses that blogs actually get read by real people. Hop on the wagon. Give him a click. Everybody else is doing it. And that, as we all know, is good enough reason to do anything. Go now!

As a sidenote, if you don't (yet) know who Joe Stagner is, check out his episode of DotNetRocks. He's a sound Geezer.

Quick. Dirty. Stoopid.

But quite educational.

Can you even name 112 languages? I got as far as about 9.

Well, no matter whether you can or you can't, you too can learn how to say "Oh my god, there's an axe in my head!" in all 112 (YEs 112 count them!) languages, including Ancient Egyptian, Visigothic, or even (and this is realy wierd!) Welsh.

They're all here.

"Deus Meus! Securis in capite meo est." (Latin)

I also know another bit of Latin Let me know if the grammar's wrong...
"Semper in excreta summus. Solum profundun variat!"
- Always in the s**t. Only the depth changes!

Just wanted to share.

GUI History

There are precious few resources out there (it seems) for designing interfaces. My perennial favourite, the IArchitect Hall of Shame is out of date, although a lot of the principles underlying it still apply, as reflected at Pixelcentric's site, and UI Patterns and Techniques gives a good overview on common ways of interacting with users..

But for a bit of history, and to put where we are in terms of GUI's now into a bit of context, I've just found the GUIdebook which not only gives a good overview of what's about at the moment in terms of GUI's, but also a bit of an overview of where they've come from, and how they've developed over time.

I'll most likely be spending quite a bit of today (between my 'regular' work) reading up on that.

Just wanted to share.

Wednesday, November 24, 2004

Screaming Fan

At the time of writing this, my blog was the 4th site that comes out of google when you search for Geoff Maciolek.

Wonder where the line is between blog and fan-site...

Geoff still has great hair. People have even (apparently) commented that it's 'Arty'. Now whilst it's finely sculpted, and certainly beautiful, sadly my 'Hair as Art' biases run too deep to describe it as arty (i.e. covered in, smeared with, or containing art).

Not, as far as I'm concerned, arty, but Geoff's hair still rocks.

Tuesday, November 23, 2004

Cheap Toyness

The very observant of you will have noticed that I've got a picture of me on my blog's front page.

For those of you who read this through an aggregator, you might also notice that I've changed my RSS feed to RSS 2.0. Yes. I am a cheap whore who's easily impressed by cheap toys. If you haven't guessed already, the only reason I changed the RSS format was so that my picture appeared in RSSBandit.

If either of you want me to change it back, let me know. I only did it for some cheap toyage. I'm sorry.

Monday, November 22, 2004

Pointless, I know...

But one thing I've been wondering for ages is whether or not Nancy Davolio is or was actually a real person.

She must be one of the most famous people in the world.

Looks like I might have to change the title of my blog...

One of the comments on this post here caught my attention. It's by Daniel Moth who says:

"I understand what you are doing from a business perspective: Driving the professional community to C#; just come out and state it please so we can all stop talking and arguing about it."
. I had a couple of thoughts about it...
  1. Refactoring's not that hard to do, if you do it as you go along. Granted, it means that your initial rate of progress might be a little lower, and it certainly looks odd when you're putting quick prototypes together, but at the end of the day, it's not that arduous a task. That said...
  2. It is a bit of a bugger when the CSharpies get tools that VB people don't
  3. This prioritizing of features like 'My' and stuff like that does give the CSharpies more ammo to sling at VB types. Which is a shame.
  4. It's a relatively minor feature, if you ask me. If you can't change your variable names using search/replace then it's your own fault!*
Those were the first thoughts I had.

Why do I think I might change the name on my blog? Well. One of the things I was really impressed with about VS 2005 is that (as far as I know) VS Standard (i.e. Cheapskate) Edition supports multiple languages. So, when I eventually get it, I'm going to be able to start working with C# as well as VB. No doubt I'll always keep a preference, but hey, one of my favourite things about VB.NET was that it's all .NET. It's all just coding against the framework, and so any differences between one and the other are just syntax. And I can deal with syntax.


*Yes, yes, yes. I know refactoring isn't just about changing variable names, it's l about taking out regularly used bits of code and slinging them in their own methods (among other things...) Changing variable names was just the first thing that came to mind at the time.

Computer stores

It takes a lot to get me to go to computer stores. Usually, I only go in there if:

a) I'm desperate for something and can't wait for next day delivery
b) I know exactly what I'm after, know they've got it in stock, and am desperate to carry something home in a box
c) I'm buying something I'm not too sure about, so I can safely return it under their retail-model-based fairly lax returns policy

The running theme here is desperation. I normally avoid them like the plague.

Reading this article about what makes up the ideal computer store reminded me of a conversation I heard one in my local shop.

Customer: Can you tell me how many internal drive bays there are in this case?
Assistant: I'm sorry, I'm not allowed to advise on individual components
Customer: Well can I open up a box to look myself?
Assistant: I'm afraid we're not allowed to do that
Customer: Well can I take the back off the display model and have a look?
Assistant: I'm afraid we're not allowed to make any modifications to any of the individual components
Customer: I'm don't want to change it, I just want to have a look inside
Assistant: I'm afraid we're not allowed to do that
Customer: So how am I supposed to know what I'm buying
Assistant: You'll have to read the description on the packaging
Customer: But there is no packaging. It's a case. It comes in a cardboard box
Assistant: hmmmm.
Customer: Do you know how many internal drive bays it has.
Assistant: Yes.
Customer: Well can you tell me?
Assistant: I'm afraid I'm not allowed to advise on individual components

Now I'm not going to get into a argument about anything, except the policies surrounding this poor assistant. I really felt for him. He knew exactly what he was talking about. He knew the answer to the question. He wasn't allowed to tell the customer because that was the store's policy (it was a big chain one).

Now I know exactly why this is, and it sucks.

Basically, in order to avoid either:

a) Hiring and training staff so they know what they're on about; or
b) Getting shedloads of returns from disgruntled customers who have been wrongly advised by staff who didn't really know what they were on about

The store has a policy not to tell anyone anything, except what it says on the product description cards on the shelves. This way, they can hire anyone they want, regardless of skill, knowledge, or any of the things that make us who we are and unleash them on the unsuspecting computer-buying public.

It really does suck. But hey, I guess I don't have to talk to them.

Just wanted to share. I'm sure I'll write something worth reading shortly. Been studying quite a little bit about English Query. It looks really cool. I didn't even know it existed, either! What a stroke of genius.

Friday, November 19, 2004

Somebody must have changed their aggregator...

Just checked my RSS feed logs, and I think someone must have changed their aggregator of choice. Not just one person, but a few.

Normally, I run at about 11 subscribers (Yes, 11 whole people!!), but it's shot up today to 14. Either 3 people have shared me with their friends, or 3 people have changed aggregators.

If I have acquired some more people, then hi! If not, then let me know what you're using. If it's good enough for 25% of my readership to migrate, then it must be good!

Just wanted to share.

PS - One of these days (maybe even this evening), I'll write something a bit more substantial. I've had a million and one thoughts in my head all day today, and I gotta write about them! And I might even write something useful too, about SQL Server (OK, useful to me...).

Thursday, November 18, 2004

Truly Cool!

Scott Hanselman uses some truly cool widgetry on his site (here's the tip - roll over the book title links).

He got it from here.

I think this is actually quite cool. I think I shall have to use it more myself!

Long, but good, article

Just a quicky. More of a 'Note to Self'.

Just skimmed through this article on MSDN.

I think I need to read this a bit more deeply. Although I've used Web Services a few times for various things, I've never really seen a summary outlining how it's architected, and the thinking behind it. All the stuff I've seen in books and online tends to dive straight into a demo, and the focus has really been 'Hey. Web Services. They're easy really!'.

Whilst I found that helpful a little while ago, I don't so much now.

Tuesday, November 16, 2004

A Picture speaks a thousand words!

Apparently, there's been a survey in a number of countries around the world about how everyone perceives Britons.

Now the survey says nothing particularly new. We're reserved, polite, sometimes mistaken for cold and snobbish, but at the end of the day we're not a bad bunch. All this, of course, becomes null and void when sport and/or booze are involved. But we knew that already.

What caught my interest, however, was the pictures the beeb chose to accompany the article. They're all shots from hit BBC Comedy Little Britain.

Most amusing. Personally I though that said more about our sense of humour than any survey could have done!

Just wanted to share.

Monday, November 15, 2004

Cheap plug-a-tron

I've finally had a chance to download the first ever Mondays show from Carl & Rory.

This is my cheap plug for it.

It rules. Download it now.

NOW I SAY! GO!

More Mozilla

Okayt, so I've kinda go tused to Mozilla, and it's OK. That'a about it. It's OK. It does the job. It maintains the web-browsing status quo. Except for a couple of things.

The good bit
Tabbed browsing is a neat feature. Not as earth shattering as some people would have you beleive, but neat. Apart from anything else, it does give me an excuse to use my much neglected and seriously under-used middle mouse button.

The Bad Bit
I don't do a huge amount of browsing, but I know a fairly standard page o' HTML when I see it. There doesn't appear to be anything particularly hokey and weird about Rory's site, but I'm buggered if FireFox can render it right. I think it might have something to do with CSS, but I couldn't be sure (mostly because I'm too lazy to dig through and find out.

*** STOP PRESS *** STOP PRESS ***
I have, however, just seen a very cool feature. One that I must admit to being very impressed with. It doesn't quite rock my world, but it certainly makes my CD player skip. FF color-codes the source when you hit 'View Page Source'. Now THAT I can get behind.

Just wanted to share.

Thursday, November 11, 2004

Blogging on Demand #4

This search recently piqued my interest. Not only is it something that's quite interesting, it's also something that, although I've used it a couple of times,I haven't really explored it very much.

"Me.ServiceProcessInstaller1.UserName" (via Google)

The ServiceProcessInstaller works in conjunction with the ServiceInstaller in providing information for, and interacting with Windows' own service installation utility, InstallUtil.exe, for (as the name suggests) installing a service.

These classes should be included whenever you have a service that you want installed (again, the name says it all, really...). Visual Studio and the .NET framework make building Windows Services very easy. Although I haven't got any experience of doing it in the past, I hear services were tricky, to say the least! All you need to do in Visual Studio to create a service is select Add-->Windows Service in the solution explorer. Very Easy . Unfortunately, by default, when you go to install your service using InstallUtil, the compiled executable doesn't have all the information that Windows needs to install it as a service.

The ServiceProcessInstaller is where you set things like the Account Type that the service is going to run under (Whether it's the System Account, User Account etc.). More often than not, you'll be setting the Account property of the ServiceProcessInstaller to ServiceAccount.LocalSystem. The reason for this is that more often than not, you'll be building an application that needs a high privilege to be able to do the things you want (if you've got a service that monitors a folder, for instance, you'll want to make sure your service has access to that folder.

Just a quick note on security (Feel free to skip this paragraph, I'm more thinking out loud than I speaking from actual experience). The best practice is to run your code with the least amount of privilege possible. If you've got a process that needs a certain resource, give it access to that resource AND NOTHING ELSE. You might want to do this by setting up a new user (Ever noticed the ASPNET User account that gets set up when you install the .NET framework?That's what this is). You can also do it by putting together a security policy and deploying it to your machines. This does, however, mean extra stuff that needs to be done at installation, and it can only be done from an account with admin rights on the machine. LocalSystem, while it doesn't really follow best practices, and it does leave your system open to buggering about (Not necessarily malicious buggering about, it could just as easily be just a bit of flaky code. We've all written some of that!), is at least the easiest option when it comes to deployment. I can see from my machine, for example, that all but 2 of the services running on my machine run under the LocalSystem account.

If you do choose to run your services under a User account, the ServiceProcessInstaller is where you might want to specify your username and password. You don't have to put it there, but you may like to. If you don't specify it in there, you will be prompted for it when you go to install each service. I guess the most common need for that would be in a corporate environment where you have a user account set up on all your machines for running a particular service, and don't want to share those credentials with your users.

That's about it for the ServiceProcessInstaller class.

One of the things the ServiceProcessInstaller class does, though, is work with the ServiceInstalller class to get them... Well... Installed. Since you can have an exe that contains a number of services, you need a separate ServiceInstaller for each service within it. The serviceInstaller is where you can specify things like the name that's displayed in the Service Manager console, the Start behavior and things like that. The key properties of note are:

StartType - This can be one of 3 values 'Automatic', 'Manual', and 'Disabled'. You're not likely to use disabled much (I can't think of a situation that would warrant it, anyway...). Automatic means the service will be started up when Windows is fired up. Manual means it won't be started up when the OS starts up, but you can still start it manually either via the Service Manager, or by using a ServiceController in code.
Disabled, as the name suggests, means you can't start it, no matter what. See what I mean about using it when you write a service?

ServiceName - This is, as the name suggests, the name of your service. This needs to be the same name as the ServiceName specified in your code.

DisplayName - This is the friendly, fluffy name you want to appear in the Service Manager. For example, the ASP.NET State Server is actually called 'asp_state'. 'ASP.NET State Server' is it's DisplayName. You don't have to have friendly names, either. SQL Server's service is called 'MSSQLSERVER' (Imaginative, eh?) and it's DisplayName is also 'MSSQLSERVER'.

The ServiceInstaller supports transactions too. It's clever like that. If something goes wrong as it installs a service, it rolls back the whole installation and leaves your computer as if it had never even heard of your service.

By and large, I haven't played about too much in the code behind these classes. Visual Studio has quite a handy little tool that automatically creates ServiceProcessInstallers and ServiceInstaller for you. If you open your service in the designer, and select the service on the design surface, there'll be a handy little linkbutton there that says something along the lines of 'Create an Installer'. Click it, and you'll see your ServiceProcessInstaller and ServiceInstaller magically appear in the designer. You can just go through and change the properties you want to change and Bob's yer uncle. You'll have to go through and do this for each service you've written, but the widget is big enough and clever enough to produce one ServiceProcessInstaller for the executable, and a ServiceController for each service. Clever, eh?

There are a whole host of other things that you can do with ServiceProcessInstaller and ServiceInstallers. These are just the main bits I've used.

It's worth noting, however, that all your service's properties can be changed through the service manager as well. You want to go in and run your service under a User account, no problem, just open up the Service Manager console, and change away. These 2 classes only do their work at the point of installing your service.

If I've missed anything major, let me know. If there's anything wrong, then let me know. Hey, if you know something you didn't know before you read it, then still let me know. Some of this stuff I already knew when I set out, and some of it I learnt on the way whilst writing this post. So it's done it's job, I guess.

Man I wish I lived in the USA

Carl Franklin's posted some pictues on his blog of the DotNetRocks party in Vegas last Friday. It looks really cool.

In the same vein as Phil Weber I think I'm going to have to start a Geoff Maciolek fanclub. Well, not so much a fanclub, more of a one-man web stalking prescence. Or maybe just a bit of a blogliment*.

Man, that Geoff Maciolek really has some fine fine hair, and some fantstic beardage to go with it.

* I just made up that word, 'Blogliment'. It means 'Blogatory Compliment'. I like it. I think I'm going to have to use it more often.

Just wanted to share.

First days with Firefox

Although it's desperately dull, I'm going to add a couple of posts about the funny things I find as I start using Firefox. This isn't meant to be any kind of review, but more of an aide memoir to myself, just in case anyone asks, or anything particularly interesting crops up. Feel free to tune out now.

Firstly, I realised just how little I use a web browser in isolation. Normally I browse the web using the built-in browser in some other application (e.g. Visual Studio, RSS Bandit etc.). The only exceptions are when websites are tryng to do something unsupported or disabled by the integrated browser.

As a result, my initial reaction so far is 'And...?'. I haven't been able to do anything I couldn't do before. I haven't noticed being any more private, or secure. There are a couple of odd behaviours I've noticed - all the text on Neopoleon.com
disappears periodically, and I have to scroll up or down to make it reappear. But apart from that, it's just more of the same, only with more public shouting.

Call me an MS fascist, or call me small minded and stubborn, but y'know, I really can't see what all the fuss is about. Maybe I'm just too much of a grumpy old man.

I've just re-read this post, and man is it dull! Sorry about that.

Just wanted to share.

Wednesday, November 10, 2004

Firefox 1.0 is out.

For the one person on the planet who doesn't know, the much vaunted Firefox 1.0 is out now.

I'll download it and give it a go, I'm sure, but I daresay I'll keep using IE for now.

To quote from the Firefox website:
Why Use Firefox?

Popup Blocking - erm... Well... I've got that already. It works fine...

Privacy and Security - I think most people would agree that Privacy and Security are as much a user's responsibility as they are the software's. I've heard it said (many times!) tat no system can be made completely secure and still usable. SecretGeek has a very nice guide to defensive programming, and making your applications secure. There is also the rather woolly issue of what constitutes privacy. Security's pretty (or at least compared to privacy, anyway!) clearcut. But Privacy? Just look at the 2 main names for internet usage monitoring software. I say SpyWare, you say AdWare. Malicious? Who knows. Easily avoidable? For sure. Killable? Definitely.

Smarter Search - "Google Search is built right into the toolbar". As it is on my machine. The Google toolbar's not that difficult to install!

Live Bookmarks - From what I can gather, this is marketing speak for 'Integrated RSS Aggregator'. Okay, fair enough. If I want to go through my RSS feeds I have to go to the hassle of opening up RSS Bandit (What a drag!). I'll reserve judgment until I play with it.

Hassle-free Downloading - And how much hassle is IE? You've got a bit of a dilemma here when you're putting together a browser, I guess. Do you download a whole bunch of stuff automatically, and face the security consequences, or do you ask for confirmation at every step? Who knows?

S, M, L or XL—It's Your Choice - Yes, it's customizable. My only concern is how that customization fits in with its security and privacy model. Does that mean I can build a plugin that pings my server with the header information of every webrequest made from the browser? Woohoo! Wrap it around a pretty theme, and I've got my piece of SpyWare (or AdWare, depending on who you are) built into the very browse itself! Great! Also means there's more stuff that needs re-installing next time I repave.

Setup's a Snap - Okay, I guess this has just been put in there to attract people who are convinced that software installation is something only to be done by techheads (and there are a lot of them out there)

A Developer's Best Friend - Eh? I have a best friend. I don't want another!

And last but not least, the one thing that I've heard so much about. The one thing that I think has had more coverage than anything else. The one thing that is meant to be the IE killer. Ladies and Gentlemen, put your hands together and give it up for the one, the only...

Tabbed Browsing - Woo Hoo. Tabbed Browsing. Well if that hasn't solved all my problems. Tabbed browsing. I can have an entire group of windows open with only one taskbar item. I can flip between one and the other. Great. Come on. It's tabbed browsing. Much as I like the tabbed interface s la Visual Studio, I don't think it's really so hot as to make it the one selling point for a browser. Is that what we've been reduced to? Getting all frothy about the mouth over tabs.

As I said before, I haven't used it yet myself. I daresay I'll write another post in a few days saying 'Hey, Firefox is da bomb. I don't know how I lived without it!' We'll have to wait and see.

Don't flame me for writing so much about something I haven't used (yet). This is just my take on the marketing spin, and the 'Firefox is gonna kill IE' vibe I've been getting from the news.

At the end of the day, it's still just a web browser.

Just wanted to share. I've seen noting but Firefox Firefox Firefox for the past 2 days...

Tuesday, November 09, 2004

I think I finally get it.

I think I might have had a bit of a revelation yesterday on the way home from work.

Walking along, rain blowing in my face, bit of Metallica on my MP3 player (And yes, Metallica, I did pay for it!), deciding whether to get the carbonara sauce out of the freezer or get the chicken out for tea, and suddenly I saw a light. I don't know if it's the light, but it was certainly bright! This, by the way, has nothing to do with inheritance. Luckily, being cold, damp. tired, hungry and annoyed (the tube was delayed as well!) is not an analogy for inheritance.

I think I finally get it.

I was thinking about a general object 'Item' that you might get in a shop or catalogue. Now up until now, I would have put together a big old class that encommpassed all my functionality, including ordering, (Item.AddToOrder()), Catalogue information (Item.Image) and so on.

In the past, I would have done one of two things:

1) Had a great big IItem interface, and had to implement a whole shedload of dummy methods to make it compile

2) Implement a few extra classes, for orders and so on which contain within them a property 'BaseItem' which returns an item

1's a bit clumsy, and means writing a whole load of unneccesary code.

2 is a little better, but still means writing a whole load of extra code. I mean, to get to it, you're looking at a minimun 3 extra keystrokes to get to a property of the BaseItem ('B', then tab to autocomplete it, then a '.'). Not ideal.

Inheritance is the key. I can create an 'Item' class, implement methods and properteis for the bits that are universal and then create inherited CatalogItem classes, OrderItem classes and so on that expand on that.

Now this isn't anything new or revolutionary. I've just re-read this post and thought to myself 'Yeah. I already knew that. What's the big deal?'

The big deal is this: Although I knew it already. I could probably have even explained it to someone else at a push, and I certainly know what people are on about when they talk about it, I didn't really get it.

Does this happen to anyone else? I mean I've used inheritance in the past, I've expanded or customised frmaework classes to make it work exactly how I want it, I've even fixed bugs shortcomings in my own code using inheritance.

Only now, though, do I think I actually really get it. I might even go as far as to say I understand it.

Just wanted to share.

Thursday, November 04, 2004

That eery feeling...

Did you ever get that eery when you're not sure whether you're looking at a spoof site or not? I remember a couple of years ago, many people got that feeling with www.manmeat.com (I'd link to it, but the site was taken down after too many people got that feeling...).

I got that today reading this company's dress code.

I don't know whether to take it seriously or not. Thw whole site gives the same impression.

It's either an unfeasibly good, creme de la creme company, (for which nobody can work at all. No. Never!) or someone's having a laugh. I still can't work it out.

If you've got any ideas, then let me know. I'm flummoxed.

Just wanted to share my flummoxed-ness.

Ignoring my own advice...

Back in this post, the first rule (more of a guideline than a rule) I made up (from experience, I hasten to add!) was "Know that you know nothing". I've been surprised this week at how right I was. And not just for .NET, but for everything.

I've recently started reading Robert Vieira's excellent Professional SQL Server 2000 Programming, and my, is it good.

I thought I knew a little bit about SQL Server. Although coming from an Access background, I'd read a bit about good database design, I've heard a few people talk about SQL server (mainly on DNR) and can hold my own in a conversation about it. Although I knew there was plenty I didn't know, I thought I knew a few of the fundamentals. Scratch that. I thought I knew enough of the slightly higher level stuff that the fundamentals would slot into place fairly simply. I now know different.

I've just spent an hour on the tube reading all about Indexes. It's only about chapter 4, and a pitifully short way into the book. And my goodness, there's a lot in there to learn. That's good, since I quite like learning new stuff. But it has highlighted just how little I know about what goes on under the hood. I knew, for example, that clustered indexes are good in some situations and bad in others. I knew as well that sometimes table indexes are a bit superfluous and can actually impede the efficiency of your database. At a push, I might even have been able to drag out of my addled brain which situations were right for which. However, after reading this one chapter, I realize that I knew nothing. I kind of knew the 'what', just not the 'why'. Granted, to get to the 'why', there are a whole load of complicated hoops you've got to jump through. The 'why' takes up a whole lotta reading, but still, it reminded me just how little I really know.

I heard someone say once 'The more I know, the more I know I don't know'. Nary a truer word spoken.

On the upside, though, I do sort of know a bit about the 'why' of indexing tables, and even with this little bit of understanding it's sparked off a few questions in my mind about other things I'd like to find out about. Which is good (especially if you're me.)

Note to self: If you're going to offer advice, don't forget to follow it yourself!

Just wanted to share.

Tuesday, November 02, 2004

New Toys! NEW TOYS!!

Well, after my birthday, I've got myself a couple of new toys to be playing with.

SQL Server Developer Edition. SQL Server's one of those biiig gaps in my skills. Although I've read quite a lot (and even used quite a bit) about database design, normalisation, stored procedures security and stuff, it's always been using Access to put together DB's on MSDE. I never even SAW query analyser until just a couple of months ago.

But that's been cured now. I've got a proper DBMS now, so that's alright.

Microsoft Flight Simulator 2004. Now this has got me all excited. This has got me out of bed early. This is a sexy mother of a game. It's really boring at times - Watching the AutoPilot steer you from Plymouth (my home town) to Exeter (where the ladies of Plymouth go for a day shopping) isn't really that exciting. But I'm stil getting over the novelty of being able to take off from Plymouth Airport, fly over the Tamar river, buzz the very same bridge that my dad goes over to get to work every day and land in a town I once sang in (they have a cathedral there, and I sang in it once.). It's got some really cool real world maps and stuff, and it covers THE ENTIRE WORLD! I'm quite impressed, anyway.

Oh yeah, and I got some SQL Server books as well. I'm currently reading Professional SQL Server Programming. It's quite good.

Expect some posts in the future about SQL and MSFS (apart from the usual .NET ramblings, rants and misc. stuff).

Although they won't be particularly frequent - for some reason, I seem to have been really really busy for the past few weeks. I'm hoping it doesn't last!

Saturday, October 30, 2004

More piratical pics!

Just a quicky...

One of my pirate mates, Mark, has put together a few more pics and video from my party. It's here. Check it out. His video's better than mine!

Friday, October 29, 2004

Good to be pushed sometimes...

I sent the link to my birthday pics to a few friends of mine last night, and immediately JML got back to me via IM.

JML's a top guy. A real diamond. He's the IT manager where I used to work, and one of the only people from there whoI stil see regularly. Mrs Mawoo tells me he's the only person on the planet who I can talk to on the phone, as well.

So anyway, JML gets back to me immediately and says 'Can I offer some constructive criticism? Your pictures look shit. What interpolation did you use on them?' So I said I used the default compression, and promptly went out and tried to find out how I can apply a different algorithm to the images being shrunk (Curse you JML! I was about to go and watch some CSI!).

Good job I did, though, because I learnt a really cool, and quite fundamental thing.

System.Drawing.Graphics.FromImage() Doesn't give you a new blank canvas
Rather, it takes your blank canvas (or your canvas with an image on it) and allows you to use GDI+ to play about with it. Everything you do, though, every string you draw, every change you make, is made to the original image, not to a new one. To give an example:

Dim pic as Image
pic = pic.FromFile("C:\Monkey.jpg")
Dim little As New Bitmap(CInt(pic.Width / 4), CInt(pic.Height / 4))
Dim g As Graphics = Graphics.FromImage(little)
With g
.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
End With
g.DrawImage(pic, 0, 0, little.Width, little.Height)
little.Save("C:\SmallMonkey.jpg")


Now, yesterday, I would have said 'What? What are you doing saving a blank bitmap?'. That what it looked like to me. If you read through the code, it looks like the sequence of events is this:

  1. Open the original Image File
  2. Create a new blank Bitmap object 1/4 the size of the original
  3. Create a new Graphics Object, copying into it the blank cnvas you've just created
  4. Draw the image etc. on the new Graphics image, leaving the original blank bitmap (little) untouched
  5. Save the blank bitmap (little)
That's what it looked like to me, anyway.

I used to imaging the Graphics object as a posh bitmap, a bitmap tat you could do some whizzy things to, like write text on it and things like that. I now understand much differently. Rather than imagine the Graphics object as a blank canvas, I rather imagine it kind of like the team of robot arms that run around cars, welding bits together. You know the ones. When the car stops on the conveyor belt, and then a squad of robot arms comes out and welds, glues and paints everything before the car moves off again. That's how I visualize it now. Robot arms. With the car (or Bitmap, in this case) in the middle. Neato. And it answered a lot of questions.

This bit on MSDN helped me out a bit too.

It left me in a really good mood. For some sick reason, I actually get quite a buzz when I find out something new. I'm still really lazy, though. I wouldn't have played about with the Graphics object and found out what a cool thing it is without JML telling me 'Dude, your pictures are shit! Sort them out.' Thanks!

Just needed to share.

Thursday, October 28, 2004

Happy Birthday to me!!

Well it was my birthday last week, and after having a bit of a mare trying to get my pictures shrunk to web-size, I've finally got them online here.

You might find the layout of the page a little familiar. I really am lazy when it comes to layout.

Just one quick note, the video of the final (Mrs Mawoo versus my mate Rod) was made using my SPV E200 Smartphone. It's not the greates quality, but hey, it's a phone. What did you expect? Spielberg?

Just wanted to share. Feel free to tell me I look great in a hat and eyepatch.

Doh!

Don't you hate it when you do something so stoopid it makes you want to cry? That happened to me just this morning. Bugger.

Over the past couple of days I've been writing just a very quick easy app to batch resize a folderful of images. I wanted to get a bunch of pictures from a party (it was my birthday Saturday. Woo and Yay) and resize them to put online somewhere. SImple, I know. Yes, I could have donme them by hand. Yes, I could have downloaded one of a million free utilities to do the same thing, but hey, where's the fun in that?

Originally the plan was to do it this way:

  1. Load the image
  2. Create a new image (in GDI+) from the original image's GetThumbNailImage method
  3. Save that image
Simple huh? It's something I've done a few times for creating thumbnail images on the fly.

Turns out (and I didn't know this before) that if the image file already has a thumbnail associated to it, it just takes that image and resizes, rather than taking the original and resizing it. As a result, half of the images that were produced were horrible pixellated crap. Not good. So I spent a few hours trying some other stuff, looking for resize methods in all of the GDI+ objects, and a whole bunch of other stuff. I even toyed with writing my own resizing algorithm to do the job I wanted. I didn't go down that route, though.

No. The route I went down was very very very easy. I'm even ashamed to admit that I had spent so much time thinking about it and playing with so many different things to arrive at this point. No.

Turns out the Bitmap object has a very nice constructor (yes, a CONSTRUCTOR! Note emphasis. I really was being that dumb!) that does it all for you. It goes like this:

Dim x as new Bitmap(Original as Image, Width as Integer, Height as Integer)

Dammit! It really hurt to delete the whole bunch of code I'd written only to replace it with one line.

And the even worse part? I haven't even got round to putting together a nice HTML page to put them on yet, so wrapped up have I been with trying to sort out this resizing thing, so my birthday party's still not online yet. When I do it, though, I'll put up a link.

Just wanted to share my stupidity. I'm hoping I'm not the only person who's had experiences like this!

Friday, October 22, 2004

Strange...

I've been playing a bit with non-rectangular Windows forms (using a background image and transparency key), and have discovered some strange things.

The TransparencyKey property doesn't work
Well, this is a known issue. The TransparencyKey property doesn't work on systems where you've got your screen colour depth set to more than 24 bit. Bit of an oversight in my book, but there you go.

Quick google search cured that, though. The problem can be solved by putting the following lines of code in your form.initialize method:
Dim Img As Bitmap = Me.BackgroundImage
Img.MakeTransparent(Img.GetPixel(1, 1))
Me.BackgroundImage = Img
Me.TransparencyKey = Img.GetPixel(1, 1)


That works, but seems to have a bit of a strange side-effect.

If I add a control to the form, a ListBox, say, and set its BackColor to Black, that control becomes transparent too. Like properly transparent. I mean it looks like there's a hole in the form. Any other colour's fine, it's just black makes a hole in the form.

It only seems to happen on the form with the transparency key stuff going on. On standard forms, it doesn't happen. Black controls look just as you'd expect. Black.

It's kind of disconcerting, seeing a selected item (blue bar and everything) floating seemingly in space (well, floating with a bunch of code behind it.

If anyone can figure out why this is happening, let me know. I'm really quite interested.

Anyway, that's what I learnt this evening.

PS - Feel free not to tell me the answer if you do know. I just needed to remind myself of an interesting thing I need to read up about.

Aha!!!!

Before I start, you're going to have to bear something in mind. I live in the UK. Which means that I'm at least 12 months behind the rest of the world when it comes to technology.

I had one of those proper 'Aha!' moments last night over the .NET framework 2.0. I went to an MSDN talk last night, ostensibly about Visual Studio Express. I'm not really that interested in the express versions per se, but I wanted to have a bit of a look at what the implications were for Visual Studio Standard Edition. What would the effect be of adding an extra layer of products at the bottom of the product line (bottom in terms of features and functionality, I hasten to add, not bottom in terms of the people using them!) have on the previous bottom of the ladder product.

And it looks good (providing the price for Standard stays about the same). Smart device development looks like it's supported in VS Standard, which is something I really kinda like. And it looks to be all round goodness in a box.

That wasn't what got me excited, though.

What got me excited was ASP.NET 2.0. Although I'm going to have to have a deeper look into how they really work, some of the data access features of ASP.NET look to really rock. Being able to put data sources with (and this is the important bit) parameters bound to other controls on the page right in the code on the ASPX page looks really cool. I'm sure there are security issues there, which is why I'm going to have to have to have a deeper look into how it works, but on the face of it, for quickly banging together web forms apps it looks like a really good thing.

Snaplines in Windows forms got me really fired up as well. Although I've seen quicky demos on channel 9 and the like, I never really appreciated just how funky a feature this really was. It's fantastic. Being able to snap controls so they line up with any of a dozen reference points (The top of the control, baseline of the text, middle of the control etc.) is really quite good. I might be biased because I've been knocking some forms together in Access, where that kind of thing is really quite hard. And even harder to do quickly without losing your train of thought.

The code editing formatting options are also really good. The demo showed a load of the options available in c#, like where opening curly brackets start and end (on a new line, inline etc), and stuff like that. In ASP.NET as well, the days of VS reformatting your code every time you switch from design to code view and back are gone You want to have a block of text hard-up against the margin, you can have a block of text hard-up against the margin. It's all preserved for you. Nice.

Data Access thingys in windows forms are quite cool as well. In the quicky demo the guy showed us, he did essentially what the Data Forms Wizard does in VS 2003, but all with just pure drag and drop. Just pull a datagrid onto a form (if I remember rightly) set its data source and run the app. It automagically generates the code to populate the grid, and even gives you a navigation menustrip to boot. The whole thing took under a minute. Sweet.

And the best thing, the thing that'll have me running out to the shop to buy VS the day it comes out, the thing that'll stick in my mind, the thing that when people ask me 'So what's so cool about VS Express?' I'll tell them about... They gave us beer and Pizza! God I'm a cheap whore.

Just wanted to share.

P.S. Sadly not many links to documentation. There's not a great deal online yet.

Tuesday, October 19, 2004

Another stoopid test...

You are .dll You are dynamic. You are constantly in danger of bringing down the house, because you don't play well with others.
Apparently I'm a .DLL.


The next couple of weeks or so mihgt be a bit light on .NET stuff. And generally light overall. I might be working on an Access project for a little while.

Yeah yeah, I know. It's Access. Which is bad on more levels than I care to imagine, but such is life.

Just wanted to share.

Friday, October 15, 2004

Blogging on Demand #3

Okay, this isn't a technical search that brought someone to my blog, but I thought it's be quite an interesting thing to write about since it's something I have (I think) a fair degree of experience in. And often colleagues at work ask me about it.

Mostly, they ask 'Why?'

Learning VB.net (via Yahoo)

Well, it's nice and vague, and I guess it is the title of my blog, so why not write a bit about my experiences learning VB.

Know that you know nothing
This I learnt after about 2 minutes playing with Viual Studio. I came from programming VBA and (gasp!) Access, thinking, 'Hey, know how this stuff works. I can write code that talks across applications, I know what a Select Case does.' I learnt very very soon that I didn't know diddly. I could talk for hours about the differences between VBA and .NET, but I'm not going to. You could try looking here for some inspiration. The 2 things that struck me first were

  1. The .NET framework is huge. To paraphrase Douglas Adams "The .NET framework is big. Really big. You might think the MS Word object model is a bit overwhelming, but that's just peanuts compared to the .NET framework."
  2. working with objects in VB.NET is completely different to working with objects in VBA. Nicer, I'll grant you, but nonetheless very different.
Unless you're really forced very hard to produce something concrete, it's very difficult to pick it up and start typing away.

In fact, I'll go as far as to say that I was so clueless about VB.NET when I first picked it up that even the help docs were next to useless for me. I mean, MustInherit? What's that all about?

Quickly, though, you'll notice something quite nice, though.

The world wants to help you (for free!)
It's true. There are a million and one places to find out about .NET. ASP.NET, WindowsForms.NET, Microsoft, everyone. If you need to find something out, it's all there. The .NET community rules. Honestly.

I sometimes post entries about webcasts and other various resources online. I love 'em. The web is a beautiful, beautiful thing for learning. But...

You can't beat a good bit of study
Unfortunately here's the pisser. Although there is more free interactive, lecture-based AV stuff out there than I have time to watch, there's nothing like sitting down for a few hours and reading. Studying is something that just unfortunately won't go away. No matter how far we advance in presentation techgnology, styles and material, if you really want to learn about something, you've got to graft for it. I tried learning a bunch of stuff through fluffy online tutorials and stuff, but when it came down to it, I learnt far more and got a much deeper understanding of the subject though just solid reading. In a way I'm lucky. I get the tube for an hour in the morning and an hour in the evening. There's 2 hours every day to just read and read and read.

An oh my, there are some books out there.

I'mk not going to start reviewing books, I can't be bothered, and hey, it's my blog. I found the Unleashed series and the teach yourself ... in 21 Days from Sams really good introducions to .NET. Personally I tend to stay away from the 24 hours books, butthat's just me.

The Dummies series is quite cool right at the very very beginning. In fact, it was this book that first made me think 'What, you can get a computer to do ANYTHING YOU WANT? Cool.'

Write stuff
I generally dont like doing the tutorials in books. I tried it, but here's the scenario I usually find:

Picture the scene. I'm sitting at home in front of my computer, book on my lap doing a tutorial. I type what it says in th book, nodding sagely at every line, saying to myself, yep. yep. Uhuh. Understand that.

Run it. Get an exception, AND THEN (here's the important bit) what do I do? Cancel the Unhandled Exception Dialog box and scour my code checking it against the book looking for the typo. Useful? I think not.

Instead, I just read the stuff think of a similar, but not identical problem, and try to solve that. Or, think of a task loosely based on the book example, but incorporate into it something I already know. I always find that where I thought I know loads, I actually know diddly when I come to integrate something that isn't in the book into the code I'm writing. Might just be me, though.

Or, do something kind of unrealted, but using just one bit of the stuff in the book. My favourite aplication I wrote, the one I'm most proud of, and the one I tell my friends (well, if we're being honest here, friend...) about is ASP2WMP which I wrote to explore remoting a bit. I got tired with populating a datagrid with the Northwind Products table. So I did something completely unrelated, but using just one apect of what I'd read that day. In fact, ASP2WMP was developed in several stages as I learnt about more stuff from the book I was reading at the time.

Answer questions
When I was getting my head round ASP.NET, I started answering questions in the ASP.NET forums. Sometimes I'd play it safe and stick to what I was absolutely sure of, but sometimes I'd try and solve a problem I wasn't too sure of and then come out with an answer. They weren't always particularly bad answers, either.

I don't know about anyone else, but I am very very lazy. That's why I started programming. I figured 'I really can't be arsed with all this work. Why can't I get a computer to do it instead?'. Well, being lazy, I really can't be arsed making problems for myself. The downside? No problems, no solutions. So I tried solving some other people's problems instead. I find that once I explain something to someone, it makes it much easier or me to crystallise that knowledge in my head too.

I think that's about all I've got to say about how I'm learning VB.NET. This is all just based on my own experience, mind you.

Oh yes, just one quick note, there's nothing annoys forum types (not me, but I occasionally see some pretty terse replies) than people eho just can't be arsed looking. So before you start asking other people questions, make sure you've checked:
  • The Help Files
  • The MSDN Library
  • Google
  • The forum itself, to make sure nobody else has come up against the same thing before
Just wanted to share. Sorry it's such a huge beast of a post. If you've got this far, then my heartiest congratulations to you. And thanks.