Skip to content

Instantly share code, notes, and snippets.

~/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
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:
(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"))
(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)
rcov -Itest --rails test/functional/*.rb test/unit/*.rb
(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))))
class A {
public void publ() {
this.priv();
}
private void priv() {
System.out.println("A PRIVATE");
}
}
class B extends A {
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
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)"
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)"