Should we get PocketPC/Windows Mobile OS upgrades (for free)?

In the times when HTC rules the Windows Mobile market with an absurd amount of different models nobody is questioning their (and perhaps MS’) tactics of pure greed and “buy new device each couple of months” logic just to get a bunch of issues fixed (and introduce new ones) and of course, to get a new OS version. True, along you’ll get newer hardware as well, but do you really need it?

The logic is simple: HTC shovels tons of good (or bad) hardware into the device, installs whatever Windows Mobile version is actual, includes drivers or not, checks the functionality by doing few tests in a day time span and releases the model. At least this is my impression. If something doesn’t work as expected you are free to purchase an improved version in a month or so. OS upgrades are very very rare and more of an exception than the rule. Missing drivers? No way they will provide any driver that is missing from the beginning even if it is a core driver, such as graphics accelerator.

In other words, upgrades are something they are really reluctant to offer. Why? Simple, more we sell more we profit. Am I spoiled by desktop computers where at least I can buy an upgrade? I don’t think so. And nor does Apple. They are giving iPhone upgrades for free. OK, iPhone isn’t perfect nor is Apple selling policy etc. but, they are providing upgrades for free. Something unthinkable in Windows Mobile world. Somebody might say that newer Windows Mobile requires better hardware and won’t run on existing devices and thus buying a new model is a necessity. Wrong. Take for example my TyTN II. It has almost the same graphics horsepower and a bit slower CPU as iPhone. Should it run WM 6.5? I think so and probably it will through self-cooked ROMs. Will it run an official version of WM 6.5? I very much doubt it.

And then there is Google Android:

Android is the first free, open source, and fully customizable mobile platform.

This approach is unthinkable again, this time for both HTC/MS and Apple. It is too soon to judge it but the idea is great. Is it possible that some day we’ll see new devices come with drivers only and we’ll be able to install whatever OS we’ll want? Just like our desktop machines? It doesn’t looks like a near future but Android is certainly a step in that direction.

Anyway, the most important difference between Apple and HTC/MS (hard to say who is responsible for what) is how they treat their devices. Apple treats them with love and care and they put a lot of effort to make them customer friendly. On the other side, HTC just puts hardware together, installs OS, throws them to customers and forgets about them. I wonder which is the policy you prefer. HTC/MS should learn something from both Apple and Google not just copy Apple’s marketplace thing (forthcoming WM feature) to make more money. It is the attitude! Even the super hyped honeycomb UI won’t make a significant difference (why the heck are people even speaking about it?).

Last but not least, mass producing instead of software upgrading unnecessarily burdens mother earth with enormous amounts of (HTC) waste.

I am currently stuck with HTC TyTN II/WM6.1 and I am waiting for a new gadget to appear. It just might be an Android one, but certainly not powered by HTC. My confidence in Windows Mobile is slowly vaporizing and I’ll most probably jump the wagon. Heck, even ease of development won’t convince me anymore (being a .net developer programming WM is somewhat familiar). It is just not quite the time for me to switch, yet.It is comming though.

Perhaps my impression is wrong, feel free to correct me. Note also that this article is more or less about the OS upgrades, not other problems.

Listening to the music while working with computer

Do you listen to the music (or perhaps to a radio station) during your daily work with computer?

I do almost all the time. I actually listen to various metal (some will contest that metal isn’t music – it is, trust me ;-)) radio stations usually through Winamp/Shoutcast stream of which H4XED radio station is my current favorite. The ability to listen to internet online radios is just awesome – I mean not being restricted to local stations, old antenna based gadgets and low quality sound. Just fire up any of media players and I am sure you’ll be able to pick among thousands of stations streaming good quality sound.

So, what do you listen to when typing all that boring code?

Silverlight 3: LOB without printing?

Looks like Silverlight 3 is very much geared towards line of business applications. That’s great and I guess what many people were looking for, including me.

So what does one need for a typical LOB application anyway? For me there are three front end ingredients:

  • editors (date, currency, etc.)
  • grid
  • printing

First two points are covered pretty well, and if they aren’t you can implement them by yourself or use 3rd party controls. The problem is the third point: printing.

