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.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

rhpp , in void *

Actually void* just points to anything, with no regard to the type of that thing. Pointing to the void is more accurately described by NULL pointer.

tunetardis ,

Fair, though I guess my interpretation was that void* is kind of like a black hole in that anything can fall into it in an unsettling way that loses information about what it was?

Traister101 ,

It erases the type of what your pointing at. All you have is a memory location, in contrast to int* which is a memory location of an int

frezik ,

“Allow me to combine the worst feature of strong typing with the worst feature of dynamic typing”.

marcos ,

But we need dynamic types!

…hold my beer…

riodoro1 ,

Result: one of the most if not the most popular programming languages.

neo ,

So, when I want the void to point back at me, do I have to loop over void* or over NULL?
And how many iterations?

programmer_belch ,
@programmer_belch@lemmy.dbzer0.com avatar

For the void to point back at you just dereference the NULL pointer

sus ,

as many iterations as it takes


<span style="color:#323232;">void* x = &x;
</span><span style="color:#323232;">char* ptr = (char*)&x;
</span><span style="color:#323232;">
</span><span style="color:#323232;">while (1) {
</span><span style="color:#323232;">    printf("%dn", (unsigned int)*ptr);
</span><span style="color:#323232;">    ptr--;
</span><span style="color:#323232;">}
</span>
mox ,

In other words, void refers to the typing of the pointer, not a particular value that might be present at its target.

(But I can see how someone might find it confusing.)

PoastRotato , in New developer
@PoastRotato@lemmy.world avatar

I just threw up in my mouth a little.

voracitude ,
RiikkaTheIcePrincess ,
@RiikkaTheIcePrincess@pawb.social avatar

I kinda wanna upvote this but it’s horrible so I’m posting this instead 😅

voracitude ,

I apologise, and I also apologise that I’m not apologising that hard about it 😂

qaz ,

Why?

zea_64 , in You can certainly change it. But should you?

It makes more sense if you think of const as “read-only”. Volatile just means the compiler can’t make the assumption that the compiler is the only thing that can modify the variable. A const volatile variable can return different results when read different times.

fl42v OP ,

I thought of it more in terms of changing constants (by casting the const away). AFAIK when it’s not volatile, the compiler can place it into read-only data segment or make it a part of some other data, etc. So, technically, changing a const volatile would be less of a UB compared to changing a regular const (?)

Scoopta ,
@Scoopta@programming.dev avatar

const volatile is used a lot when doing HW programming. Const will prevent your code from editing it and volatile prevents the compiler from making assumptions. For example reading from a read only MMIO region. Hardware might change the value hence volatile but you can’t because it’s read only so marking it as const allows the compiler to catch it instead of allowing you to try and fail.

humbletightband ,

I will not tell my kids regular scary stories. I will tell them about embedded systems

suzune ,

When you program embedded you’ll also dereference NULL pointers at some point.

More...Some platforms can have something interesting at memory address 0x0 (it’s often NULL in C).

humbletightband ,

I was thinking about telling them how in embedded systems it’s a good practice to allocate the memory by hand, having in mind the backlog, but yours will come first

Scoopta ,
@Scoopta@programming.dev avatar

In amd64/x86 kernel space you can dereference null as well. My hobby kernel keeps critical kernel structures there XD.

mox , (edited )

AFAIK when it’s not volatile, the compiler can place it into read-only data segment

True, but preventing that is merely a side effect of the volatile qualifier when applied to any random variable. The reason for volatile’s existence is that some memory is changed by the underlying hardware, or by an external process, or by the act of accessing it.

The qualifier was a necessary addition to C in order to support such cases, which you might not encounter if you mainly deal with application code, but you’ll see quite a bit in domains like hardware drivers and embedded systems.

A const volatile variable is simply one of these that doesn’t accept explicit writes. A sensor output, for example.

TheEntity ,

The very notion of “less of a UB” is against the concept of UB. If you have an UB in your program, all guarantees are out of the window.

fl42v OP ,

I mean, changing a const is itself a questionable move (the question being whether the one doing it is insane)

QuaternionsRock ,

I’ve never really thought about this before, but const volatile value types don’t really make sense, do they? const volatile pointers make sense, since const pointers can point to non-const values, but const values are typically placed in read-only memory, in which case the volatile is kind of meaningless, no?

zea_64 ,

Maybe there’s a signal handler or some other outside force that knows where that variable lives on the stack (maybe through DWARF) and can pause your program to modify it asynchronously. Very niche. More practical is purely to inhibit certain compiler optimizations.

rooster_butt ,

They do in embedded when you are polling a read only register. The cpu can change the register but writing to it does nothing.

QuaternionsRock ,

That seems like a better fit for an intrinsic, doesn’t it? If it truly is a register, then referencing it through a (presumably global) variable doesn’t semantically align with its location, and if it’s a special memory location, then it should obviously be referenced through a pointer.

scorpionix , in As someone not in tech, I have no idea how to refer to my tech friends' jobs
@scorpionix@feddit.de avatar

Not engineer.

At least here in Germany, engineer is a protected profession. Other than that: All of the above.

Infynis ,
@Infynis@midwest.social avatar

Interesting. In the US, all kinds of jobs are called engineers

omgitsaheadcrab ,

Yeah, same in the UK. Really annoyed me that the plumber, electrician… etc were all engineers. In Germany it’s as protected as calling yourself doctor, which ultimately affects how people view the profession and the salaries they command

masterspace ,

I mean, it’s a protected term in Canada too but it doesn’t necessarily lead to higher salaries.

My cousin who’s an electrician made about as much as I did as an electrical engineer, and I left electrical engineering to be a software developer because it paid more. Engineering paid more than being an electrical technician / designer, but not by a huge amount.

omgitsaheadcrab ,

I left aeronautical engineering to become a software “engineer” for similar reasons, salary and work culture. Actual engineering pays quite terribly in the UK, it’s a fair bit better in Germany or the US from what I hear.

brbposting ,

US much better than Germany I’ve heard!

emberwit ,

Software yes, actual no

Damage ,

Yeah it’s difficult for me to name my title in English 'cause the word doesn’t exist. I went to a technical high school, not university. (Not college!)

mumblerfish ,

It does not only dictate your professional life/status in Germany, being a doctor, your social as well. Someone I know got a postdoc in germany, no luck finding a place to live until they started asking their german collegues to call and saying “doctor so-and-so is looking for an appartment”. So, he gets one. The guy has a very long full name, so the nametag the landlord is gonna put on the postbox is way to long, but if you cut off the part where it says he is a doctor, it would fit. He insists to cut that part away, the landlord just refuses, says fuck your name and person basically, and cuts off part of his last name instead. Saying you are a doctor gets you first in fucking everything (maybe not lufthansa, then they just say ‘senators’ or something). Extremely class divided social society that.

brbposting ,

Damn I’m surprised to hear that!

FiniteBanjo ,

TBF some plumbers and electricians are qualified engineers, just not all.

tsonfeir ,
@tsonfeir@lemm.ee avatar

There are a few dick engineers working on the corner. Dickvelopers? Cockologists?

prettybunnys ,

I believe job titles specifically are(were?) considered in exempt / non-exempt status for overtime.

Why Administrator is in a lot of titles also.

Gladaed ,

If you studied a technical science and do coding for that you may be allowed to be called ingenieur.

NotSteve_ ,

It is in Canada too but that doesn’t seem to stop companies from using the term

Kidplayer_666 ,

Here in portugal too. But there is a specific engineering field which is informatic engineering? Software engineer essentially

Jrockwar ,

Hmmm. But all the people around me working in software studied multiple years in an Engineering field. In my case, I studied a 5-year industrial engineering and two masters afterwards; I feel very comfortable wearing the “software engineer” or more accurately “robotics engineer” badge.

acockworkorange ,

