Skip to content

Instantly share code, notes, and snippets.

View mkaufmann's full-sized avatar

Moritz Kaufmann mkaufmann

View GitHub Profile
@mkaufmann
mkaufmann / mandelbrot.rs
Created March 2, 2015 08:07
Rust parallel Mandelbrot
use std::ops::{Add, Sub, Mul};
use std::collections::VecDeque;
use std::num::Float;
pub struct MandelbrotSequence {
s: Complex<f64>,
p: Complex<f64>
}
impl MandelbrotSequence {

When working on my boids simulator, I ran into the issue of not knowing how to do a lock free write back to the main bird array [which is something I wanted for performance reasons].

This is a small example I implemented over the weekend to see if its possible.

Build: clang -lpthread -lstdc++ lockfree.cpp rustc main.rs

Tested on rustc 0.13.0-nightly (88b6e93d3 2014-10-31 23:36:48 +0000)

@mkaufmann
mkaufmann / gist:9100637
Created February 19, 2014 20:17
Rust vec mystery
Rust-Version:
=============
commit d40b5374055086df88727925872f0733843f9d2e
Source:
=======
#[crate_id = "testx"];
use std::vec;
@mkaufmann
mkaufmann / gist:8716922
Created January 30, 2014 19:30
Stripe-CTF3 Solutions Level -3
Diff for Level0, read file into HashSet:
========================================
+require 'set'
path = ARGV.length > 0 ? ARGV[0] : '/usr/share/dict/words'
-entries = File.read(path).split("\n")
+entries = Set.new File.read(path).split("\n")
@mkaufmann
mkaufmann / getimg.py
Created October 8, 2011 21:06 — forked from stchris/getimg.py
Improved version of getimg.sh - gets the 'image of the day' from NASA, writes the summary onto the image and sets it as the Gnome wallpaper.
#!/usr/bin/env python
"""
getimg.py
Gets the current image of the day from NASA and sets it as the
background in Gnome. The summary / description text is written
to the image.
Requires:
PIL (apt-get install python-imaging or pip install PIL)