/egilh

Learning by doing

February 2007 Entries

I recently moved my blog to a hosting center (more on that in another post) and hit a few strange issues: forms would fail with an Invalid Viewstate error forms authentication would be lost after my web application was recycled I know why it happens (ASP.NET security measures) but not what is causing it. Let me try to explain better. ASP.NET does it best to make sure the ViewState and forms authentication cannot be hacked by “signing“ sensitive data. The <machineKey> element in Machine.Config decides how the key is generated and which algorithm to use. The computer can generate the key automatically but it is machine specific so the key must be ...

or at least the Chinese think I am… I would never have found out if I did not work next to the Chinatown of Milano. There was an advertisement for the Chinese New Year celebration recently and I saw a description of the various zodiacs. By chance I noticed that this is the year of the Pig. I do not believe in astrology but I find the wikipedia description of the Year of the Pig scarily accurate: The Pig type is usually an honest, straightforward and patient person. They are a modest, shy character who prefers to work quietly behind the scenes. When others despair, they are often there to offer support. This type of person is reserved with those they do not ...

What is the optimal way of lacing your shoes? Good we have university mathematicians to help us with these philosophical issues and present the best solutions: The criss-cross and straight patterns (left and centre) are strongest, but the bow-tie pattern (right) is the most efficient I keep it simple and use the criss-cross pattern. What about you? Are you a traditionalist or are you using one of the 400 million other ways of lacing a shoe?

While porting my free Pocket PC applications to .NET CF 2.0 I just discovered an interesting "feature" of the Microsoft Pocket Outlook wrapper. The first port of poToday used my POOM wrapper for .NET CF 1.0 but I decided to drop it for the built in Microsoft PocketOutlook libraries. My application dropped from 70kb + 30kb of wrapper DLL to only 31kb. Reorganizing the menus I am able to use the application completely without stylus which is pretty neat. But I found a problem with DueDate property that drove me crazy for a while. I can filter on the DueDate like this: TaskCollection dueTasks = allTasks.Restrict("[DueDate] = \"" + System.DateTime.Today.ToString("dd/MM/yy") ...

I automatically generate a short summary for each post on my blog. The logic for creating the summary should stay on the front end but I did not have the source code for my blog engine (.text) so I put it in the DB. The following function removes all HTML tags, leaving only the text I want to display in the summary: CREATE FUNCTION [dbo].[replaceHTML] ( @cont varchar(8000) ) RETURNS varchar(8000) AS BEGIN declare @out varchar (8000) declare @tag varchar (8000) declare @pos1 int declare @pos2 int -- Find the start/end of first tag set @pos1=charindex('<', @cont);posted @ Monday, February 26, 2007 10:09 PM | Feedback (0)

I have bought many tickets through TicketOne.it recently (U2 Milano, Mugello 2006, Mugello 2007, Misano 2007). But the purchase experience has always been slow and painful. This evening was the last drop when I tried to buy tickets for Bugs Bunny On Ice. I ordered two adults and two kids and got a ticket assignments where the kids would sit on a separate row and with seat numbers far away me and my wife. I would have accepted the tickets asap if I hadn't used the company before. I hunted around for 1/2 hour on TicketOne and the event site of Bugs Bunny without finding a way to identify if the seats really were close or far from each other. I went through the whole ...

Tired of the standard QWERTY and the faster, but not so common Dvorak, keyboard layouts? Why not make your own with Microsoft Keyboard Layout Creator: Apart from using it for an office prank, the tool is actually useful if you have laptop with a weird keyboard layout or if you a programming on a non-US keyboard where frequently used characters like {}; are hidden away behind obscure AltGr+Shift combinations.

I recently got a Motorola SLVR L7 at work to replace my broken Nokia 6630. My main reasons for getting it were the size (small and light) and the fact that it charges via a standard Mini USB cable just like my PDA. Finally only one cable and one charger to bring around. Motorola is not as good as Nokia when it comes to software but who cares as I only need it for SMS and making calls. Like the Nokia 6630 it synchronizes with my Outlook contacts. At least that was what I thought... I tried transferring contacts via Bluetooth from my PC, via Bluetooth and MMS from Pocket PC, but the phone did not like the contact format. In the end I tried the Motorola Phone Tools but ...

UGISS, the Italian SQL Server Users Group, is organizing a free event with Microsoft 27/2: SQL Server: una piattaforma integrata [Italian] I get more and more respect for the conferences/work shops hosted by the various Italian User Groups each time I attend one. They are held by people that want to share their hard learned experience, not by someone who is paid to sell a product. There will be two tracks in the afternoon; one for DBAs and one for developers. Thanks for the tip Michele

When Compact is not Compact enough; try the .NET Micro Framework. It is targeted at small devices like smart watches and SideShow The main difference from the other .NET versions is that .NET Microsoft Framework does not require Windows. It runs in a few few hundred kilobytes of RAM, and as little as 512K of flash memory and brings the benefits of the CLR to small devices: Enables writing of simpler, more fail-safe code through built-in support for garbage collection and exception handling. Protects against errant execution by supporting only “safe” IL instructions. Allows straightforward support for new hardware with the ability to write device drivers ...