- Program Synthesis using miniKanren
This file contains 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
"X1. A drinks dispenser has two buttons labelled ORANGE and | |
LEMON. The actions of pressing the two buttons are /set-orange/ and | |
/set-lemon/. The actions of dispensing a drink are /orange/ and | |
/lemon/. The choice of drink that will be dispensed is made by | |
pressing the corresponding button. Before any button is pressed, no | |
drink will be dispensed." | |
(declare orange lemon) | |
(def c (chan)) |
This file contains 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
(ns vending-machine.core | |
(:require [cljs.core.async | |
:refer [<! >! chan timeout]] | |
[figwheel.client :as figwheel | |
:include-macros [true]] | |
[om.core :as om | |
:include-macros true] | |
[sablono.core :as html | |
:refer-macros [html]]) | |
(:require-macros [cljs.core.async.macros |
This file contains 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
(ns arith.core | |
(:require [clojure.core.typed :refer [ann defalias Rec U Val Int]] | |
[clojure.core.match :refer [match]])) | |
(defalias Expr | |
(Rec [Expr] | |
(U '[(Val :zero)] | |
'[(Val :succ) Expr]))) | |
(ann evaluate [Expr -> Int]) |
This file contains 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
upstream http_backend { | |
server localhost:3000; | |
keepalive 32; | |
} | |
server { | |
location /ralphedwards/ { | |
proxy_pass http://http_backend/; | |
proxy_http_version 1.1; | |
proxy_set_header Connection ""; |
This file contains 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
framework 'Cocoa' | |
require 'rubygems' | |
require 'sucker' | |
application = NSApplication.sharedApplication | |
worker = Sucker.new( | |
:locale => :us, | |
:key => aws_key, |
This file contains 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
require 'java' | |
require 'clojure' | |
module Clojure | |
include_package 'clojure.lang' | |
end | |
foo = Clojure::PersistentHashMap.create(:a, 1) | |
# => {:a=>1} | |
foo.assoc(:e, 5) |
This file contains 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
(defn stress-ref | |
[r] | |
(let [slow-tries (atom 0)] | |
(future | |
(dosync | |
(swap! slow-tries inc) | |
(Thread/sleep 200) | |
@r) | |
(println (format "r is: %s, history: %d, after: %d tries" | |
@r (ref-history-count r) @slow-tries))) |
This file contains 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
+/Users/zerokarmaleft/.sm/core/cli/shell/dev/functions:69 sm_development_setup():66 > git clone https://github.com/sm/sm-extensions extensions | |
Cloning into extensions... | |
fatal: https://github.com/sm/sm-extensions/info/refs not found: did you run git update-server-info on the server? | |
+/Users/zerokarmaleft/.sm/core/cli/shell/dev/functions:70 sm_development_setup():67 > __sm.log.error 'There was an __sm.log.error cloning extensions repository from https://github.com/sm/sm-extensions into /Users/zerokarmaleft/projects/sm/extensions.' | |
+/Users/zerokarmaleft/.sm/core/sm/shell/log/functions:343 __sm.log.error():2 > printf 'ERROR(__sm.actions.call): There was an __sm.log.error cloning extensions repository from https://github.com/sm/sm-extensions into /Users/zerokarmaleft/projects/sm/extensions.\n' | |
ERROR(__sm.actions.call): There was an __sm.log.error cloning extensions repository from https://github.com/sm/sm-extensions into /Users/zerokarmaleft/projects/sm/extensions. | |
+/Users/zerokarmaleft/.sm/core/sm/shell/log/func |
This file contains 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
#include <iostream> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <fstream> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
ofstream outfile; |