Azure’s Service Bus and EnergyNet (PDC Day 0)

On Day 0 of Microsoft PDC, I attended the Software in the Energy Economy workshop. Much to my surprise (and disappointment), we didn’t talk about energy for the entire first half of the workshop. Instead, it was about Azure’s Service Bus. BAD Microsoft!! It was explained to us by Juval Lowy that he wanted to do it entirely on energy but Microsoft forced him to have half of the talk on the service bus. Now I can understand this from Microsoft, but this should have been clear to the people there. Honestly, I would have much preferred to go to another workshop than to learn about the Azure Service Bus. Cool stuff but my current analysis of it is that it’s way too unreliable (I don’t mean bugs, I mean lack of transactional support) and it is simply missing some of the things that I would want/need in such a system, like queues! There are hacks to implement them, but I don’t want to have such an important foundational part of my architectures built on hacks! Anyways, that can be for another day (gotta get to the keynote).


Rendering a Custom ASP.NET Control when Disabled by Parent Container

So I was performing some maintenance work on some webform stuff in an application and ran into a problem where an existing custom control, which I have the source for so I can fix it (yay!), wasn’t properly disabling itself when it was in a container that became disabled. The way it works, it overrides the rendering process and spits out lots of HTML and javascript (eww!) but for the important things for this rendering, it looks at a custom “ReadOnly” property on the control to enable/disable the appropriate things. So essentially the control is always enabled except when that flag is set to false – a bad idea!


Indianapolis gets T-Mobile 3G!

Like many others, I got my Android G-1 phone a couple days before it was officially released and have been longing for when Indy would finally get 3G coverage. Lo and behold, I get out of the shower this morning to check the weather and my 3G icon is lit up, albeit with only 1-2 bars (out of 4). Did some surfing and it seemed to load quickly just like it has when I’ve traveled to 3G cities (San Diego, LA, Chicago, etc.).


Installing Windows 7 or Windows Server 2008 R2 from USB Stick

With Windows 7 and Windows Server 2008 R2 recently going RTM, I’ve found myself installing them in quite a few different configurations. One configuration that I’ve recently ran into is installing it into a machine with no CD drive of any means. I know I could carry around a USB-based DVD drive but instead, I wanted to have a USB pen drive to install it from. After some research, I found that it was relatively easy to create such a tool!


Going to PDC 2009

Yesterday I got the thumbs up that I’m being sent to PDC 2009 by my company! I planned on going whether I was sent or not but it’s nice to not have to foot the bill out of my own pocket this year. In 2005 I was lucky enough that my company covered airfare and hotel while Telerik was generous enough to cover my registration for the conference and the pre-conference. Last year I wasn’t so lucky and had to cover almost all of it out of pocket but that’s what you expect as a contractor.

Here’s what I have to do:

Pragmatic Spaces ’09

Pragmatic Spaces 2009 is coming soon.

Known details for now:
1. Limited to 150 people
2. You want to be there
3. There will be GREAT discussions you WON’T want to miss!
4. #pragma09 is something to watch for!

While not directly related to Indy ALT.NET, many of the folks from that community are involved in this event. Alan Stevens will also be an important person for the event.

NAnt – Detect 64-bit or 32-bit OS

I was working with Cody Collins and we ran into a problem recently with detecting whether the OS running was 32-bit or 64-bit from within NAnt. We’re trying to automate the installation of some software that has separate installers for 32-bit and 64-bit and we need to determine which installer to run from NAnt.

The problem begins with NAnt being compiled for 32-bit mode only which means all 64-bit functionality is transparent to it. If it weren’t for that, then we could simply depend on the PROCESSOR_ARCHITECTURE environment variable. So if you try to ask the OS if it’s 64-bit, it will tell you that it isn’t. Luckily there is an IsWow64Process WinAPI call that you can make to determine if you are running in WoW64. From these two pieces of information, you can infer whether or not the OS is 64-bit.

Cody and I were able to come up with the following scripts to determine this.

Note: This runs unmanaged code and does not protect you from crashes there – this could be better but this should get you 90% of the way there. This has been tested on Windows XP (32-bit), Windows 2003 (64-bit), Windows Vista (32-bit and 64-bit), Windows 2008 (32-bit), and Windows 7 RC (64-bit). Not an exhaustive test but it covers many of the bases.

<property name="Is64BitOperatingSystem" value="false" />
<property name="Is64BitProcess" value="false" />
<property name="IsWow64Process" value="false" />
<target name="DetectOperatingSystemArchitecture" depends="DetectIfWow64Process,DetectIf64BitProcess">
		This will detect whether the current Operating System is running as a 32-bit or 64-bit Operating System regardless of whether this is a 32-bit or 64-bit process.
	<property name="Is64BitOperatingSystem" value="${IsWow64Process or Is64BitProcess}" />
		<when test="${Is64BitOperatingSystem}">
			<echo message="The operating system you are running is 64-bit." />
			<echo message="The operating system you are running is 32-bit." />
