programming.dev

jadelord, to piracy in aaron swartz day

He was from the future. Look, he’s reading from a book made of flexible glowing paper and not flat tablets like we primitive people do.

purplemonkeymad, to programmer_humor in git commit -m "hotfix"

I’m sure that commit will be fixed in sort order and not remain that way until it becomes a “we don’t know why, but just do this bit.”

hakunawazo, (edited )

Just comment out the window until it is fixed. Either way it isn’t dangerous as long as you surround it with try/catch.
But I don’t know exactly about that catch part if something happens a few miles above.

visnudeva, to asklemmy in Do actors all need to agree to casually smoke for some roles?
@visnudeva@lemmy.ml avatar

I have a question of the same kind, how do they do when they clearly sniff coke ? What kind of white powder isn’t harmful to the nose is used in cinema ?

merfolk,
@merfolk@lemmy.world avatar

I believe they use inositol powder.

fearout,
@fearout@kbin.social avatar

As far as I know, it’s usually crushed vitamin B. Shouldn’t feel like much unless you do dozens of takes.

At least that’s what they used in Mr. Robot.

visnudeva,
@visnudeva@lemmy.ml avatar

Thank you for your answers !

olafurp, to programmer_humor in ifn't

I’d take a not or “if not” operator tbh.

Appoxo,
@Appoxo@lemmy.dbzer0.com avatar

ifnt instead of ifn’t

Dasnap, (edited ) to programmer_humor in Guys! Should I accept the offer? 😂
@Dasnap@lemmy.world avatar

This reminds me of heart4heart levels in LittleBigPlanet.

prongs,

I miss that game. Not much tickles the same creativity and playfulness that I’ve tried since then. I used to spend hours in the level creator doing dumb stuff.

jaybone, to programmer_humor in Fitbit Clock Face

Clocky McClockface

Use datatypes

sbv, to programmer_humor in The Holy Trinity of JavaScript

Sorry, 0 == ‘t’? What?

jtk,
@jtk@lemmy.sdf.org avatar

Yeah, it’s true. I knew all the other ones, had to put that one in the dev tools console to believe it. I was just happy to know === continues to be sane in that comparison.

Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

that's not "t", it's "\t" which is just a tab. There's also "\n" for newline.

MinekPo1,
@MinekPo1@lemmygrad.ml avatar

yeah but why is a single character string containing a tab equal to zero ???

Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

That would be weird if a string containing a space wasn't equal to 0 " " == 0, but that's not the case in JS. If you think that "" and " " being equal to 0 is weird then I agree, but since they are, you should expect "t" and "n" to equal 0 too.

Ephera,

The == operator in JS will try to cast the things being compared and do all kinds of ‘smart’ assumptions about what equality means. This is why everyone uses === instead…

8bitguy,

Unless you enjoy inviting the chaos.

sbv,

It’s a slash-t in the comment. Maybe kbin has different rendering rules for comments?

https://sh.itjust.works/pictrs/image/7026f17a-f237-49d3-8d80-28632876acdb.png

Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

Oh, in that case I replied to @MinekPo1 with my answer to that. BTW can you see the slash in: t and "t".

sbv,
Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

My bad. I just edited it. "t" t It's displaying correctly on Lemmy.world. So it seems like another Kbin only issue.

Sonotsugipaa,
@Sonotsugipaa@lemmy.dbzer0.com avatar

It still makes no sense though

Limitless_screaming,
@Limitless_screaming@kbin.social avatar

If " " wasn't equal to 0, it wouldn't make sense, but since a string containing a space equals 0, you'd expect the same to apply to a string containing a tab or a newline. (or at least I'd expect that)

FaceDeer,
@FaceDeer@kbin.social avatar

I admit I have never dabbled in javascript, despite being a proficient programmer. I now dread to ask... would any string that contains only whitespace == 0? " \t\n \t " for example?

Limitless_screaming,
@Limitless_screaming@kbin.social avatar

Yes, it would. Just like a string of spaces " " == 0, but it isn't that bad; === is Javascript's version of == in other languages, and, thus, you should be using it if you don't want that wonkiness.

== is just for convenience, like when you want to make sure that the user didn't leave the form empty and the button shouldn't be greyed out, and other UI stuff. Without these kinds of features JS wouldn't be used in so many toolkits.

atx_aquarian,
@atx_aquarian@lemmy.world avatar

Ok, I always mistakenly assumed === was the identity operator in JS, too. TIL, thanks! As much as we like to poke fun at JS, every time I’m taught the rationale behind some aspect of it, I find it redeeming and even a little endearing.

bitcrafter,

