[-] Mikina@programming.dev 38 points 3 months ago

There's a piece of code in our hobby game project that I've written after attending classes in college about how to write clean and SOLID code. It's the most overengineered piece of shit I've ever written. I'm not saying it's the fault of the lectures, of course it's on me being a little bit over zealous, but it does check all the boxes - It's a simple "show selectable list of stuff", follows MVC, it's extensible without rewriting to adittional data-types and formats, extensible view that can show any part of data you need, generic, and in general it could be used anywhere we need, for any kind of data.

There's only one place where we need and use such list in our game.

I needed to rewrite a part of it, since the UI changed drastically, to not need this kind of list, while also adding events into the process. I haven't seen the code for almost 4 years, and it's attrocious. Super hard to understand what's going on, since it's too generic, interfaces and classes all over the place, and while it probably would be possible to rewrite the views for the new features we need, it's just so complex that I don't have the mental capacity to again figure out how it was supposed to work and properly wire it up again.

I'm not saying it's fault of the classes, or SOLID. It's entirely my fault, because the classes inspired and hyped me with ideas about what a clean code should look like, that I didn't stop and think whether it's really needed here, and went over-the-top and overengineered the solution. That's what I'd say is the danger of such Clean Code books and classes - it's easy to feel clever for making something that passes SOLID to the letter, but extensibility usually comes at a complexity, and it's super important to stop and think - do I really need it?

[-] Mikina@programming.dev 37 points 3 months ago* (last edited 3 months ago)

One night when returning from a party at work, I've decided to stay a while longer in the tram to escort my co-workers to the tram central hub (which was like half an hour of tram ride), instead of getting out at my home, which was only 5 minutes from our workplace.

When I got into the tram back home, there was an older guy with a carboard robot costume, who was talking to someone about his work in the theater. Because I find people like that interesting, I decided to move closer and sit next to them, so I can listen to their pretty interesting conversation. I've tripped and basically literally fell into their conversation, and the other guy left, so we started talking. It turned out he does a prop-guy on movies and for theater, and we hit it off pretty well. He also lived literally 3 minutes from my place, and we have decided to go have a few more beers at his home, which was basically a storage lot full of random stuff without much furniture - just random props, one bed, and a lot of beer.

I've messaged my GF that I'll be late, since I'm drinking with this pretty cool old guy, and send her a picture of the place. Her reponse was "Wait, isn't that ?". Turns out, he was a prop guy on a movie they were filming a lot of years ago at their old family house when she was young, and not only he was the most fun guy to be around there, always sneaking out to drink with them, but also briefly dated her (late) mother, so he's basically her step-dad. Since he's pretty old-school, no social networks, internet and barely a phone, we did exchange contacts and since then have seen him a few times, and it was always a treat, like getting us to the backstage of theater production. But the way we have met is so, so random and the odds of something like that happening are mind blowing. I usually don't follow random people home, but here we have hit it off so well that we wanted to keep talking and it didn't even felt weird.

[-] Mikina@programming.dev 41 points 4 months ago

They should have just add more rainbows to the skin, and make it as gay as possible.

[-] Mikina@programming.dev 46 points 10 months ago

Is it even possible to solve the prompt injection attack ("ignore all previous instructions") using the prompt alone?

[-] Mikina@programming.dev 45 points 10 months ago

I'm actually glad for it. It made me switch to Linux, discover Mullvad Browser and their VPN combo, get a GrapheneOS phone, find an amazing Freetube YT desktop client, and dabble with Home Assistant and PIHole. Plus I migrated to Protonmail and Kagi as my search, and Lemmy instead of reddit is also an amazing change, the discussions I've seen so far feel better and more in depth, and I'm enjoying my time here so far. The lack of endless content is also great, to help with implementing Digital Minimalism.

So, while I hate any large corporation and their greed with more and more passion, it has lead me to a nice privacy journey, for which I'm glad.

[-] Mikina@programming.dev 41 points 1 year ago* (last edited 1 year ago)

That's why I'm avoiding any extension I know I really don't need.

I've already burned myself once, when Nano Defender sold out and turned into a cookie-stealing malware. By the time it was one of few adblockers that were not being blocked by adblock killers. They've pushed a malware update through the Chrome web store, and started exploiting stolen cookies immediately.

