I hereby claim:
- I am eyas on github.
- I am eyas (https://keybase.io/eyas) on keybase.
- I have a public key ASAA-BJC35BzpVJ3h34r6dxKm5_WB126wVPWzA438NYViQo
To claim this, I am signing this object:
using System; | |
using System.Collections.Generic; | |
namespace Algorithms | |
{ | |
/// Edmonds Karp MaxFlow Algorithm | |
/// based on en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm | |
public class EdmondsKarp { | |
private int n = 0; |
/** | |
* Unpack-able variadic tuples in C++. You can use these classes to conviniently unpack | |
* tuple contents as an lvalue using the `unpack` function. | |
* | |
* Example: | |
* tuple<int, double, int> t(1, 5.0, 3); | |
* int x_1; double x_2; int x_3; | |
* unpack(x_1, x_2, x_3) = t; | |
*/ |
module simple { | |
export class Promise<T> { | |
public map<R>(func: (t: T) => R): Promise<R> { | |
var promise: Promise<R> = new Promise<R>(); | |
if (this.v !== undefined) promise.result(func(this.v)); | |
else if (this.e !== undefined) promise.result(this.e); | |
else { | |
this.tcb.push(t => { | |
promise.result(func(t)); | |
}); |
I hereby claim:
To claim this, I am signing this object:
function parseComment(comment: string): string { | |
const result: string[] = []; | |
const parser = new Parser({ | |
ontext: text => result.push(replace(text)), | |
onopentag: (tag, attrs) => { | |
switch (tag) { | |
case 'a': result.push(`{@link ${attrs['href']} `); break; | |
case 'em': case 'i': result.push('_'); break; | |
case 'strong': case 'b': reslt.push('__'); break; | |
// ... |
export class Class { | |
// ... | |
private baseNode(skipDeprecatedProperties: boolean, context: Context): | |
TypeNode { | |
// ... | |
const parentNode = /* ... */; | |
const isRoot = parentNode === null; | |
const propLiteral = createTypeLiteralNode([ | |
// Add an '@id' property for the root. |
- } else if (propLiteral.members.length > 0) { | |
- return propLiteral; | |
} else { | |
- return createTypeLiteralNode([]); | |
+ return propLiteral; | |
} |
// Top-level module: | |
const wellKnownTypes = [ ... ]; // Top-level var with more than one "Type". | |
const dataType = ...; | |
function ForwardDeclareClasses(topics: ReadonlyArray<TypedTopic>): ClassMap { | |
const classes = new Map<string, Class>(); | |
for (const wk of wellKnownTypes) { | |
classes.set(wk.subject.toString(), wk); | |
} | |
classes.set(dataType.subject.toString(), wk); |
- if (classes.size === 0) { | |
- throw new Error('Expected Class topics to exist.'); | |
- } |