Skip to content

Instantly share code, notes, and snippets.

View bananabrick's full-sized avatar

Arjun Nair bananabrick

  • Toronto, ON
View GitHub Profile
node: 5, store: 5
from: 230917 21:50
to: 230917 21:50
r-amp: NaN
_kind______from______to_____________________________________count___bytes______time
flush L0 12 23MB 1s
ingest L0 12 12KB
ingest L5 48 62KB
ingest L6 12 12KB
@bananabrick
bananabrick / parse_pebble.py
Created November 2, 2021 23:41
Parse pebble log output and plot stuff
import matplotlib.pyplot as plt
import sys
def read(filepath):
times = []
fs = []
commit = []
throughputs = []
find_insert = False
with open(filepath) as f:
1. I was trying to mount the following drives:
ubuntu@nair-test-0001:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 55.4M 1 loop /snap/core18/2066
loop1 7:1 0 230.1M 1 loop /snap/google-cloud-sdk/184
loop2 7:2 0 67.6M 1 loop /snap/lxd/20326
loop3 7:3 0 32.1M 1 loop /snap/snapd/12057
sda 8:0 0 10G 0 disk
├─sda1 8:1 0 9.9G 0 part /
import sys
from collections import defaultdict
from functools import lru_cache
from collections import Counter
def mi(s):
return map(int, s.strip().split())
def lmi(s):
return list(mi(s))
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_view"
module Vea(
Var(..), Row, Figure,
pp, buildFigure, normalize, restrict,
multiply, sumOut, keepBest
) where
import Utils
import Data.List (intercalate)
import Data.Maybe (mapMaybe)
import Data.Monoid ((<>))
appParser :: Parser CoreExpr
appParser = foldl App <$> coreWithoutAppWithParen <*> some coreWithParenParser
-- Result is this?
App {applier = Var {varName = "f"}, appliedOn = App {applier = Num {number = 2}, appliedOn = Num {number = 3}}}
coreExprParser :: Parser CoreExpr
coreExprParser =
-- I was having some backtracking
-- issues so now we "try" every parser.
choice [
Var <$> string "wtfd",
Var <$> string "wtf",
letRecParser,
letParser,
constrParser,
alphaNumUnder :: Parser String
-- Parser for string alphanumeric + '_' characters.
alphaNumUnder = consume $ many $ alphaNumChar <|> single '_'
variable :: Parser String
variable = (:) <$> letterChar <*> alphaNumUnder
{- CIS 194 HW 10
due Monday, 1 April
-}
module AParser where
import Control.Applicative
import Data.Char