This file contains 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
interface Foo | |
of Bar | Baz | |
{} | |
interface Bar | |
satisfies Foo | |
{} | |
object barInstance satisfies Bar {} |
This file contains 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 ceylon.collection { | |
group | |
} | |
import ceylon.test { | |
assertEquals, | |
test | |
} | |
{String*} splitBy(Boolean(Character) predicate)(String input) | |
=> input.split(predicate); |
This file contains 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
/** | |
Anh Nhan's utilities library | |
Released under Apache v2.0 | |
Software provided as-is, no warranty | |
*/ | |
import ceylon.collection { | |
HashSet, |
This file contains 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
λ java -version | |
java version "1.7.0_11" | |
Java(TM) SE Runtime Environment (build 1.7.0_11-b21) | |
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode) | |
λ javac -version | |
javac 1.7.0_11 | |
λ ceylon -v | |
ceylon version 1.1.0 (Ultimate Ship The Second) |
This file contains 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
{ | |
init: function(elevators, floors) { | |
//# Elevator[] | |
var elevs = []; | |
//# Floor[] | |
var fls = []; | |
var equals = function (num) | |
{ | |
return function (el) |
This file contains 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
/** | |
Anh Nhan's utilities library | |
Released under Apache v2.0 | |
Software provided as-is, no warranty | |
*/ | |
import ceylon.test { | |
assertEquals, |
This file contains 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
// The column struct, with the array | |
struct Column | |
{ | |
State[] states; | |
private bool[State] _uniques; | |
bool add(ref State state) | |
{ | |
if (state in _uniques) | |
{ |
This file contains 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
<?php | |
function get_in(array $array, array $keys, $default = null) | |
{ | |
if (!$keys) { | |
return $array; | |
} | |
$current = $array; | |
foreach ($keys as $key) { |
This file contains 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
PS C:\Users\AnhNhan\Documents\dev\get-in> php -v | |
PHP 5.4.11 (cli) (built: Jan 16 2013 20:26:26) | |
Copyright (c) 1997-2013 The PHP Group | |
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies | |
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans | |
PS C:\Users\AnhNhan\Documents\dev\get-in> php .\benchmark.php | |
Time taken (single, not opt): 3.1025559902191 | |
Time taken (single, opt): 2.5755219459534 | |
Time taken (nested, not opt): 4.346479177475 |
This file contains 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
FDEL=4 | |
FILES=`s3cmd ls s3://hcaw/db/ | grep -Po "([a-zA-Z0-9|\/|\:]+\.(.*?))?$" | head -n $FDEL` | |
for fi in $FILES | |
do | |
s3cmd del $FI | |
done | |