Skip to content

Instantly share code, notes, and snippets.

View tshort's full-sized avatar

Tom Short tshort

  • Electric Power Research Institute
View GitHub Profile
@tshort
tshort / simondf.md
Last active August 29, 2015 14:11
Timing Simon's DataFrame

Simon's DataFrame mock-up using staged functions

module SimonDataFrame

type DataFrame{N,D}
    data::D
end
@tshort
tshort / t.md
Last active September 17, 2015 20:44

hello world

# /: comment
aK
 \ hello world
.asdf#wer 456
@tshort
tshort / README.md
Last active October 29, 2015 01:53 — forked from espinielli/README.md
Problems with a groupby transform involving sum

Problems with a groupby transform involving sum

In this spec, the groupby transform works just fine using any of median, count, or average. When I use sum, the graph doesn't show.

@tshort
tshort / README.md
Last active October 29, 2015 02:01
Vega working groupby version

Problems with a groupby transform involving sum

In this spec, the groupby transform works just fine using any of median, count, or average. When I use sum, the graph doesn't show. This version should display right.

@tshort
tshort / nodal-jump.jl
Last active January 17, 2016 12:24
Example of nodal problem formulations with JuMP
using JuMP
function localVar(m, name = "", expose = false)
x = JuMP.Variable(m, -Inf, Inf, :Cont, name, NaN)
if expose
JuMP.registervar(m, name, x)
end
x
end
@tshort
tshort / complex-numbers-in-JuMP.jl
Created January 20, 2016 14:43
Example of complex numbers with JuMP
using JuMP
function Base.real{T <: JuMP.JuMPTypes}(x::Matrix{T})
@assert size(x,1) == 2
vec(x[1,:])
end
function Base.imag{T <: JuMP.JuMPTypes}(x::Matrix{T})
@assert size(x,1) == 2
vec(x[2,:])
end
@tshort
tshort / config.js
Created July 16, 2017 18:13
MagicMirror setup
var config = {
port: 8080,
ipWhitelist: [], // Set [] to allow all IP addresses.
language: "en",
timeFormat: 12,
units: "imperial",
modules: [
{
module: 'MMM-ProfileSwitcher',
@tshort
tshort / example.jl
Created July 27, 2017 13:22
Storage / CktElement issue in OpenDSSDirect
julia> using OpenDSSDirect
julia> using OpenDSSDirect.DSS
shell> cd C:\\PortableApps\\OpenDSS\\electricdss-git\\Distrib\\IEEETestCases\\13Bus
C:\PortableApps\OpenDSS\electricdss-git\Distrib\IEEETestCases\13Bus
julia> dss("redirect IEEE13Nodeckt.dss")
""
@tshort
tshort / description.md
Last active January 16, 2018 21:28
Example of using Makie.jl to pick points off of an image with the mouse/keyboard

Run the Julia code below, and it'll pop up a window with an image. Select the window. Move the mouse around, and hit the f key. A red marker should appear.

I used the keyboard with the mouse because my application had several different features I wanted to pick out. You could adapt this to use the mouse buttons.

@tshort
tshort / ccalls.md
Created April 16, 2018 21:28
`ccall`'s from libjulia

Julia's runtime provides a lot of functionality used by base Julia code. A subset of this is needed to support basic data structures like arrays, dicts, and strings. Here is a list of the ccall's used by base Julia code. The most important ones for basic wasm support are:

# most important
abstractdict.jl
        :jl_eqtable_get
        :jl_eqtable_nextind
        :jl_eqtable_pop
        :jl_eqtable_put
        :jl_idtable_rehash