Skip to content

Instantly share code, notes, and snippets.

(comment defn fizz-buzz [n]
(if (= 0 (mod n 15))
"fizzbuzz"
(if (= 0 (mod n 3))
"fizz"
(if (= 0 (mod n 5))
"buzz" n))))
(comment defn fizz-buzz [n]
(if (= 0 (mod n 15))
(ns Solution
(:gen-class))
(require '[clojure.string :as str])
; Auto-generated code below aims at helping you parse
; the standard input according to the problem statement.
(defn -main [& args]
(let [n (read) _ (read-line) temps (read-line)]
; n: the number of temperatures to analyse

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.

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.

"These" in Javascript

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

foo(1, 2);
{ global: [Circular],
 process: 
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
void red() {
if (gl_FragCoord.y < 100.0) {

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                                                      
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;
@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)