Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View prydt's full-sized avatar

pry prydt

View GitHub Profile
@prydt
prydt / verus_stack.rs
Created February 19, 2024 05:06
Refinement Practice with Verus, made a simple Stack
use vstd::prelude::*;
// My first real practice with refinement.
// Have a spec data structure, an implementation,
// and a way of converting from impl to spec.
//
// the technique is to prove that all the impl functions
// take you to the same spec states as the spec functions do.
verus!{
@prydt
prydt / datalog.py
Created February 4, 2024 20:04
very naive datalog engine in Python
from enum import Enum, auto
class Relations(Enum):
PARENT = auto()
ANCESTOR = auto()
class Vars(Enum):
X = auto()
@prydt
prydt / powertop.service
Created May 14, 2021 20:47
a powertop service config
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
ExecStart=/usr/bin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
#
# a script to return averages of hoplite output layers in CSVs -- Pranoy
#
import csv
import glob
import numpy as np
averages_list = []

Keybase proof

I hereby claim:

  • I am prydt on github.
  • I am prydt (https://keybase.io/prydt) on keybase.
  • I have a public key ASCSjjm4oA9Jaa7YqDfAPj7AIed7AoklaAQ1EOY2soBUWQo

To claim this, I am signing this object:

@prydt
prydt / recover.c
Created July 26, 2017 21:44
A bit of C code that will find jpgs in a memory file
//
// this file was originally used for cs50 pset4
//
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
@prydt
prydt / HashTable.kt
Created June 14, 2017 14:37
A simple chaining HashTable in Kotlin
package prydt.source
/**
* A HashTable
* Created by PryDt 6/14/2017.
*/
// a key-value pair
data class HashPair<Key, T>(val key: Key, val item: T)
@prydt
prydt / SinglyLinkedList.kt
Created June 14, 2017 14:24
A basic Singly Linked List in Kotlin
package prydt.source // just a package, m8
/**
* Created by PryDt on 6/13/2017.
*/
// basic node on list
data class Node<T>(var key: T?, var next: Node<T>?)
// the list class