I have yet to see a LOB application that doesn’t do any printing. Heck, even Notepad does printing. Since there is much talking about LOB acronym in conjunction with Silverlight 3 I’d assume printing will be natively supported by Silverlight 3. Now, sit down and take a deep breath: there is no printing support feature announced whatsoever! Looks like Microsoft is creating a new bread of LOB applications: green ones – they won’t pollute the earth with wasted papers. That’s good in the time of global warming. But that’s not good for LOB applications nor for Silverlight 3.

Imagine a customer asking: “The application looks great but how can I print the reports?
Manager/whatever (selling a Silverlight 3 application): “You can’t but you can see the data in 3D using your graphic card’s GPU! Why would you need printing for?
Silverlight 3 developer (kicking in): “Ehm, there is a PrtScn button on the keyboard.

Looks like I am not alone in printing quest (just to name first two from what I’ve read):

Redmon Developer News readers
Oliver Sturm (point 1 on the list)
… (I am sure the list is a long one)

Building an Intel Core i7 based computer – Chassis

The last ingredient is the chassis. Likewise PSU it looks like you don’t need to be careful when picking one. Wrong. Chassis are very different and details are important. Let’s go by features in no significant order.

Weight

Cheaper chassis are mostly build from steel (at best the front cover is made by aluminum but they are mostly from steel) while the more expensive are built from aluminum. Which means lower price and more weight. I am not sure how much the material affects cooling – aluminum chassis should perform better. Since my chassis will sit under my desk and I will (hopefully) rarely move it I am not concerned with weight. The cooling difference should be minimal. Thus steel for me, aluminum is an option.

Classic or tool-less

Tool-less design means that you won’t have to toy with screws to mount drives and add-in cards. Instead you’ll easily use custom made plastic gizmos to fix them. Otherwise you’ll have to use a screwdriver (not that fixing a motherboard is still a screwing experience nevertheless). Not a big deal but this is a good feature. I’ll go for this, not at all costs though (I’ll install hardware only once).

Drives mounting direction

Some chassis support drive mounting from side. This makes mounting and even more important, changing, drives much easier. In classic way you have to push the drive towards wire-filled motherboard to get it in or out. But if you have a side mounting option the drive replacement and mounting is much easier. A must.

Size

Mid-tower for me. No need for big tower.

Front side connectors and their placement

I like to have them on the top of the chassis and I am looking for: 2 (at least) x USB and Firewire. e-Sata is a welcome option.

Front side buttons placement

Having power on and reset buttons located at front side is not a very good idea. They are easily involuntarily kicked when the chassis is positioned under the desk (on the floor) and when the access to them is too easy. Which is something you want try to avoid, otherwise you (or your kids) might reset your computer in middle of the work and data will be lost. Pay attention to buttons accessibility to avoid such unpleasant surprises.

Internal ventilation

Once more the keywords here are 12cm fan and a slow rotation to avoid making too much noise. I like to have two of them, one on the front side and the other on the back side. Front side fan should be an intake while the back side one should be an outtake. So the air moves through and cools entire chassis content. Furthermore the front side one should be placed right in the front of hard driver to provide an adequate air flow. If the chassis doesn’t come with built-in fans it should have at least adequate holes.

Design

I don’t care. It will sit under my desk and I won’t look at it often.

PSU location

PSU is usually located at the top of the back side of the chassis. However the recent trend seems to favor putting it on the bottom to improve the temperature reduction inside the PSU itself. I thought this is a nice idea and why not – cooler PSU means lower noise. But later, when I was building the computer I’ve found that it isn’t such a good idea after all for various reasons (details in next post).

That’s it more or less. There are plenty of different chassis out there from many different manufacturers and picking a good one might take quite some time. Usually I buy chassis made by Cooler Master and this time is no different. At my price range they are good enough.

I’ve bought a Cooler Master RC-690-KKN1-GP from AGT.si for 83 Euros. Note: this chassis has PSU located on the bottom of the chassis. The delivery process from AGT took more than a month because the chassis wasn’t in stock and distributer took quite a long time to deliver.

See other relevant posts:

Introduction
CPU cooler
The goal
Power Supply Unit
Memory
Storage
CPU
Graphics card
Motherboard

