This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
During the great alphabet famine of two thousand aught six, column names were abbreviated to near-non-readability. In order to automate tests of [newsystem] reports against [oldsystem] reports, we're retaining those column names here. You're welcome. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def populationByState(){ | |
return zipcodes().aggregate( | |
[ $group : | |
[ _id : [ state : '$state', city : '$city' ], pop : [ $sum : '$pop' ] ] | |
], | |
[ $group : | |
[ _id : '$_id.state', avgCityPop : [ $avg : '$pop' ] ] | |
], | |
[ $sort: ['avgCityPop' : -1] ] | |
).results() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChatService { | |
static transactional = false | |
static atmosphere = [mapping: '/atmosphere/chat'] | |
..... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChatService { | |
static transactional = false | |
static atmosphere = [mapping: '/atmosphere/chatty'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent> | |
<cffunction name="getArtist" output="false" access="public" returntype="any" hint=""> | |
<cfargument name="id" type="numeric" required="true"/> | |
<cfquery datasource="cfartgallery" name="artist"> | |
select * | |
from artists | |
where artistid = <cfqueryparam value="#arguments.id#" cfsqltype="cf_sql_integer"/> | |
</cfquery> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From David Laing & Greg Malcolm's excellent javascript koans. I'm wondering: What are practical uses cases for this function synthesizing in javascript, where this approach would be preferable to all other possible approaches: | |
it("should use lexical scoping to synthesise functions", function () { | |
function makeIncreaseByFunction(increaseByAmount) | |
{ | |
var increaseByFunction = function increaseBy(numberToIncrease) | |
{ | |
return numberToIncrease + increaseByAmount; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component output="false"{ | |
function loop1(){ | |
x = 1; | |
for( x = 1; x LTE 100; x++ ){ | |
writeLog("x is #x#"); | |
loop2(); | |
} | |
return x; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gmu.mut; | |
import java.util.ArrayList; | |
import java.util.Calendar; | |
/** | |
* Class Account represents an immutable customer account. | |
*/ | |
public class Account { |
NewerOlder