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
;; Now, replace the loop by more telling operations. | |
(defn tarjan | |
"Returns the strongly connected components of a graph specified by its nodes | |
and a successor function succs from node to nodes. | |
The used algorithm is Tarjan's one." | |
[nodes succs] | |
(letfn [(sc [env node] | |
; env is a map from nodes to stack length or nil, nil means the node is known to belong to another SCC | |
; there are two special keys: ::stack for the current stack and ::sccs for the current set of SCCs |
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 smm.core | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:require [clojure.core.logic.fd :as fd])) | |
;;; S E N D | |
;;; + M O R E | |
;;; --------- | |
;;; M O N E Y |
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
;; core.logic solution for "Klondike" puzzle: | |
;; http://www.futilitycloset.com/2014/01/27/back-from-the-klondike/ | |
;; unfortunately, on the real problem it dies with OutOfMemoryError. | |
;; but theoretically it works :) | |
(ns klondike.core | |
(:refer-clojure :exclude [== !=]) | |
(:require [clojure.core.logic :refer [run == != fresh appendo conde all fail project]] | |
[clojure.core.logic.fd :as fd])) |
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
#!/bin/bash | |
# arXiv uses an outdated TexLive distribution. This script is used to package | |
# all neccesary files so my paper can be compiled on arXiv... | |
# path to the texlive distribution | |
TEXLIVE=/usr/local/texlive/2016 | |
# prepare the diretory for my submission | |
rm arXiv-package.zip |
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 make-change | |
(:refer-clojure :exclude [==]) | |
(:require [clojure.core.logic :refer :all] | |
[clojure.core.logic.fd :as fd])) | |
(def common-us-coins | |
{:penny 1 | |
:nickel 5 | |
:dime 10 | |
:quarter 25}) |