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
# Test framework | |
from unittest import TestCase | |
from nose.tools import raises | |
# Objects under test | |
from foo import bar | |
class TestBar(TestCase): | |
def test_cool_bar_thing1(self): | |
self.assert(1==1) |
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
# Instructions for setting up OpenCV development in Clojure on Ubuntu | |
# Copied from http://docs.opencv.org/2.4/doc/tutorials/introduction/clojure_dev_intro/clojure_dev_intro.html | |
# Install opencv | |
sudo apt-get install libopencv-dev | |
# Get location of latest .jar and .so | |
dpkg -L libopencv2.4-java | grep jar | |
dpkg -L libopencv2.4-jni | grep .so |
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
all: test_Factory | |
test_Factory: test_Factory.cpp | |
$(CXX) -std=c++0x -o test_Factory test_Factory.cpp |
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
grammar CFunction; | |
function : retType name args ; | |
args : '(' arg (',' arg)* ')' ; | |
arg | |
: 'double' name # SCALAR_ARG | |
| 'double' '*' name # ARRAY_ARG |
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
grammar CFunction; | |
options { | |
output = AST; | |
ASTLabelType = CommonTree; | |
} | |
tokens { | |
SCALAR; | |
ARRAY; |
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 a grammar called Hello | |
grammar Hello; | |
r : 'hello' ID; | |
ID : [a-z]+ ; | |
WS : [ \t\r\n]+ -> skip ; |
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
# Change location to where External Code is installed | |
cd ~/Work/ExternCode/ | |
# Install conscript, a tool for installing and updating Scala software | |
# programs. | |
curl https://raw.github.com/n8han/conscript/master/setup.sh > conscript_setup.sh | |
less conscript_setup.sh | |
chmod 755 conscript_setup.sh | |
./conscript_setup.sh |
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
grammar Expr; | |
// Need to call recursive rule expr from non-recursive rule | |
r : expr+ ; | |
// ANTLR4 : Left recursion! | |
// Operator precedence matches order of definition | |
expr : '-' expr // Unary minus | |
| expr ('*' | '/' ) expr | |
| expr ('+' | '-' ) expr |
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
1. Modify ~/system/bin/dx to increase memory size: | |
#dx helper script | |
dalvikvm -Xms256m -Xmx512m -cp $APK com.spartacusrex.spartacuside.external.dx $@ | |
2. Download [Complete ANTLR 4.0 Java binaries jar](http://www.antlr.org/download/antlr-4.0-complete.jar) and copy to ~/bin. Change to this directory. | |
3. Convert jar to dex so that it can run on Android (takes about 20mins with power connected): | |
dx --dex --output=antlr-4.0.dex.jar antlr-4.0-complete.jar |
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
all: fx_solver | |
fx_solver: fx_solver.cpp | |
clang++ -std=c++0x -I/usr/include/coin -o fx_solver fx_solver.cpp -lClp | |
# Install CLP: | |
# sudo apt-get install coinor-libclp0 coinor-libclp-doc |