9.11.05

Is there a wrong answer? [weird bugs #2]

Today I was talking with a couple of friends about importance of proper software error notifications and messages about incorrect data input. The topics were: programs with no messages (either it works or it does not), programs with messages which have no meaning to the user, programs with a-lot-of messages.

Although no one likes when the program crashes without any explanation, I don't believe that many people would appreciate the program displaying them all the "ugly" details behind the crash (not to mention security issues behind this software misdesign).

Then there are the messages that give user a chance to decide what to do about the error: notify manufacturer with details or just ignore... What about informational messages: something is about to happen and you are given a chance to decide in what direction should the program go ("The file you are trying to open does not exist. Should I create a new one?").

Now when you have some thoughts of your own, consider a program with an informational message that gives a simple choice of Yes and No.
Ok?
Now imagine that program offers a choice of "Yes" and "No, but do it anyway".... Having trouble? Try Adobe Photoshop CS!

Yup, one of most popular image editing programs has the stupidest bugs of all time. If your Windows have paging file disabled Photoshop will complain during startup, but will give you a chance to continue loading, or not to continue loading, but still load... :)

Make a choice! I'll bet I can guess which one it'll be! :)

11.8.05

Borderless Windows Form and Maximize

Bug or feature?

When you maximize a borderless form it will cover the whole screen as expected, but it will also cover the Task bar. Although I haven't found any documentation that states that's by design many claim so...

If you don't like this behaviour you can manually "hard code" maximum form size when it's maximized through MaximizedBounds form property.

Add this code to your form and you're all set... Enjoy!


public new FormWindowState WindowState
{
    
get
    
{
        
return base.WindowState;
    
}
    
set
    
{
        
if (value == FormWindowState.Maximized)

        {
            
this.MaximizedBounds =
               SystemInformation.WorkingArea;
        
}
        
base.WindowState = value;                
    
}
}

6.7.05

Choose a winning horse

About 15 months ago I got myself a brand new HP nc8000 laptop. Although many said it’s bulky, fat or even ugly I liked it. A couple of months later battery died. It wouldn’t charge and it wouldn’t run without AC connected. A week later I got my laptop back from repairs with a new battery.
Everything was fine for next 11 months when speakers all of a sudden stopped working. No sound, not even a beep! Next month Bluetooth card said bye, bye! How? I’d like to know too. After LCD screen started flickering 7 weeks ago I decided it’s finally time for next visit to repair center.

For 6 weeks no word from repair services: „next week…“ I was told every time I called. After a long time I finally receive a call: “We got all the components and we assembled your unit, but…”, “What BUT?!? I don’t want to hear BUT!!”.
Seems like someone connected something wrong and laptop squeaked a simple and short “bzzz…!". If I wasn’t at least angry by then, I was furious now for sure!

I was immediately transferred to repair services head and was promised a new laptop. When? In a week, she said. Well, we’ll see about that week…

Yesterday, I was surprised more than ever. Not only did they call me back in under a week, but I was offered a brand new nc8230 laptop! “We are very sorry for all the inconveniences. And would you accept this offer?”. “First, you should be VERY sorry, and yes, I will accept this new laptop.” :))

I was replaced this for this! Bigger screen, faster CPU, new DDR2, bigger HDD...
Thumbs up HP! You just got yourself a long term customer.

9.4.05

Html2Img Renderer

Have you ever had a need to create a screenshot/thumbnail of some web site? How many times have you used PrintScreen key and pasted image in Paint for saving?

How about grabbing thumbnails for dozens or even hundreds of pages? Seems like a tedious tasks.

There are some libraries that could help you automate that task, but they are not very cheap (around $150). Anyway, I created my own library to automate "screenshoting" web pages.

Dowload both binaries and source from here: Html2Img library

6.4.05

.NET Assembly

From time to time I'm asked to explain what's a .NET assembly and how it differs from "standard" dll or exe file. Check out this blog for explanation + more...

30.3.05

[joke] Turner Brown... :)))

A skinny little white guy goes into an elevator, looks up and sees this HUGE African American guy standing next to him. The big guys sees the little guy staring at him, looks down and says:
"7 feet tall, 350 pounds, 14 inch penis, 1 pound left testicle, 1 pound right testicle,...Turner Brown."

The small man faints dead away and falls to the floor. The big guy kneels down and brings him to, shaking him. The big fellow says, "What's wrong with you?" In a weak voice the little guys says, "What EXACTLY did you say to me?"

