Skip to content

Instantly share code, notes, and snippets.

View cogumbreiro's full-sized avatar

Tiago Cogumbreiro cogumbreiro

View GitHub Profile
public class Fin1 {
public static def main(s:Array[String](1)) {
val f = Clock.make();
val c = Clock.make();
async clocked(c, f) {
Clock.advanceAll(); // deadlocks here
}
f.advance();
}
}
public class Fin1 {
public static def main(s:Array[String](1)) {
//val f = Clock.make();
val c = Clock.make();
async clocked(c, /*f*/) {
Clock.advanceAll(); // deadlocks here
}
//f.advance();
}
}
public class Fin {
public static def main(s:Array[String](1)) {
finish {
val c = Clock.make();
async clocked(c) {
c.advance(); // deadlocks here
}
} // deadlocks here
}
}
@cogumbreiro
cogumbreiro / AbstractSettable.x10
Created June 6, 2013 22:28
This code breaks the compiler for X10 2.3.1
public abstract class AbstractSettable[T] implements Settable[T] {
public operator this()=(value:T) {
set(value);
}
}
@cogumbreiro
cogumbreiro / orderedsets.py
Created June 28, 2013 15:23
Generator of an ordered set from a sequence of elements.
def ordered_set(elems):
"""
Returns a generator for an order set created from the given elements.
"""
data = set()
for elem in elems:
before = len(data)
data.add(elem)
after = len(data)
if before != after:
@cogumbreiro
cogumbreiro / why3unknown
Created June 16, 2014 21:37
Lists the unknown files in a why3session.
#!/usr/bin/env python3
import xml.etree.ElementTree as etree
from os.path import join, isfile
from os import listdir, unlink
from fnmatch import fnmatch
IGNORED = [
'*.bak',
'#*#',
'why3session.xml',
@cogumbreiro
cogumbreiro / install-why3-lang.sh
Last active August 29, 2015 14:22
Installing Why3 syntax highlight for Gedit
# Assumes Why3 was installed locally with OPAM
cp ~/.opam/system/share/why3/lang/why3.lang ~/.local/share/gtksourceview-3.0/language-specs/
@cogumbreiro
cogumbreiro / serialization-formats-survey.md
Last active August 29, 2015 14:23
Survey on serialization formats
#!/usr/bin/env bash
FREQUENCY=20ms
"$@" &
jid=$!
trap cleanup INT
function cleanup() {