Skip to content

Instantly share code, notes, and snippets.

View aleph0ne's full-sized avatar
💭
I may be slow to respond.

Aleph 0ne aleph0ne

💭
I may be slow to respond.
View GitHub Profile
@aleph0ne
aleph0ne / crash_woo.txt
Created October 1, 2012 00:39
Crashy WooWave
Process: finalww1 [74825]
Path: /Applications/WooWave Sync Pro.app/Contents/MacOS/finalww1
Identifier: com.yourcompany.finalww1
Version: ???
Code Type: X86-64 (Native)
Parent Process: launchd [389]
User ID: 501
Date/Time: 2012-09-30 17:37:56.723 -0700
OS Version: Mac OS X 10.8 (12A269)
@aleph0ne
aleph0ne / lesson11.lsp
Created May 29, 2011 00:36
Causes LD problem: New Lessons in Lisp Eleven
#!/usr/bin/env newlisp
; causes test code from blog
;
(define (LD root test)
(setf root (explode (string " " root)))
(setf test (explode (string " " test)))
; other code goes here
(setf len-root (length root))
@aleph0ne
aleph0ne / get-friends.lsp
Created May 20, 2011 04:22
get-friends (LD Modified)
#!/usr/bin/newlisp
; A super-fast implementation of the Levenshtein Distance (Edit Distance)
; ;
; ; Requires:
; ; https://github.com/causes/puzzles/raw/master/word_friends/word.list
; ;
; ; http://en.wikipedia.org/wiki/Levenshtein_distance
; ;
; ; Pass in a word and get back a list
@aleph0ne
aleph0ne / mixed.lsp
Created May 18, 2011 07:17
Mixt Party Favors
#!/usr/bin/newlisp
; Input:
; The input file (party.txt) has 1000 lines with people id's and ages
; (you are id 0), a separator line "--", and the rest are lines that have the
; relationship information (a line with [user_id1] [user_id2] means user_id1 and
; user_id2 know each other).
; Output:
; For each goal you should have one line with the total number of favor
@aleph0ne
aleph0ne / FastEditDistance.lsp
Created May 10, 2011 01:41
Fast Edit Distance (Modified Levenshtein Distance)
#!/usr/bin/newlisp
; A super-fast implementation of the Levenshtein Distance (Edit Distance) algorithm
;
; Requires:
; https://github.com/causes/puzzles/raw/master/word_friends/word.list
;
; http://en.wikipedia.org/wiki/Levenshtein_distance
;
; Pass in a word and get back a list
;
; SHA
;
(global isLinux)
(setq isLinux (if (or (= 1 (sys-info 9)) (= 129 (sys-info 9))) true nil))
(setq SHA1 (import (if isLinux "libssl.so" "/usr/lib/libssl.dylib") "SHA1"))
@aleph0ne
aleph0ne / md5.lsp
Created May 5, 2011 06:36
md5 hash without C code
;
; Modified from the work of http://snippets.dzone.com/posts/show/2591
;
; (load "md5.lsp")
;
; Example:
; > (load "md5.lsp")
; (lambda (str) (md5-init) (md5-update str (length str)) (md5-final) (set 'result "")
; (for (i 0 15 1)
; (set 'result (append result (format "%02x" (md5-digest i))))) result)
@aleph0ne
aleph0ne / newLisp.Language.info
Created May 5, 2011 05:06
TextMate Changes to newLisp.bundle
{ scopeName = 'source.lsp';
comment = 'newLisp';
fileTypes = ( 'lsp', 'qwerty' );
foldingStartMarker = '^\((define(-macro)?)\s*?\(.+?\)$';
foldingStopMarker = '^(?!\((define(-macro)?)\s*?\(.+?\))';
patterns = (
{ name = 'storage.context.lsp';
match = '\b(\S+?):(\S+)\b';
},
{ match = '(?<=\(define-macro \()(\S+)\b';
@aleph0ne
aleph0ne / collatz.lsp
Created May 5, 2011 02:02
streamtech 100 (Collatz)
;
; http://streamtech.nl/problemset/100.html
; aka http://en.wikipedia.org/wiki/Collatz_conjecture
;
(define (collatz)
(println "Collatz Conjecture: low high (ENTER/RETURN to end)")
(until (= (set 'p (read-line)) "")
(set 'in (map int (parse p " ")) )
(set 'low (in 0) 'high (in 1))
#!/usr/bin/newlisp
;
; Two words are friends if they have a Levenshtein distance of 1.
; That is, you can add, remove, or substitute exactly one letter in
; word X to create word Y.
; A words social network consists of all of its friends, plus all of
; their friends, and all of their friends friends, and so on.
;
; Write a program to tell us how big the