The explanation given to you makes it sound like == was deliberately designed to be a more convenient version of ===, but what actually happened was that == used to be the only equality operator in JavaScript, which meant that if you didn’t want it’s auto-coercing behavior then you needed to go out of your way to add additional type checks yourself. Because this was obviously a tremendously inconvenient state of affairs, the === operator was introduced later so that you could test for equality without having to worry about JavaScript doing something clever underneath the hood that you weren’t expecting.

masterspace, (edited )

The explanation given to you makes it sound like == was deliberately designed to be a more convenient version of ===

I mean technically == was deliberately designed to be a more convenient version of other languages’ == operator… Just specifically more convenient for light UI stuff since that was all JavaScript was supposed to be used for at the time (or all they thought it would be used for).

But give programmers a way to write and execute a small script and someone will eventually use that to try and write an emulator that emulates the computer it’s running on, so the web evolved into more complicated applications, and then that convenience turned out to be wildly inconvenient, not to mention horribly unexpected for programmers coming from other languages, so then they added the triple equality to match other languages.

Blackmist,

You have to remember that the underlying principle of JavaScript seemed to be “never throw an error”, even if what it’s being told to do is weapons grade bollocks.

sheepishly, to programmer_humor in We're not the same! (period)
@sheepishly@kbin.social avatar

Jokes on you, the reason I don't open source my code is because I never finish writing it

dan,
@dan@upvote.au avatar

But that’s one of the benefits of open source. Post your code and find someone else to finish it :D

itsnotits,

Joke’s* on you

(Short for “The joke is on you”.)

sheepishly,
@sheepishly@kbin.social avatar

Jokes on you, my apostrophe key is broken

dantheclamman,
@dantheclamman@lemmy.world avatar

Commitmentphobe

jdaxe, to memes in 6÷2(1+2)

It’s hilarious seeing all the genius commenters who didn’t read the linked article and are repeating all the exact answers and arguments that the article rebuts :)

RickyRigatoni,
@RickyRigatoni@lemmy.ml avatar

I’m still not used to having combined image and text posts so I usually don’t notice the text portion if it isn’t a big ol’ wall and I hope I’m not the only one.

TheLastHero,

you are so sure that you are right and already “know it all”, why bother and even read this? There is no comment section to argue.

he made a mistake posting this to a comment section, now he must pay the price

wischi,

❤️ True, but I think one of the biggest problems is that it’s pretty long and because you can’t really sense how good/bad/convining the text is it’s always a gamble for everybody if it’s worth reading something for 30min just to find out that the content is garbage.

I hope I did a decent job in explaining the issue(s) but I’m definitely not mad if someone decides that they are not going to read the post and still comment about it.

Gradually_Adjusting, to memes in Shout-out-to-mods-posting
@Gradually_Adjusting@lemmy.world avatar

I’ll work on it

nissenice, to programmer_humor in :q! to quit the Force

False! A proper Vim user would never put their hand on the arrow keys.

hakunawazo, (edited )

Always on hjkl to move, and always ready to insert (i), append (a) or insert before (O) or after (o) line and fast escape with esc.
For search and rescue missions usually use the /.
They need a vim drill before combat.

peopleproblems, to programmer_humor in The Perfect Solution

oh Jesus

did this come full circle?

we used python to query chatgpt to decide if a number is even or odd and return true or false?

Ephera,

True or false or null.

Mathematicians didn’t know it yet, but numbers can now be even, odd or neither.

dan,
@dan@upvote.au avatar

True or false or null.

Ah, yes, a three-state boolean.

lars,
Natanael,

Non integers certainly aren’t even or odd, so yes?

Ephera,

Yeah, I’m chalking that up to Python’s untypedness. I was going to write “integers”, but technically that function takes a “num”, whatever that is.

For all we know, it could be a string, asking ChatGPT to hack the government. Is that even? Probably no. Or None. Or T-Rex. Without reading the entire function, we don’t know that it’s not returning T-Rex.

Thankfully, it doesn’t matter. Just stick the result into an if-else, then False and None will land you in the else-branch. And both True and our Truthiness-Rex will land you in the if-branch. Just as Guido intended.

…this rant brought to you by trauma.

testeronious, to memes in Appreciate all the content though
FlyingSquid, (edited )
@FlyingSquid@lemmy.world avatar

Sorry. I’m just trying to do something with my time until I go to the Mayo Clinic on the 15th. I can leave though. Some people here seem to want me to…

Edit: Or maybe not the 15th. They lost my appointment. Rescheduled for March 28th. Meanwhile, I’m looking elsewhere.

bunnykei,

Nah thanks for the content, and hope all goes well at the clinic! Keep posting if it helps you

FlyingSquid,
@FlyingSquid@lemmy.world avatar

