First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

March 2007 Blog Posts

Am I an iMan?

Yesterday after work I was running on Oriental Parade, and I thinking about all the iThings my wife and I have.

I've got a black iPod Nano 2Gb 1G, Daniela has a green iPod Nano 4Gb 2G, and we also have an old 20Gb iPod (4G), the wedding gift from my brother, with a custom engraving with the wedding date (22/01/2005). So we have 3 iPod.

But an iPod is sad if it is left alone, so I have a lot of other iThing around my home:

But the accessory I like the most, and that shows the level of extensibility of the iPod is the car radio adapter for my Audi A3. With that adapter, the radio treats the iPod as a 6 disc CD changer (5 playlists + the "all songs in the iPod in alphabetic order")

As soon as you plug the adapter cable in the dock connector of the iPod, it shows the Audi logo on the screen, and when listening to the music you can read the songs being played.

The click wheels is disabled, but you can navigate through the playlist and through the songs with the "next/prev CD" and "next/prev song" in the radio.

The iPod firmware has been designed so that any accessory could draw on the display, change the way the click wheel works (or disable it), write files on the memory (both audio and text) and, of course, navigate through the songs and change the volume. An accessory connected to the dock can do everything it wants to do smile_shades.

Too bad there are not public API or command specs to program your own iPod. Would have been a nice way to throw away some spare time.smile_wink

You may have noticed that this post has a lot of images linked using the Lightbox library that will ship with next version of Subtext. Also this is a test for a WLW plugin I'm writing: more on this in a future post.

PS: This is an enhanced version of the post I wrote a few days ago on my Italian blog: "Sono forse un iUomo?".

Why don't you swim across the Atlantic Ocean?

Do you want to go from Madison, WI, USA to Milano? Why don't you have a swim across the Ocean?

Sounds silly? Well, these are the directions that Google Map is suggestions to go from any place in the US to any place in Europe. And they also estimate that you are going to take 30 days to swim the 3500 miles from Long Wharf NY, to Le Havre. This means that you have to swim without rest for 30 days at around 7,8 km/h (which is the same speed of the 100m swimming male Olympic record)

Below is a screenshot, and the link to my trip from Madison, WI, USA to Milano.

Thanks to Luigi for pointing me to that ... ehm... funny thing smile_regular

Continuous Integration with The Simpsons™

As part of my new job as Chief Software Architect here in Calcium, one of my task is setting up a "state of the art" build/testing environment so that the various developers working on the project know if they broke something with their latest commit, or the exotic Java-.NET integration stopped working.

I already setup a CC.NET build server (and I already wrote about something I did), but Continuous Integration is useless if nobody knows about the results of the builds in a timely way.

We have all servers (both the build and the test server) in our office, so I installed CCTray on the one with speakers (and sometimes we use as Jukebox ) and configured a few audio alert for builds.

In the CC.NET version 0.6 there were 2 sets of audio files, but they have been removed in following version.

