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 dimensioned as dim; // it doesn't compile anyway but you need to know this | |
use dim::Sqrt; | |
use dim::si::Unitless; | |
use dim::typenum::{Diff, Prod, Quot, Sum}; | |
use rand::Rng; | |
use std::ops::{Add, Div, Mul, Sub}; | |
#[derive(Debug, Clone, Copy)] | |
pub struct Vec3<T> { | |
pub x: T, |
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
Traceback (most recent call last): | |
File "/home/kimockb/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 162, in make_fid | |
fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl) | |
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper | |
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper | |
File "h5py/h5f.pyx", line 78, in h5py.h5f.open | |
OSError: Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable') | |
During handling of the above exception, another exception occurred: |
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
#![feature(untagged_unions)] | |
#[repr(C)] | |
struct MyVec<T> { | |
data: *mut *const T, | |
length: usize, | |
capacity: usize, | |
} | |
union TinyPtrVec<T> { |
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 rustfft; | |
extern crate num_complex; | |
extern crate gnuplot; | |
use num_complex::Complex; | |
use gnuplot::*; | |
use rustfft::FFT; | |
fn main() { | |
// create an rv and ccf to convolve |
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
#[macro_use] | |
extern crate bencher; | |
extern crate rayon; | |
use rayon::prelude::*; | |
use bencher::Bencher; | |
fn sieve(bench: &mut Bencher) { | |
bench.iter(|| { | |
let max = 10_000 as usize; | |
// This mut is more of an annotation than anything |
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
#[macro_use] | |
extern crate cpython; | |
use std::rc::Rc; | |
pub struct Simulation { | |
pub star: Rc<Star>, | |
pub spots: Vec<Spot>, | |
} | |
pub struct Spot { |
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 futures; | |
extern crate tokio; | |
use futures::future::lazy; | |
use tokio::executor::current_thread; | |
fn main() { | |
let data = vec![1, 2, 3, 4, 5]; | |
current_thread::run(move |_| { | |
for num in data.iter() { |
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
DEBUG 2018-02-16T07:58:37Z: discord::async: connected to discord w/ heartbeat 41250ms. | |
DEBUG 2018-02-16T07:58:37Z: discord::async: send: Object({"d": Object({"compress": Bool(true), "large_threshold": Number(250), "properties": Object({"$browser": String("Discord library for Rust"), "$device": String("discord-rs"), "$os": String("linux"), "$referrer": String(""), "$referring_domain": String("")}), "token": String("Bot MTc2MTM1Njg4NjY2NzQyNzg0.DTQ_hg.HRKyVQHLOLtEKwexb0j_tmoroso"), "v": Number(6)}), "op": Number(2)}) | |
DEBUG 2018-02-16T07:58:38Z: discord::model: Unhandled keys: Game has Object({"timestamps": Object({"start": Number(1518755284048)})}) | |
DEBUG 2018-02-16T07:58:38Z: discord::model: Unhandled keys: Game has Object({"assets": Object({"large_image": String("spotify:702ea459eef6df07fec7756a0a38b2452e9c9d4d"), "large_text": String("Reflection (Deluxe)")}), "details": String("Everlasting Love"), "flags": Number(48), "party": Object({"id": String("spotify:83888634339528704")}), "session_id": String("ed449fa5 |
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
let runner = ClientBuilder::new(&url) | |
.unwrap() | |
.add_protocol("rust-websocket") | |
.async_connect_secure(None, &core.handle()) | |
.and_then(|(duplex, _)| { | |
let (sink, stream) = duplex.split(); | |
stream.filter_map(|message| { | |
match message { | |
OwnedMessage::Text(t) => { | |
if let Ok(Standard(slackmessage)) = serde_json::from_str::<slack_api::Message>(&t) { |
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
error: failed to run custom build command for `openssl v0.7.14` | |
process didn't exit successfully: `/home/ben/discord-rs/target/debug/build/openssl-52416aa69a800e6e/build-script-build` (exit code: 101) | |
--- stdout | |
TARGET = Some("x86_64-unknown-linux-gnu") | |
OPT_LEVEL = Some("0") | |
TARGET = Some("x86_64-unknown-linux-gnu") | |
HOST = Some("x86_64-unknown-linux-gnu") | |
TARGET = Some("x86_64-unknown-linux-gnu") | |
TARGET = Some("x86_64-unknown-linux-gnu") | |
HOST = Some("x86_64-unknown-linux-gnu") |