November 2005 - Posts

Visual Studio 2005 Spell Checker?

I'm a crap speller, I admit it. Fortunately computers are generally better at spelling than me. Unfortunately Visual Studio doesn't have the ability to spell check my code and it drives me nuts. Why Oh Why Oh Why can Visual Studio not call into the word spell checker if its on my machine?

So I've done some searches and found very little satisfaction. There is one tool that is working for me right now but I would love to know if you have heard of another one?

  • CodeSmart 2005 - $249 - pictures look good, but no Visual Studio 2005 version. Seems like a lot of the other features you get are already part of VS2005. Spell check results come back like Search or compiler errors in a grid. Seems OK but doesn't feel like spell checking.
  • Visual Assist - $129 - VS2005 version available. Spell checker seemed to find some typos and miss others - at least in the HTML page I was editing. It thought that "I've" was 2 words and offered to add "ve" to the dictionary. Red underlines just like word. Once again a lot of extra functionality that seems to overlap with VS2005.
  • Microsoft Example Macro - $FREE - Highlight a block of text and run a macro is not a good UI. Not sure it will work in VS2005 and didn't try since I got lots of odd errors in VS2003. It did run though. I doubt it understands anything about code structure etc though
  • Spell Code - $19.95 - just does spelling. Uses a select/run command approach and works on forms and inside code which is nice. Throws an error if you select a block of code with ///<> comments which means 100% of my code. VS2003 only.
  • Code Spell - $29 - and the search ends..... VS2005 (in fact only VS2005 but that's fine with me). A lack of superfluous features that VS already has, squiggly underlines (though they are blue not red - I prefer consistency with word). Understands CamelCaseWords. Seems to want to spell check the HTML and CSS which is something that could be improved but I can live with that too. I have 30 days to see if this will work but my 10 minute trial is feeling good.

Craig pointed out that I had missed FXCop. Sure FXCop checks my public API spelling for me, but it doesn't check the HTML, the comments and the strings. I hate having to cut & paste my HTML pages into word to spell check them. Don't forget folks that FXCop is now called Code Analysis and is built into VS2005 (not in Express products) and for some reason its not turned on by default (I guess this feature was designed by the same PM who decided that Option Explicit should be off in VB3.... and we are still paying the price).

No world records

Well the race is over, the terrible rain that I awoke to at 5:30am (Yes that's AM - runners are a crazy bunch) faded by 7:30 and though it was chilly we didn't get wet which is all I care about. 2 hours in the rain is not much fun. Final time 2:08:04 which is pretty damn good if I do say so myself!

I've never run with so many people in a race, I tend to run the start of a race too fast, but it was jut about impossible to do that today due to all the people. This is a good thing.

Lots of people out on the course with signs and cheering which is very nice. Not sure what happened to the GU station - good job I took some along myself. The chocolate one is like eating frosting.

ZMan's big day

It's been a busy week - The ZChick had me installing new bathroom cabinets on Monday (apparently being at home all day means I can work on the honey-do list 7 days a week), some Christmas shopping on Tuesday (has to be done early to catch the post back to England) followed of course by Thanksgiving (or since I'm not American I like to think of it as a practise run for Christmas).

The BIG DAY of which I refer is now less than 12 hours away. At 7:30am tomorrow I'm running my first half marathon. If you had told me this time last year that I would be running, I may well have died laughing. But I started running with a group in May and now here I am - quite a lot fitter but amazingly not as much lighter as you would assume. Of course when your starting point is out of shape and over weight there really is only one way to go when you train 3 times a week. Seattle has lots of hills and this is my first race at this distance so there won't be any records other than setting a personal best to measure future races against. However I should come in around 2:10 or so meaning that the race will be over earlier than the time I normally get out of bed on a Sunday. So if you happen to be near the course and you can pick me out (no glasses when I'm running - red tshirt, black shorts) and you like to get up early then come shout at me. Race number is 5324.


Referrer Spam madness

I took at look at the stats for The ZBuffer today and got a nice surprise - its only the 15th and I've already beaten the traffic for my best month. So I take a quick look in the stats to see what was so popular and I find that all of the increase was referrer spam. 20,000 hits alone in a 4 day period this month which has thankfully now stopped. I really don't like having bad statistics - one day I hope somebody will pay me for ads - so I spent a few hours today looking through the referrer list to pick out some keywords that I can filter on. (no I'm not telling what the list is - someone will surely use it against me. Suffice to say that online pharmacies and online casinos are the biggest offenders by far. The porn guys are barely making a showing).

Here's the before and after stats for each month

2005 11 40317 20914
2005 10 36876 36818
2005 9 29689 29586
2005 8 21566 21485
2005 7 21864 21863
2005 6 33472 33471
2005 5 36371 36344
2005 4 20637 20636
2005 3 9448 9446
2005 2 7543 7542
2005 1 9708 9708
2004 12 14366 14365
2004 11 483 483

Turns out that up till this month its really not been too bad, mostly less than 100 hits per month.

Common Sense...

I had almost given up that there was any left in the world and then today I got a $20 gift certificate and an apology from the company that refused to take my business last week. They even thanked me for my observations that even if the email address looks suspicious a valid credit card, CCV number and a shipping address that matches the billing should usually indicate a severe lack of fraud. Anyway, good job I didn't name any names eh ?

Even better the price had dropped $5 since last week so all in all the present cost $25 less....

Converting C# to J# - the Managed DirectX tutorials

After reading a complaint that there were no samples for J# and DirectX I decided it might be interesting to see how hard J# is. I did look into Java for about a week 5 years ago or so, but other than that I've never written any Java.

I decided to convert the tutorials from the SDK - they don't use the framework and they are only a few hundred lines of code. I started by creating an empty winforms application to see what the empty shell of an application looked like. To be honest its really not that different from c#. Then I cut & pasted code from the c# tutorial and changed things as the compiler complained. Here's all the things I had to change:

  • namespace X {} becomes package X;
    Its also not something that surrounds the class - its a statement at the top of the file.
  • using A.B.C; becomes import A.B.C.*;
    I'm not sure how you do using N=A.B.C; in J#, in the couple of places the tutorials used it I just fully qualifed the name in the code.
  • Math causes a clash between System.Math and Java.Lang.Math. I chose System since thats what the original code used, but the compiler warning suggests using the Java.Lang
  • class Foo : Bar becomes class Foo extends Bar
  • J# doesn't understand properties so Foo.Property becomes Foo.set_Property(value) or Foo.get_property().This was the biggest change to make as DirectX uses a lot of properties. It makes the code bigger and a lot harder to read:
    • device.Transform.World = ....
    • Color.Blue
    • device.TextureState[0].ColorOperation = TextureOperation.Modulate;
  • Also in that example notice that you can't use [] to index into collections.
  • You have to use CLR types rather than C# shortcuts
    object becomes Object
    bool becomes Boolean
  • Not being sure how J# handles parameter lists I had to create PresentParams as an array because the Device constructor expects an array. This could well be my ignorance of the language. At least the compiler told me what was wrong - the last parameter had to be an array.
  • out params don't appear to have to be specified when you call [Note. A comment informs me that 'out' isn't supported in J# so this statment is probably wrong, but I don't have time to try it or research it. Oddly I didn't have problems with the app when I tested]
  • Events don't have the += overload, you have to use objects.Add_......()
  • You can't say catch (ExceptionType), you have to put in a variable even if its not used - catch (ExceptionType ex)
  • Enums and integers don't mix. e.g. you have pass in LockFlags.None rather than 0 like the samples do. To be honest this seems very sensible.
  • typeof(object) becomes Class.ToType(object.class) - thanks to for that one
  • @"\..\..\" becomes \\..\\..\\
  • You don't have to say override to override methods
  • using () { } has be written out in full as a try/finally with a dispose()

All in all not too bad - I think it took about an hour total to get them working and most of the mistakes were my bad cut & paste between the samples. Code is in ZBuffer dowloads.

There was a F# version of some of the tutorials out there that I should dig up and look at again. Anybody know of any other esoteric languages that have sample code for DirectX - I hear IronPython is quite popular these days. Here's a list of all the languages you can use to write managed directx.

Stupid companies

One more rant for today. Yesterday I tried to order a gift for The ZChick. As always I used some shopping services on the web to try to find the best deal and I came across company X that had the best price. So I put in my order for around $50.

[no I'm not naming them, they appear to be small enough that if they search for their name this blog would come up ahead of them and whilst they are stupid they don't deserve bad press]

Today I got a notice that my order had been cancelled because the email address I used was suspicious. I've seen this before because of how I create new email addresses. I own a domain that I use for my personal emails, lets call it Its set up so that anything before the @ will come in to my mailbox. So when I do business with a new company I use That way if they sell my name I know exactly who sold it (I've caught a couple of places over the years but you will be glad to know that everyone else honors their privacy statement). So company X sees and is suspicious. I've had this happen before and once I explain the situation they all are happy to let me order.

Not company X. No, even though they had a personal reply from my normal email address they still think that this is fraud or phishing. They accused me of trademark infringement, illegal use of their domain name and threatened to report me to 'the proper authorities' in their reply. I guess my explanation of the email address was just too technical for whoever answers their customer service emails. I'm quite looking forward to hearing from email address police or whoever it is you report this stuff to.

I sent them a reply pointing out that its none of these things and that since they insist I will take my business elsewhere.

To anyone out there who wants to do business online please think a little before you attack potential customers in email - they maybe spent 10 years building web sites, working on security and other such things and quite possibly they are a lot smarter than you.

Lean, Mean, Clean geeking machine

Well I'm just about recovered from this weeks wipe the windows install and start from scratch. I used to do this fairly regularly but I've just remembered why I don't any more.

Firstly it just takes too long - I've probably spent 20 hours so far, the first 10 of which I really couldn't do anything useful on the machine since my regular software programs were not installed yet. There's probably another 20 hours to go to get all the other stuff on there - but at least that can happen in the background.

Secondly, you have to watch out for all the 'bonus' software that people think you need these days. Here's my list of offenders (note that if they offer me an up front option to say no then I'm happy and I'm not going to use your name here)

  • Adobe Reader (formerly Acrobat) - tries to install some stupid photo gallery (though it had its own installer with a cancel button) and also put Yahoo toolbar on without any mention that I noticed
  • Apple - I just want the free quicktime player. I don't want ITunes, I don't want the IPODService you gave me, I don't want the tray icon, I don't want the quickstart icons..... Aaaaaargh. Oh and you've taken away the full screen option in quicktime unless I pay. I really will be using this less and less.
  • ATI - to install the control panel software I had to install the .Net framework. Why not look for it in your installer and tell me. I installed your software rebooted and had to click through a pile of dialog boxes that still didn't tell me what was missing. I will give you a couple of points back since this was in the installation docs but who read them? And I don't want your icon in the system tray either.
  • WinFast/LeadTek - no I don't want your icon in the system tray.

And before someone complains that this has nothing to do with Managed DirectX there is a tie in. When you write good professional software read the list above and make sure your software doesn't do any of it.

  1. Make sure the users can choose where to install - its OK to put it behind an 'advanced' button but some of us don't keep program files on c:\
  2. My desktop, system tray, quickstart toolbar and favourites are MINE. At the very least ask me before you pollute them. Opting out as the default would be nice. You get one place - a folder in the start menu.
  3. I don't want free software no matter how cool it is. For a start I had to waste time downloading it.
Finding work

Anonymous Coward asks how I find the jobs I have mentioned. I've talked about how I landed the MSDN column - there was a certain amount of luck, being in the right place at the right time and being a MS employee who was prepared to initially work for free there.

The project I posted the early screen shot of came as a result of helping someone with a coding problem that the Coding4Fun guys forwarded to me because it was related to DirectShow - I managed to help them with their problem and they remembered that. I met up with the person while at PDC and he talked about an idea he had which involved some 3D and asked if I would be interested.

The other project also has a slight link back to Coding4Fun - the people involved had heard of me through that. I met up with the guys almost accidentally at Seattle Code camp and we talked about what they were doing and, as I am well known for, I offered up my uncensored opinion, which in this case was for the most part "very impressive". When they found out I was "The ZMan" they told me they were glad to meet me because they wanted to get some 3D stuff into their product. So far on this one I've just had a quick lunch to discuss involvement and I'm doing some thinking.

One thing that they all had in common is that I was already out there with a reputation - I'm not sure how anonymous you want to be but if you can't post a link to your blog showing even basic 3D work, or use your real name so I can find out how many people you helped on newsgroups or in forums then you are off to a rocky start unless your resume is already full of similar work. I already talked about some of the reasons for helping others - finding work can be added to that list. So get some demos going, blog about them and send me a link to post on The ZBuffer. Organize and speak at a code camp. Head off to the newsgroups and forums and post under a constent name or alias.

Bear in mind I'm talking side jobs at low rates or working on something for free in hope of a future pay out. Since I budgeted this year already I can afford to take those kind of risks to build a client base, portfolio and reputation - not everyone can do that.

(sorry to be so vague about who I'm working for or what I'm doing - I don't want to create a reputation of blabbing about things!)

Secret project screen shot

As part of the proof of concept for one of the secret projects - here is a screen shot. Other than some bad coding (check out the framerate for 6 spheres!) any guesses?
Secret Project

Keeping busy - but on the right things?

Well I finally managed to get myself into a coding zone that I haven't been in for many years. Coding for hours on end, not noticing that its gone dark outside and I should really have turned the lights on and forgetting to let the ZHounds outside.  One night I even forgot to feed the poor things - of course they came to find me before I was an hour late.

Sadly the thing I was coding has nothing to do with games, managed directX or even 3d graphics. So how do I justify spending the time on it? Well I have been out of coding for quite some time so right now being in the zone and coding things I've not done too much of is still valuable to me. I've had to deal with threading issues, PInvoking to an old C DLL, delegates, callbacks and lots of other things I've heard of and seen in others code but never actually done myself (remember that I hit 'management' at Microsoft just before .Net was released so though I stayed fairly active in tinkering, bug fixing and code reviews its hard to say that I had ever done something solid in .Net). No I'm not telling what it is - I don't talk too much about projects in progress becuase 1. I might want to sell something one day and 2. I might never finish it.

I had to stop doing that because I'm currently working on a design and a quote for a company that need a small 3d visualizer for a project - we've yet to agree on a fee but it will be my 2nd paid gig after the MSDN articles. It will use Managed DirectX so when completed I will put a link up on The ZBuffer.

Just to be even more secret I had a meeting with another company this week that have a project that currently supports 2d graphics using GDI. They want to expand it to do both the 2D using DirectX and add some 3D aspects. Its not something they have announced yet hence it has to be kept under wraps. At the moment the product is a free download but the intention in the future is to have paid versions so there will hopefully be some money in that for me as well.

So 2 projects that are MDX and 3D graphics related that may generate some income. Tough decisions since they are not actually games which is where I want to be, but they pay now and games are more risky. I know that technically I budgeted to be able to do this year with no income at all but if I can make some money then it extends how long I can do this for. Right now I have decided I will take the side jobs if they have some Managed DirectX or 3D graphic content.



This Blog