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
@echo off | |
setLocal EnableDelayedExpansion | |
set CLASSPATH=" | |
for /R ./lib %%a in (*.jar) do ( | |
set CLASSPATH=!CLASSPATH!;%%a | |
) | |
set CLASSPATH=!CLASSPATH!" | |
set CLASSPATH=%CLASSPATH%;src;test;config;data | |
echo CLASSPATH=%CLASSPATH% | |
java -Xmx1G -cp %CLASSPATH% jline.ConsoleRunner clojure.main -i run.clj -r |
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 comp-ns-find | |
(:require [clojure.contrib.seq :as seq] | |
[clojure.contrib.classpath :as cp] | |
[clojure.contrib.jar :as jar]) | |
(:import (java.util.jar JarFile))) | |
(defn find-compiled-modules | |
"Performs search for clojure namespaces in .jar files" | |
[] | |
(map symbol |
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
;; use of defrecords for https://jukkaz.wordpress.com/2010/08/26/age-discrimination-with-clojure/ | |
(defrecord Person [name age]) | |
(def persons1 | |
[(Person. "Boris" 40) | |
(Person. "Betty" 32) | |
(Person. "Bambi" 17)]) | |
(let [[minors majors] (separate #(<= (:age %) 18) persons1)] | |
(println minors) |
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 calc-occuriences-trans [^String text] | |
(let [res (reduce (fn [m ^Character c] | |
(let [ch (Character/toUpperCase c)] | |
(assoc! m ch (+ 1 (m ch 0))))) (transient {}) text)] | |
(persistent! res))) | |
;; (calc-occuriences-trans (slurp "/home/ott/tmp/1/dict" :encoding "ISO-8859-1")) => 1.5-2 sec | |
(defn calc-occuriences [^String text] | |
(let [tmap (map (fn [^Character ch] (hash-map (Character/toUpperCase ch) 1)) text)] | |
(apply merge-with + tmap))) |
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
(defun string-join-accum (joiner strings accum) | |
(cond ((not strings) accum) | |
((not (cdr strings)) (concat accum (car strings))) | |
(t (string-join-accum joiner (cdr strings) | |
(concat accum (car strings) joiner))))) | |
(defun string-join (joiner strings) | |
(string-join-accum joiner strings "")) | |
(defun invoke-bash (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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="xml" indent="yes"/> | |
<xsl:template match="/Site"> | |
<testsuite> | |
<xsl:variable name="BuildName"><xsl:value-of select="@BuildName"/></xsl:variable> | |
<xsl:variable name="BuildStamp"><xsl:value-of select="@BuildStamp"/></xsl:variable> | |
<xsl:variable name="Name"><xsl:value-of select="@Name"/></xsl:variable> | |
<xsl:variable name="Generator"><xsl:value-of select="@Generator"/></xsl:variable> | |
<xsl:variable name="CompilerName"><xsl:value-of select="@CompilerName"/></xsl:variable> |
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 hbr-clj | |
(:use compojure.core ring.middleware.reload clojure.data.json) | |
(:require [compojure.route :as route]) | |
(:import [org.apache.commons.codec.digest DigestUtils])) | |
(defroutes my-routes | |
(GET "/md5/:what" [what] (json-str {:what what :hash (DigestUtils/md5Hex what)})) | |
(route/not-found "<h1>Page not found</h1>")) | |
(def app (-> #'my-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 rtest.core | |
(:gen-class) | |
(:use [ring.middleware params multipart-params keyword-params] | |
ring.adapter.jetty | |
) | |
) | |
(defn handler [request] | |
{:status 200 |
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
;;; minimial-cedet-config.el --- Working configuration for CEDET from bzr | |
;; Copyright (C) Alex Ott | |
;; | |
;; Author: Alex Ott <[email protected]> | |
;; Keywords: cedet, C++, Java | |
;; Requirements: CEDET from bzr (http://cedet.sourceforge.net/bzr-repo.shtml) | |
;; Do checkout of fresh CEDET, and use this config (don't forget to change path below) |
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
;;; cedet-1.1-startup.el --- Working configuration for CEDET 1.1 & below | |
;; Copyright (C) Alex Ott | |
;; | |
;; Author: Alex Ott <[email protected]> | |
;; Keywords: CEDET 1.1, | |
;; Requirements: CEDET 1.1 or below | |
(load-file "~/tmp/cedet-1.1/common/cedet.el") | |
(require 'semantic-decorate-include) |
OlderNewer