Skip to content

Instantly share code, notes, and snippets.

@adamashton
adamashton / MonteCarlo.cs
Last active March 6, 2017 19:40
SameBirthday
using System;
namespace MonteCarlo
{
class Program
{
private static Random r = new Random();
private static readonly double GestationPeriodMean = 280.6;
private static readonly double GestationPeriodStandardDeviation = 9.7;
private static readonly int Simulations = 10000000;
@adamashton
adamashton / AsyncQueue
Created August 15, 2016 19:03
An Asynchronous persistent queue implementation utilizing Akavache as the persistent store.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Threading.Tasks;
using Akavache;
namespace AkavacheQueue
@adamashton
adamashton / countdownv1.py
Created May 10, 2012 22:05
Countdown Solver Unfinished
import itertools
def _solve(target, numbers):
#print 'Solving T=' + str(target) + ': ' + str(numbers)
# base case
if target in numbers:
# solved.
print target,
return True