This file contains hidden or 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
public class TernaryNpe { | |
public static void main(String args[]) { | |
final String a = "a"; | |
final String aa = "aa"; | |
final String b = null; | |
final String bb = ""; | |
/* Test Case 1 */ |
This file contains hidden or 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
static std::string copyString(JNIEnv* env, jstring js) { | |
const char *utf = env->GetStringUTFChars(js, NULL); | |
std::string name = std::string(utf); | |
env->ReleaseStringUTFChars(js, utf); | |
return name; | |
} |
This file contains hidden or 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 { |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 <[email protected]> | |
:) | |
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 hidden or 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 hidden or 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 hidden or 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. | |
* |