this post was submitted on 22 Jan 2025
549 points (98.9% liked)

memes

11121 readers
3549 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to !politicalmemes@lemmy.world

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/AdsNo advertisements or spam. This is an instance rule and the only way to live.

Sister communities

founded 2 years ago
MODERATORS
 
top 20 comments
sorted by: hot top controversial new old
[–] FartsWithAnAccent@fedia.io 33 points 1 day ago (1 children)

Whoah, coding and algorithms???

[–] Clinicallydepressedpoochie@lemmy.world 4 points 1 day ago* (last edited 1 day ago)

I think you mean magic and miracles!

Magnets, how they work?

[–] hark@lemmy.world 9 points 1 day ago* (last edited 1 day ago) (1 children)

Crashes DESTROYED with CODING and ALGORITHMS.

[–] TriflingToad@sh.itjust.works 5 points 1 day ago

"big air" is hating these revolutions [spinning fan emoji]

[–] agamemnonymous@sh.itjust.works 18 points 1 day ago (2 children)

For a sufficiently defined "goingToCrashIntoEachOther" and "don't", isn't that basically how it works?

[–] Ephera@lemmy.ml 5 points 1 day ago (2 children)

Well, even at that level of abstraction, it's a bit weird, because goingToCrashIntoEachOther and dont() both need the information from where a collision is going to take place, so you'd expect something to be passed into dont().

Well, and it's easy to dismiss this stuff as implementation details, but that if-statement needs to run as part of a loop. This loop should probably be on a separate thread, so it doesn't get blocked by other stuff going on. Which means access to the motors needs to be behind some form of mutex, which it needs to be able to acquire fairly quickly. And then, yeah, those implementation details quickly add up to become the part that's actually complex.

[–] yetAnotherUser@discuss.tchncs.de 3 points 21 hours ago (2 children)

The functions just store all variables in a globally accessible JSON file. Compartmentalization is for programmers that aren't capable of writing bug-free code.

[–] Ephera@lemmy.ml 3 points 16 hours ago

While writing the comment above, I was thinking that there are some ~~uncivilized~~ languages that allow you to call functions in the same class without an explicit self.dont() or this.dont(), so technically you can magically transfer data like that.

But having a variable goingToCrashIntoEachOther in a class would be a bit weird.

[–] filcuk@lemmy.zip 3 points 21 hours ago (1 children)

The only logical way to coordinate multiple drones like this is to store the json on a local nas and have them take turns updating their vectors within

[–] yetAnotherUser@discuss.tchncs.de 2 points 20 hours ago* (last edited 20 hours ago)

I was thinking the drones would use Bluetooth to send the modified json to each other which negates the need for a NAS.

Of course, two different drones may have modified the json nearly simultaneously so the json would need to be timestamped and the earlier timestamp overrules the later one in case of merge conflicts.

[–] Korhaka@sopuli.xyz 1 points 20 hours ago (1 children)

Couldn't dont() just be an order to halt and goingToCrashIntoEachOther can be a simple true/false?

So the drones both stop, then start moving and immediately see they will crash into each other so they halt again. Drone version of you go, no no you go

[–] Ephera@lemmy.ml 2 points 16 hours ago

In my head, the drones were going so fast that just slamming into the brakes wasn't enough and you'd rather have to dodge. Not sure, if that's only in my head or if I actually saw the video of these drones a long time ago.

But yeah, if they are going really slow, then that could work.
Maybe you'd even have them back up a bit and then turn at a random angle before trying to continue flying, so you don't end up in the deadlock you described. 🙃

[–] ByteJunk@lemmy.world 6 points 1 day ago

It definitely should be, but at some point in time, very intelligent people though that this was a Good Thing:

bReadLine(bPort,&arru8NumberList)

[–] jayk@lemmy.ca 18 points 1 day ago
[–] capuccino@lemmy.world 5 points 1 day ago (1 children)

yea, pretty much like that

[–] funkless_eck@sh.itjust.works 1 points 20 hours ago

should be everything_is_okay if it's going to be a boolean

[–] Ephera@lemmy.ml 4 points 1 day ago

These days they'd write "AI" and you'd be none the wiser, because even if it involves a machine learning model (which is definitely not a given either), they will still have used quite a lot of coding and algorithms to tie it all together.

I like to mentally substitute these terms with "magic". Because ultimately, it just means that they don't want to explain it to you, but they need to tell you something, so you don't ask about it.

plsAndThankYou

[–] Kolanaki@yiffit.net 1 points 1 day ago

If {not_broken} then {fix_it_anyway};

[–] intensely_human@lemm.ee -1 points 1 day ago

This is actually how I would start out if I were developing this algorithm. I always start with the highest-level code first, then flesh out all the details in function definitions.