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 is_printable_ascii(c: u8) -> bool { | |
c >= 0x20u8 && c < 0x7fu8 | |
} | |
fn main() { | |
// why temporary variable needed? | |
// error: borrowed value does not live long enough | |
let test_data: ~[u8] = std::io::File::open(&Path::new("test_data")).read_to_end(); | |
let _test_data_filtered: ~[u8] = test_data.iter() | |
// why double deref? |
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 mod extra; | |
use extra::base64::FromBase64; | |
#[test] | |
fn test_b64_1() { | |
let test_data = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n"; | |
match test_data.from_base64() { | |
Ok(s) => s, | |
Err(msg) => fail!(format!("Failed to read b64: {:s}", msg.escape_default())) | |
}; |
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(macro_rules)]; | |
macro_rules! enum_fmt( | |
($name:ident { $($member:ident),+ }) => ( | |
enum $name { | |
$( | |
$member, | |
)+ | |
} | |
impl std::fmt::Default for $name { |
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
Administrator@WIN-CUTEPBGVI8S /d/big_struct | |
$ cat main.c | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
typedef struct TwoU64s { | |
uint64_t one; | |
uint64_t two; | |
} TwoU64s_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
OpenGL vendor string: NVIDIA Corporation | |
OpenGL renderer string: GeForce GTX 660/PCIe/SSE2 | |
OpenGL core profile version string: 4.3.0 NVIDIA 325.15 | |
OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler | |
OpenGL core profile context flags: (none) | |
OpenGL core profile profile mask: core profile | |
OpenGL core profile extensions: | |
OpenGL version string: 4.3.0 NVIDIA 325.15 | |
OpenGL shading language version string: 4.30 NVIDIA via Cg compiler | |
OpenGL context flags: (none) |
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(globs)]; | |
#[feature(macro_rules)]; | |
#[feature(managed_boxes)]; //TODO do without managed boxes | |
extern mod glfw; | |
extern mod gl; | |
use std::libc; | |
use std::cast; | |
use std::ptr; |
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
[adt-bundle-linux-x86_64-20130917]$ eclipse/eclipse | |
# | |
# A fatal error has been detected by the Java Runtime Environment: | |
# | |
# SIGSEGV (0xb) at pc=0x00007f4d49124a48, pid=27190, tid=139970217621248 | |
# | |
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18) | |
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops) | |
# Problematic frame: | |
# C [libgobject-2.0.so.0+0x19a48] g_object_get_qdata+0x18 |
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
#0 0x00007ffff2d37e40 in __cxa_throw () from /usr/lib/libstdc++.so.6 | |
#1 0x00007ffff5a00f3a in rust_begin_unwind () from /usr/lib/librustrt.so | |
#2 0x00007ffff773edd6 in rt::task::Unwinder::begin_unwind::h7c12263797ed0789vaR::v0.9$x2dpre () | |
from /usr/lib/libstd-6c65cf4b443341b1-0.9-pre.so | |
#3 0x00007ffff772244a in rt::task::begin_unwind::h89e154cd0915671aJ::v0.9$x2dpre () | |
from /usr/lib/libstd-6c65cf4b443341b1-0.9-pre.so | |
#4 0x00007ffff7722612 in ?? () from /usr/lib/libstd-6c65cf4b443341b1-0.9-pre.so | |
#5 0x00007ffff772201d in ?? () from /usr/lib/libstd-6c65cf4b443341b1-0.9-pre.so | |
#6 0x00007ffff7721efd in ?? () from /usr/lib/libstd-6c65cf4b443341b1-0.9-pre.so | |
#7 0x00007ffff77225c1 in ?? () from /usr/lib/libstd-6c65cf4b443341b1-0.9-pre.so |
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
test.rs:20:12: 20:18 error: type `&~A:Send` does not implement any method in scope named `a` | |
test.rs:20 a.a(); | |
^~~~~~ | |
error: aborting due to previous error | |
task '<unnamed>' failed at 'explicit failure', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:98 | |
task '<unnamed>' failed at 'explicit failure', /build/rust-git/src/rust/src/librustc/rustc.rs:391 |
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
trait Foo {} | |
struct Bar; | |
impl Foo for Bar {} | |
fn main() { | |
let a: @Foo = @Bar as @Foo; | |
let b = a as @Bar; | |
} |