dotNoted

Icon

Observations of .Net development in the wild

Wix being dogfooded

Looks like Wix (Windows Installer XML – MS’s first open source project, and the installer technology we use for a number of products) is making it mainstream, getting out in actual products by Microsoft, not just obscure development tools…

 

 

Filed under: Software Engineering

Some free books on map making and geospatial measurement

 
Geodesy for the layman:
Older, but a good introduction to finding points on the earth’s surface – an important aspect of GIS.
Map projections; a working manual
Good material for understanding how to move earth bound points to a 2D surface. A bit thick, but some good parts.

Filed under: GIS

Getting today’s date (without the time) in TSQL

 
 

 
 
It’s a technical term for spanglish.
 
It also makes a lot of sense when constructing software, and we get to jump back and forth between languages.
 
Going between different imperative languages isn’t too hard, although I’m beginning to use the -> operator in C# more often (and am now convinced it is better where ref objects are concerned in .Net – since the semantics are so different between heap and stack types.) Going between language styles, like imparative to declarative, or functional to imparative things get more tiring. But some things are just easier expressed in one language style vs. another ((HT|X)ML comes to mind as the most oustanding – coding it imparatively just is awful).
 
Case in point: try to get today’s date without the time from T-SQL. Go ahead….
 
Yea, it’s ugly. This is as good as I can get it. Your comments to improve it are appreciated…

DECLARE

@today varchar(30)

SET

@today = CAST(YEAR(getdate()) as varchar) + RIGHT(’00’+CAST(MONTH(getdate()) as varchar), 2) + RIGHT(’00’+CAST(DAY(getdate()) as varchar), 2)

Of course, this is implicitly convertable in TSQL…

DECLARE

@tdate datetime

SET

@tdate = @today

PRINT

@tdate

Filed under: Code Kaizen

SendTo Visual Studio for Debugging

Can’t believe I hadn’t thought of this before…
 
More than that, I can’t believe I can’t find _anyone_ who hasn’t thought of this one…
 
Sometimes, you need to be able to grab onto an EXE before it launches with a debugger and watch everything it does for some clue of what is going wrong. I’ve been working on an interop layer from PowerBuilder to .Net via a set of unmanaged interfaces on the PB side (PBNI) and C++/CLI on the CLR side. Right before last week’s demo, the mapping application we’re building stopped working completely and unexpectedly, where the run before it was working. Turned out that it was due to me writing to the event log without a defined event source (still can’t explain why it worked in the first place). The only way I found that out is by grabbing the EXE on launch and watching where it failed, since it is a Powerbuilder app, and it doesn’t generate debug info when it creates the EXE file… and forget about using the Powerbuilder IDE to do anything. It becomes more of a basket case than the program I’m trying to debug!
 
The only way I knew how to do this is by creating a new key in the HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options registry key with the name of the file, and a string value with "devenv.exe /debugexe" as the data. Everytime you launched the EXE on the system, it would bring up Visual Studio instead, and you could debug the process. This worked, but it was a pain to manage the key.
 
Enter "SendTo". It is a directory in your profile (C:Documents and Settings<your user name> by default). Create a shortcut there called "Visual Studio to Debug" and make it point to ‘"C:Program FilesMicrosoft Visual Studio 8Common7IDEdevenv.exe" /debugexe’. When you right click an EXE, choose this new option in the "Send To >" menu item, and Visual Studio will come up with the EXE ready to launch. Ahh… much more efficient.

Filed under: Tools