This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Utilities | |
type TrimStart<String extends string> = String extends ` ${infer R}` ? TrimStart<R> : String; | |
type TrimEnd<String extends string> = String extends `${infer R} ` ? TrimEnd<R> : String; | |
type Trim<String extends string> = TrimEnd<TrimStart<String>> | |
type Head<Array extends any[]> = Array[0] | |
type Tail<Array extends any[]> = | |
((...a: Array) => void) extends (h: any, ...rest: infer Tail) => void ? Tail : never; | |
type MergeArrayOfObjects<T extends object[]> = T[1] extends undefined | |
? Head<T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DIV: u32 = 8; | |
pub fn tesselate( | |
image: &DynamicImage, | |
sites: &Vec<(u32, u32)>, | |
) -> image::ImageBuffer<Rgb<u8>, Vec<u8>> { | |
let (width, height) = image.dimensions(); | |
// Create a mapping between a voronoi region and color | |
let mut site_colors: HashMap<(u32, u32), Rgb<u8>> = HashMap::new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::process::exit; | |
fn main() { | |
// The minimum values of m to search though | |
let m_min = 2; | |
let m_max = 16; | |
for m in m_min..m_max { | |
print!("For {}:", m); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma config(Sensor, in1, lightSensor1, sensorReflection) | |
#pragma config(Sensor, in2, lightSensor2, sensorReflection) | |
#pragma config(Sensor, dgtl1, ultrasonic, sensorSONAR_inch) | |
#pragma config(Sensor, dgtl3, encoder, sensorNone) | |
#pragma config(Sensor, dgtl8, bump, sensorNone) | |
#pragma config(Motor, port1, puncher, tmotorNone, openLoop) | |
#pragma config(Motor, port2, leftDrive, tmotorNone, openLoop) | |
#pragma config(Motor, port3, rightDrive, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port4, servo, tmotorVex393_MC29, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finds the character distribution of a file | |
"""Returns a list of the frequencies of each character by ASCII code""" | |
def frequency(string): | |
dist = [0] * 127 | |
for char in string: | |
dist[ord(char)] += 1 | |
return dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int LOGISTIC[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 44, 45, 46, 48, 49, 51, 52, 54, 56, 57, 59, 60, 62, 64, 65, 67, 68, 70, 71, 73, 75, 76, 78, 79, 81, 82, 83, 85, 86, 88, 89, 90, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 119, 120, 120, 120, 121, 121, 121, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125 }; | |
int logistic(int n) { | |
return sgn(n) * LOGISTIC[abs(n)]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Invite manager: | |
* 1) Generates new invites | |
* 2) Applies them to users | |
* 3) | |
*/ | |
import Koa from "koa"; | |
import * as Router from "koa-router"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Type definitions for vexdb 1.5 | |
// Project: https://github.com/MayorMonty/vexdb#readme | |
// Definitions by: My Self <https://github.com/me> | |
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
import { EventEmitter } from "events"; | |
type Endpoint = | |
| "events" | |
| "teams" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf vexbot; | |
git clone https://gitub.com/MayorMonty/vexbot; | |
cd vexbot; | |
yarn; | |
node main.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf vexbot; | |
git clone https://github.com/MayorMonty/vexdb; | |
cd vexdb; | |
npm install; | |
node main.js & |
NewerOlder