Skip to content

Instantly share code, notes, and snippets.

Avatar

John Myles White johnmyleswhite

View GitHub Profile
@quinnj
quinnj / juliacon2015.jl
Last active Aug 29, 2015
Managing Data in Julia: Old Tricks, New Tricks Code
View juliacon2015.jl
Pkg.clone("https://github.com/quinnj/Mmap.jl")
Pkg.clone("https://github.com/quinnj/CSV.jl")
Pkg.add("ODBC")
Pkg.checkout("SQLite","jq/remodel")
Pkg.add("SQLite")
Pkg.checkout("SQLite","jq/updates")
reload("Mmap")
reload("CSV")
@0xabad1dea
0xabad1dea / singularthey.md
Last active Oct 12, 2021
Singular They in Technical English
View singularthey.md

Guidelines for Singular They in Technical English

by 0xabad1dea, December 2014

This document is an RFC of sorts for increasing the adoption rate of Singular They in technical English. This is not an ultimatum; this is not shaming anyone who has done otherwise; and this is definitely not applicable to any other language.

What is Singular They?

View DataFrameX.jl
type DataFrame{N,D}
data::D
end
immutable Field{s}
end
Field(s::Symbol) = Field{s}()
function DataFrame(;kwds...)
@cscheid
cscheid / main.jl
Created Sep 10, 2014
bare-bones stress majorization in julia
View main.jl
# You should totally ignore this because it's the first piece of Julia I've ever written.
# 2-clause BSD, blah.
function make_cycle(n)
result = Dict{Int32, Array{Int32}}()
for i = 1:n
ii = i - 1
push!(result, i, [1 + ((i+n-2) % n), 1 + i % n])
end
result
@avibryant
avibryant / gist:11376572
Last active Mar 13, 2016
Google <=> Open Source Rosetta Stone
View gist:11376572
GFS = HDFS
MapReduce = Hadoop
BigTable = HBase
Protocol Buffers = Thrift or Avro (serialization)
Stubby = Thrift or Avro (RPC)
ColumnIO = Parquet
Dremel = Impala
Chubby = Zookeeper
Omega = Mesos
Borg = Aurora
@guanix
guanix / bogosort.jl
Last active Jan 1, 2016
Bogosort and Bogobogosort in Julia
View bogosort.jl
function bogosort(v::Array)
if length(v) == 1
return v
end
c = deepcopy(v)
while !issorted(c)
shuffle!(c)
end
@slycoder
slycoder / gist:8150548
Created Dec 27, 2013
Closure speeds: Result: 0.5260329246520996 0.656851053237915 0.5118138790130615
View gist:8150548
begin
local y::Vector{Int64} = zeros(Int64, 1000000)
global demo2
function demo2()
x = y
for ii in 1:1000000
@inbounds x[ii] += 3
end
return x
end
@romainfrancois
romainfrancois / gist:6981372
Last active Dec 25, 2015
Reading the internal function table
View gist:6981372
#include <Rcpp.h>
using namespace Rcpp;
typedef SEXP (*CCODE)(SEXP, SEXP, SEXP, SEXP);
/* Information for Deparsing Expressions */
typedef enum {
PP_INVALID = 0,
PP_ASSIGN = 1,
PP_ASSIGN2 = 2,
@phaedryx
phaedryx / summary
Last active Oct 12, 2021
Loyalty and Layoffs by David Brady
View summary
Original text here: https://whydavewhy.com/2013/08/16/loyalty-and-layoffs/
@carlobaldassi
carlobaldassi / nzipperf.jl
Last active Dec 18, 2015
Alternative Zip iterator, with better performance than the one in base, but whose performance degrades if calls to start,next,done are inlined.
View nzipperf.jl
module NZipTest
import Base.start, Base.next, Base.done, Base.length
using Benchmark
immutable NZip0
end
immutable NZip1{I1}
i1::I1