The first set is featuring a space age metallic female voice that says:

  • Successful build: "Confirmed"
  • Fixed build (that means transition from broken to successful build): "Program loaded and ready"
  • Broken build: "Warning, the system has become unstable"
  • Still failing (means the last commit didn't fix the build): "Negative"

The second set is from Homer Simpson:

  • "DOH!!" whenever a build is broken
  • "WOOHOO!!" whenever a build is successful

and it doesn't care about transition from broken to successful build.

In our office we adopted a mixed solution: we are using the 2 Simpson's audio files for everything but the transition from broken to successful, where we use the "Program loaded and ready" audio file.

Anyway I think a better solution to CI notification is to have visual reminder of the status of the builds, something like the server screensaver.

You can download the CCTray audio files from CC.NET cvs archive, or you can download it from the zip file I created for your convenience.

kick it on

DataFormatString is not applied to BoundField

<asp:BoundField DataField="data"
      HeaderText="Data" SortExpression="data"
     DataFormatString="{0:d}" />

Why does this line of code (ehm... markup) always render the string "27/03/2007 0.00.00" as if it was just using a normal ToString(), instead of "27/03/2007", which is the result of the String.Format method using {0:d} (ShortDate format)?

At first I was thinking about some kind of error in the format string, but after carefully reading my format string bible I decided it was not my fault: a few search on Google and I found out this interesting post about some breaking changes in the ASP.NET 2.0 GridView.

The ASP.NET team decided to HtmlEncode by default all texts in order to prevent possible Cross-Site Scripting attacks. And for some strange reasons the HtmlEncode is applied before the Format method: to use the Format string now you need to add a HtmlEncode="false".

So, the correct definition for the bound field should be that one:

<asp:BoundField DataField="data"
 HeaderText="Data" SortExpression="data"
 DataFormatString="{0:d}" HtmlEncode="false" />

And the same applies to column headers: if you write HeaderText="Start<br>Date" and you don't say not to HtmlEncode it, then you will not see the 2 lines.

Bug or feature? This is the question...

I'm a DHSB programmer, what about you?

Just found a Programmer Personality Test, based on the Myers-Briggs Type Indicator, should tell you which kind of programmer you are.

So, I am a:

  • Doer
  • High level
  • Solo programmer
  • liBeral


3D Desktops

One of the latest trend is the inclusion inside operating systems of some kind of visually enhanced desktops: Vista has Aero, the OS X has Exposé and all the nice animations of the desktop, and some projects (like Beryl or Compiz) are adding the same (and even more "extreme") features to Linux distributions.

Luigi is using Ubuntu as his main laptop and he filmed the graphic effects he can handle with his 256Mb RAM, 6 years old laptop (he is running Compiz). 

Another very nice example of a Linux 3D Desktop is Beryl, a fork of Compiz (thanks to Alessio for sharing)

But that trigger a question in my head: why does Vista need special graphic cards and a lot of RAM just to have some translucent windows, while Compiz can play movies with the player on the edge of a 3D cube with just normal laptops graphic cards and 256Mb of RAM?

PS: if you are using a feed reader, you are missing 2 video: look at the post on my site to see them

Online project management with BaseCamp

Daniela left New Zealand this morning, and I'll not see her in person till August when I'll go back to Italy to spend a "real" summer on the beach.

But while she was here we started to do some work together and we needed a way to share to-dos, milestones, and general documents. At first we tried to use the Google Suite (Calendar, Docs) but it doesn't have to do lists, and since the main reason for going online is to be able to share to-dos we decided not to use it.

So we decided to give Ta-da lists a try, we liked it and we decided also to try its big brother BaseCamp, which is an online project management and communication "enabler" application, with milestones, messages and a shared writeboard for collaborative writing.

So we will be using this application to help us with the development of our new cooking blog cookingPiyo, to write the posts for it (using the collaborative writing feature), and for the work Daniela will be doing with the redesign of the user interface for the Subtext admin.

I've been using it only for a week, but I'm really starting to love it... I may even decide to buy the personal account and then I'll also have multiple projects, and an online file sharing area.

If you never did it I suggest you take a look at the online tour.

Suffering Kernel CPU time pain

My old laptop is almost 4 years old, and in the last few months it is suffering a strange issue with CPU kernel time: the "red line" in task manager is always 0 to 15 points less then the real CPU usage (so if CPU is idle, the kernel time is around 5%, if total CPU usage is 70% then kernel time is 60% and so on). That means that most of the CPU is spent in kernel mode handling hardware management, dealing with drivers and other stuff.

That is a pain because sometimes all the applications stop responding, the GUI become unresponsive, and even normal tasks takes a long time (for example it takes almost 45 seconds for Subtext to start running in debug mode after the build process has finished).

This is a screenshot of my CPU time after double-clicking on the SubText solution (which will open VS2005 and will load the solution), Once VS is up and the solution loaded I just run with debug.

I tried running all possible diagnostic tools, from checkdisk to sprinrite (which tests each single cluster on the disk). I defragmented the disk, I uninstalled all unused application and services that could cause the disk to misbehave like that, but nothing got better. But nothing solved the problem or helped me discover the reason of the problem.
A funny thing is that my wife's laptop is having exactly the same problem: same model, bought the same day in July 2003. So it should be a problem with the model of that laptop, or some application we both are running.

Probably it's time to rebuild the system, but since it's running on an old hardware, with just 1Gb of RAM, with an "old style" single core 2.66Ghz, with just 40Gb of disk space and a mobile ATI Radeon, it will never run Vista with an acceptable level of performance (and forget about the Aero, which is the only reason I see for moving to Vista). So I was wondering if the time has come to buy a new laptop or try fixing that one.

DTS is off, but why?

Today is the first day in New Zealand without DTS, so now we will have sunset at 7pm instead of 8pm as we had yesterday. (Actually at 6.39pm)

I was thinking about the changes made the USA and Canadian governments this year: why do we have to go back to the real time zone so early? Isn't it better to have more light in the evening for another month instead of having sunrise at 5am? Who cares about having sun at 5am since almost everybody is still sleeping at that hour of the day? I usually don't wake up before 7:30am, so, for my point of view, all the sun before that time of the day can be safely moved in the evening smile_teeth

The same applies to Italy of course: maybe it's better to do the same, and have more sun in the evening and less at 5am.

What do you think?

How-to add Lightbox v2 to a Subtext skin

Yesterday I added Lightbox v2 to my skin. So here is a step by step guide on how to do it.

Step 1: Download library

Download Lightbox 2.02 and extract it on a folder of your choice.

Step2: Skin Definition

Change the skin definition inside skin.config or skin.user.config adding the following lines inside the <Scripts> tag:

<Script Src="scripts/prototype.js" />
<Script Src="scripts/scriptaculous.js?load=effects" />
<Script Src="scripts/lightbox.js" />

And that inside the <Styles> tag:

<Style href="lightbox.css" />

If you are upgrading from the version of lightbox that is coming with Subtext you have to remove the following lines, too:

<Script Src="~/scripts/lightbox.js" />
<Style href="~/scripts/lightbox.css" />

In the case you don't have anything else, then your skin definition should be something link:

<SkinTemplate Name="lightbox2EnabledSkin"
        <Script Src="scripts/prototype.js" />
        <Script Src="scripts/scriptaculous.js?load=effects" />
        <Script Src="scripts/lightbox.js" />
        <Style href="lightbox.css" />

Step 3: Modify images path

Since lightbox script and its CSS references images using their full path, next thing you need to change is the location of images: you need to change is inside 2 files.

js/lightbox.js (first 2 lines of JavaScript excluding the comments):

var fileLoadingImage = "/skins/<yourskinName>/images/loading.gif";
var fileBottomNavCloseImage = "/skins/<yourskinName>/images/closelabel.gif";

and css/lightbox.css: here you have to look for all the places that have a "../images/" and replace it with "/skins/<yourskinName>/images/"

Step 4: Copy files to production server

Now that all the changes are done, you have to copy all the files to the production server:

  • css/lightbox.css goes into the skin root folder (/skins/<yourskinName>/)
  • all js files (prototype.js, scriptaculous.js, lightbox.js and effects.js) go into the skin script folder (/skins/<yourskinName>/scripts)
  • all the gif files that are inside images folder must be copied to the skin images folder (/skins/<yourskinName>/images)
  • last update the skin.config (or skin.user.config) skin configuration file

(If you don't see the changes then you need to recycle your website, if you don't have access to an IIS admin tool, just rename web.config to web.config.1 and rename it back after a few seconds)

Step 5: How to include a lightbox enabled image

Nothing is changed from the previous version, so all your old images will go on working they way they did before.

Adding an image is easy: just do as if you want to open the full-size image in a new page, than add a rel attribute with a value of "lightbox" to the anchor tag.

<a href="fullimageUrl" rel="lightbox" title="caption"><img src="thumbUrl" /></a>

And if you want to use the new feature added with version 2, the gallery, you just need specify lightbox[galleryname] as rel attribute.

<a href="fullimageUrl1" rel="lightbox[galleryname]" title="caption 1"><img src="thumbUrl1" /></a>
<a href="fullimageUrl2" rel="lightbox[galleryname]" title="caption 2"><img src="thumbUrl2" /></a>
<a href="fullimageUrl3" rel="lightbox[galleryname]" title="caption 3"><img src="thumbUrl3" /></a>

I just added a feature request on sourceforge for next version of Subtext, and I'm going to add lightbox v2 inside the 1.9 branch, so hopefully adding a lightbox would be easier in a few months.


CodeClimber is now LightBox2 enabled

As I promised a few weeks ago, I just upgraded my CodeClimber skin to version 2 of Lightbox.

To see the new features have a look at my post about picture of vacations and click on the images: the first one is a normal image (but you will notice the new image loading animation), while the second and the third are setup as gallery, so, clicking on the first (the Kilimanjaro one) you have to possibility to move to the other (Kalymnos one) always staying on the image popup.

I'll write more on how to setup this on any Subtext blog in a few days

UPDATE: I just wrote an step by step guide on how add lightbox v2 to a subtext blog

Blogging about Cooking with WordPress

Today is the launch day for my new blog: CookingPiyo.

It's a blog about cooking, with recipes, wine reviews, restaurant reviews, cooking tips, and sport eating tips, between Milano and Wellington.

My wife designed the skin, while I made a few customization to wordpress (made a few plugins).

I decided to use WordPress instead of SubText because I wanted to test in first person how the user experience of that great blogging tool is, and maybe get some inspiration for the plugin API and the redesign of SubText admin interface.

At the moment only Italian reading people will be able to read the blog, since it's just in Italian: maybe I'll migrate to the multi-blog version of WordPress and will start also an English version of the same blog.

The first recipe, as tribute to New Zealand, is the Pavlova.

ASP.NET 2.0 new features documentation roundup

I just had to collect a list of links about the new features of ASP.NET 2.0 for my colleagues since our next project will be ASP.NET 2.0 and will leverage almost all of that features, so I think is worth sharing it.

  1. Membership/role/profile API: for managing account, login, administrative permissions, and so on (and you can build a custom provider that gets data from a legacy database)
  2. SiteMap: bound with the feature above, will make very easy the process of limiting the access to not allowed pages, and provide a unique place for defining the menu bar and navigation:
  3. Masterpages: to get an easy way to have a consistent look&feel among all the pages:
  4. ASP.NET Ajax: to add some nice UI elements and provide an easier interaction for the end user:
  5. Localization: to have the possibility to localize the web application, even if the at first you want to have it only in English:
  6. Themes: the same results can probably be achieved designing the pages making a wise use of CSS, but worth knowing what you can do in order to make a decision:

Are you in US? No, you cannot see WLW gallery

Exactly what I'm saying: if your browser doesn't have en-US inside the preferred languages you cannot see the Window Live Writer Gallery. And having something with en is not enough because I had en-NZ and was not working too.

The quick fix is to add en-US to the languages.

Thanks to Scott for the suggestion

Congratulation FCKeditor!!!

DotNetNuke team just announced that DNN 4.5+ will move to FCKeditor as the default rich text editor on all the portal pages, replacing the previously used FTB.

This is a big achievement for Frederico Caldeira Knabben that started that project in March 2003 and that was awarded as SF Project of the Month in December 2005.

I've been a member of that team for a long time, and I developed the java connector. Here a public thank you that Fred said when he was interviewed by  SF for the POTM award:

I would also like to leave here a big thanks for all my contributors, who have always given their best to enhance the quality of our project, and especially to Simone Chiaretta, who has been with us a long time.

Unfortunately I had to stop contributing due the many things that are happening to me in that period of my life, so now the java integration is managed by Alakon Software. Now my involvement with FCKeditor will be mainly testing it inside our Subtext blog engine and translating to Italian.

Past and future vacation picture

Leonie (Nic 's wife) just gave me the excuse to post some holiday picture: today meme is "Vacation's pictures" (from Create a Connection!)

1) Post a photograph from a favorite vacation

It's hard to tell about a favorite vacation, since all my last vacation with my wife Daniela have been great, so I'll post one from my last vacation, which was last week walking the Queen Charlotte Track.

There are also a lot of other pictures from that short 4 days trek on my wife's flick account.

2) And locate one from a future vacation spot

