I hereby claim:
- I am dymk on github.
- I am dymk (https://keybase.io/dymk) on keybase.
- I have a public key ASAFTHCjQAvzt4vE7x0p1hggQkZ05gWFFkT0E4AEVmw2ugo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #include <setjmp.h> | |
| #include <stdio.h> | |
| #include <jumptests.h> | |
| static jmp_buf *last_buf = NULL; | |
| static jmp_buf *scope_buf = NULL; | |
| void second() { | |
| printf("--> enter second\n"); | |
| throw(1); |
| /// Maps coefficient location to a weight bucket | |
| /// Initialized with a self executing lambda, a-la Javascript | |
| shared float[ImageArea] WeightBins = (() { | |
| float[ImageArea] tmp; | |
| foreach(i; 0..ImageHeight) { | |
| foreach(j; 0..ImageWidth) { | |
| tmp[(i * ImageHeight) + j] = min(max(i, j), 5); | |
| } | |
| } | |
| return tmp; |
| use core::vec; | |
| pub fn haar2d<T : NumCast>(in_mat: ~[~[T]]) -> ~[~[float]] { | |
| let in_mat_rows = in_mat.len(); | |
| // Initialize a vector n items long with the value 0 | |
| //Perform on each row | |
| let mut in_mat = do vec::map_consume(in_mat) |vec| { | |
| haar1d(vec) |
| trait Newable { | |
| fn new() -> Self; | |
| } | |
| struct Foo(int); | |
| impl Newable for Foo { | |
| fn new() -> Foo { | |
| return Foo(1); | |
| } | |
| } |
| fn exportPixels(&self) -> ~[RGB] { | |
| //Determine the size of the vector we need to allocate | |
| let mut pixel_buffer = vec::with_capacity::<self::RGB>(self.numPixels()); | |
| unsafe { | |
| let buffer_ptr = vec::raw::to_ptr(pixel_buffer); | |
| wand_extern::MagickExportImagePixels(buffer_ptr); | |
| vec::raw::set_len::<RGB>(pixel_buffer, self.numPixels()); | |
| } | |
| pixel_buffer | |
| } |
| struct Circle { radius: int } | |
| trait Shape {} | |
| impl Shape for Circle {} | |
| fn main() { | |
| //Doesn't crash if 'all' is immutable: | |
| // let all: ~[~Shape] = ~[~Circle{radius: 2} as ~Shape]; | |
| //Doesn't crash if 'all' is mutable: | |
| // let mut all: ~[~Shape] = ~[~Circle{radius: 2} as ~Shape]; |
| C:\lib>rustc --test my_lib.rs | |
| test_my_lib.rs:1:4: 1:11 error: failed to resolve import: my_lib | |
| test_my_lib.rs:1 use my_lib; | |
| ^~~~~~~ | |
| error: failed to resolve imports | |
| error: aborting due to 2 previous errors |
| use types::{MyType, MyOtherType}; | |
| mod types; |
| lib\wand_extern.rs:5:12: 5:26 error: unresolved name | |
| lib\wand_extern.rs:5 use types::{MagickWandPtr, ImagePtr}; | |
| ^~~~~~~~~~~~~~ | |
| lib\wand_extern.rs:5:12: 5:26 error: failed to resolve import: types::MagickWandPtr | |
| lib\wand_extern.rs:5 use types::{MagickWandPtr, ImagePtr}; | |
| ^~~~~~~~~~~~~~ | |
| lib\wand_extern.rs:5:27: 5:36 error: unresolved name | |
| lib\wand_extern.rs:5 use types::{MagickWandPtr, ImagePtr}; | |
| ^~~~~~~~~ | |
| lib\wand_extern.rs:5:27: 5:36 error: failed to resolve import: types::ImagePtr |