This file contains hidden or 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
var mouseDown = Observable.FromEventPattern<MouseButtonEventArgs>(this, "MouseDown") | |
.Select(x => x.EventArgs.GetPosition(this)); | |
var mouseUp = Observable.FromEventPattern<MouseButtonEventArgs>(this, "MouseUp") | |
.Select(x => x.EventArgs.GetPosition(this)); | |
var mouseMove = Observable.FromEventPattern<MouseEventArgs>(this, "MouseMove") | |
.Select(x => x.EventArgs.GetPosition(this)); | |
mouseMove.SkipUntil(mouseDown) |
This file contains hidden or 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
<Application | |
x:Class="Approve.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" | |
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" | |
xmlns:local="clr-namespace:Approve"> | |
<!--Application Resources--> | |
This file contains hidden or 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
public class AreaFallowed | |
{ | |
public AreaFallowed(string gardenID, NodaTime.LocalDate date, int x, int y, int width, int length) | |
{ | |
GardenId = gardenID; | |
Date = date; | |
X = x; | |
Y = y; | |
Width = width; | |
Length = length; |
This file contains hidden or 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
XAML | |
--------------------------------------------------------------- | |
<ComboBox Grid.Row="0" x:Name="gardens" Margin="10" FontSize="24"> | |
<ComboBoxItem>New...</ComboBoxItem> | |
<ComboBoxItem>G1</ComboBoxItem> | |
<ComboBoxItem>G2</ComboBoxItem> | |
<ComboBoxItem>G3</ComboBoxItem> | |
</ComboBox> | |
This file contains hidden or 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
var canvasMouseOver = Rx.Observable.fromEvent(myCanvas, "mousedown"); | |
var canvasMouseWheel = Rx.Observable.fromEvent(myCanvas, "mousewheel"); | |
canvasMouseWheel.skipUntil(cavasMouseOver) | |
.subscribe(function (val) { | |
if (val.originalEvent.wheelDelta < 0) { | |
mainViewVM.incrementFrame(); | |
} | |
else { |
This file contains hidden or 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.Threading | |
let printBoard (grid:int[,]) = | |
let maxX = (Array2D.length1 grid) - 1 | |
let maxY = (Array2D.length2 grid) - 1 | |
for row in 0 .. maxX do | |
for col in 0 .. maxY do | |
if(grid.[row,col] = 1) then printf "*|" else printf " |" | |
printfn "" |
This file contains hidden or 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
//ounce | |
//gallon | |
[<Measure>] type gal | |
//lovibond | |
[<Measure>] type L | |
//pounds | |
[<Measure>] type lbs | |
//gc = grain color | |
//weight = grain weight in lbs |
This file contains hidden or 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
<script> | |
function getStudyMetadata() { | |
var promise = $.ajax({ | |
type: "GET", | |
url: "/study/metadata/{id}", | |
dataType: "json" | |
}).promise(); | |
return Rx.Observable.fromPromise(promise); | |
}; | |
This file contains hidden or 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
# Auto detect text files and perform LF normalization | |
* text=auto | |
# Custom for Visual Studio | |
*.cs diff=csharp |
This file contains hidden or 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
$appCmd = "C:\Program Files (x86)\IIS Express\appcmd.exe" | |
$result = Invoke-Command -Command {& $appCmd 'list' 'sites' '/text:SITE.NAME' } | |
for ($i=0; $i -lt $result.length; $i++) | |
{ | |
Invoke-Command -Command {& $appCmd 'delete' 'site' $result[$i] } | |
} |