It does help me. I won’t go into my sad life, but Lemmy makes it better. Thanks!

sweetmartabak,

Do what makes you happy, my dude/dudette. And good luck with the clinic visit!

FlyingSquid,
@FlyingSquid@lemmy.world avatar

Thanks!

testeronious,

thanks for contributing to lemmy, but if bettering your life means that you’ll post less, by all means do that :)

SuddenDownpour,

For whatever it’s worth, I like to see you posting.

FlyingSquid,
@FlyingSquid@lemmy.world avatar

Thanks!

rainerloeten,
@rainerloeten@lemmy.world avatar

Who does? And why? Lemmy needs content, why wouldn’t one appreciate your posts? ^^

FlyingSquid,
@FlyingSquid@lemmy.world avatar

You’d have to ask them. I’m definitely not universally loved or anything, but I’m grateful for the appreciation I get.

rainerloeten,
@rainerloeten@lemmy.world avatar

If you have no haters, you’re doing something wrong ;) (Ve)

FlyingSquid,
@FlyingSquid@lemmy.world avatar

Probably true!

daFRAKKINpope,

No one is universally loved. Everyone brave enough to put themselves out there will have people push back and talk trash. If doing what you do brings you some joy, do your best to ignore them and push on.

CertifiedBlackGuy,

Notice me senpai :'(

FlyingSquid,
@FlyingSquid@lemmy.world avatar

Beg pardon?

rosymind,

I’m actually worried about you, and your dry-heaving. Lemmy wouldn’t be the same without you so don’t die

FlyingSquid,
@FlyingSquid@lemmy.world avatar

I appreciate it, but I don’t think I’m dying quite yet. And it’s definitely not cancer or anything like that. Honestly, despite all that, I feel fine most of the time. Which is part of what makes it so weird.

rosymind,

Random question, but do hot showers help? I noticed a while back that you mentioned weed on some comment or other. I once lived with this family who had a woman in her late 50’s who was a chronic (and I mean CHRONIC) user. She was struggling with nausea that was only alieviated by hot showers (idk why she told me this we weren’t close). Turns out there’s a condition:

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

FlyingSquid,
@FlyingSquid@lemmy.world avatar

I’m afraid there’s nothing for them to help with. Hyperemesis is extremely unlikely. I don’t vomit, I dry heave. And usually only once a day, soon after I get up. And hyperemesis also involves nausea, which I don’t have.

rosymind,

Damn. Well, I hope it’s something as simple and easily fixed at least!

FlyingSquid,
@FlyingSquid@lemmy.world avatar

It’s not. I made a post about it in the health community if you’re curious, but I’ve bummed everyone out enough in this thread!

lemmy.world/post/10237266

aodhsishaj,

Your content is much appreciated. Fuck the haters.

FlyingSquid,
@FlyingSquid@lemmy.world avatar

Thanks!

JDubbleu,

From what I’ve seen one dude is salty and everyone else (including myself) is happy to have your contributions! I don’t necessarily agree with you on everything you post, but you’re respectful and actually back up what you say. I respect that a hell of a lot more than someone who I’m in complete agreement with, but plugs their ears at the first sign of pushback.

FlyingSquid,
@FlyingSquid@lemmy.world avatar

Thanks. I hate the Reddit squabbling. I wish people could disagree without insults and I won’t take part in it. I also think people should back up their claims. I don’t expect everyone to feel the same way I do, I just wish so many people didn’t.

corsicanguppy, to programmer_humor in Release notes of an open source app. Someone is pretty mad at Canonical for Snap

Having worked with Unix and Linux for 29 years, some of it deep in os security, I strongly believe

  • canonical is good at hiding the fact they’re evil as hell
  • snap is a bag o shite

Cheers to this guy.

AVincentInSpace,

Canonical wants to be Microsoft so bad

criticalimpact, (edited ) to programmer_humor in GitHub Desktop or Git CLI?

CLI
Though I will admit it took me a while to get there
git add -i is where the true magic begins

stepanzak,

TIL!

FiskFisk33,

git log --graph --oneline --all

hakunawazo,

Also part of the Cli magic is a pretty git log tree like that:
https://lemmy.world/pictrs/image/3302d15a-1370-4f02-bc0d-5ec00c0c20f6.png
stackoverflow.com/questions/1838873/…/34467298#34…

And a proper diff tool like vim:

git config --global diff.tool vimdiff git config --global difftool.prompt false

(Current diff could be closed with :qa. All diffs could be closed with :cq).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18878464 bytes) in /var/www/kbin/kbin/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php on line 171

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10502144 bytes) in /var/www/kbin/kbin/vendor/symfony/error-handler/Resources/views/logs.html.php on line 35