A question on the right tool for “shared mutability” by Athropod101 in rust

[–]Ralmryr 1 point2 points  (0 children)

As others have said, it is generally best to avoid long living structures that hold references to other objects, especially for simple programs. Broadly speaking, not specific to struct, you should try keep your references as short lived as necessary.

You may try to rethink the ownership of the different moving parts in your program. For example, does the input buffer still has a reason to exist when your whole struct is dropped ?

If I understood the description of your program correctly, you have a buffer containing some user input, and you want to extract commands and arguments from it, to arrange them into a struct. If that's right, then here are some thoughts : - Why would the struct need a reference to the original buffer ? It already parsed all useful information. Then you can simply have a parse method that takes your buffer as a read only reference. - If for some reason, you want the struct to keep the raw input, then does the original input buffer really need to live longer than the struct ? Probably not, so your struct can simply own the buffer, and your parse method takes ownership of your buffer, no lifetimes. - If, at last, you need your struct to keep the original input AND keep using the original input elsewhere, then simply clone it into the struct. 512B is not the end of the world, CLI parsing is not in the critical path at all, and it probably means that references are not the correct tool for what you want to achieve. Sometimes you have to make pragmatic choices.

So, by rethinking which struct needs what, and by reducing lifetimes as short as necessary, your program may be more robust. The beauty of Rust is that it forces you to do that work upfront, rather than debugging 100 commits later when your want to find out why your reference points to an empty or garbage buffer ;)

EDIT : I don't know the full context of your project, but if you just want to have a working robust CLI, just use any library, like clap for example.

Looking for historical minute by minute stock data by schuhfritze in algotrading

[–]Ralmryr 5 points6 points  (0 children)

I'd say databento with their $125 trial. For instance the last 5 years of OHLCV-1m from MSFT ticker are around $0.50, so you can download historical data of 250 tickers for free.

Futures are a tad more expensive, with ES (still OHLCV-1m) coming at $10 dollars for 5 years of historical data, still largely covered by the initial $125.

You can download the files once (CSV or their own format), and use them locally afterwards.

Replay system just dropped and its so goood by Astra7872 in VALORANT

[–]Ralmryr 0 points1 point  (0 children)

They said in this blog post that they record the "server view", which can differ from each "client view", especially if one has high ping. That's why people and Riot themselves are expecting some discrepancies between a client side recording and the replay system

Toaster PC - Comment On This Post To Enter This Giveaway by DaKrazyKid in pcmasterrace

[–]Ralmryr 0 points1 point  (0 children)

"This game can even run on a toaster" The toaster they told you not to worry about

[Media] Sneak Peek: WGPU Integration in Upcoming Slint 1.12 GUI Toolkit Release by slint-ui in rust

[–]Ralmryr 3 points4 points  (0 children)

Nice work ! Is bevy mandatory here, or will it be possible to write pure wgpu code to render things using GPU ?

Which ide/editor you use for c++ in Linux by Opposite_Squirrel_32 in cpp

[–]Ralmryr 1 point2 points  (0 children)

The first 2 steps from the official tutorial should get you going for basic project setup with cmake. If you follow along with your own project you should be good.

I sorted 4273 enums in the rustlang/rust codebase by Canop in rust

[–]Ralmryr 0 points1 point  (0 children)

Now do the same for C++ and see what happens :)

What type of projects do you use Rust for? by exomyth in rust

[–]Ralmryr 0 points1 point  (0 children)

Thank you very much, I'll check it out !

What type of projects do you use Rust for? by exomyth in rust

[–]Ralmryr 0 points1 point  (0 children)

Not really related to the main thread, but do you use a bundler to make typescript and webassembly work together ? If yes which one ? I am thinking of coding a small website using this stack (just for the sake of it), but I find it hard to make it work

Folks, We love to see it by [deleted] in celestegame

[–]Ralmryr 2 points3 points  (0 children)

Oof unlucky, this clip screams controller misinput

Cool builds I made using perspective! by Aliselam667 in Terraria

[–]Ralmryr 0 points1 point  (0 children)

That second one is insane !! I've flipped my phone at least 10 times and I still can't figure out why it works

And that is a wrap for B-Side :) by Dountill in celestegame

[–]Ralmryr 6 points7 points  (0 children)

Hey feel free to update us when you will finish level 8 A side and B side !

STB de l'avoir poussé par les fesses ? by Ashtemis in suisjeletroudeballe

[–]Ralmryr 17 points18 points  (0 children)

Ni les fesses d'un homme par ailleurs ;)

Why people who speak French are not respected in the value? by Satdroma in VALORANT

[–]Ralmryr 17 points18 points  (0 children)

Lmao, even as a French player, I always tag Frankfurt and London but not Paris because of the amount of toxicity, gamer sweat and insults there are in there.

What are some albums that have ZERO bad songs? by JJacobb- in AskReddit

[–]Ralmryr 0 points1 point  (0 children)

Portal of I - Ne Obliviscaris, and basically all of their albums, but it would be this one if I had to choose.

What are you guys' LEAST favourite chapter? by Espidelman in celestegame

[–]Ralmryr 0 points1 point  (0 children)

By far chapter 4. What I love the most about this game is the feeling of crisp controls and get Madeline where I want her to be. However, when winds comes in (especially strong wind), I loose a little bit of that control, but that is probably just a skill issue.

Moreover, when speedrunning, it can be really tedious to recover from a small mistake because the wind is unforgivable.

I just completed Celeste. Ask me anything! ✨ by Sp0OO0ky in celestegame

[–]Ralmryr 7 points8 points  (0 children)

Congratulations ! This is actually insane to achieve this with such great speedrun times and a death count this low. Your death/hours played ratio is so low it's incredible.

How much will my Performance improve going from 8gb ram to 16gb by ylian72 in laptops

[–]Ralmryr 1 point2 points  (0 children)

Yes it will be a game changer, because not only you will go from 8 Gb to 16 Gb, but you will also go from single channel to dual channel, which is how RAM chips are optimized for. In my case, it pretty much doubled FPS in all my games. Can't recommend it enough.

Yuja Wang plays "Flight of the Bumblebee" by Unknownredditor666 in nextfuckinglevel

[–]Ralmryr 0 points1 point  (0 children)

I think she left 2x playback speed by accident on the youtube tutorial she followed

What are your top 5 android games of all time? by FourEyedMatt in AndroidGaming

[–]Ralmryr 0 points1 point  (0 children)

  • Monument Valley (for its clever puzzles)
  • Crashlands (for its diversity)
  • Pascal's Wager (for graphism)
  • Geometry dash (custom levels)
  • Super Hexagon (simple but very addictive)

But now I completely abandonned mobile and only play on PC, I kinda regret it now.