I hereby claim:
- I am mlms13 on github.
- I am mulmus (https://keybase.io/mulmus) on keybase.
- I have a public key ASC1pfTBJTZEjJ8xXbxWGMnKwv5AyUjTCKvxW90-0NN3sgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
static var coins = [4, 3, 1]; | |
var computed = new Map(); // cache already-solved target amounts | |
// return the minimum number of coins needed to make change for the | |
// given target amount, using the list of coins above. Returns `None` | |
// for requests that don't make sense (target < smallest coin) | |
// break it into all possible sub-problems, and cache the result from computing those | |
// did i do it? is this dynamic programming? | |
function makeChange(target: Int, count: Int): Option<Int> { | |
return switch computed.getOption(target) { |
-- data NamedColor = Red | Green | Blue | |
-- data CustomColor = CustomColor | |
-- { r :: Int | |
-- , g :: Int | |
-- , b :: Int | |
-- } | |
-- data Color = NamedColor | CustomColor | |
create type custom_color as (r int, g int, b int); |
function match(arr: Array<ParenToken>, leftCount = 0): Bool { | |
return switch arr.getOption(0) { | |
case None: leftCount == 0; | |
case Some(LeftParen): match(arr.tail(), leftCount + 1); | |
case Some(RightParen): leftCount <= 0 ? false : match(arr.tail(), leftCount - 1); | |
}; | |
} | |
function tokenize(str: String): Array<ParenToken> { |
#! /usr/bin/env bash | |
color_black='\033[0;30m' | |
color_red='\033[0;31m' | |
color_green='\033[0;32m' | |
color_yellow='\033[0;33m' | |
color_blue='\033[0;34m' | |
color_purple='\033[0;35m' | |
color_cyan='\033[0;36m' | |
color_gray='\033[0;37m' |
var flat = [ | |
{ id: "A", name: "A", parent: "" }, | |
{ id: "B", name: "B", parent: "" }, | |
{ id: "C", name: "C", parent: "D" }, | |
{ id: "D", name: "D", parent: "B" }, | |
{ id: "E", name: "E", parent: "A" } | |
]; | |
function unflatten(list) { | |
return; //... |
var sections = [{ | |
id: "A", | |
flag: false, | |
subsections: [{ | |
id: "A1", | |
subsections: [{ | |
id: "A1a", | |
flag: true | |
}, { | |
id: "A1b" |
// Type definitions for Lovefield v2.0.62 | |
// Project: http://google.github.io/lovefield/ | |
// Definitions by: freshp86 <https://github.com/freshp86> | |
// Definitions: https://github.com/borisyankov/DefinitelyTyped | |
/// <reference path="../es6-promise/es6-promise.d.ts"/> | |
declare module lf { | |
export enum Order { ASC, DESC } |
// get names and ratings for BFZ cards from ChannelFireball | |
function getRatings() { | |
var list = [].slice.apply($('.postContent h1').not(":first").not(":last")); | |
return list.map(function(el) { | |
var rating = $(el).next().next().clone().find("b").remove().end().text() | |
return { | |
name: el.textContent, | |
rating: parseFloat(rating) | |
}; | |
}); |
function uphxlib | |
# upgrade normal haxe repositories | |
echo 'a' | haxelib upgrade | |
# keep track of the current directory | |
set current_dir (pwd) | |
# update all 'dev' repo git repositories | |
for lib in (haxelib list | cut -d: -f2- | grep 'dev:') | |
set dev_dir (echo $lib | rev | cut -c 2- | rev | cut -d '[' -f2- | cut -c5-) |