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
import Mouse | |
import Window | |
-- Mouse.isDown is true whenever the left mouse button | |
-- is pressed down and false otherwise. | |
--MODEL | |
type Points = [(Int,Int)] | |
--UPDATE |
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
import List | |
import Mouse | |
import Window | |
--MODEL | |
defaultBall = {x = 0, y = 0, v = toFloat 0, angle = toFloat 0} | |
--UPDATE | |
location t b = { b | x <- b.x - t * b.v * cos b.angle, | |
y <- b.y - t * b.v * sin b.angle } |
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
import String | |
import Graphics.Input (Input, input) | |
import Graphics.Input.Field as Field | |
xaxis = segment (-150,-100) (150,-100) | |
yaxis = segment (-150,-100) (-150,100) | |
content : Input Field.Content | |
content = input Field.noContent | |
field = Field.field Field.defaultStyle content.handle id "Type here!" <~ content.signal |
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
import Keyboard | |
import Window | |
import Graphics.Input (Input, input, button, dropDown) | |
import Graphics.Input.Field (Content, noContent, field, defaultStyle, Forward, Backward) | |
-- MODEL | |
data Direction = North | East | South | West | |
type Robot = {x:Int, y:Int, dir:Direction} | |
type Board = [(Int,Int)] | |
type Game = {robot:Robot, board:Board} |
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
import Basics | |
import Keyboard | |
import Random | |
--MODEL | |
background = {width = 500.0, height = 500.0, color = black} | |
paddle1 = {width = background.height/30, height = background.height/7, x = 20-background.width/2, y = 0.0} | |
paddle2 = {paddle1 | x <- background.width/2 - 20} | |
ball = {side = paddle1.height/5, x = 0, y = 0, vx = 1, vy = 0.3} | |
--UPDATE |
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
open System | |
open System.Windows.Forms | |
open System.Drawing | |
//************Number of cells and dimensions************ | |
let cellSide = 10 | |
let noOfCellsInOneDir = 16 | |
let side = cellSide * noOfCellsInOneDir | |
let totNoOfCells = pown noOfCellsInOneDir 2 | |
//***********Helper functions******************** | |
let mapMatrix matrix = (List.map >> List.map) matrix |
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 quickSort l = | |
match l with | |
| [] -> [] | |
| x::xs -> xs |> List.partition (fun y -> y < x) |> function (ltx,gtx) -> (quickSort ltx)@x::quickSort gtx |
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() |
OlderNewer