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
<connectors> | |
<http-connector name="http-connector" socket-binding="http"> | |
<param key="http-upgrade-endpoint" value="http-acceptor"/> | |
</http-connector> | |
<http-connector name="http-connector-throughput" socket-binding="http"> | |
<param key="http-upgrade-endpoint" value="http-acceptor-throughput"/> | |
<param key="batch-delay" value="50"/> | |
</http-connector> | |
<in-vm-connector name="in-vm" server-id="0"/> | |
</connectors> |
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
def foo(stuff): | |
return stuff | |
def bar(stuff): | |
return 3 * stuff | |
def f(func, stuff): | |
return 2 * func(stuff) | |
f(bar, 5) # => |
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
function sum(x){ | |
return function(y){ | |
return x + y; | |
}; | |
} | |
sum(2)(3); | |
// or alternatively |
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
<html> | |
<head> | |
<title><?php echo $title;?></title> | |
</head> | |
<body> | |
<?php include $sub_template; ?> | |
</body> | |
</html> |
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
quicksort [] = [] | |
quicksort (x:xs) = | |
let smallerSorted = quicksort [a | a <- xs, a <= x] | |
biggerSorted = quicksort [a | a <- xs, a > x] | |
in smallerSorted ++ [x] ++ biggerSorted |
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 | |
foreach($rows as $row) { | |
$name = $row['name']; | |
$date = $row['date']; | |
include('tr_partial.php') | |
} |
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 | |
class A { | |
public $foo = 1; | |
public $bar = 2; | |
public $veryverylongattrnamethatisridiculouslylongthankyouautocomplete = 3; | |
} | |
$a = new A; | |
$b = new SplFixedArray(3); |
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
(fn stepper (state _) | |
(let [pc (:state :pc) | |
instrs (:state :instructions) | |
instr (:instrs pc)] | |
(cond | |
((=== (:instr 0) :jmp) {:pc (:instr 1), :instructions instrs})))) | |
(reduce #stepper [[:jmp 1] [:jmp 0]] (infinity)) |
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
(ns stream-play) | |
(use pharen.io.async as io) | |
(let | |
[addr (gethostbyname "www.example.com") | |
client (stream_socket_client (. "tcp://" addr ":80") | |
errno error-msg 30 | |
(| STREAM_CLIENT_CONNECT STREAM_CLIENT_ASYNC_CONNECT)) | |
read (arr [client]) | |
write (arr [client]) |
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 | |
declare(ticks=10); | |
// A function called on each tick event | |
class Counter { | |
static $a = 0; | |
static $b = 0; | |
} |
NewerOlder