During the 2008 recession, a lot of Uber drivers had engineering degrees. I guess we should start calling Uber drivers engineers too.

Jrockwar ,

No, that’s precisely the opposite of my point. If you drive an Uber, you’re an Uber driver. People are “CEO” or “Judge” despite nobody having a CEO or Judge degree. Your profession is what you do, not what you happened to study in your teens to get there.

acockworkorange ,

I understand your point now and I agree. Your colleagues that studied engineering became programmers. Why do people treat this as if that’s bad? It’s a beautiful profession.

Jrockwar ,

I don’t think it’s bad, in fact I wonder the same. These are my colleagues because it’s the same path I took - I now work developing self-driving cars (I slowly transitioned from aerospace to manufacturing automation to robotics) and it’s the most rewarding job I’ve ever had, and it feels very much like engineering. I don’t care if I’m not a “manufacturing engineer” anymore; I really like my job and I like my title to reflect somewhat accurately what I do, but that’s the extent I care about it.

explodicle ,

How come they don’t count? They’re figuring out how the machines should work, for money. That’s engineering, right? (I’m an American mechanical engineer)

floofloof ,

In Canada you have to be qualified and licensed to call yourself an engineer. There are people who can use the title “software engineer”, but it’s not the majority of people working in development.

astraeus ,
@astraeus@programming.dev avatar

They have to protect German engineering at all costs

rimjob_rainer ,

Softwareingenieur darf man sich nennen, wenn man ein mathematisch-naturwissenschaftliches Fach studiert hat, wo Informatik dazugehört. Somit ist Software Engineer oder Softwareingenieur die korrekte Berufsbezeichnung für alle mit einem Bachelor/Master oder höher in Informatik.

emberwit ,

Dann muss man schon auch als solcher tätig sein, sonst nicht.

nickwitha_k ,

Sparkling Technologist.

pwalker ,

That is not entirely true. It’s a bit more complicated. Yes it is protected since the 1970s but it’s more of an academic title. You needed to study something that is “mainly” of technological or scientific nature. Basically befire the Bologna reform every student in Tec. Unis/FHs did get the title Diplom-Ingenieur. So the engineer part was literally part of your degree. This of course also true in case you studied IT. So yes there are many who call themselves IT engineers also in Germany. However it’s more of a philosophical question how much software development is actually engineering or rather craftsmanship.

AeonFelis , in Is this a Nut?

C# should actually be “What Java said, except it’s ICrackable”.

callumbirks ,

Would the equivalent Rust trait be Crack?

blackstampede ,

AsCrack

taaz ,

Into<dyn AsCrack>

class_d_fire ,

Into’s type parameter has an implicit Sized bound. I think AsRef<dyn Crack> would be the trait of choice :D

Hazzia ,

pervert

warlaan ,

No, actually C#'s answer should be: “What Java said - hold on, what Python said sounds good too, and C++'s stuff is pretty cool too - let’s go with all of the above.”

C#, or as I like to call it “the Borg of programming languages”.

dependencyinjection ,

I got my first software developer role last year and it was the first time I’d written C#, I was more TypeScript. Now we use both but I must say I really like C# now that I’m used to it.

LeFantome ,

I think most programmers would like C# if they spent time with it. It is getting a bit complex because the joke about it over borrowing from other languages is on the money. It is a nice language though and pretty damn fast these days all things considered.

Scoopta ,
@Scoopta@programming.dev avatar

There’s too much MS in the language and runtime for me. The fact that it gives my Linux programs DLL files and the fact that by default the SDK phones home makes me run away in horror from not only writing it but also running other projects written in it.

force ,

even nicer is F#. join us brother, you can do everything that you can do in C# but better

dependencyinjection ,

What does it offer that would make it better? Just curious and I’m not in a position to change out tech stack at work though.

force , (edited )

The biggest selling point about functional languages for me is the type system, mainly algebraic/union types (which imo Scala does the best), pattern matching (and imo Rust does this best), and the incredible type inference, but also all the functional features. But I think the best part about F# specifically comparing it to C# is the removal of a shit ton of the boilerplate. Plus data is immutable by default, always a nice touch.

