Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Fischer dfischer

View GitHub Profile
View Ternary Solution
I believe this is correct. Please let me know if there are errors.
X | - 0 +
---------
- | + 0 -
0 | - 0 +
+ | 0 + -
Call this gate "R". It's universal, assuming we have fan-out (trit-copying) and the constants. That is, a circuit of R's can be built
to represent any function f: T^n -> T where T = {-, 0, +}.
@dfischer
dfischer / README.md
Created Sep 22, 2020 — forked from hornc/README.md
Thue-Mirr esolang Interpreter
View README.md

Thue-Mirr interpreter,

https://esolangs.org/wiki/Thue-Mirr

usage: thue-mirr.py [-h] [--debug] [--char] [--num NUM] file

Thue-Mirr https://esolangs.org/wiki/Thue-Mirr Interpreter v1.0 by Salpynx. 2019 CC0

positional arguments:
  file               source file to process
@dfischer
dfischer / README.md
Created Sep 22, 2020 — forked from hornc/README.md
Thue-Mirr esolang Interpreter
View README.md

Thue-Mirr interpreter,

https://esolangs.org/wiki/Thue-Mirr

usage: thue-mirr.py [-h] [--debug] [--char] [--num NUM] file

Thue-Mirr https://esolangs.org/wiki/Thue-Mirr Interpreter v1.0 by Salpynx. 2019 CC0

positional arguments:
  file               source file to process
@dfischer
dfischer / blocktoimg.py
Created Aug 10, 2020 — forked from laanwj/blocktoimg.py
tools to write (block) data to png files and vice versa
View blocktoimg.py
#!/usr/bin/env python3
# Distributed under the MIT software license
import binascii, struct, sys, io, argparse
from PIL import Image
IMG_WIDTH = 512 # could be made adaptive...
MIN_HEIGHT = 4 # minimum height of image; twitter won't let us upload anything smaller
BYTES_PER_PIXEL = 4 # RGBA, 8 bit
def div_roundup(x,y):
View how_to_build_a_fast_limit_order_book.md

https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/

The response to my first few posts has been much larger than I’d imagined and I’d like to thank everyone for the encouragement.

If you’re interested in building a trading system I recommend first reading my previous post on general ideas to keep in mind.

My first really technical post will be on how to build a limit order book, probably the single most important component of a trading system. Because the data structure chosen to represent the limit order book will be the primary source of market information for trading models, it is important to make it both absolutely correct and extremely fast.

To give some idea of the data volumes, the Nasdaq TotalView ITCH feed, which is every event in every instrument traded on the Nasdaq, can have data rates of 20+ gigabytes/day with spikes of 3 megabytes/second or more. The individual messages average about 20 bytes each so this means handling

View how_to_build_a_fast_limit_order_book.md

https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/

The response to my first few posts has been much larger than I’d imagined and I’d like to thank everyone for the encouragement.

If you’re interested in building a trading system I recommend first reading my previous post on general ideas to keep in mind.

My first really technical post will be on how to build a limit order book, probably the single most important component of a trading system. Because the data structure chosen to represent the limit order book will be the primary source of market information for trading models, it is important to make it both absolutely correct and extremely fast.

To give some idea of the data volumes, the Nasdaq TotalView ITCH feed, which is every event in every instrument traded on the Nasdaq, can have data rates of 20+ gigabytes/day with spikes of 3 megabytes/second or more. The individual messages average about 20 bytes each so this means handling

@dfischer
dfischer / renamefiles.fish
Created Oct 15, 2019 — forked from staydecent/renamefiles.fish
File renaming pattern for Fish Shell with OSX sed
View renamefiles.fish
# 'Item*' it the pattern to look for
# sed "s/I/i/g" is the replacement pattern
for f in Item*; mv $f (echo {$f} | sed "s/I/i/g"); end
View gist:0944a07453eaac62d85131e041713609
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<edit mode="prepend" name="family"><string>Noto Sans</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>serif</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Serif</string></edit>
</match>
View gist:1e208baeff1e57b2029bc12fdb609731
# ~/.config/fish/config.fish
eval (starship init fish)
status --is-interactive; and source (pyenv init -|psub)
set -g fish_user_paths "/usr/local/sbin" $fish_user_paths
set -g fish_user_paths "/Users/dfischer/.emacs.d/bin" $fish_user_paths
set -g fish_user_paths "/Users/dfischer/.dotfiles/bin" $fish_user_paths
You can’t perform that action at this time.