Skip to content

Instantly share code, notes, and snippets.

View oxinabox's full-sized avatar
🐂

Frames White oxinabox

🐂
View GitHub Profile
@oxinabox
oxinabox / ex.jl
Created January 15, 2020 15:13
DateTimeChanges
## With this PR
julia> using Dates
# PERIOD
julia> d = Day(1)
1 day
julia> show(d)
@oxinabox
oxinabox / examples.jl
Last active January 15, 2020 15:10
date printing changes
julia> using Dates
# PERIOD
julia> d = Day(1)
1 day
julia> show(d)
Day(1)
julia> show([d])
@oxinabox
oxinabox / PSO.dx
Last active December 2, 2019 01:57
A Particle Swarm Opotimizer in DexLang
' # Particle Swarm Optimizer
' ## Fitness function
rosenbrock:: Real -> Real -> Real
rosenbrock x y = sq (1.0 - x) + 100.0*sq (y - x*x)
' We write one that uses vector for input
@oxinabox
oxinabox / Manifest.toml
Created November 20, 2019 14:53
Distrubuted Fault
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[BinaryProvider]]
deps = ["Libdl", "SHA"]
git-tree-sha1 = "5b08ed6036d9d3f0ee6369410b830f8873d4024c"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.8"
[[Compat]]
@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 / 1
Created September 16, 2019 15:15
hold this image
a
@oxinabox
oxinabox / fdiff.jl
Created August 8, 2019 19:02
A Simple scalar ForwardDiff using ChainRules + DualNumbers
#==
A Simple scalar ForwardDiff using ChainRules + DualNumbers
---
No promises are made to its correctness or safty.
Infact it probably errors for super standard cases.
But this is just to explain how it can work
==#
## Setup
using Pkg: Pkg, @pkg_str
@oxinabox
oxinabox / TensorBoardLoggerDemo.ipynb
Created July 5, 2019 16:12
Note: this does get a bit carried way on using closures. Cleaner is really to just set the logger.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oxinabox
oxinabox / TellMeAboutSlotValues.ipynb
Created April 20, 2019 21:27
Cassette and I, killing the optimizer
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oxinabox
oxinabox / demo.ipynb
Last active January 25, 2019 19:46
Using Cassette to pull out information about creation of Vectors.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.