- Make sure developer tools are installed.
- Get the source from Freshmeat.
- Run
tar xvfj ex-050325.tar.bz2 && cd ex-050325
. - Add
include <sys/ioctl.h>
to fileex.h
. - Run the following:
make install INSTALL=/usr/bin/install \
PREFIX=${HOME}/.local/ \
#!/bin/sh | |
# Usage: heroku-pg-dump-schema.sh HEROKU-APP-NAME DB-ENV-VAR-NAME SCHEMA-NAME | |
app=$1 | |
env_var=$2 | |
schema=$3 | |
db_url=`heroku config -s --app ${app} | grep ${env_var}` |
(defn delete-recursively [fname] | |
(let [func (fn [func f] | |
(when (.isDirectory f) | |
(doseq [f2 (.listFiles f)] | |
(func func f2))) | |
(clojure.java.io/delete-file f))] | |
(func func (clojure.java.io/file fname)))) |
tar xvfj ex-050325.tar.bz2 && cd ex-050325
.include <sys/ioctl.h>
to file ex.h
.make install INSTALL=/usr/bin/install \
PREFIX=${HOME}/.local/ \
// Solves problem 62 by iterating over all ints in increasing order | |
// and storing each in a map keyed by the lexigraphically-sorted | |
// cube of that number's digits. Repeat until storing an int results | |
// in the map key having five values associated with it. | |
// | |
// https://projecteuler.net/problem=62 | |
// | |
// It turns out big ints weren't necessary to solve the problem, | |
// but re-writing numerics code from regular to big numbers is | |
// a huge PITA, so it's better to start with math/big if you think |
package main | |
import "fmt" | |
func main() { | |
fmt.Printf("%d\n", iter(36, []int{25, 10, 5, 1})) // descending order, reverse of naive. | |
} | |
type Cache map[string]int |
;; Collection Iterators | |
;; Edwin Watkeys | |
;; May 22, 2020 | |
;; MIT Licensed | |
(define-library (iterator) | |
(import (scheme base) (scheme list) (srfi 111) (chibi generic)) | |
(export iterable? iterate map reduce next empty into done? | |
icons imake inext iempty imap-proc) |
;; Collection Iterators | |
;; Edwin Watkeys | |
;; May 22, 2020 | |
;; MIT Licensed | |
(define-library (iterator) | |
(import (scheme base) (scheme list) (srfi 111) (chibi generic)) | |
(export iterable? iterate map reduce next empty into done? | |
icons imake inext iempty imap-proc) |
;; Collection Iterators | |
;; Edwin Watkeys | |
;; May 22, 2020 | |
;; MIT Licensed | |
(define-library (iterator) | |
(import (scheme base) (scheme list) (srfi 111) (chibi generic)) | |
(export iterable? iterate map reduce next empty into done? | |
icons imake inext iempty imap-proc) |
(define-library (atomic-box-test) | |
(import (scheme base) (scheme write) (chibi test) (atomic-box) (srfi 18)) | |
(export run-tests) | |
(begin | |
(define (thread-spawn thunk) | |
(let ((t (make-thread thunk))) | |
(thread-start! t) | |
t)) |
;;; This is not a good use of macros. See below for an | |
;;; example implementation of COND. | |
(define-syntax proc-all | |
(syntax-rules () | |
((_ exp () body ...) | |
(begin body ...)) | |
((_ exp (match matches ...) body ...) | |
(unless (= exp match) (proc-all exp (matches ...) body ...))))) |