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
<sburb name="Openbound_p3" version="1.0" char='foo' startAction='test' curRoom='bar' description="initialization" scale='2' levelPath='levels/openbound_p3' resourcePath='resources/openbound_p3'> | |
<dependencies> | |
<dependency>etc/ui.xml</dependency> | |
<dependency>etc/standardTemplates.xml</dependency> | |
<dependency>etc/sfx.xml</dependency> | |
</dependencies> | |
<action name='test' command='talk'> | |
<args>@! test!</args> |
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
<script> | |
/* | |
var grid = [ | |
[0,0,0,0,0,0], | |
[0,0,0,0,0,0], | |
[0,0,0,0,0,0], | |
[0,0,0,0,0,0], | |
[0,0,0,0,0,0], | |
[0,0,0,0,0,0] | |
]; |
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
function MinStack(){ | |
this.stack = []; | |
this.min = []; | |
} | |
MinStack.prototype.push = function(x){ | |
if(this.stack.length==0){ | |
this.min.push(x); | |
}else{ | |
if(this.getMin()>x){ |
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
Pseudocode iterative implementation of the recursive algorithm: | |
G(n) = | |
if(n>4) | |
doPair(n-1, n) | |
G(n-1) | |
doPair(n-1, n) | |
else | |
doBaseCase() |
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
struct SomeStruct{ | |
data: uint | |
} | |
impl SomeStruct{ | |
fn setData (&mut self, value: uint) { | |
self.data = value | |
} | |
fn getData (&self) -> uint { |
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
//multiplicative range to keep neighbours beyond nearest neighbour | |
var rangeSensitivity = Math.sqrt(1.8); //a bit less than sqrt(2), basically a magic number | |
//main function | |
GridThing.doMap = function(collection){ | |
var graph = new Graph(); | |
//unimportant construction of points | |
buildGrid(graph); | |
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::ptr::RawPtr; | |
type NodeRef<T> = Option<Box<Node<T>>>; | |
type NodeBackRef<T> = *mut Node<T>; | |
struct Node<T> { | |
left: NodeRef<T>, | |
right: NodeRef<T>, | |
parent: NodeBackRef<T>, | |
value: T, |
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::ptr::RawPtr; | |
type NodeRef<T> = Option<Box<Node<T>>>; | |
type NodeBackRef<T> = *mut Node<T>; | |
struct Node<T> { | |
left: NodeRef<T>, | |
right: NodeRef<T>, | |
parent: NodeBackRef<T>, | |
value: T, |
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
rustc: i686-pc-mingw32/stage2/test/collectionstest-i686-pc-mingw32.exe | |
C:\Users\Alexis\Documents\GitHub\rust\src\libcollections\treemap.rs:864:14: 864:23 error: cannot borrow `cur#0` as mutable more than once at a time | |
C:\Users\Alexis\Documents\GitHub\rust\src\libcollections\treemap.rs:864 Some(ref mut x) => { | |
^~~~~~~~~ | |
C:\Users\Alexis\Documents\GitHub\rust\src\libcollections\treemap.rs:864:14: 864:23 note: previous borrow of `cur#0` occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of `cur#0` until the borrow ends | |
C:\Users\Alexis\Documents\GitHub\rust\src\libcollections\treemap.rs:864 Some(ref mut x) => { | |
^~~~~~~~~ | |
C:\Users\Alexis\Documents\GitHub\rust\src\libcollections\treemap.rs:874:2: 874:2 note: previous borrow ends here | |
C:\Users\Alexis\Documents\GitHub\rust\src\libcollections\treemap.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
fn splay (&mut self, node: &mut Node<T>) { | |
enum SplayType {NoSplay, Zig, ZigZig, ZigZag}; | |
loop { | |
let splayType = match node.get_parent() { | |
None => NoSplay, | |
Some(parent) => { | |
match parent.get_parent() { | |
None => Zig, | |
Some(_) => { | |
if parent.is_left() == node.is_left() { |
OlderNewer