This file contains hidden or 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 java.util.AbstractList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class HexDump | |
{ | |
private static final int _16 = 16; | |
private static class ByteList extends AbstractList<Integer> |
This file contains hidden or 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 hex.core) | |
;; | |
;; Decode hex numbers - kata | |
;; | |
(defn decimal-value [n] | |
(or | |
(get {\0 0 \1 1 \2 2 \3 3 \4 4 \5 5 \6 6 \7 7 \8 8 \9 9 \a 10 \b 11 \c 12 \d 13 \e 14 \f 15} n) | |
(throw (Exception. (str "Invalid number: " n))))) |
This file contains hidden or 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 diamond.core) | |
;; | |
;; Diamond kata | |
;; | |
(def alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ") | |
(def blanks-d (iterate #(str %1 "-") "")) | |
(defn blanks [n] (nth blanks-d n)) |
This file contains hidden or 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
/** | |
* Solution for the java puzzle from http://zeroturnaround.com/fun/magical-java-puzzle-pat-the-unicorns/ | |
*/ | |
public class Unicorn { | |
private static int currentLine = 0; | |
public static boolean pat() { | |
int line = getExecutionLineFromMagicalLand(); |
This file contains hidden or 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
;; The content for the project.clj | |
#_(defproject datetest "1.0.0-SNAPSHOT" | |
:description "Some date calculations" | |
:dependencies [[clj-time "0.3.5"] | |
[org.clojure/clojure "1.3.0"] | |
[org.clojure/math.numeric-tower "0.0.1"]]) | |
(ns test.date | |
(:use clojure.math.numeric-tower) | |
(:refer-clojure :exclude (extend)) |
This file contains hidden or 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
;; Beispiele für die REPL | |
(+ 2 2) | |
; Listen | |
'(1 2 3 4 5 "ksdjksdfjkjsdf") | |
; Vektoren | |
[1 2 3 4 5] |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or 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
Dies ist ein aTest;;2;3;4;5;6;7;2 | |
Dies ist ein bTest;1;2;3;4;5;6;7;2 | |
Dies ist ein cTest;1;2;3;4;5;6;7;2 | |
Dies ist ein dTest;1;2;3;4;5;6;7;2 | |
Dies ist ein eTest;1;2;3;4;5;6;7;2 | |
Dies ist ein fTest;1;2;3;4;5;6;7;2 | |
Dies ist ein gTest;1;2;3;4;5;6;7;2 | |
Dies ist ein hTest;1;2;3;4;5;6;7;2 | |
Dies ist ein iTest;1;2;3;4;5;6;7;2 | |
Dies ist ein jTest;;2;3;4;5;6;7;2 |