-
Install Putty
-
Connect to server over ssh
-
Login with username then password
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
//How can we do this imperitive process with Haskell/Purescript style functions? | |
//Examples | |
// > generateQuestions([1,2,3,4,5,6,7,8])(3)(2) | |
// [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] | |
// > generateQuestions([1,2,3,4,5])(2)(4) | |
// [ [ 1, 2 ], [ 3, 4 ], [ 5, 1 ], [ 2, 3 ] ] |
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.Linq; | |
using System.Collections.Generic; | |
namespace DearCSharpYouLose { | |
public static class FuncExtension { | |
public static Func<A, C> Select<A, B, C>(this Func<A, B> f, Func<B, C> g) { | |
return a => g(f(a)); | |
} |
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
{-# OPTIONS_GHC -fwarn-incomplete-patterns -Werror #-} | |
-- Show | |
-- p1 = | |
-- ... | |
-- method(f,f) | |
-- ... | |
-- p2 = | |
-- ... |
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
//Local Declaration | |
Func<string> returnsString = () => ""; | |
Func<int, int> takesIntReturnsInt = i => i * 2; | |
//Class-Level Declaration | |
//Generic Params |
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
Download `cabal-install-2.2.0.0-x86_64-apple-darwin-sierra.tar.gz` | |
Extract | |
Run: | |
Gregs-MacBook-Pro:downloads huck$ ./cabal --version | |
cabal-install version 2.2.0.0 | |
compiled using version 2.2.0.1 of the Cabal library | |
Gregs-MacBook-Pro:downloads huck$ ./cabal install Cabal cabal-install | |
Warning: Parsing the index cache failed (Unknown encoding for constructor). | |
Trying to regenerate the index cache... |
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 map = (f, o) => { | |
//o must be an object | |
let keys = Object.keys(o); | |
let ret = {}; | |
for (let i = 0; i <= keys.length - 1; i++) { | |
let key = keys[i]; | |
let val = o[key]; | |
ret[key] = f(val, key); | |
} | |
return ret; |
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
import Data.Traversable | |
main = | |
traverse print (genAll 'J') | |
-- [_,_,A,_,_] | |
-- [_,B,_,B,_] | |
-- [C,_,_,_,C] | |
-- [_,B,_,B,_] | |
-- [_,_,A,_,_] |
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
buildFeaturePreview(vehicle: IVehicle): string { | |
let mpg = this.shouldShowMpg(vehicle) ? `${vehicle.MPGCity} / ${vehicle.MPGHighway} MPG` : null; | |
let features = vehicle.HighlightedFeatures.map(feature => feature.description); | |
return [mpg, | |
...features] | |
.filter(isDefinedAndNotNull) | |
.join(', ') | |
'...'; | |
} |