Thursday, August 20, 2009

Happy 40th Birthday Unix

Unix, Linux is more than an operating system for us Techies it's a kind of way of life. I get great intellectual pleasure from finding clever ways to write scripts using Bash, Zsh, Perl, AWK or whatever. These days I spend more time using Cygwin on Vista which kind of gives me the best of both worlds. I would like to abandon Microsoft completely but have to work with so many clients that just have Windows.

I've recently had some fairly horrific experiences of using Microsoft software Visual Studio, ASP etc and found myself having download 100's of MB of code just to set a few miserable flags. Everything Microsoft do seems to overloaded with bureaucratic heaviness, endless series of black boxes, wizards where I feel I control very little.

Anyway thank heavens for LAMP Linux-Apache-MySQL-PHP/Perl and the wonderful community of users that surround it

Labels: , , , ,

Sunday, May 03, 2009

Solve Your Techie Problems at stackoverflow.com

I was told that http://stackoverflow.com was now preferred to Experts Exchange probably because it's totally free. I certainly got an answer to my MySQL problem in less than 15 minutes.

eg

Hi I have a table with one record per person and per item of clothing

so

peter, jumper,blue
peter,trousers,green
sue,dress,green
peter,jumper,red
gordon,jumper,green


I want to write a query to select all people with green jumpers but only if they have no other color jumper

So in the above case it would ONLY select Gordon not greedy old Peter

The solution provided by lc was a sub select or multiple select query

SELECT *
FROM myTable AS t1
WHERE t1.clothing = 'jumper' AND t1.color = 'green'
AND NOT EXISTS(SELECT *
FROM myTable AS t2
WHERE t2.person = t1.person AND t2.clothing = 'jumper'
AND t2.color <> 'green')

Labels: , ,