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
signature LAZY = | |
sig | |
type 'a lazy | |
val lazy : (unit -> 'a) -> 'a lazy | |
val immediate : 'a -> 'a lazy | |
val force : 'a lazy -> 'a | |
end | |
structure Lazy :> LAZY = | |
struct |
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
signature HELPER = | |
sig | |
val power : int * int -> int | |
val apply : ('a -> 'b) * 'a -> 'b | |
val id : 'a -> 'a | |
val curry : ('a * 'b -> 'c) -> ('a -> 'b -> 'c) | |
val uncurry : ('a -> 'b -> 'c) -> ('a * 'b -> 'c) | |
val flip : ('a * 'b -> 'c) -> ('b * 'a -> 'c) | |
val toBin : int -> string | |
val toOct : int -> string |
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 ruby | |
class SimpleStopWatch | |
def initialize() | |
@base = Time.now | |
@pausing = false | |
@pausing_secs = 0 | |
@min = 0 | |
@sec = 0 | |
@rem = 0 |
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 ruby -Ku -w | |
def resize(a, blank, s) | |
num = s - a.size | |
return a if num==0 | |
if num > 0 | |
num.times { a.push(blank) } | |
else |
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
#define NODES 5 | |
#define LINKS 25 | |
#define INVALID 255 | |
#define INFINITY 16 | |
#define _(from, to) ((from) * NODES + (to)) | |
mtype = {msg}; |
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
# | |
# Usage: glpsol -m sudoku.mod -o sudoku.sol | |
# | |
set Number := 1..9; | |
set GNumber := 0..2; | |
set Group{i in GNumber} := i*3+1..i*3+3; | |
var cell{Number, Number, 0..9} binary; | |
var answer_cell{Number, Number} integer; |
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
#include <stdio.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <linux/i2c-dev.h> | |
#define I2C_FILE "/dev/i2c-1" | |
#define BMP180_I2C_ADDR 0x77 |
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 -S jruby -I . | |
require 'echowand.jar' | |
java_import 'echowand.service.Core' | |
java_import 'echowand.service.Service' | |
java_import 'echowand.net.InetNodeInfo' | |
java_import 'echowand.common.EOJ' | |
java_import 'echowand.common.EPC' |
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 main | |
import ( | |
"fmt" | |
"time" | |
"math/rand" | |
) | |
var msg = &struct{}{} |
OlderNewer