For F#, the special types may not be super relevant when interacting with C# libraries, but in general you can do everything in F# that you can do in C#, including all the OOP. It’s just an added bonus that you basically get enums on steroids and pattern matching.

I find that writing in F#, even if I write basically the same code I would in C#, speeds up my design/programming a TON and makes it significantly more maintainable and easy to navigate. There’s a lot less clutter and you don’t have to worry about the layers upon layers of repetitive boilerplate.

The only downside IMO is that F# can have some terrible error messages. And of course, you have to learn F# syntax which can be a small pain if you’ve never used ML or Haskell (especially when it comes to function call syntax). But if you’re mainly interfacing with C# libraries then it’s no big deal. I started making an application only utilising C# libraries (mainly DB stuff) the same day I started using F# and it went relatively smoothly, although probably because Rust is the main language I used then.

This resource might help, although I can’t say it’s enough to completely learn the language: fsharp.org/learn/

redcalcium , in Yup sums up all my project

Autoscaling for personal projects is just a tool to turn random DDOS into personal bankruptcy.

Kissaki ,
@Kissaki@programming.dev avatar

I scale by dropping requests

Blue_Morpho ,

I don’t understand how anyone uses a paid API for a personal project. I looked hard into MS, Google and Amazon a few years ago for a project and couldn’t find anywhere where you could hard block services to never ever go above the free tier.

Considering that I’ll build a project and forget about it for years, putting in my credit card into a cloud service was a guaranteed gigantic bill sometime in the future when things went wrong. (Over your life, something is guaranteed to go wrong.)

poke ,

Oracle cloud will stop things if it goes out of the free tier.

whereisk ,

Have you heard of virtual debit cards? You can’t charge what’s not there.

Also, at least AWS will in fact send you an email when you approach the end of free tour usage.

Having said all that, most devs can host the few hundred visits they might get over a month with a $200 home server and a free CloudFlare cache if they know what they’re doing.

Blue_Morpho ,

Have you heard of virtual debit cards?

I tried one and it didn’t work. Reading about it said they block those.

I don’t need an email. I need it to stop instantly. In the time it takes me to notice an email, I could have hundreds of dollars in charges.

kogasa ,
@kogasa@programming.dev avatar

All cloud providers will support budget notifications. That doesn’t do much good when you shoot past the budget in a short timespan. I set a Google cloud budget of $20/month and enabled a Tensorboard instance, which had no observable indication that it cost anything except the base cost of the VM, and got notified that I was $280 over budget the next day. Apparently there was an upfront $300/month/user fee for Tensorboard. (Several months later they changed the pricing model to $10 GiB/month with no user fee.)

lordnikon ,

to answer your question you can with budgets under cost explorer and running everything as a cloudformation template

histic , in I need this....

Help! It didn’t change my code at all it’s just the same!

devilish666 OP ,

Congrats then…

InnerScientist ,

Can’t Improve Upon Perfection

redcalcium , in wait what

The sole purpose of the tab key is for instructing the editor to insert four spaces.

Buddahriffic ,

*three spaces.

Actually, let’s make that two.

absentbird ,
@absentbird@lemm.ee avatar

2 space gang represent.

theneverfox ,
@theneverfox@pawb.social avatar

They fear us. We have to hide in the shadows.

But this is just one more example of our superiority - a perfect compromise between the file size and the nightmare that is two different invisible characters

Liz ,

Cycling through buttons, atl+tab, Ctrl+tab, some other fourth thing.

redcalcium ,

something something real linux users don’t use gui and tab completion

Liz ,

You can take my Cinnamon GUI from my cold dead hands.

mexicancartel ,

To insert a… TAB. Not four or any n number of space but TAB

redcalcium ,

After years of ass-whopping by python interpreter for stray tab characters, I’m now mentally rejecting the existence of tab character in my computing devices.

mexicancartel ,

Isnt that only because you “mixed” spaces with tabs? I have had no issues with python and tabs with no spaces for intendation

hansl ,

Yep the ASCII table just goes 1, 2, 3, 4, 5, 6, 7, 9, 10, …

corsicanguppy , (edited )

And indent according to my major mode.

Maiznieks , in Manager: This task only takes 30 minutes. Why did it take you the whole day?

“Fix”

obrenden ,

With 400 lines changed over 50 files

hypnotic_nerd OP ,
@hypnotic_nerd@programming.dev avatar

“updates”

dukk ,

“feat: stuff”

Guilty of this one myself.

Jeremyward ,

I had a commit recently that was like 2000 lines changed over 6 files. Really should have been a smaller issue.

Dkarma ,

Y tho??? Holy shit. Commits should be like functions. One thing and one thing only. Maybe a small group of files like the same change over multiple config files. 50 is insane to me.

Dasnap ,
@Dasnap@lemmy.world avatar

‘Change’ if I’m feeling particularly chaotic.

ShittyKopper ,

git commit -m $(date)

akkajdh999 ,

Make a cron job for git add . &amp;&amp; git commit “$(date)” &amp;&amp; git push -f

MajorHavoc ,

I actually did this once…I swear there was a good reason. I promise it wasn’t anywhere that mattered.

Edit: I think it was a personal journal repo that I wanted daily versions of, but couldn’t be bothered to actually check in.

frezik ,

“Bits were fiddled, possibly in the right way”

PixxlMan ,

My butterfly was having a bad day so I can’t be sure, sorry

Dkarma ,

See jira-blah: is my go-to. Sometimes there’s even a jira at that location/number 🤔

Meowoem ,

‘fixed odd or even function for values 600 to 950, plus other stuff I forgot to commit earlier’

thurstylark , in JavaScript
bungle_in_the_jungle ,

I come back to watch this every few years. It’s so good!

brbposting ,

How do I know so little about programming yet this is still so funny?

Maybe the neuroscientists have some insight:

https://sh.itjust.works/pictrs/image/e7206940-e3e5-44bd-8f4b-edb85b807f64.jpeg

davidagain ,

You can tell that they find the answers absurd and the WAT memes are universally funny.

bleistift2 ,

I’ve seen this guy referenced twice today. If only he knew how to write instead of giving talks…

Squiddlioni , in Like getting 9 women pregnant and expecting a baby in 1 month

It's called Brook's Law. It takes a lot of time and effort getting people up to speed, and that takes experienced devs away from coding. You also have to get them credentialed, teach them the tools, need extra code reviews/testing/bugfixes while they learn the quirks and pitfalls of the code base, etc. In the long term you'll be able to get more done, but it comes at the cost of short term agility.

SpaceNoodle ,

This, except for bullshit credentials.

Squiddlioni ,

Maybe "credentialed" wasn't the right word. I was thinking of software licenses and access to third party tools and systems. Probably not as big a mess in game dev as it is in government.

IsThisAnAI ,

You mean you didn’t enjoy sitting there when your thumb up your ass while you wait 6 months for a background check and another 6 months to get your GFE? Crazy!

Tar_alcaran ,

Yeah, it happens everywhere, all the time. And the main cause of it is, surprise surprise, people who have no technical understanding of the subject matter.

doublejay1999 ,
@doublejay1999@lemmy.world avatar

If you have a troubled project, and you add more people, you have a bigger troubled project.

It’s a common trap for project managers … and in fact some pretty high brow projects blew up because of this.

When you are called in front of the board, and they say:

“Hey, your project is late, we get it, it’s not your fault, but we have to deliver on the 1st of the month. - and so we’re giving you our 10 best men to get it done”

I can tell you, it takes a certain amount of testicular fortitude to say “That won’t work”. More than I had at the time , in fact.

Transporter_Room_3 ,
@Transporter_Room_3@startrek.website avatar

My anecdote isn’t quite the same since it deals with something a lot simpler, and lower stakes than stuff like this.