The big dude says, "I saw the curious look and figured I'd just give you the answers to the questions everyone always asks me. I'm 7 feet tall, I weight 350 pounds, I have a 14 inch penis, my left testicle weighs 1 pounds, my right testicle weighs 1 pounds and my name is Turner Brown."

The small guy says, "Turner Brown?
Thank God! I thought you said "Turn around."

18.3.05

SoapSerializerTransformer on gotdotnet, downloads

WOW! 200+ downloads in just 7 days... I'm really impressed!

Either people really missed this in Enterprise Library or Download's title is extremely catchy :)

Comment your thoughts here: have you found any bugs, do you miss some features...

12.3.05

SoapSerializerTransformer on gotdotnet

Now you can download my custom serializer transformer I blogged about in previous post on gotdotnet.

Enjoy!

9.3.05

Microsoft Enterprise Library - custom Serializer Transformer provider

A couple of weeks ago I started playing with MS Enterprise Library 1.0. Basically MS EntLib is a
package with various logically connected Application Blocks put together. If you've used AppBlocks before EntLib won't be a problem to understand, moreover the concept is the same but "better".
Great feature is Enterprise Library Configuration utility which enables you to make all necessary adjustments to your .config file through UI. :)
I only regret that assemblies that contain your custom providers must reside in a GAC or folder where EntLibConfig utility is installed in. Or you could add <codebase> node in Enterprise Library or machine config files. Wouldn't it be cool if you could tell EntLibConfig utility: "Look, the thing I wrote is correct, so ignore reflection errors you're receiving" or instruct it to look for assemblies in a specific folders.
Well, whatever...

I jumped on a Enterprise Library bandwagon starting with Configuration Application Block regarding project I'm currently involved with (check my previous post) and although I still have to crawl through all of the blocks in Library, I already ran into problem with XML Serializer Transformer provider.

What was the problem? Basically put, I wrote custom objects to hold configuration data and decided to use builtin XML Serializer Transformer provider to write configuration data to XML file. (XML Serializer Transformer uses .NET's XML serialization.)
My configuration objects hold many name-value pairs of information, but still require several custom properties, so I inherited them from DictionaryBase. Problem No.1 XmlSerializer (which is used by XML Serializer Transformer) doesn't support serializing object which implements IDictionary interface.
Ok, I'll find some other way to create dictionary-like class. How about NOT inheriting object from DictionaryBase but adding a NameValueCollection or Hashtable as a private member and wrap calls to them in custom methods. Wrong! Same result as Problem No.1: these types implement IDictionary. :(
Googling for an hour or so, and a possible result is here: inherit from NameObjectCollectionBase. Problem No.2 Ok, now it serializes name-value pairs, but it doesn't serialize public properties. (Apparently that's BY DESIGN?!?) DAMN! Now I'm really pissed!
Back to Google...

Thank you http://groups.google.com and someone who posted this solution: SOAP serialization will serialize almost anything to XML without a problem (how would .NET Remoting work without it? :) ). I honestly don't know why I didn't remember this myself...

So I wrote custom serializer transformer provider for Enterprise Library Configuration Block :"SoapSerializerTransformer". The process is quite simple...
1. Create a class, inherit it from TransformerProvider
2. Implement three methods: void Initialize(ConfigurationView configurationView), object Serialize(object value) and object Deserialize(object section) - you can copy method bodies from
XmlSerializerTransformer and then make changes, pretty straightforward.
3. Make adjustments in your .config file (you can use Enterprise Library Configuration utility - but don't forget to copy the assembly where your provider is implemented in folder where EntLibConfig utility resides or EntLibConfig will report reflection errors during Validation process)
And that's it!

To help you get started feel free to download and freely use my implementation (C#).

Pozdrav!

Apology

It's been a very long time since my last post. I was thinking about writing some really good excuse (presumably believable), but I decided to tell THE TRUTH: I was lazy! Yup... I was so lazy about typing new blogs that I completely forgot about it... :(

Am I sorry? Yes and no.

Yes: so many things happened since my last post that I wanted to write about here, but now are more-or-less lost. Also, not to forget, I promised some articles about WS-*...

No: I did and learned so many new things in the meantime, that I don't know where to (re)start bloging.

I co-founded software consulting - training organization: idroot.net. Web is still under construction and will remain in that status for some time... Until it's finally published check out my personal web: http://dfruk.idroot.net.

Currently, I'm involved in a "financial market" software project as a dev consultant. Most interesting fact is that server-part of this project is a high-perf .NET application, so when this project finishes sometime around mid-June maybe I'll have a tips'n'tricks article about writing high-perf .NET applications.