Skip to content

Instantly share code, notes, and snippets.

View richardadalton's full-sized avatar

Richard Dalton richardadalton

View GitHub Profile
@richardadalton
richardadalton / gist:61fd9e02a34398c78c217c4fd311fdf5
Created September 7, 2016 09:07
A simple generic Command/Query Agent in F# using MailboxProcessor
type Message<'S> =
| Query of ('S -> unit)
| Command of ('S -> 'S)
| Kill
type CQAgent<'S>(state: 'S) =
let innerModel =
MailboxProcessor<Message<'S>>.Start(fun inbox ->
let rec messageLoop (state: 'S) =
async {
@richardadalton
richardadalton / gist:014c2eeede38fb290ecd
Created September 18, 2015 10:13
Can I Make a Palindrome - Imperative vs Functional
Here's a little programming challenge, the kind you might be asked in a job interview.
Write a function that can tell if a sequence of characters can be rearranged to form a palindrome.
And here's a solution in C (The kind you might be expected to write in a job interview)
http://geeksquiz.com/check-characters-given-string-can-rearranged-form-palindrome/
bool canFormPalindrome(char *str)
{
// Create a count array and initialize all values as 0
@richardadalton
richardadalton / NewDevBox.txt
Last active August 29, 2015 14:13
NewDevBox
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst visualstudio2013professional -InstallArguments "/Features:'Blend WebTools'"
cinst vs2013.4
cinst visualstudio2013-sdk
cinst visualstudio2013-modelingsdk
cinst sublimetext2
cinst virtualbox
cinst vagrant