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
local width=480 | |
local height=270 | |
local sigma = 10; | |
local rho = 28; | |
local beta = 8.0 / 3.0; | |
local x=0.1 | |
local y=0 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name="viewport" /> | |
<link rel="icon" href="data:,"> | |
<title>String art</title> | |
<script type="text/javascript" src="jquery.min.js"></script> | |
<style> | |
html, body { |
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
import collections | |
import math | |
import os | |
import cv2 | |
import numpy as np | |
import time | |
MAX_LINES = 4000 | |
N_PINS = 36*8 | |
MIN_LOOP = 20 # To avoid getting stuck in a loop |
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
# see here also for seq | |
# https://nimbyexample.com/sequences.html | |
# pretty print a seq | |
# or better than just echo it | |
proc pp(a: seq[ seq[int] ] ) = | |
for i in a: | |
echo(i) |
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
# forward declarations | |
proc even(x: int) : bool; | |
proc odd(x: int) : bool; | |
proc odd(x : int) : bool = | |
if x==0: | |
return false | |
else: | |
return even(x-1) |
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
--[[ | |
saw this buried in this code | |
https://www.lexaloffle.com/bbs/?tid=49068 | |
]]-- | |
function mod(val,modulo) | |
--Mod for 1 based numbers. | |
--3%3=3. 4%3=1, 1%3=1 | |
return (val-1)%modulo+1 |
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
import struct | |
data = open("test.bin","rb").read() | |
# all of these are unsigned | |
def read_single_byte(data,position): | |
return struct.unpack("B",data[position:position+1]) | |
def read_single_word(data,position): | |
return struct.unpack("H",data[position:position+2]) |
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
#include <iostream> | |
#include "raylib.h" | |
int main(void) { | |
std::cout << "howdy" << std::endl; | |
// Initialization | |
//-------------------------------------------------------------------------------------- | |
const int screenWidth = 800; |
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 n=200,i,s,t; | |
float a[] = new float[n*4],d; | |
void setup() { | |
size(800,800); | |
colorMode(3); | |
blendMode(2); | |
for(i=0;i<n*4;i++) { | |
a[i] = 400-random(800); |
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
# needed to include the no-stack-protector to make gcc | |
# be fast and loose with the stack | |
junk : test.c | |
gcc -o junk -g -fno-stack-protector test.c | |
clean : | |
rm -f ./junk | |
NewerOlder