Skip to content

Instantly share code, notes, and snippets.

View jamii's full-sized avatar

Jamie Brandon jamii

View GitHub Profile

BOT browser

Brief explanation: The BOT system used in LT keeps all application state in a globally accessible index. A browser tools could use this to show lists of object types, objects, behaviours and tags updating in real time and filterable by type and key/value search. This would let new developers browse through state to get an overview of where things are stored and then drill down to watch the objects they are interested in and see how they change over time.

Expected results: A UI for browsing and searching behaviours, objects and tags that updates in real time

Knowledge prerequisites: Familiarity with clojurescript and experience with building interactive HTML apps

Mentor: Jamie Brandon

#
# Fatal error in ../../v8/src/mark-compact.cc, line 2751
# CHECK(heap_->TargetSpace(heap_object) == heap_->old_pointer_space()) failed
#
==== C stack trace ===============================
1: ??
2: ??
3: ??
function shrinkwrap(gen) {
return {
arbitrary: gen.arbitrary,
shrink: function(value) {
var shrinks = [];
for (var i = 0; i < maxShrinks; i++) {
try {
shrinks[i] = gen.randomShrink(value);
} catch (err) {
if (err.constructor !== Unshrinkable) throw err;
;; fast gens with no shrinking and no long strings. good enough for government work
(defn make-simple-key-elem [rnd size]
(let [value (gen/rand-range rnd (- size) size)]
(if (pprng/boolean rnd)
value
(str value))))
(defn make-simple-key [rnd size key-len]
(let [result #js []]
@jamii
jamii / gist:8fa2192efd0f2a70a9d0
Created January 7, 2015 05:19
fuzzy matching
function isAfterBoundary(string, i) {
// checks if previous char is not alphanumeric
if (i === 0) {
return false;
} else {
var cc = string.charCodeAt(i - 1);
return !((cc > 47 && cc < 58) || (cc > 64 && cc < 91) || (cc > 96 && cc < 123));
}
}
#!/usr/bin/env python3
import gi.repository
from gi.repository import Gio, GLib
import sys
import subprocess
session_bus = Gio.BusType.SESSION
cancellable = None
proxy_property = 0
interface_properties_array = None
for i in std::iter::range_step(2, -1, -1) {
println!("{}", i);
}
// prints 2, 1, 0
let x = ["a", "b", "c"];
for i in std::iter::range_step(2, -1, -1) {
println!("{}", x[i]);
}
// prints "c"
Compiling bigcheck v0.0.1 (file:///home/jamie/bigcheck)
src/lib.rs:68:45: 68:63 error: cannot infer an appropriate lifetime due to conflicting requirements
src/lib.rs:68 let result = std::thread::spawn(|| function(input)).join();
^~~~~~~~~~~~~~~~~~
src/lib.rs:68:48: 68:56 note: first, the lifetime cannot outlive the expression at 68:47...
src/lib.rs:68 let result = std::thread::spawn(|| function(input)).join();
^~~~~~~~
src/lib.rs:68:48: 68:56 note: ...so that auto-reference is valid at the time of borrow
src/lib.rs:68 let result = std::thread::spawn(|| function(input)).join();
^~~~~~~~
fn catch(function: fn(Vec<i64>) -> (), input: Vec<i64>) -> bool {
let passed_function = function.clone();
let passed_input = input.clone();
let handle = std::thread::spawn(move || passed_function(passed_input));
handle.join().is_err()
}
fn catch2<Input: Send + Clone>(function: fn(Input) -> (), input: Input) -> bool {
let passed_function = function.clone();
let passed_input = input.clone();
Compiling eve v0.0.1 (file:///home/jamie/eve/runtime)
src/solver.rs:90:43: 90:72 error: borrowed value does not live long enough
src/solver.rs:90 &Clause::Tuple(ref source) => source.constrained_to(result).drain().map(|tuple| Value::Tuple(tuple)).collect(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/solver.rs:90:43: 90:123 note: reference must be valid for the destruction scope surrounding method call at 90:42...
src/solver.rs:90 &Clause::Tuple(ref source) => source.constrained_to(result).drain().map(|tuple| Value::Tuple(tuple)).collect(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/solver.rs:90:43: 90:123 note: ...but borrowed value is only valid for the method call at 90:42
src/solver.rs:90 &Clause::Tuple(ref source) => source.constrained_to(result).drain().map(|tuple| Value::Tuple(tuple)).collect(),