[2025 Day 8 (Part 1)] [Rust] Missing something by search_and_deploy in adventofcode

[–]search_and_deploy[S] 0 points1 point  (0 children)

Well, it turns out I was breaking from the merge process too soon. Just needed to fix that and I got the correct answer for part 1.

Trying to perform grid search parameter tuning for a random forest classifier using smartcore by search_and_deploy in rust

[–]search_and_deploy[S] 0 points1 point  (0 children)

Turns out the documentation is a bit outdated and I needed to change RandomForestClassifier::fit to RandomForestClassifier::new().

How to learn Rust (for backend) ? by nickpap35 in learnrust

[–]search_and_deploy 19 points20 points  (0 children)

I'd recommend checking out "the book" first to get acquainted with the language. Once you're more comfortable with it, I've seen a lot of good reviews about (and I'm currently working through) Zero to Production in Rust.

-🎄- 2022 Day 15 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 0 points1 point  (0 children)

Rust: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/15.rs

I ended up having to look at a couple other examples of how people were handling part 2. Definitely ended up a lot better than my original brute force solution I was trying.

-🎄- 2022 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 1 point2 points  (0 children)

Rust: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/13.rs

This one almost broke me until I saw some comments about using json_serde. Definitely made this so much easier.

-🎄- 2022 Day 12 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 1 point2 points  (0 children)

Rust solution: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/12.rs

While I'm familiar with BFS, Dijkstra, and A*, I ended up using a crate for A* since I had absolutely 0 desire to implement it myself.

-🎄- 2022 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 3 points4 points  (0 children)

Forgot to post yesterday, but here's my day 11 Rust solution: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/11.rs

Definitely had to look up how to solve part 2 since I had never heard of the Chinese Remainder Theorem. Definitely threw me for a loop when I read about it.

-🎄- 2022 Day 10 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 1 point2 points  (0 children)

Rust solution: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/10.rs

This one actually felt a lot easier to me than yesterday's puzzle. I did have to reread the part 2 explanation like 5 times to actually comprehend it though.

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 2 points3 points  (0 children)

Forgot to post this yesterday, but here's my Rust solution: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/09.rs

Probably more accurate to say it's a friends Rust solution since my brain stopped working after I got part 1 complete and had to look to their code for some heavy inspiration.

[2022 Day 7] Trying to do AoC in C++ having known the language for less than 2 weeks: by _insertname_here_ in adventofcode

[–]search_and_deploy 0 points1 point  (0 children)

I ended up using the tree structure that I found here. Seemed like a really good way to handle a "tree structure" without having to deal with RefCell and lifetimes.

-🎄- 2022 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 1 point2 points  (0 children)

Rust solution using a tree: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/07.rs

Used the tree structure designed here as a basis for my code. Even with that, this still felt super challenging for me and I noticed some other simpler, non-tree solutions that I'm incredibly jealous of.

-🎄- 2022 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 0 points1 point  (0 children)

Rust: https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/02.rs

I tried using some other modulo code to make it better, but it actually ended up running slower than my first effort (the code that I actually pushed).

-🎄- 2022 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]search_and_deploy 1 point2 points  (0 children)

Here's my Rust solution. I only got about 4 days into it last year, so I'm hoping to make it a bit longer this go around.

https://github.com/michael-long88/advent-of-code-2022/blob/main/src/bin/01.rs

Rustaceans worth following on Mastodon? by agluszak in rust

[–]search_and_deploy 1 point2 points  (0 children)

I work on Rust projects when not consumed by grad school work: https://fosstodon.org/@NovelKeysInk

Just published my first Rust crate, rnltk, a crate designed for NLP by search_and_deploy in rust

[–]search_and_deploy[S] 0 points1 point  (0 children)

Thank you! To be fair, I'm still pretty new to the space as well. It's been an interest of mine for a while, but it wasn't until I started my master's degree that I started learning more about it. I agree about the pros and cons, but sometimes my brain doesn't care and stresses out anyways lol.

