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
/* $Id: superfish.css,v 1.3 2010/03/27 09:18:40 mehrpadin Exp $ */ | |
/*** ESSENTIAL STYLES ***/ | |
.sf-menu, .sf-menu * { | |
margin: 0; | |
padding: 0; | |
list-style: none; | |
} | |
.sf-menu { | |
line-height: 1.0; | |
z-index: 99; |
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
var fib, num; | |
fib = function(x) { | |
if (x > 2) { | |
return fib(x - 1) + fib(x - 2); | |
} | |
return x; | |
}; | |
console.log((function() { | |
var _results; | |
_results = []; |
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
(apply + | |
(filter #(or (= 0 (mod % 3)) | |
(= 0 (mod % 5))) | |
(range 1 1000))) |
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 f [col pos] | |
(loop [c col cnt 1 acc []] | |
(if (empty? c) | |
acc | |
(recur (rest c) (inc cnt) (if (= 0 (mod cnt pos)) | |
acc (conj acc (first c))))))) | |
(= (f [1 2 3 4 5 6 7 8] 3) [1 2 4 5 7 8]) | |
(= (f [:a :b :c :d :e :f] 2) [:a :c :e]) |
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-mode) | |
(define-key clojure-mode-map (kbd "C-c C-g") 'clojure-browse-function) | |
(defun clojure-browse-function () | |
(interactive) | |
(browse-url | |
(concat "http://clojuredocs.org/clojure_core/clojure.core/" | |
(format "%s" (symbol-at-point))))) |
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 simple-csp.core | |
( :refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defne arco [x y] | |
([:sa :wa]) | |
([:sa :nt]) | |
([:sa :q]) | |
([:sa :nsw]) | |
([:sa :v]) |
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 rubric.core) | |
(defn average | |
"Averages a set of scores" | |
[& scores] | |
(/ (apply + scores) (count scores))) | |
(defn weighted-average | |
"Calculates a total score from individual weighted results. | |
Expects pairs of <weight>, <score> whose weights add to 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
(def tree [:f [:b [:a nil nil] [:d [:c nil nil] [:e nil nil]]] [:g nil [:i [:h nil nil] nil]]]) | |
(fact | |
(depth-first-preorder tree) => [:f :b :a :d :c :e :g :i :h]) | |
;cheating? =) | |
(defn depth-first-preorder | |
"Perform a preorder traversal of a tree, depth-first." | |
[tree] | |
(filter #(not (nil? %)) (flatten tree))) |
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 foo.service | |
(:require [io.pedestal.service.http :as bootstrap] | |
[io.pedestal.service.http.route :as route] | |
[io.pedestal.service.http.body-params :as body-params] | |
[io.pedestal.service.http.route.definition :refer [defroutes]] | |
[ring.util.response :as ring-resp])) | |
(defn about-page | |
[request] | |
(ring-resp/response (format "Clojure %s" (clojure-version)))) |
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 tutorial.core | |
(:require [cljminecraft.bukkit :as bk] | |
[cljminecraft.blocks :as bl] | |
[cljminecraft.events :as ev] | |
[cljminecraft.entity :as ent] | |
[cljminecraft.player :as plr] | |
[cljminecraft.util :as util] | |
[cljminecraft.logging :as log] | |
[cljminecraft.config :as cfg] | |
[cljminecraft.commands :as cmd] |