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
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dapibus quam vitae augue condimentum pharetra. Aliquam sit amet nisi risus. Cras eget sem sodales metus consectetur eleifend. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam hendrerit sapien non augue molestie egestas. Proin eu semper ipsum. Quisque vulputate nisl id hendrerit volutpat. Nunc condimentum dui id sagittis consequat. Cras ac cursus augue, ut sagittis quam. Nullam pulvinar eget elit ut finibus. Cras facilisis eu quam non mattis. Nullam ac neque vitae neque ultrices porttitor sed in est. | |
Ut ultrices at turpis non aliquet. Pellentesque facilisis tellus at neque consectetur, eu bibendum justo finibus. Aenean felis ligula, rhoncus id placerat imperdiet, consectetur nec eros. Nullam et pretium ligula. Integer bibendum massa at est pharetra, non eleifend sem sodales. Fusce porttitor gravida diam id tincidunt. Cras in ullamcorper orci. Nulla sit amet diam nisl. Sed a nisi ornare, efficitur diam ac, tristique ante. Pellentes |
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
16-06-18 00:00 2714 | |
16-06-18 00:10 2756 | |
16-06-18 00:20 2807 | |
16-06-18 00:30 2837 | |
16-06-18 00:40 2862 | |
16-06-18 00:50 2883 | |
16-06-18 01:00 2860 | |
16-06-18 01:10 2877 | |
16-06-18 01:20 2889 | |
16-06-18 01:30 2848 |
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 fs = require("fs"); | |
const modelText = String(fs.readFileSync("Bunny.obj")); | |
const parseOBJ = function(modelText) { | |
let lines = modelText.split("\n"); | |
let vertexes = []; | |
let faces = []; | |
for(let line of lines) { |
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
/* ACSEF Program: find prime numbers */ | |
/* Compile with -DDEBUG to print all primes */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <time.h> | |
#define MAX_PRIME 100000000 |
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
<html> | |
<head> | |
<title>Mandelbrot</title> | |
</head> | |
<body> | |
<canvas id="output" width="600" height="400" style="border: 1px solid black;"></canvas> | |
<script> | |
const canvas = document.getElementById("output"); | |
const ctx = canvas.getContext("2d"); |
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
// deps | |
const net = require("net"); | |
const makeVarInt = (value) => { | |
const buf = []; | |
do { | |
let cur = value & 0b01111111; | |
value >>>= 7; | |
if(value != 0) { | |
cur |= 0b10000000; |
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
// crude, primitive module for tackling CSVs | |
// use something better i beg | |
const parseCSV = (text, delimiter = ",") => { | |
// extract column headers | |
const firstNewline = text.indexOf("\n"); | |
const columns = text.slice(0, firstNewline).split(delimiter); | |
// read |
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
// quick and dirty cache | |
module.exports = class { | |
constructor(maxAge, maxSize) { | |
this.maxAge = maxAge; | |
this.maxSize = maxSize; | |
this.cache = new Map(); | |
} |
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
// query making helper | |
// written while feeling very sick | |
class Query { | |
constructor(db, tableName) { | |
this.db = db; | |
this.tableName = tableName; | |
} |
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 nthPrime = (n) => { | |
// conservative upper bound for nth prime is n log(n log n) | |
// works for all n >= 6 | |
const max = Math.floor(n * Math.log(n * Math.log(n))); | |
// allocate sieve | |
const sieve = new Uint8Array(Math.ceil(max / 8)).fill(0); | |
// we need to keep track of how many primes we've encountered so far because the upper bound probably includes more than `n` primes |
OlderNewer