Saturday, March 8, 2014

Running old ASP app on Windows 7 - 401.3 unauthorized problem

There's a great article here about how to run and debug that 'classic' ASP site of yours, if you happen to have one. However, if you make just the steps from article, you'll probably end up with "HTTP Error 401.3 - Unauthorized" error. The solution is simple and found on serverfault - you just have to grant the IUSR user at least a Read&Execute access to your website's folder. Just like that:
Hope I saved you some googling.

Sunday, March 2, 2014

ASP.NET web forms captcha

The whole purpose of this post is to show how simple it is to introduce some custom handler in ASP.NET (that old one, which's still used though). Reading the preparation book to TS 70-515 exam, I found handlers' examples there very impractical, so I decided to get more or less real case, where custom handlers are of use - captcha. To free UI thread, handler will be asynchronous.

Saturday, March 1, 2014

Changing desktop icon fonts in xfce

You may have noticed, that desktop icon fonts that are by default in Linux Mint xfce/Xubuntu distros are awful. It’s just plain black, which means that putting any dark wallpaper will render your icon labels unreadable.
Seriously, guys! Desktop font should be light gray with a dark gray shadow, as it is in LM Mate, LM Gnome, Windows or any other OS. Usability designers have discovered this long ago, just copy this solution as many have done before you.
Fortunately, I googled up this xfce forum thread, where guy is adviced how to change the desktop fonts in xfce.
The only difference is that you have to edit the .gtkrc-xfce file, not .gtkrc-2.0, as the latter contains only include ".gtkrc-xfce" line.
So,you may copy-paste the code below to your ~/.gtkrc-xfce and relog with the current user so that changes are applied.
style "xfdesktop-icon-view" {
    XfdesktopIconView::label-alpha = 0
    XfdesktopIconView::shadow-x-offset = 1
    XfdesktopIconView::shadow-y-offset = 1
    XfdesktopIconView::shadow-color = "#101010"
    XfdesktopIconView::selected-shadow-x-offset = 1
    XfdesktopIconView::selected-shadow-y-offset = 1
    XfdesktopIconView::selected-shadow-color = "#101010"
 
    fg[NORMAL] = "#fefefe"
    fg[SELECTED] = "#fefefe"
    fg[ACTIVE] = "#fefefe"
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"
If you want to change font as well, for example to ‘Verdana’, just add font_name="Verdana" line somewhere within the braces.
P.S. I think this is quite a good example of why the Linux desktop lags behind the Windows and OSX.

Displaying quotation marks in CSV opened by Excel

I love CSV. Easy to serialize, easy to read, great choice for some basic reports. Good news is, it can be opened by MS Excel, so office folks can use it. Bad news is that Excel (at least 2007 one, which’s still widely used) parses CSV in a weird way.
So, how wrapping quotation marks are handled:

1. Single quotation marks around value have no effect –
"test"
is displayed as
test
.
2. Double quotation marks add some ‘cool’ quotation marks in the end of the string – so
""test""
becomes
test""
.
3. Tripple quotation marks actually give those bloody single quotation marks around value –
"""test"""
becomes
"test"

Note, that this applies only to quot. marks that ‘wrap’ the value, i.e. are at the start and the end of value. Quot. marks in the middle of value are displayed ‘as-is’, e.g.
test "that" string
is displayed as
test "that" string
(identical).
I’m not that sure I want to know of reasons why it’s made so.