Implements:
- Basic in-memory blockchain
- Basic Proof of work
- Methods to serialize/deserialize complete chain
Again none of this is supposed to be production ready.
Original tweet size in JSON 2624 Msgpack = 1817 Gzip + Json = 1058 Gzip + Msgpack = 1116 LZ4 + Json = 1628 LZ4 + Msgpack = 1361 | |
Original tweet size in JSON 1863 Msgpack = 1443 Gzip + Json = 0783 Gzip + Msgpack = 0835 LZ4 + Json = 1153 LZ4 + Msgpack = 1040 | |
Original tweet size in JSON 2074 Msgpack = 1670 Gzip + Json = 0842 Gzip + Msgpack = 0894 LZ4 + Json = 1229 LZ4 + Msgpack = 1139 | |
Original tweet size in JSON 2025 Msgpack = 1617 Gzip + Json = 0845 Gzip + Msgpack = 0895 LZ4 + Json = 1238 LZ4 + Msgpack = 1143 | |
Original tweet size in JSON 2069 Msgpack = 1663 Gzip + Json = 0846 Gzip + Msgpack = 0901 LZ4 + Json = 1243 LZ4 + Msgpack = 1164 | |
Original tweet size in JSON 2035 Msgpack = 1634 Gzip + Json = 0852 Gzip + Msgpack = 0907 LZ4 + Json = 1247 LZ4 + Msgpack = 1167 | |
Original tweet size in JSON 1988 Msgpack = 1464 Gzip + Json = 0804 Gzip + Msgpack = 0862 LZ4 + Json = 1220 LZ4 + Msgpack = 1061 | |
Original tweet size in JSON 1910 Msgpack = 1502 Gzip + Json = 0775 Gzip + Msgpack = 0832 LZ4 + Json = 1154 LZ4 + Msgpack = 1060 |
# for neater URLS like /{text}/{size}/{bg} | |
RewriteEngine on | |
RewriteRule ^img/([^/]+)/(\d+)/([a-fA-F0-9]{6})$ i/index.php?text=$1&size=$2&bg=$3 [NC,QSA] | |
RewriteRule ^img/([^/]+)/(\d+)$ i/index.php?text=$1&size=$2 [NC,QSA] | |
RewriteRule ^img/([^/]+)$ i/index.php?text=$1 [NC,QSA] | |
RewriteRule ^img/([^/]+)/.+$ i/index.php?text=$1 [NC,QSA] |
/** | |
* Copyright 2017 Zohaib Sibte Hassan | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |
Slow network time in seconds (100Mbps): | |
LZ4/Write takes: 0.2853062963485718 | |
LZ4/Read takes: 0.3265376162528992 | |
QLZ/Write takes: 0.31065379858016967 | |
QLZ/Read takes: 0.4505005311965942 | |
ZSTD/Write takes: 0.1596823501586914 | |
ZSTD/Read takes: 0.2516604351997376 | |
ZLIB/Write takes: 0.3231374764442444 | |
ZLIB/Read takes: 0.2478048324584961 | |
UC/Write takes: 0.7657859945297241 |
''' | |
Copyright (c) 2013 Zohaib Sibte Hassan | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
<?php | |
$x = function($bar, $foo="9") { | |
echo $foo, $bar, "\n"; | |
}; | |
class MissingArgumentException extends Exception { | |
} | |
function call_user_func_named_array($method, $arr){ |
Javascript #router. Features:
package luna.lib | |
import io.lettuce.core.RedisClient | |
import io.lettuce.core.RedisException | |
import io.lettuce.core.cluster.RedisClusterClient | |
import io.lettuce.core.cluster.api.sync.RedisClusterCommands | |
import org.jgroups.Address | |
import org.jgroups.annotations.MBean | |
import org.jgroups.annotations.Property | |
import org.jgroups.conf.ClassConfigurator |
object Stopwatch { | |
inline fun elapse(callback: () -> Unit): Long { | |
var start = System.currentTimeMillis() | |
callback() | |
return System.currentTimeMillis() - start | |
} | |
inline fun elapseNano(callback: () -> Unit): Long { | |
var start = System.nanoTime() |