used to assemble bicycles for a sporting goods chain, and had to travel to a nearby city to build theirs because nobody there knew how. I had two days to get 300 done.

I got there and start, and about two hours in the store manager comes over and tells me he’s pulling 2 of their operations employees to help and learn how to build. “they’re the strongest guys we have so they should have no problem tossing these bikes around”

I straight up told him I have no time at all to train them on how to build and do the safety inspections correctly, not to mention the fact that I will still have to personally inspect every single one they put together anyway, so if they want to give me help I’ll take it but they’re on trash duty. Remove all the packaging, put the bike next to my work area, toss the trash. I will build. If there’s extra time at the end I will be happy to instruct everyone in the store how it’s done. Or even put me on the schedule for next week to do it.

Dude got pissy and wanted me to train people first, so I just called the district manager while he was talking and had him tell the guy to do what I said because I’m here at corporates request and if I don’t get the bikes finished in time then “it will look bad on your store’s next visit if the bikes are still boxed up”

In the end I got all of them done with about 3 hours to spare, so I spent the rest of the time teaching a couple people how to do it.

jaybone ,

Holy shit. In an 8 hour day that’s like 20 bikes an hour. So that’s a bike every three minutes. How is that even possible?

Transporter_Room_3 ,
@Transporter_Room_3@startrek.website avatar

Lol I wish it was just an 8 hour day.

More like 12-14 hours, and with the experience I had I was able to build most in about 6-7 minutes.

There’s downsides to speed building like that, because whoever has to inspect it when it gets sold has to spend a lot longer fixing minor problems.

If I were building at my own store, each bike took about 20 minutes because I made sure everything was as close to “ready to ride” as possible.

Nowadays I bulk build for many companies. They don’t give a shit about quality but I spent years making sure my bikes were perfect, so I still like to make them good to ride out the door.

my quickest bike was one particularly well put together model. 3 minutes per bike and it was good enough that I’d ride one without tools to the nearest store a few miles away.

kibiz0r ,

but it comes at the cost of short term agility

Often long-term agility, as well.

Big teams are faster on straightaways. Small teams go through the corners better. Upgrading from a go-kart to a dragster may just send your project 200mph into a wall. Sometimes a go-kart is really what you need.

SeeJayEmm ,
@SeeJayEmm@lemmy.procrastinati.org avatar

I just wanted to say I loved your analogy.

TheKracken ,

Some go karts have 2 seats and that’s ok.

Ephera ,

Currently in a project, where for strategic and unrelated reasons, we ended up with 4 new juniors and had to hand off one senior. In a team that consisted of merely 3 people before.

So, it’s just me and another guy having to constantly juggle these juniors to push them back into the right direction and review whatever code they ended up with.
It’s so frustrating, because while I’ll gladly pass on my knowledge, the project has basically ground to a halt.

There’s so many tasks me and the other senior would like to just quickly tackle. Which should just take a few days, no big deal. Oh no, I rarely get a day’s worth of work done in two weeks. The rest is just looking after the juniors, who cannot tackle many of the actual crucial tasks.

And it’s not even like the juniors are doing a bad job. Frankly, they’re doing amazingly for how little support we can give them. But that doesn’t stop the project from falling apart.

darkpanda ,

“What one programmer can do in one month, two programmers can do in two months.”

the_post_of_tom_joad , in Hey, I'm new to GitHub!

This whole thread makes me feel so much better about my struggles with github as a non-developer. I thought it was just me being an idiot

Potatos_are_not_friends ,

If it helps, even devs have problems following the install instructions.

It could be for a lot of reasons. Usually it’s because it’s open source and we can’t test it for every possible configuration. Or we are just trying to code, not deal with the dozen other setups.

Me in particular, all my application projects don’t include node versions, and assume Linux. Even I forget that sometimes if I’m loading a old project and suddenly it doesn’t build, and I have to futz around for an hour eupdating packages.

corsicanguppy ,

my application projects don’t include node versions

