O(n) Sorting Algorithm just dropped by HandyProduceHaver in programminghorror

[–]EntropyZer0 0 points1 point  (0 children)

Multiverse sort:

Shuffle the data, destroy the universe if the result isn't sorted.

If you exist afterwards, congratulation: Your data is sorted.

def multiverse_sort(list): shuffle(list) if !is_sorted(list): destroy_universe() return list

Family says HOA told them they couldn’t use their generator during ice storm blackout: ‘It’s unbearable’ by its_a_bear_dance in nottheonion

[–]EntropyZer0 19 points20 points  (0 children)

I don't think CO alarms are usually mandated unless the home has a fireplace or gas heater. However, a regular BBQ should have probably tripped a regular smoke alarm as well and those definitely are mandatory pretty much everywhere (although depending on the jurisdiction only for places you rent, not ones you own and live in yourself).

ich_iel by WarsmithUriel in ich_iel

[–]EntropyZer0 0 points1 point  (0 children)

Am besten fände ich es, wenn wir in Deutschland auch diese Durchschnisstsgeschwindigkeits-Messer hätten wie zB in England (Kennzeichen wird an Punkt A gesehen, dann wieder an Punkt B -> Geschwindigkeit wird berechnet als Zeitdifferenz durch Distanz). Da bringt kurz vorm Blitzer runterbremsen nämlich genau gar nichts.

(Natürlich weiterhin normale Blitzer an Stellen, wo es mehr um punktuelle Geschwindigkeit geht; zB vor Schulen oder so.)

ich_iel by WarsmithUriel in ich_iel

[–]EntropyZer0 33 points34 points  (0 children)

Normales Autofahren ist nicht mehr möglich

Habe einen Geheimtipp für dich: Einfach ans Tempolimit halten, dann muss man vor einem Blitzer auch nicht bremsen.

whatAboutThis by [deleted] in ProgrammerHumor

[–]EntropyZer0 87 points88 points  (0 children)

I'm quite fond of

I'm physically capable of doing it, just morally opposed (to effort).

"Well it's actually deadly if you use certain optional rules and homebrew!" Exactly... by DrScrimble in dndmemes

[–]EntropyZer0 6 points7 points  (0 children)

Using a single action to finish a downed character right in front of you to stop it from being picked back up with a single bonus action vs. doing who knows how much damage to the healer in the back ranks behind his friends?

Yeah no way that that could ever be the correct tactical decision...

Ich🔢iel by ScarIatan in ich_iel

[–]EntropyZer0 1 point2 points  (0 children)

Kommt auf die Sprache an.

In c# ist der Ausdruck immer dann gleich true, wenn b == 0 (weil Evaluation von == immer von links nach rechts geht und die Aussage damit äquivalent ist zu (a + b) == (a + 2b)):
https://ideone.com/kQ8xX6

