Skip to content

Instantly share code, notes, and snippets.

import java.awt.event.KeyEvent;
float drag = 0.9;
class Point {
float x, y, vx, vy;
Point(float x, float y) {
this.x = x;
this.y = y;
void setup() {
size(500, 500);
}
void tree(float x, float y, float length, float angle) {
if (length < 2) {
return;
}
float ny = y - length * sin(angle);
float nx = x + length * cos(angle);
#include <stdio.h>
#include <time.h>
#include <ApplicationServices/ApplicationServices.h> /* ApplicationServices.framework needed */
char *logFileName = "./keystroke.log";
FILE *logFile = NULL;
int counter = 0;
struct timespec prev_time;
float angle(vec2 uv) {
float a = atan(uv.y / uv.x);
if (uv.x < 0.) {
a += PI;
}
if (uv.x > 0. && uv.y < 0.) {
a += PI2;
}
return a;
}
@davidrusu
davidrusu / stepper.py
Last active January 11, 2018 16:49
steppers
from random import random
def busy_block(stepper):
res = None
while stepper is not None:
stepper, res = stepper()
print(res)
return res
@davidrusu
davidrusu / ring-sigs.org
Created December 29, 2021 04:52
Ring Signature Presentation

Elliptic Curve Cryptography Basics

Lets quickly build up a ECC system so that we are all on the same page.

Elliptic Curve Cryptography Basics: Finate Field

First, define a finate field F_q where q is a large prime.

Operations in F_q are all done modulo q.