Skip to content

Instantly share code, notes, and snippets.

tangentstorm tangentstorm

Block or report user

Report or block tangentstorm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@koo5
koo5 / source.txt
Created Nov 22, 2012
"The Amazing Interactive Turing Machine" by "J.D. Clemens"
View source.txt
"The Amazing Interactive Turing Machine" by "J.D. Clemens"
Section 1 - Bibliographic Data
The story headline is "An Interactive Waste of Time".
The story genre is "Other".
The story description is "You have almost reached the end of your shift. All that remains is to clean one final room, the control room for that weird contraption being built by the scientists here. Carrying your usual equipment, you open the door and step into... The Amazing Interactive Turing Machine!"
Release along with source text and a website.
@emmanuel
emmanuel / file.sql
Created Jun 2, 2011
Closure Table operations SQL fragments
View file.sql
-- Retrieve descendants
-- ====================
-- retrieve descendants of #4
SELECT c.*
FROM Comments AS c
JOIN TreePaths AS t ON c.comment_id = t.descendant
WHERE t.ancestor = 4;
-- Retrieve ancestors
@jpjacobs
jpjacobs / som.ijs
Last active Feb 29, 2016
Kohonen SOM
View som.ijs
NB. Self-Organising map
require 'math/lapack/geev'
require 'tables/csv'
require 'viewmat'
NB. closeall_jviewmat_ ''
NB. parameters:
N =: 30 NB. side of neuron map. (N -> (*:N) neurons)
ntrain =: 25 NB. number of training samples per class
niter =: 10000 NB. number of iterations
'a0 an' =: 25 1 NB. Starting and ending learning factor
View j-vs-hs.md
h> (map sum)[[0..n]|n<-[0..10]
j] +/"1 i."0 >:i.11


j] +~^:5]1
h> let rfx f y = f y y ; pow = (\n f -> if n == 0 then id else f . pow (n-1) f) in pow 5 (rfx (+)) 1 

j] +/~i.4
View serial.go
type Message struct {
type string
midiData [3]byte
sysexData[255]byte
sysexLen int
}
func NewBoard() *Board {
b := &Board{}
// Start the message loops
@alexaltair
alexaltair / Today's Learning.md
Last active Dec 18, 2015
An exploration of infinite lists.
View Today's Learning.md

The first thing that really surprised me today was the flexibility of Ruby's shovel operator, <<. A student in the class had tried the following:

a = [0]
a << a

What do you think a is now? I was sure it would be [0, [0]]. But lo and behold, Ruby sparkles;

a = [0]
a << a
@tangentstorm
tangentstorm / objpas-lexer.txt
Created Feb 27, 2013
Lexer DFA for object pascal
View objpas-lexer.txt
[[a[nd
|rray
|s
|sm]
|b[egin]
|c[ase
|lass
|onst[
|ructor]]
|d[e[structor
@tangentstorm
tangentstorm / FORLOOP.rx
Last active Dec 11, 2015
Talk about "build one to throw away"
View FORLOOP.rx
## OBERON SYNTAX TO COMPILE:
FOR x := start TO goal BY step DO
block
END;
## StringTemplate ( generating retro code ):
for_stmt(id, beg, end, step, block) ::= <<
( FOR ) <id>
@tangentstorm
tangentstorm / likstromsnat.hs
Last active Oct 9, 2015
a little electronics problem
View likstromsnat.hs
{-
| a dumb little circuit simulator in haskell
| by tangentstorm, 2012/08/22
|
| This basically just calculates values using Ohm's law.
| it (probably?) only works for simple circuits where there
| is a single path from the power source to each node, and
| from each node back to the power source.
|
| many thanks to quicksilver and Axman6 on #haskell for advice
@ik5
ik5 / dynamic_method.pas
Created Jun 18, 2012
How dynamically execute a method in Object Pascal Class
View dynamic_method.pas
{$mode objfpc}{$M+}
program test;
type
TMyClass = class
procedure SayHi;
end;
procedure TMyClass.SayHi;
begin
You can’t perform that action at this time.