Archive for July, 2004

Have to blog some error pages

Saturday, July 24th, 2004

Because I’m a geek, I want to make my own error pages for my site. However, I don’t want the stupid things to look completely different from the rest of the site, and I don’t want to have to change the stupid things every time I change the UI for my site (which I like to do). Hence, the blog entries that are the redirects for my error pages. I’m gonna do 404 first, since it’s nice and easy… maybe forbidden (403) after that. Whee!

Serializing the game data

Saturday, July 24th, 2004

So I’m working on the level designer for my game, Runner (in stores near you in 2006 or so). Up until tonight, I’ve been envisioning the game data (the levels and scripts) being stored in an XML format on disk, so that someone could come along, grok my nice open format, come up with a better editor for the data than I could, and thereby enhance my game.

However, serializing into XML has no middle ground: it is either blissfully easy or incredibly, painfully, hard. Despite the help from such wonderful tools as Chris Sells’ XmlSerializer Pre-Compiler, which I first heard about from Christoph and his article about the XmlSerializer, and some exception digging and Googling, it seemed like it was no dice for my game data being easily saved into XML.

“Wait a minute,” I thought to myself. “I don’t want to futz around figuring out how to save the stuff, I want to get on with making cool game stuff!” So I relied on the good ol’ System.Runtime.Serialization.Formatters.Binary.BinaryFormatter which saved my data, with only two hitches, directly into a binary format. What were the two hitches? Seems that the BinaryFormatter has problems with System.Drawing.Pen (fine, no problem), and, more worryingly, it can’t deserialize a non-public delegate into an event. Makes sense (it is private, after all)... but it still kinda sucks. Lucky for me, I only had to change one delegate/event pair to workaround this. And what have I lost? Nothing, so far, as long as I abstract away from the BinaryFormatter stuff so that all anyone knows about is Save() and Load(). I think I’m set.

Very cool.

The Church of Bush

Friday, July 23rd, 2004

The Village Voice has a neato article about The Church of Bush. I’m opposed to George W. Bush; I’ve disagreed with many of this administrations policies, especially in its handling of foreign affairs. So, in a Taoist-political turnabout, I’m sure that there are people who agree with the man on almost everything he does.

This article, however, caters more to people like me. It goes a little too far with the personal jibes (such as asking what kind of man could ”...go on a fishing trip while his daughter was undergoing surgery, and use the world’s media to mockingly order her to clean her room while he was away…”) but the premise is basically sound: why are people blind to the truth of this man?

Truth is a very subjective thing, it’s true… things that people found very distasteful about Clinton I hardly noticed and I cannot, in good faith, claim that the foibles I overlooked in Clinton wouldn’t become character flaws in Bush… but the facts seem staggering to me: cutting veteran’s benefits, taking the strongest economy into the biggest defecit since at least Reagan (even adjusting for wartime spending), invading Iraq looking for WMDs that we were so sure were there we were willing to destroy a country (oops, sorry ‘bout that guys), and meanwhile he’s this great man? This compassionate man? I don’t buy it.

So, Linda Ronstadt soapboxes aside, could this man please not be our president next term? Could this administration please be replaced? I’m not necessarily a huge Kerry/Edwards fan (Howard Dean was more my speed, despite the anger), but anything’s gotta be better than this.

Sometimes I hate English

Friday, July 23rd, 2004

The French call it esprit de l’escalier, while the Germans use the even more fun treppenwitz. Both mean the same thing: the “spirit of the staircase”, which is when you think of that perfect rejoinder to that tremendous jerk’s “witticism” once you’ve left the room but would look like a doof using it now.

And do you know my favorite treppenwitz?

A positive Microsoft support experience

Thursday, July 22nd, 2004

I just got off the phone with a Microsoft support person. I was having this weird problem with Visual Studio at work, and seeing as we’re in the first week of a development cycle, having to stop for four hours to fix one’s development environment just plain sucks.

After speaking with two very polite people, I got to speak with Alden. Alden was friendly, got to the point, wasn’t condescending, and, in the end (after 3 hours!) fixed my problem. I owe him big.

Here’s my problem, so that someone, somewhere, might see this and learn from it: last week, after a restart due to Windows Update, the program I’m working on here at work wouldn’t work. It gave this really weird error at runtime: “Delegates must be of the same type”. This is a weird error for two reasons: because this is something that the compiler should have caught in the first place, and because the source file in question (where the runtime exception was being thrown from) hadn’t changed in about a week. Suddenly, after I do a Windows Update, my C# compiler is generating bad code? Weird.

I uninstalled the hotfixes, re-installed the framework, the third-party component that we’re using that was slightly involved, and, eventually, Visual Studio .NET 2003 itself (two, count’em two hours for that alone). Finally, the problem disappeared. However, in the back of my mind was the sneaking suspicion that it would be back.

Which it was, today. Since it happened again, I figured that I’d better bring in the big guns and get some Microsoft support through our MSDN subscription… turns out that the Windows Update that went through today (requiring a restart) munged up Crystal Reports… Now, I don’t need Crystal Reports, nor have I ever even used Crystal Reports, but I’m a completist, so I installed everything I could when installing Visual Studio last time. After removing Crystal Reports, everything smoothed right out. Voila!

So… thanks, Alden. And, if you’ve just got a Windows Update and Visual Studio doesn’t work anymore, try uninstalling Crystal Reports. Is that enough keywords for you, Google?

Resharper hits 1.0!

Thursday, July 22nd, 2004

Visual Studio is finally progressing beyond the Stone Age of source code editing, thanks to JetBrains, the makers of IntelliJ: Resharper has hit 1.0, and it’s only $99 per user.

I’m not a Java developer. I can program in Java, but there’s a distinction between being a programmer and being a developer. It doesn’t take a Java guru, however, to appreciate a beautiful goddamn piece of editing software: IntelliJ just plain makes me drool with geek lust. Live templates, smart replacement, refactoring built in… it’s got everything you need to increase your productivity by an order of magnitude while developing in Java.

Meanwhile, I’m stuck with Visual Studio .NET 2003… it doesn’t have refactoring, variable renaming, live templates, or any of that. Sure, it has IntelliSense (and thank God for that), but that’s a long way from what it could be. Enter the greatness that is JetBrains, the maker of IntelliJ. Taking pity on us poor C# fools, they’ve created an add-in for Visual Studio called Resharper, which lets us harness some of the power of a modern source editing tool. If you haven’t seen it before, go download it right this instant. You will discover what it means to have a pleasurable programming experience.

Not only that, but they have this great idea: the early access program. Ryan posted an article about what he calls an “open development process”, where the users may download betas of the program, test it out, offer feedback, and there is a direct line of communication between the developers and the people who intend to use the software. Not only do the customers get what they want out of the product, but, when it comes time to release, you have a loyal customer base ready to sing your praises. I couldn’t agree more; I, too, wanted to do this while we were at OpenStorm. Oh, well…

I can’t remember the last time I’ve used so many links in one post. Whee!

Nice article on SignedXML

Thursday, July 22nd, 2004

I found a nice article on SignedXML. Seems like the people at SevenObjects are making a quick buck of a licensing scheme that this guy just exposed.

Of course, I’m the guy who paid the $11 for the licensing component. At least I didn’t have to write it myself. ( =