Skip to content

Instantly share code, notes, and snippets.

View bennage's full-sized avatar
🌦️
working on the weather 🗺️

Christopher Bennage bennage

🌦️
working on the weather 🗺️
View GitHub Profile
@bennage
bennage / count_change.fs
Created September 19, 2013 00:47
An F# implementation of the counting change problem's solution, following the clojure example from this post: http://www.billthelizard.com/2010/12/sicp-219-counting-change-revisited.html Can you improve it?
open System;
open System.Diagnostics;
[<EntryPoint>]
let main argv =
let rec cc amount coins =
match (amount, coins) with
| (0,_) -> 1
| (_,[]) -> 0
| (amount,_) when amount < 0 -> 0

The Old Monster Shop

The Old Monster Shop is a pre-Time of Troubles Forgotten Realms campaign using Dungeon World instead of AD&D 2nd Edition.

Campaign Introduction

You are each one of the many Children of Helm, orphans raised at Helm's Hold southeast of Neverwinter. The monastery is all you've known, but you're now the age where you must enter the world and live by your own means. But before your life is truly your own, you must make a final oblation to Helm, in service to the Hold. You will travel to the City of Splendors, Waterdeep, and gain the trust of an evil monster-peddler there named Feldyn. What you will do with his trust, and when, is a secret that Watcher Dumal Erard has not yet shared.

But Dumal is like a father to you, a parent in lieu of those you lost, and you trust him completely. His instructions, and his plan for gaining Feldyn's trust, are simple, but will be hazardous. Because Feldyn only retains people he knows and trusts, you will start by selling him young monsters and monst

// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// The goal of the dojo will be to
// create a classifier that uses training data
// to recognize hand-written digits, and
// evaluate the quality of our classifier
@bennage
bennage / alias.cs
Created March 10, 2014 23:10
making tuples a little easier to work with
namespace AliasFun
{
using MyRecord = System.Tuple<string, int>;
public class AnExample
{
public void Demonstrating()
{
var record = new MyRecord("thing", 42);
}
@bennage
bennage / bits.cs
Created March 19, 2014 23:46
counting bits
using System;
namespace Bits
{
class Program
{
static void Main(string[] args)
{
var lookup = BuildLookup();
@bennage
bennage / ideas.md
Last active August 29, 2015 14:02
What questions do you have about participating in open source?

Are you new to open source? What sort of questions, concerns, or even fears do you have?

Culture

  • How do I start contributing to other projects?
  • How can I encourage contribution to my project?
  • Who should have commit rights?
  • What commitment am I making by opening my source?
  • How do I establish a community?
  • What expectations will the community have?
@bennage
bennage / sliding_window.cs
Last active August 29, 2015 14:02
is there an Rx method that already does this?
namespace RxTest
{
using System;
using System.Collections.Generic;
using System.Linq;
using Chunk = System.Collections.Generic.List<int>;
internal class Program
{

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Data;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.Reactive.Linq;
import * as foo from "foo"
var $foo = require("foo");
var foo = $foo;
import foo from "foo"
var $foo = require("foo");
var foo = $foo.default;
import { foo } from "foo"
var $foo = require("foo");