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
(defun set-psake-compile-command () | |
(interactive) | |
(let ((psake-file-dir (locate-dominating-file (buffer-file-name) "default.ps1"))) | |
(if psake-file-dir | |
(let (( psake-command (concat "Set-Location " psake-file-dir "; & c:\\Dropbox\\bin\\psake.ps1"))) | |
(progn | |
(make-local-variable 'compile-command) | |
(setq compile-command | |
(concat "powershell -NoProfile -ExecutionPolicy unrestricted -Command \"" psake-command "\""))))))) |
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
;; I came up with this after reading http://stackoverflow.com/questions/1009037/processing-pairs-of-values-from-two-sequences-in-clojure | |
(defn nseq-map | |
"Given keys and sequences of values, produces a sequence of | |
maps of the keys to each slice of values from the sequences. | |
Example: | |
user> (nseq-map [:a :b :c] [1 2 3] [\"ba\" \"bb\" \"bc\"] [\"cx\" \"cy\" \"cz\"]) | |
({:c \"cx\", :b \"ba\", :a 1} {:c \"cy\", :b \"bb\", :a 2} {:c \"cz\", :b \"bc\", :a 3})" | |
[keys & value-seqs] |
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
cd 'C:\Program Files (x86)\Git\doc\git\html'; ls *.html | ?{$_.Name -match '\w+-\w+\.*'} | %{mv $_ $($_.Name.Replace('-', ''))} |
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
Date,USDEUR | |
2010-07-02,1.2548 | |
2010-07-01,1.2328 | |
2010-06-30,1.2271 | |
2010-06-29,1.2198 | |
2010-06-28,1.2339 | |
2010-06-25,1.2294 | |
2010-06-24,1.2262 | |
2010-06-23,1.2271 | |
2010-06-22,1.2258 |
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
let ex (p : bool) = | |
if p then ignore() | |
else failwith "gusto" | |
let f () : unit = | |
ex false | |
(* stack trace doesn't include f's body. why? *) | |
f() |
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
char[] GetDelimeters(string s) | |
{ | |
return HasCustomTokens(s) ? | |
s.Substring(2, 1).ToCharArray() | |
: new char[] { ',', '\n' }; | |
} | |
string GetValueToParse(string s) | |
{ | |
return HasCustomTokens(s) ? |
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
char[] GetDelimeters(string s) | |
{ | |
if (s.StartsWith("//")) | |
return s.Substring(2, 1).ToCharArray(); | |
else | |
return new char[] { ',', '\n' }; | |
} | |
string GetValueToParse(string s) | |
{ |
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
// Adds the integers in a string like "1,2,3" = 6, | |
// or "//;\n1;2;3" = 6 | |
public int Add(string value) | |
{ | |
if (string.IsNullOrEmpty(value)) | |
return 0; | |
var delimters = new char[] { ',', '\n' }; | |
if (value.StartsWith("//")) | |
{ |
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
(* | |
Very ugly, very rough, very F# 101 <- my attempt to implement | |
STOMP [http://stomp.codehaus.org/Protocol]. | |
This is the first time I've really tried using active patterns and | |
absolutely the first time I've used MailboxProcessors. | |
There are a couple of concepts I am still trying to work out: | |
1) What exactly happens with AsyncResponse's in mailboxes...I think I |