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
let GetAsync(url : string, i : int) = | |
async { | |
let req = WebRequest.Create(url) | |
let! rsp = req.AsyncGetResponse() | |
use stream = (rsp :?> HttpWebResponse).GetResponseStream() | |
use zip = new GZipStream(stream, CompressionMode.Decompress) | |
use reader = new StreamReader(zip) | |
Console.WriteLine("Received page " + i.ToString()) | |
return reader.ReadToEnd() | |
} |
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 ss = new AVSpeechSynthesizer(); | |
foreach(var voice in AVSpeechSynthesisVoice.GetSpeechVoices()) | |
{ | |
var su = new AVSpeechUtterance("Microphone check. One, two, one two.") { | |
Rate = AVSpeechUtterance.DefaultSpeechRate, | |
Voice = voice | |
}; | |
ss.SpeakUtterance(su); | |
} |
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 map = new MKMapView(); | |
var ctr = new CLLocationCoordinate2D(37.8, -122.4); | |
map.SetCenterCoordinate(ctr, false); | |
map.SetRegion(new MKCoordinateRegion(ctr, new MKCoordinateSpan(0.025, 0.025)), false); | |
Console.WriteLine("Center coordinate is still NaN: " + map.CenterCoordinate.Latitude.ToString()); | |
/* | |
Error: NaN Lat & Long var | |
circle = MKCircle.Circle(map.CenterCoordinate, 100); |
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 static double[,] ToRangePlusOrMinusOne(this byte[,] self) | |
{ | |
var ySize = self.GetLength(1); | |
var xSize = self.GetLength(0); | |
var dArr = new double[ySize, xSize]; | |
for(var y = 0; y < ySize; y++) | |
{ | |
for(var x = 0; x < xSize; x++) | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using System.Drawing; | |
using MonoTouch.CoreGraphics; | |
using MonoTouch.CoreAnimation; | |
using MonoTouch.AVFoundation; |
NewerOlder