Skip to content

Instantly share code, notes, and snippets.

View ianfiske's full-sized avatar

Ian Fiske ianfiske

  • NextEra Analytics
View GitHub Profile
@ianfiske
ianfiske / gist:9bfcd388dcd592d976e4
Created January 21, 2015 15:12
Python wrapper class for keyval stores and pyrocksdb
import cPickle
import rocksdb
class KeyValDB(object):
@staticmethod
def get_database(db_type, path):
if db_type == 'shelve':
return ShelveDB(path)
elif db_type == 'rocksdb':
@ianfiske
ianfiske / readtemp.nut
Last active April 17, 2016 12:51
Read temperature from DS18B20 on Electric Imp
#require "Onewire.class.nut:1.0.0"
ow <- Onewire(hardware.uart12);
power <- hardware.pin8;
power.configure(ANALOG_IN);
local success = ow.init();
if (!success) {
// Report error. Note if the Onewire object instantiated in
// debug mode, the object will report errors
#!/usr/bin/env bash
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@ianfiske
ianfiske / parametron_test_module.jl
Created May 24, 2019 13:30
Test Module for Parametron
module TestParametron
# create a MathOptInterface optimizer instance
using OSQP
optimizer = OSQP.Optimizer()
# create a Parametron.Model, which holds problem information
using Parametron
using Random, LinearAlgebra
@ianfiske
ianfiske / gist:535c79c8782b5d4cfdc7094faeeaa7a7
Created February 6, 2020 19:45
Julia VSCode 1.3.1 Memory Leak
This file has been truncated, but you can view the full file.
[ Info: Starting the Julia Language Server
[ Info: Received new data from Julia Symbol Server.
signal (15): Terminated: 15
in expression starting at /Users/ifiske/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/main.jl:11
sweep_page at /Users/julia/buildbot/worker/package_macos64/build/src/gc.c:1209 [inlined]
sweep_pool_page at /Users/julia/buildbot/worker/package_macos64/build/src/gc.c:1277 [inlined]
sweep_pool_pagetable0 at /Users/julia/buildbot/worker/package_macos64/build/src/gc.c:1297 [inlined]
sweep_pool_pagetable1 at /Users/julia/buildbot/worker/package_macos64/build/src/gc.c:1317 [inlined]
sweep_pool_pagetable at /Users/julia/buildbot/worker/package_macos64/build/src/gc.c:1347 [inlined]
@ianfiske
ianfiske / sf-stacktrace.txt
Last active August 24, 2021 13:35
RCall.jl + sf + vscode segfault (lldb stacktrace)
julia> reval("library(sf)")
signal (11): Segmentation fault: 11
in expression starting at REPL[7]:1
_platform_strlen at /usr/lib/system/libsystem_platform.dylib (unknown line)
Allocations: 20613870 (Pool: 20606437; Big: 7433); GC: 24
Process 61545 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00007fff20467552 libsystem_platform.dylib`_platform_strlen + 18
libsystem_platform.dylib`_platform_strlen:
This file has been truncated, but you can view the full file.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.7.1 (2021-12-22)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> include("/Users/ifiske/projects/irdot/IntegratedDipatchSimulation/examples/autodiff.jl")
(base) ➜ ~ julia --project=/Users/ifiske/projects/irdot/IntegratedDipatchSimulation/examples /Users/ifiske/projects/irdot/IntegratedDipatchSimulation/examples/autodiff_mwe.jl
after simplification :
define nonnull {} addrspace(10)* @preprocess_julia_f_1787({} addrspace(10)* nonnull align 16 dereferenceable(40) %0) local_unnamed_addr #2 !dbg !14 {
entry:
%1 = call {}*** @julia.get_pgcstack()
%2 = load atomic {} addrspace(10)*, {} addrspace(10)** inttoptr (i64 4586392936 to {} addrspace(10)**) unordered, align 8, !dbg !15, !tbaa !9
%3 = call cc37 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32)* @jl_apply_generic to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* %2, {} addrspace(10)* nonnull %0), !dbg !15
%4 = call cc37 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32)* @jl_apply_generic to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecas
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"