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 pop<T, ..Stack>((_, ..stack): (T, ..Stack)) -> Stack { | |
stack | |
} | |
fn dup<T: Clone, ..Stack>((x, ..stack): (T, ..Stack)) -> (T, T, ..Stack) { | |
(x.clone(), x, ..stack) | |
} | |
fn swap<T, U, ..Stack>((x, y, ..stack): (T, U, ..Stack)) -> (U, T, ..Stack) { | |
(y, x, ..stack) |
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 git2::Delta; | |
use git2::DiffOptions; | |
use git2::Repository; | |
use std::collections::BTreeMap; | |
use std::env::set_current_dir; | |
use std::process::Command; | |
fn main() { | |
let repo = Repository::open_from_env().unwrap(); | |
set_current_dir(repo.workdir().unwrap()).unwrap(); |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package amedia; | |
import java.io.File; | |
import java.net.URL; |
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
/* | |
Tests the Any trait. | |
*/ | |
pub struct Player { | |
name: ~str | |
} |
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
pub unsafe fn allocMegaGroup(mblocks: nat) -> ~Block { | |
let n = MBLOCK_GROUP_BLOCKS(mblocks); | |
enum SearchResult<'a> { | |
PerfectMatch(~Block), | |
BestMatch(&'a mut BlockData, &'a mut BlockMeta), | |
NoMatch | |
} | |
fn go<'a>(n: uint, | |
prev_link: &'a mut Option<~Block>, | |
best: Option<(&'a mut BlockData, &'a mut BlockMeta)>) |
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
// array per definizione nomi da 0 a 19 | |
static a19: [&'static str, ..20] = [ | |
"", "uno", "due", "tre", | |
"quattro","cinque", "sei", "sette", "otto", | |
"nove", "dieci", "undici", "dodici", | |
"tredici", "quattordici", "quindici", | |
"sedici", "diciassette", "diciotto", | |
"diciannove" | |
]; |
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
( | |
|a: |b: |||| a(|| {}) | |
)( | |
|b: ||| b() | |
) |
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
let (ref cfg, ref appCfg) = { | |
let prefix = Path::new(getenv("HOME").unwrap_or(~"")); | |
(prefix.join(".Sync.conf"), prefix.join(".Mirana.conf")) | |
}; |
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
let (ref cfg, ref appCfg) = if nix { | |
( Path::new ( "~/.Sync.conf" ) , | |
Path::new ( "~/.Mirana.conf" ) | |
) | |
} else { | |
let prefix = getenv("HOME").unwrap_or(~""); | |
( Path::new ( prefix + "~/.Sync.conf" ), | |
Path::new ( prefix + "~/.Mirana.conf" ) | |
) | |
}; |
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::str::*; | |
use std::hashmap::*; | |
trait CloneParser<T> { | |
fn clone_as_parser(&self) -> ~Parser<T>; | |
} | |
impl<T, U: Clone> CloneParser<T> for U { | |
fn clone_as(&self) -> ~Parser<T> { | |
~self.clone() as ~Parser<T> |
NewerOlder