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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Meine erste Videoapplikation</title> | |
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<script src="https://raw.github.com/Wolfy87/EventEmitter/master/EventEmitter.min.js"></script> | |
<script src="https://raw.github.com/palavatv/palava-client/master/palava.min.js"></script> | |
<script type="text/coffeescript"> |
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
import locale | |
x = [ u'sac', u'sáb'] | |
sorted(x) | |
>>> [u'sac', u's\xe1b'] | |
locale.setdefault(locale.LC_COLLATE, 'de_DE.UTF-8') | |
sorted(x, cmp=locale.strcoll) | |
>>> [u's\xe1b', u'sac'] |
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
(project (table :t1) | |
[:id :title] | |
(case :alias?? | |
(<= :wage 200) | |
"low" | |
(and (> :wage 200) (< :wage 400)) | |
"average" | |
(>= :wage 400) | |
"high" | |
:else "negative")) |
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
(project (table :t1) | |
[:id :title] | |
(case :alias | |
(when (<= :wage 200) | |
"low") | |
(when (and (> :wage 200) (< :wage 400)) | |
"average") | |
(when (>= :wage 400) | |
"high") | |
:else |
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
\usepackage{listings} | |
\lstdefinelanguage{Clojure} | |
{morekeywords={defn, defmacro, let, if, when, loop, recur}, | |
sensitive=false, | |
morecomment=[l]{;;}, | |
morecomment=[s]{/*}{*/}, | |
morestring=[b]", | |
} |
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 x {:a 1 :b 2 :c 3}) | |
(def y {:a 2 :b 3 :c 4}) | |
(def z (zipmap [:a :b :c] (range 10 15))) | |
(def g #{:a :b}) | |
(defn always-merge-with [f keyseq & maps] | |
(reduce (fn [ret k] (assoc ret k (apply f (map #(get % k) maps)))) {} keyseq)) | |
(always-merge-with vector g x y z) | |
=> {:b [2 nil 11], :a [1 2 10]} |
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 x {:a 1 :b 2 :c 3}) | |
(def y {:a 2 :b 3 :c 4}) | |
(def z (zipmap [:a :b :c] (range 10 15))) | |
(def g #{:a :b}) | |
(defn always-merge-with [f keyseq & maps] | |
(reduce (fn [ret k] (assoc ret k (apply f (map #(get % k) maps)))) {} keyseq)) | |
(always-merge-with vector g x y z) | |
=> {:b [2 nil 11], :a [1 2 10]} |
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
(clojure.xml/emit {:tag :FOO | |
:attrs {:attr 'xxx}, | |
:content [{:tag :BAR | |
:attrs {:name "bar", :num 123}} | |
{:tag :BAR | |
:attrs {:name "baz", :num 100}}]}) | |
<?xml version='1.0' encoding='UTF-8'?> | |
<FOO attr='xxx'> | |
<BAR name='bar' num='123'/> | |
<BAR name='baz' num='100'/> |
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
(binding [*print-meta* true] | |
[(str (with-meta 'symbol {:a 1})) | |
(pr-str (with-meta 'symbol {:a 1}))]) | |
=> ["symbol" "^{:a 1} 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
;; snippets to be used on the repl or within the example applet | |
(ns demo) | |
(defmacro show [& body] | |
`(pivot/disp-> (pivot/show (do ~@body)))) | |
;; ---title--- | |
;; Treeview Tutorial | |
;; ---description--- |
NewerOlder