Skip to content

Instantly share code, notes, and snippets.

View arthurp's full-sized avatar
🙀
Working stiff.

Arthur Peters arthurp

🙀
Working stiff.
View GitHub Profile
@arthurp
arthurp / Semantic_version_as_infinite_ordinals.txt
Last active January 3, 2023 19:57
Semantics versions defined using infinite ordinals
You can define an ordering that would usually be lexical (order (x, y, z) by ordering x first,
then y within that, then z within that) or even nested lexical by instead adding together various
expressions which use ordinal numbers (represented as the naturals) and the constant Ω which is
the first uncountable ordinal meaning that Ω is greater than all countable ordinals (i.e., all
ordinals 0, 1, 2, .....). So Ωz (for all z) is strictly larger than any finite x, meaning that
the lexical ordering of (x, y) is the same as the ordering of the infinite ordinal Ω*x + y.
This expands to any number of elements in tuple and allows for nested tuples.
Versions x.y.z are represented as (x, y, z) and ordered as above. The definition of semantic
versioning is then: Symantic versions which differ only by a countable amount are bug
@arthurp
arthurp / experiments.ipynb
Last active February 14, 2019 01:42
MXNet Autograd Experiments
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arthurp
arthurp / failurerate.sh
Last active December 14, 2018 04:18
Orc Issue #223 status
function opts {
(cat <<EOF
porc:eta-spawn-reduce
porc:try-catch-elim
porc:try-finally-elim
porc:tail-spawn-elim
porc:inline-spawn
EOF
) | sort
}
@arthurp
arthurp / generate_scala_dict.sh
Last active May 10, 2018 18:37
cSpell Dictionary for Scala
MANGLING_TOKENS=$(paste -s -d'|' <<'HERE' | sed 's/|/\\|/g;s/\$/\\$/g'
$m[a-zA-Z]\+
MODULE$
$lzy
$module
_$eq
$_setter_$
$tilde
$eq
$less
@arthurp
arthurp / generate_java_dict.sh
Last active April 1, 2019 14:46
cSpell Dictionary for Java
MANGLING_TOKENS=$(paste -s -d'|' <<'HERE' | sed 's/|/\\|/g;s/\$/\\$/g'
$[0-9]\+
HERE
)
jar tf /usr/lib/jvm/java-8-oracle/jre/lib/rt.jar |
sed -n '\@^\(java/\|javax/\)@s/\.class//p' |
xargs javap |
sed '
# Drop header lines
package org.singingwizard.exception;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.RootCallTarget;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.profiles.BranchProfile;
public class ExceptionOnOnlyPath {
@arthurp
arthurp / ExceptionOnOnlyPath.java
Last active August 3, 2017 14:53
A small Truffle test program which demonstrates that Truffle will never include exception handlers in compiled code in some cases
package org.singingwizard.exception;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.RootCallTarget;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.RootNode;
public class ExceptionOnOnlyPath {
/** A simple exception which doesn't capture a stack.
#!/bin/sh
PREREQ="lvm2"
prereqs()
{
echo "$PREREQ"
}
case $1 in
diff --git a/OrcScala/src/orc/run/core/VirtualClock.scala b/OrcScala/src/orc/run/core/VirtualClock.scala
index 9bcbf52..998de4f 100644
--- a/OrcScala/src/orc/run/core/VirtualClock.scala
+++ b/OrcScala/src/orc/run/core/VirtualClock.scala
@@ -80,9 +80,16 @@ class VirtualClock(ordering: (AnyRef, AnyRef) => Int, runtime: OrcRuntime)
dequeueMins() match {
case Some((newTime, first :: rest)) => {
currentTime = Some(newTime)
+ println(s"Advancing to $newTime waking $first :: $rest")
first.publish(true.asInstanceOf[AnyRef])
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set(/v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/tasks/GetEnergy.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/Creep.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/Loop.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/Builder.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/api/PathFinder.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/Harvester.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/api/ScreepsContext.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/Main.scala, /v/filer4b/v20q001/amp/tmp/amps-screeps/src/main/scala/org/singingwizard/screeps/ai/Upgrader.scala, /v/filer4b/v20q001/amp/tmp/amps-s