Skip to content

Instantly share code, notes, and snippets.

View oxinabox's full-sized avatar
🐂

Frames White oxinabox

🐂
View GitHub Profile
@oxinabox
oxinabox / OpenFST_example.ipynb
Created January 18, 2017 06:01
Julia OpenFST glue example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oxinabox
oxinabox / src.jl
Created November 30, 2016 04:52
WindowingIterator.jl, more robust-code for windows, than the ones I normally hack together
using DataStructures
using StaticArrays
import Base: start, next, done, iteratoreltype, iteratorsize, length, size, eltype
export ContextWindowed
immutable ContextWindowed{VIEWABLE, HALFWIDTH, T}
src::T
end
iteratoreltype{V, N, T}(::Type{ContextWindowed{V, N, T}}) = iteratoreltype(T)
@oxinabox
oxinabox / OptimisingDietsWithLinearProgramming.ipynb
Created November 15, 2016 09:14
Optimising Diets with Linear Programming (NB: this is not nutritional advice, this will probably kill you.)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oxinabox
oxinabox / SmoothingPlot.ipynb
Created October 13, 2016 03:14
Geometric Smoothing Effect on Postierior Distribution (Lyndon White 2016)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oxinabox
oxinabox / ClusterSoup.jl
Created October 2, 2016 01:25
Some clustering helpers I wrote when I was just starting to learn julia (I release this to the Public Domain. Do with it what you want.)
module ClusterSoup
export scatter_data, prescattered_mapreduce, put!, update_remote,replace_remote, fetch_reduce, rmap
using Pipe
using Zlib
import Base.put!
function put!(pids::Vector{Int}, val)
RemoteRef[put!(RemoteRef(id)::RemoteRef, val) for id in pids]
@oxinabox
oxinabox / normpath.ipynb
Last active September 14, 2016 10:41
A method to Normalize Paths, by removing ".." ie φ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oxinabox
oxinabox / PathAlgebra.md
Last active September 10, 2016 13:31
An Abstract Algebra definition for Path Schema, by Lyndon White (@oxinabox) and Fengyang Wang (@TotalVerb)

In general a path can be described as a a heirachical index. This covers all the operations in python3 path lib. It is defined independent of the object (filesystem, document etc) being indexed.

The precise implementation of the Algebric structure differs, depending on the Path types in question, eg Filesystem vs URL.

This defintion is generally applicable to paths, such as:

  • File paths
  • URLs
@oxinabox
oxinabox / julia_threadcall.jl
Created August 15, 2016 05:14
I thought this would let run a julia function in just one thread
using Base.Threads
function threadcall(f::Function, run_on_thread::Int, args...; kwargs...)
@assert run_on_thread!=1
rr = Future()
function inner()
function fun()
if Base.Threads.threadid()==1
yield()
@oxinabox
oxinabox / valgrinding_output
Created August 2, 2016 16:30
See line 139?
ubuntu@workhorse:~/GitterBots.jl$ valgrind julia src/stackoverflow2gitter.jl "https://webhooks.gitter.im/e/aaaaaaa111222"
==14404== Memcheck, a memory error detector
==14404== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==14404== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==14404== Command: julia src/stackoverflow2gitter.jl https://webhooks.gitter.im/e/cb47d908faf6cb77e634
==14404==
==14404== Warning: set address range perms: large range [0x395db000, 0x23a5ef000) (defined)
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/ubuntu/GitterBots.jl/src/stackoverflow2gitter.jl:11
WARNING: Base.String is deprecated, use AbstractString instead.
@oxinabox
oxinabox / Pkg.status.txt
Created August 1, 2016 04:30
Pkg.status()
55 required packages:
- AbstractTrees 0.0.3
- AmplNLWriter 0.2.1
- Blocks 0.1.0
- BlossomV 0.0.3
- Cbc 0.2.0
- Clp 0.2.0
- CoinOptServices 0.1.0
- Combinatorics 0.3.2
- Compat 0.8.6