Archive for the ‘Short’ Category

MySQL Having Clause

Tuesday, September 25th, 2007

Last Friday, I had to run some complicated SQL queries at work. I was dealing with 300k rows of history items that I had to select based on an aggregate function. Unfortunately, WHERE clauses cannot contain the result of an aggregate function. Having clauses are like where clauses, but they’re applied last, and without optimization–and they can contain the result of an aggregate function. Here’s an example:

mysql> SELECT `col1`, COUNT(distinct `col2`) as as distcol2 , COUNT(distinct HOUR(`date`)) as hours FROM `sometable` WHERE foo GROUP BY `col1` HAVING `hours` = 2 and `distcol2` = 2 order by rand() DESC limit 100;

Philmont Pictures

Thursday, April 27th, 2006

I started uploading some Philmont pictures.

They’re all uber-high resolution and I don’t have nearly enough free space with this hosting (unless I resize them all [doing so would bring me physical pain. {and I still won’t have room for all of them}])

Touche

Wednesday, November 30th, 2005

En Garde!… And you thought that geeky T-Shirts could never get me anywhere. You just wait until I tell Google about my T-Shirt collection. Come to think of it, I really would like a Google T-shirt.

McGuyver Vs. James Bond

Thursday, November 24th, 2005

…In a battle to the death. Please comment.

]: export PATH=this:then:that

Wednesday, November 23rd, 2005

So… Gaim is working… I reverted to a previous version of Pango, and got the first error I posted about. I manged to work around the problem, rather than fix it… I simply reordered the directories in my path. hehehe…. :)

this post dedicated to Kayla…

Google and World Conquest…

Sunday, November 20th, 2005

I can’t help but reiterate that Google’s present course of action clearly leads directly to world domination. Just check out this recent post on slashdot… Hey: Better Google than Microsoft, right?

Back on Gnome

Saturday, November 12th, 2005

Or did I ever leave? That is the question. Whenever anyone asked, I simply replied “I use KDE. Gnome’s better; Gnome’s more stable. KDE’s sexier.” The looks are all KDE really has going for it. I’ll take gnome any day. I just compiled 2.12.1. Its nice. A few rough edges, but I think I’ve done a good job getting things working. Two posts in five minutes. Frightening.

In other news, I may have accidentally started what could have potentially become world war III. Lets just hope this negotiations don’t turn out like the ones in episode one…

Yellow Textboxes

Thursday, November 10th, 2005

Since Google Toolbar (beta) for Firefox came out, I’ve been having a problem with text boxes turning yellow at random. This has been quite a problem as not all font colors show up well in that ugly shade of yellow. The grey that is used in my comment form, for instance, cannot be read at all. I went through great lengths to figure out what could be causing those yellow boxes. As my blog is valid XHTML 1.1 and CSS, it clearly couldn’t be that, so what could it be? I was logging into my gmail account today, and something about Auto Fill (a feature of the Google toolbar) popped up. I started poking around a bit, and found an option that caused text boxes to turn yellow when autofill thought it could fill them in. That’s nice. I could have filled them in, but they were yellow, so I couldn’t even see what I was typing.

x is an element of: {3x}U{4x}\{6x}

Wednesday, November 9th, 2005

In case anyone was wondering, the 79th natural number that is divisible by 3 or 4 but not 6 is 236. Don’t ask me why, but it clearly isn’t an accident that (3)(79) = 237…

A Thought to Chew On

Tuesday, November 8th, 2005

Greg on his death bed: “Just one more digit of pi and I’ll set the world record…”. For those of you who know me, I’m sure you understood that…