9551 grau-weiß
9552 Fliesen Winter
9553 Schwarzer Herzog/Wolters Pilsener
9554 Mc V
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
object Util { | |
/** Merges a collection of streams into a single stream. | |
* | |
* Returns a sorted stream if all input streams are sorted. | |
*/ | |
def mergeStreams[A](streams: Traversable[Stream[A]])(implicit ord: Ordering[A]): Stream[A] = { | |
val streams1 = streams.toList filterNot (_.isEmpty) sortBy (_.head) | |
if (streams1.isEmpty) | |
Stream.empty | |
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
/** Implicit class for adding `|>` and `tap` operations to `AnyVal`. | |
* | |
* See `http://stackoverflow.com/a/11120847/839131`. | |
*/ | |
implicit class PipeAndTap[A](val x: A) extends AnyVal { | |
/** Applies `f` to the underlying value and returns the result. */ | |
def |>[B](f: A => B) = f(x) | |
/** Applies `f` to the underlying value `x` (presumably with side effects) | |
* and returns `x`. |
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
;; ummels's solution to Squares Squared | |
;; https://4clojure.com/problem/138 | |
(fn [start end] | |
(letfn | |
[(squares [start end] | |
(take-while #(<= % end) (iterate #(* % %) start))) | |
(arrange [x] | |
(let [n (count x) | |
dim (int (Math/ceil (Math/sqrt n))) |
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
(fn [s e] | |
(let [squares (apply str (take-while #(<= % e) (iterate #(* % %) s))) | |
filler (drop (count squares) (repeat (#(* % %) (Math/ceil (Math/sqrt (count squares)))) \*)) | |
elements (concat squares filler) | |
dimension (int (Math/sqrt (count elements))) | |
cardinal (- (* 2 dimension) 1) | |
canvas (vec (repeat cardinal "")) | |
start-pos (* 2 (quot (dec dimension) 2)) | |
path (take (count elements) (mapcat #(repeat (+ 2 (* 2 %)) (if (odd? %) dec inc)) (range))) | |
balance (fn [c] (#(apply str `(~@% ~@(interpose \ c) ~@%)) (repeat (/ (- cardinal (- (* 2 (count c)) 1)) 2) \ )))] |
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
(fn [l u] | |
(let [s (apply str (take-while #(<= % u) (iterate #(* % %) l))) | |
d (int (Math/ceil (Math/sqrt (count s)))) | |
n (concat (seq s) (repeat (- (* d d) (count s)) \*)) | |
m (loop [m {} sx n | |
r (if (even? d) (- d 2) (dec d)) c (- d 1) | |
dr (mapcat #(repeat (* % 2) (if (even? %) -1 1)) (range)) | |
dc (mapcat #(repeat (inc (* % 2)) (if (even? %) 1 -1)) (range))] | |
(if (empty? sx) m | |
(recur (assoc m [r c] (first sx)) (rest sx) |
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
;; ummels's solution to Love Triangle | |
;; https://4clojure.com/problem/127 | |
(fn [mine] | |
(let [n (count mine) | |
ln #(loop [r 1 v %] (if (< v 2) r (recur (inc r) (quot v 2)))) | |
m (apply max (map ln mine)) | |
lmax (fn [xs] ; treats nil as -infinity | |
(let [a (first xs) r1 (rest xs) b (first r1) r2 (rest r1)] | |
(cond (empty? r1) a |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
diff --git a/fontforge/macbinary.c b/fontforge/macbinary.c | |
index a452d5b..d90f567 100644 | |
--- a/fontforge/macbinary.c | |
+++ b/fontforge/macbinary.c | |
@@ -37,7 +37,7 @@ | |
#include "psfont.h" | |
#if __Mac | |
# include <ctype.h> | |
-# include </Developer/Headers/FlatCarbon/Files.h> | |
+# include <CoreServices/CoreServices.h> |
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
val m = Map(0 -> 'a') | |
for (n <- 0 until 2) { | |
m.get(n) match { | |
case Some(x) => println(s"Value found for key $n: $x") | |
case None => println(s"No value found for key $n") | |
} | |
} |
OlderNewer