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
~/code/labrepl(master⚡)$ lein deps | |
Downloading: com/lowagie/itext/1.4/itext-1.4.pom from clojure-releases | |
Downloading: com/lowagie/itext/1.4/itext-1.4.pom from clojure | |
Downloading: com/lowagie/itext/1.4/itext-1.4.pom from clojure-snapshots | |
Downloading: com/lowagie/itext/1.4/itext-1.4.pom from clojars | |
Downloading: com/lowagie/itext/1.4/itext-1.4.pom from central | |
Downloading: com/lowagie/itext/1.4/itext-1.4.jar from clojure-releases | |
Downloading: com/lowagie/itext/1.4/itext-1.4.jar from clojure | |
Downloading: com/lowagie/itext/1.4/itext-1.4.jar from clojure-snapshots | |
Downloading: com/lowagie/itext/1.4/itext-1.4.jar from clojars |
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
An error has occurred while processing the Maven artifact tasks. | |
Diagnosis: | |
Unable to resolve artifact: Missing: | |
---------- | |
1) com.lowagie:itext:jar:1.4 | |
Try downloading the file manually from the project website. | |
Then, install it using the command: |
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 simpleweb | |
(:gen-class) | |
(:use compojure.core | |
ring.adapter.jetty) | |
(:require [compojure.route :as route])) | |
(defroutes greeter | |
(GET "/" [] "<h1>test</h1>") | |
(route/not-found "not found")) | |
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
(defproject cljservice "1.0.0-SNAPSHOT" | |
:description "A Compojure 'Hello World' application" | |
:dependencies [[org.clojure/clojure "1.2.0-beta1"] | |
[org.clojure/clojure-contrib "1.2.0-beta1"] | |
[compojure "0.4.1"] | |
[ring/ring-jetty-adapter "0.2.3"]] | |
:main simpleweb) | |
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
rcov -Itest --rails test/functional/*.rb test/unit/*.rb |
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 seen-primes (atom [])) | |
;; BUG: if composite c is larger than any p in known-primes-atom, | |
;; and (rem c p) != 0 for all p, then c would be seen as a prime, though | |
;; it is a composite number. | |
(defn memoized-prime? [known-primes-atom n] | |
(if (< n 2) | |
false | |
(every? #(not (zero? (rem n %))) | |
(for [d @known-primes-atom :when (< (* d d) n)] d)))) |
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
class A { | |
public void publ() { | |
this.priv(); | |
} | |
private void priv() { | |
System.out.println("A PRIVATE"); | |
} | |
} | |
class B extends A { |
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
class Singleton(object): | |
def __new__(cls, *p, **k): | |
if not '_the_instance' in cls.__dict__: | |
cls._the_instance = object.__new__(cls) | |
return cls._the_instance | |
class Test(Singleton): | |
def __init__(self): | |
pass |
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
class Clown(object): | |
def __init__(self, name): | |
self.name = name | |
def nice_hi(self): | |
return "Helloooo " + self.format_name() | |
def format_name(self): | |
return self.name + " (the clown)" |
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
class Clown(object): | |
def __init__(self, name): | |
self.name = name | |
def nice_hi(self): | |
return "Helloooo " + self.__format_name() | |
def __format_name(self): # mangled to _Clown__format_name() | |
return self.name + " (the clown)" |