Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
jestdotty566265do1-preview can answer questions
gpt makes up answers
like I asked it if you could look up if a hashset contains a hash in rust and it made up some dumb garbage that violates types
o1-preview said no. though technically you could do it with unsafe code
sigh. my ideas never work out in rust
I didn't wanna use a hashmap. I just wanted the values to auto index and overwrite if existing. therefore hashset, yes? but then turns out I had a need to check if a key was unique somewhere else because of a bug someone else was handing me that was giving me values as new when they weren't new. so I needed to check if I already had the value in the set. but without doing expensive lookup stuff to make the object that's in the set. well fuck you I guess -
typosaurus1219865d@jestdotty Imagine that @SidTheITGuy was making fun of the 'thinking' of o4. You would think he would gain some experience before bashing it. The differences are big. Upgrade Sid, dinosaur :p * pet pet pet *
@jestdotty it should have a upsert function that inserts if not exists yet. The thing you had to build yourself now. I think in low level languages they give you the bare minimal to work with. Bit weird because rust kinda feels high level with such std. Pick a side.
Preferably you would extend the original HashMap thingy and overwrite the set functional that doesn't check 'get' value right? Can be fun?
Maybe try your projects in C++, maybe it makes more sense. Would be interesting, a set of projects made with both languages with a summary of the experience -
typosaurus1219865d@jestdotty I mainly use for formatting / renaming and autocomplete. Barely use chat. I do often select code, do some ctrl+I and magic appears
-
typosaurus1219865d@jestdotty what would be the name of a handicapped dinosaur in this case? I think the typosaurus
-
bazmd52265dI don't think "AI" can build low-level code and work with off the shelf hardware which I enjoy doing, working with relays and sensors, robotic systems, and putting it all together, my next major project maybe a flight simulator (I'm still thinking about it), I wanted to build a simulator years ago but the hardware wasn't good enough.
-
typosaurus1219865d@bazmd I'm sure AI can even help with that. It knows that if you just defined x, that you want to reuse x as parameter and stuff. It'll surprise you. If it's wrong, you type ahead. Try codeium, totally free, great performance.
What hardware do you use for your simulator? -
lorentz1518565d@jestdotty If you want to know whether an element is in a hashmap you have to do a lookup.
you can use get_or_insert or one of its variants to only insert a value if it's not already in the set. If there's any meaningful difference between the two candidates but they compare the same and hash equal then that's a weird enough hack already that I think just checking the value in the set afterwards to see which one it is is a reasonable counterhack.
If you can still change datastructures, consider switching back to a HashMap<T, ()> and using get_entry_mut. -
bazmd52265d@retoor If you look up Robospot, the idea is similar to that, except the servos have to take the weight of a person sitting inside it and be powerful enough to move it, LED screens have brought the weight down too and can be built into the simulator, even with the most basic controller board it can be programed just as easy as a robotic lighting system or a large telescope, I would have no trouble building a prototype with a local engineering company that I worked with on another project. They would build the frame, mountings and chassis, it would be built like an aircraft, I have lots of ideas about it...
-
Hazarth953065d> "I mainly use for formatting / renaming and autocomplete. Barely use chat. I do often select code, do some ctrl+I and magic appears"
> "it's thinking omg!!"
You just backtracked all the way to the start on the Gartner hype cycle? -
typosaurus1219865d@Hazarth I've just researched the gartner hype cycle and its key phases and do not understand your point :) But backtracking is fun, so yeah, totally did that!
-
Hazarth953065d@retoor it means that everyone is going to be charmed by the "magical o1" until they are not... The same way people were totally salivating ober gpt3 and gpt4 at their individual release until, months later, people finally realized It's not all that and It's actually barely useful for anything. Not sure why we have to go through this again for o1.
-
typosaurus1219865d@Ranchonyx no, no, no. You're a typosaurus now according to sophisticated research
-
cuddlyogre124864dNo thanks. Every time I use it, it causes me more work than if I had just done it myself.
-
devRancid65364d@lorentz there's still a difference between looking up if a key exists and also getting it's value (additional memory accesses etc)
-
lorentz1518564d@devRancid If you don't use the value, the load is optimized away. Rust is a static language that uses LLVM, you can count on these things. You always have to load the key because the same hasher state could be produced by a different key too.
-
12bitfloat943764dEh, AI is sometimes useful for little self contained things I'm too lazy to write myself
For actual programming work it's kinda useless since it doesn't know your code base and how everything should integrate -
lorentz1518564d@jestdotty This really sounds like a hashmap from the data you're actually considering for equality to the whole object would be a better fit. Generally, equality should consider the whole object. It's not necessarily wrong if it doesn't, but it's a caveat to consider for further decisions because datastructures are designed with the assumption that equality is total.
also check out the raw entry API that's available on unstable and in the Hashbrown crate. Hashbrown is identical to the std hashmap, it's literally imported by std, but std hides the raw entry API because it's kind of contract breaking. -
lorentz1518564d@jestdotty Hashing in Rust just means deriving a value from every observable aspect of an object, hasher states can be small and in particular hashmaps usually use a very small hasher state and truncate it to an index anyway. A hashmap lookup involves jumping to that index, then going through every key with the same truncated hash and comparing each of them with the lookup key for equality.
-
typosaurus1219864d@cuddlyogre your name is already cuddlyogre, that's fine. I don't have to invent a dinosaur name for you :)
-
lorentz1518564dYou can also define a borrowed version of your object. If you implement Borrow and the equality traits, you can use the borrowed version as a lookup key. If you also implement ToOwned, you can use the borrowed version with get_or_insert and it'll be converted only if needed.
-
lorentz1518564d@jestdotty actually, check out HashSet::get_or_insert_with, it can be used for what you want. You can define a boolean flag and set it in the converter function to detect that the new value was inserted.
-
typosaurus1219864d@12bitfloat you're totally, totally wrong. Not used AI for long time. I can imagine if you say code generation is useless, but it goes beyond that. The other two points are totally opposite. It knows your codebase and it predicts integration quite while. Use codeium for a a few hours and you'll proof me right. Until then, you're a resistosaurus.
Not only AI will know your codebase, the whole world will know. Made possible by FREE AI 😂 -
lorentz1518564d@retoor I know all this about the Rust API because whenever I get stuck I scour the docs for the building blocks I need and learn a ton of unrelated stuff in the process.
-
jestdotty566264d@lorentz I remember when I could straight up read the whole docs for 4 hours and remember everything
now I get lost cooking so I had to take notes and mark the steps with checkmarks because brain damage -.-
hopefully I'll recover one day... -
I've tried chat, but not autocomplete. all the experiences I've had so far with AI were charming, but didn't have good results, so I'm not fully convinced it's useful.
-
typosaurus1219863d@darksideofyay it's advancing rapidly. I swear by it now. Try codeium for vscode to get an up-to-date experience. The AI from previous month is not the AI of today. Much advancements.
Main difference: normally a word is auto completed. Now it auto completes a line with your casing of variable names and most likely exactly the variables you want and maybe even the value you would expect. Tbh, it's freaking many times right. Almost magic. These are my stats: https://codeium.com/profile/... (One day i had 608!!! completions. I assume it only counts accepted completions, else it's nothing)
But i have no idea what percentile means. I code freaking a lot, maybe i'm in top users or smth. Did had the plugin disabled for some reason i just found out.
AI is worth it to retry from time to time -
typosaurus1219863d@darksideofyay
Own example, it sees that this one is missing in the list and it auto completes the whole if statement. It even helps me prevent a mistake by forgetting it. it's free btw -
typosaurus1219854d@iiii I thought you're advising me to use switch statements. If you mean something else, tell me. I don't understand in that case
-
typosaurus1219853d@jestdotty it wasn't my answer but I also make sure my feature doesn't last a day, I break it up in multiple components in that case that I all see as a deliverable. The interview was about finishing side projects in general iirc. The answer was to keep it fun by rotating a few projects. That rotation period can be a few hours to two days. I don't work longer on same project longer than two days in general. It's just the time that I get a bit tired if certain type of project and move on. It's not really planned, it's just how it is. I'm in a finishing phase currently, I finished a few projects. Was about time!
-
typosaurus1219853d@jestdotty also, by rotating regurarely, you're always looking with fresh mind towards the project. That's a big noticeable plus!
-
typosaurus1219853d@jestdotty code is way more fun than gaming for me. Putting brain to work gives me the idea of doing smth usefull and that gains more dopemine than anything else. My end products mostly are useless but I consider trained brain also an end product. Gaming doesn't have an end product for me
-
typosaurus1219853d@jestdotty yeah, that's what I had for 1,5 years due medication, brain issues. Now I'm getting a bit used to it and brain is running and enjoy it every day. I was a zombie
Related Rants
If you don't use AI for coding you're a kinda dinosaur. Cute, but that's all
random
old
credential sharing
ai
dinosaur
extinction
dying