View generated_module.ll
This file contains 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
source_filename = "1tyt6immxwy9a8vn" | |
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-windows-msvc" | |
%.win32.image_import_desc = type { i32, i32, i32, i32, i32 } | |
@__ImageBase = external global i8 | |
@import.mydll.1.dll.dll_name = private constant [11 x i8] c"mydll.1.dll", section ".idata$7" |
View mod.rs
This file contains 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
//! deserialization from horrible xml | |
//! | |
//! | |
mod helpers; | |
use quick_xml::Reader; | |
use quick_xml::events::{Event, BytesStart}; | |
use error::{Error, Result}; |
View day23.rs
This file contains 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
#![allow(unused)] | |
mod prelude; | |
use self::prelude::*; | |
use rand::Rng; | |
use std::cmp; | |
#[derive(Debug, Copy, Clone, Deserialize, PartialEq)] | |
pub struct Nanobot { |
View day22.rs
This file contains 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
#![allow(unused)] | |
mod prelude; | |
use self::prelude::*; | |
const DEPTH: usize = 8787; | |
const TARGET: (usize, usize) = (10, 725); | |
fn geo_index(x: usize, y: usize, world: &mut Map<(usize, usize), usize>) -> usize { | |
if let Some(&value) = world.get(&(x,y)) { |
View day4.rs
This file contains 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(dbg_macro)] | |
#![allow(unused)] | |
mod prelude; | |
use self::prelude::*; | |
#[derive(Debug, Deserialize, PartialOrd, PartialEq, Eq, Ord)] | |
struct TS { | |
year: u32, | |
month: u32, |
View my_oldest_surviving_rust.rs
This file contains 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
// july 2014 | |
use std::io; | |
use std::from_str::FromStr; | |
// [], argument is optional, defaults to rax | |
#[deriving(Show)] | |
enum Operator { | |
MOV, // conditional move - MOV reg_from,reg_to,reg_test | |
IDA, // array index - IDA reg_array,reg_offset,[reg_output] |
View rotating_rect.rs
This file contains 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 luminance; | |
extern crate luminance_glfw; | |
use luminance_glfw::{Device, GLFWDevice, WindowDim, WindowOpt, WindowEvent}; | |
use luminance::framebuffer::Framebuffer; | |
use luminance::shader::program::{Program, Uniform}; | |
use luminance::pipeline::{BoundTexture, RenderState, entry, pipeline}; | |
use luminance::texture::{self, Texture, Sampler, TextureError}; | |
use luminance::pixel; |
View main.rs
This file contains 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 gif; | |
use std::collections::HashMap; | |
use gif::{Frame, Encoder, Repeat, SetParameter}; | |
use std::fs::File; | |
use std::io::prelude::*; | |
static COLOR_MAP: [u8; 15] = [ | |
20, 12, 28, // CLEAN |
View day7.rs
This file contains 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
use std::collections::HashMap; | |
#[derive(Debug, Clone, PartialEq)] | |
struct Node { | |
weight: u32, | |
children: Vec<String>, | |
} | |
impl Node { | |
fn weight(&self, map: &HashMap<String, Node>) -> u32 { |