Skip to content

Instantly share code, notes, and snippets.

View pczarn's full-sized avatar
🇵🇱
Proland

Peter Blackson pczarn

🇵🇱
Proland
  • Poland
View GitHub Profile
pub struct MySlice {
start: *const u8,
len: uint,
}
#[inline(never)]
pub fn merge_slice(val: &[u8]) -> MySlice {
let mut val_ptr = val.as_ptr();
let mut len = val.len();
.text
.file "myhash.bc"
.align 16, 0x90
.type _ZN4main20h487ea52046783e21hQaE,@function
_ZN4main20h487ea52046783e21hQaE: # @_ZN4main20h487ea52046783e21hQaE
.cfi_startproc
# BB#0:
cmp rsp, qword ptr fs:[112]
ja .LBB0_2
# BB#1:
@pczarn
pczarn / sort.c
Last active August 29, 2015 14:17
100000,4498507,3303010,648466,16
200000,8362325,6241487,1600060,17
300000,14234516,9815716,2576244,18
400000,20917134,15040464,3536045,18
500000,27302971,18864431,4210794,18
600000,34065834,24098987,5387591,19
700000,41003115,30249966,6298501,19
800000,48902149,35815841,7190792,19
900000,59714105,41751355,8217691,19
1000000,63407397,47906822,9090613,19
recognizer.earleme == 0
====================================
start: • stmts (0)
stmt : • ident ty defined_as rhs action semi (0)
stmts: [ • stmt ]* (0)
------------------------------------
start: • stmts (0)
stmts: • g32 (0)
stmt : • g24 semi (0)
g24 : • g25 action (0)
@pczarn
pczarn / robin_hood.jl
Last active November 6, 2016 11:21
Probability distribution of hash table lookup cost in Robin Hood hashing.
LOAD_FACTOR = 0.909
PRECISION = 6000
N_LIMIT = 250
setprecision(512)
function psi(n, a::BigFloat)
p = 1 / a - 1
q = BigFloat(0)
extern crate runtime;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum Test {
Foo,
Bar,
}
#[test]
fn test_layered_parser() {
@pczarn
pczarn / mkv.rs
Last active July 15, 2024 06:14
Design experiments for Panini's grammar description
fn main() {
let mkv = grammar! {
start ::= (id, size, hsize):resync
resync ::= resync_element_id:bytes(0x1F43B675 | 0x18538067 | 0x1654AE6B) ~ (seglen, x):matroska_number => {
(resync_element_id, seglen, x + 4)
};
matroska_number ::= b:byte ~ (mut r):byte+(leading_zeros(b)) => {
let n = leading_zeros(b) + 1;
@pczarn
pczarn / RobinHood.ipynb
Last active February 19, 2017 17:12
Notebook for Robin Hood hashing (using Julia)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pczarn
pczarn / coalesced-notes.txt
Created March 25, 2017 20:55
Mass Effect 3 Coalesced bin
/bioinput.ini/sfxgame/sfxgamemodebase/bindings
( Name="Shared_Action", Command="Exclusive Used | Exclusive PressAction | OnTap 0.3 TapAction | OnHold 0.3 HoldAction")
( Name="Shared_Aim", Command="SwapWeaponIfEmpty | TightAim | FOV 0 | OnRelease FOV 95 | OnRelease StopTightAim" )
( Name="My_Storm", Command="Exclusive TryStandingJump | OnRelease StormOff | StormOn" )
( Name="My_Melee", Command="TryHeavyMelee")
: OnTap 0.01 TryMelee | LeaveWorld | OnHold 0.01 TryHeavyMelee
( Name="F11", Command="screenshot" )
sfxgamemodedefault
inputdelaystormexit = 0.01
inputdelaytightaimexit = 0.01
@pczarn
pczarn / Earley.agda
Last active May 25, 2019 17:33
Defining grammars / parse forests / BNF eventually for an Earley parser in Agda
open import Data.List
open import Data.Nat
open import Data.Nat.Properties
open import Relation.Binary.PropositionalEquality
-- open import Data.Product
module Earley where
data Terminality : Set where
T : Terminality