This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[STAThread] | |
static void Main() | |
{ | |
_nui = new Runtime(); | |
var app = new Application(); | |
var window = new Window(); | |
InitializeNui(); //Initializing the Runtime object and opening video streams | |
CreateGUI(window); //Setting up a canvas to hold the RGB video and the image attached to the hand of captured person | |
var skeletonFrameReadyObservable = Observable.FromEventPattern(_nui, "SkeletonFrameReady"); | |
var trackedSkeletons = from ev in skeletonFrameReadyObservable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Scenario] | |
public class Test_Bus_Subscriptions_For_Consumers_In_Dummy_Saga_Using_Castle_As_IoC : | |
Given_a_service_bus_instance | |
{ | |
readonly IWindsorContainer _container; | |
public Test_Bus_Subscriptions_For_Consumers_In_Dummy_Saga_Using_Castle_As_IoC() | |
{ | |
_container = new WindsorContainer(); | |
_container.Register( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Test | |
[TestFixture] | |
public class TestSendMessageReceiveEvent | |
{ | |
private IWindsorContainer _container; | |
private readonly Guid _aggregateId = Guid.NewGuid(); | |
private static readonly ILog _Logger = LogManager.GetLogger(typeof (TestSendMessageReceiveEvent)); | |
private readonly ManualResetEvent _received = new ManualResetEvent(false); | |
public TestSendMessageReceiveEvent() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class TestSendMessageReceiveEventNoIoC | |
{ | |
private readonly Guid _aggregateId = Guid.NewGuid(); | |
private static readonly ILog Logger = LogManager.GetLogger(typeof (TestSendMessageReceiveEvent)); | |
private readonly ManualResetEvent _received = new ManualResetEvent(false); | |
public TestSendMessageReceiveEventNoIoC() | |
{ | |
BasicConfigurator.Configure(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let luhn (inp:string) = | |
let algo (s:string) = | |
Regex.Replace(s, "[^0-9]", "").ToCharArray() | |
|> Array.rev | |
|> Seq.map(int << string) | |
|> Seq.fold (fun (fldr,weight) num -> fldr + (num * weight) / 10 + (num * weight) % 10, weight % 2 + 1) (0,2) | |
|> fst | |
match inp with | |
| "" -> 0 | |
| _ -> 10 - (algo inp) % 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec sum list = | |
match list with | |
| [] -> 0; | |
| h::t -> h + sum t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function A(){ | |
promises1 = new Array(); | |
promises2 = new Array(); | |
for (var i = start; i < end; i++) | |
{ | |
B(someUri); | |
} | |
await(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Challenge https://groups.google.com/group/functional-programming-sthlm/browse_thread/thread/647165dc2d923529?hl=sv | |
// The record type Part | |
type Part = { | |
Heading : string; | |
Text : string; | |
IsColumnLayout : bool; | |
} | |
// Make some test data | |
let r = { Heading="Wide part"; Text="This is a wide part"; IsColumnLayout=false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec buildAppend (lst:int list) num = | |
if lst.Length < 30000 then | |
buildAppend (lst @ [num]) num | |
else | |
lst | |
let rec buildCons (lst:int list) num = | |
if lst.Length < 30000 then | |
buildCons (num::lst) num |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fibonacci = | |
seq{yield 0 | |
yield 1 | |
yield 1 | |
let rec fibo a b = | |
seq{yield (a + b) | |
yield! fibo b (a+b)} | |
yield! fibo 1 1 } |
OlderNewer