Saturday, November 29, 2003
Today I Am 0x20
Wednesday, November 26, 2003
Away From Keyboard
This week is the Thanksgiving holiday in the US. Next week I'll be in Zurich, Switzerland, speaking at DevDays. As I have no idea if I'll even be able to get online in Europe, the blogging will be a bit light for a while, and I might be a bit slow on the email uptake.
The good news (unless you think not hearing from me for a bit is the good news) is that with my DevDays slides finally done, I can spend my weekends on something else. I plan to use some of that time to write a bit more in the ol' Direct3D Tutorial Series, which I have sadly neglected. That plus a port to dasBlog should keep me busy.
Monday, November 24, 2003
Test Driven Development Introduction
Peter Provost has a great introduction
to test-driven development here.
Although I haven’t yet read any of the Extreme Programming canon, I have
been doing a lot more programming over the last year than was previously the
case, and I find myself gravitating naturally towards some of the precepts of XP.
I’d love to give Test-Driven Development a full-blown try, but when you’re
a consultant, you have to go with what the client wants. Maybe I can find a way to
work it in to one of my side projects.
Found Some New Shortcut Keys
I've always been a big fan of shortcut keys. Today I happened
to mistakenly hit a few keys, and discovered a few more I never knew about (this is
on Windows XP).
WinKey + LeftArrow = Minimize Current Window
WinKey + UpArrow = Maximize Current Window
WinKey + DownArrow = Restore Current Window
Now if I could just find the shortcut key for FixBug.
Or better yet, CureSleep.
Update: I'm a big fat idiot.
So it seems these aren't commands that are built into the shell, but rather just some
of the default mappings added by WinKey.
WinKey totally rocks - I use it so much, I even forget that it's there. Like I did
for this post.
Friday, November 21, 2003
ASP.NET Quirklet - Nested VDirs
I ran into something that took me almost all of yesterday to figure out. I was trying
to set up a series of virtual directories in IIS. The basic idea was that I had a
set of ASPX pages and a set of ASP.NET Web Services, and that they should be organized
under a single URL, like http://localhost/MyApplication.
I couldn’t put everything into the same virtual directory, because we already
had a disk structure defined that located the ASMX and ASPX pages in different places.
So I figured I’d map /MyApplication to the ASPX directory, and just create a
child virtual directory like /MyApplication/WebServices that mapped to the ASMX directory.
(You did know that virtual directories can contain other virtual directories, didn’t
you? And that they can point to any physical directory, even one that isn’t
a child of the parent vdir’s physical directory?)
The problem I ran into immediately with this approach was that some of the settings
in my ASPX web.config were incompatible with my web services. This is a problem because
many web.config settings are inherited by child virtual directories. My solution to
this was to create two children of /MyApplication - /MyApplication/UI and /MyApplication/WebServices.
Both children had to be proper virtual directories, and not just regular directories
underneath a virtual directory. This is because
1) The
two physical directories in question don’t share a common parent physical directory,
and
2) Some
of the things in my web.config file only work when the web.config file lives in a
virtual directory root.
It was a bit annoying that I was going to have to type http://localhost/MyApplication/UI
instead of http://localhost/MyApplication to get to the ASPX pages, but it’s
a minor annoyance, and if it really bugs me I can fix it later with a server-side
remapping or a simple client-side redirect. So I mapped the parent virtual directory
off to a random empty directory on my hard drive, mapped the two child vdirs off to
the appropriate place, and went on coding.
Everything was going great until I tried to install the stuff on someone else’s
machine. I’d written a setup script, and although it seemed to run to completion,
the app didn’t work when I was done. It was failing in all sorts of weird ways,
doing things it just shouldn’t. Most troubling was when it would error out because
it couldn’t find the current username…because even though I had ASP.NET
Forms Authentication set up, it was never redirecting to the login page!
Ultimately, I found the answer through trial and error. It turns out that during setup,
the check-out from source control wasn’t creating the empty directory that the
parent directory virtual directory was mapped to. And for whatever reason, if you
have nested virtual directories, if the parent directory does not exist, ASP.NET
completely ignores the web.config files in the child virtual directories. Leading
to the highly confusing behavior I mentioned. The solution was simple: just make sure
the parent vdir points to a valid physical directory, and everything returns to normal.
Wednesday, November 19, 2003
Keith's Book Feed
Keith Brown has his new security book online. And when I say “online”, I mean he’s actually writing the darn thing right there on his web page. Even better, the book has an RSS feed. Subscribed!
His last book was excellent – I’m sure this will be the same.
Monday, November 17, 2003
I Am the #1 Google Hit for "Build An Army of Giant Nuclear Powered Robots"
How cool is that? Evil supervillians of the world, eat my Google dust! :)
It’s this previous post, by the way. Kudos to Rob Engberg for both inspiring the original post and pointing out the tasty Google goodness.