Tuesday, October 30, 2007

4456.aspx

How to say this?

It was the best of times, it was the worst of times…


It has been an incredible adventure and a great experience…


Hm…
There is no easy or soft way to say this, so let me make a long story short. After almost 12 years working for Iris Technologies, IrisCube, IrisCube Reply, Sytel Reply I am leaving the company to learn something new.


I cannot wait to get started in my new job as I have a lot to learn at 10100


To my colleagues that read this:



I have one wish for a personal goodbye gift from you. I would really love it if you can send me your Outlook Contact card with your picture/avatar and whatever other info you want to share like phone number, messenger alias, web site etc.


I will continue to work in the Milano area so I am sure we will meet again soon. Please drop by my office for a chat and coffee before my last day at work 6/12.


I will miss you all…

Wednesday, October 24, 2007

4428.aspx

Vodafone Betavine

The Vodafone Betavine site is a open community website created and managed by Vodafone Group R&D with the mission to



...support the wider development community in stimulating ideas, developing, testing and launching great new applications for mobile and Internet communications.



Interesting. Vodafone is huge, so they should have the power to make device manufacturers adhere to the (few) mobile browsing and applications standards that exists. If you are not familiar with developing for mobile devices, you can compare it with the problems we had a decade ago developing for Mozilla and Internet Explorer. But imagine a headache hundreds of times worse as each device has its own peculiarities (even “standard“ software like the Nokia Series Sxx).


The site is open to anyone and I am thrilled to see that Vodafone is not censoring complaints (at least so far).
<flame>



Judging from some forums they could have called the site VodafoneBetaWhine…  Vodafone, correctly, get a lot of complaints regarding their Mobile Internet which basically destroys all internet sites that provide their own  mobile rendering. Vodafone Italy goes one step further than the Vodafone operators in other European countries and even imposes their own Vodafone header and footers on some mobile devices making it look like the service is provided by Vodafone. Difficult to explain to customers that pays for picture perfect rendering just to see it garbled by Vodafone...


</flame>


Thanks for the link Maurizio.

4423.aspx

How to fix Error 1714: The older version of ... cannot be removed

It is several years since I last reinstalled my PC and it shows. I used to keep the setup program for the downloaded software in a download directory but I do not do it anymore as:



  • it wastes space

  • it only takes a few seconds/minutes to download the latest version from the web.

