Skip to content

Instantly share code, notes, and snippets.

View chubbc's full-sized avatar

Christopher T. Chubb chubbc

View GitHub Profile
@chubbc
chubbc / AoC2023.ua
Last active December 5, 2023 00:33
AoC2023 Uiua
# Day 01 #######################################################################
Input ← ≡(□)⬚@ ⊜∘≠@\n. &fras "01.txt"
FilterDigits ← (@0|∘)×⊃(≥@0)(≤@9).⊔
EndNumbers ← parse⊂⊃(⊢)(⊢⇌)▽>@0.
Silver ← /+∵(EndNumbers FilterDigits)
Numbers ← ⊜□≠@ ."one two three four five six seven eight nine"
FilterWords ← +@0/↥≡(×)+1⇡9≡(⌕∩(⊔)) Numbers
@chubbc
chubbc / bootstrap.jl
Last active October 16, 2023 12:07
Bootstrap threshold analysis script
#!/usr/bin/env julia
#===========================================================================================
████████╗██╗ ██╗██████╗ ███████╗███████╗██╗ ██╗ ██████╗ ██╗ ██████╗
╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔════╝██║ ██║██╔═══██╗██║ ██╔══██╗
██║ ███████║██████╔╝█████╗ ███████╗███████║██║ ██║██║ ██║ ██║
██║ ██╔══██║██╔══██╗██╔══╝ ╚════██║██╔══██║██║ ██║██║ ██║ ██║
██║ ██║ ██║██║ ██║███████╗███████║██║ ██║╚██████╔╝███████╗██████╔╝
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═════╝
k = 14
str = ""
str *= "+"^(k-1) * ">+>" * ">,"^(k-1) * "<"^k * "\n"
str *= "[\n"
str *= "\t<+>\n"
str *= "\t[-]" * "+"^((k*(k-1))>>1) * "\n"
str *= "\t>[-]" * ">[-<+>]"^(k-1) * "," * "<"^k * "\n"
str *= "\n"
for i=1:k-1
for j=i+1:k
+++++++++++++>+>>,>,>,>,>,>,>,>,>,>,>,>,>,<<<<<<<<<<<<<<[<+>[-]+++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]>[
-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+>]>[-<+
>]>[-<+>],<<<<<<<<<<<<<[->>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>[-<<<<<
<<<<<<<<<<+>>>>>>>>>>>>>>>]<<<<<<<<<<<<<<[->>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<]>>>>
>>>>>>>>>>>[-<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>]<[-<->]<[[-]<<<<<<<<<<<<<<<->>>>>>>
>>>>>>>>]<<<<<<<<<<<<<<[->>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>[-<<<<<
<<<<<<<<<<+>>>>>>>>>>>>>>>]<<<<<<<<<<<<<[->>>>>>>>>>>>>+>+<<<<<<<<<<<<<<]>>>>>>>
>>>>>>>[-<<<<<<<<<<<<<<+>>>>>>>>>>>>>>]<[-<->]<[[-]<<<<<<<<<<<<<<<->>>>>>>>>>>>>
>>]<<<<<<<<<<<<<<[->>>>>>>>>>>>>>+>+<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>[-<<<<<<<<<<<
+++>+>>,>,>,<<<< initialise out to 3 / cnt to 1 / read in the first 3 value
[ loop until the cnt is 0
<+> increment out by 1
[-]++++++ set count to 6
> [-] >[-<+>] >[-<+>] >[-<+>] , <<<< shuttle everything along and read new element
> [->>>>+>+<<<<<] >>>>>[-<<<<<+>>>>>] <<<<<< move a into place
>> [->>>>+>+<<<<<] >>>>>[-<<<<<+>>>>>] <<<<<<< move b into place
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< neq
########## House ##########
3 Gaye Cameron One Nation
1 Catherine Dyson Greens
5 Scott Morrison Liberal
4 Jacqueline Guinane United Australia
2 Simon Earle Labor
########## Senate ##########
@chubbc
chubbc / investing_resources.md
Last active May 30, 2022 00:43
Recommened investing resources

Investing resources I recommend

Good general overview:

Investing Demystified by Lars Kroijer Nice ~30 min introduction to basic index investing stuff, tends to be pretty concrete. Mostly focuses on the motivation of index investing and basic practice, and not so much of the mathematical theory. He advocates for a 2 fund portfolio (global stock tracker + global bond tracker). Only real criticism is that he exclusively recommends being completely globally diversified, whereas I'd argue some home bias is justified for most people. The rest of his youtube channel outside of this series can be pretty safely ignored.

The Bogleheads' Guide to Investing Pretty good general introduction to index-focused investing in general. Tends to be very broad in scope, meaning it probably hits some topics that mightn't be so relevant/necessary (e.g. b

if(d>=1) {
d--; c++;
} else if(c>=9) {
c-=9; b+=1; d+=8;
} else if(c>=8) {
c-=8;
if(p>=1) { p--; q+=7; d+=8; }
else if(f>=1) { f--; b++; d+=8; }
else if(e>=1) { e--; d+=7; }
else { d+=6; }
using Primes;
function fractran_prog()::Vector{Rational{BigInt}}
prog::Vector{Rational{BigInt}}=[];
(a,b) = Rational{BigInt}.((2,3)); # Input
(c,d) = Rational{BigInt}.((5,7)); # Program counter
(p,q) = Rational{BigInt}.((11,13)); # Public key
(e,f,g) = Rational{BigInt}.((17,19,23)); # Encryption key
(na,np) = Rational{BigInt}.((29,31)); # Ancillas for neq
>+[[-]>[-],[+[-----------[>[-]++++++[<------
>-]<--<<[->>++++++++++<<]>>[-<<+>>]<+>]]]<] # Read mod
>+> # Set flag
>+[[-]>[-],[+[-----------[>[-]++++++[<------
>-]<--<<[->>++++++++++<<]>>[-<<+>>]<+>]]]<] # Read num 1
>+[[-]>[-],[+[-----------[>[-]++++++[<------
>-]<--<<[->>++++++++++<<]>>[-<<+>>]<+>]]]<] # Read num 2