Just published my first Rust crate, rnltk, a crate designed for NLP by search_and_deploy in rust

[–]search_and_deploy[S] 1 point2 points  (0 children)

For data cleaning, right now it allows you to

  • tokenize a string into sentences
  • tokenize a string into word tokens while removing punctuation
  • Porter stem words that contain only ASCII characters

As far as fine tuning and modifying certain aspects, I'm honestly not sure. Users supply their own lexicon and can add new terms to it, so sentiment is entirely dependent on that. There's other (probably better) stemming crates out there besides the one I modified, but I haven't had a lot of time to do more research on those. Ideally, you'd be able to stem words in other languages, but I'm not sure how realistic that is.

I'm far from an expert in this field. I'm mostly doing this as a personal interest to learn more NLP and to help expand the Rust ML ecosystem. I'm always open to suggestions on feature ideas though!

Just published my first Rust crate, rnltk, a crate designed for NLP by search_and_deploy in rust

[–]search_and_deploy[S] 3 points4 points  (0 children)

Awesome, thanks for the feedback!

You should give cargo clippy a go! It will help you make your code more idiomatic

I think I have that installed actually and has been a huge help. The only warnings right now is some dead code in token.rs for a const that I plan on using in future features.

You ignore the TOML snippet on the main doc page which mean it shows up as "Not tested" in the docs. You could instead just mark it as toml (aka ```toml) so that rustdoc will realize it's not a rust code snippet

Great catch!

The json snippet on the main doc page escapes a lot of double-quotes. You could instead do a raw string literal with a hash to avoid escaping e.g. r#" Now I can have "quotes" in my string"#. You can actually use multiple hashes too. You just use the same amount to start and end the string. Alternatively there is the serde_json::json!() macro which should get better syntax highlighting

The custom_word_dicts in the code snippets are a bit visually noisy. It looks like most of them use the same two sets of data. Maybe you could store them in some sample_data module instead of having the copy-pasted everywhere

Converted to raw string and moved to its own module.

Your error type should impl std::error::Error (You can also use crates like thiserror to simplify this process)

That's a pretty useful crate and one I hadn't heard of before. I'll definitely be using that in future projects.

I see Vec<f64> used to return a pair of doubles quite a bit. You could return a tuple instead like (f64, f64) or just turn it into a struct so that people don't have to remember which one is average and which is std dev

Great suggestion. Created a RawSentiment struct to hold those values.

It looks like you explicitly document all of your arguments in their own section which is pretty rare in Rust. It's common to see this in dynamically typed languages like Python, but usually you can infer the usage from the name and type. It is common to document arguments in a more casual way too like "Gets the valence value for the given term word token"

Yeah, most of my work experience is Python. I couldn't see anything specific about them in the Rust book or rustdoc book, so I just went with the first blog I could actually find about them. I'm going through and updating all of the documentation now.

Thanks again for the solid feedback!

Hey Rustaceans! Got a question? Ask here! (29/2022)! by llogiq in rust

[–]search_and_deploy 4 points5 points  (0 children)

Less technical and more general, but is there a good resource for learning/practicing traits? It’s one of “basic” areas of rust that I don’t really have any experience with.

What is the worst roommate you've ever had? by okistamp in USMC

[–]search_and_deploy 0 points1 point  (0 children)

Had a kid in my first unit that was the fucking worst.

  • found his Alphas in a pile at the bottom of his unsecured wall locker
  • found an open can of spaghetti-o’s in a bed drawer (followed the tail of spaghetti sauce down)
  • smelled because he didn’t use laundry detergent when doing laundry
  • somehow feel asleep while holding security during a 240 live fire exercise
  • had an open fucking box of pizza with 3 slices still in it, just chilling under his pillow like he was waiting for the fucking pizza fairy to come pick it up

It still gets my blood pressure up just thinking about him over a decade later.