To run this you need node and the PEG.js module installed.
To create the parser.js file, run:
pegjs grammar.peg parser.js
Now to compile the xmaslang source, run:
node parser.js program.xmas > programm.js
insert : Ord a => a -> Vect n a -> Vect (1 + n) a | |
insert x [] = [x] | |
insert x (y::ys) with (x <= y) | |
| True = x::y::ys | |
| False = y::insert x ys | |
isort : Ord a => Vect n a -> Vect n a | |
isort [] = [] | |
isort (x::xs) = insert x (isort xs) |
#lang racket | |
(require (only-in racket | |
(+ old+))) | |
(define (dechurch n) | |
(n (λ (i) (old+ i 1)) 0)) | |
(define (zero f x) | |
x) |
/* | |
* Coffetimer (safetytimer) | |
* | |
* Activated when button (pin 4) is grounded. | |
* Connected to a RF - remote control on pin 5 and 6 | |
* via a couple of transistors, controling the | |
* coffemakers power outlet. | |
* | |
* */ |
To run this you need node and the PEG.js module installed.
To create the parser.js file, run:
pegjs grammar.peg parser.js
Now to compile the xmaslang source, run:
node parser.js program.xmas > programm.js
-++/|+(5)++(3)(1)(1)<x+(2)x>$->#(2)<x(1)>s(1)<i+si>+||#(5)<x->x<y+$xz(100)<k-zk>y>><x$xa(0)<b+ab>>|-$->#(10)<x#x>x(0)<y+x$yz(0)<y+yz>>$->->#(30)<x+x(1)><x%$->#(10)<a*a$=?->#<F?=F*(2)(4)<B*+FBB>[-(20)(15)](100000)>[|->#||(1)<x+(1)x><x+(1)x><x|(1)<x+(1)x>><r$rp(0)<q+pq>>]<i+(100)i><x>x(100)>A(0)<I+AI>>M(1)<b+Mb>x>C(0)<m+mC><x*(113)x>|||*|||(1)<x(1)><x+|(1)<x(1)>x><x*||(1)<x(1)><x+|(1)<x(1)>x>x>|||(1)<x(1)><x+|(1)<x(1)>x><x+||(1)<x(1)><x+||(1)<x(1)><x+|(1)<x(1)>x>x>x><x+|||(1)<x(1)><x+|(1)<x(1)>x><x+||(1)<x(1)><x+||(1)<x(1)><x+|(1)<x(1)>x>x>x>x><x+|*|||(1)<x(1)><x+|(1)<x(1)>x><x*||(1)<x(1)><x+|(1)<x(1)>x>x>|||(1)<x(1)><x+|(1)<x(1)>x><x+||(1)<x(1)><x+||(1)<x(1)><x+|(1)<x(1)>x>x>x><x+|||(1)<x(1)><x+|(1)<x(1)>x><x+||(1)<x(1)><x+||(1)<x(1)><x+|(1)<x(1)>x>x>x>x>x><x+||*|||(1)<x(1)><x+|(1)<x(1)>x><x*||(1)<x(1)><x+|(1)<x(1)>x>x>|||(1)<x(1)><x+|(1)<x(1)>x><x+||(1)<x(1)><x+||(1)<x(1)><x+|(1)<x(1)>x>x>x><x+|||(1)<x(1)><x+|(1)<x(1)>x><x+||(1)<x(1)><x+||(1)<x(1)><x+|(1)<x(1)>x>x>x>x><x+|*|||(1)<x(1)><x+|(1)<x(1)>x><x*||(1)< |
(ns shades.lenses) | |
; We only need three fns that know the structure of a lens. | |
(defn lens [focus fmap] {:focus focus :fmap fmap}) | |
(defn view [x {:keys [focus]}] (focus x)) | |
(defn update [x {:keys [fmap]} f] (fmap f x)) | |
; The identity lens. | |
(defn fapply [f x] (f x)) | |
(def id (lens identity fapply)) |
These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):
Install Raspbian - http://www.raspberrypi.org/downloads
Install the necessary dependecies:
sudo apt-get install git-core build-essential
(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)
# MAC manipulators | |
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
/*<?php | |
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
//\u000A\u002F\u002A | |
class PhpJava { | |
static function main() { | |
echo(//\u000A\u002A\u002F | |
"Hello World!"); | |
}} | |
//\u000A\u002F\u002A | |
PhpJava::main(); |
(Full description and list of commands at - https://npmjs.org/doc/index.html)
Make sure to export your local $PATH and prepand relative ./node_modules/.bin/: