This file contains hidden or 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::io::Write; | |
use std::thread::{self, sleep, JoinHandle}; | |
use std::time::Duration; | |
fn flush() { | |
std::io::stdout().flush().unwrap(); | |
} | |
fn main() { | |
let mut threads: Vec<JoinHandle<()>> = Vec::new(); |
This file contains hidden or 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
struct Atom { | |
position: [f32; 3], | |
epsilon: f32, | |
sigma: f32, | |
} | |
impl Atom { | |
fn new(x: f32, y: f32, z: f32, epsilon: f32, sigma: f32) -> Atom { | |
Atom { | |
position: [x, y, z], |
This file contains hidden or 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 bash | |
set -e | |
NIMAGES=8 | |
WD=`pwd` | |
while [ $# -gt 0 ] | |
do |
This file contains hidden or 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 hyper; | |
extern crate url; | |
static HOST: &'static str = "www.google.com"; | |
macro_rules! ret_err( | |
($e:expr) => {{ | |
match $e { | |
Ok(v) => v, | |
Err(e) => { println!("Line {}: {}", line!(), e); return; } |
This file contains hidden or 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
from ctypes import c_int, POINTER, cdll, Structure | |
import time | |
import socket | |
try: | |
import gevent | |
except ImportError: | |
gevent = False | |
dht_so = cdll.LoadLibrary("./libdht.so.1.0.1") |