Skip to content

Instantly share code, notes, and snippets.

View SuperFluffy's full-sized avatar

Richard Janis Goldschmidt SuperFluffy

View GitHub Profile
--- stdout
Downloading https://github.com/denoland/ninja_gn_binaries/archive/20200313.tar.gz... Done.
using Chromiums clang
clang_base_path /tmp/cargo-installYoYyID/release/clang
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-n344329-9284abd0-5.tgz .......... Done.
cargo:warning=Not using sccache
The current directory is /home/janis/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.3.8
gn gen --root=/home/janis/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.3.8 /tmp/cargo-installYoYyID/release/gn_out
running: "/tmp/cargo-installYoYyID/release/ninja_gn_binaries-20200313/linux64/gn" "--root=/home/janis/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.3.8" "gen" "/tmp/cargo-installYoYyID/release/gn_out" "--args=is_debug=false clang_base_path=\"/tmp/cargo-installYoYyID/release/clang\" use_sysroot=false"
Done. Made 138 targets from 86 files in 160ms
import { Universe } from "./wasm_game_of_life";
const pre = document.getElementById("game-of-life-canvas");
const universe = Universe.new();
const renderLoop = () => {
pre.textContent = universe.render();
universe.tick();
requestAnimationFrame(renderLoop);
#![feature(box_syntax)]
extern crate simd;
use simd::x86::avx::f32x8;
use simd::x86::avx::AvxF32x8;
use std::time::Instant;
const N: usize = 1024;
const M: usize = 1024;
@SuperFluffy
SuperFluffy / arduino_part.ino
Created December 10, 2017 21:00
Super simple setup to have an RPi talk to an Arduino using Rust (On the RPi) and C++ (on the Arduino)
#include <Wire.h>
#define SLAVE_ADDRESS 0x10
int number = 0;
int state = 0;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600); // start serial for output
// initialize i2c as slave
@SuperFluffy
SuperFluffy / maybe_value_t.rs
Created May 6, 2017 17:03
clap's value_t! expanded to permit missing arguments
macro_rules! maybe_value_t {
($m:ident, $v:expr, $t:ty) => {
maybe_value_t!($m.value_of($v), $t)
};
($m:ident.value_of($v:expr), $t:ty) => {
match value_t!($m, $v, $t) {
Ok(val) => Ok(Some(val)),
Err(ref e) if e.kind == ::clap::ErrorKind::ArgumentNotFound => Ok(None),
Err(e) => Err(e),
}
@SuperFluffy
SuperFluffy / after_edit
Created April 24, 2017 13:12
How to git add -p a hunk?
# Manual hunk edit mode -- see bottom for a quick guide.
@@ -1,13 +4,14 @@
#[macro_use(azip)]
extern crate ndarray;
#[cfg(feature="tuple")]
extern crate tuple;
-mod integrators;
+// mod integrators;
@SuperFluffy
SuperFluffy / ar.py
Last active February 18, 2023 09:36
Chaotic attractor reconstruction from http://www.node99.org/tutorials/ar/
# Code taken from http://www.node99.org/tutorials/ar/ and adjusted for Python 3 + filled in the missing pieces:
#
# + Python 2 tuple args -> Python 3 does not allow passing tuples; unpack with *args instead
# + numpy.hstack -> numpy.vstack
# + preprocess -> numpy.histogram + numpy.digitize
# + mutual_information -> sklearn.metrics.normalized_mutual_information_score
# + separate between the "discretized signal" and the original continuous dynamics
import numpy as np
import matplotlib.pyplot as plt
impl<S, P> Stepper for Euler<S, P>
where S: ODE<State=P> + 'static,
P: Clone,
for<'a> &'a P: IntoNdProducer,
for<'a> &'a mut P: IntoNdProducer,
{
type System = S;
type State = P;
fn do_step(&mut self, state: &mut Self::State) {
name native_blas ns/iter native_noblas ns/iter diff ns/iter diff %
add_1d_regular 278 283 5 1.80%
add_1d_strided 3,815 3,750 -65 -1.70%
add_2d_0_to_2_iadd_scalar 187 181 -6 -3.21%
add_2d_assign_ops 300 286 -14 -4.67%
add_2d_broadcast_0_to_2 187 181 -6 -3.21%
add_2d_broadcast_1_to_2 560 541 -19 -3.39%
add_2d_cutout 810 799 -11 -1.36%
add_2d_f32_regular 310 312 2 0.65%
add_2d_regular 300 287 -13 -4.33%
@SuperFluffy
SuperFluffy / Cargo.toml
Created January 31, 2017 15:42
panic in self.pointer_is_inbounds() in impl_methods.rs:92
[package]
name = "arrayvec_blowstack"
version = "0.1.0"
authors = ["Richard Janis Goldschmidt <janis.beckert@gmail.com>"]
[dependencies]
ndarray = "0.7"
[dependencies.arraydeque]
git = "https://github.com/SuperFluffy/arraydeque"