Online markdown text editor capable to generate PDF and HTML. Contains a set of useful options for writers:
- spelling correction
- grammar checker
- translations
- synonyms
(ns epam-auth.core | |
(:import (com.gargoylesoftware.htmlunit WebClient)) | |
(:gen-class :main true))) | |
(def client (doto (WebClient.) | |
(.setUseInsecureSSL true) | |
(.setJavaScriptEnabled true))) | |
(defn login-form [] | |
(let [page (.getPage client "http://duckduckgo.com") |
#!/bin/bash | |
get-infoq-video () { | |
echo 'usage get-infoq-video http://www.infoq.com/presentations/Concurrency-Clojure' | |
curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10')" $1 | grep "<source src=" |sed -E 's/.*<source src="([^"]+)".*/\1/g' |xargs curl -O | |
} |
(use 'clojure.java.io) | |
(defn read-lines [file] | |
(with-open [rdr (reader file)] | |
(doall (line-seq rdr)))) | |
(defn dna-reverse-complement [dna] | |
"Takes a DNA string and returns it's reverse complement" | |
(apply str (map (fn [x] | |
(cond |
(= "Test Testerson, 123 Test Lane, Testerville, TX" | |
(let [[a b] ["Test" "Testerson"] | |
{:keys [street-address city state]} test-address] | |
(str a " " b ", " street-address ", " city ", " state))) |
(fn [s n] | |
(keep-indexed | |
(fn [i v] (when (pos? (mod (inc i) n)) v)) | |
s)) |
(defn gcd [a b] | |
(let [min (min a b) | |
max (max a b) | |
rem (mod max min)] | |
(if (zero? rem) | |
min | |
(recur min rem)))) | |
(defn gcd2 [a b] | |
(let [quotient (/ a b)] |
(defn compare-jobs | |
[m1 m2 key] | |
(loop [keys (clojure.set/intersection (set (keys m1)) (set (keys m2))) | |
changed-jobs {}] | |
(if (empty? keys) | |
changed-jobs | |
(let [name (first keys) | |
status (get-in m1 [name key]) | |
updated-status (get-in m2 [name key])] | |
(if (= status updated-status) |
I hereby claim:
To claim this, I am signing this object:
(require '[clatrix.core :as cl]) | |
(import '[clatrix.core Matrix]) | |
(defn matrix-trace | |
[^Matrix m] | |
(->> m | |
(cl/map-indexed (fn [i j v] (if (= i j) v 0))) | |
(mapv #(reduce + %)) | |
(reduce +))) |