\s+ #ignore whitespace
{ "{"
} "}"
[ "["
] "]"
, ","
This file contains hidden or 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
| Object.prototype.toString = function() { | |
| var key, result, val; | |
| result = ["{"]; | |
| for (key in this) { | |
| val = this[key]; | |
| result = result.concat(key, ":", val, ","); | |
| } | |
| result.pop(); | |
| return (result.concat("}")).join(""); | |
| }; |
This file contains hidden or 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
| genpair = (num)-> | |
| return [] if num<=1 | |
| result = [] | |
| for i in [0..num-2] | |
| result = result.concat ([i,n] for n in [i+1..num-1]) | |
| return result |
This file contains hidden or 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
| //114.34.230.1 | |
| //192.168.1.100 | |
| var http = require('http'); | |
| var fs = require('fs'); | |
| var url = require('url'); | |
| http.createServer(function (req, res) { | |
| var pathname = url.parse(req.url).pathname; | |
| console.log(pathname); | |
| if(pathname=='/') |
This file contains hidden or 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
| (defun pin (atm) | |
| (cond | |
| ((eql atm 'CA) 'P6);seg14 display | |
| ((eql atm 'CB) 'N4) ((eql atm 'CC) 'V5) ((eql atm 'CD) 'T5) ((eql atm 'CE) 'U7) | |
| ((eql atm 'CF) 'R3) ((eql atm 'CG1) 'N5) ((eql atm 'CG2) 'R5) ((eql atm 'CH) 'T3) ((eql atm 'CJ) 'T3) | |
| ((eql atm 'CK) 'V4) ((eql atm 'CL) 'V7) ((eql atm 'CM) 'R7) ((eql atm 'CN) 'T7) ((eql atm 'DP) 'U5) | |
| ((eql atm 'S1) 'N3);push button | |
| ((eql atm 'S2) 'P4) ((eql atm 'S3) 'P3) ((eql atm 'S4) 'L6) ((eql atm 'S5) 'M5) | |
| ((eql atm 'S6) 'U2) ((eql atm 'S7) 'U1) ((eql atm 'S8) 'T2) | |
| ((eql atm 'D1) 'K4);LED |
This file contains hidden or 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
| #| | |
| usage: | |
| (funcall (self-lambda (n) (if (> n 0) | |
| (self (- n 1)) | |
| n)) | |
| 5) | |
| |# | |
| (defmacro self-lambda (param-lst &rest body) | |
| (let ((fn (gensym))) |
This file contains hidden or 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
| ;longer,filter,group (p47 | |
| ;flatten,prune (p49 | |
| ;find2,before,after,duplicate,split-if (p50 | |
| ;most,best,mostn (p52 | |
| ;map0-n,map1-n,mapa-b,map->,mappend,mapcars,rmapcar (p54 | |
| ;readlist,prompt,break-loop (p56 | |
| ;mkstr,symb,reread,explode (p58 | |
| ;memoize (p65 | |
| ;rfind-if (p73 |
This file contains hidden or 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
| aaaaa | |
| bbb |
This file contains hidden or 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
| >(defmacro add-to-list (a lst) | |
| `(setf ,lst (cons ,a ,lst))) | |
| >(setf lst '(1 2)) ; lst是一個變數,值為(1 2)這個list | |
| >(setf a 'lst) ; a是一個變數,值為#:LST這個symbol | |
| >(cons 3 lst) ;lst先被evaluate | |
| (3 1 2) | |
| >lst | |
| (1 2) ;lst的值不會變 |
This file contains hidden or 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
| (setf smdl | |
| (quote | |
| ;-----------write SMDL here and command (compile-it "filename")---------------------------- | |
| ;this is and example | |
| (state-machine | |
| (clock "clk") | |
| (init-state A) | |
| (triggerd | |
| ("tri" | |
| "n_sig1" "n_sig2")) |
OlderNewer