/egilh

Learning by doing

October 2004 Entries

Now this is a strange one. The following stored procedure crashes the SQL worker process that is executing it: CREATE PROCEDURE usp_UpdateDeviceEnabled@idDettaglio int,@sDevicelist text AS UPDATE CP_Valori set CP_Valori.sCPValore = @sDevicelist FROM Colonne_Personalizzate INNER JOIN CP_Valori ON Colonne_Personalizzate.idColonna = CP_Valori.idColonna INNER JOIN Dettaglio ON CP_Valori.idDettaglio = Dettaglio.idDettaglio WHERE (CP_Valori.idDettaglio = @idDettaglio) AND (Colonne_Personalizzate.sType = 'CMB_DEVICE') It bombs with the following errors: Event Type: ErrorEvent Category: (2)Event ID: 17052Description:Error: 0, Severity: ...

Microsoft's original Caller ID for e-mail wasn't approved so they have merged their proposal with the Sender Policy Framework (SPF) written by Meng Weng Wong and Mark Lentczner. Have a look at the Sender ID Framework Executive Overview for a quick intro to what the Sender ID is. My thoughts on it? SPAM sucks and there must be a way to fight it. Sender ID may be a step in the right direction, as it makes it easier to detect spam by automatic systems, but it does not prevent spam from being sent. It would be a lot better to kill the spam before it even reaches the internet. These days a lot of spam is sent by trojans and virus infected PCs with fast internet connections. ...

Wish I had more time to blog… I'm on a tight schedule working on compatibility and performance issues when delivering contents to the latest and greatest UMTS/3G phones like SonyEricsson Z1010 and Samsung Z107 (wonder why all the latest models are all called Z something; Lack of fantasy? The End Of The English Alphabet?). Only Coding & Music while I wait for the official release of project #100. More info after 4/11 when I should be able to say something without risking my job.

Bought the Riot on an empty street album by Kings of Convenience yesterday. Great music for coding sessions; easy listening and acoustic instruments. One of the Amazon.com reviewers wrote "Okay if you are 30 something,". He must be a genius :-)

A great little time saver; the CopySourceAsHtml plugin for Visual Studio makes it possible to copy html formatted source code to your blog without cutting and pasting it via Word. Pasted via CopySourceAsHtml: .csharpcode { font-size: 10pt; color: black; font-family: Courier New , Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0px; } .rem { color: #008000; } .kwrd { color: #0000ff; } .str { color: #006080; } .op { color: #0000c0; } .preproc { color: #cc6633; } .asp { background-color: #ffff00; } .html { color: #800000; } .attr { color: #ff0000; } .alt { background-color: #f4f4f4; width: ...

Running a decent OS from a single floppy reminds of the first Linux builds I used (0.90-something). MenuetOS promises a lot more though with a full GUI as well: MenuetOS is an Operating System for the PC written entirely in 32bit assembly language, and released under the GPL. It supports 32 bit x86 assembly programming since this allows for smaller, faster and less resource hungry applications to be created. Menuet has no roots within unix or the posix standards, nor is it based on any particular operating system. The design goal has been to remove the extra layers between different parts of an OS, which normally complicates programming and create bugs. Features- ...

Michael Howard, author of Writing Secure Code (2nd edition), compares IIS6 and Apache security stats IIS 6 has been rock solid on the production systems where I use it and I have had no security problems. Got infected by Code Red on my Win2k dev machine a loooong time ago before I learned, the hard way, to harden my machines.

It's official: Visual Studio 2005 will support Edit & Continue for C# What a great news on a Monday morning! One of the top feedback requests from our customers is support for Edit & Continue (E&C) in C# in Visual Studio 2005. I am excited to announce that the C# team took your feedback to heart and has added support for E&C in Visual Studio 2005. The Edit & Continue feature will be part of the next Visual Studio 2005 Technology Preview which will be released this week.

CodeProject is a great resource. It has an active community with loads of sample code. I'm using the CxImage component a lot and it's a great example of the quality of the code on CodeProject. It also has a weekly CodeProject newsletter CodeProject member #47586 (of 1.437.688 last time I checked)

What: First some background info: I like to know how things work. I started picking apart broken kitchen appliances when I was a kid, trying to figure out what was wrong. I had a hard time buying spare parts though as repair centers wanted to do the job themselves to earn money. These days I check out How Stuff Works once in a while to learn something new. It's the same interest in knowing what goes on behind the scenes that got me started programming as well. My neighbor convinced me to spend the few bucks I had earned picking strawberries during my summer vacation on a computer. I started using Lotus and WordPefect, constantly wondering how the stuff worked. I got ...

Neither Outlook nor Pocket Outlook marks tasks as private. If you have a private PC it's not a problem but if you work with an Exchange server some companies leave your mailbox configure so -everyone- can see your "public" tasks. My tasks are private and they should stay so. The following code sample uses the Pocket Outlook .NET Compact Framework class library to create a new task, set the due date to today, an mark it as private and display it so the user can enter subject and notes: public enum Sensitivity { Normal = 0 , Personal = 1, Private = 2, Confidential = 3 } … /// <summary> /// Create a new ...

I frequently have more than 20 tasks due each day. Stuff that must get done in high priority, some low priority reminders and blog notes. On the PC I use an Outlook macro but there is no macro language on the Pocket PC so I used the modified Pocket Outlook .NET CF class library to catch up with old tasks. // In the class declaration private PocketOutlook.Application _pocketOutlook; ... // Startup code in the form Load() routine _pocketOutlook = new PocketOutlook.Application(); _pocketOutlook.Logon(); … /// <summary> /// Catch up with task that are due in the past /// </summary> /// <param name="sender"></pa ...

Had to look around the templates for a while but I found it in the end. Add the following in at the end of Skins\SkinName\Controls\CategoryList.ascx and insert the JavaScript script from Google. Works like a charm. <ItemTemplate> <h3>Sponsored links</h3> <ul> <li> PASTE SCRIPT HERE </li> </ul> </script> </ItemTemplate>

Bruce Schneier has started his own blog. I have been a faithful reader of the Crypto-gram newsletter / blog since I read the footnote in Cryptonomicon. He knows a lot about security and writes about it with a passion. Via [Larry Osterman]

What: a small web based joke server. I saw all this programs popping up on the web and wanted to find out how I could implement my own. Collected some jokes I had in my inbox and saved them to a formatted text file (no xml yet). Wrote an indexer that generated a tiny lookup table so I didn't have to parse the entire file to pull out a joke. The CGI program in C pulled out a random joke each time a page was requested. Nothing fancy but it was fun to make and test. Upgraded it later to use the predecessor to ISAPI when it was made available in a small web server that ran on Windows 95. When: mid 90s Lessons learned: CGI is grand but ISAPI is way faster on Windows Technorati ...

I was about to implement my own clipboard classes for .NET CF when I found the Clipboard usage article. It has complete source code that implements the two alternatives for working with the clipboard in .NET CF. Alternative 1: use P/Invoke to call the following methods:[DllImport("Coredll.dll")] private static extern bool OpenClipboard(IntPtr hWndNewOwner);[DllImport("Coredll.dll")] private static extern bool CloseClipboard(); [DllImport("Coredll.dll")] private static extern bool EmptyClipboard(); [DllImport("Coredll.dll")] private static extern bool IsClipboardFormatAvailable(uint uFormat); [DllImport("Coredll.dll")] private static extern IntPtr GetClipboardData(uint ...