Skip to content

Instantly share code, notes, and snippets.

View lithp's full-sized avatar

Brian Cloutier lithp

  • Ethereum Foundation
  • San Francisco, CA
View GitHub Profile
@lithp
lithp / twelve_balls.py
Last active March 10, 2023 18:43
twelve balls
#!/usr/bin/env python3
"""
**Problem Statement**: There are 12 balls. 11 of them are equi-weight and the 12th ball
has a different weight. It is heavier or lighter than the others, you don't know which.
You have a balance scale; when given two non-intersecting sets of items it returns one of
three answers: the first set is heavier, the sets have equal weight, the second set is
heavier. You are only allowed to use the scale three times, can you determine which ball
is the odd ball, and whether it's heavier/lighter than the others?
@lithp
lithp / attestation.txt
Created April 9, 2022 03:38
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 254
Hash: aa773563 143d77d4 b5c0c0bc d672db31
128a204e 3fc41d9b f60de003 17d684b1
547ea40f 4560cf76 5441d7ef 0123bfac
0a700e0d 7f719667 e6b2df72 702e75fa
Batch
PCR Run Completed
set results reported -> Waiting for Timer
Results Reported
Waiting for Timer
90 minutes passes -> Results Submitted
hold results -> Results Held
submit now -> Results Submitted
Results Held
unhold results -> Results Reported
@lithp
lithp / keybase.md
Last active June 29, 2018 05:17
keybase.md

Keybase proof

I hereby claim:

  • I am lithp on github.
  • I am lithp (https://keybase.io/lithp) on keybase.
  • I have a public key ASBKhvt74gLkZeNwVgEE-M6RuZ1FS8OsxJ3INO-Th26eIwo

To claim this, I am signing this object:

@lithp
lithp / improved-euler35.pl
Created April 14, 2015 03:14
Faster implementation of euler35 in Prolog
#!/usr/bin/swipl -q -t main -s
:- use_module(library(assoc)).
:- use_module(library(pairs)).
divides(X, Y) :- 0 is X mod Y.
prime(X) :- X > 1,
Limit is floor(sqrt(X)),
foreach(between(2, Limit, Factor), not(divides(X, Factor))).
@lithp
lithp / euler35.pl
Created April 9, 2015 15:19
Euler 35 in prolog
#!/usr/bin/swipl -q -t does_not_work -s
divides(X, Y) :- 0 is X mod Y.
prime(X) :- X > 1,
Limit is floor(sqrt(X)),
foreach(between(2, Limit, Factor), not(divides(X, Factor))).
rotate([H | Rest], R) :- append(Rest, [H], R).
@lithp
lithp / core.clj
Created April 3, 2015 22:59
Game of Life in Clojure
(ns game-of-life.core
(:gen-class)
(:require [clojure.string :as string])
)
; inclusive coordinates of two opposite corners
(defn window [x1 y1 x2 y2] [x1 y1 x2 y2])
(defn top-right [[x1 y1 x2 y2]] [(max x1 x2) (max y1 y2)])
(defn bottom-left [[x1 y1 x2 y2]] [(min x1 x2) (min y1 y2)])
@lithp
lithp / review.md
Last active August 29, 2015 14:14
jkol36/layers code review

A Code Review of Layers

I spent a bit looking at the repo and came up with a few parts where it could be improved. While reading this please remember that many of the things in it are simply my opinion. I've done my best to provide justifications; where you don't agree with those justifications feel free to ignore them. Most programming is more craftsmanship than engineering. Each of us have our own style and it's rare that you'll know with certainty which style is "better".

Also, if there's something you don't understand, ask me about it! It's not your fault for misunderstanding but my fault for not describing it well enough. I'm not a very good writer.

Without further ado:

Your usage of git is a little unorthodox

@lithp
lithp / gist:d489e65efbcc4604ff02
Created October 26, 2014 06:39
Keybase Proof
### Keybase proof
I hereby claim:
* I am num1 on github.
* I am him (https://keybase.io/him) on keybase.
* I have a public key whose fingerprint is AF46 151F 67D2 F121 8385 F10D DBBA A066 716F 2EFC
To claim this, I am signing this object: