As I mentioned in my previous article about how to render an ASP.NET MVC View to a string, there are several methods to do it and they probably are quite different performance-wise. Well, this time I've got some benchmarks. ![]()
As I mentioned in my previous article about how to render an ASP.NET MVC View to a string, there are several methods to do it and they probably are quite different performance-wise. Well, this time I've got some benchmarks. ![]()

Yesterday I went visiting the "Park of the Monsters" in Bomarzo, near Viterbo. The park was built in the 16th century by architect Pirro Ligorio, on commission by the lord of Bomarzo, Vicino Orsini. It is one of the first parks of its kind and has inspired many later monumental gardens, like the "Giardino dei Tarocchi" by Niki de Saint Phalle.
The park is said to be a mockery of classical, symmetrical gardens of the time. It is located at the bottom of the valley near Bomarzo, overseen by the town and the estate of the former noble house. A dense wood takes up most part of the garden, intertwined with monumental sculptures and buildings, each one of them with mysterious inscriptions and symbolical meanings.
I just reorganized the code of On Top Replica and finally committed it on the repository on CodePlex.
I also fixed some annoying things: first of all, resizing now works way better. The aspect ratio of the cloned window is now kept also while resizing, not only when you release the drag handle. Doing that is harder than expected in Windows Forms, but can be done by handling the right Win32 messages.
As a user suggested on the On Top Replica page, I also added region selection to the windows menu: that is, after selecting which window to clone you can also select one of the saved regions to apply directly. This should make using regions a bit easier.
Next updates in the pipeline: refactoring the code a bit (it's messy, but piece by piece it's getting better...) and adding some cool features for Windows 7! That means I'll remove the "tray icon" and leave the application on the task bar, add some jump lists, etc...
Let me know if you find bugs or have some suggestions.
Comments welcome as always. ![]()
I've had an account on Last.fm for more than 3 years and liked it on the spot. I love to explore new music, discover new artists, listen to streaming radio (that is, until it was free) and especially scrobbling the music I listen!
The geek in me simply freaks out seeing the amount of stats you can get from your Last.fm "scrobbled" data: the music I listened the most this week? Last month? What is my favorite Porcupine Tree song? In fact there's also lot of external services that offer awesome visualizations of your data.
This was great up to the day when I decided to put my whole music collection on the Windows Home Server and listen to it via the built in UPnP media sharing in Windows Media Player. That day I discovered that the Windows Media Player plug-in doesn't scrobble songs on network shares! It doesn't work, neither from an SMB shared folder, nor directly through UPnP sharing (which in fact is HTTP streaming).
Yesterday I went to the Porcupine Tree concert at the Atlantico in Rome, with Federico and Alessandro.

In a previous post I outlined the method I used to rip multichannel surround audio from my DVD-A collection. As was pointed out in the comments, the method works but isn't entirely correct.
As I discovered now, DVD-Audio discs usually contain both Video and Audio data. The audio data, which are the advertised high resolution 24 bit surround tracks, are located in the AUDIO_TS folder. For compatibility reasons (I guess), all DVDs also contain a standard VIDEO_TS folder that contains a normal DVD movie with compressed DTS sound. The video data is great if you want to playback the disc on a home theater (and show off your surround system, perhaps) or to access the bonus features.
But to get the full listening experience it is best to use the uncompressed PCM audio data. Here's an illustrated guide on how to rip the tracks.
While working on OnTopReplica I needed a way to constrain the aspect ratio of the "cloned" window. Since the live thumbnails created using the DWM API cannot be manipulated and always maintain the aspect of the original window, it makes sense to limit the user's choices in resizing the window, in order to fit the window to the cloned thumbnail automatically.
Much like in the case of media players, where video files have a certain aspect ratio (let's ignore that this ratio can usually be changed by the user). If the video doesn't fit inside the player window, black bars are added on top and bottom or on the sides. Limiting the user's resizing options in this case actually improves the interface experience because a tedious task is handled directly (like searching the right size of the window to reduce the black bars).
In Windows Forms you have two options to react to resize events of the window: the OnResize event and the couple OnResizeBegin and OnResizeEnd. The problem of those two methods is that they both run after the window has been resized. That is, after the window received the WM_SIZE message (in Win32 terms). You can force the window to adopt a correct size after receiving one of those events.
This would work, if it weren't for the option "Show window contents while resizing" (added a long way back in Windows 98, more or less). That option (which is usually on by default) causes the window to generate a lot of WM_SIZE messages while it is being resized. If you react by changing the size on each event, the result is an extremely jerky window that jumps back and forth while the users tries to resize it. And the contents of the window flicker awfully as a result.