Simon Fell > Its just code > October 2003

Thursday, October 30, 2003

He's back!

Peter is back blogging from the PDC. :)

< 10:23 AM PDT # >
Addiction


A little too close to the truth!

< 10:11 AM PDT # >

Wednesday, October 22, 2003

Kerberos

I have no idea how or what, but something seems messed up on my AD setup, i get this in my event log every time my XP box tries to authenticate to a Win2003 server (both in the domain, the DC running Win2000). Suggestions welcome!

The kerberos client received a KRB_AP_ERR_MODIFIED error from the server host/devon.simonathome.com. This indicates that the password used to encrypt the kerberos service ticket is different than that on the target server. Commonly, this is due to identically named machine accounts in the target realm (SIMONATHOME.COM), and the client realm. Please contact your system administrator.
< 6:19 PM PDT # >
CodeSmith

I started looking at CodeSmith, as an old time Gen<X> user I felt right at home, if you're interested in template based code generation, check it out. Update, 2 hours after i finished installing it i already had templates to gnerate stored procedures and data access layer code all to the conventions and paterns that i'm using. Great job Eric!

< 2:35 PM PDT # >

Tuesday, October 21, 2003

Type Hierarchies

More and more services seem to be using derived complex types (like below) to get type hierarchies in their language of choice, works great for those languages that it maps cleanly to (like c# and java), but its painful but possible in VB6. Ran into one VB6 bug (no chance of seeing a fix for it) where interface methods can't have _ in the name, the compiler fails to see the implementation in the implementing class. As far as I can see from the docs _ is valid in a method name, oh well, one more wrinkle in the xsd -> vb name mapping process.

	<complexType name="Entity">
		<sequence>
			<element name="Id" type="xs:string"/>
			<element name="LastModified" type="xs:dateTime"/>
			<element name="LastModifiedBy" type="xs:string"/>
		</sequence>
	</complexType>
	<complexType name="Contact">
		<complexContent>
			<extension base="tns:Entity">
				<sequence>
					<element name="ContactPerson" type="xs:string"/>
					<element name="ContactPhone"  type="xs:string"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
	<complexType name="Customer">
		<complexContent>
			<extension base="tns:Contact">
				<sequence>
					<element name="Since" type="dateTime"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
< 10:46 PM PDT # >
sa.windows.com

What is sa.windows.com and why is my XP box talking to it?, was using YATT to check and couple of things and noticed a number of requests going to sa.windows.com. I think its something to do with the search tool in windows explorer.

GET /sasearch/lclsrch.xml HTTP/1.1
If-Modified-Since: Fri, 30 Aug 2002 03:41:31 GMT
User-Agent: SCAgent
Host: sa.windows.com

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Wed, 22 Oct 2003 00:35:51 GMT
P3P: Custom Header Value: policyref="<http://sa.windows.com/privacy/>", CP="NOI DSP NID COR CUR ADMa DEV OUR SAM BUS STA"
ETag: "43be26e61d4c11:7fe"
Content-Length: 0

GET /sasearch/lclAdv.xml HTTP/1.1
If-Modified-Since: Fri, 30 Aug 2002 03:41:32 GMT
User-Agent: SCAgent
Host: sa.windows.com

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Wed, 22 Oct 2003 00:35:51 GMT
P3P: Custom Header Value: policyref="<http://sa.windows.com/privacy/>", CP="NOI DSP NID COR CUR ADMa DEV OUR SAM BUS STA"
ETag: "6850c1829cac11:7fe"
Content-Length: 0

GET /sasearch/balloon.xsl HTTP/1.1
If-Modified-Since: Fri, 30 Aug 2002 03:41:32 GMT
User-Agent: SCAgent
Host: sa.windows.com

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Wed, 22 Oct 2003 00:35:51 GMT
P3P: Custom Header Value: policyref="<http://sa.windows.com/privacy/>", CP="NOI DSP NID COR CUR ADMa DEV OUR SAM BUS STA"
ETag: "6fb3f46c61d4c11:7fe"
Content-Length: 0

GET /sasearch/lclprog.xml HTTP/1.1
If-Modified-Since: Fri, 30 Aug 2002 03:41:38 GMT
User-Agent: SCAgent
Host: sa.windows.com

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Wed, 22 Oct 2003 00:35:51 GMT
P3P: Custom Header Value: policyref="<http://sa.windows.com/privacy/>", CP="NOI DSP NID COR CUR ADMa DEV OUR SAM BUS STA"
ETag: "6fb3f46c61d4c11:7fe"
Content-Length: 0

GET /sasearch/lclprog.xml HTTP/1.1
If-Modified-Since: Fri, 30 Aug 2002 03:41:38 GMT
User-Agent: SCAgent
Host: sa.windows.com

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Wed, 22 Oct 2003 00:35:54 GMT
P3P: Custom Header Value: policyref="<http://sa.windows.com/privacy/>", CP="NOI DSP NID COR CUR ADMa DEV OUR SAM BUS STA"
ETag: "e0372a839cac11:7fe"
Content-Length: 0

GET /sasearch/lclrfine.xml HTTP/1.1
If-Modified-Since: Fri, 30 Aug 2002 03:42:36 GMT
User-Agent: SCAgent
Host: sa.windows.com

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Wed, 22 Oct 2003 00:41:56 GMT
P3P: Custom Header Value: policyref="<http://sa.windows.com/privacy/>", CP="NOI DSP NID COR CUR ADMa DEV OUR SAM BUS STA"
ETag: "56e83a839cac11:7fe"
Content-Length: 0
< 5:46 PM PDT # >

Saturday, October 18, 2003

Urrrrghhhh
< 5:57 PM PDT # >

Thursday, October 16, 2003

iTunes wOOt!, the Windows version of iTunes is out. I've been pretty disappointed with both WMP9 and Winamp3, so i hope this will save me!.
< 5:41 PM PDT # >

Monday, October 13, 2003

Single Instance Apps

To expand on my earlier comments on Chris's book about the Applications and Settings chapter here are the issues I spotted (BTW, don't let this put you off buying the book, its a good book, I'd still recommend it)

Single Instance Apps via a named Mutex

Chris outlines a solution using a named Mutex to detect multiple instances of an application trying to start, and points out that there can be issues when running under terminal services, however the particular problem that Chris outlines (same user with multiple Terminal Server sessions going) doesn't exist, because the mutex names are bound to different scopes, as described in detail in the Platform SDK docs for CreateMutex (and equally completely missing from the .NET docs for the Mutex class), you can prove this to yourself with a simple demo.

using System ;
using System.Threading ;

public class MutexName
{
        public static void Main(string [] args)
        {
                bool firstInstance = false ;
                Mutex m = new Mutex(true, "SimonsTestMutex", out firstInstance ) ;              
                
                Console.WriteLine("Mutex created, firstInstance={0}, press any key", firstInstance ) ;
                
                Console.Read() ;
        }
}

Run an instance on the console and using the same account another instance from a TS session, now grab ProcessExplorer and fire it up from one of the sessions, you'll notice that the actual name of the console instance mutex is \BaseNamedObjects\SimonsTestMutex but the name of the TS instance is \Sessions\1\BaseNamedObjects\SimonsTestMutex. The TS folks have done the heavy lifting for you.

Passing Command Line Parameters

The chapter goes on to discuss how to pass parameters from the 2nd start attempt to the already running attempt, and outlines a solution based on remoting. There are 2 issues with this, one it uses a localhost:1313 address, of which there is one per box, no good in the face of TS and second there's a potential security issue in the TS case as it's passing the parameters I tried to start the app with to potentially a different user account. I'm not sure how to fix this, you need something that can take advantage of the scoping done for kernel objects, perhaps a named pipe channel would pick up those scopes?? (anyone know)

My final issue was later in the chapter it talks about storing data as serialized instances using the serialization framework, and there's also talks about versioning, but no mention of the potential issues with migrating the serialized data between versions. I did subsequently noticed that there's an appendix on that very topic, so make sure you check that out as well.

< 7:17 PM PDT # > [playing David Shire - The Taking of Pelham 123 (End Title) (from Now, Listen!)]
Consolidation WebMethods to buy The Mind Electric
< 11:52 AM PDT # >

Sunday, October 12, 2003

You were only meant to blow the bloody doors off!
< 5:54 PM PDT # > tags : Music

Friday, October 03, 2003

Update

Haven't posted much recently, mainly because I've been busy, then I've been sick, now I'm back to been busy, here's a few bit'n'peices

< 9:32 AM PDT # > [playing Cass - Mind Rewind (Momu Remix)]