There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lemmy.ml

thejevans , to programmerhumor in LISP is ugly
@thejevans@lemmy.ml avatar

I know it’s not nearly as nested as this, but nesting in Rust annoys the hell out of me.


<span style="font-weight:bold;color:#a71d5d;">impl </span><span style="color:#323232;">{
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="color:#323232;">{
</span><span style="color:#323232;">        </span><span style="font-weight:bold;color:#a71d5d;">for </span><span style="color:#323232;">{
</span><span style="color:#323232;">            </span><span style="font-weight:bold;color:#a71d5d;">match </span><span style="color:#323232;">{
</span><span style="color:#323232;">                case </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">{
</span><span style="color:#323232;">                }
</span><span style="color:#323232;">            }
</span><span style="color:#323232;">        }
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">}
</span>

is something I’ve run into a few times

darcy ,
@darcy@sh.itjust.works avatar

the loop or match statement could possibly be extracted to another function, depending on the situation. rustc will most likely inline it so its zero cost

DWin ,

Just use this syntax


<span style="color:#323232;">let myResultObject = getResult() 
</span><span style="color:#323232;">let item = match myResultObject {
</span><span style="color:#323232;">	Ok(item) => item, 
</span><span style="color:#323232;">	Err(error) => {
</span><span style="color:#323232;">		return;
</span><span style="color:#323232;">	} 
</span><span style="color:#323232;">};
</span>
thejevans ,
@thejevans@lemmy.ml avatar

How does that change anything? Sorry if it wasn’t clear, this was assuming a function call in the for loop that returns either a Result or enum.

DWin ,

Oh sorry, I misread what you typed and went on a tangent and just idly typed that in.

One thing you could do for your situation if you’re planning on iterating over some array or vector of items is to use the inbuilt iterators and the chaining syntax. It could look like this


<span style="color:#323232;">let output_array = array.into_iter()
</span><span style="color:#323232;">    .map(|single_item| {
</span><span style="color:#323232;">        // match here if you want to handle exceptions
</span><span style="color:#323232;">    })
</span><span style="color:#323232;">    .collect();
</span>

The collect also only collects results that are Ok(()) leaving you to match errors specifically within the map.

This chaining syntax also allows you to write code that transverses downwards as you perform each operation, rather than transversing to the right via indentation.

It’s not perfect and sometimes it’s felt a bit confusing to know exactly what’s happening at each stage, particularly if you’re trying to debug with something mid way through a chain, but it’s prettier than having say 10 levels of nesting due to iterators, matching results, matching options, ect.

thejevans ,
@thejevans@lemmy.ml avatar

I definitely use that syntax whenever I can. One of the situations where I get stuck with the nested syntax that I shared is when the result of the function call in the for loop affects the inputs for that function call for the next item in the loop. Another is when I am using a heuristic to sort the iterator that I’m looping over such that most of the time I can break from the loop early, which is helpful if the function in the loop is heavy.

DWin ,

It feels like maybe this could be a code structure issue, but within your example what about something like this?


<span style="color:#323232;">fn main(){
</span><span style="color:#323232;">    let mut counter = 0;
</span><span style="color:#323232;">    let output_array = array.into_iter()
</span><span style="color:#323232;">        .map(|single_item| {
</span><span style="color:#323232;">            // breaks the map if the array when trying to access an item past 5
</span><span style="color:#323232;">            if single_item > 5 {
</span><span style="color:#323232;">                break;
</span><span style="color:#323232;">            }
</span><span style="color:#323232;">        })
</span><span style="color:#323232;">        .collect()
</span><span style="color:#323232;">        .map(|single_item| {
</span><span style="color:#323232;">            // increment a variable outside of this scope that's mutable that can be changed by the previous run
</span><span style="color:#323232;">            counter += 1;
</span><span style="color:#323232;">            single_item.function(counter);
</span><span style="color:#323232;">        })
</span><span style="color:#323232;">        .collect();
</span><span style="color:#323232;">}
</span>

Does that kinda syntax work for your workflow? Maybe it’ll require you to either pollute a single map (or similar) with a bunch of checks that you can use to trigger a break though.

Most of the time I’ve been able to find ways to re-write them in this syntax, but I also think that rusts borrowing system although fantastic for confidence in your code makes refactoring an absolute nightmare so often it’s too much of a hassle to rewrite my code with a better syntax.

thejevans ,
@thejevans@lemmy.ml avatar

Thanks for this! I’ll see if I can work something like this in.

RedditRefugee69 , to lemmyshitpost in Humans be like

There is something fascinating about getting a glimpse of how truly complex and incomprehensible the world is. There’s a reason Fire and Water are so hard to replicate with mathematical processors (in CGI)

strawberry ,
@strawberry@artemis.camp avatar

nah we got that shit figured out. u seen avatar way of the water?

Tash ,
@Tash@lemmy.world avatar

Aside from the boring story I wasn’t impressed by the 48fps and optical abberations of water when compared to real life. I don’t believe we “figured that shit out” yet.

RedditRefugee69 ,

Even as close as we are now it took a long time and is computationally intensive

TrustingZebra ,

7/10 Too much water

RedEyeFlightControl ,
@RedEyeFlightControl@lemmy.world avatar

Wait until the Air and Fire episodes!

Pretty sure cameron is playing the long con with this one. We got “Avatar the last Airbender” around the same time “Avatar” came out. The first Avatar was Earth Kingdom. This most recent was Water Kingdom. So it stands to reason the next two are Wind and Fire, right?

Right??

We are being played for absolute fools!

Brunbrun6766 , to memes in I mean, he isn't wrong
@Brunbrun6766@lemmy.world avatar

In case anyone didn’t know what that actually is

www.ncbi.nlm.nih.gov/pmc/articles/PMC7388807/

catsup ,

Maybe that’s just me, but I only understood like 1 out of every 7 words in that article

DessertStorms ,
@DessertStorms@kbin.social avatar

A much easier read: https://www.cornwalllive.com/news/uk-world-news/people-born-tiny-holes-above-811203
TL;DR: it's called preauricular sinus and is thought to be vestigial gills

andrew ,
@andrew@lemmy.stuart.fun avatar

Vestigial? We gotta find that gene.

bestnerd ,

It’s the aganoff gene. Still in us

andrew ,
@andrew@lemmy.stuart.fun avatar

Can I get updates on this gene daily?

franklin ,
@franklin@lemmy.world avatar

I’ll take them too but only if something big happens

pjhenry1216 ,

I'm trying to wrap my head around "invagination". Like I'm pretty sure I get the general gist of the meaning, but it's really making me realize I don't think I know the etymology of the root word at all...

TheYear2525 ,

A hole’s a hole.

1847953620 ,

It’s what the Volkswagen Auto Group calls it when you buy one of their cars.

EmoDuck ,

Ok ChatGPT, explain it for children:

ChatGPT A preauricular sinus (PAuS) is like a tiny hole near your ear that you’re born with. It can be on one side or both, and sometimes there can be more than one hole on one ear. People have known about these little holes for a long, long time, even before doctors named them. Some artists in the past, like Hieronymous Bosch, drew pictures of them. Doctors later called them preauricular sinuses.

These little ear holes are special because they can be a part of different health conditions that some people have from birth. Think of them like a unique feature, just like how some people have freckles or dimples. So, in modern times, doctors see them as something interesting about a person’s body, but they also check if they might be connected to any health issues.

Zhao ,

Fuck… that was pretty good

skankhunt42 ,
@skankhunt42@lemmy.ca avatar

I mean, how would we know if it wasn’t? I also understood nothing in the article.

iamdisillusioned ,

I assumed it was a scar from a failed forward helix piercing.

flameguy21 , to memes in Wadup

I barely remember anyone from Reddit. Too many people to ever see any consistent names (except on smaller subs). I see reccuring people on Lemmy pretty frequently though.

altima_neo ,
@altima_neo@lemmy.zip avatar

Yeah, mostly meme users like shittymorph and shittywatercolour

Ozzy ,

shoutout flameguy21, gotta be my favorite lemur

DaDaDrood , to memes in Finally solved

That’s ceo material.

interdimensionalmeme , to memes in Jim "Scumbag" Farley

Why are these posts specifically aimed at car company CEOs?

Are they begging for money in Congress again ?

Is this an anticar thing ?

Are they in union négociations ?

Donebrach ,
@Donebrach@lemmy.world avatar

The American autoworkers union is currently striking due to stalled contract negotiations.

w2tpmf ,

Because this is the trending politics community. I meant it says so right th…oh … “memes”? That’s the same thing, right?

Grayox OP ,
@Grayox@lemmy.ml avatar

Memes are memes

Antitrust7668 ,

What ever happened to making memes just to make someone smile for a moment and not a means to publicize an agenda? We get it, you’re a liberal who hates capitalism. Enough already…

WarmSoda ,

When a person that named themselves “antitrust” is upset about spotlighting union grievances…

Antitrust7668 , (edited )

When someone doesn’t know what a burner with a randomly generated name is and completely disregards my comment all together 😆

Dkcecil91 ,

Man you must really hate jokes.

Antitrust7668 ,

No, I just enjoy seeing something other than the same stupid, 1-sided shit day in and day out.

Soulg ,

Pointing out a blatant flaw does not inherently mean you hate capitalism. But that being your immediate reaction sure is telling.

Antitrust7668 ,

Fair point. You can’t also deny that places like this 1) aren’t overly political and 2) are so far left you never hear from the other side.

