Skip to content

Instantly share code, notes, and snippets.

Jonathan Bieler jonathanBieler

Block or report user

Report or block jonathanBieler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gtk_build.jl
using ApplicationBuilder, GtkREPL, Compat
cd("/Users/jbieler/.julia/dev/GtkREPL/")
builddir = "/Users/jbieler/.julia/dev/GtkREPL/builddir/GtkREPL.app/Contents/Libraries/"
r = s->joinpath("/Users/jbieler/.julia/",s)
#Gtk libs
gtk_libs = [
:libgdk,
:libgdk_pixbuf,
View cmaes.jl
module CMAES
using Optim, Distributions, Parameters
import Optim: ZerothOrderOptimizer, ZerothOrderState, initial_state, update_state!,
trace!, assess_convergence, AbstractOptimizerState, update!, value, value!, pick_best_x,
pick_best_f
struct CMA <: Optim.ZerothOrderOptimizer
λ::Int
σ::Float64
View RemoteEval.jl
module RemoteEval
@enum Messages DONE=1
function start_server()
port, server = listenany(8000)
@async begin
while true
sock = accept(server)
View bindeps_sdl.jl
using BinDeps
using Compat
@BinDeps.setup
sdl2 = library_dependency("sdl2", aliases=["sdl2-2.0"])
# package managers
if is_linux()
provides(AptGet, Dict("sdl2-2.0"=>sdl2))
View cmaes.jl
module CMAES
using Distributions
∑(x) = sum(x)
function init_constants(xinit,λ,w,μ)
D = length(xinit)
μ_w = 1.0 / sum(w.^2)
View ZerothOrderOptimizer.jl
module A
using Optim
import Optim: ZerothOrderOptimizer, ZerothOrderState, initial_state, update_state!, trace!, assess_convergence, AbstractOptimizerState, update!, value
struct RandomSampler <: ZerothOrderOptimizer
σ::Float64
end
RandomSampler(; σ=1e-1) = RandomSampler(σ)
View FirstOrderOptimizer.jl
module A
using Optim
import Optim: FirstOrderOptimizer, initial_state, update_state!, trace!, assess_convergence, AbstractOptimizerState, update!, value
struct MinimalGradientDescent <: FirstOrderOptimizer
η::Float64
end
View TypedFunction.jl
struct TypedFunction{T <: Function,I,O}
f::T
end
(f::TypedFunction)(args...) = f.f(args...)
function tupleize(args) # I don't know how to go from (Int,Int) to Tuple{Int,Int}
t = Tuple{Any}
t.parameters = Core.svec(args...)
View cairo_text.jl
## header to provide surface and context
using Cairo
c = CairoRGBSurface(256,256);
struct cairo_font_options_t end
options = ccall((:cairo_font_options_create,Cairo._jl_libcairo), Ptr{cairo_font_options_t}, ())
ccall((:cairo_font_options_set_antialias,Cairo._jl_libcairo), Void, (Ptr{cairo_font_options_t},Cint),options,Cairo.ANTIALIAS_SUBPIXEL)
set_font_options(cr,options) = ccall((:cairo_set_font_options,Cairo._jl_libcairo), Void,
(Ptr{Void},Ptr{cairo_font_options_t}),cr,options)
View cairo_buid_works.jl
bielers-MacBook-Air:~ bieler$ /Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.0 (2017-06-19 13:05 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin13.4.0
You can’t perform that action at this time.