- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
# SPDX-License-Identifier: Unlicense or CC0 | |
extends Node2D | |
# Smooth panning and precise zooming for Camera2D | |
# Usage: This script may be placed on a child node | |
# of a Camera2D or on a Camera2D itself. | |
# Suggestion: Change and/or set up the three Input Actions, | |
# otherwise the mouse will fall back to hard-wired mouse | |
# buttons and you will miss out on alternative bindings, | |
# deadzones, and other nice things from the project InputMap. |
RSA Private-Key: (6969 bit, 69 primes) | |
modulus: | |
01:01:57:5a:5e:73:6f:8f:02:77:e3:27:6e:c6:bd: | |
97:cf:32:95:de:59:a7:32:7e:64:84:e3:3e:e8:17: | |
f3:8c:07:5c:1e:74:7a:40:33:86:7b:45:bc:e0:b6: | |
c8:6c:e3:fa:5a:1c:65:18:1a:5c:fc:3c:8a:c4:f5: | |
6f:63:60:32:cc:cd:03:b5:c9:54:29:d5:b2:c1:24: | |
54:81:0b:f4:40:53:84:e5:14:2c:58:70:98:7f:36: | |
6b:ef:df:13:5e:8f:07:05:f1:42:25:cf:30:82:94: | |
9a:11:df:49:9a:76:51:ad:6e:d7:46:2d:b8:ed:39: |
import hmac, hashlib | |
# Data from I²C trace at https://hackaday.io/project/19480-raspberry-pi-camera-v21-reversed/log/52547-i2c-logic-analyzer-trace | |
# Secret key from VideoCore blob | |
# serial[8], serial[7:4], serial[3:0] | |
serial = bytes.fromhex("EE8C196D8301230B59") | |
# rPi -> camera random number | |
numIn = bytes.fromhex("5805F3C898C3133154498E082F2E703516F2DBD1") |
from math import * | |
# a performant solution would store a prefix sum of line lengths to | |
# a sidechannel and then use that to do a bsearch; on the GPU, | |
# you'd do a sum tree / histopyramid as a preprocessing step | |
def find_point(points, d): | |
d = d | |
for i in range(1, len(points)): | |
x0,y0 = points[i-1] | |
x1,y1 = points[i] |
DEVICE = atmega328p | |
CLOCK = 16000000 | |
PROGRAMMER = -c arduino -P /dev/ttyUSB0 -b57600 | |
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) | |
SOURCES = $(shell find . -name '*.c') | |
OBJECTS = $(SOURCES:.c=.o) | |
# Automatic dependency resolution |
Most important detail: in js13k entry 13k stands for zipped entry size. And this detail makes js13k differ from other code golfing compos.
Last year winner entry uncompressed size was about 70k. 70 kilobytes! In js1k you have a month to minify 1k, so how much time would it take to minify 70k? Nope, you have only 1 month. So it's very unlikely one will manually golf the entry. And this is the other thing that makes js13k special: no hardcore manual "hell yeah I've stripped one byte!" golfing.
var DSON = DSON || { | |
parse: function(v) { | |
return JSON.parse(v.replace(/"(\\"|[^"])*"|[a-z]+/gi, function(v) { | |
return { | |
such: '{', | |
wow: '}', | |
is: ':', | |
so: '[', | |
many: ']', | |
next: ',', |
function getTrilateration(position1, position2, position3) { | |
var xa = position1.x; | |
var ya = position1.y; | |
var xb = position2.x; | |
var yb = position2.y; | |
var xc = position3.x; | |
var yc = position3.y; | |
var ra = position1.distance; | |
var rb = position2.distance; | |
var rc = position3.distance; |
function random_text( $type = 'alnum', $length = 8 ) | |
{ | |
switch ( $type ) { | |
case 'alnum': | |
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'alpha': | |
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'hexdec': |