Skip to content

Instantly share code, notes, and snippets.

View fffej's full-sized avatar

Jeff Foster fffej

View GitHub Profile
@fffej
fffej / NGram.cs
Created October 13, 2021 15:09
2 Gram model in C#
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
namespace generating_text
{
class Model
{
// A map of Word => {Words}.
(defun fib (n)
"Compute the nth number in the Fibonacci sequence."
(if (<= n 1) 1
(+ (fib (- n 1) (fib (- n 2))))))
(defun tree-search (states goal-p successors combiner)
"Find a state that satisfies goal-p. Start with states,
and search according to successors and combiner."
(dbg :search "~&;; Search: ~a" states)
(cond ((null states) fail)
((funcall goal-p (first states)) (first states))
(t (tree-search
(funcall combiner
(funcall successors (first states))
(rest states))
RestoreDatabase(SQL7SERVER, "SQLDataCompare2", BACKUP_LOCATION+"\\SQL7\\SQLDataCompare2.bak", SQL7PASSWORD);
RestoreDatabase(SQL2000SERVER, "SQLDataCompare1", BACKUP_LOCATION+"\\SQL2000\\SQLDataCompare1.bak", SQL2000PASSWORD);
SynchronizeDatabase(SQL2000SERVER, SQL2000PASSWORD, "SQLDataCompare1", SQL7SERVER, SQL7PASSWORD, "SQLDataCompare2", 1);
[TestFixture]
public class UglyThingTest
{
[Test]
public void CreateUglyThing()
{
UglyThing ugly = new UglyThing();
}
}
@fffej
fffej / Kata2.cs
Created March 28, 2017 14:31
Kata number 2
namespace TDDKata2
{
public class Class1
{
[Test]
public void Volume_Of_A_Cube()
{
Assert.That(new Cube(1).Volume, Is.EqualTo(1));
}
@fffej
fffej / Kata2.cs
Created March 28, 2017 14:31
Kata number 2
namespace TDDKata2
{
public class Class1
{
[Test]
public void Volume_Of_A_Cube()
{
Assert.That(new Cube(1).Volume, Is.EqualTo(1));
}

Keybase proof

I hereby claim:

  • I am fffej on github.
  • I am fffej (https://keybase.io/fffej) on keybase.
  • I have a public key ASCtXvHaI1pD3pxRMPMztq_UbLFSSj5-SrqYGgvpJjxIogo

To claim this, I am signing this object:

@mixin border {
border: 1px solid #333;
}
article.post {
background: #eee;
@include border;
}
ul.menu {
background: #ccc;
@include border;
private LiveDatabase RefreshLiveDatabase(LiveDatabase source, int whichDatabase)
{
source.Cleanup();
var original = whichDatabase == 1 ? m_DB1Original : m_DB2Original;
return original.ToLive();
}