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
(for [class | |
(sort (re-seq #"[-a-zA-Z0-9.]*\.jar" (System/getProperty "java.class.path" ".")))] | |
(println class)) |
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
;; http://stackoverflow.com/questions/4830900/how-do-i-find-the-index-of-an-item-in-a-vector/4831170#4831170 | |
;; CSV File: | |
;; first-name, last-name, phone <- headers (column names) | |
;; Ambrose, BS, 234333 | |
;; Chris, Squire, 4333 | |
;; 1. Extract to vector |
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
# Set up the prompt | |
autoload -Uz promptinit | |
promptinit | |
prompt walters | |
# Use emacs keybindings even if our EDITOR is set to vi | |
bindkey -e | |
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history: |
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
public class Dispatch { | |
public static void main(String[] args) { | |
// Start here | |
// Java uses single dispatch. | |
// | |
// Single dispatch is based on the runtime "type" of d, which is Dog. | |
Dog d = new Dog(); |
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
<collection xmlns:ands="http://www.ands.org.au/ontologies/ns/0.1/VITRO-ANDS.owl#" | |
xmlns:bibo="http://purl.org/ontology/bibo/" | |
xmlns:foaf="http://xmlns.com/foaf/0.1/" | |
xmlns:dcterms="http://purl.org/dc/terms/" | |
xmlns:vivo="http://vivoweb.org/ontology/core#" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:skos="http://www.w3.org/2004/02/skos/core#" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:event="http://purl.org/NET/c4dm/event.owl#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" |
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 logic-test.core | |
(:refer-clojure :exclude [inc reify ==]) | |
(:use clojure.core.logic.prelude) | |
(:use clojure.core.logic.minikanren)) | |
(defn secondo [l x] | |
(exist [r] | |
(resto l r) | |
(firsto r x))) |
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
(run out-str | |
(js-statement out-str "println(\"asdf\");")) | |
#<StackOverflowError java.lang.StackOverflowError> |
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
(run 4 [q] | |
(exist [a t] | |
(typedo [[:f :- a] | |
[:g :- :int]] | |
q | |
:int))) | |
;=> (:f | |
; :g | |
; [:apply :f :g] |
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 logic-introduction.core | |
(:refer-clojure :exclude [inc reify ==]) | |
(:use [clojure.core.logic minikanren prelude nonrel match disequality])) | |
(defn geto [key env value] | |
(matche [env] | |
([[[key :- value] . _]]) | |
([[_ . ?rest]] (geto key ?rest value)))) | |
(defn typedo [context exp resulttype] |
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 logic-introduction.core | |
(:refer-clojure :exclude [inc reify ==]) | |
(:use [clojure.core.logic minikanren prelude nonrel match disequality])) | |
(defn geto [key env value] | |
"Succeed if type association [key :- value] is found in vector env." | |
(matche [env] | |
([[[key :- value] . _]]) | |
([[_ . ?rest]] (geto key ?rest value)))) |
OlderNewer