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 lab.indexes) | |
(defn fields-prefix? | |
"All fields of b are prefix of a" | |
[a b] | |
(= (set (take (count (:fields b)) (:fields a))) (set (:fields b)))) | |
(defn implies? | |
"Optimizations allowed by index a include ones allowed by index b (MySql)" | |
[a b] |
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
class Animal { | |
void action() { | |
bark(); | |
} | |
} | |
class Cat extends Animal { | |
@Override | |
void action() { | |
meow(); |
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
(defproject test-project "1.0-SNAPSHOT" | |
:description "Some description." | |
:url "http://example.com" | |
:dependencies [[org.clojure/clojure "1.2.1"] | |
[org.clojure/clojure-contrib "1.2.0"] | |
[compojure "0.6.2"] ; [ring "0.3.10"] | |
[ring/ring-jetty-adapter "0.2.3"] | |
[com.twinql.clojure/clj-apache-http "2.2.0"] | |
[match "0.2.0-SNAPSHOT"] | |
; [postgresql/postgresql "9.0-801.jdbc4"] |
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 clojuweb.core | |
(:use compojure.core) | |
(:require [compojure.route :as route] | |
[compojure.handler :as handler])) | |
(defroutes main-routes | |
(GET "/delay/:t" [t] | |
(try | |
(Thread/sleep (Long/parseLong t)) | |
"something" |
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
package petrglad; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.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 petrglad.shunting-yard | |
(use clojure.contrib.math | |
clojure.test)) | |
(def operation-tokens | |
(sorted-map-by | |
#(compare %2 %1) ; longer tokens first | |
")" 0 | |
"(" 1 | |
"+" 2 |
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
from pv.core import PSys, Log | |
from pysqlite2 import dbapi2 as sqlite | |
import os, time | |
class Root: | |
def __init__(self): | |
self.attributes = {} | |
self.dbConn = sqlite.connect(":memory:") | |
self.createInitialSchema() |
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
http://subclipse.tigris.org/update_1.8.x | |
http://download.eclipse.org/egit/updates | |
# testng: | |
http://beust.com/eclipse | |
http://ccw.cgrand.net/updatesite | |
# maven: | |
http://m2eclipse.sonatype.org/sites/m2e | |
# clojure | |
http://ccw.cgrand.net/updatesite/ |
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 petrglad.cell.cell | |
(:import (java.awt Color Graphics Dimension RenderingHints) | |
(java.awt.image BufferedImage) | |
(javax.swing JPanel JFrame))) | |
(def scale 7) | |
(def dim 100) | |
(defn fill-cell [#^Graphics g x c] | |
(doto g |
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
<plugin> | |
<groupId>org.bsc.maven</groupId> | |
<artifactId>maven-processor-plugin</artifactId> | |
<version>2.0.5</version> | |
<executions> | |
<execution> | |
<id>process</id> | |
<goals> | |
<goal>process</goal> | |
</goals> |
OlderNewer