Skip to content

Instantly share code, notes, and snippets.

' Okay, so this isn't a great example and because it's so simple it's a bit unfair to the
' object-oriented one. But hopefully it gets the gist across.
' Here's a made-up class with only one important method that does a tiny bit of calculation, in
' a very object-oriented, stateful way:
Public Class Blah
Private x As Integer
Private y As Integer
@nickknw
nickknw / gist:3810499
Created October 1, 2012 09:15
Attempt at understanding the Y combinator
; http://www.dreamsongs.com/Files/WhyOfY.pdf
(define Y (lambda (f)
(let ((g (lambda (h)
(lambda (x) ((f (h h)) x)))))
(g g))))
; I understand it up to here.
; But then we have this:
@nickknw
nickknw / gist:3475151
Created August 26, 2012 06:39
Flashpunk Text attempts
var text:Text = new Text("blah blah");
var textEntity:Entity = new Entity(0, 0, text);
add(textEntity);
var text2:Text = new Text("yes yes");
addGraphic(text2);
@nickknw
nickknw / gist:2855830
Created June 1, 2012 23:46
Math riddle: 4 = 3
Theorem: 3=4
Proof:
Suppose:
a + b = c
This can also be written as:
4a - 3a + 4b - 3b = 4c - 3c
After reorganizing:
@nickknw
nickknw / gist:2307907
Created April 5, 2012 04:24
Odd prolog syntax
% Following code sample from 'Higher Order Logic Programming In Prolog' by Lee Naish
% www.csee.umbc.edu/771/papers/mu_96_02.pdf
% insertion sort (simple version)
isort([], []).
isort(A.As, Bs) :-
isort(As, Bs1),
isort(A, Bs1, Bs).
% insert number into sorted list
@nickknw
nickknw / gist:1141181
Created August 12, 2011 00:32
some typical gvim -V9 output
could not source "$VIM\vimrc"
sourcing "$HOME\_vimrc"
Searching for "filetype.vim" in "C:\Documents and Settings\nknowlson/vimfiles,C:\Program Files\Vim/vimfiles,C:\Program Files\Vim\vim73,C:\Program Files\Vim/vimfiles/after,C:\Documents and Settings\nknowlson/vimfiles/after"
Searching for "C:\Documents and Settings\nknowlson/vimfiles\filetype.vim"
Searching for "C:\Program Files\Vim/vimfiles\filetype.vim"
Searching for "C:\Program Files\Vim\vim73\filetype.vim"
line 2: sourcing "C:\Program Files\Vim\vim73\filetype.vim"
Searching for "ftdetect/*.vim" in "C:\Documents and Settings\nknowlson/vimfiles,C:\Program Files\Vim/vimfiles,C:\Program Files\Vim\vim73,C:\Program Files\Vim/vimfiles/after,C:\Documents and Settings\nknowlson/vimfiles/after"
Searching for "C:\Documents and Settings\nknowlson/vimfiles\ftdetect/*.vim"