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
#!/usr/bin/env python | |
""" | |
Matplotlib based photo ranking system using the Elo rating system. | |
Reference: http://en.wikipedia.org/wiki/Elo_rating_system | |
by Nick Hilton | |
modified by Patrick Beagan | |
This file is in the public domain. |
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
/** | |
* https://www.thecocktaildb.com/api.php | |
* Note, this is for educational purposes only, request an api key for other uses. | |
*/ | |
var https = require('https'); | |
var express = require('express') | |
function slurpJson(optionInfo) { | |
return new Promise(function(resolve, reject) { | |
var reqGet = https.request(optionInfo, |
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
#!python3 | |
from hashlib import sha256 | |
import sys | |
import os | |
import random | |
import difflib | |
prefix = "out/" | |
suffix = ".plasmid" |
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
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
// --- implementation of a union in kotlin | |
abstract class UnionBase<T>(s: Set<T?>) { | |
init { | |
val c = s.count { it != null } |
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
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
val test1 = "test1" | |
val test2 = "test2" | |
val test3 = "test3" | |
val test4 = null |
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
fun <A, B, R> ((A, B)->R).curry(a: A): (B)->R = { b: B -> this(a, b) } | |
fun <A, R> ((A)->R).curry(t: A): ()->R = { this(t) } | |
//---------------------------------------------------------------------- | |
fun f(i: Int, s: String) { | |
print(i) | |
println(s) | |
} | |
fun main() { |
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
fun main(args: Array<String>) = main2(args) | |
/** | |
* Simple Moving Average | |
*/ | |
fun sma(p: Int): (Double) -> Double { | |
if (p < 1) throw IllegalArgumentException("Period must be a positive integer") | |
val list = mutableListOf<Double>() | |
return { | |
list.add(it) |