I hereby claim:
- I am poetix on github.
- I am poetix (https://keybase.io/poetix) on keybase.
- I have a public key ASDdtm9fCHu0-fJArrQzHByuiG-rDxBbi1TeELZ3YLElBwo
To claim this, I am signing this object:
class Heap<T> { | |
selectMax: (l: T, r: T) => boolean; | |
data: T[]; | |
constructor(selectMax: (l: T, r: T) => boolean) { | |
this.selectMax = selectMax; | |
this.data = []; | |
} | |
length(): number { |
/** | |
* Given a start node and a function which provides an Iterable of adjacent nodes for any node, | |
* perform a breadth-first traversal of the graph and yield each visited node together with | |
* the minimum number of steps needed to reach that node from the start node. | |
*/ | |
function *bft<T>(start: T, adjacent: (node: T) => Iterable<T>): IterableIterator<[T, number]> { | |
const visited: Set<T> = new Set(); | |
const queue: T[] = [start]; | |
visited.add(start); | |
var depth = 1; |
module Lib | |
( playRepeatedly, | |
firstStep | |
) where | |
import System.IO | |
data GameStep = Guess { animalName :: String } | |
| Question { | |
question :: String, |
import itertools | |
from urllib import request | |
import os | |
if not os.path.isfile('count_1w.txt'): | |
request.urlretrieve( | |
"https://norvig.com/ngrams/count_1w.txt", | |
"count_1w.txt") |
public String ofNullableExample(Map<String, String> map) { | |
return Optional.ofNullable(map.get(key)) | |
.orElseThrow(() -> new ItemNotFoundException(key)); | |
} | |
public String nullCheckingExample(Map<String, String> map) { | |
String valueAtKey = map.get(key); | |
if (valueAtKey == null) { | |
throw new ItemNotFoundException(key); | |
} |
public final class Person { | |
// Publicly accessible, all parameters validated. | |
public static Person with(String name, int age, String favouriteColour) { | |
checkArgument(age > 0, "age must be greater than 0"); | |
return new Person( | |
checkNotNull(name, "name must not be null"), | |
age, | |
checkNotNull(favouriteColour, "favouriteColour must not be null") |
import { expect } from 'chai'; | |
import 'mocha'; | |
import { mock, instance, when, anyString, verify } from "ts-mockito"; | |
class HelloEndpoint { | |
constructor(private service: HelloService) {} | |
async handle(evt: any): Promise<any> { | |
const greeting = await this.service.sayHello(evt.queryStringParameters.name); | |
return { |
import { expect } from 'chai'; | |
import 'mocha'; | |
class HelloEndpoint { | |
constructor(private service: HelloService) {} | |
async handle(evt: any): Promise<any> { | |
const greeting = await this.service.sayHello(evt.queryStringParameters.name); | |
return { | |
body: greeting |
import { expect } from 'chai'; | |
import 'mocha'; | |
class HelloEndpoint { | |
constructor(private service: HelloService) {} | |
async handle(evt: any): Promise<any> { | |
const greeting = await this.service.sayHello(evt.queryStringParameters.name); | |
return { | |
statusCode: 200, |
I hereby claim:
To claim this, I am signing this object: