Thursday, December 18, 2008

Monday, December 15, 2008

Object-relational impedance mismatch

Recently I found myself discussing how to an application accesses data in a database. This Wikipedia article has some good arguments for an Object-relational mapping approach. http://en.wikipedia.org/wiki/Object-Relational_impedance_mismatch

Thursday, December 4, 2008

Log file monitoring for log4net output

I was thinking of building a C# UDP listener to connect a log4net UDP appender to. Something like this - Code Project: A log4net Realtime Color Console for ASP.NET

The trick would be getting a setup that would work for multiple developers. A service that accepts the UDP packets and relays them out to registered listeners or something such similar.

After some quick Googling I found it would be quicker to have each developer just point a log monitoring tool at the output from a RollingFileAppender. BareTail seems to do a pretty good job.

Updated: When combined with a RollingFileAppender using XmlLayout Log4view works well to filter out the loggers.

Tuesday, November 11, 2008

Chinglish with cable tester

 
Posted by Picasa

This almost makes sense:

Do not use it beyond usage

But I'm really not sure what they were getting at with:

Do not change it on your mind
http://en.wikipedia.org/wiki/Chinglish

Monday, November 10, 2008

Find all stored procedures that contain a particular string

SELECT    so.Name, so.xtype as Type
FROM    dbo.sysobjects so
    JOIN dbo.syscomments scm ON so.id = scm.id
WHERE scm.text like '%CorporationID%'
GROUP BY so.Name, so.xtype
or better yet:
SELECT  routine_name FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_definition LIKE '%..%'

Wednesday, November 5, 2008

Detecting if the processor is 64 bit in a batch file

I needed a batch file to copy a different DLL depending on the processor architecture (one for x86 and one for x64).

Using the environment variables PROCESSOR_ARCHITECTURE did the trick.

echo %PROCESSOR_ARCHITECTURE%

Wednesday, October 29, 2008

ScriptResource.axd throws ArgumentOutOfRangeException

After doing a deployment from the build server in the NZ timezone to the production server in the US PST timezone I started seeing the following exception:

----
Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Specified argument was out of the range of valid values.
Parameter name: utcDate
Request information:
Request URL: https://www.mydomain.com:443/Site/ScriptResource.axd?blahdeblah
----

Turns out there were problems locating AJAX assemblies that, from the production servers perspective, were dated in the future.

The solution is to either wait for the timezone difference to sort itself out or to update the last modified date on the DLLS.

See the following link for an example of the latter.