This is even harder to tell, since still not sure where I'll be in the next 6 months, here in Wellington, or back to Milano, or maybe even somewhere else (Vancouver? Barcellona?). But the most probable future vacations will be: Mount Kilimanjaro peak in August or back to climb for the 2007 RocTrip event in Kalymnos (well, if they do it again this year as they are doing since a few years).



The picture about Kilimanjaro is taken from wikipedia while the one about Kalymnos is taken from my picasaweb photo album on my last trip in Kalymnos last September.

Easier editing of CruiseControl.NET config file with CCNetConfig

A few weeks ago I started using a nice utility that helps with the editing of CruiseControl.NET configuration files: CCNetConfig.

The configuration file has some many options available, and each single plugin (for example source control, or different build tasks) has different options. So it's quite difficult to remember all the configuration options and going every time on the documentation can be quite time consuming.

This is not an very sophisticated application, but it's very powerful and effective in its simplicity: it's based on the property grid control available inside the Windows.Form assembly. And there a lot of rules that present the user with only the available configuration options for the chosen plugins and also for the specified CCNet version.

Here is a screenshot of the version I installed on my development machine and it's editing the ccnet.config file for the build machine I'm setting up here at Calcium.

At the moment of writing the current version is the 0.3.5 RC2 (the one displayed on the screenshot above) but Ryan Conrad is already working on the 0.3.9 which will also add support for the 1.2.1 ccnet configuration schema.

