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
typedef struct HCountedArray_ { | |
size_t capacity; | |
size_t used; | |
HArena * arena; | |
struct HParsedToken_ **elements; | |
} HCountedArray; | |
typedef struct HBytes_ { | |
const uint8_t *token; | |
size_t len; |
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
enum HParserBackend { | |
PB_MIN = 0, | |
PB_PACKRAT = PB_MIN, // PB_MIN is always the default. | |
PB_REGULAR, | |
PB_LLk, | |
PB_LALR, | |
PB_GLR, | |
PB_MAX = PB_GLR | |
} |
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
use std::fmt::Show; | |
trait Mappable<T> { | |
fn each<'r>(&self, f: &mut |&T|: 'r -> ()); | |
fn map<'r, B>(&self, f: &mut |&T|: 'r -> B) -> Vec<B>; | |
} | |
enum BinaryTree<T> { | |
Leaf(T), |
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 init_parser() -> *mut h::HParser { | |
unsafe { | |
let token1 = h::h_token(hello.as_ptr(), from_uint(hello.char_len()).expect("uint conversion failed")); | |
let token2 = h::h_token(world.as_ptr(), from_uint(world.char_len()).expect("uint conversion failed")); | |
let token3 = h::h_token(there.as_ptr(), from_uint(there.char_len()).expect("uint conversion failed")); | |
let token4 = h::h_token(bang.as_ptr(), from_uint(bang.char_len()).expect("uint conversion failed")); | |
h::h_sequence(token1, h::h_choice(token2, token3, token4, ptr::null<h::HParser>()) , ptr::null<h::HParser>()) | |
} | |
} |
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 crate libc; | |
use std::num::{ from_uint }; | |
use std::ptr; | |
use std::mem; | |
use std::io::stdio; | |
use h = hammerll; | |
static hello : &'static str = "Hello "; | |
static world : &'static str = "World"; | |
static there : &'static str = "there"; |
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
#include <pthread.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/resource.h> | |
#define STACKSIZE (16 * 1024) | |
#define NUM_THREADS 100000 | |
#define getlimit(x) getrlimit(RLIMIT_##x, &limit); printf("%s current: %lu, max: %lu\n", #x, limit.rlim_cur, limit.rlim_max); | |
void *do_nothing(void *args) | |
{ |
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
execute pathogen#infect() | |
" set UTF-8 encoding | |
set enc=utf-8 | |
set fenc=utf-8 | |
set termencoding=utf-8 | |
" disable vi compatibility (emulation of old bugs) | |
set nocompatible | |
" use indentation of previous line | |
set autoindent |
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
22:37:31.976 [sparkDriver-akka.actor.default-dispatcher-3] DEBUG o.a.s.s.BlockManagerMasterActor - [actor] handled message (0.072741 ms) ExpireDeadHosts from Actor[akka://sparkDriver/user/BlockManagerMaster#273583151] | |
22:37:32.376 [sparkDriver-akka.actor.default-dispatcher-13] DEBUG o.a.s.s.c.SparkDeploySchedulerBackend - [actor] received message ReviveOffers from Actor[akka://sparkDriver/user/CoarseGrainedScheduler#-801996212] | |
22:37:32.377 [sparkDriver-akka.actor.default-dispatcher-13] DEBUG o.a.s.s.c.SparkDeploySchedulerBackend - [actor] handled message (0.327742 ms) ReviveOffers from Actor[akka://sparkDriver/user/CoarseGrainedScheduler#-801996212] | |
22:37:33.376 [sparkDriver-akka.actor.default-dispatcher-13] DEBUG o.a.s.s.c.SparkDeploySchedulerBackend - [actor] received message ReviveOffers from Actor[akka://sparkDriver/user/CoarseGrainedScheduler#-801996212] | |
22:37:33.377 [sparkDriver-akka.actor.default-dispatcher-13] DEBUG o.a.s.s.c.SparkDeploySchedulerBackend - [actor] handled message (0.343444 ms) ReviveO |
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
main : Element | |
main = plotAxis 580 300 "time - minutes" "events" | |
plotAxis w h xLabel yLabel = | |
let lineWidth = 2 | |
labelHeight = 10 | |
arrowSize = 6 | |
ylen = toFloat (h-lineWidth-2*arrowSize-4*labelHeight) | |
xlen = toFloat (w-lineWidth-2*arrowSize-4*labelHeight) | |
maxX = 100 |
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
trait Strategy<Output> { | |
fn send(&self, item: Result<&Output>); | |
fn accept(&mut self, sub: &Subscriber<Output>) -> Option<uint>; | |
} | |
type Sub<I> = (Subscription, Subscriber<I>); | |
//This is the most basic strategy which only accepts a single subscriber | |
struct SingleStrategy<O> { | |
subscriber: Option<Sub<O>>, |
OlderNewer