<script language="C#" prefix="MyWin32Calls">
	< code>
		< ![CDATA[
			public static extern bool IsWow64Process(System.IntPtr hProcess, out bool lpSystemInfo);
			public bool IsWow64Process()
				bool retVal = false;
				IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, out retVal);
				return retVal;
	< /code>
<target name="DetectIfWow64Process">
		Detects whether we are currently in a WoW64 process or not.
	<property name="IsWow64Process" value="${MyWin32Calls::IsWow64Process()}" />
	<echo message="Setting the [IsWow64Process] property to ${IsWow64Process}." />
<target name="DetectIf64BitProcess">
		Detects whether we are currently in a 32-bit or 64-bit process (not necessarily what the OS is running). Note that as of the time of this writing, this will ALWAYS return false because NAnt is compiled to run in 32-bit mode only.
	<!-- This can return x86, x64, AMD64, or IA64 as of the time of this writing. This works for a 32-bit process in a 64-bit OS because the OS makes the 64-bitness transparent to the process in this environment variable. -->
	<property name="Is64BitProcess" value="${environment::get-variable('PROCESSOR_ARCHITECTURE')!='x86'}" />
	<echo message="Setting the [Is64BitProcess] property to ${Is64BitProcess}." />

On a 64-bit OS, it has the following output:

D:\bin\deleteme\nanttest>build DetectOperatingSystemArchitecture
NAnt 0.85 (Build 0.85.2344.0; rc4; 6/2/2006)
Copyright (C) 2001-2006 Gerry Shaw
Buildfile: file:///D:/bin/deleteme/nanttest/
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: DetectOperatingSystemArchitecture
   [script] Scanning assembly "lsbw4oxa" for extensions.
     [echo] Setting the [IsWow64Process] property to True.
     [echo] Setting the [Is64BitProcess] property to False.
     [echo] The operating system you are running is 64-bit.
Total time: 0.2 seconds.

Happy NAnting!!!

*heads off to the IndyALT.NET meeting on Continuous Integration now…*

Truncate Logs for SQL Server 2008

I had previously posted how to Truncate Logs for SQL Server 2005. Unfortunately, this method does not work in SQL Server 2008. The reason is because the “WITH TRUNCATE_ONLY” command is no longer in SQL 2008. Assuming you run in full recovery mode, the new script to do this is:

USE [{DatabaseName}]
DBCC SHRINKFILE({TransactionLogLogicalName})

Simply setting the database mode into simple recovery mode performs the actual truncation but the file is not shrunk by that. DBCC SHRINKFILE will take care of that second step. And don’t forget to put it back into full recovery mode at the end!!


How to identify the user your ASP.NET app uses to authenticate as

I was recently asked how to identify the user your ASP.NET application uses to authenticate as. This can be a simple question or a bit more involved. Let’s start with the simple answers first.

Default Accounts:
Windows XP, Windows 2000, and earlier (you should NOT be caring about earlier!):
ASPNET – this is created automatically by the .NET Framework

Windows Vista, Windows 2003, and newer:

Overridden Examples:
Just because that is the default, it doesn’t mean that it is that way for your application. The first place to check is in the Advanced Settings for your Application Pool. This should tell you the account your application will default to if you don’t override it within your application.

Next, you can check your web.config to see if you’re application is impersonating a user. This is the next level of defaults to check. (and perhaps machine.config too, but you should probably NOT be overriding it there!) This will override the above defaults.

Now that you have checked there, the next thing to do is identify what type of IIS Authentication is being used. If anonymous, then you’re done – it will default to the above defaults in that overriding order. If you’re using ASP.NET impersonation, then that should default to the above as well. If you’re using Basic, Digest, Forms, or Windows authentication, then the authentication will be based on the user that the end-user logs in as.

Things can get even trickier if you do things in code, but generally this will figure it out for you.


What am I up to?

I usually keep to technical topics on here but this one is going to take a step back.

In the past I have been a consultant through nearly my entire career. I have gone into new [to me] businesses, listened to what they wanted, helped them learn what they needed, helped them determine the correct solution for their need, often helped create these solutions or worked with the teams who created the solutions, helped the companies implement and deploy these solutions, helped with training, helped with post-deployment support, and anything else you can think of that goes with the territory. I have worked on single-person projects and have worked with teams ranging from 2 to 15 people. I have participated as a supporting developer, the lead developer, a supporting architect, the lead architect, a business analyst, and even a project manager on these different teams.

For the past year and a half, I have been working with the Indiana State Supreme Court on a project called eCWS. On this project I was the architect and lead developer in a team with 8 developers. My team and I designed, created, and maintained this entire system from scratch and won at least 3 international awards with the project. As of the time I rolled off of this project about a month ago the system had logged approximately 1 million citations and warnings, consisted of a laptop-based and PDA-based client (both of which were rock-solid and easily maintainable), a web-based client system, as well as some web-based server components while integrating with various electronic court systems (and of course most of these systems shared a common code-base to keep the code manageable).

Also, for the past year, I have helped to create the Indianapolis ALT.NET user group and have acted as the president of the user group. I have attempted to push a wonderful movement in furthering the community’s education on best practices and broadening the community’s range of thinking to more outside-the-box tools and techniques. As we are now, we are one of the most active and organized ALT.NET user groups in the world (and we’re about to step things up to the next level)!

For the past month I have done some consulting work for an older client of mine while waiting for negotiations and planning for “the big one” to come through. I’ve been ready to advance my career and, in doing so, will be stepping out of the consulting role I have been so successful in for years. Beginning today I will be joining the EnerGenuity team here in Indianapolis. EnerGenuity currently has a great software suite that keeps their customers happy (which include Fortune 500 and other companies). My official title, I think, is something like Technology and Product Development Manager (for the first time I’ll have a legitimate title and not one that I make up on-the-spot as so many software developers/consultants do!). In short, I will be leading the IT team for EnerGenuity. This is sure to be a challenging and rewarding experience in my life and I think EnerGenuity and I are a great match for each other! I think I have so much to offer and they have so much they need and the details in both of these seem like an absolutely perfect match!

So… that’s about it. Just thought I’d give you an update of what I was up to. 🙂


« Previous PageNext Page »

Jaxidian Update is proudly powered by WordPress and themed by Mukkamu