I hereby claim:
- I am benjamin-bader on github.
- I am bendb (https://keybase.io/bendb) on keybase.
- I have a public key whose fingerprint is 0E1F CB12 79F1 21EB F2B1 123F 6681 E17F 3BEA EF7F
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
package com.keepsafe.services.manifest.collect; | |
import com.google.common.base.Function; | |
import com.google.common.base.Predicate; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.NoSuchElementException; | |
import java.util.Set; |
// | |
// DSMainViewController.m | |
// VideoGenie | |
// | |
// Created by Benjamin Bader on 1/29/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import "DSMainViewController.h" |
open System | |
open System.IO | |
[<Literal>] | |
let trainingDataFile = @"C:\Users\ben\Downloads\digitssample.csv" | |
type ImageData = { | |
ActualNumber: byte | |
Pixels: float [] | |
} |
// 'a seq -> ('a * 'a) seq | |
let pair (series: 'a seq) = seq { | |
use enum = series.GetEnumerator() | |
if enum.MoveNext() then | |
let first = ref (Some enum.Current) | |
while enum.MoveNext() do | |
if Option.isSome !first then | |
yield (Option.get !first), enum.Current | |
first := None |
public static IEnumerable<T> Cycle<T>(this IEnumerable<T> collection, bool forceToList = false) | |
{ | |
var list = collection as IList<T>; | |
if (list != null) | |
{ | |
return CycleList(list); | |
} | |
return forceToList |
public static IEnumerable<T> Interleave<T>(this IEnumerable<T> collection, IEnumerable<T> other, int thisCount, int thatCount) | |
{ | |
if (collection == null) | |
throw new ArgumentNullException("collection"); | |
if (other == null) | |
throw new ArgumentNullException("other"); | |
if (thisCount < 1) | |
throw new ArgumentOutOfRangeException("thisCount", thisCount, "Must be greater than zero."); |
public static IEnumerable<IList<T>> Partition<T>(this IEnumerable<T> collection, int windowSize) | |
{ | |
if (collection == null) | |
throw new ArgumentNullException("collection"); | |
List<T> list; | |
using (var enumerator = collection.GetEnumerator()) | |
{ | |
// Break on an empty sequence to avoid a pointless allocation. | |
if (!enumerator.MoveNext()) |