This file contains hidden or 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
| (deftype Foo [] | |
| Object | |
| (equals [this x] | |
| (.. this getClass (isInstance x)))) | |
| (let [f (Foo.)] | |
| (.equals f f)) ; false, creates problems when looking up items in map |
This file contains hidden or 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 second-post.postgres | |
| (:use aleph) | |
| (:require [clojure.contrib.sql :as sql]) | |
| (:import [org.apache.commons.dbcp BasicDataSource])) | |
| (def pool-size 10) ; or match expected number of threads | |
| (def ds | |
| (doto (BasicDataSource.) | |
| (.setDriverClassName "org.postgresql.Driver") |
This file contains hidden or 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 second-post.mysql | |
| (:use aleph) | |
| (:require [clojure.contrib.sql :as sql]) | |
| (:import [org.apache.commons.dbcp BasicDataSource])) | |
| (def pool-size 10) ; or match expected number of threads | |
| (def ds | |
| (doto (BasicDataSource.) | |
| (.setDriverClassName "com.mysql.jdbc.Driver") |