Skip to content

Instantly share code, notes, and snippets.

View jamii's full-sized avatar

Jamie Brandon jamii

View GitHub Profile
> clj -T:build build/uber && java -jar target/preimp-1.0.0-standalone.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/InputSource
at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:120)
at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:65)
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:68)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:139)
at ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:50)
at ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:41)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)

The best:

[nix-shell:~]$ sudo dd if=Downloads/NIXOS_SYSTEM.img of=/dev/mmcblk0p2 bs=8M oflag=sync,direct status=progress
1811939328 bytes (1.8 GB, 1.7 GiB) copied, 59 s, 30.7 MB/s
dd: error writing '/dev/mmcblk0p2': No space left on device
218+0 records in
217+0 records out
1825570816 bytes (1.8 GB, 1.7 GiB) copied, 59.4498 s, 30.7 MB/s
[nix-shell:~]$ du -h Downloads/NIXOS_SYSTEM.img
3.4G Downloads/NIXOS_SYSTEM.img
@jamii
jamii / Mist.md
Created February 25, 2012 21:15
Mist: an open-source clojure library for p2p NAT traversal, dynamic addressing and pubsub

About

Building decentralised services is an exercise in accidental complexity. Connectivity is the first hurdle. Users move around, go on- and off-line and lurk behind NAT. For centralised systems we have ICE. For decentralised systems there is no standard solution.

Mist will take an abstract address representing a user, locate their machine, punch a hole and return a local UDP proxy to talk to that user. It will be cross-platform, provide a simple api and be easy to use with existing UDP programs.

As a bonus, the implementation also provides a p2p pubsub system.

The design is based heavily on Jeremy Miller's telehash protocol (although simplified and streamlined) and draws ideas from libswift. It is also based on lessons learned from my telehash implementation.

jamie@machine:~$ nix-shell ./test.nix
[nix-shell:~]$ exit
jamie@machine:~$ nix-shell ./test.nix --arg crossSystem '(import <nixpkgs/lib>).systems.examples.aarch64-multiplatform'
these derivations will be built:
/nix/store/ykhh1k6sg8nqd4kjzisfd78215gm08hp-llvm-7.1.0-aarch64-unknown-linux-gnu.drv
/nix/store/skq2sfprzjvabk4yhhvgg959y1alg7zj-mesa-19.1.5-aarch64-unknown-linux-gnu.drv
/nix/store/1bdblhq53m9jwk1vdh5nl32r4dn1q7jz-libGL-1.0.0-aarch64-unknown-linux-gnu.drv
/nix/store/8c1p4x1zfd95k0x46nwvimd7scfybywl-cairo-1.16.0-aarch64-unknown-linux-gnu.drv
/nix/store/7bmb2avirv6lazz5zc2w9d3pcrl58xfl-absolute_gir_path.patch.drv
(lldb) bt all
* thread #1, name = 'sqllogictest', stop reason = signal SIGSTOP
* frame #0: 0x00007ffff7cc82dd libpthread.so.0`__GI___pthread_timedjoin_ex + 445
frame #1: 0x0000555555b43e7d sqllogictest`join at thread.rs:168
frame #2: 0x00005555555d5618 sqllogictest`_$LT$std..thread..JoinHandle$LT$T$GT$$GT$::join::hab0e5b34b5aa2c78 + 72
frame #3: 0x00005555555e1066 sqllogictest`_$LT$timely_communication..initialize..WorkerGuards$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::h03f32e10376100ef + 166
frame #4: 0x00005555555c884c sqllogictest`core::ptr::real_drop_in_place::hdcc67cf3c2194a39 + 12
frame #5: 0x00005555555cc04b sqllogictest`sqllogictest::run::h0ee1d73416c26295 + 2379
frame #6: 0x00005555555c66d5 sqllogictest`sqllogictest::main::h8e18555117711ce2 + 1781
frame #7: 0x00005555555c22c3 sqllogictest`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h3a8b47154c70f142 + 3
(lldb) bt all
* thread #1, name = 'sqllogictest', stop reason = signal SIGSTOP
* frame #0: 0x00007ffff7cc82dd libpthread.so.0`__GI___pthread_timedjoin_ex + 445
frame #1: 0x0000555555b43e7d sqllogictest`join at thread.rs:168
frame #2: 0x00005555555d5618 sqllogictest`_$LT$std..thread..JoinHandle$LT$T$GT$$GT$::join::hab0e5b34b5aa2c78 + 72
frame #3: 0x00005555555e1066 sqllogictest`_$LT$timely_communication..initialize..WorkerGuards$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::h03f32e10376100ef + 166
frame #4: 0x00005555555c884c sqllogictest`core::ptr::real_drop_in_place::hdcc67cf3c2194a39 + 12
frame #5: 0x00005555555cc04b sqllogictest`sqllogictest::run::h0ee1d73416c26295 + 2379
frame #6: 0x00005555555c66d5 sqllogictest`sqllogictest::main::h8e18555117711ce2 + 1781
frame #7: 0x00005555555c22c3 sqllogictest`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h3a8b47154c70f142 + 3
julia> abstract type Expr end
julia> struct Apply <: Expr
f::Expr
arg::Expr
end
julia> struct Var <: Expr
name::Symbol
end
mdp example? https://www.nature.com/articles/s41598-017-15249-0
foraging? http://rsif.royalsocietypublishing.org/content/14/136/20170376
something better about policies? https://www.mitpressjournals.org/doi/full/10.1162/neco_a_00999
overview of papers. http://www.sciencedirect.com/science/article/pii/S0149763416307096
working software for reading model. http://www.sciencedirect.com/science/article/pii/S0149763416307096
possible alternative formulations. http://www.mdpi.com/1099-4300/19/6/266/htm
meta-bayes. http://www.ipsi.utoronto.ca/sdis/Friston-Paper.pdf
habits? http://www.sciencedirect.com/science/article/pii/S0149763416301336
hierarchical? http://rstb.royalsocietypublishing.org/content/364/1521/1211?ijkey=22b2ec7c7ee727c55840251984a7e9803922b453&keytype2=tf_ipsecsha