Uri Escaping

Either I need to download a certain page for further processing or I need to just post some data, code for generating url is quite similar. Just take two strings and merge them together. I usually then convert resulting string into Uri because most methods tend to require it, or even if they accept string, they convert it into Uri internally. For example:

var uriString = string.Format("http://www.example.com/{0}/", "ABC");
var uri = new Uri(uriString);
Debug.WriteLine(uriString + "\t" + uri.ToString());
// http://www.example.com/ABC/    http://www.example.com/ABC/

This, of course, does not deal with having special characters. All you need for those is escaping. Fortunately Uri class already has a method for that:

var uriString = string.Format("http://www.example.com/{0}/", Uri.EscapeDataString("A/BC"));
var uri = new Uri(uriString);
Debug.WriteLine(uriString + "\t" + uri.ToString());
// http://www.example.com/A%2FBC/  http://www.example.com/A/BC/

As you can see peculiar thing happened. While our string is escaped, transforming it to Uri actually loses this. Instead of encoded “A%2FBC” as one segment we get separate “A” and “BC”. Querying server with later will not result in expected content.

Solution here is to use double escaping.

var uriString = string.Format("http://www.example.com/{0}/", Uri.EscapeDataString(Uri.EscapeDataString("A/BC")));
var uri = new Uri(uriString);
Debug.WriteLine(uriString + "\t" + uri.ToString());
// http://www.example.com/A%252FBC/    http://www.example.com/A%252FBC/

End result might look ugly but it will get you that page every time.

P.S. Example.com does not contain said directories/files. To see double encoding example, you can check this link toward DigiKey (http://www.digikey.com/product-detail/en/DS2482S-100%252B/DS2482S-100%252B-ND/1197435) or just roll your own.

Bastards

Illustration

I am always happy when someone chooses to distribute my software. If nothing else they often host software install themselfs and thus they lower load on my own server. Everybody wins. Usually.

Bastards at IrcFast (no, I will not include their link) decided to bundle VHD Attach with Babylon toolbar and something called Coupish. I view both those packages as borderline spyware. And I would never bundle my program with them. If you install VHD Attach and you are not careful, you will soon be looking for removal procedure. Let’s just get it in clear: THIS IS NOT ENDORSED NOR BUNDLED BY ME.

Are they doing anything illegal? No, license I selected is quite permissive and it does allow for almost anything. As long as software is intact anyone can bundle it as much as they want. And even if I had it under any other license I am not sure it would matter. Those idiots would bundle it anyhow.

I can only do one thing. I can warn everybody to stay clear of this site.

VHD Attach 3.61

Illustration

Nothing much here. Just a single bug fix that makes VHD Attach work properly on German Windows. :)

Update from within application or from web site.

KulenDayz 2012

Illustration

For next three days Beli Manastir will host crème de la crème of Croatian IT community. Whoever comes there can expect a lot of quality lectures delivered by people all around world. And that will be mixed with huge amounts of fun and mingling.

For all community members sessions are free while other pay nominal fee. Post conference events do require additional payment but they are well worth it.

Unfortunately this year everybody will have to live without me present and no session will hold my ramblings. But do not worry, next year I am back. :)

P.S. If you see Bernard, give him a hug - this conference is his baby and every year he puts enormous amounts of love and energy into it.

Illustration

Fingerprint Logon in Windows 8

Illustration

As I installed Windows 8 I was very happy to see that my Authentec AES2810 fingerprint reader got installed by default.

My happiness didn’t last too long. As I went to record my fingerprints I was greeted with “The selected fingerprint reader has no management application installed”. In Windows 7 that application got installed via Windows Update alongside reader’s driver. In Windows 8 they decided driver alone is enough. Which idiot arrived to that conclusion is left for discussion. In any case, my fingerprint reader was useless.

If everything else fails, go to manufacturer - AuthenTec was kind enough to offer their Protector Suite 2012 for download. Installing it allowed me to use fingerprints once more. It is not ideal situation since that program is limited version (unless you upgrade) and it includes way more than one needs for simple logon. But it does work.