« first day (1928 days earlier)      last day (1544 days later) » 

2:21 PM
@Shepmaster "An i32 takes 4 bytes" octet octet ! ^^
 
2:37 PM
giga-octet somewhere else with that :-)
(quite pleased with that pun)
 
god I dislike delete question without reason
specially when I was putting time on it
 
2:54 PM
@Stargateur You are pedantic about all the wrong things ;-)
2
 
@trentcl a bytes is a bytes an octet is an octet
 
I wonder why stack is at the top and heap is at the bottom
like, is there a reason, or just "we did it this way"
 
@Shepmaster this is a very good reason
 
I wonder if it's to make it easier people who were writing memory allocators
The compiler can do the ugly stack stuff once
 
144
A: What is the direction of stack growth in most modern systems?

paxdiabloStack growth doesn't usually depend on the operating system itself, but on the processor it's running on. Solaris, for example, runs on x86 and SPARC. Mac OSX (as you mentioned) runs on PPC and x86. Linux runs on everything from my big honkin' System z at work to a puny little wristwatch. If the...

 
Were there not enough questions to close today for you to go so far back? :D
 
@mcarton that was part of my semi-regular "who misused " cleanup
 
4:06 PM
what?
 
did you really need help for this ?
 
@Stargateur help == someone else does the research
I have reasonably limited time to work on the playground
 
4:25 PM
I'm not sure any research have been done or any testing, because again "Change GitHub Gist creation to be private" it's not private but secret
 
@Stargateur I tested it myself locally before merging
 
thus my conclusion, did you really need this one value PR change :p
that not really important
just this one line PR make me laugh a little
 
I will take any opportunity to try and get someone, anyone, to contribute to the playground, ideally for the long term
 
 
3 hours later…
7:50 PM
For those whose eyes bled at my previous generic calls, I've accepted some code duplication and gotten to this
    let execute = warp::path("execute").and(sandbox_api(execute));
    let compile = warp::path("compile").and(sandbox_api(compile));
    let format = warp::path("format").and(sandbox_api(format));
    let clippy = warp::path("clippy").and(sandbox_api(clippy));
    let miri = warp::path("miri").and(sandbox_api(miri));

    let api = execute.or(compile).or(format).or(clippy).or(miri);
    let api = warp::post().and(api);

    let crates = warp::path("crates").and(cached_api(AsyncSandboxCache::crates));
 
8:35 PM
I don't understand, if we want to use a var of type int, why do we have to first declare it as a string()?
 
@Unbreachable you don't; there's no type int or string in Rust either.
 
That is actually giving me a difficult time right now because I have an fn with a parameter and the type is u32, but I am getting an error because, in another fn where I actually input the argument to pass it, it's giving mismatched types.....well then how the heck do you me expect to pass it if you want me to declare a string and convert it to int after? I simply don't understand
I am talking about string::new() and then converting it to u32
 
14
Q: How to read an integer input from the user in Rust 1.0?

sundar - Reinstate MonicaExisting answers I've found are all based on from_str (such as Reading in user input from console once efficiently), but apparently from_str(x) has changed into x.parse() in Rust 1.0. As a newbie, it's not obvious how the original solution should be adapted taking this change into account. As ...

152
Q: Convert a String to int in Rust?

mtahmedNote: this question contains deprecated pre-1.0 code! The answer is correct, though. To convert a str to an int in Rust, I can do this: let my_int = from_str::<int>(my_str); The only way I know how to convert a String to an int is to get a slice of it and then use from_str on it like so: let...

 
I already know how to do that
mind if I share my code?
forgot
 
go for it (ideally minimized; there are Rust-specific MRE tips you can use to reduce your original code for posting)
 
8:45 PM
thanks yea I cut out the code and left the only thing I am talking about
Any idea on how I can get around this?
 
That code isn't valid syntax
 
i told you i cut out all other code that didn't matter, and only showed what the issue is
 
Sorry about that: here you go play.rust-lang.org/…
 
@Unbreachable this code compiles fine and doesn't have errors about the incorrect types
The playground allows you to build and run the code, make sure that it produces the error you want to ask about.
 
8:53 PM
Huh? really? It's giving me an error.
 
Running it in the playground has a run time error (because the playground doesn't allow user input)
but there's no compiler error about mismatched types, which is what it seemed you were asking about
 
It doesn't? oops
that is what i am asking......lets see
Can you take a look at this please, I have changed it a bit
Why is it "out of scope"? Is it because it's in the loop?
 
yes. It's the same as
{
    let foo = 1;
}

foo;
You can do this instead
let age: u32 = loop {
    let mut age = String::new();
    println!("Age: ");
    stdin.read_line(&mut age).expect("Failed to read answer.");
    if let Ok(num) = age.trim().parse() {
        break num;
    }
};
 
I understand it, thanks a bunch.
But it gives me an error linking with link.exe failed: exit code: 1104
 
 
1 hour later…
10:26 PM
I needed to install new version of vs.... If anybody has the same issue I figured it out here, thanks. github.com/rust-lang/rust/issues/44787 see ya
 
11:22 PM
@Shepmaster do you have a link to the complete code ? that playground ?
 
11:34 PM
@Stargateur I can push a branch later on this evening and link you.
 
@Shepmaster this evening... yeah this evening :p. that would be nice
I have an idea
coming from C ^^
 
@Stargateur add undefined behavior? Ha ha. I joke
 
I promise it will be without unsafe
BTW, a good stackreview question IMO
1
Q: Rust Iterator Fizzbuzz

S0AndS0Rust is one of my first forays on a strongly typed language, beginning to like it's strictness, and am looking to improve my comprehension. Questions Are there any mistakes that the compiler hasn't pestered my about? The iterator increments or decrements, any other directions it should go? It'...

 

« first day (1928 days earlier)      last day (1544 days later) »