Skip to content

Instantly share code, notes, and snippets.

View ScottPJones's full-sized avatar

Scott P. Jones ScottPJones

  • Gandalf Software, Inc.
  • Beverly, MA USA
View GitHub Profile
Verifying that +scottpjones is my blockchain ID. https://onename.com/scottpjones
@ScottPJones
ScottPJones / benchcr.jl
Created June 8, 2016 13:23
Updated benchmark of Chris Raukaukas Ellipsis benchmark, from blog
function c1()
u = Array{Int}(4,4,3)
u[:,:,1] = [1 2 3 4
1 3 3 4
1 5 6 3
5 2 3 1]
u[:,:,2] = [1 2 3 4
1 3 3 4
1 5 6 3
Name Digits Age
Zachary 2 12
Natalie K 3 12
Berla O 7 9
Matt 7 12
Daniel 7 10
Jackson 5 11
Isabella 7 10
Thanos 7 9
Norah H 2 10
"""
@file ScienceFair.jl
@author Alex Matthew Jones-Martin
@copyright 2016 Gandalf Software, Inc.
@brief My science fair project
"""
module ScienceFair
end
@ScottPJones
ScottPJones / gist:8122d2da3c7ecfa0e3dc
Created March 29, 2016 13:12
Compose & Gadfly problems in v0.5
22:05 $ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0-dev+3301 (2016-03-28 22:55 UTC)
_/ |\__'_|_|_|\__'_| | Commit 9066e43 (0 days old master)
|__/ | x86_64-apple-darwin15.4.0
@ScottPJones
ScottPJones / myconv.jl
Created January 14, 2016 12:41
Conversion code using tables built with iconv.jl, for 8-bit character sets -> UTF-8 & UTF-16, compared with using iconv.jl and ICU.jl
using iconv
abstract ByteToUnicode
abstract UnicodeToByte
function get_table(enc)
inp = Vector{UInt8}(1)
badbytes = Set{UInt8}()
out = Vector{UInt32}(256)
cntinv = 0
@ScottPJones
ScottPJones / snacks.jl
Last active January 12, 2016 18:06
Simple example of using JuMP to figure out snack calendar for children in Montessori Children's House classroom
"""
@file snacks.jl
@author Scott Paul Jones
@copyright 2015
@license MIT
@brief Build snack calendar for children, using constraint engine
Changes
@ScottPJones
ScottPJones / benchmark.jl
Created November 1, 2015 14:48
benchmark different abs versions
function checked_abs{T<:Signed}(x::T)
x == typemin(T) && throw(OverflowError())
abs(x)
end
function scott_abs{T<:Signed}(x::T)
(v = abs(x)) < 0 && throw(OverflowError())
v
end
function testnoop(n)
local v::Int
@ScottPJones
ScottPJones / galliumbuild
Created September 13, 2015 22:38
Trying to build keno/gallium.jl with Xcode 7.1 beta
ld: warning: ld: warning: ld: warning: ignoring file /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libc++.tbd, missing required architecture x86_64h in file /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libc++.tbdignoring file /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libc++abi.tbd, missing required architecture x86_64h in file /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libc++abi.tbdignoring file /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libSystem.tbd, missing required architecture x86_64h in file /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64h:
@ScottPJones
ScottPJones / results-0818
Last active August 29, 2015 14:27
Code to test performance of new pure Julia reverse(str::UTF8String), along with test results from my MacBook Pro
julia> dotest(1000000)
Length of string: 0
ASCII reverse: 0.056237 seconds (2.00 M allocations: 91.553 MB, 11.00% gc time)
UTF-8 oldreverse: 0.037658 seconds (2.00 M allocations: 91.553 MB, 7.40% gc time)
UTF-8 newreverse: 0.003620 seconds
UTF-16 reverse: 0.046076 seconds (2.00 M allocations: 91.553 MB, 8.44% gc time)
UTF-32 reverse: 0.054243 seconds (2.00 M allocations: 91.553 MB, 6.92% gc time)
0.142451 seconds (6.00 M allocations: 274.666 MB, 7.32% gc time)
Length of string: 1