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 | |
/** | |
* Created by PhpStorm. | |
* User: Roman | |
* Date: 24.02.2016 | |
* Time: 9:45 | |
*/ | |
namespace App\Dao; |
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 | |
/** | |
* @author Roman Gemini <[email protected]> | |
* @date 25.03.2016 | |
* @time 15:56 | |
*/ | |
namespace Slang\Database\Fluorite\Concrete; | |
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 | |
/** | |
* @author Roman Gemini <[email protected]> | |
* @date 25.03.2016 | |
* @time 15:54 | |
*/ | |
namespace Slang\Database\Fluorite\Concrete; | |
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 | |
/** | |
* 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 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 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 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 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 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 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; |
OlderNewer