Posts

X-Men Code 127

One of the more interesting things about SQL Server 2005 is the support for the XML datatype. Instead of playing around with wierd and funky stored procedures to manipulate XML, you get validation and a bunch of other features just by specifying a field or a parameter as XML. Now, as nice as it is to be able to serialize a .net object and store the entire thing in one field in the database, I have my feelings that there is significant overhead to querying into that XML on a more than ad-hoc basis. So, you *might* want to add some additional fields to the table containing the xml. For example if you had the following XML: <OrderID>0a4fc0f8-6106-467f-ae10-45dcbfe4cefa</OrderID> <CustomerNumber>1234</CustomerNumber> <Status>Active</Status><Lines> <OrderLine ItemId="123" Quantity="2" Taxable="false" Price="12.34" DateChanged="2006-04-20T12:16:20.8942144-06:00" IsReadOnly="false"><...

What!?? No clever title?!??

No clever title for this one. Just a reminder that you can turn on tracing in an asp.net web page by including the following in your page directive: <%@ page trace="true" %> And, lest you tire of remembering which specific pages you have this enabled on, you can turn on tracing for an entire application by including the following in the web.config: <trace enabled="true" localonly="true" tracemode="SortByTime" pageoutput="true" requestlimit="10"><trace enabled="true">

Apple Core...Baltimore...Who's your friend?

I've always had a soft spot in my heart for Apple. While it wasn't my "first" computer, (that was a Commodore Pet), The Apple II was the computer where I learned about data structures, graphics, and really did some useful programming. In college when I needed to get a computer, I bought a Macintosh IIsi. While my computer programming career has been mostly Windows-centric, I still like the elegance and simplicity of products from Apple; especially when they are free. After playing with Music Match and other music programs, I've pretty much decided to use iTunes in my home as a music library management and MP3 player. I like it's playlist management features, the fact that it is easy to rip and burn physical CDs and the user interface is simple and elegant. The visualizations are cool too. I don't buy much music through the iTunes store (only one to date), but I do buy music on CD and want to be able to listen to it without physically handling the CDs; or m...

Master and Commander

I just thought I'd put my favorite registry hack here. Create a text file with a .reg extension with this text: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\Command] @="Command &Prompt" [HKEY_CLASSES_ROOT\Directory\shell\Command\command] @="cmd.exe" Once you have the file saved, just double-click it and merge it with the registry. This adds a context menu that can be used in the explorer to open a command prompt window to the highlighted folder.

How to skin a Turkey

Here is a very useful function created to parse a delimited list in TSQL. It is fairly straight forward. Pass the string to be parsed and the delimiter (defaults to a comma) and it returns a table with a single column containing the strings that were delimited together. Why Microsoft doesn't have something like this built in is beyond me. CREATE FUNCTION dbo.fn_ParseDelimitedList ( @DelimitedList varchar(8000), @Delimiter char(1) = "," ) RETURNS @TableVar TABLE (Item varchar(100) NOT NULL ) AS BEGIN DECLARE @IDListPosition int DECLARE @IDList varchar(8000) DECLARE @ArrValue varchar(8000) DECLARE @Pattern char(3) SET @IDList = COALESCE(@DelimitedList, '') IF @IDList '' BEGIN -- Add Trailing delimiter to end of list so user doesn't have to IF RIGHT(@DelimitedList,1) @Delimiter begin SET @IDList = @IDList + @Delimiter END SET @Pattern = '%' + @Delimiter + '%' -- Loop through the comma demlimted string list WHILE PATINDEX(@Pat...

You liquidated her, eh? Very resourceful...

Long time, no blog. What can I say? I've been to the "Happiest Place On Earth" But, now that I'm back, here's a neat little trick that I learned about how to embed and use graphic resources in a Visual Studio .NET application. For my example, I'm assuming that I have an icon file named "Test.ico". Using visual studio or another tool, you can create a bitmap, jpeg, gif, or Icon. Put that file in the same directory as the rest of your project. Then Add the file to the project (Add Existing Item...) and add the file. Change the Build Action of the file to be "Embedded Resource" When you want to use the file, simply add the following code (or something similar): Dim _icon as Icon = New Icon(Me.GetType(),"Test.ico") Now you have a real icon that can be used for any number of things (application icon, status icon, etc.)

Am I Blue?

Image
Just a quickie post with a picture for those of you who may not know what I look like. Actually, you still won't know what I look like because this was my Halloween 2005 costume. A "Blue Man" This whole effect was accomplished using simple make-up items from "The Costume Shop" in Garden City, Idaho. I prepped myself with a good shave and a haircut The skin-head wig was prepared using Caster Sealer. This helped it to have a less streaky appearance than it would have had otherwise. This is bascally castor oil, but it makes the latex skin less slippery. I positioned the skin-head over my hair and ears and then glued it in place with stage glue. We applied Cobolt Blue Greasepaint to my entire head and neck. I'm wearing a black turtleneck shirt with black pants, shoes and socks. The entire process took about an hour. Total cost: $20