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 io_client = require('socket.io-client'); | |
host = 'localhost'; | |
port = 8001; | |
var url = "http://" + host + ":" + port; | |
var client = io_client.connect(url); | |
console.log("Attempting to connect with server@" + host + ":" + port); | |
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
extern mod extra; | |
use extra::treemap::TreeMap; | |
fn main(){ | |
let mut map : ~TreeMap<~str, ~str> = ~TreeMap::new(); | |
map.swap(~"dog", ~"cat"); | |
let value : &~str = map.find(&~"dog").unwrap(); | |
println!("dog -> {:s}", *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
extern mod extra; | |
use extra::treemap::TreeMap; | |
use extra::json::{Json,Object}; | |
enum NestedSearchError { | |
NoSuchAncestor(~str), | |
NoSuchKey, | |
TypeMismatch | |
} |
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
extern mod extra; | |
use extra::treemap::TreeMap; | |
use extra::json::{Json,Object,from_str}; | |
/* | |
fn find_nested_string(&self, key_iterator: I) -> Result<V, NestedSearchError>; | |
fn find_nested_number(&self, key_iterator: I) -> Result<V, NestedSearchError>; | |
fn find_nested_boolean(&self, key_iterator: I) -> Result<V, NestedSearchError>; | |
fn find_nested_list(&self, key_iterator: I) -> Result<V, NestedSearchError>; |
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": { | |
"view_items": [ | |
{ | |
"node": [ | |
"ViewItemUse", | |
[ | |
{ | |
"node": [ | |
"ViewPathGlob", |
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
fn main(){ | |
let json_value = from_str("{\"dog\" : \"cat\"}").unwrap(); | |
let keys = &[ | |
&~"1", &~"2", &~"3", &~"4", &~"5", &~"6", &~"7", &~"8", &~"9", &~"10", | |
&~"11", &~"12", &~"13", &~"14", &~"15", &~"16", &~"17", &~"18", &~"19", &~"20", | |
&~"21", &~"22", &~"23", &~"24", &~"25", &~"26", &~"27", &~"28", &~"29", &~"30", | |
&~"31", &~"32", &~"33", &~"34", &~"35", &~"36", &~"37", &~"38", &~"39", &~"40", | |
&~"41", &~"42", &~"43", &~"44", &~"45", &~"46", &~"47", &~"48", &~"49", &~"50" |
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
#![feature(globs)] | |
extern crate mio; | |
use mio::*; | |
use mio::net::*; | |
use mio::net::tcp::*; | |
const SERVER: Token = Token(0); | |
struct Server { |
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/python | |
import socket, time | |
connections = [] | |
for i in range(10000): | |
s = socket.socket() | |
s.connect(("localhost", 44444)) | |
connections.append(s) | |
if len(connections) % 100 == 0: | |
print "Connections: " + str(len(connections)) | |
print "Sleeping" |
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
pub trait ToMessageHandler { | |
fn to_message_handler<'a>(self) -> Box<MessageHandler + 'a>; | |
} | |
impl <'b, F> ToMessageHandler for F where F : Fn(&Frame) -> AckOrNack + 'b { | |
fn to_message_handler<'a>(self) -> Box<MessageHandler + 'a> { | |
Box::new(ClosureMessageHandler{closure : self}) as Box<MessageHandler> | |
} | |
} |
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
$ ./mach build | |
Usage: git submodule [--quiet] add [-b branch] [-f|--force] [--reference <repository>] [--] <repository> [<path>] | |
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...] | |
or: git submodule [--quiet] init [--] [<path>...] | |
or: git submodule [--quiet] update [--init] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...] | |
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...] | |
or: git submodule [--quiet] foreach [--recursive] <command> | |
or: git submodule [--quiet] sync [--] [<path>...] | |
Error running mach: |
OlderNewer