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
—– BEGIN LICENSE —– | |
Michael Barnes | |
Single User License | |
EA7E-821385 | |
8A353C41 872A0D5C DF9B2950 AFF6F667 | |
C458EA6D 8EA3C286 98D1D650 131A97AB | |
AA919AEC EF20E143 B361B1E7 4C8B7F04 | |
B085E65E 2F5F5360 8489D422 FB8FC1AA | |
93F6323C FD7F7544 3F39C318 D95E6480 | |
FCCC7561 8A4A1741 68FA4223 ADCEDE07 |
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
import inspect | |
def use_strict(func): | |
signature = inspect.signature(func) | |
def validate_args(*args): | |
params = signature.parameters.values() | |
types = map(lambda p: p.annotation, params) | |
zipped = zip(list(*args), types) |
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 | |
function tail($fn) | |
{ | |
$underCall = false; | |
$pool = []; | |
return function (...$args) use (&$fn, &$underCall, &$pool) { | |
$result = null; | |
$pool[] = $args; |
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
public static function tokenize($code) | |
{ | |
// Initial state of parser | |
$baseIter = function ($rest, $acc) use (&$baseIter, &$symbolIter, &$stringIter, &$commentIter) { | |
if (sizeof($rest) == 0) { | |
return $acc; | |
} | |
list ($head, $tail) = toHeadTail($rest); | |
switch ($head) { | |
// We got '(', so we just add it to list of lexemes. |
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
package biz.radioteria.flow.stream | |
import com.sun.org.apache.xpath.internal.operations.Bool | |
import junit.framework.TestCase | |
import java.io.ByteArrayOutputStream | |
import java.io.IOException | |
import java.io.OutputStream | |
class OutputStreamsTest : TestCase() { |
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
package biz.radioteria.flow.stream | |
import java.io.IOException | |
import java.io.OutputStream | |
import java.util.concurrent.LinkedBlockingQueue | |
import java.util.concurrent.ThreadPoolExecutor | |
import java.util.concurrent.TimeUnit | |
class NonblockingOutputStream(private val outputStream: OutputStream) : OutputStream() { |
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
package biz.radioteria.web.server | |
import biz.radioteria.web.request.Request | |
import biz.radioteria.web.request.RequestMethod | |
import com.sun.net.httpserver.HttpExchange | |
fun fromHttpExchange(httpExchange: HttpExchange): Request { | |
val method = httpExchange.requestMethod | |
val path = normalizedRequestPath(httpExchange.requestURI.path) | |
val query = httpExchange.requestURI.query ?: "" |
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
(define (square a) | |
(* a a)) | |
(define (cube a) | |
(* a a a)) | |
(define (abs a) | |
(if (< a 0) (- a) a)) | |
(define (average a b) |
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 | |
/** | |
* Define routes for your application in this file. | |
* Use $this keyword as Router instance. | |
* | |
* @var \Slang\Routing\Router $this | |
*/ | |
$this->get("/", "HomeController::index", ["name" => "home"]); |
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 | |
/** | |
* @author Roman Gemini <[email protected]> | |
* @date 25.03.2016 | |
* @time 15:54 | |
*/ | |
namespace Slang\Database\Fluorite\Concrete; | |