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 static java.util.Arrays.asList; | |
| import java.util.List; | |
| import java.util.stream.Stream; | |
| public class Main { | |
| public static void main(String[] args) { | |
| List<Integer> numbers = asList(1, 2, 3, 4, 5); | |
| int[] factor = {2}; |
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
| use_synth :blade | |
| bizet = (ring :d, :r, :r, :a, :f5, :r, :a, :r) | |
| bizet_variation = (ring :d, :r, :r, :Bb, :g5, :r, :Bb, :r) | |
| define :drums do | |
| 2.times do | |
| if rand(2) > 1 | |
| sample :drum_tom_mid_soft | |
| else | |
| sample :drum_heavy_kick |
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
| object PopNews { | |
| def main (args: Array[String]) { | |
| val bests = Seq("radiohead", | |
| "Whitney", | |
| "Cowtown", | |
| "Car seat headrest", | |
| "Woods", | |
| "Leonard Cohen", |
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
| [push] | |
| default = current | |
| [fetch] | |
| prune = true | |
| [alias] | |
| st = status | |
| ci = commit | |
| br = branch | |
| co = checkout | |
| lol = log --graph |
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
| (println "Clojure FTW !") | |
| (+ 1 1) | |
| (* (/ 2 4) (/ 4 2)) | |
| (+ 2 2 2 2) | |
| (/ 8 2 2) |
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
| (def *small* 1) | |
| (def *big* 100) | |
| (defn guess [] | |
| (Math/round (double(/ (+ *big* *small*) 2)))) | |
| (defn smaller [] | |
| (def *big* (guess)) | |
| (guess)) |
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 fr.mga.functional; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import static java.lang.Character.getNumericValue; | |
| import static java.util.stream.Collectors.joining; | |
| public class FooBar { |
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 fr.mga.hello; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
| import org.springframework.context.annotation.ComponentScan; | |
| @ComponentScan | |
| @EnableAutoConfiguration | |
| public class Application { |
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 fr.mga.mashup.mapreduce; | |
| import rx.Observable; | |
| import java.util.List; | |
| public class MapReduce { | |
| private List<Integer> list; |
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 fr.mga.mashup; | |
| import rx.Observable; | |
| public class Hello { | |
| public String msg(String ... msg) { | |
| HelloFunction function = new HelloFunction(); | |
| HelloReduce reduce = new HelloReduce(); | |
| return Observable.from(msg).map(function).reduce(reduce).toBlocking().first(); | |
| } |
NewerOlder