Skip to content

Instantly share code, notes, and snippets.

🔨
Hacking on hdf5-rust

Ivan Smirnov aldanor

🔨
Hacking on hdf5-rust
Block or report user

Report or block aldanor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pandas-bench.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aldanor
aldanor / playground.rs
Created Feb 20, 2019 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#[macro_use]
extern crate error_chain; // 0.12.0
extern crate num_traits; // 0.2.6
use num_traits::AsPrimitive;
use std::fmt::Debug;
error_chain! {
types { TractError, TractErrorKind, TractResultExt, TractResult; }
foreign_links {}
@aldanor
aldanor / chunkshape.rs
Last active Dec 28, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View chunkshape.rs
pub type Ix = usize;
pub fn estimate_chunkshape(shape: &[Ix], itemsize: usize, base_kb: usize) -> Vec<Ix> {
if shape.is_empty() {
return vec![1];
}
let size: Ix = shape.iter().product();
let size_mb = ((size * itemsize) as f64) / ((1 << 20) as f64);
let basesize = base_kb << 10;
let pow2 = size_mb.max(1.).min((1 << 23) as _).log10().trunc();
@aldanor
aldanor / playground.rs
Created Oct 29, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#![allow(dead_code)]
use std::cell::RefCell;
use std::rc::Rc;
trait Stream<'a> {
type Item: 'a + ?Sized;
fn subscribe<F>(self, f: F) where F: FnMut(&Self::Item) + 'a;
@aldanor
aldanor / playground.rs
Created Oct 26, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
use std::cell::RefCell;
use std::rc::Rc;
trait Observer<T> {
fn on_next(&mut self, item: T);
}
impl<T, F> Observer<T> for F where F: FnMut(T) -> () {
fn on_next(&mut self, item: T) {
self(item)
@aldanor
aldanor / playground.rs
Created Oct 26, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
use std::cell::RefCell;
use std::rc::Rc;
trait Observer<T> {
fn on_next(&mut self, item: T);
}
impl<T, F> Observer<T> for F where F: FnMut(T) -> () {
fn on_next(&mut self, item: T) {
self(item)
@aldanor
aldanor / playground.rs
Created Oct 23, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
trait Observer<T> {
fn on_next(&mut self, item: Option<T>);
}
impl<T, F> Observer<T> for F where F: FnMut(Option<T>) {
fn on_next(&mut self, item: Option<T>) {
self(item)
}
}
View .ycm_extra_conf.py
import json
import os
import shlex
import sys
def extract_includes():
cwd = os.getcwd()
cc1 = os.path.join(cwd, 'cmake', 'compile_commands.json')
cc2 = os.path.join(cwd, 'compile_commands.json')
@aldanor
aldanor / libpcap_versions.py
Last active Mar 20, 2017
libpcap versions
View libpcap_versions.py
import collections
import fnmatch
import git
import os
import pprint
import pycparser
import subprocess
import tempfile
repo = git.Repo()
View gist:9703cac534201d95252a7e804ee88420

#Node

##single

Size Heap New Small Node Array Stack
256*1 19,000 19,000 31,000 18,000 42,000 12,000
256*4 19,000 19,000 31,000 18,000 42,000 12,000
256*8 19,000 19,000 31,000 18,000 41,000 12,000
256*256 26,000 29,000 28,000 15,000 39,000 12,000
You can’t perform that action at this time.