Posts

Showing posts from July, 2006

Some Basic Rules of Development

I've been developing software by myself for the better part of 20 years now, and in a team environment for at least the last 6 years. Here are some of the lessons I've learned along the way. Not all of these are 100% my own ideas, but I can state that I've "taken ownership" of all of them, having been both a developer and a development department manager: 1) A development team should have a single design authority. The best systems have one member of a team who dominates the design and development and has a clear view of where the system is going. Without this strong focus and lead, many projects throw together a set of conflicting ideas and the system will ultimately stagnate or become extremely difficult to maintain. This person needs to be big on communication and small on ego. 2) Code should be documented, but not overdocumented. Lots of documentation does not equal good design and will not guarantee a good, well designed system. A system can have a good desi...

Asynchronous Fire and Forget Pattern Redux

Illustrates the use of the Asynchronous "Fire and Forget" Delegate invocation pattern in .NET. Sample console app performs enqueing of 100,000 Sql Server inserts with this pattern in from 2.5 to 5.5 seconds, depending on the machine setup. Complete source code download. read more  |  digg story

Build a .NET Windows XP 'Site Changer' Utility

There are several hacks and utilities to enable multiple web sites on Windows XP IIS, but they have nasty side effects. This simple .NET utility just changes the home directory location of the default single site, and has no side effects. Complete source code. read more  |  digg story

Unable to install Visual Studio on a 64-bit Operating System

This is a strange one indeed. I got a new laptop (64-bit of course) and put Windows XP Pro x64 on it, Everything is installed perfectly, including VS.NET 2003 Enterprise and VS.NET 2005 Pro. Now I notice I have ASP.NET debugging issues in VS.NET 2003. So I figure I'll do a reinstall or repair on VS.NET 2003 to see if that takes care of it. Go to Control Panel, Add/Remove, click on the "Change" button for VS.NET 2003 with the DVD in the drive, get an error dialog. OK, let's just run setup.exe off the DVD, right? You get: "Unable to install Visual Studio on a 64-bit Operating System". DOH! It already installed, right? I'm not going mad or anything. OK, we try running the .MSI directly. It runs OK, starts gathering information, and then it QUITS! There is very little information on this anywhere. Does anybody have any ideas on this? It's not a big deal for me, VS.NET 2003 runs fine, its just that I get "Unable to Start the Debugger" error...

Binary Serialization To / From String and Encoding

Recently somebody posted on the C# language newsgroup that they couldn't figure out how to convert an object to a string (and the reverse) since all the examples only showed how to write / read to a file. I chimed in that I thought what the OP really meant was "how to convert a stream to a string" (as in using the BinaryFormatter for serialization), and so I posted the following sample: Stream to string: byte[] b = MyMemoryStream.ToArray(); string s = System.Text.Encoding.UTF8.GetString(b); String to stream: string s = "whatever"; byte[] b = System.Text.Encoding.UTF8.GetBytes(s); MemoryStream ms = new MemoryStream(b); Friend and fellow MVP Jon Skeet, who is pedantic to a fault, responded with this: "That's a way which is almost guaranteed to lose data. Serialization with BinaryFormatter produces opaque binary data, which may very well not be a valid UTF-8 encoded string. To convert arbitrary binary data to a string and back, I'd use Convert.ToBase6...

World War III and the Lessons Of History

"This is World War III. This idea that we have this one-sided war where the other team gets to plan how to kill us and we get to talk, is nuts." -- Newt Gingrich While Newt tends to be a little "over the top", sometimes, he's got a point. If we would observe the lessons of history and stand up to bullies early on, instead of engaging in social masturbation (diplomacy) so much, decisive action could have gone a long way toward eliminating a lot of the problems with North Korea and the MIddle East. Iran is clearly behind the Hezbollah attacks from Southern Lebanon and Hezbollah, Iran's little puppet regime, has the same stated goal as does Hamas - the destruction of the State of Israel. It never ceases to amaze me how otherwise intelligent diplomats and leaders of democratic nations fail to understand that you cannot negotiate with somebody who wants to kill you as their primary objective: Terrorists : We are going to kill you. Death to XXX! Country: L...

Sets of "101 Code Samples" For Visual Studio.Net And SQL Server

This details links to some of the better code samples for Visual Studio.NET (2003 and also 2005) as well as SQL Server 2005. While targeted at beginners, even expert programmers will find these useful. read more  |  digg story

Logical Fallacy, and Code Monkey.

If you follow any discussion topic or newsgroup thread where a debate of sorts ensues, you are just as likely to see examples of logical fallacy. Wikipedia has a pretty good write-up on it here. The most common examples, and a few short illustrations: Ad baculum Ad hominem Affirming the consequent Appeal to authority Appeal to fear Appeal to pity Appeal to tradition Appeal to probability Appeal to the majority Argument from ignorance Begging the question Biased sample Correlation implies causation Equivocation Hasty generalization Post hoc ergo propter hoc Straw man Ad baculum: If x does not accept that P, then Q. Q is a threat or attack on x. Therefore, P is true. In other words, "This is right because if you do not believe it, you will be beaten up." Ad hominem: A (fallacious) ad hominem argument has the basic form: A makes claim X. There is something objectionable about A. Therefore claim X is false. "Only right-wing nutjobs believe that homosexuals account for one t...

Who says Game Developers don't use .NET?

Image
Recently I took my kid to a local bowling alley that has a nice game room where he likes to play racing car type-videogames. The first pic below, which I snapped with my camera phone, shows the front of "Need for Speed Underground" by EA. But, what's that whitish looking thing in the middle of the screen? Well, as can be seen in the following close-up, it's the Common Language Runtime Debugging Services dialog for an unhandled exception ! Looks like our EA lead developer didn't finish his last debugging session, heh? Of course, I must admit this is somewhat familiar -- where I work, the QA Department consists of "push it into production"! Kudos to EA for some cool game programming with .NET and DirectX. But - BADDD on the developer who didn't put in an unhandled exception logger that would restart the app and let the poor user who just dropped three quarters in there get a free game... the high road is "oops - we screwed up - the next game i...

Loss of Keyboard functionality in Visual Studio 2005 -- and a FIX!

Its funny but last night I installed IE 7, BETA 3 on my AMD x64 system running Windows Enterprise Server 2003 x64 Edition and just this morning I noticed an issue that had been reported back during BETA 2 of Visual Studio 2005 - all of a sudden in a Web Application project, the enter key, the F11 key (continue step through breakpoint), backspace and a couple others quit working. CTRL-V (Paste) and CTRL-C (Copy) etc. also don't work. This has been described by Developers as "The Haunted Keyboard" bug, and was supposedly fixed after BETA 2. The only problem is, I'm getting to see the re-runs. [NOTE: There is a FIX for this at the bottom of this post] In fact, at first I thought it was my keyboard because it has a short cord and I've got it snaked behind the monitor, over the back of my desk, and then back up front under the desk to plug in the back of the CPU on the floor, and several times I"ve booted up in the past with no keyboard (probably from pulling on t...