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::net::{TcpListener, TcpStream, Shutdown, | |
ToSocketAddrs, SocketAddr, IpAddr, | |
Ipv4Addr, Ipv6Addr}; | |
use std::collections::HashMap; | |
use std::{thread, time}; | |
use std::io::{Read, Write, ErrorKind}; | |
use std::env; | |
use std::str; | |
static DEFAULT_ADDR:&'static str = "localhost:12001"; |
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::net::{TcpListener, TcpStream, Shutdown, | |
ToSocketAddrs, SocketAddr, IpAddr, | |
Ipv4Addr, Ipv6Addr}; | |
use std::collections::HashMap; | |
use std::{thread, time}; | |
use std::io::{Read, Write, ErrorKind}; | |
use std::env; | |
use std::str; | |
//use hello_world::objects::DataObject; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
size_t | |
hash(const void *str, size_t size) | |
{ | |
size_t hash = 5381; | |
unsigned char 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
use std::sync::atomic::{AtomicU16, AtomicU8, AtomicPtr, Ordering}; | |
fn store_ptr(obj:*mut i32, ptr:&AtomicPtr<i32>) { | |
ptr.store(obj, Ordering::SeqCst); | |
} | |
fn load_ptr(ptr:&AtomicPtr<i32>) -> *mut i32 { | |
ptr.load(Ordering::SeqCst) | |
} |
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 <atomic> | |
#include <thread> | |
#include <chrono> | |
#include <cstdint> | |
#include <limits> | |
#include <cassert> | |
#include <cstdio> | |
struct HazardNode { | |
std::atomic<void*> ptr = nullptr; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdarg.h> | |
#include <stdint.h> | |
#include <assert.h> | |
static const char* GRAPH_LABEL_FIELD = "_NLABEL"; | |
static const char* GRAPH_ROOT_NAME = "_RGRAPH"; | |
static const char* GRAPH_ROOT_VAL = "1"; |
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 GraphEdge = String; | |
type GraphRelation = String; | |
type GraphEdgeMap = HashMap<GraphRelation, HashSet<GraphEdge>>; | |
fn main() { | |
println!("Hello, world!"); | |
} |
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::rc::Rc; | |
use std::sync::{RwLock, Arc}; | |
use std::thread; | |
use std::collections::HashMap; | |
use std::collections::HashSet; | |
use std::fmt; | |
use std::clone::Clone; | |
fn main() { |
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::rc::Rc; | |
use std::sync::{RwLock, Arc}; | |
use std::thread; | |
use std::collections::HashMap; | |
use std::collections::HashSet; | |
use std::fmt; | |
use std::clone::Clone; | |
#[derive(Debug)] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Runner Game</title> | |
<style> | |
canvas { background: #eee; | |
display: block; | |
margin: 0 auto; | |
} | |
</style> |
NewerOlder