This file contains hidden or 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
data Expr | |
= Const Integer -- values (integers) | |
| Add Expr Expr -- addition | |
| Mul Expr Expr -- multiplication | |
| If Expr Expr Expr Expr -- conditional branching (If a == b then c else d) | |
-- Not turing complete, but should be capable of evaluating most functions. | |
deriving (Show, Eq) | |
eval :: Expr -> Integer |
This file contains hidden or 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
g++ -std=c++11 Arith.cpp -S && cat Arith.S | |
g++ -std=c++11 Arith.cpp && ./a.out |
This file contains hidden or 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
""" | |
Discrete decision tree impl, pretty basic. (works for this example) | |
No libraries :) | |
Copyright (C) Seiji Emery 2018 | |
""" | |
# Setup our dataset | |
data = { | |
'Day': [ 'D%s'%i for i in range(1, 15) ], |
This file contains hidden or 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
chmod +x serializer.d | |
./serializer.d |
This file contains hidden or 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
from utils.jobs import * | |
@job("apply-subdivision") | |
class BpySubdivisionJob (BpyJob): | |
@describe('input', type='file', ext='.obj') | |
@describe('output', type='file', ext='.obj') | |
@describe('subdivisions', type=intrange(1,6)) | |
def run (self, input, output, subdivisions = 2): | |
src_obj = self.load_obj(path=input) | |
cube = self.create_cube() |
This file contains hidden or 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 python3 | |
# bpy-run-from-blender fix. | |
# Assumes that commandline arguments are | |
# sys.argv[0] = path-to-blender | |
# sys.argv[1] = '-b' | |
# sys.argv[2] = '-P' | |
# sys.argv[3] = path-to-this-script | |
import sys | |
import os |
This file contains hidden or 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
4cd.edu | |
aaaom.edu | |
aacc.edu | |
aacsb.edu | |
aakers.edu | |
aamu.edu | |
aau.edu | |
aauj.edu | |
aauni.edu | |
aaup.edu |
This file contains hidden or 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
public class YourTestClass { | |
public static void main (String[] args) { | |
expect("my tests", () -> { | |
expect("test arithmetic", () -> { | |
assertEquals(2 + 2, 4); | |
assertNotEquals(2 + 2, 5); | |
}); | |
expect("test exceptions", () -> { | |
assertNoThrow(() -> { if (2 + 2 != 4) { throw new IllegalStateException("blarg!"); }); | |
assertThrows(() -> { if (2 + 2 != 5) { throw new IllegalStateException("blarg!"); }); |
This file contains hidden or 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 python3 | |
nines = set(range(1, 10)) | |
nines = [ (i, nines - set([ i ])) for i in range(1, 10) ] | |
print(1, len(nines), [ i for i, _ in nines ]) | |
for k in range(2, 10): | |
nines = [ | |
(d * 10 + i, rest - set([ i ])) | |
for d, rest in nines |
This file contains hidden or 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
// | |
// A minimalistic unittesting framework that uses signal handling + | |
// longjmp to detect + test assertions + segfaults. | |
// | |
// Will add to this if / as needed | |
// | |
#ifndef __SEMERY_C_MINTEST_FRAMEWORK__ | |
#define __SEMERY_C_MINTEST_FRAMEWORK__ |