Thanks! I'm going to this this but instead use Command::new to run the command as sudo and then process::exit(0) to end the non sudo process. — SmushyTaco2 mins ago
@FrenchBoiethios I don't think it needs to be closed. It represents a confusion about how lifetime annotations work, and could be useful to someone else having the same misconception.
It's part of someone's journey towards understanding lifetimes.
pins in SO chats are always badly used. I know they're very important in Miaou where rooms are more focused: all kinds of important announcements are pinned (and there's an optional feature to ask for your acknowledgment)
Yes, it's horrible. There are a few good points though (even if not counting the fact it's on SO and related to a language) compared to a few hyped recent chats: doesn't break the browser and doesn't just display five lines of text with fancy backgrounds or spaces around.
true.. I was actually thinking about this aspect of sites yesterday. I created a nice plugin/addon for a torrent site, to that it would support j, k, l, and ; key navigation (for scroll and pagination respectively) and the only reason I was able to "hack it" is because it was using the good ol' ways
I know, when I created the C chatroom, I also created a publicly available GreaseMonkey/TamperMonkey script package for quick standard insertion, book recommendation links, etc.
Anyway, you can make it easier to use, but features are genuinely missing from the chat
which you cannot just fix with tweaks on your local client
if your program auto-sudos you run into an endless supply of cans of worms to open, as sudo isn't just "you can sudo" or "you cannot sudo"; most people have a much tighter restriction of what people can sudo into
@DenysSéguret that's exactly what my experience is.. all the startups/companies here are obsessed with finance.. or gambling actually -- for example smarkets.. Amazing salaries, mind blowing offices, equipment, extras (food/snacks, activities, perks, etc.)
but then again.. finance.. gambling.. couldn't care less about those..
I don't even mind if I would get lower salaries, not that many extras nor a good office, but if the tech stack is okay, and the goal is something I care about -- I'm in
Finance can be really interesting, btw. I've had a brief foray into HFT algorithms on one of my previous jobs
I didn't like the trading part, but the high frequency part was extremely interesting and teaches you to think differently about certain problems you normally wouldn't even notice
"Tech stack is okay" - that's rare
to this day I'm still waiting to meet a company where the tech stack isn't crippled by technical debt
Give it a shot? You seem to be mostly on the front end part of JS, but if you've ever got a backend process to write for the shits and giggles, it's worth it
Re: "new" JS languages, there's too much fragmentation on that front to tell whether TS will come out on top or not
@E_net4theMeta-RemoveR Can you be more specific? Was referring to the specific "a Result can be seen as a sequence of zero or one element", which flat-out isn't true
a Result is always one element, of either of the two types
@SébastienRenauld Ah, so you're talking about that question? In that context, I doubt that it will help, the OP doesn't seem to have the necessary know-how.
@FrenchBoiethios Oh, I'm the same on the "being able to read a fuckton of documentation", but that doesn't mean that a) somebody new to the language will know where to start or b) they'll do it efficiently
For that reason, if they had a fair go at it I'll just help them
@FrenchBoiethios I'd make the argument that you are saying the equivalent of "String should have just been Vec<u8>". The semantics of the type are as important (or more) than the underlying implementation / layout
@SébastienRenauld now, that's not to say that the security is ironclad. There are some holes I know of, but it's at the level of "good enough for the people who use it now"
@Shepmaster do you kill the container between sessions, or can we implement a chat by storing text files inside ? Or maybe use your container as an online volume for our needs ?
Today I try to solve two problems on LeetCode —— First, and Second.
For the first question, I have written the correct code, but there are still things I don't understand: Playground
pub fn intersection(vec1: Vec<i32>, vec2: Vec<i32>) -> Vec<i32> {
let mut vec = Vec::new();
for i in vec...
@SébastienRenauld yes, it's a poorly flowing question. They describe in prose how to break it (and the error message shows the removal of the .clone())
@DenysSéguret The webserver creates a temporary directory, volume mounts that into the container, then destroys it after the request is done.
Should've asked before - "mounts that into the container", what's in it (other than the code, I guess) and what underlying FS is it?
I've seen this happen with docker mounts
Unrelated, if anybody wants to discover some cool music, I've just accidentally re-discovered 2cellos (youtube.com/watch?v=nkcm5cT9gGI ) thanks to youtube recommendations
@Shepmaster I forgot that dynamically named maps are the "legitimate" case for flatten. We have basically stopped using flatten everywhere because it allocates an intermediate map, even when one shouldn't be needed (ie when flattening the fields of nested structs).
@Shepmaster It's a little hard to justify the effort, because we basically have hand-rolled the impls and tweaking them for a changed field here or there isn't really a big deal
But I would like to because it would be fun!
It's actually nice that the macros are separate so you can make different ones. The core model and traits are still pretty much ideal
A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a hard line break (rendered in HTML as a <br /> tag):
@SébastienRenauld I agree that asking for a library is off-topic, but there's this weird loophole around asking how to do something can be answered with "use this library"
It's just too broad to recommend something. If he doesn't care about blocking calls reqwest does it, so does curl-rust. If he cares and wants something that runs on an event loop, actix-web with actix-multipart on top is the way to go
The async example is useful, but being new to Rust and Tokio, I am struggling to work out how to do N requests at once, using URLs from a vector, and creating an iterator of the response HTML for each URL as a string.
How could this be done?
@Shepmaster I'd really appreciate your insight on this one
as I'm pretty sure that in both cases the underlying compiler will move things back to the stack if the functions are that simple (both for C++ and for rust)
I'm also pretty sure the dude is wrong about std::function being stack-allocated always
People eyeballing performance optimizations based on incorrect assumptions. Thinking about it, I don't understand how you could stack-allocate std::function considering that it is a wrapper object; the underlying lambda, sure, but not the wrapper
Can Rust strongly type integers to defined ranges?
For example, I'd like to define a type to represent months, which can be [1 .. 12], inclusive. Range checking would panic if this variable goes beyond this range.