Monday, December 29, 2008

Testers are cool at prime numbers

A software tester, a software developer, and a project manager are told: 
“All odd numbers are prime”
The Developer says:
“Let's see, 3 is prime, 5 is prime, 7 is prime - looks like it‟s true”
The Project Manager says:
“Let's see, 3 is prime, 5 is prime, 7 is prime, 9 is prime, 11 is prime –looks like it‟s true.”
The Tester says:
That's silly, nine is a non-prime odd number - looks like it's bullshit”

I recently heard this very sad anecdote while attending a lecture about Software Testing. 

Everybody (except maybe a Test Manager) knows the developer would look up prime numbers on google before even trying to answer.

Anyway - here's a good resource about odd prime numbers humour.

Wednesday, December 24, 2008

[Poll] How many development feeds can you take?

To all of you information addicts out there - I was wondering how much information can people take.

At the moment I have 104 active subscriptions on my google reader, mostly development stuff, and I can barely keep up. I do not really read all the stuff that gets posted - I scan with my eyes and if my fast forward algorithm gets some keyword that I am interested in I go back and read the post.

If you add twitter to that there's enough for an overdose of information (but twitter is more about what people are doing and you don't really try to keep up if you don't wanna go mad).

How many feeds do-you/can-you follow (assuming you have a day-job)? Check-out the poll.

P.S. Happy Christmas to all the butchers out there from .NET Butchering 


kick it on

Friday, December 12, 2008

Recession will (hopefully) wipe SEO off the earth

I am no economics nostradamus or anything, but it's likely in my opinion that recession will bring people back to the real thing, and wipe SEO scums who lure between marketing an IT off the internet (and hopefully the earth).

I know there are loads (well, maybe not that much... ) of respectable professionals out there who offer SEO as part of their services - and they'll probably survive, but If I already believed that  "if you do SEO for a living, you will be out of business or irrelevant in 3 years" (quoting SEO is dead) recession seems now to be only accellerating things from this point of view.

I already stated my views on SEO in a previous post, but if you have a look at this link you'll notice that this guy's English is way better than mine and his approach to SEO deconstruction is way less simplistic; we're basically saying the same thing though: SEO is piss-easy. Even if I worked in marketing, I'd never invest solely on SEO because it's a soap bubble that's gonna explode in people faces sooner or later. 

Go ahead - tell me I am an idiot. 

Wednesday, December 10, 2008

[T-SQL] How to boost 'joined' Update Performance

Time for some real boring stuff.

The first thing people are tempted to write when they have to run an update on a table picking stuff from another table is probably something like this:

--method 1: nested select
--around 15 mins to execute on 100.000 records
UPDATE myTable
SET myTable_field = (SELECT myOtherTable_field
FROM myOtherTable
WHERE myOtherTable_someID = myTable_someID)

This way the nested select will run once for each record you're updating (100k times in my example) and you'll get shit performance.

Alternative to this are:

--method 2: update FROM more than one table
--around 45 secs to execute on 100.000 records
UPDATE myTable
SET myTable_field = b.cache_VmiID
FROM myTable a, myOtherTable b
WHERE b.myOtherTable_someID = a.myTable_someID

or, more intuitive:

--method 3: JOINED UPDATE
--42 secs to execute on 100.000 records
UPDATE myTable
SET a.myTable_field = b.myOtherTable_field
FROM myTable a join myOtherTable b
on b.myOtherTable_someID = a.myTable_someID

Execution times assume you're clearing SQLServer cache with fucking DROPCLEANBUFFERS (without clearing cache method 2 and 3 take about 4-5 secs).

kick it on

Thursday, December 4, 2008

[.NET] A Microsoft race

My Microsoft Visual Studio 2008 is screwed. Cannot start the application. After trying to fix it with the troubleshooting guide from Microsoft without any joy it looked as if the best solution was to use the canonical uninstall/reinstall pattern. A poll for you all: is it gonna take longer to uninstall Microsoft Visual Studio 2008 or to download the 3gigs ISO from Torrents? After 30minutes it looks very tight, who's gonna win?

[SQLServer2005] computer localhost does not exist on the network

This really bugged me out.

Talking about useful error messages from SQL Server, After installing SQL Server 2005 whatever edition on Vista and setting up a few DBs on management studio I tried to access SQL Server Surface Area Configuration and I got the following genial error message:
"computer localhost does not exist on the network (...)"
this is some epic bullshit, obviously followed by some other useless crap which I won't mention.

This obviously gave me no clue - so just out of curiosity I tried to open SQL Server Configuration Manager and I got another happy error message which makes even less sense:
"Cannot connect to WMI provider"
WTF is this supposed to mean? I have no clue what a WMI provider is. Anyway - the only resort I was left was good old Google. So I started googlin' like crazy and I found some crazy SOAB of an MVP on a msdn forum thread who was trying to convince some indian guy to reinstall Windows and SQLServer. 

I kept looking till I found something that did the trick: 

Apparently the problem is due to some SQLServer installation fuckup with some MOF files.

If you run this in your cmd line it should solve it:
C:\Program Files\Microsoft SQL Server\90\Shared>mofcomp "C:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof"

kick it on

Wednesday, December 3, 2008

[.NET] How to sort DataTable

There's no way to automatically sort a DataTable after it's populated.

A way around this is to sort the DefaultView of the DataTable (or any other DataView associated with the DataTable).

You can achieve this using the Sort property of the DataView. This is a string which specifies the column (or columns) to sort on, and the order (ASC or DESC).

myDataTable.DefaultView.Sort = "myColumnOfChoice DESC";

The DefaultView can now be used as datasource for stuff or to do whatever you need it for.