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
-module(heathrow). | |
-compile([debug_info, export_all]). | |
mainFunc() -> | |
BottomGraphVal = {{0,[]},{0,[]}}, | |
MoveCosts = [{50, 10, 30}, {5, 90, 20}, {40, 2, 25}, {10, 8,0}], | |
AccIn = {BottomGraphVal, [], []}, |
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
-- [output function | generators/predicates] | |
-- like this | |
[ x * 2| x <- [1..4]] | |
-- can be read as take x and multiply it with two, and get x from the list consisting of 1 to 4. | |
-- [2,4,6,8] | |
-- or like this | |
[ (x * 2, y - 3)| x <- [1..3], y <- [2..4]] | |
--[(2,-1),(2,0),(2,1),(4,-1),(4,0),(4,1),(6,-1),(6,0),(6,1)] |
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
:load | |
--used like | |
:load myFirstProgram.hs | |
-- Good one to note, including packages is different and done with<br /> | |
:import | |
-- used like | |
:import Data.List |
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
:set +t | |
:unset + |
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
var q = 'http://gas-unit.googlecode.com/svn/trunk/gas-unit/gasUnit.js'; | |
var s = UrlFetchApp.fetch(q).getContentText(); | |
eval(s); | |
function runFindRightAssertions() { | |
var testFixture = new TestFixture('Tests on findRight function'); | |
testFixture.addTest( |
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
// inspired by Chris Rae's VBA site: http://chrisrae.com/vba/ | |
function findRight(findIn, findWhat) { | |
var findLoc=0; | |
for(findLoc=(findIn.length - findWhat.length + 1);findLoc>=1;findLoc--) | |
{ | |
if (findIn.substring(findLoc,(findLoc + findWhat.length)) === findWhat) {return findLoc;} | |
} | |
return -1; | |
} |
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 random = new System.Random() | |
Seq.initInfinite (fun _ -> (random.NextDouble(), random.Next(500, 10000))) | |
|> Seq.filter (fun (x,y) -> x < 0.5) | |
|> Seq.take 5 | |
|> Seq.iter (fun elem -> printfn "%A" elem) | |
printfn "" |
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] | |
public void StringFormat6() { | |
string x = "hello"; | |
string y = "jello".Replace("j", "h"); | |
Assert.AreNotSame(x, y); | |
string z = string.Intern(y); | |
Assert.AreSame(x, z); | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
namespace RestTestApp | |
{ | |
internal class Program |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace EulerPalindrome { | |
class Program { | |
static void Main(string[] args) { | |
string test2 = "Anna"; |
NewerOlder