Partial Output Caching in ASP.NET MVC updated

Thanks to Miha Valenčič I’ve found this great article about Partial Output Caching in ASP.NET MVC. It actually explains how to do ActionResult caching in ASP.NET MVC. It was exactly what I was looking for. I had the same idea as in this blog post but didn’t know about SwitchWriter method nor I was aware of ActionFilterAttribute. IOW I had the idea but I didn’t know how to implement it. Which the mentioned blog post does.

The encoding

Problem

While this approach works I immediately stumbled on an encoding issue. The cached output is always encoded with UTF-16 encoding which might not be always a good thing. In fact IE7 protested immediately that one can’t switch between encodings (my original encoding is UTF-8) just like that. Hm.

So I went looking who is the culprit and soon found out that it is the temporary StringWriter created in the method below:

public override void OnActionExecuting(ActionExecutingContext filterContext) { _cacheKey = ComputeCacheKey(filterContext); string cachedOutput = (string)filterContext.HttpContext.Cache[_cacheKey]; if (cachedOutput != null) filterContext.Result = new ContentResult { Content = cachedOutput }; else { _originalWriter = (TextWriter)_switchWriterMethod.Invoke( HttpContext.Current.Response, new object[] { new HtmlTextWriter( new StringWriter()) }); } }


See, StringWriter uses UTF-16 and won’t allow any other encoding to be set. Easily that is.

Solution

Luckily the solution is an easy one. It involves a StringWriter derived class that accepts any encoding, such as this one (from Jon Skeet’s message):

public class StringWriterWithEncoding : StringWriter
{
Encoding encoding;
public StringWriterWithEncoding(Encoding encoding)
{
this.encoding = encoding;
}
public override Encoding Encoding
{
get { return encoding; }
}
}

This new class should be used in creating that temporary writer, like this:

public override void OnActionExecuting(ActionExecutingContext filterContext)
{
_cacheKey = ComputeCacheKey(filterContext);
string cachedOutput = (string)filterContext.HttpContext.Cache[_cacheKey];
if (cachedOutput != null)
filterContext.Result = new ContentResult { Content = cachedOutput };
else
{
StringWriter stringWriter = new StringWriterWithEncoding(filterContext.HttpContext.Response.ContentEncoding);
        HtmlTextWriter newWriter = new HtmlTextWriter(stringWriter);
_originalWriter = (TextWriter)_switchWriterMethod.Invoke(HttpContext.Current.Response, new object[] { newWriter });
}
}

And that’s it. New version of temporary writer will automatically use whatever encoding is set by HttpResponse.ContentEncoding.

The ContentType

Problem

The other problem involves ContentType not being cached. In my case I am testing with SyndicationFeed and ContentType has to be “application/rss+xml”. However it is ignored by the original caching mechanism where only response content is cached but not ContentType.

Solution

I’ll declare a new class that will store both content and content type.

class CacheContainer
{
public string Output;
public string ContentType;
public CacheContainer(string data, string contentType)
{
Output = data;
ContentType = contentType;
}
}

I’ll use this class to store cached content, like this:

public override void OnResultExecuted(ResultExecutedContext filterContext)
{
if (_originalWriter != null) // Must complete the caching
{
HtmlTextWriter cacheWriter = (HtmlTextWriter)_switchWriterMethod.Invoke(
HttpContext.Current.Response, new object[] { _originalWriter });
string textWritten = ((StringWriter)cacheWriter.InnerWriter).ToString();
filterContext.HttpContext.Response.Write(textWritten);
CacheContainer container = new CacheContainer(textWritten, filterContext.HttpContext.Response.ContentType);
        filterContext.HttpContext.Cache.Add(
_cacheKey, container, null, DateTime.Now.AddSeconds(_cacheDuration), 
Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
}
}

See, I am caching both Response.ContentType and its content now.

The last step is to use the cached ContentType, like this:

public override void OnActionExecuting(ActionExecutingContext filterContext)
{
_cacheKey = ComputeCacheKey(filterContext);
CacheContainer cachedOutput = (CacheContainer)filterContext.HttpContext.Cache[_cacheKey];
    if (cachedOutput != null)
{
filterContext.HttpContext.Response.ContentType = cachedOutput.ContentType;
filterContext.Result = new ContentResult { Content = cachedOutput.Output };
}
else
{
StringWriter stringWriter = new StringWriterWithEncoding(filterContext.HttpContext.Response.ContentEncoding);
HtmlTextWriter newWriter = new HtmlTextWriter(stringWriter);
_originalWriter = (TextWriter)_switchWriterMethod.Invoke(HttpContext.Current.Response, new object[] { newWriter });
}
}

There you go.

ActionOutputCacheAttribute.cs (3.51 kb)

My first ASP.NET MVC pet project – Walls Talking

This week I’ve been extremely busy. Besides my usual work that pays for my living I worked on my first ASP.NET MVC project: Walls talking. I followed ASP.NET MVC development for long time but never had time to do something on my own.

And just a few days before ASP.NET MVC RTM release I’ve downloaded RC2 and in a couple of days (in spare time, mind you) I’ve put together Walls Talking, a graffiti collection site. Actually the idea for this project comes from my Saša and I merely coded the site that implements the idea. It features a form for uploading graffiti photos and its description, about page, a home page listing last 10 entries and a syndication feed. So far. The site is under construction of course and I’ll add features as long as my time permits me.

I can say that ASP.NET MVC is a truly a great platform for building web sites. It feels so slick and clean and much easier than regular ASP.NET bloated wizardry. I am missing a few features (i.e. construction of URL links outside of the Views, StreamActionResult that can be cached, etc.) so far, but hey, it is only at version 1.0. And there are relatively simple workarounds for those missing features that I created.

Building an Intel Core i7 based computer – Motherboard

First step in picking a proper motherboard is a chipset choice. But not with the Intel Core i7 as the only available chipset is Intel X58, like it or not.

My next step is to pick a manufacturer I like. As for graphics card my choice goes to Gigabyte. Never had issues with their motherboards and they are well built with quality components.

Next, I define what I expect from my motherboard. Here is the list:

  • passive cooling (heat pipes rules)
  • it should have a built-in Intel Matrix RAID controller (it goes by name ICH10R)
  • it should support at least 4 SATA2 drives (have at least 4 adequate ports)
  • it should have two PCI-E 2.0 16x ports (one goes to graphic card, the other might go to an additional graphic card (perhaps for running CUDA or for running more than two screens at once) or some other card requiring high bandwidth). Note, I don’t care about nVidia SLI or ATI Crossfire.
  • it should support three memory channels (the number of memory slots should be 3 or 6  - 6 is preferred) as Core i7 works with three channels natively (read my CPU article)
  • it should support QPI up to 6.4 GT/s (bus speed)
  • it should support at least 6GB DDR3 1600GHz (or faster) RAM
  • it should have as many USB 2 ports as possible (they are never enough, trust me)
  • it should have at least one Gb LAN adapter (two is better but not obligatory)
  • it should have dual BIOS (this feature is useful if something goes wrong when BIOS is flashed to a newer version. If the motherboard doesn’t have dual BIOS or some similar solution then the only solution is to send it in for a repair)
  • it should support 5.1 sound output
  • it should have at least one PCI slot
  • it should support IEEE 1394 aka Firewire (useful for transferring videos from video camera)
  • it should have PS/2 ports for both keyboard and mouse (more USB ports are left for other devices)
  • built with quality components is a bonus
  • eSata support is a bonus
  • misc features that I take for granted

I don’t care about motherboard performance since it doesn’t vary a lot between similar motherboards. After looking Gigabyte’s line of X58 motherboards I’ve finally picked a Gigabyte EX58-UD4 model. It has more or less everything I listed except for eSata connector (which is really useful only for connecting external hard disks). It also features a single LAN adapter but I don’t care since I have a spare PCI network card hanging around.

The most interesting aspect of this motherboard is perhaps Intel Matrix ICH10R built-in RAID controller. It is some sort of a hybrid because it doesn’t have a dedicated CPU – instead it steals a bunch of CPU cycles from the main CPU. As long as one uses RAID 0, 1 or 0+1 it doesn’t matter much because the utilization is really marginal. RAID 5 is a different story – don’t use RAID 5, specially with built-in controllers if you care about performance – I won’t use it on this workstation thus I don’t care. The controller doesn’t have its own cache as well. Again, this isn’t much of an issue unless you are in the RAID 5 or higher. The backup electricity is provided by an UPS for me (there is no option for a backup battery).
On the positive side Intel Matrix is fast enough (again, for RAID 0, 1 and 0+1) and has a clear advantage on compatibility field. Imagine the situation your non-Intel RAID controller card fails. You have to buy a new one. Here is a big problem: you have to buy the same model unless you are searching for troubles. The thing is that RAID controllers, even from the same company aren’t very much compatible as they write data to disk a bit differently – IOW you might loose all the data if you don’t find an adequate one because it won’t be able to read the data. Ouch. If the original controller is an old one then double ouch. Here Intel Matrix shines, at least judging from tests performed by online web sites (can’t remember where I’ve read them) – most chances are that if you change your motherboard for another one that has an ICH10R RAID controller it will just work. Furthermore it is probably compatible with older RAID controller models as well (ICH9R, ICH8R, etc.) – on the negative side you have to change your motherboard if built-in controller fails which might be even cheaper than changing a separate controller.

I’ve bought a Gigabyte EX58-UD4 motherboard from mimovrste.com for 215 Euros.

See other relevant posts:

Introduction
CPU cooler
The goal
Power Supply Unit
Memory
Storage
CPU
Graphics card

 

A Windows Home Server backup engine’s serious issue

I consider Windows Home Server as an excellent backup solution for doing disk image backups – it is wickedly fast and consumes minimum space possibly on the server. Unfortunately it lacks reliability. The most notorious bug, the one that corrupted its file system in combination with certain client applications, is fixed. But there are other problems to worry about.

Today I’ve come across a show stopper. Let me first explain how WHS reclaims free space. Once the backup data expires it isn’t automatically reclaimed. Instead a cleanup process has to be performed. By default it runs once per week but one can change its scheduling. So far so good. And guess what. The cleanup process doesn’t work anymore on my WH server – it runs to 5% and then it just stops leaving the data as is. Not even sure when or why it started to fail. No space is reclaimed and I am slowly getting out of disk space because the storage just grows and grows. At the same time it is unclear whether this is a consequence of a corrupted data (yikes!), a software issue or both. Similar bug was reported last year through Connect but so far, even after more than 4 months, no fix is available. Microsoft guys claim that they solved the problem but just this fact without a solution for us doesn’t help us, does it?

And I though the most important feature of backup engines is their reliability.

Building an Intel Core i7 based computer – Graphics card

This one is a relatively easy choice.

The main criteria for me is the silence. Fortunately there are passively cooled mid-range graphics cards out there based on the GPUs from both nVidia and ATI. They are not amazingly fast, but hey, one needs amazing speed only when playing games or for some really specialized tasks. There is really no need for top performances for me.

The other important feature I am looking for is a double DVI output because I am currently using two LCD screens.

Next, I’ll have to choose between nVidia and ATI. This is a difficult choice because the two companies are more or less equally good. The deciding factor for me is CUDA (which is only supported by nVidia and I might play with it) and the fact that nVidia passively cooled cards are more powerful than ATI ones.

The last criteria is performance. I’ve picked the fastest passively cooled graphics card from nVidia on the market: card based on a 9600GT GPU. The bus supported is PCI-E 2.0 which is a mainstream bus (AGP and PCI are legacy buses and should be avoided). The card is manufactured by Gigabyte, a company I consider a good one and I never had problems with.

That’s it. I’m not interested in other features. Perhaps having a HDMI converter (which my card has) might be important in future if/when I decide to buy a new LCD screen. I don’t think that it will happen anytime soon though.

Note: The graphics card I’ve bought occupies two slots (see the pictures below) on the chassis due to the massive heat-pipe cooler.

I’ve bought a GIGABYTE GV-NX96T512HP 9600GT 512MB PCIe (rev 3.0) from Mlacom for 111 Euros.

See other relevant posts:

Introduction
CPU cooler
The goal
Power Supply Unit
Memory
Storage
CPU