Skip to content

Instantly share code, notes, and snippets.

(ns fourclojure.problem)
(comment Maximum Value 38)
(defn max-of [& positive-numbers]
(let [max-acc
(fn [ns acc]
(if (empty? ns)
acc
(recur (rest ns) (if (> (first ns) acc) (first ns) acc))))]
(defn naive-fibonacci [n]
(condp = n
0 1
1 1
(+ (naive-fibonacci (- n 1))
(naive-fibonacci (- n 2)))))
(defn fibonacci-draft
([n]
(fibonacci-draft n 0 1))
@thieux
thieux / clojure-repl-dev.clj
Created January 10, 2017 21:36
Build incrementally a clojure function using the REPL
clojure-drafts.core> (repeat 2 :x)
(:x :x)
clojure-drafts.core> (map (fn [e] (repeat 2 e)) [:x])
((:x :x))
clojure-drafts.core> (map (fn [e] (repeat 3 e)) [:x])
((:x :x :x))
clojure-drafts.core> (map (fn [e] (repeat 3 e)) [:x :y])
((:x :x :x) (:y :y :y))
clojure-drafts.core> (flatten (map (fn [e] (repeat 3 e)) [:x :y]))
(:x :x :x :y :y :y)
package fr.ing.authorization.engine;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

Linux Top Command

Tasks: 193 total,   1 running, 192 sleeping,   0 stopped,   0 zombie
%Cpu(s): 42,9 us,  4,1 sy,  0,2 ni, 49,7 id,  2,8 wa,  0,0 hi,  0,3 si,  0,0 st
KiB Mem:   8195608 total,  8070412 used,   125196 free,   144788 buffers
KiB Swap:  4290556 total,    16776 used,  4273780 free.  2380092 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                   
 1902 engineer  20   0 4825048 1,631g  34352 S 246,6 20,9  10:31.10 java                                                      
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
void red() {
if (gl_FragCoord.y < 100.0) {

"These" in Javascript

function foo(a, b) {
  console.log(this);
}

foo(1, 2);
{ global: [Circular],
 process: 

Apache Kafka Overview

Replication

1 leader is elected per partition. Many followers. Followers calculate the offset. If leader crashes, a new leader is elected. Non replicated messages are lost.

Producers & consumers deal with the leader.

Grille Blues

Itération 1 (setup)

Note simple :

  • Jouer un do.
  • Jouer un do à l'octave.
  • Jouer un re.
  • Jouer la gamme do re mi fa sol la si.