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.

redcalcium , in Good luck web devs

Not on wayland, right? Time to pester wayland devs to add this important missing features!

nickwitha_k ,

Probably would fall into scope of a compositer in Wayland, rather than the protocol. I suspect it originated with old CRT displays. Sometimes they can appear scan diagonally.

Even without that usecase, I think it’s great to have around in order to support novel displays and display-like devices.

Plibbert , in Good luck web devs
lurch ,

They put touchscreens on doorstops now? /s

xmunk ,

Java truly runs on everything.

NoisyFlake ,

Unleash the power of the pyramid!

1984 , in Happy New Year Coders.
@1984@lemmy.today avatar

At least we know how to make fun of ourselves.

Can’t get dates, but we have humor. :)

MonkderZweite , (edited ) in Happy New Year Coders.

Happy new year fixing family’s setup!

slazer2au , in Happy New Year Coders.

Surely a regular day should have a rubber ducky.

CannotSleep420 , in Happy New Year Coders.

Literally me fr fr

onlinepersona ,

Very french french of you

CC BY-NC-SA 4.0

hakunawazo , in Happy New Year Coders.

Carnival is the “hacker” from mainstream news.

LetterboxPancake , in Happy New Year Coders.

I spent the last day refactoring code for a (private) project. But I drank coffee. This isn’t accurate at all!

xoggy , in This is what being a Redditor does to your life
@xoggy@programming.dev avatar

When you go to merge master into your feature branch but accidentally squash master in.

backhdlp , in This is what being a Redditor does to your life
@backhdlp@lemmy.blahaj.zone avatar

Me when I don’t know at how many changes I should commit (the previous commit changed 2 characters):

QuazarOmega ,

For real, or when you should make the first and second commit.
Or worse, when you’re too focused and start making a ton of changes, then you realize you haven’t committed anything. Discovering I can stage ranges has made me fall for this way too many times, because I think I’ll easily just go back and extract one atomic change at a time later (spoiler: it won’t be easy ( ; ´ Д `))

pkill ,

as soon as you realize you can’t easily contain your commit message within a 50-character conventional message (or slightly more if you wand to be more specific about the scope)

DarkGamer , in 4 billion if statements
@DarkGamer@kbin.social avatar

This is why every programmer needs to understand the modulo operator.

MxM111 ,

I would divide by two (floating point) and check the fractional part.

sus ,

turns out that 2^53 + 1 is an even number

iknowitwheniseeit ,

The article only covers unsigned 32-bit numbers, so floating point division would be fine.

merc , in 4 billion if statements

I like this bit at the end:

As a side note, the program is amazingly performant. For small numbers the results are instantaneous and for the large number close to the 2^32 limit the result is still returned in around 10 seconds.

caellian ,

Really makes you question your sanity when optimizing jumps in code without benchmarks.

merc ,

For a long time I’ve been of the opinion that you should only ever optimize for the next sucker colleague who might need to read and edit your code. If you ever optimize for speed, it needs to be done with massive benchmarking / profiling support to ensure that the changes you make are worth it. This is especially true with modern compilers / interpreters that try to use clever techniques to optimize your code either on the fly, or before making the executable.

Klear ,

The first rule of optimization: Don’t do it
The second rule of optimization: Don’t do it yet (experts only)

Ephera ,

I’m absolutely on-board …in application code.

I do feel like it’s good, though, when libraries optimize. Ideally, they don’t have much else to do than one thing really well anyways.

And with how many libraries modern applications pull in, you do eventually notice whether you’re in the Python ecosystem, where most libraries don’t care, or in the Rust ecosystem, where many libraries definitely overdo it. Because well, they also kind of don’t overdo it, since as a user of the library, you don’t see any of it, except the culmulative performance benefits.

merc ,

Libraries are also written and maintained by humans.

It’s fine to optimize if you can truly justify it, but that’s going to be even harder in libraries that are going to be used on multiple different architectures, etc.

blusterydayve26 ,

I’m still mad he didn’t use the size of the number to tell the system which block to read first. I feel like that would be a great use for division or maybe modulus?

merc ,

I just like how he used “% 2” in the Python code he used to generate the C++ code.

mexicancartel , in 4 billion if statements

Well i hate this:

PS > .\program.exe 0

THIS:

.\

Hotzilla , in 4 billion if statements

Could be easily made 50% space saving by only iffin all odds and return even on else. Maybe one if before to handle overflow to avoid wrong even if over the last if.

Deebster ,
@Deebster@programming.dev avatar

Well yeah, if you allow cheating!

bjorney ,

Yeah but then ALL even numbers would be slow to compute because you would have to chain through every odd before you know that 2 is even.

Depends on the expected distribution of input values

coloredgrayscale ,

Heuristic: keep it until 512, afterwards powers of 2, and numbers like 1000, 2000,…, 10000, 20000,… (regex: [0-9]000+)

dukk , in Good luck web devs

Original Article

Basically, it’s just some cool X11 magic that uses a matrix transformation to rotate the screen.

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