Skip to content

Instantly share code, notes, and snippets.

View huntiep's full-sized avatar

Hunter huntiep

View GitHub Profile
#!/usr/bin/racket
#lang racket
(define args (current-command-line-arguments))
(define infile (vector-ref args 0))
(define input (file->string infile))
(define line-len (+ 1 (string-length (car (string-split input "\n")))))
(define (p1 input idx sum)
fn part2(input: &str) -> String {
let mut sum = 0;
let mut i = 0;
let input = input.as_bytes();
let len = input.len();
'a: loop {
if i == len {
break
}
let mut r = 0;
@huntiep
huntiep / invertbst.sasm
Last active November 28, 2023 22:44
Invert a Binary Tree with S assembler - https://github.com/huntiep/sasm
(include! "syscalls.sasm")
;; Initialize malloc
(jal x1 malloc-init)
;; Create tree:
;; a
;; / \
;; b c
;; / / \
/// Is this even Rust anymore?
use std::{fs, io, thread};
use std::arch::x86_64::*;
use std::io::Write;
const NUM_CPUS: usize = 24;
#[derive(Copy, Clone)]
struct SendPtr(*const u8);
unsafe impl Send for SendPtr {}
@huntiep
huntiep / Cargo.toml
Created November 29, 2018 19:22
Benchmark of AMD64 PUSH vs SUB+MOV
[package]
name = "push"
version = "0.1.0"
authors = ["A non-e-moose"]
[dependencies]
[dev-dependencies]
criterion = "0.2.5"
memmap = "0.7.0"

Slide 2

Who?

  • Soon unemployed
  • Work life okay (?)

Slide 3

First, an apology

Slide 4