Skip to content

Instantly share code, notes, and snippets.

Dr-Emann /
Created Oct 30, 2018 — forked from rust-play/
Code shared from the Rust Playground
use std::sync::{Arc, Mutex, MutexGuard};
use std::thread;
use std::thread::JoinHandle;
type SafeNode = Arc<Mutex<TreeNode>>;
struct TreeNode {
value: u16,
children: Vec<TreeNode>,
Dr-Emann /
Created Apr 27, 2017 — forked from anonymous/
Rust code shared from the playground
extern crate rand;
use rand::{thread_rng, Rng};
use rand::distributions::{Normal, IndependentSample};
struct SinglePack {
open_block: Vec<f64>,
open_sum: f64,
blocks: Vec<Vec<f64>>,
Dr-Emann /
Last active Sep 12, 2016 — forked from jackmott/
Naive Rust Game
// Implementation contributed by
// Optimized game implementation in Rust
extern crate time;
use time::precise_time_ns;
use std::ops::{Add, Sub, Mul};
const NUM_BLOCKS: usize = 65535;
const NUM_ENTITIES: usize = 1000;
const CHUNK_COUNT: usize = 100;
Dr-Emann /
Created Oct 1, 2015 — forked from pnispel/
bad rust?
let start = time::now();
let metadata = try!(fs::metadata(&path));
let mut file = try!(File::open(&path));
let mut buf = vec![0u8; metadata.len() as usize];
try!( buf));
let mut str: &str = try!(str::from_utf8(&buf));
View multiple files.xml
<!-- strings_user.xml -->
<string name="user_name">Name</string>
<string name="user_password">Password</string>
<string name="user_phone">Phone</string>
<!-- strings_registration.xml -->
Dr-Emann / haxelib.schema.json
Last active Dec 17, 2015
Haxelib.json schema. Written in [json-schema](
View haxelib.schema.json
"$schema": "",
"description": "A haxelib project",
"type": "object",
"properties": {
"name": { "$ref": "#/definitions/name" },
"license": {
"description": "The open source license under which the project is licensed",
"enum": ["GPL", "LGPL", "BSD", "Public", "MIT"]
Dr-Emann / core-haxelib.json
Created May 29, 2013
Haxe haxelib.json's for polygonal libraries
View core-haxelib.json
"name": "polygonal-core",
"license": "MIT",
"tags": ["cross", "utility"],
"description": "core library used by other polygonal libraries",
"version": "1.0.2",
"url": "",
"dependencies": {
View MacroCollection.hx
package ;
* ...
* @author Zachary Dremann
#if macro
import haxe.macro.Expr;
import haxe.macro.Context;
Dr-Emann / Main.hx
Created Mar 13, 2012
Testing Haxe Rounding Speeds
View Main.hx
package net.zdremann.tmp.roundto;
import de.polygonal.core.fmt.Sprintf;
import de.polygonal.core.math.Limits;
import de.polygonal.core.math.Mathematics;
import haxe.Timer;
import nme.display.Sprite;
import nme.Lib;
#if !js
Dr-Emann /
Created Feb 27, 2012
Getting ESuds info from Java
public class Machine {
public Machine()
this.status = MachineStatus.UNKNOWN;
public Machine(final int id, final int num, MachineStatus status)
{ = id;