A nice feature is the split pane that shows the documentation page for the selected configuration node. This way you have the best of both worlds: the verbose description of all the settings and attributes, and the managed editing of them.

Good job Ryan!!!

iTunes 7.1 is out, with fullscreen coverflow

I'm becoming an Apple fan more and more ever day. A few days ago they just released the new iTunes, version number 7.1.

Using iTunes 7.1, you can now enjoy your favorite iTunes movies, TV shows, music, and more from the comfort of your living room with Apple TV. iTunes 7.1 also supports a new full screen Cover Flow and improved sorting options to let you decide how iTunes should sort your favorite artists, albums, and songs.

And they also say it should fix many of the compatibility issues it had running on Vista.

If you are interested in the full release notes, you will be disappointed, as they don't say much more than what I just quoted above.

You can get the new iTunes 7.1 from the Apple site, or wait till your Apple Software Update detects the new version.

Visual Studio 2005 SP1 Update for Vista available

After a few month of beta, Microsoft finally release the final version of the Visual Studio 2005 Service Pack 1 update that specifically targets problems running on Vista.

I installed the beta a few months ago, just a few days after starting to work here at Calcium, and I didn't have any notable issues.

You can download it from Microsoft Download Site:

Visual Studio 2005 Service Pack 1 Update for Windows Vista