But installing from a "temporary" directory causes one problem: some programs cannot be uninstalled as they are unable to find the original setup so they return "Error 1714: The older version of … cannot be removed". :-(


This is bad design if you ask me. If you need something from the original setup, either you copy the stuff you need to your application directory or you tell me that I have to save it somewhere for the future. Downloading the latest version from the web does not help as you need the particular setup program you installed with :-( :-(


Being stuck with tons of old software on my PC I cannot uninstall is bad enough. But, what really bugs me, is that some software cannot be installed unless you uninstall the old version. I tried to install the new version of Virtual PC and I got this message since I had Microsoft Virtual PC 2004 installed already:



Error 1714. The older version of Microsoft Virtual PC 2007 cannot be removed.


I was considering using RegMon to see which registry keys the VPC2007 setup uses when I found the Windows Installer CleanUp Utility. It does not uninstall the application as such, it just removes it from the list of applications that Windows thinks is installed. Ugly, but it fixed the problem for me.


Select the software you want to "uninstall" from the list, click Remove and hope for the best:

Monday, October 22, 2007

4411.aspx

DateTime is not supported by gregorian calendar

I got this "new" exception when I was consuming one RSS feed:



System.FormatException was unhandled
 Message="The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar."
 Source="mscorlib"
 StackTrace:
      at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
      at System.DateTime.Parse(String s)


System.DateTime.Parse chocked on this input date 2007-09-13T24:28:51Z


Forcing the current culture to System.Globalization.CultureInfo.InvariantCulture did not help so I ended up with this ugly hack:
 dateString = dateString.Replace("T24:", "T00:")


Let me know if you find a cleaner solution.

Friday, October 19, 2007

4410.aspx

When MSDE is better than 2005

Believe it or not, I downgraded from SQL Server 2005 Express to MSDE and got a drastic performance improvement:



  • 6.0 seconds average call time with SQL Server 2005 Express 15/10

  • 1.9 seconds average call time with MSDE 18/10

The DB is identical in terms of data and indexes. The only difference is the SQL engine. I am still not 110% sure why, but as far as I can tell it is due to the different ways MSDE and SQL Server 2005 Express limits performance on my particular hardware. Or rather, lack of hardware, as I am hosting everything on a Virtual Server.


Until January this year I hosted my mail and blogs at home on a PC. It has been a valuable experience as I have learned a lot about hosting a service 24x7. But after almost 3 years I decided to host my mail and blog at a hosting provider. Aruba has a basic Virtual Server at 12 euro a month with Win2k3 64 bit, 8 CPUs, 3GB of disk, 512 MB of ram that is more than enough or me. But not for SQL Server 2005 apparently…


SQL Server 2005 Express limits performance to one physical CPU. This gives good performance on multi-core or hyperthreading CPUs. But, in the case of my Virtual Server I believe it is only using 1 of the 8 available CPUs becoming a bottleneck. MSDE, on the other hand, does not have a CPU limit the workload governor starts slowing down the database engine when more than eight operations are actively running at the same time. Which means that SQL Server 2000 Desktop Engine (MSDE 2000) is significantly faster than SQL Server 2005 Express on my “hardware“.


At least I believe this is the cause as I cannot think of any reason why my blog is suddenly 3 times faster than it used to be (after a few long nights downgrading by hand).

Thursday, October 18, 2007

4401.aspx

How to display a top level window in .NET without making it active

For the poGmail program I needed a way to display a semi transparent alert window in the corner of the screen that was on top of all the other windows without giving it focus. .NET supports transparent windows but the forms are always brought to the front and given the input focus when you call .Show(). This is not nice when you are working, as whatever you write goes to the alert window instead of the current window.


The class below uses interop to modify the form so it does not get activated when you show it. You can call it from the constructor of the form like this: 


    WindowUtils.SetWindowTopMostWithoutFocus(this);



using System;


using System.Windows.Forms;


using System.Runtime.InteropServices;


 


namespace NoFocusWindow


{


    class WindowUtils


    {


        [DllImport("USER32.dll")]


        extern public static bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);


 


        public const int HWND_TOPMOST = -1; // 0xffff


        public const int SWP_NOSIZE = 1; // 0x0001


        public const int SWP_NOMOVE = 2; // 0x0002        


        public const int SWP_NOACTIVATE = 16; // 0x0010


        public const int SWP_SHOWWINDOW = 64; // 0x0040        


 


        public static void SetWindowTopMostWithoutFocus(IntPtr handle)


        {


            SetWindowPos(handle,


                 (IntPtr)HWND_TOPMOST, 0, 0, 0, 0,


                 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);


        }


 


        public static void SetWindowTopMostWithoutFocus(Control ctrl)


        {


            SetWindowTopMostWithoutFocus(ctrl.Handle);


        }


    }


}


 


Based on this class

Monday, October 15, 2007

4389.aspx

poGmail: A Gmail notifier for the Pocket PC (beta)

This is the first time I am releasing a beta with some known issues...
I have decided to do it to cover as wide a range of Pocket PC/Windows Mobile devices as possible. I am using it on my Windows Mobile 5.0 Phone Edition device but I am sure there are problems with other versions and I would like to find and fix them.


You can download the latest version at the poGmail home page.


Installation instructions:



  • Install .NET Compact Framework 2.0 if you don't have it already

  • Copy the .CAB file to your device (via Active Sync or a memory card)

  • Run the .CAB.

  • Run poGmail and configure accounts and the download schedule

The setup program installs:



  • The Gmail client program (installed in the programs menu as poGmail)

  • The "today screen" plugin

The Gmail client uses the same configuration file as the PC version so you can copy it from the PC to the Pocket PC (\program files\poGmail) if you do not want to re-enter all the data on the pocket pc.


Known issues from beta testers:



  • The "today screen" plugin does not automatically show up after the installation. You have to  Click Start, Settings, Today, the "Items" tab then OK. Or you can soft reset your device.

  • The buttons do not work on the HTC Touch. I do not know if it applies to all Windows Mobile 6.0 devices.

  • Screen orientation. I have not added support for landscape mode yet

The unread mails are displayed using the file poGmailTemplate.htm as a template. Feel free to "customize" it as you want. Make a cool template and I will include it in the download.


Please let me know if you find any bugs and I will do my best to fix them