Pointless Mails

I just got e-mail from Microsoft with my free 30-day pass for Windows Azure. It came in mail titled “Take Advantage of a Free 30-Day Windows Azure Pass”. Last year I wanted to get into but Croatia wasn’t among supported countries. From good sources I got that this year this will change. I took this offer as good sign.

Of course, when I came to registration site, Croatia was suspiciously missing from list. Another disappointment.

I am not that much disappointed at Microsoft as such since it is their business decision whether they want Croatian money or not. I am disappointed by assholes who sent such mails to everybody everywhere. Microsoft has all my data (and that does include country). How hard was it to filter out people not in “proper” countries?

White-on-White Spinner

Illustration

As far as Android goes, I like it’s light theme much better that black one. It is matter of preference really since both are equally functional.

First time I used Spinner control I noticed interesting result - I got white text on white background. While other controls used theme that was defined application wide Spinner forced white background on it’s drop-down. Black theme defines white text on black background, Spinner forces white background - white text on white background is their bastard offspring.

Solving this took a little bit of time and single line. It was easiest to change background color for drop-down just after it is inflated:

@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {				
    if (convertView == null) {			
        View view = _inflater.inflate(android.R.layout.simple_list_item_single_choice, parent, false);
        view.setBackgroundColor(Color.BLACK);
        ((TextView)view).setSingleLine();
        ((TextView)view).setEllipsize(TruncateAt.END);
        convertView = view;
    }
    return super.getDropDownView(position, convertView, parent);
}

P.S. It might be as well that I broke something to get Spinner behave this weirdly - I haven’t investigated much further after I got the result.

ConnectionString Loses Password Field

Illustration

One application used ConnectionString that read “Server=.\SQLEXPRESS; Database=MyDatabase; MultipleActiveResultSets=true; User ID=MyUser; Password=MyPassword; Connect Timeout=10;”. Yes, I know all dangers of transporting user id and password in this manner, but trust me, there was no other choice for this particular scenario. It worked for quite some time and I was satisfied with it.

As upgrade went, I needed one additional connection. I saw no problem with it, I did it plenty of times:

public SqlConnection Clone(SqlConnection original) {
    var clone = new SqlConnection()
    clone.ConnectionString = original.ConnectionString
    return clone;
}

However, in this particular scenario, all I got was “Login failed for user…” message. After some checking, I noticed one peculiar thing. My connection string, as far as SqlClient was concerned, was “Server=.\SQLEXPRESS; Database=MyDatabase; MultipleActiveResultSets=true; User ID=MyUser; Connect Timeout=10;”. My Password field was completely missing!

ConnectionString gets cleaning treatment and password just gets omitted. Solution comes in form of one additional parameter. If we add “Persist Security Info=true;” to out ConnectionString SqlConnection will give us enough rope to hang ourself and Password field will be preserved.

A Piece of Shit

Illustration

First, some clarifications: I am HP man, I always was. My current laptop is HP, my wife’s laptop is HP, my previous laptop was HP, my printer is HP…

When it came time to replace my trusty HP nx9030 I tried to find best laptop in reasonable price range. I thought that I found it in HP 6730b. It had decent processor, lot of memory (4 GB), nice screen… Only thing I found wrong with it was keyboard design where they jammed Home, PgUp, PgDown, etc. keys in vertical line at right side. It wasn’t as nice as almost-standard placement on 9030 but I could live with it.

I should have seen trouble when I managed to scratch it’s scratch-proof surface. Next thing to go was power adapter. After that my screen went crazy. Then another power adapter went down. Then it started to go crazy. It would reboot without warning (and no, it wasn’t Windows’ fault). My guess is that it overheats. Although that doesn’t explain why capacitive keys at top (volume, wireless, etc.) sometime turnoff until next reboot. Booting from USB is broken for last few BIOS revisions - to do USB install I need to downgrade… And trust me, these are things that I hate the most - I will not event get into a lot of small issues. Only thing that works correctly is keyboard - no, wait, I had to replace that also…

I owned this laptop for little bit over two years now and I still cannot trust it. It just keeps failing me. It might be me, it might be my particular laptop, it might be whole series. I just know that I am utterly disappointed.

Bright side?

There is single bright point in whole situation - HP support. Guys were more than helpful with all these problems and did their fair share of fixing. They are only reason I would even consider HP again.

[2011-02-20: Guess what? Laptop is dead again. I would guess that whole charging circuit on laptop went kaboom. Good news is that power adapter seems to be ok…]

[2011-03-22: As soon as I said that HP support is only bright side, I should have known that this will turn bad. I got laptop from last service and from plastic seemed little bit “wobbly”. When I opened case I saw that four screws keeping plastic were missing altogether. Laptop is working without them but my trust in HP support is shaken.]

[2011-03-31: Yes, I am selling this laptop. Interested?]

Top 5 Tips for Graduate Engineers

I am doing most of my work as a computer programmer but I play with electronics as a hobby of mine and thus I watch EEVBlog quite regularly.

In his latest video he gives tips about working in electronics industry and they match my experiences in computer industry perfectly. Definitely video to check, even if you are not a graduate student.