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
reload("/Users/jacobquinn/julia/base/mmap2.jl") | |
function seg(n) | |
file = tempname() | |
s = open(file, "w") do f | |
write(f, "Hello World\n") | |
end | |
for i = 1:n | |
m = Mmap2.Array(file) | |
m[1] |
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
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") |
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
### Micro performance benchmarks | |
# Results Data | |
## String Type | Benchmark | DateTime Run | | |
## Julia Version | Strings.jl Version | | |
## Time Elapsed | Bytes Allocated | GC Time | |
# reload("Strings") | |
results = Dict("String Type"=>ASCIIString[], | |
"String Length"=>Int[], |
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
type Table{T} <: Source | |
schema::Schema | |
index::Vector{Int} | |
ints::Vector{NullableVector{Int}} | |
floats::Vector{NullableVector{Float64}} | |
ptrstrings::Vector{NullableVector{PointerString}} | |
strings::Vector{NullableVector{UTF8String}} | |
dates::Vector{NullableVector{Date}} | |
datetimes::Vector{NullableVector{DateTime}} | |
any::Vector{NullableVector{Any}} |
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
julia> function f(v::Vector{Int8}, n) | |
s = Int8(0) | |
@inbounds for i = 1:n | |
s += v[i] | |
end | |
return s | |
end | |
f (generic function with 2 methods) | |
julia> function f(v::Vector{Union{Void, Int8}}, n) |
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
""" | |
Base.selectorbytes(A::Array{T, N}) -> Array{UInt8, N} | |
For an Array with `isbits` Union elements, return the "selector bytes" that indicate the | |
index of the type for each array element, i.e. the type of `A[1]` is | |
`Base.uniontypes(eltype(A))[Base.selectorbytes(A)[1] + 1]`. | |
**NOTE**: The actual array selector bytes are returned, meaning if individual elements | |
are modified, the original array will reflect those changes. Setting selector bytes to | |
invalid or out-of-bounds type indexes may corrupt the original array. | |
""" |
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
const EXPONENTS = [ | |
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, | |
1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, | |
1e20, 1e21, 1e22, 1e23, 1e24, 1e25, 1e26, 1e27, 1e28, 1e29, | |
1e30, 1e31, 1e32, 1e33, 1e34, 1e35, 1e36, 1e37, 1e38, 1e39, | |
1e40, 1e41, 1e42, 1e43, 1e44, 1e45, 1e46, 1e47, 1e48, 1e49, | |
1e50, 1e51, 1e52, 1e53, 1e54, 1e55, 1e56, 1e57, 1e58, 1e59, | |
1e60, 1e61, 1e62, 1e63, 1e64, 1e65, 1e66, 1e67, 1e68, 1e69, | |
1e70, 1e71, 1e72, 1e73, 1e74, 1e75, 1e76, 1e77, 1e78, 1e79, | |
1e80, 1e81, 1e82, 1e83, 1e84, 1e85, 1e86, 1e87, 1e88, 1e89, |
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
const BYTES = fill(false, 128) | |
BYTES[Int(',')] = true | |
BYTES[Int('\n')] = true | |
BYTES[Int('\r')] = true | |
const COMMA = UInt8(',') | |
const NEWLINE = UInt8('\n') | |
const RETURN = UInt8('\r') |
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
call plug#begin('~/.config/nvim/plugged') | |
Plug 'morhetz/gruvbox' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'JuliaEditorSupport/julia-vim' | |
Plug 'cespare/vim-toml' | |
Plug 'tpope/vim-fugitive' | |
Plug 'ararslan/license-to-vim' | |
call plug#end() |
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 debian:stretch-slim | |
# Create the home directory for the new user. | |
RUN mkdir -p /home/default | |
# Create an default user so our program doesn't run as root. | |
RUN groupadd -r default &&\ | |
useradd -r -g default -d /home/default -s /sbin/nologin -c "Docker image user" default | |
# Set the home directory to our default user's home. | |
ENV HOME=/home/default |