Skip to content

Instantly share code, notes, and snippets.

(letrec ((monitor (lambda ()
(task-info)
(sleep 10000)
(monitor)))
(notify (lambda (prefix t)
(assert! `(notify ,prefix ,(random)))
(sleep t)
(notify prefix t)))
(listen (lambda ()
(let ((m (recv)))
;; Code:
'(* 2 (handle (raise (raise 3)) (lambda (e restart) (restart (* 2 e)))))
;; Compiled code:
'(let ((__handler96 (&uproc-error-handler))
(__cont95
(lambda (__value97)
(__MULT 2 __value97 (lambda (__value94) __value94)))))
(do (&set-uproc-error-handler!
(lambda (__error99 __restart98)
@Idorobots
Idorobots / idonteven.scm
Created July 21, 2015 14:24
I just lost my abbility to even...
;; Code:
'(letrec ((even? (lambda (x) (if (= 0 x) 't (odd? (- x 1)))))
(odd? (lambda (x) (if (= 0 x) 'n (even? (- x 1))))))
(even? 7))
;; Compiled code:
'(let ((__evenQUEST '()) (__oddQUEST '()))
(do (set!
__evenQUEST
(lambda (__x __cont1)
@Idorobots
Idorobots / gist:293ea077ab0d578cb16d
Created March 15, 2015 22:03
Formants blah blah blah
|------------+-------+--------+--------|
| samogłoska | F1 | F2 | F3 |
|------------+-------+--------+--------|
| a | 713.4 | 1202.3 | 2570.9 |
| | 623.5 | 1141.7 | 2423.0 |
| | 622.7 | 1175.4 | 2652.8 |
|------------+-------+--------+--------|
| e | 559.0 | 1665.1 | 2449.1 |
| | 546.8 | 1727.7 | 2521.8 |
| | 543.4 | 1737.3 | 2410.7 |
@Idorobots
Idorobots / file.d
Last active August 29, 2015 14:13
Graham scan
module graham;
import std.algorithm;
import std.array;
import std.math;
import std.conv;
struct Point {
double x;
double y;
(ns component.core
(:require [com.stuartsierra.component :as component]))
(defrecord AppConfig [file path]
component/Lifecycle
(start [this]
(println "Starting AppConfig!")
this)
@Idorobots
Idorobots / gist:ad4d749074f1d3715019
Last active August 29, 2015 14:06
PKGBUILD for emscripten-git
# Contributor: Vlad Kolotvin <vlad.kolotvin@gmail.com>
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
pkgname=emscripten-git
pkgver=11558
pkgrel=1
pkgdesc="LLVM-to-JavaScript compiler"
arch=('i686' 'x86_64')
url="http://emscripten.org"
license=('custom')
@Idorobots
Idorobots / gist:668e7c43bc1d8a2776a6
Created July 15, 2014 15:41
Parallella temp script
#!/bin/bash
raw=`cat /sys/bus/iio/devices/iio:device0/in_temp0_raw`
offset=`cat /sys/bus/iio/devices/iio:device0/in_temp0_offset`
scale=`cat /sys/bus/iio/devices/iio:device0/in_temp0_scale`
c_temp=`echo "scale=1;(($raw + $offset) * $scale) / 1000" | bc`
f_temp=`echo "scale=1;(($c_temp * 9) / 5) + 32" | bc`
echo
echo "Zynq Temp: $c_temp C / $f_temp F"
@Idorobots
Idorobots / gist:8d487e3bd43b44d31a33
Last active August 29, 2015 14:01
Simple TCP Echo client.
#include <signal.h>
#include <errno.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@Idorobots
Idorobots / gist:11405377
Last active August 29, 2015 14:00
Half-assed apriori attempt.
module apriori;
import std.stdio;
import std.string;
import std.conv;
bool contains(A, E)(A array, E element) {
foreach(E e; array) {
if(e == element) return true;
}