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 System.Environment | |
main = do (countTo:_) <- getArgs | |
let numbers = fizzbuzz [0..(read countTo)] | |
mapM_ putStr $ map (\n -> n ++ ", ") $ init numbers | |
putStrLn $ last numbers | |
divides d n = rem n d == 0 | |
fb x = if (divides 15 x) then "Fizzbuzz" else if (divides 3 x) then "Fizz" else if (divides 5 x) then "Buzz" else show x |
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
find . -name packages.config -exec grep -H -n '^.*System.Windows.*' {} \; | |
find . -name *.csproj -exec grep -H -n '^.*<Reference Include="System.Windows.Controls.Toolkit.Internals, Version=4.0.5.0, Culture=neutral, PublicKeyToken=2c5c654d367bf4a7, processorArchitecture=MSIL">' {} \; |
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 tron.neil.bots | |
(:require [tron.core :as tron])) | |
(def directions {:right [1 0] | |
:down [0 1] | |
:left [-1 0] | |
:up [0 -1]}) | |
(def pos [3 4]) |
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
;Circle | |
(ns tron.neil.bots | |
(:require [tron.core :as tron])) | |
(def directions {:right [1 0] | |
:down [0 1] | |
:left [-1 0] | |
:up [0 -1]}) | |
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
(require '[clojure.zip :as zip]) | |
(def v [[[1 2 [3 4]] [:a [[ :b :c] :d]]] ["f" "g"] [[["h"] "i"] "j"]]) | |
(def z (zip/vector-zip v)) | |
z | |
( -> z zip/node) | |
( -> z |
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
(defprotocol LNext | |
(foo [this] [this a] "this is a foo 1") | |
(bar [this a] "this is a bar")) | |
(extend-protocol LNext | |
String | |
(foo | |
([this] (str this " with extra goodness!")) | |
([this a] (str this " with double extra goodness!!" a))) |
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 foo | |
[arg] | |
(cond | |
(string? arg) | |
(println "a string") | |
(and (number? arg) | |
(pos? arg)) | |
(println "pos arg yo!") |
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
awk '{gsub (/^[ \t]+|[ \t]+$/,""); print "\"" $0 "\"," > "OUTPUT.csv" }' INPUT.txt |
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
DECLARE @constraints_to_remove TABLE ( | |
schemaName nvarchar(128) NOT NULL, | |
tableName sysname NOT NULL, | |
constraintName sysname NOT NULL); | |
INSERT @constraints_to_remove ( | |
schemaName, | |
tableName, | |
constraintName) | |
SELECT |
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
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" --graph --date=short > gitlog.txt |