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
(ns tonvanbart.roman | |
(:use clojure.test) | |
(:require [clojure.string :as str])) | |
(defn convert-step | |
"one step converting a number to roman numerals" | |
[n unitsymbol fivesymbol tensymbol] | |
(cond | |
(< n 4) (apply str (repeat n unitsymbol)) | |
(< n 9) (str/join |
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
(ns sicp.chapter1.ex1_11) | |
; SICP chapter 1, exercise 11 | |
; let f(x) = x for x<3 | |
; f(x) = f(x-1) + 2f(x-2) + 3f(x-3) otherwise | |
(defn f | |
"the tree-recursive version" | |
[n] | |
(if (< n 3) 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
set nu | |
set showmode | |
set autoindent | |
set smartindent | |
set sw=4 | |
set ts=4 | |
set expandtab | |
set hlsearch |
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
#!/bin/bash | |
main() { | |
if [ "$#" -ne 2 ]; then | |
EXPLAIN | |
exit 0 | |
fi | |
clean "$@" | |
} |
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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
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
(ns minesweeper.solver | |
(:use clojure.test)) | |
(defn solve [scenario] | |
"Example input: {:rows 10 :cols 10 :mines 2}" | |
(let [mines (:mines scenario) | |
rows (:rows scenario) | |
cols (:cols scenario) | |
freecells (- (* rows cols) mines)] | |
(cond |
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
package org.vanbart; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.HashMap; | |
import java.util.Map; | |
import static org.hamcrest.core.Is.is; | |
import static org.junit.Assert.assertNull; |
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
#!/bin/bash | |
main() { | |
if [ "$#" -ne 2 ]; then | |
printusage | |
exit 0 | |
fi | |
dozip $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
import java.util.Arrays; | |
import java.util.List; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.stream.Collectors; | |
/** | |
* Functional replacement for Template Method in java 8 | |
* Created by ton on 25/10/16. | |
*/ |
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
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.Consumer; | |
import reactor.core.publisher.Flux; | |
import reactor.core.publisher.FluxSink; | |
/** | |
* Created by ton on 10/11/16. | |
*/ |
OlderNewer