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
object Blah extends App { | |
trait ArgProvider { | |
} | |
case class ColumnReference(value: String) extends ArgProvider | |
abstract class Rule(name: String, val argProviders: ArgProvider*) |
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
(:~ | |
: Neat examples of zero-padding a one digit month, for later | |
: construction of xs:date etc. | |
:) | |
(: Example 1: When given a single digit month :) | |
let $month := '4' | |
return | |
substring(concat('0', $month), string-length($month)) |
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 wlhn | |
import com.twitter.hashing.KeyHasher | |
object BloomApp extends App { | |
/** | |
* A bloom filter is used to test whether an element is a member of a set. | |
* |
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
object AllCombinations extends App { | |
/** | |
* Returns all permutations of all combinations | |
* of everything in the input data | |
* | |
* For example, given the `data` List('a', 'b', 'c') | |
* will return the result: | |
* | |
* List( |
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
xquery version "3.0"; | |
module namespace ranges = "http://github.com/adamretter/ranges"; | |
(:~ | |
: Produces sequences of ranges ($from, $to) | |
: which span a $range-size | |
: all the way from $range-from upto $range-to | |
: | |
: This can be very useful when working |
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
(:~ | |
: Generates a string of random hex digits | |
: @author Adam Retter <adam@exist-db.org> | |
:) | |
let $len := 20 (: how long a string to generate :) | |
return | |
codepoints-to-string(((1 to $len) ! util:random(16)) ! (.[. lt 10]+48, .[. ge 10]+87)) |
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
version 1.0 | |
@totalColumns 4 | |
room: is("Galeria") or is("1") or is("2") | |
start: regex("(([0-1][0-9])|(2[0-3])):[0-5][0-9]") | |
name: notEmpty | |
title: notEmpty | |
/* | |
CSV Schema for http://csvconf.com/presentations.csv | |
*/ |
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
version 1.0 | |
@totalColumns 4 | |
Time: regex("(([0-1][0-9])|(2[0-3])):[0-5][0-9] - (([0-1][0-9])|(2[0-3])):[0-5][0-9]") | |
Galeria: notEmpty | |
"Room 1": | |
"Room 2": | |
/* | |
CSV Schema for http://csvconf.com/schedule.csv | |
*/ |
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
version 1.0 | |
@totalColumns 4 | |
Time: regex("(([0-1][0-9])|(2[0-3])):[0-5][0-9] - (([0-1][0-9])|(2[0-3])):[0-5][0-9]") | |
Galeria: notEmpty | |
"Room 1": | |
"Room 2": | |
/* | |
CSV Schema for http://csvconf.com/schedule.csv | |
*/ |
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 wlhn | |
/** | |
* West London Hack Night 2014-08-13 | |
* Finding the minimum distance | |
* between any two words in a Shakespeare | |
* play | |
*/ | |
object Dijkstra { |
OlderNewer