Skip to content

Instantly share code, notes, and snippets.

View maedoc's full-sized avatar

marmaduke woodman maedoc

  • now
  • here
View GitHub Profile
@maedoc
maedoc / clang.txt
Created May 31, 2022 16:37
Stan issue with adj updates
--- Compiling, linking C++ code ---
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_6.0.0/include -I stan/lib/stan_math/lib/sundials_6.0.0/src/sundials -DBOOST_DISABLE_ASSERTS -c -include-pch stan/src/stan/model/model_header.hpp.gch -include /Users/duke/Nextcloud/Work/HiresHMC/bigpbvepinc.hpp -x c++ -o /Users/duke/Nextcloud/Work/HiresHMC/bigpbvep.o /Users/duke/Nextcloud/Work/HiresHMC/bigpbvep.hpp
In file included from <built-in>:1:
user_header.hpp:82:14: error: no viable overloaded '+='
xz.adj() += g_x;
~~~~~~~~ ^ ~~~
user_header.hpp:105:7: note: in instantiation of function template specialization 'bigpbvep_model_namespace::ode_rhs_rev<stan::math::arena_matri
@maedoc
maedoc / stan.ycm_extra_conf.py
Created May 31, 2022 11:53
A ycm file for Stan work
import os.path
def Settings(*args, **kwargs):
stan_cmd = '-std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DBOOST_DISABLE_ASSERTS -c -include-pch stan/src/stan/model/model_header.hpp.gch -x c++ -o examples/bernoulli/bernoulli.o examples/bernoulli/bernoulli.hpp'
home = os.environ['HOME']
stan_cmd = stan_cmd.replace('-I stan/', f'-I {home}/.cmdstan/cmdstan-2.28.2/stan/')
flags = [_ for _ in stan_cmd.split(' ') if _.strip()]
return {'flags': flags}
@maedoc
maedoc / watts.md
Last active March 16, 2022 21:18
Watts transcriptions

How do I stop thinking?

source

1st part of YT https://www.youtube.com/watch?v=eTO_WQZ-2q0 which is part of a larger lecture on consciousness.

mirror mind

Hakuin, the 17th century master writes in one of his poems, he uses the phrase,

@maedoc
maedoc / Makefile
Last active January 27, 2022 11:07
minimal Stan user func with external files
model: model.stan support.o support.hpp
STANCFLAGS=--allow-undefined USER_HEADER=$$PWD/support.hpp LDLIBS_OS=$$PWD/support.o make -C ~/.cmdstan/cmdstan-2.28.2/ $$PWD/model
@maedoc
maedoc / codim3.py
Last active December 7, 2021 11:20
Codim-3 canonical model of Saggio et al 2020 https://elifesciences.org/articles/55632
from scipy.integrate import ode
from numba import njit
import numba as nb
from NumbaLSODA import lsoda_sig, lsoda
from numba import njit, cfunc
@njit
def Parametrization_VectorsGreatCircle(p1,p2,R):
E = p1 / R
F = np.cross(np.cross(p1,p2),p1)
@maedoc
maedoc / numba-bold.ipynb
Created December 6, 2021 12:17
A BOLD implementation in Numba for neural network simulations.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maedoc
maedoc / benchmark-autodiff.ipynb
Last active December 10, 2021 10:06
Sensitivity analysis of network of Epileptors
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maedoc
maedoc / minfield.ipynb
Created November 13, 2021 22:10
A minimal field model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maedoc
maedoc / share-from-scratch.md
Created November 8, 2021 12:36
Internet sharing from scatch

Internet sharing from scratch on Linux

Something like

steps

Assuming eth0 is the interface which already has internet, and you want to share to eth1,

  • Install dnsmasq
@maedoc
maedoc / lesmd.py
Last active October 25, 2021 08:48
Low entropy symbolic model definitions in Python
import sympy
class DfunSymGen(dict):
def __init__(self):
self.symbols = []
def __setitem__(self, key, val):
dict.__setitem__(self, key, val)
self.symbols.append(key)
def __getitem__(self, key):
if key not in self: