This file contains hidden or 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
void rawToEulerInt(long rawMagneticX,long rawMagneticY,long rawMagneticZ, | |
long rawGravimetricX,long rawGravimetricY, | |
long * eulerYaw,long * eulerPitch,long * eulerRoll) { | |
vec3 rotMagnetic; | |
vec2 linGravimetric; | |
vec2 normRotMag; | |
sinCos pitch,roll; | |
#ifdef USE_FILTERS | |
if (!madeFilters) { |
This file contains hidden or 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
def prim(name, default, actions): | |
action_string = ", ".join(actions) | |
if default: | |
animate_string = ", animate me . 1 1 0" | |
else: | |
animate_string = "" | |
print("create name %s%s; adone %s" % (name, animate_string, action_string)) | |
def action_prim_mem(name, value): | |
action_string = "animate %s . 1 1 %s" % (name, ("0" if value else "2147483647")) |
This file contains hidden or 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
/* | |
SDL - Simple DirectMedia Layer | |
Copyright (C) 1997-2012 Sam Lantinga | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either | |
version 2.1 of the License, or (at your option) any later version. | |
This library is distributed in the hope that it will be useful, |
This file contains hidden or 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 strict"; | |
// See browser tests for examples (tests/runner.py, search for sdl_). Run with | |
// python tests/runner.py browser | |
// Notes: | |
// SDL_VIDEORESIZE: This is sent when the canvas is resized. Note that the user | |
// cannot manually do so, so this is only sent when the | |
// program manually resizes it (emscripten_set_canvas_size | |
// or otherwise). |
This file contains hidden or 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
Index: configure.proto | |
=================================================================== | |
--- configure.proto (revision 35456) | |
+++ configure.proto (working copy) | |
@@ -2847,89 +2847,6 @@ | |
fi | |
dnl check for opengl libs. | |
- AC_MSG_CHECKING(whether we can use the GL library) | |
- |
This file contains hidden or 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::marker::PhantomData; | |
use std::cell::Cell; | |
struct Scope<'s> { | |
num: Cell<usize>, | |
phantom: PhantomData<Cell<&'s mut ()>>, | |
//ms: Vec<&'s mut i32>, <-- useful trick for understanding lifetimes | |
} | |
impl<'s> Scope<'s> { |
This file contains hidden or 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
ALU | |
Sequence: name=ALUSeq | |
SetInteger: name=SI00 | |
Sequence: name=Seq.1 | |
SetInteger: name=SI01 | |
Sequence: name=Seq1. | |
SetInteger: name=SI10 | |
Sequence: name=Seq.1-2 | |
SetInteger: name=SI11 | |
Sequence: name=Decoder |
This file contains hidden or 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::any::TypeId; | |
use std::any::Any; | |
fn wrap<F: Fn()+Any>(closure: F) -> extern "C" fn() { | |
extern "C" fn wrapped<F: Any>() -> () { | |
println!("Haven't written this yet! TypeId: {:?}", TypeId::of::<F>()); | |
} | |
println!("Storing closure {:?}", TypeId::of::<F>()); | |
wrapped::<F> | |
} |
This file contains hidden or 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(type_macros)] | |
struct Zero; | |
struct Succ<T>(T); | |
macro_rules! newtype { | |
($name_:ident) => { | |
get_and_inc!($name_, Zero); | |
} |
This file contains hidden or 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(specialization)] | |
#![allow(dead_code)] | |
struct Nil; | |
struct Cons<H, T>(H, T); | |
trait MayContain<T> { | |
fn get(&self) -> Option<&T>; | |
fn get_mut(&mut self) -> Option<&mut T>; | |
} |