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
function Shape(x, y) { | |
this.x = x; | |
this.y = y; | |
} | |
Shape.prototype.toString = function() { | |
return 'Shape at ' + this.x + ', ' + this.y; | |
}; | |
function Circle(x, y, r) { |
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
import pyuv | |
def on_close(tcp): | |
print "closed" | |
def on_read(tcp, data): | |
print "read" | |
if data is None: | |
tcp.close(on_close) | |
else: |
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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import socket | |
import time | |
import struct | |
import datetime | |
def calculate_checksum(s): | |
csum = reduce(lambda a,b: 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
[color] | |
ui = auto | |
[core] | |
pager = lv -c |
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
var net = require('net') | |
console.log("main") | |
var client = net.connect(8080, function() { | |
console.log("connected") | |
var req_message = "GET / HTTP/1.0\r\n\r\n" | |
client.write(req_message) | |
}); |
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
net = require 'net' | |
console.log "main" | |
client = net.connect 8080, ()-> | |
console.log "connected" | |
req_message = "GET / HTTP/1.0\r\n\r\n" | |
client.write req_message | |
client.on 'data', (data) -> |
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
events = require 'events' | |
initiator = new events.EventEmitter | |
class Pipe extends events.EventEmitter | |
constructor: (@name)-> | |
@queue = [] | |
recv: (event, value) => | |
@queue.push(value) |
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
-module(systolic_simulator2). | |
-export([run/0, cell/6, input/3, terminator/0]). | |
input(AB, Next, [])-> | |
Next ! {AB, stop}; | |
input(AB, Next, Seq)-> | |
[Head | Rest] = Seq, | |
Next ! {AB, Head}, | |
input(AB, Next, Rest). |
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
-module(systolic_simulator3). | |
-export([run/0, pipe/3, terminator/0, cell/2, cell/4, input/3]). | |
input(AB, Next, [])-> | |
Next ! {AB, stop}; | |
input(AB, Next, Seq)-> | |
[Head | Rest] = Seq, | |
Next ! {AB, Head}, | |
input(AB, Next, Rest). |
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
<type 'instance'> __main__.A True True | |
<class '__main__.B'> <class '__main__.B'> True True | |
<type 'int'> <type 'int'> False False | |
<type 'tuple'> <type 'tuple'> False False | |
<type 'list'> <type 'list'> False False | |
<type 'dict'> <type 'dict'> False False | |
<class '__main__.DD'> <class '__main__.DD'> True True | |
<type 'bool'> <type 'bool'> False False |
OlderNewer