T-SQL Tuesday – HAVING Puzzle answer

Earlier today you may have seen a blog post of mine about a puzzle involving HAVING. You should read that post before this one. It was part of Adam Machanic’s T-SQL Tuesday meme. The question was about the query: SELECT ‘No Rows’ WHERE 1=2 HAVING 1=1; And here’s the explanation. Start by making yourself a "dual table", like what you’d use in Oracle, and use this instead of having no FROM clause. Put a row in it. CREATE TABLE dual (dummy bit); INSERT dual VALUES (1); –Now count the rows in it SELECT COUNT(*) FROM dual; –Now count how many … Continue reading T-SQL Tuesday – HAVING Puzzle answer

T-SQL Tuesday – T-SQL Puzzle with HAVING

Adam’s hosting another T-SQL Tuesday, for which this post is jumping in. He’s themed it around T-SQL Puzzles, which I found quite interesting, because the world is full of them. Most of the questions that I answer on forums, help sites, and so on, are puzzles. I guess there’s the difference between “Problem” and “Puzzle”, but I prefer to think of thing as puzzles. For Adam’s meme though, I thought I’d share a Puzzle that I ask students who take my Advanced T-SQL course. The idea is to have them start thinking about what each component of T-SQL is actually … Continue reading T-SQL Tuesday – T-SQL Puzzle with HAVING

DeepZoom fixoutlook – and a tip on hosting SilverLight

I haven’t done much SilverLight development – I’ve dabbled at best. And I don’t really count using DeepZoom Composer as proper SilverLight, but it makes a SilverLight application. So I’ve got one at http://www.lobsterpot.com.au/fixoutlook The background is that there’s a group of people who feel very strongly that Outlook should use proper standards for rendering emails. I understand that Microsoft have made a conscious decision to use Word for rendering emails, but I’m certainly part of the crowd who agree that Microsoft may have got this one wrong. They made a large image, and I thought this image would made … Continue reading DeepZoom fixoutlook – and a tip on hosting SilverLight

Things You Know Now

This blog meme is doing the rounds… I’ve been tagged at least twice now (Jason Strate and Greg Linwood), so I suppose subconsciously I’ve been thinking about this stuff for a few weeks already. Since I do a lot of training, I tend to explain these things to my students anyway. I have a lot of opportunity to stand up in front of people and tell them important stuff – so this kind of thing definitely comes up now and then. Things I wish I had known years ago (career-wise that I would teach new people in the SQL field) … Continue reading Things You Know Now

Meet the Robinsons in amazing 3D

Being a parent, I went to see the new Digital 3D movie Meet the Robinsons over the weekend. The film itself is a little predictable, and not much to really blog about, but the Digital 3D is really impressive. It uses Disney Digital 3D technology  (a rebranding of Real D) like Chicken Little and Monster House before it. Now I’m wishing I did though, because the 3D technology is really impressive! In the olden days (read ‘1980s’), 3D meant wearing red and blue glasses, so that the stuff on the screen that was coloured red could only be seen by … Continue reading Meet the Robinsons in amazing 3D

Cricket PowerGadget

I was thinking about PowerShell and how you can get it to do fantastic things. And I wondered how easily it could be used for scraping cricket scores. So I threw together four lines of code to grab the cricket scoreboard from cricinfo and rip out the title. $ret = (new-object Net.WebClient).DownloadString(“http://content-aus.cricinfo.com/ausveng/engine/current/match/249226.html?view=live;wrappertype=mainframe”)$titlestart = [Regex]::Matches($ret,”<title>”,”IgnoreCase”)[0].Index$titleend = [Regex]::Matches($ret,”</title>”,”IgnoreCase”)[0].Index$ret.Substring($titlestart+7,$titleend-$titlestart-7) Edited: This can be done easily in one line – Lars pointed out the use of Regex to grab the section between the title tags, which then means we don’t need to store $ret at all. It can now be: [Regex]::Match((new-object Net.WebClient).DownloadString(“http://content-aus.cricinfo.com/ausveng/engine/current/match/249226.html?view=live;wrappertype=mainframe”),”<title>(.*)</title>”,”IgnoreCase”).Groups[1].Value It’s not … Continue reading Cricket PowerGadget

Five things

Nick tagged me. Thanks Nick. Turns out you are still here. Hmm… Five things about me you might not know. 1/ I’m a Christian (and proud of it). I have been all my life, and don’t remember not ever being a Christian. I actually come from a long line of Christians, and ‘minister’ is one of the more common career choices in my ancestry. 2/ My grandfather is a personal hero of mine – he’s a past-president of the Royal Aeronautical Society, and was Engineer of the Year in 1984, I think partly because of a few helpful passing comments … Continue reading Five things

An A2-sized rugged Tablet PC in the shower

I have lots of ideas in the shower. Perhaps it’s because I’m just waking up from sleeping on stuff, perhaps it’s because the water cleans impurities out of the air, meaning that my brain gets fed a better quality of oxygen (I’ve seriously heard this theory before). But whatever the reason, I often find myself having ideas when I’m in the shower. The most annoying thing is when that idea is the repeat of a shower that I had a few days earlier. Then I’m kicking myself for not remembering it once the day was underway properly. And that’s where … Continue reading An A2-sized rugged Tablet PC in the shower

My twin’s birthday

Today is my twin brother's birthday. He's 32, poor guy. He'll probably call me later on today, which will give me the opportunity to wish him a happy birthday. But if he reads my blog, he'll see me wishing him happy birthday here. Happy Birthday, Andrew. You're getting old! Oh, I get it. 🙁 So, the thirty-second year is over. Felt like it took longer than half-a-minute, although in some ways it didn't. Time to reflect perhaps – I'm sick today, so maybe there's a good opportunity.