View wlog.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
var fs = require("fs"); | |
var writer; | |
function wait(ms) { | |
return new Promise(function (resolve) { | |
setTimeout(resolve, ms); | |
}); | |
} | |
function rad2deg(r) { | |
return r / Math.PI * 180; |
View calc60.ps
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
%! | |
0 setlinewidth | |
/vertex { 2 copy 5 4 roll dup 4 1 roll | |
newpath 0 360 arc closepath | |
gsave 1.0 setgray fill grestore | |
stroke | |
12 ge { |
View lmbda.cpp
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
// Copyright: https://mit-license.org/ | |
// | |
// cpplint lmbda.cpp 2>&1 | grep -v "Is this a non-const reference?" | |
// g++ -Wall -Wextra -pedantic -std=c++14 -g lmbda.cpp -o lmbda | |
// | |
#include <assert.h> | |
#include <iostream> | |
#include <vector> |
View C30.py
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
#!/usr/bin/env python | |
import matplotlib.pyplot as plt | |
import networkx as nx | |
C30=[[9,10,1],[0,2,25],[1,18,3],[2,4,26],[3,16,5],[4,6,27],[5,14,7],[6,8,28],[7,12,9],[8,0,29],[0,11,19],[10,12,21],[11,8,13],[12,14,22],[13,6,15],[14,16,23],[15,4,17],[16,18,24],[17,2,19],[18,10,20],[19,21,24],[20,11,22],[21,13,23],[22,15,24],[23,17,20],[1,26,29],[25,3,27],[26,5,28],[27,7,29],[28,9,25]] | |
G = nx.Graph() | |
for i in range(len(C30)): | |
for j in C30[i]: | |
G.add_edge(i, j) |
View ps_done.ps
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
%! | |
0 setlinewidth | |
/Times-Roman findfont 12 scalefont setfont | |
newpath 8 99 moveto 601 99 lineto 601 692 lineto 8 692 lineto closepath stroke | |
/vertex { 2 copy 5 4 roll dup 4 1 roll | |
newpath 0 360 arc closepath |
View tetrahedron_with_cylinder_edges.scad
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
v=[[sqrt(8/9),0,-1/3],[-sqrt(2/9),sqrt(2/3),-1/3],[-sqrt(2/9),-sqrt(2/3),-1/3],[0,0,1]]; | |
R=40; | |
r=1; | |
$fn=25; | |
for (a = [0:2], b = [a + 1:3]) hull() { | |
translate(R*v[a]) sphere(r); | |
translate(R*v[b]) sphere(r); | |
} |
View tetrahedron.py
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
# store as eg. '/home/pi/tetrahedron.py', then execute in FreeCad Python console by: | |
# exec(open('/home/pi/tetrahedron.py').read()) | |
import FreeCAD,FreeCADGui | |
import Part | |
import math | |
if FreeCAD.ActiveDocument == None: | |
FreeCAD.newDocument() | |
View planar_face_traversal.cpp
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
//======================================================================= | |
// Copyright 2007 Aaron Windsor | |
// | |
// Distributed under the Boost Software License, Version 1.0. (See | |
// accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
//======================================================================= | |
// Replaced hardcoded example graph by code to read fulgen.c output; here C60 fulleren: | |
// $ ~/plantri52/fullgen 60 ipr code 6 stdout 2>/dev/null | ./planar_face_traversal | |
//======================================================================= |
View mjpeg_fps
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
#!/bin/bash | |
host=$1 | |
port=$2 | |
get="GET /?action=stream HTTP/1.1\r\nConnection: Keep-Alive\r\n\r" | |
( | |
read -r prev | |
read -r line | |
mi=$(echo "1/(${line}-${prev})" | bc -ql) | |
ma=${mi} | |
su=${mi} |
View isPrime.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
// GatewayScript script (IBM DataPower Gateways) that tests passed | |
// number "num" for being a prime slowly, via regexp match + reports runtime | |
// | |
var sm = require('service-metadata'); | |
session.input.readAsJSON(function (error, num) { throwIf(error); | |
var t0 = sm.timeElapsed; | |
var iP = isPrime(num); | |
var t1 = sm.timeElapsed; | |
session.output.write(iP+" ("+(t1-t0)/1000.0+"s)"); |
NewerOlder