Skip to content

Instantly share code, notes, and snippets.

View bbarry's full-sized avatar

Bill Barry bbarry

  • Ren Inc
  • Pennsylvania
View GitHub Profile

and the whole idea that the Misfit crew are actively destroying a culture to save a species... The People will lose their language in a few generations because English is in every way imaginable superior.

And then Julian is also about to jump them ahead a technology progression that took humans around 10-60,000 years:

  • The People don't have writing (8,000 BC).
  • They haven't invented a wheel (10,000 BC).
  • Vemik is apparently the inventor of the Bow (65,000 BC).
  • They barely have pottery (16,000 - 30,000 BC)
  • They appear to not have invented the Loom (36,000 BC)
  • They don't seem to know what charcoal is (100,000 - 790,000 BC)
[Fact(Skip = "This test generator is capable of producing crashes that are not yet fixed; see, for example, Fuzz5815")]
public void Fuzz()
{
int dt = Math.Abs(new DateTime().Ticks.GetHashCode() % 10000000);
// generate a pattern-matching switch randomly from templates
string[] expressions = new[]
{
"M", // a method group
/// <summary>
/// A skip list is an ordered collection with O(log(n)) average case searching, inserting and removal. It also provides
/// O(n) enumeration and constant time access to the first element.
/// While the standard implementation is nondeterministic and based on overlapping forward linked lists, this
/// implementation is deterministic and uses double linked lists to provide constant time acess to the last element and
/// O(n) enumeration in reverse order as well as optimized insertion and removal for items in the last position.
/// </summary>
/// <typeparam name="T"></typeparam>
[PublicAPI]
[DebuggerDisplay("Count = {Count}, First = {SafeFirst}, Last = {SafeLast}")]
@bbarry
bbarry / _1_source.cs
Last active November 23, 2016 19:25
async inlined
using System;
using System.Threading.Tasks;
public class C {
static async Task A()
{
var a = 0;
await B();
Console.Write(a++);
await B();
@bbarry
bbarry / Program.cs
Last active September 11, 2016 18:48
testing program for verifying linear algorithm compared to quadratic algorithm for roslyn issue 13685: https://github.com/dotnet/roslyn/issues/13685
using System;
using System.Collections.Generic;
using System.Linq;
using Combinatorics.Collections;
namespace ConsoleApp1
{
public class Program
{
public static void Main(string[] args)
@bbarry
bbarry / ChangeMaker.cs
Created June 15, 2016 22:20
change making algorithm
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace ConsoleApplication1
{
public class Program
@bbarry
bbarry / Knapsack.cs
Created June 14, 2016 14:50
various knapsack implementations
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace ConsoleApplication1
{
public class Program
{
@bbarry
bbarry / ai.js
Last active May 30, 2016 23:29
2048 - ai.js
var log2 = Math.log2;
if(!log2) {
log2 = function (x) { return Math.log(x) / Math.LN2; };
}
function Ai() {
var score = function (grid, previous) {
var total = 0, count = 0, ptotal = 0, pcount = 0;
grid.eachCell(function (x, y, tile) {
if (tile) { total += (log2(tile.value)-1)*tile.value; count += 1; }
var tracer = new Array2DTracer();
var logger = new LogTracer();
var D = [
Array1D.random(20, 0, 50),
Array1D.random(20, 0, 0)
];
tracer._setData(D);