Suppose we want a set of unique { x, y } points to plot on a graph.
this expression:
new Set([
{ x: 1, y: 1 },
{ x: 1, y: 1 },
]);Suppose we want a set of unique { x, y } points to plot on a graph.
this expression:
new Set([
{ x: 1, y: 1 },
{ x: 1, y: 1 },
]);| export type Either<E, A> = [E, null] | [null, A]; | |
| type Fn<A, B> = (a: A) => B; | |
| export const left = <E, A>(e: E): Either<E, A> => [e, null]; | |
| export const right = <E, A>(a: A): Either<E, A> => [null, a]; | |
| export const isLeft = <E, A>(e: Either<E, A>): e is [E, null] => e[1] === null; | |
| export const isRight = <E, A>(e: Either<E, A>): e is [null, A] => e[0] === null; |
| #!/usr/bin/env python | |
| ## Decodes NTLM "Authenticate" HTTP-Header blobs. | |
| ## Reads the raw blob from stdin; prints out the contained metadata. | |
| ## Supports (auto-detects) Type 1, Type 2, and Type 3 messages. | |
| ## Based on the excellent protocol description from: | |
| ## <http://davenport.sourceforge.net/ntlm.html> | |
| ## with additional detail subsequently added from the official protocol spec: | |
| ## <http://msdn.microsoft.com/en-us/library/cc236621.aspx> | |
| ## |
| // this function assumes the CSV has no fields with commas, | |
| // and strips out all the double quotes | |
| function parseCsvResponse(csvString) { | |
| var retArray = []; | |
| var strLines = csvString.split(/\n/g); | |
| var strLineLen = strLines.length; | |
| for (var i = 0; i < strLineLen; i++) { | |
| var line = strLines[i]; | |
| if (line != '') { |