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
https://docs.google.com/presentation/d/1OAiTyyIyUFszdvdnX_RZv1NmB7OCg1GL_RvL1c0uY0g/edit?usp=sharing |
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
package demo; | |
public class Calculator { | |
enum Operation { | |
Addition, Subtraction | |
} | |
public int calculate(Operation operation, int a, int b) { | |
switch (operation) { |
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
(defn- load-post [file] | |
(try | |
(->> (slurp file) | |
(parser/parse) | |
(convert-date) | |
(split-tags) | |
(add-author) | |
(add-file-name (.getName file)) | |
(add-relative-url (.getName file)) | |
(add-absolute-url (.getName file)) |
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
public class PerfRequest { | |
public static void main(String[] args) throws Exception { | |
int index = 0; | |
int numberOfErrors = 0; | |
while(index < 100000) | |
{ | |
URL url = new URL("http://localhost:8080"); | |
HttpURLConnection connection = (HttpURLConnection)url.openConnection(); |
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
// Three Laws of Robotics | |
public void processAction(Ai ai, Action action, Environment environment) { | |
List<Human> humans = detectHumans(environment); | |
// A robot may not injure a human being or, through inaction, | |
// allow a human being to come to harm. | |
if (ai.predict(action).injure(humans)) { | |
throw new FirstLawsException(); | |
} |
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 game-of-life | |
(:require [clojure.test :refer :all])) | |
(defn test-function [] | |
:true) | |
(deftest game-of-life | |
(testing "test-function" | |
(is (= :false (test-function))))) |
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
#!/bin/sh | |
# | |
# The hook check if commit message include jira ticket number. | |
# Example: | |
# Message: Refactoring (WEBAPI-100) | |
# | |
# Script location: .git/hooks/commit-msg | |
# | |
test "" != "$(grep '\(WEBAPI-[0-9]\+\)' "$1")" || { | |
echo >&2 "ERROR: Commit message is missing Jira issue number." |
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 gdg-jihlava) | |
;1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz | |
(defn fizz-buzz-number [number] | |
(cond | |
(= 0 (mod number 3) (mod number 5)) :fizz/buzz | |
(= 0 (mod number 3)) :fizz | |
(= 0 (mod number 5)) :buzz | |
:else number)) |
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
[Štěpán]: Používám knihovnu peerjs, který řeši problémy s rozdíli implementace ff a chrome; | |
a problém je, když se mi spojí 20 (víc jsem netestoval) prohlížečů, tak se to spojí, | |
vše je connected, readu a super; všechny kontrolní proměnné webrtc (connected, closed, | |
destroyed a ještě jeden tam je) všechno se tváří správně (tak jak by mělo), | |
ale vždy (myšleno jako v 98% případů) se najde nějaká svoji dvojice prohlížečů (tj. spojení webrtc), | |
mezi kterými žádné zprávy neprojdou (ale vše se opět tváří jako že ok) |
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
package com.topmonks.monkbox.engine; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.junit.runners.Parameterized; | |
import java.util.Arrays; | |
/** |