I hereby claim:
- I am fcarriedo on github.
- I am fcarriedo (https://keybase.io/fcarriedo) on keybase.
- I have a public key ASBklMjeK0rC1A1be5sKj_7_METS6OdNPip_Ry9qQF79hQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
[[112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101], [216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201], [313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301], [415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401], [513, 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, 501], [612, 611, 610, 609, 608, 607, 606, 605, 604, 603, 602, 601], [709, 708, 707, 706, 705, 704, 703, 702, 701]]}
<div class="msg"> | |
<h3>Msg</h3> | |
<p>This is the message: </p> | |
<p><i>{{.}}</i></p> | |
</div> |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Created: March 23 2010 | |
Comments: | |
A very basic ant file for lib projects. | |
--> | |
<project name="Estation Prototype" basedir="." default="jar"> |
In a 20 thousand feet view, two persistent communication channels* will be maintained, one for commands generally coming from the ZoomShop (client) to the NCube (server) for dispensing, inventory requests, etc. in an RPC style and another one for events (in fire-and-forget style) which flow is to be started from the NCube (server) to the ZoomShop (client).
Having persistent connections benefits both parties as both can immediately detect when a connection was broken and take the appropriate measures.
On a related note, but not relevant to this document, both commands and events messages (see NCube Protocol Format > Messages) are to be serialized as XML documents.
*Note: Within this document, the term stream, socket connection and channel are treated as synonyms.
/** | |
* Returns a functions that ensures that only one call | |
* executes every given milliseconds. | |
*/ | |
function throttle(funct, time) { | |
var active = false; | |
return function() { | |
if(!active) { | |
active = true; | |
funct.apply(this, arguments); |
import java.util.List; | |
import java.util.ArrayList; | |
/** | |
* Temporal DB class. | |
* | |
* @author Francisco.Carriedo | |
* May 16, 2012 | |
*/ | |
public class DB { |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipOutputStream; | |
public class ZipUtil { | |
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; |
import com.sun.net.httpserver.*; | |
import java.net.*; | |
import java.io.*; | |
import java.util.*; | |
public class DemoServer { | |
public static void main(String[] args) throws Exception { | |
final int port = 8000; | |
HttpServer server = HttpServer.create( new InetSocketAddress("localhost", port), 10); | |
server.createContext("/stats", new MyHandler()); |
object HelloWorld { | |
def main(args: Array[String]) { | |
println("Hello world") | |
} | |
} |