Maybe someone will find this post and explain to me why SQL Server behaves like this. My question isn’t “how should I rewrite this query”, but “why does SQL Server act like this”. The behavior I see is that for some reason it’s easier to do TOP bignumber than TOP smallnumber. In my instance, TOP [...]
Posts tagged programming
My tools for development under Ubuntu
My work machine recently developed the click of death, so I had to get a new hard drive and reinstall everything. Just in case this happens again, and in case anyone else is interested, below is the list of things I install in addition to the standard Ubuntu installation:
Ruby Braces vs. Do/End blocks
When parentheses are important: So, braces have higher precedence over do/end blocks. According to Pickaxe, when calling a method with no parentheses, the braces will be applied to the last method parameter, do will be applied to the invocation. A Very Contrived Example: def string_to_integer if block_given? yield.to_i else 0 end end a = [1,2,3] [...]
Observation: Code cleverness == Bad
This is inspired by Ruby, but could apply to Perl as well. Situation: class with dynamic, on the fly class method definitions of the form What this does is defines some class methods role1_email_addresses, role2_email_addresses, etc on the fly. Works perfectly, until the first element returned in users is actually an empty email. This is [...]
How to add event listeners under the GMap2 API
Some Javascript stuff here concerning Google Maps and coding for them. This took me a little bit to figure out, cause I was a little slow, last night. Also, the Google Map API documentation doesn’t seem to cover this sort of eventuality. Say that, for whatever reason, you have an array of GMarker objects and [...]
Excellent Rails plugin for auto-ERD generation
Need to generate a nice ERD or inheritance diagram for your Rails app? This plugin comes to the rescue! This is one of those things that seems like totally a no-brainer, given Rails’ knowledge of the schema. read more | digg story
How to tell when your programming logic needs tweaking
I meant to post this when I found it awhile ago: If you’ve writen code that needs to sometimes generate the following SQL query “SELECT * FROM tbl WHERE (1 = 2) … ” you should probably think about refactoring.