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
(* | |
Copyright (c) 2008-2011 IntelliFactory | |
GNU Affero General Public License Usage The code | |
is free software: you can redistribute it and/or | |
modify it under the terms of the GNU Affero | |
General Public License, version 3, as published by | |
the Free Software Foundation. |
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
Originally: | |
https://gist.github.com/7565976a89d5da1511ce | |
Hi Donald (and Martin), | |
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I | |
appreciate the tone. This is a Yegge-long response, but given that you and | |
Martin are the two people best-situated to do anything about this, I'd rather | |
err on the side of giving you too much to think about. I realize I'm being very | |
critical of something in which you've invested a great deal (both financially |
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
namespace Extensions | |
open System.Text.RegularExpressions | |
///Regex extensions | |
module Regex = | |
type ActiveMatch = | |
{ | |
Match: Match | |
MatchValue: string | |
Groups: Group list |
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
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Web.Mvc; | |
namespace HeaderChecking.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
public ActionResult Index() |
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
open System.Net.Sockets | |
type A = System.Net.Sockets.SocketAsyncEventArgs | |
type B = System.ArraySegment<byte> | |
exception SocketIssue of SocketError with | |
override this.ToString() = | |
string this.Data0 | |
/// Wraps the Socket.xxxAsync logic into F# async logic. |
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
namespace FilesTypeProvider | |
open System.Reflection | |
open Microsoft.FSharp.Core.CompilerServices | |
open Samples.FSharpPreviewRelease2011.ProvidedTypes | |
open System.Text.RegularExpressions | |
[<TypeProvider>] | |
type public CheckedFilesProvider() as this = |
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
(* | |
http://4clojure.com/problem/92 | |
Roman numerals are easy to recognize, but not everyone knows all the rules necessary to work with them. | |
Write a function to parse a Roman-numeral string and return the number it represents. | |
You can assume that the input will be well-formed, in upper-case, and follow the subtractive principle. | |
You don't need to handle any numbers greater than MMMCMXCIX (3999), the largest number representable with ordinary letters. | |
(= 14 (__ "XIV")) |
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
PS1_BASE="$PS1" | |
format_prompt () { | |
if [ "$?" -ne "0" ]; then | |
PS1="${PS1_BASE}\[\033[0;31m\]ಠ_ಠ\[\033[0m\] " | |
else | |
PS1="${PS1_BASE}" | |
fi | |
} | |
PROMPT_COMMAND=format_prompt |
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 mapReduce (map : 'T1 -> Async<'T2>) | |
(reduce : 'T2 -> 'T2 -> Async<'T2>) | |
(input : seq<'T1>) : Async<'T2> = | |
let run (a: Async<'T>) (k: 'T -> unit) = | |
Async.StartWithContinuations(a, k, ignore, ignore) | |
Async.FromContinuations <| fun (ok, _, _) -> | |
let k = ref 0 | |
let agent = | |
new MailboxProcessor<_>(fun chan -> | |
async { |
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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading; | |
using System.Threading.Tasks; |