Destraight , (edited )

I do not see others laughing. This isn’t exactly funny. How is a CEO getting paid much more than the average worker supposed to make me laugh? This more of a news article snippet than a meme

HiddenLayer5 ,

Since when were memes exclusively meant to make you laugh? Memes have always been a means of societal commentary, think Rage Comics and AdviceAnimals plenty of the most famous ones talk about very real issues.

Gestrid ,

Even something as simple as the “This is fine” meme could be considered “not funny” in the same way this meme is “not funny” depending on how it’s used.

HiddenLayer5 ,

deleted_by_author

  • Loading...
  • Gestrid ,

    (You might’ve mistaken me for the other guy. I’m agreeing with you.)

    HiddenLayer5 ,

    Looks like I did. I apologize, should have paid closer attention when replying.

    Gestrid ,

    It’s fine, happens to the best of us.

    Destraight ,

    The “meme” is not exclusive to me. What made you have that idea?

    NaoPb ,

    I am laughing. Because what else can you do, seeing the hell we were born into and will probably stay the same for the rest of our lives. Nothing is going to change and if you weren’t born on top, you’re never going to come out on top. No matter what you tell yourself.

    Antitrust7668 ,

    Glad I’m not the only one…

    CatZoomies , (edited )
    @CatZoomies@lemmy.world avatar

    To add this for posterity, there is an additional component to the U.S. autoworkers union striking. In 2008 during the global financial crisis (with things like robosigning foreclosures, predatory loans with ballooning interest rates, etc.), some U.S. automakers were asking for government bailouts, which eventually were granted. These bailouts were entirely taxpayer funded. Now the automakers are refusing to meet union contract negotiations. Automakers not paying employees cost-of-living, or frankly, just salary increases is upsetting, but the additional hypocrisy of U.S. tax-paying citizens bailing out these companies with their own money in 2008, and then not having the companies return some of the wealth in 2023 is enraging.

    Edit:

    Forgot to add that when the automakers were begging for government bailouts, the automakers had to take away worker pensions and some benefits to “protect the system”. In 2023, the U.S. autoworkers union is fighting to get those benefits back for the workers.

    interdimensionalmeme ,

    It seems obvious the government is siding with the owners.

    NuraShiny ,

    I’d guess it’s because of the automotive union strikes that are going on in the US right now?

    Moonrise2473 OP , to mildlyinfuriating in AI generated content for a fake repair forum, just to let you waste money on those fake "surveys"

    The purpose is to trick the user in to clicking the fake link and waste 5 euro for the fake “survey” with those fake waits and fake countdowns leading ultimately to an error 404

    JokeDeity , to memes in Jim "Scumbag" Farley

    Laughs in 20k a year.

    Grayox OP ,
    @Grayox@lemmy.ml avatar

    Hope the cost of living helps offset that… what company has been stealing your labor from you?

    JokeDeity ,

    Big Lots, worst pay to effort ratio of anywhere I’ve ever worked. Working harder than I ever have for less than I ever have until I find something else.

    Grayox OP ,
    @Grayox@lemmy.ml avatar

    That sucks smelly ass, sorry to hear that, maybe try and organize once you have another job lined up? I’ll never forget working the morning shift at hardes, literally the most stressful job I have ever had, for the least pay I have ever made. I got a job at a factory and made twice the salary, but did a quarter of the work, and I had to hear the people I work with denigrate fastfood workers wanting to raise the minimum wage to $10 an hour, cause they thought they worked so much harder and only made $12 an hour. They pit us against eachother while eating caviar from fishes that are going extinct because they are actively poisoning every aspect of our society and our world simultaneously and living in opulence that make the Kings of old look modest. Shits gotta give…

    chiliedogg ,

    What part of the country are you in?

    JokeDeity ,

    Indiana.

    chiliedogg ,

    Darn. I don’t have any contacts there.

    But if you’ve got a clean criminal record look into city jobs. The pay isn’t usually amazing (better than yours though), but the benefits are usually really, really good.

    Even in Texas I have never had to pay premiums on medical, dental, and vision for a government job, and my last 2 cities have provided 2:1 matching on my retirement plan at 7% (so I have 21% going towards pension). The guys mowing the parks get the same benefits.

    StraySojourner ,

    I work in an IT call center and only make 25k. It’s a nightmarish routine of answering calls from customers who don’t believe in your basic right to be respected, answering to employers who believe the same.

    I_Has_A_Hat , to memes in Cheers my dudes

    A workday was also like 4 hours or less in biblical times though.

    The idea that people in the past worked long, grueling hours due to lack of technology is a myth. People had way more free time in those days.

    Prunebutt ,

    I’ve heard this a few times and wholeheartedly believe it. But I don’t know any sources, when I’m asked. Do you happen to know any?

    snaf , to internetfuneral in not even you

    Huh, I wonder who that’s for.

    pH3ra OP ,
    @pH3ra@lemmy.ml avatar

    Literally everyone.
    That’s the point.

    DragonTypeWyvern ,
    pH3ra OP ,
    @pH3ra@lemmy.ml avatar

    Oooh… Now I get It…

    ivanafterall , to memes in Nutella
    @ivanafterall@kbin.social avatar

    I think even a judge would understand murder upon seeing this. "Trial dismissed, you both frankly showed more restraint than I could have."

    brygphilomena , to linux in Linux can be used at your workplaces

    At best, it means sysadmin have to support both Linux and windows. You’re going to double everyone’s tools.

    This reads like an engineer who is way too invested in using their toolset and thinks everyone else is stupid for not using the same. Like someone who has never worked in management or had to make business decisions. They are looking at it only through a tech viewpoint.

    Not only would you need to have an IT team that knew how to manage and support it (which costs money and time) but you then have to train your entire work force which costs insane amounts of time. You would have to do IT training for every new hire for them to even use their computer. That sort of time and training (which takes two employees, the trainer and trainee) costs a lot of money, far more than any OS licensing or end user software costs. Plus the decreased work output while the user to get used to the toolset.

    In a software development company, sure, Linux might be a valid option. But it’s not ready for most companies main workforce. And it’s not a technological issue. It’s a human resources issue.

    ShittyRedditWasBetter ,

    It’s also a tech issue. Linux Desktop is a mess and breaks constantly as soon as you start to tweak it. And every damn plug in is maintained by a few different people with no commitment of backwards compatibility. It’s a disaster and incredibly time intensive to troubleshoot every broken desktop on patches.

    Linux is great for running technology services. Linux DE is and has been a disaster for 20 years now.

    x3i ,

    Wtf is “Linux desktop”? There are more than a dozen different mainstream desktop environments and window managers that have different degrees of maturity, stability and complexity so this blank statement is very hard to support. Not even talking about the servers/prtocols behind it. I can certainly not confirm that experience on Sway, Gnome and Hyprland and with how young the latter is, I would actually expect it to break.

    So no, from a technical perspective, Linux is absolutely ready as long as you stick to stable distros and configurations.

    Edit: wording

    ShittyRedditWasBetter ,

    Lolol gnome, stable, 🤣🤣🤣

    And I guess kdes swap to Wayland has been an easy joy for most people. I definitely don’t see bitching every other week about electron apps breaking.

    Craftkorb ,

    KDE is still working great on X11, which is the standard for most users anyway.

    ShittyRedditWasBetter ,

    👌👍 whatever you say.

    TheAnonymouseJoker ,
    @TheAnonymouseJoker@lemmy.ml avatar

    GNOME is the king of stability and professionalism, like it or not. KDE is like the GNU car meme, except GNOME is also open source, so KDE has no bragging rights. On top of it, GNOME is the Windows of extension ecosystem, putting cherry on top of the truffle cake.

    Bartsbigbugbag ,

    You know Reddit is still around, if you like it better, you can go back. No one here would fault you.

    ShittyRedditWasBetter ,

    Nah

    Bartsbigbugbag ,

    So you’re purposefully using something you dislike even more than something you call shitty? Really healthy habits there, no wonder you’re a miserable to be around.

    ShittyRedditWasBetter ,

    I’m actually hoping this place is successful. I don’t think it will be but I’m here for now. You really are inventing an imaginative story from a user name.

    rbos ,
    @rbos@lemmy.ca avatar

    Many places support MacOS as well, so it would only be a third additional toolset. Plus, there’s a ton of overlap between toolchains, which reduces the overhead further. If you’re supporting enterprise MacOS, you’re probably using Foreman, JAMF, or Puppet with Active Directory.

    Not to mention, a lot of places already have Linux servers, so the configuration management toolchains and expertise may already exist in a given organization, unless they’re absolutely pathologically mired in the Windows ecosystem. Which, granted, is a lot of places, but you’re making it sound far harder than it would be in a real world situation.

    cdsigma , to memes in Please discuss.

    Every day we stray further from the light of lord

    moosetwin , to memes in conservative physics
    @moosetwin@lemmy.dbzer0.com avatar

    this mf just said superfluid is not a real state of matter

    Rooty , to linux in It either runs on Linux or refund

    At this point I wouldn’t be suprised that some dev companies are taking Microsoft kickback money under the table. There is really no excuse for a game not to work on Linux natively on 2023.

    alteropen ,
    @alteropen@noc.social avatar

    @Rooty @Uluganda you mean apart from the extra work it takes for devs to give support to the platform, a platform where they will get less than 1% of sales.

    saying "theres no excuse" is just delusional

    Rooty ,

    Steam decks and other deck PCs are rapidly gaining ground, not to mention that steam runs natively on Linux. The “less than 1% marketshare” meme is 20 years old at this point and no longer relevant. Once again, there is no excuse.

    alteropen ,
    @alteropen@noc.social avatar

    @Rooty even 3 - 5% is not worth it for a lot of devs for the amount of time it would take. you must also consider every update also needing the same care taken to it. financially small devs don't have the resources and big devs know it would eat into their profits

    flashgnash ,

    I don’t think it neccesarily takes much to make a game compatible, from what I hear at this point it basically just consists of not doing really weird things with your game and not choosing an anti cheat that doesn’t work

    By the fact basically every indie game I’ve ever tried has worked flawlessly in proton I’d say there’s no excuse for new triple a games not to

    alteropen ,
    @alteropen@noc.social avatar

    @flashgnash yeah they work in proton... that's not native linux. porting a windows game to native Linux is more trouble that its worth for most devs hence projects like proton

    flashgnash ,

    I guess so but I honestly think proton is the way forward for Linux gaming, as far as I can tell they run just as well if not better under proton than on windows

    erwan ,

    It’s still less than 5%, so unfortunately it’s still at a level they can ignore.

    We need more gaming devices that ship with Linux out of the box, like the Steam Deck. Market share is not going to go up only with PC gamers choosing Linux over Windows.

    mnemonicmonkeys ,

    Plus it’s actually 3% market share now

    dino ,

    what kind of support mate? jesus I hate this argument. As if publisher do anything out of the ordinary to provide linux compatbility. All the work was done by valve already or is still being done.

    Cornelius ,

    Look at no man’s sky and how they in the past have had to patch their game for Linux via proton. It happens, proton is not perfect and it never will be

    dunestorm ,
    @dunestorm@lemmy.world avatar

    Well, the thing is that developers need to go out of their way to intentionally break Linux support. The community does 99% of the work in most cases. Launchers, along with anti-cheat are the most egregious.

    Anti-cheat I can semi-understand, the developer has to do some work, but popular anti-cheats support Linux no problem.

    Launchers, however are 100% useless other than Steam itself, I wish Valve would ban third-party launchers. I wouldn’t be surprised though if some publishers would pull their games from Steam if Valve outright banned them.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines