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 net.experimentalworks.clojure.outdegree | |
(:import | |
(edu.kit.ipd.sonar.server.centralities Centrality Centrality$Type CentralityImpl) | |
(java.util HashMap)) | |
(:gen-class | |
:extends edu.kit.ipd.sonar.server.centralities.CentralityImpl)) | |
(defn -getType [this] Centrality$Type/NodeCentrality) | |
(defn -getName [this] "Outdegree (Clojure)") | |
(defn -getVersion [this] 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
public class OutdegreeCentrality extends CentralityImpl { | |
/** | |
* Return the Type of centrality. | |
* | |
* @return The type. | |
*/ | |
public Type getType() { | |
return Type.NodeCentrality; | |
} |
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
package net.experimentalworks.scala | |
import edu.kit.ipd.sonar.server._ | |
import edu.kit.ipd.sonar.server.centralities.CentralityImpl | |
import edu.kit.ipd.sonar.server.centralities.Centrality | |
import scala.collection.JavaConversions._ | |
import scala.collection.mutable.Map | |
import java.util.{HashMap => JavaHashMap} | |
/** | |
* Indegree calculations done in Scala. |
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
(devmode) BuenosAires:~/dev/java/pse/> hg book -r 677 current | |
** Unbekannter Fehler, Details folgen | |
** Problemdetails bitte bei http://www.selenic.com/mercurial/bts | |
** oder mercurial@selenic.com melden | |
** Mercurial Distributed SCM (version 1.4.3+4-d9aa5b368e36+20100202) | |
** Erweiterungen geladen: ignoresubrepo, pager, patchbomb, bookmarks, color, mq, graphlog, rebase, mbox, histedit, hgk | |
Traceback (most recent call last): | |
File "/opt/local/bin/hg", line 27, in <module> | |
mercurial.dispatch.run() | |
File "/opt/local/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run |
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
(defn hsv2rgb | |
([x] (apply hsv2rgb x)) | |
([h s v] (map #(* 255 %) | |
(let [u (int (/ h 60.0)) | |
f (- (/ h 60.0) u) | |
p (* v (- 1 s)) | |
q (* v (- 1 (* s f))) | |
t (* v (- 1 (* s (- 1 f))))] | |
(condp = u | |
0 (list v t q) |
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 net.experimentalworks.clojure.outdegree | |
(:import | |
(edu.kit.ipd.sonar.server.centralities Centrality | |
Centrality$Type CentralityImpl) | |
(java.util HashMap)) | |
(:gen-class | |
:extends edu.kit.ipd.sonar.server.centralities.CentralityImpl)) | |
(defn -getType [this] Centrality$Type/NodeCentrality) | |
(defn -getName [this] "Outdegree (Clojure)") |
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 net.experimentalworks.clojure.comp | |
(:use compojure)) | |
(defroutes helloworld-routes | |
(GET "/*" | |
(html [:html [:body [:p "Hello World"]]]))) | |
(run-server {:port 8080} | |
"/*" (servlet helloworld-routes)) |
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 net.experimentalworks.clojure.comp | |
(:use compojure)) | |
(defroutes helloworld-routes | |
(GET "/*" | |
(html [:html [ :body [ :p "Hello World"]]]))) | |
(decorate helloworld-routes (with-session :memory)) | |
(run-server {:port 8080} |
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 net.experimentalworks.clojure.comp | |
(:use compojure)) | |
(defroutes helloworld-routes | |
(GET "/login/:user" | |
[(session-assoc :loggedin (:user params)) | |
(html [:html [:body [:p "You are now logged in as " (:user params)]]])]) | |
(GET "/*" | |
(if (contains? session :loggedin) | |
(html [:html [:body [:p "Welcome back " [:b (:loggedin session)]]]]) |
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 net.experimentalworks.clojure.comp | |
(:use compojure)) | |
(defroutes helloworld-routes | |
(GET "/login/:user" | |
[(session-assoc :loggedin (:user params)) | |
(html [:html [:body [:p "You are now logged in as " (:user params)]]])]) | |
(GET "/logout" | |
(if (contains? session :loggedin) | |
[(session-dissoc :loggedin) |
OlderNewer