- Summary
- Example programs
- Updated (?) edit.k
- ~2014 older version that has more info
- The project has been running since at least 2012
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
Video tutorial of this gist file : https://www.youtube.com/watch?v=kmT-z2lqEPQ | |
Used web UI commit hash id: a9eef1fbb1dcdce4f0eb0b8e0f79dcd4c96713e1 | |
Used ControlNet commit hash id : 241c05f8c9d3c5abe637187e3c4bb46f17447029 | |
git checkout a9eef1fbb1dcdce4f0eb0b8e0f79dcd4c96713e1 | |
git checkout master |
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
;;; Fractional set cover solver with adahedge for the dual surrogate multiplers. | |
(defpackage "FRACTIONAL-SET-COVER" | |
(:use "CL")) | |
(in-package "FRACTIONAL-SET-COVER") | |
(deftype dvec () `(simple-array double-float 1)) | |
(defstruct tour | |
(index (error "index must be provided") |
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
# LVDB - LLOOGG Memory DB | |
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]> | |
# All Rights Reserved | |
# TODO | |
# - cron with cleanup of timedout clients, automatic dump | |
# - the dump should use array startsearch to write it line by line | |
# and may just use gets to read element by element and load the whole state. | |
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
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 firstshot.chessknightmove | |
(:refer-clojure :exclude [== >= <= > < =]) | |
(:use clojure.core.logic | |
clojure.core.logic.arithmetic)) | |
(defn knight-moves | |
"Returns the available moves for a knight (on a 8x8 grid) given its current position." | |
[x y] | |
(let [xmax 8 ymax 8] | |
(run* [q] |
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
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
A hopefully short and concise explanation as to how Clojure deals with Objects. If you already write Clojure, this isn't for you.
You know what an Interface is if you write/read Java or PHP 5+. In Clojure it might be called defprotocol.
user> (defprotocol IABC
(also-oo [this])
(another-fn [this x]))
IABC
Basic unit type:
λ> replTy "()"
() :: ()
Basic functions:
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 '[clojure.core.async :as a]) | |
(def xform (comp (map inc) | |
(filter even?) | |
(dedupe) | |
(flatmap range) | |
(partition-all 3) | |
(partition-by #(< (apply + %) 7)) | |
(flatmap flatten) | |
(random-sample 1.0) |
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 shades.lenses) | |
; We only need three fns that know the structure of a lens. | |
(defn lens [focus fmap] {:focus focus :fmap fmap}) | |
(defn view [x {:keys [focus]}] (focus x)) | |
(defn update [x {:keys [fmap]} f] (fmap f x)) | |
; The identity lens. | |
(defn fapply [f x] (f x)) | |
(def id (lens identity fapply)) |
NewerOlder