|
|
I’ve been tasked at coming up with a standard architecture for us to apply to our future projects. Yeah, I know, there’s no blanket answer for everything, but given the requirements I expect, I think a single architecture can handle 95% of what we’ll be doing and we can deviate/improve as necessary for the other 5%.
Ultimately I don’t yet know what this is going to look like but this is the direction I’m leaning in:
(more…)
March 11th, 2010
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
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).
(more…)
November 17th, 2009
Categories: .NET, Community Events, Programming | Author: Shane Milton | Comments: 2 Comments |
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!
(more…)
October 1st, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
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.).
(more…)
September 9th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
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!
(more…)
August 28th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: 3 Comments |
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:
(more…)
August 23rd, 2009
Categories: .NET, Community Events, Programming | Author: Shane Milton | Comments: No Comments |
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.
July 20th, 2009
Categories: Community Events, Indy Events, Programming | Author: Shane Milton | Comments: No Comments |
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| <property name="Is64BitOperatingSystem" value="false" />
<property name="Is64BitProcess" value="false" />
<property name="IsWow64Process" value="false" />
<target name="DetectOperatingSystemArchitecture" depends="DetectIfWow64Process,DetectIf64BitProcess">
<description>
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.
</description>
<property name="Is64BitOperatingSystem" value="${IsWow64Process or Is64BitProcess}" />
<choose>
<when test="${Is64BitOperatingSystem}">
<echo message="The operating system you are running is 64-bit." />
</when>
<otherwise>
<echo message="The operating system you are running is 32-bit." />
</otherwise>
</choose>
</target>
<script language="C#" prefix="MyWin32Calls">
< code>
< ![CDATA[
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool IsWow64Process(System.IntPtr hProcess, out bool lpSystemInfo);
[Function("IsWow64Process")]
public bool IsWow64Process()
{
bool retVal = false;
IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, out retVal);
return retVal;
}
]]>
< /code>
</script>
<target name="DetectIfWow64Process">
<description>
Detects whether we are currently in a WoW64 process or not.
</description>
<property name="IsWow64Process" value="${MyWin32Calls::IsWow64Process()}" />
<echo message="Setting the [IsWow64Process] property to ${IsWow64Process}." />
</target>
<target name="DetectIf64BitProcess">
<description>
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.
</description>
<!-- 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}." />
</target> |
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
http://nant.sourceforge.net
Buildfile: file:///D:/bin/deleteme/nanttest/test.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: DetectOperatingSystemArchitecture
[script] Scanning assembly "lsbw4oxa" for extensions.
DetectIfWow64Process:
[echo] Setting the [IsWow64Process] property to True.
DetectIf64BitProcess:
[echo] Setting the [Is64BitProcess] property to False.
DetectOperatingSystemArchitecture:
[echo] The operating system you are running is 64-bit.
BUILD SUCCEEDED
Total time: 0.2 seconds.
D:\bin\deleteme\nanttest>
Happy NAnting!!!
*heads off to the IndyALT.NET meeting on Continuous Integration now…*
July 16th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
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:
1
2
3
4
5
6
7
8
| USE [{DatabaseName}]
GO
ALTER DATABASE [{DatabaseName}] SET RECOVERY SIMPLE
GO
DBCC SHRINKFILE({TransactionLogLogicalName})
GO
ALTER DATABASE [{DatabaseName}] SET RECOVERY FULL
GO |
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!!
-Shane
April 22nd, 2009
Categories: Programming, SQL Server | Author: Shane Milton | Comments: No Comments |
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:
NETWORK_SERVICE
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.
-Shane
April 9th, 2009
Categories: .NET, Programming | Author: Shane Milton | Comments: No Comments |
Next Page »
|