Well, that’s just a better security stance against supply-chain attack right there.

iorale ,

deleted_by_author

  • Loading...
  • dgriffith ,

    Seems to be a rare thing,

    Didn’t you know? All the cool kids these days skip documentation and just hang out on discord, where you can get a laggy response to your query about build dependencies in 2-3 business days.

    Celofyz ,

    Reminds me how many years ago I was complaining that people would go ask questions on irc instead of reading docs or posting on a forum so it could be indexed. Looks like nothing changed

    Gumbyyy ,

    I try to write documentation/instructions for dummies, because often, I’m the dummy when I have to dig back into the code again after not touching or thinking about it in months or years.

    emergencybird ,

    If it makes you feel even better, I’m a software engineer and I had lots of trouble learning to use GitHub and git, it’s embarrassing to admit it but I’m super glad I learned!

    zarkanian ,
    @zarkanian@sh.itjust.works avatar

    Git isn’t properly taught. I’ve studied programming both in college and in a boot camp, and both times they rushed right over git, showing only the bare essentials. This left me unprepared for the real world. I didn’t know how to do basic stuff like exclude files or even undo changes.

    It’s so complex, they really should have a separate class for it.

    madcaesar ,

    Do you have a proper good tutorial to recommend?

    zarkanian ,
    @zarkanian@sh.itjust.works avatar

    I like the git katas which go along with Johan Abildskov’s book Practical Git. I recommend the book, but you don’t need it in order to do the katas.

    lethargic_lemming ,

    I am a full-time software developer and everytime I need to merge or rebase, I Google the commands… just in case

    madcaesar ,

    I hate git and all it’s unintuitive commands.

    GBU_28 ,

    Just pull!

    antonim ,

    Same. I learned about the ‘releases’ section only recently thanks to some kind Lemmy user (kinder than some I’ve seen on Lemmy and reddit discussing this same image, some people are openly supporting gatekeeping of software).

    rikudou , in Returns a sorted list in O(1) time

    While this doesn’t work all the time, when it does, it’s really fast. Similar to the isPrime function, it’s correct most of the time and is much faster than alternative implementations:

    
    <span style="color:#323232;">function isPrime(number) {
    </span><span style="color:#323232;">    return false;
    </span><span style="color:#323232;">}
    </span>
    
    itslilith ,
    @itslilith@lemmy.blahaj.zone avatar

    asymptotically this is 100% correct!

    mumblerfish ,

    What would be the accuracy on something like a 64bit unsigned integer?

    itslilith ,
    @itslilith@lemmy.blahaj.zone avatar
    dgriffith , (edited )

    What your code can do is run this first and if it returns false then do a quick double check using a traditional isPrime function. Really speeds things up!

    rikudou ,

    I mean, it has a 99.999%+ success rate on a large enough sample and I can live with that.

    dgriffith ,

    Nah, you’ve always got to check the corner cases. It’s a variation on Murphy’s Law - you don’t encounter corner cases when you’re developing a program but corner cases are 99 percent of an everyday user’s interaction.

    docAvid ,

    Good idea, but it would be much faster if you do the double-check on true instead.

    xmunk ,

    This is a power(ful) idea.

    Are my stats/programmers in the house?

    fibojoly ,

    Better. Return true if the number is in a stored list of known primes, otherwise return false right away. But then, start a separate thread with an actual verification algorithm. When the verification is done, if it was actually a prime number, you just crash the program with a WasActuallyPrime exception.

    Asudox ,

    50/50 chance of being right in O(1) time

    rikudou ,

    It’s right much more often than just 50/50.

    andnekon ,

    50/50 would be for isOdd with the same implementation

    Lmaydev ,

    Primes are not that common especially as numbers get bigger.

    It’ll be right the vast majority of times.

    affiliate , in They Need To Stop Doing This

    what if we made a new type of blockchain? one that was powered by generative AI and the metaverse? oh! and could we make it so that it Empowers Business Solutions?

    sneaky_b45tard ,

    Thanks, i had a stroke while reading that

    npz ,

    This can certainly be done as long as we stick to the five core values - take ownership, take the leap, act with integrity, put the customer first, and dare to innovate.

    Kichae ,

    This whole comment chain is making me feel sad. And angry. And sangry.

    CeeBee ,

    Only if we have 3 red lines, 2 blue lines, and one transparent line. And have all of them perpendicular to each other.

    affiliate ,

    that’s some nice 6-dimensional thinking! very well suited to the new blockchain project

    yogsototh ,
    @yogsototh@programming.dev avatar

    Can a line be a cat? I love kittens.

    CeeBee ,

    Can the cat be drawn in red?

    phoenixz ,

    Shut up shut up shut up!

    Please don’t give people stupid ideas

    chiliedogg ,

    What we need is a paradigm shift in how we empower synergy between product lines through utilization of emerging technologies and strategic acquisitions to improve our KPIs across the platform.

    nintendiator ,

    Your anus is moving but I don’t get a thing of what you speak.

    phoenixz ,

    Ever heard of justified homicide? :)

    glad_cat , in data secured
    • Me: Ctrl+S, please save this file
    • Windows: Do you want to save it on SharepointOnedriveCloudthing?
    • Me: Put it in the local Downloads folder FFS
    • Windows: OMG it’s too hard!
    thepianistfroggollum ,

    LPT: get a debloater to remove One Drive and other MS bullshit.

    LinkOpensChest_wav ,
    @LinkOpensChest_wav@lemmy.one avatar

    BC Uninstaller my beloved

    Vishram1123 ,

    LPT: Use Linux

    thepianistfroggollum ,

    Right, because running one script is way more of a hassle than running Linux.

    ImpossibleRubiksCube ,

    Point here. Running one script is much easier, and more agreeable to company machines, than installing another OS.

    That said, I must quote my hero. “Stop being a little bitch. Use Linux.”

    Okalaydokalay ,

    Use F12 instead. Brings up the classic Save As and doesn’t (currently) default to OneDrive.

    glad_cat ,

    You save my life, thanks!

    Subverb ,

    Nice tip, thanks.

    WhiskyTangoFoxtrot ,

    It’s amazing the hoops people will jump through to deal with Windows’ bullshit but the moment Linux presents the slightest obstacle they write it off as “too hard to use.”

    Redkey ,

    I kind of agree with you but there’s also the issue that when you have a problem with Windows, there are 30 people to tell you, “Here are the hoops, and here’s how to jump through them,” while on Linux there are often only 3-5 people, all telling you, “LOL wipe and replace your whole OS with the distro that I use because I don’t have that specific problem.”

    Tranus ,

    I think it’s the other way around. I often find only one source (if any) for configuring windows, and it’s some registry edit that hasn’t worked for years. On linux, there will be a dozen people providing multiple ways of getting it done, most of which work.

    thepianistfroggollum ,

    Or is some Microsoft community post where the “experts” just copied and pasted the steps from the top Google result.

    clearleaf ,

    I wonder if any of those people know what ‘sfc /scannow’ is even supposed to do.

    thepianistfroggollum ,

    You say that like switching to Linux doesn’t require jumping through a bunch of hoops.

    I run both, and Windows is by far the most user friendly (ignoring Apple since they easily win the UI/UX competition). I didn’t have to spend hours getting my gpu to work with Windows or to install on a RAID configuration.

    Linux is great if you want to control your system, but most people don’t want to fuck with it.

    walkercricket ,

    I didn’t have to spend hours getting my GPU to work on Linux… What were you using exactly, as a distro and as a GPU? Not that I try to invalidate your experience, but afaik, if you have a AMD or Intel GPU, it should work out of the box and if you have an Nvidia GPU, any user friendly Linux distro that is optionally made for gaming have drivers preinstalled and can easily be updated through a GUI or a two words command so that you can directly play as soon as you installed the distro.

    ImpossibleRubiksCube ,

    Windows: …

    What?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines