Skip to content

Instantly share code, notes, and snippets.

View waTeim's full-sized avatar

Jeff Waller waTeim

View GitHub Profile
@waTeim
waTeim / A Paren Parser
Last active January 4, 2016 10:59
An example paren matching parser using pegjs
This GIST is a set of java script source and input files and the pegjs parser source.
@waTeim
waTeim / Just node by itself
Created October 30, 2014 21:15
gdb output following seg-fault while running node-julia on a simple input file node libuv = 1.0.x julia libuv = 0.11.x
Reading symbols from /usr/local/bin/node...done.
(gdb) info files
Symbols from "/usr/local/bin/node".
Local exec file:
`/usr/local/bin/node', file type elf64-x86-64.
Entry point: 0x5fd9e0
0x0000000000400200 - 0x000000000040021c is .interp
0x000000000040021c - 0x000000000040023c is .note.ABI-tag
0x0000000000400240 - 0x0000000000426db4 is .hash
0x0000000000426db8 - 0x00000000004aefb8 is .dynsym
const solMass = 4 * pi^2
const daysPYear = 365.24
immutable ThreeD
x::Float64
y::Float64
z::Float64
end
# all these functions modify a global array, a better idea is to pass them the array
@waTeim
waTeim / gist:4118fe8c6e96e14728bf
Last active August 29, 2015 14:10
Try/catch vs NaN
function t1(x::Float64)
if x == 100_000_000 throw(DomainError()); end
return x;
end
function t2(x::Float64)
if x == 100_000_000
return NaN;
else
return x;
@waTeim
waTeim / PGPP-stage2.cpp
Created March 2, 2015 21:15
Typedef traversal assert failure
#include <iostream>
#include "clang/Frontend/FrontendActions.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
using namespace std;
using namespace clang;
@waTeim
waTeim / DumpBinOutput.txt
Created May 18, 2015 04:49
Embedding Julia with gyp for node-julia attempt
Microsoft (R) COFF/PE Dumper Version 12.00.31101.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file C:\Julia\julia-f875a541be\bin\libjulia.dll
File Type: DLL
Section contains the following exports for libjulia.dll
@waTeim
waTeim / JuliaMakeInstall.txt
Created May 20, 2015 07:36
Output of Julia make install
bizarro% make install
CC usr/bin/stringreplace
. /Users/jeffw/src/julia/deps/julia-env/bin/activate && sphinx-build -b html -d _build/doctrees . _build/html
Making output directory...
Running Sphinx v1.2.3
loading pickled environment... not yet created
building [html]: targets for 74 source files that are out of date
updating environment: 74 added, 0 changed, 0 removed
reading sources... [100%] stdlib/test
/Users/jeffw/src/julia/doc/stdlib/collections.rst:121: WARNING: duplicate object description of Base.length, other instance in /Users/jeffw/src/julia/doc/stdlib/arrays.rst, use :noindex: for one of them
@waTeim
waTeim / julia gdb session example
Last active October 14, 2019 17:49
A julia GDB session example
jeffw@dub1:~$ ps auxww | grep julia
jeffw 5646 1.5 11.3 8587092 85668 pts/0 S+ 19:53 0:03 julia-debug
jeffw 5886 0.0 0.1 9392 896 pts/1 S+ 19:57 0:00 grep --color=auto julia
jeffw@dub1:~$ gdb -p 5646
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
@waTeim
waTeim / test
Created June 29, 2015 03:16
Oracle Java execution in Julia
jeffw@ub0:~/src/JavaCall.jl/src$ julia test.jl
Loaded /usr/lib/jvm/java-7-oracle/jre/lib/amd64/server/libjvm.so
[Dynamic-linking native method java.lang.Object.registerNatives ... JNI]
[Registering JNI native method java.lang.Object.hashCode]
[Registering JNI native method java.lang.Object.wait]
[Registering JNI native method java.lang.Object.notify]
[Registering JNI native method java.lang.Object.notifyAll]
[Registering JNI native method java.lang.Object.clone]
[Dynamic-linking native method java.lang.System.registerNatives ... JNI]
[Registering JNI native method java.lang.System.currentTimeMillis]
@waTeim
waTeim / JavaCall master
Last active August 29, 2015 14:23
Oracle JVM with signal handlers disabled
julia> jcall(jlm, "Sin", jdouble, (jdouble,), pi/2)
WARNING: gc_disable() is deprecated, use gc_enable(false) instead.
in depwarn at ./deprecated.jl:62
in gc_disable at deprecated.jl:49
in jcall at /home/jeffw/.julia/v0.4/JavaCall/src/JavaCall.jl:254
while loading no file, in expression starting on line 0
[Dynamic-linking native method java.lang.ClassLoader.findLoadedClass0 ... JNI]
[Dynamic-linking native method java.lang.ClassLoader.findBootstrapClass ... JNI]
#
# A fatal error has been detected by the Java Runtime Environment: