Skip to content

Instantly share code, notes, and snippets.

View darrenldl's full-sized avatar

Darren Li darrenldl

View GitHub Profile
@darrenldl
darrenldl / compile-test.rkt
Created March 18, 2017 08:11
Racket megaparsack compile test code
#lang racket
(require megaparsack megaparsack/text)
(module+ main
(displayln
(with-handlers ([exn:fail:read:megaparsack? (λ(x) #f)])
(parse-result!
(parse-string integer/p "123"))))
)
@darrenldl
darrenldl / compile-test-log
Created March 18, 2017 08:16
Racket megaparsack compile test log
standard-module-name-resolver: collection not found
for module path: racket/match/gen-match
collection: "racket/match"
in collection directories:
context...:
show-collection-err
standard-module-name-resolver
#%embedded:g2732:curly-fn-transformer: [running expand-time body]
get-sym
/usr/share/racket/collects/racket/promise.rkt:58:10
@darrenldl
darrenldl / profile.txt
Created July 16, 2018 07:03
ocaml-reed-solomon-erasure : pure ocaml profile
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
74.00 10.93 10.93 camlReed_solomon_erasure__Galois__mul_slice_xor_pure_ocaml_inner_5708
14.22 13.03 2.10 1900021475 0.00 0.00 camlPervasives__char_of_int_1125
4.60 13.71 0.68 345 1.97 1.97 camlPervasives__$5e_1117
4.13 14.32 0.61 camlReed_solomon_erasure__Galois__mul_slice_pure_ocaml_inner_5701
1.49 14.54 0.22 12582912 0.00 0.00 camlRandom__intaux_1238
let swap (a : int array) (i : int) (j : int) : unit =
let temp = a.(i) in
a.(i) <- a.(j);
a.(j) <- temp
(* Took a while to understand what you're trying to do in this function,
* add comments in future whenever you have a non-trivial piece of code *)
let small_to_front (arr : int array) (start_unsorted : int) : unit =
(* W.r.t aux, see below *)
let rec aux (arr : int array) (start_unsorted : int) (i : int) (index_smallest : int) : unit =
@darrenldl
darrenldl / status
Created January 19, 2019 12:57
VLC status file text
3.0.6
http://get.videolan.org/vlc/3.0.6/vlc-3.0.6.tar.xz
VideoLAN and the VLC development team present VLC 3.0.6 "Vetinari".
VLC 3.0.6 is a minor update to VLC 3.0 branch, improving hardware decoding, Windows 10 and macOS mojave integration, RTSP, Bluray but also adding the support for a fast AV1 decoding.
@darrenldl
darrenldl / ubuntu_luks_keyfile_guide.md
Last active July 14, 2023 17:18
Ubuntu keyfile boot

Ubuntu LUKS keyfile guide

Goal

We want to be able to set up an encrypted Ubuntu installation where we can unlock using just an external USB key without entering any passwords

We do not consider evil maid attacks in this case, and are only worried about data leak

We also assume USB key is kept securely, thus we are not concerned with USB key not being encrypted

Cornell CS3110 2019 Chapter 8.2 Streams thought process

Context

This is a document in response to a Discord question on how to go about understanding the definition of nats in the chapter listed in title.

We cannot teach intuition, but giving one a more indepth view on how someone else thinks might allow one to draw inspirations and form intuitions more efficiently than just staring at a (very) abstract object for days.

Following documents some of the ways I dissected/thought about nats, as an attempt of achieving the above goal.

@darrenldl
darrenldl / proof-of-attack_vs_proof-of-security.txt
Last active September 16, 2020 15:54
Notes on proof of attack vs proof of security
Proof of attack vs proof of security
Soundness (NO false positives, may false negatives)
- May miss out legitimate cases
- "Conservative" systems normally at least have soundness
Completeness (may false positives, NO false negatives)
- Never miss out legitimate cases, but may grab more than needed
Proof of attack (off sec)
- Under some premises, shows there exists an attack for a given system (e.g. protocol, software)