It was a difficult day, where I had to explain to few of my exes that someone hacked their Instagram account due to an ad-blocker I've set up for them when we were dating few years ago.

[-] Mikina@programming.dev 51 points 1 year ago* (last edited 1 year ago)

My favorite story about docs is when I tried implementing multithreaded Raycast in Unity.

I needed it to hit multiple targets per ray. Should be pretty easy, after all - there is this parameter right in the constructor:

maxHits: The maximum number of Colliders the ray can hit.

And this is how you use it, straight from the docs:

The result for a command at index N in the command buffer will be stored at index N * maxHits in the results buffer.

If maxHits is larger than the actual number of results for the command the result buffer will contain some invalid results which did not hit anything. The first invalid result is identified by the collider being null. The second and later invalid results are not written to by the raycast command so their colliders are not guaranteed to be null. When iterating over the results the loop should stop when the first invalid result is found.

Well, no. It's not working like that. I was always getting just a single hit, but sometimes, I received two or more hits. After a few days of debugging, I have found a typo in bubblesort, which caused the multiple hits, and I was in fact getting only one hit every time.

Strange, must be a bug then. And then I found it. A bug report from 3 years ago. But it was closed as solved. And the resolution?

I have some news about the issue where RaycastCommand will only return a maximum of 1 hit regardless what you set maxHits to.

According to our developers, each individual raycast in a batch only does a Raycast single in PhysX which will only return the first hit, and not multiple hits if the ray passes through several objects which would require a different raycast function. The documentation simply doesn't explain this very well.

The docs above are from 2021. Three years after this. The fuck "doesn't simply explain it very well"? It literally explains it pretty damn well.

But looks like they've finally changed the docs for 2022+ at least, it did happen few years ago.

[-] Mikina@programming.dev 46 points 1 year ago

Why is Meta suing Freenom?

[-] Mikina@programming.dev 36 points 1 year ago

I've lost all of my faith in mobile gaming ecosystem ever since I saw that talk of the two guys that created a bot for generating and uploading as many slot machine games to the playstore as possible, just generic pull a lever, see an ad and that's it, based on a random keyword like "owl slot machine" or "bathtub sloth machine" with pictures pulled from google images, that let the bot run for a few months and then found out that they made literally thousands of dollars of ad money.

[-] Mikina@programming.dev 53 points 1 year ago* (last edited 1 year ago)

My personal opinion is that it's one of the first large cases of misalignment in ML models. I'm 90% certain that Google and other platforms have been for years already using ML models design for user history and data they have about him as an input, and what videos should they offer to him as an ouput, with the goal to maximize the time he spends watching videos (or on Facebook, etc).

And the models eventually found out that if you radicalize someone, isolate them into a conspiracy that will make him an outsider or a nutjob, and then provide a safe space and an echo-chamber on the platform, be it both facebook or youtube, the will eventually start spending most of the time there.

I think this subject was touched-upon in the Social Dillema movie, but given what is happening in the world and how it seems that the conspiracies and desinformations are getting more and more common and people more radicalized, I'm almost certain that the algorithms are to blame.

[-] Mikina@programming.dev 40 points 1 year ago* (last edited 1 year ago)

While lemmy.world is not my main instance, so I have no say in whether you defederate or not, I would like to bring this arugment into the discussion, because it's applicable for all instances, and make de-federation an absolute must for every instance.

Allowing Meta in goes directly against the idea of Fediverse, and we should fight it as much as possible.

This is a literal quote from the main header on https://www.fediverse.to/

The fediverse is a collection of community-owned, ad-free, decentralised, and privacy-centric social networks.

Each fediverse instance is managed by a human admin. You can find fediverse instances dedicated to art, music, technology, culture, or politics.

Join the growing community and experience the web as it was meant to be.

I've seen a lot of comments mentioning that defederating with Meta goes against the principles and main ideas of the Fediverse, that it should be inclusive and allow people to connect. But, judging by this main selling point of the Fediverse, it sounds to me like Meta shouldn't be in the Fediverse do begin with.

view more: ‹ prev next ›

Mikina

joined 1 year ago