Posts

Showing posts from July, 2005

Terrorism: It's a Dog's Life! And, It Just Works...

This morning I heard a piece on the K9 Enforcement Detection program. These dogs, many of which come from animal shelters because their feisty behavior (good for this program) was too much for their original owners, have detected over 40,000 concealed HUMANS in cargo, etc - not to mention tons of explosives and drugs. The dogs are trained that if they smell a human they can't see, they should make an alert to their handler. All the training is basically positive reinforcement and play to the dogs. This program costs a measly $3.5 million a year, a drop in the bucket compared to the multimillion dollar high-tech equipment we have that's designed to do to same work and may actually be more effective than the machines. In addition, the dogs are highly portable and can be flown anywhere on a moment's notice. Support our Troops - Woof! It Just Works I had to do another C++ conversion recently on a custom C++ program that takes a file and a password and performs a custom XOR MD5

ASP.NET 2.0: Strange 404 Errors and the "App_Offline.htm" file

If you get strange HTTP 404 errors in your ASP.NET 2.0 application, always check for a zero-length "magic file" called app_offline.htm and delete it. If this file is present in your web site, then the entire application will be considered offline by the ASP.NET runtime. There is actually a button that says "Take application offline" which creates this file, but unfortunately the "magic file" can also "magically appear", so you can spend quite some time chasing bugs that aren't there. Post-beta 2 builds are expected to provide a proper explanation. The reason it can appear by itself is that it's used to "take the application offline" when copying a web site. If this operation crashes somewhere in the middle for some reason, the file doesn't get deleted. For ADO.NET and Databases, if ASP.NET has open connections, you can shut down the application domain by adding a file named "app_offline.htm" to the Web applicat

Don't have to Pee in the Boat!

This comes up so often (guilty of it meself) that I have to write about it. Programmers often come up with a scheme of logic in how they are going to implement their particular business scenario. Sometimes it is elegant, sometimes it's complicated. But more often than not, it isn't always completely "thought through". Consider: Two Irishmen are fishing on a lake. One pulls in a bottle, and as he unhooks it from the line, a genie pops out and offers him one wish. "Turn the lake into beer", the fisherman says. Genie waves his hand and -- "Poof" -- the whole lake turns into sparkling Harps! Fisherman turns to his buddy and says, "Well, what do you think?" His buddy says, "You jerk! Now we'll have to pee in the boat!" Do you find yourself often having boxed yourself in, without a clear path to the Mens (or Ladies) room, and no key? And you have to "Pee in the Boat", e.g. you have to work around all the code you have al

IISRESET Yields "Class not registered", ASP.NET 2.0 Solution Model, and Virtual Earth

Here's the fix: Use the following command: C:\Windows\system32\inetsrv\iisrstas.exe /RegServer While I am on this, IISRESET comes with some handy command line switches that many people are not aware of: IISRESET.EXE (c) Microsoft Corp. 1998-1999 Usage: iisreset [computername] /RESTART Stop and then restart all Internet services. /START Start all Internet services. /STOP Stop all Internet services. /REBOOT Reboot the computer. /REBOOTONERROR Reboot the computer if an error occurs when starting, stopping, or restarting Internet services. /NOFORCE Do not forcefully terminate Internet services if attempting to stop them gracefully fails. /TIMEOUT:val Specify the timeout value ( in seconds ) to wait for a successful stop of Internet services. On expiration of this timeout the computer can be r

An Interesting Story about Contract First (and other tidbits)

This morning I had the simplest class, marked Serializable, and ran it through an XmlSerializer test just to "be sure". Little booger started throwing those weirdo XmlSerializer exceptions. They are so hard to understand, even if you look at the InnerException, its enough to make you go stark, raving mad. Finally, I thought, "How about doing it backwards?" In other words, Let's write the XSD Schema and be happy with it. Then, we just fire up XSDObjectGen and let the tool generate the class, right? Well, it serialized perfectly right out of the box. I had gotten a property assignment wrong (mistakenly assigned to the public field instead of the private one in the ctor). There's something to be said for Contract First! On a somewhat related side note, Oleg Tkachenko, XML MVP, has announced that XPathReader 1.1 is available . Nice Stuff, lean and mean XPath rocks! And another: this morning I spent some time letting FXCop have fun with the assemblies in my l

Some observations on Script Callbacks, "AJAX", "ATLAS" "AHAB" and where it's all going.

I've taken a more than cursory interest in the whole Remote Scripting (.NET species) vs. AJAX and now ATLAS discussion, mostly because I started using Remote Scripting since Microsoft first released it, and because I continued to refine it after seeing Brent Ashley's excellent work with JSRS, which was one of the first "real" cross-browser solutions back in 2000 (that's the turn of the Century for you history buffs). Now Bertrand Leroy, a Microsoft guy whose work I like , has authored some very interesting ASP.NET 2.0 script callback stuff that he points to on his blog, and he is obviously (at least, to me he is) involved quite heavily in the development of this new ATLAS infrastructure that they'll preview at PDC. Leroy's most recent post brings to the surface what I agree are the major differences between the "AJAX a - la .NET" approach as popularized by Michael Swartz with his AJAX.NET library, and Leroy's RefreshPanel, the ASP.NET 2.0 b

Who says programmers can't find religion?

Image

Revealing our Sources, Protecting our Butts, or just plain Treason?

Special Counsel Patrick Fitzgerald, a Justice Department prosecutor, is trying to determine who in the Bush administration leaked the name of covert CIA operative Valerie Plame in 2003 to the media and whether any laws were violated. Plame's name was leaked, her diplomat husband said, because of his criticism of the Bush administration's handling of the Iraq war. Right. So Judge Hogan orders Judith Miller to jail, saying confinement at a jail in the Washington, D.C., area might convince her to change her mind and testify. Meanwhile buddy Time reporter Matt Cooper gets a convenient phone call from his "source" who suddenly tells him it's OK to squawk, and so he doesn't go to jail. Yup, its Cooper and Time who are the chicken-shits! Kudos to Miller, she has enough guts to stand by her principles as a professional journalist, whether you agree with her or not. Meanwhile Bob Novack, not exactly Mr. Liberal, and the real potential villain in all this, is nowhere

Contract First and XSDObjectGen

I have been a fan of the concept of "Contract First" development, particularly where XML - based messages can encapsulate the data. This works not only for webservices, but for most any type of business object. The general idea is that if you can "Schematize" the objects at the message level, your customers or partners can get a copy of the schema and begin their part of the work about consuming your stuff even before you write any code. This concept has not been lost on the folks at Microsoft. Not only have they incorporated the Application Connection Designer in VS.NET 2005 Team System, there has been significant work along these lines by some of the XML and webServices luminaries such as Christian Weyer and others. The MS XML Team Blog is another good place to start for resources and links. Aaron Skonnard has a series he is doing on this at MSDN . Enter XSDObjectGen from Colin Cole and Dan Rogers at Microsoft. This is a big step in the right direction, bec