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 qa.deaf | |
(:use [clojure.contrib | |
[server-socket :only [create-server]] | |
[duck-streams :only [reader writer]]])) | |
(def port 6662) |
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
(defembedded Grade | |
[:scored | |
:possible | |
:percentage]) | |
(defentity Scorecard | |
[#_ :questionnaire-id ;not needed? use client's questionnaire-id | |
#_ :questionnaire-title ;also not needed? | |
:operator {:type Employee} | |
:evaluator {:type Employee} |
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
;before | |
(ns slideshow.core | |
(:use [slideshow.images] | |
[slideshow.utils] | |
[net.cgrand.moustache :only [app]] | |
[hiccup.core :only [html]] | |
[hiccup.page-helpers :only [include-js include-css]] | |
[ring.adapter.jetty :only [run-jetty]] | |
[ring.middleware | |
[params :only [wrap-params]] |
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 in-range [start end d] | |
(not (or (.before d start) | |
(.after d end)))) |
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
Assert failed: (string? q-title) | |
[Thrown class java.lang.AssertionError] | |
Restarts: | |
0: [QUIT] Quit to the SLIME top level | |
Backtrace: | |
0: qa.setup$make_client.invoke(setup.clj:40) | |
1: clojure.lang.AFn.applyToHelper(AFn.java:180) | |
2: clojure.lang.AFn.applyTo(AFn.java:151) |
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 lower-key [x] | |
(if (or (string? x) (keyword? x)) | |
(-> x name .toLowerCase keyword) | |
x)) | |
(defn map-keys | |
"applies f to each key of m. also to keys of m's vals and so on." | |
[f m] | |
(zipmap |
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 xls-report | |
[headers rows] | |
(str | |
(join "\t" headers) | |
(apply str | |
(for [r rows] | |
(str "\n" | |
(join "\t" r)))))) | |
(defn employee-display [emp] |
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
<?php | |
session_start(); | |
$db = mysql_connect("localhost", "bdag", "bdag") or die("Could not connect."); | |
if(!$db) | |
die("no db"); | |
if(!mysql_select_db("bdaginventory",$db)) |
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 18 and 67 in project euler | |
(defn max-path-sum | |
"give it a vector of vectors that form a triangle" | |
([t] (max-path-sum t (- (count t) 2) (t (dec (count t))))) | |
([t top bot] | |
(if (> top 0) | |
(max-path-sum | |
t | |
(dec top) | |
(vec |
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 nodes | |
{:k {:neighbors [:kaet] :activation 0.2} | |
:ae {:neighboars [:kaet] :activation 0.2} | |
:t {:neighbors [:kaet] :activation 0.2} | |
:kaet {:neighbors [:k :ae :t :cat] :activation 0.2} | |
:cat {:neighbors [:kaet] :activation 0.2}}) | |
(map #(:activation (% nodes)) (-> nodes :kaet :neighbors)) |