This file contains hidden or 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
Parameters: | |
Domain: | |
Description: Domain for hosted zone, e.g. example.com | |
Type: String | |
Resources: | |
WebHostedZone: | |
Type: AWS::Route53::HostedZone |
This file contains hidden or 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
(defun rle-encode (lst) | |
(reverse (rle-lib-encode lst nil))) | |
(defun rle-lib-encode (lst acc) | |
(if (null lst) | |
acc | |
(let ((curr (car lst)) | |
(prev (car acc)) | |
(cnt (car (cdr acc)))) | |
(if (equal curr prev) |
This file contains hidden or 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
-module(rle). | |
-export([encode/1]). | |
-export([decode/1]). | |
encode(List) -> | |
lists:flatten(lists:foldr( | |
fun (Prev, [[Count, Prev]|Rest]) -> | |
[[Count + 1, Prev]|Rest]; | |
(Current, Acc) -> |
This file contains hidden or 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
-module(perftest). | |
-export([test_avg/4]). | |
test_avg(M, F, A, N) when N > 0 -> | |
L = test_loop(M, F, A, N, []), | |
Length = length(L), | |
Min = lists:min(L), | |
Max = lists:max(L), | |
Med = lists:nth(round((Length / 2)), lists:sort(L)), |
This file contains hidden or 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
-module(binary2). | |
-export([joinl/2]). | |
-export([joinfl/2]). | |
-export([joinfr/2]). | |
% use list comprehension | |
joinl([], Sep) when is_binary(Sep) -> | |
<<>>; | |
joinl([H|T], Sep) -> |
This file contains hidden or 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 | |
/** | |
* Inverts a given matrix | |
* | |
* @param array $A matrix to invert | |
* @param boolean $debug whether to print out debug info | |
* | |
* @return array inverted matrix | |
*/ |
This file contains hidden or 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> | |
<body> | |
<h1>Test Peb Page</h1> | |
<p>This page starts a session and keeps a counter in a session variable.</p> | |
<p>It uses kvstore application to store PHP sessions in Erlang Mnesia.</p> | |
<div><a href="test-peb-session.php">Reload this page</a> to increment the counter.</div> | |
<?php | |
interface SessionHandlerInterface {} |