Skip to content

Instantly share code, notes, and snippets.

View paulzzy's full-sized avatar

Paul Zhang paulzzy

View GitHub Profile
@paulzzy
paulzzy / herbie_egraph.json
Created October 17, 2024 18:24
A really big e-graph (from Herbie, after undoing rewrites)
{
"nodes": {
"0.0": {
"op": "+",
"children": [
"0.0",
"54.0"
],
"eclass": "0",
"cost": 1.0,
// Works on egg v0.9.5 (https://github.com/paulzzy/egg.git?branch=push-uslmvkxmnqwq#0e7234ff)
use egg::{
undo_rewrites, Analysis, Applier, EGraph, Id, Language, PatternAst, Rewrite, Subst, Symbol,
};
struct UndoApplier<'a, L, N>
where
L: Language,
N: Analysis<L>,
@paulzzy
paulzzy / mdriver_perf.sh
Last active August 8, 2022 06:41
Profiles the performance of your malloc lab code! :D
#! /usr/bin/env bash
# Generates perf data for the malloc lab. Profiles the mdriver binary created by
# the Makefile. Besides the functions you write (in mm.c), mdriver calls a bunch
# of other functions. Be aware of this when you look at the profiling data.
#
# A great visualization tool for perf files is https://profiler.firefox.com
# (it's a website, just upload your perf file and it should work)
#
# This script is designed to be executed on UCLA SEASnet servers, but it should
@paulzzy
paulzzy / kudu_progress.js
Last active June 5, 2022 04:28
Kudu progress, since Kudu won't tell you 😩
// Reports your Kudu progress, since Kudu doesn't tell you. 😩
//
// 1. First, make sure to navigate to a homework page, then load the questions!
// 2. Open the browser console. Check out the below links for help~~
// Firefox: https://firefox-source-docs.mozilla.org/devtools-user/web_console/#opening-the-web-console
// Chrome: https://developer.chrome.com/docs/devtools/open/
// 3. Copy the below code, paste into the browser console, and press enter. Magic! Woo!
{
function count(css_selector) {

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.