One step closer to the Mac

I've been thinking about getting a mac since I saw the new MacBook Pro more than one year ago: now my old 4 years old laptop (Acer Travelmate 430) is starting to have some problems (running very high on kernel mode CPU time, probably due to some HD failures) and the macbook option is getting more and more real.

Probably I'll not buy a MacBook Pro since it costs too much (4.749 NZ$ or 2.499 euro), but the MacBook 13"" with 2GB of RAM is what I'll probably buy.

I knew about Parallels, the software that allow you to run a Windows OS (XP or Vista) inside a Mac, but yesterday I found out a very cool feature they added to the final release of Parallels Desktop for Mac: Coherence.

This feature allow user to run Windows applications without forcing them inside the virtual desktop.

When a user switches to Coherence mode, their Windows desktop disappears, leaving their Windows applications running directly on their Mac desktop.

But an image, or a video, is better than a thousand words:


If you are reading this post inside a newsreader, read the post on the CodeClimber site to watch the video

SetData to clipboard failing on VirtualPC

After a nice 4 days trek on the Marlborough Sounds (pictures and short report to come soon), I'm back at work.

We are close to the release of the next version of our main product, so we are setting up some VirtualPCs to test it. And we found a problem on a portion of application that never caused problems: a simple Clipboard.SetDataObject.

Looking at the documentation on MSDN I found that NET 2.0 added a new overload to the SetDataObject method:

public static void SetDataObject (
    Object data,
    bool copy,
    int retryTimes,
    int retryDelay

Why should a method have these retry options?

Adding data to the Clipboard can occasionally fail if the Clipboard is busy with another thread or application. This method is useful to work around this issue in environments with heavy Clipboard use.

But these retry options doesn't seem to be enough on Virtual PC, so I wrote a small helper method that seems to work around the problem most of the times.

private static void CopyDataToClipboardSafe(object data, bool copy)
      Clipboard.SetDataObject(data, copy, 10, 50);
  catch (ExternalException)
          Clipboard.SetDataObject(data, copy, 10, 50);
      catch (ExternalException)

Not 100% effective, but since the problem happens mainly on Virtual PCs, and probably 95% of the users of our product never heard about it, I think I can safely announce that I fixed that bug smile_wink.
And probably better to use VMware as virtualization software for our test environment.

kick it on

Going tramping

Tomorrow morning I'm leaving for the first real trekking here in New Zealand:

I'm going to walk the Queen Charlotte Track in the Marlborough Sounds.

I'll be walking for 4 days inside nature, bush, on unspoiled beaches, and, hopefully, under a warm sun.

The track is 71 km long, with the 3rd day being the longest (24km, 6 hours walk at easy pace) and the 2nd one being the shortest (11Km, 3hours).

If you are interested to know more about that track the official track website have a nice track guide with maps, elevations, approximate times and so on...

So, I'll be back blogging next Tuesday.

As a side note, if you click on the picture above you will notice a new feature I'm going to add to my blog skin: Lightbox. Subtext comes with Lightbox v1, but version 2 is around since one year, so I think I'll update my skin to the new version soon.