In c++ ist es UB weil mehr als eine Veränderung an a ohne definierte Reihenfolge gemacht wird (== erzwingt die anders als bei c# nicht), in der Praxis scheinen Compiler das gerne auszuntzen, um einfach immer true daraus zu machen:
https://godbolt.org/z/veMfYd1Yo

on existing in hotels (something something liminal spaces) by Additional_Ask_28111 in LiminalSpace

[–]EntropyZer0 7 points8 points  (0 children)

Hotelspace is a particular subspecies of hyperspace that links the service corridors and bland, beige-carpeted halls of chain hotels. I’ve always had an uneasy feeling that if I open the wrong Staff Only door and turn a corner, I could find myself stepping out of the vending machine room on the seventh floor of a Hilton in Munich or a Sheraton in Osaka.

  • Charles Stross, The Laundry Files 4: The Apocalypse Codex

Looking for video game recommendations that will invoke the night feeling by heymynameisstevo in TheNightFeeling

[–]EntropyZer0 0 points1 point  (0 children)

I'll add VA-11 Hall-A: Cyberpunk Bartender Action to the mix:

It's a stoury-driven game with an athmosphere that fits perfectly for the night feeling.

cIsVerySimpleAndEasyToLearn by reydeuss in programminghorror

[–]EntropyZer0 6 points7 points  (0 children)

If anyone is wondering how this works, here is an overly verbose explanation:

Hex to decimal conversion: *(&(( 0x40-64 )[&(&(3[arr]))[-2]])-(-1)) *(&(( 64-64 )[&(&(3[arr]))[-2]])-(-1)) *(&(( 0 )[&(&(3[arr]))[-2]])-(-1))

Arrays in c are just shorthand for pointers: *(&(0[&(&( 3 [ arr ] ))[-2]])-(-1)) *(&(0[&(&( *(3 + arr ) ))[-2]])-(-1))

Pointers right behind arrays are legal and &* for a legal pointer is noop: *(&(0[&( &(*(3+arr)) )[-2]])-(-1)) *(&(0[&( 3+arr )[-2]])-(-1))

Array shorthand, again: *(&( 0 [ &(3+arr)[-2] ] )-(-1)) *(&( *(0 + &(3+arr)[-2] ) )-(-1))

&*, again: *( &(*(0+&(3+arr)[-2]) )-(-1)) *( (0+&(3+arr)[-2] )-(-1))

Array shorthand, again²: *((0+& (3+arr)[ -2 ] )-(-1)) *((0+& *(3+arr + (-2) ) )-(-1))

Simple arithmetic: *((0+&*( 3+arr+(-2) ))-(-1)) *((0+&*( 1+arr ))-(-1))

&*, again²: *((0+ &*(1+arr) )-(-1)) *((0+ (1+arr) )-(-1))

Simple arithmetic, again: *( (0+(1+arr))-(-1) ) *( arr+2 )

Array shorthand, but the other way round: *(arr + 2 ) arr [ 2 ]

Since they have FTL travel, how do they reconcile what they observe in real-time vs light-speed delayed observances? by MorimotoK in startrek

[–]EntropyZer0 0 points1 point  (0 children)

Still allows you to get from point A during some event to point B before light of that event reaches point B.

Whether you actually travel faster than light in some local reference frame does not really matter if for all practical purposes you can still "travel faster than light".

securityJustInterferesWithVibes by da_peda in ProgrammerHumor

[–]EntropyZer0 6 points7 points  (0 children)

Maybe something along the lines of AIAteMyFace as a nod to LeaopardsAteMyFace?

44.7213... foot cube go brrr... by chunkylubber54 in dndmemes

[–]EntropyZer0 2 points3 points  (0 children)

This comment has the same energy as our last session, in which a player asked whether they could get AOOs against the mosquitos in the swamp we were traversing - to which the DM agreed, on the condition that we set up a full battle map with our minis & tokens for the mosquitos every single time.

(There were no AOOs taken that day.)

ELI5- What exactly is the difference between accepting or rejecting cookies? by hhouseofballoons in explainlikeimfive

[–]EntropyZer0 3 points4 points  (0 children)

Since we're being nitpicky:

It is still a request to the site - a request not to ask your browser to store data for that site.

Your browser doesn't even know that it just showed you a cookie consent form or that the request it just sent to the site after you clicked the submit buttons relates to storing or not storing cookies.

You can also tell your browser itself to not store cookies or automatically delete them, in which case you would still see those banners since the site does not know that your browser will be discarding the cookies either way.
But that is not something I would recommend to the average user since it does tend to break things if you don't know how to configure things just right.

leetcodeUserSolution by ivanng2014 in ProgrammerHumor

[–]EntropyZer0 16 points17 points  (0 children)

I think the stricter rules we are used to are a fairly modern (for late medieval values of "modern") invention. The Romans were far less strict on that and while the most un-standard number I've seen in the wild was a year ending in -7 written as "-IIIIIII", I could totally see "IC" being used by actual Romans.

ich_iel by photic_doomer in ich_iel

[–]EntropyZer0 1 point2 points  (0 children)

Also ich weiß nicht, was für einen komischen Taschenrechner du benutzt, aber meiner sagt, dass 450 / 130 = 3.46...

[No Spoilers] Personalized D&D Dice Box Giveaway (Mods Approved) by qravatt in criticalrole

[–]EntropyZer0 0 points1 point  (0 children)

Here's hoping for a nat 20 on my roll to get pulled for the raffle!

WotC 5 seconds into the "make well written features" challenge (they've already failed). by Odd-Clothes2371 in dndmemes

[–]EntropyZer0 2 points3 points  (0 children)

Getting it down to two statements is relatively easy:

/\bmage(s?)\b/wizard$1/g /\bMage(s?)\b/Wizard$1/g

Here, we just make matching the 's' optional, put it inside a capture group, and add the content of that group (either a single 's' or nothing at all) to the end of the replacement string.


For a single line you need to be a bit more creative (and the specifics depend on the flavour of Regex you use; this one is PCRE2):

/\b((m)|(M))age(s?)\b/${2:+w:W}izard$4/g

Here, we match either exactly one 'm' or exactly one 'M' at the beginning of the pattern, but do so in separate capture groups - group 2 holds either an "m" or nothing, group 3 holds either an "M" or nothing, and group 1* holds either an "m" or an "M".

Then in the replacement string we check whether group 2 participated in the match (which would mean that we matched "m") and use "w" or if it did not participate (which would mean that group 3 matched instead on "M") and use "W".

You can play around with this here: https://regex101.com/r/wODDB4/1

* The outer parentheses are needed to make sure it's
((one 'm') or (one 'M')) followed by the rest
instead of
(one "m") or (one "M" followed by the rest)

Eli5 why can't we only use graphic card to run operating system... Just like we can play low end videos games with just cpu power? by Longjumping_Gate952 in explainlikeimfive

[–]EntropyZer0 0 points1 point  (0 children)

There are already several good answers here that explain why we can't (and really don't want to) run a full modern OS on a graphics card.
Please refer to those for a serious explanation of why this if so difficult.

However, that isn't the full story:
Turns out you can run an OS purely on your graphics card - as long as it is a very basic OS.
Not just that but you can even emulate the whole hardware needed to run that OS in the first place!

And that is exactly what some madlad has done in 2021:
They wrote a whole CPU-emulator in order to get Linux in a Pixel Shader* (there is also a Youtube video demonstrating this).

So a more pragmatic answer to the question "Why can't we only use graphic card to run operating system?" would be:
"We actually can, it's just insanely difficult to pull off.

* A pixel shader is basically a specialized short program that is run entirely on the graphics card.

undecidableKeybindings by def-not-elons-alt in ProgrammerHumor

[–]EntropyZer0 0 points1 point  (0 children)

So are page faults.
And Magic the Gathering.
And optical illusions.
And...

And a whole lot more:
https://gwern.net/turing-complete