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
<Resource name="jdbc/QuoteDB" auth="Container" type="javax.sql.DataSource" | |
maxActive="100" maxIdle="30" maxWait="10000" username="SA" password="" | |
driverClassName="org.hsqldb.jdbc.JDBCDriver" url="jdbc:hsqldb:hsql://localhost:9001/" /> |
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
public class Marker { | |
public String color; | |
public String tip; | |
public Marker(String color, String tip) { | |
this.color = color; | |
this.tip = tip; | |
} | |
public void write() { |
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
(define-key input-decode-map "\e[1;10A" [M-S-up]) | |
(define-key input-decode-map "\e[1;10B" [M-S-down]) | |
(define-key input-decode-map "\e[1;10C" [M-S-right]) | |
(define-key input-decode-map "\e[1;10D" [M-S-left]) | |
;(define-key input-decode-map "\e[1;9A" [M-up]) | |
;(define-key input-decode-map "\e[1;9B" [M-down]) | |
;(define-key input-decode-map "\e[1;9C" [M-right]) | |
;(define-key input-decode-map "\e[1;9D" [M-left]) |
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
upstream myapp { | |
server 127.0.0.1:8000; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
proxy_pass http://myapp; | |
proxy_read_timeout 180; |
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 jaspertest.core | |
(:import [net.sf.jasperreports.engine JasperFillManager JasperExportManager JasperCompileManager]) | |
(:require [clojure.java.io :as io])) | |
(defn java-hashmap [results-map] | |
(let [hashmap-reducer (fn [m [k v]] (doto m (.put (name k) v)))] | |
(reduce hashmap-reducer (java.util.HashMap.) results-map))) | |
(def mock-data |
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
public class Game { | |
// https://gist.github.com/orb/ | |
public static void main(String[] args) { | |
char[][] board = new char[20][40]; | |
initBoard(board); | |
int x = 5; | |
int y = 5; | |
int xspeed = 1; | |
int yspeed = -1; |
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
-- exercise 1 | |
toDigitsRev n = if (n <= 0) | |
then [] | |
else (n `mod` 10) : (toDigitsRev (n `div` 10)) | |
toDigits = reverse . toDigitsRev | |
-- exercise 2 |
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
;; http://gigasquidsoftware.com/blog/2014/11/13/clojure-fizzbuzz-without-conditionals | |
(defn fb [n] | |
(or (->> (map #(str %1 %2) | |
(cycle [nil nil "fizz"]) (cycle [nil nil nil nil "buzz"])) | |
(take n) | |
last | |
not-empty) | |
n)) |
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
;; austin clojure meetup hacking | |
;; ---------------------------------------- | |
;; just merge 2 seqs | |
(defn merge2 [s1 s2] | |
(if (seq s1) | |
(when (seq s2) | |
(let [i1 (first s1) |
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
(defmulti fact1 identity) | |
(defmethod fact1 0 [_] 1) | |
(defmethod fact1 :default [n] (* n (fact1 (dec n)))) | |
(defmulti fizzbuzz | |
(fn [n] | |
[(zero? (mod n 3)) | |
(zero? (mod n 5))])) |