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.

Drama_durch_Lama , in TypeScript is Quantum Ready

That gave me an idea: A variable that is only defined when observed by a debugger, otherwise it’s null.

Flipper ,

How about an instruction that jumps only when a debugger is attached? Cause that exists.

huaris , in The classic font size exploit

These services empower you to quickly recognize fonts you might want to license or download for free. Once identified, you can visit font platforms like font script to acquire the fonts.

magnus , in Guthib

What, no websocket-based realtime statistics for number of total, daily and hourly mistypings?

kromem , in The Perfect Solution

Inefficient solution.

You should simplify it to just ask the model if the last bit of the binary representation of the integer is a 1 or a 0.

Natanael ,

They don’t process inputs as binary (they use clusters of symbols, i.e. letter groups) so that’s not guaranteed to work

kromem ,

r/woosh

Natanael ,

I did realize that too was a joke, still wanted to point that out

kromem ,

Well, in the sake of pointing things out, GPT-4 can actually correctly answer the prompt, because it arrives at it in the opposite direction. It can tell the integer is even or odd and knows that even or odd integers in binary end in 0 or 1 respectively.

AeonFelis ,

You can ask it if the last digit is odd or even, then.

abbadon420 , in Guthib

I also like the sl command for linux: github.com/mtoyoda/sl

https://raw.githubusercontent.com/mtoyoda/sl/master/demo.gif

The animation takes ages and you can’t cancel it XD

docAvid ,

And it has a whole set of options based on common ls options. Classic and brilliant.

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

IIRC the train travels at a constant speed so you can make it faster by resizing your terminal so it’s narrower. Thus the train has a shorter distance to travel and the animation length is reduced.

abbadon420 ,

TIL

user224 ,
@user224@lemmy.sdf.org avatar

echo ‘while true; do sl; done’ >> ~/.bashrc

Kerb ,
@Kerb@discuss.tchncs.de avatar

the best part is the version with the flags -al

Aatube ,
@Aatube@kbin.social avatar

you mean -Flacked

Kerb ,
@Kerb@discuss.tchncs.de avatar

you can actuall stop it by pressing ctrl-z and running bg

joyjoy ,

The average bash user doesn’t know how to do that.

Aatube ,
@Aatube@kbin.social avatar

I'm sure there's an asciicast of this beautiful steamroll somewhere...

otter , in Guthib

::: spoiler spoiler, try the link first The giant text makes it even better ::::

doctorcrimson , in The Perfect Solution

“Is this number even?”

“yes of no”

“Invalid Response, please answer with yes of no”

“yes of no”

"Invalid Response,…

MrOxiMoron ,

Dutch programmer, ‘of’ is dutch for ‘or’.

I wonder if OpenAI is smart enough for that

olutukko ,

I would imagine it is. I have tried all sort of typos and it has never misunderstiood me because of that

pressanykeynow ,

I dunno, I once combined two languages in the context and it started to give me a bunch of python code. Was scary.

xx3rawr ,

“Is this number even?”

“ja”

snrkl , in Every goddamn time

FWIW, Little known fact: Matrix 2 used real vuln (SSH CRC32) for trinity power grid hacking scene.

Even better to know: the scene was completed before the CRC32 vuln was public. So the scene used real 0day vuln…

moonpiedumplings ,

Even better to know: the scene was completed before the CRC32 vuln was public. So the scene used real 0day vuln…

Source? After some googling, I can only find that this is a 0day in the matrix universe, but not in the real world at the time the scene was made (matrix reloaded is a 2003 movie, vuln was discovered and patched around 2001.)

reddit.com/…/actual_crc32_exploit_used_in_matrix_…

insecure.org/stf/neiljk.html

www.exploit-db.com/exploits/20617

cupcakezealot , in Every goddamn time
@cupcakezealot@lemmy.blahaj.zone avatar

except lex. she took forever to get in and reactivate the door locks.

peopleproblems , 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.

niktemadur , in Every goddamn time

What about DJ Qualls in “The Core”?

While being interrogated in his introduction sequence, he casually folds an aluminum chewing gum wrapper, puts it to his lips and kinda whistles with it for a second, while holding a cell phone in front of his mouth. After this little public display of phreaking, he hands the cell phone over to the hero and says “Here… now you can call anywhere free for life with it”.

FlyingSquid , in Every goddamn time
@FlyingSquid@lemmy.world avatar
Classy ,

For how much fun NCIS was to watch it also was such a groan whenever the “code” sequences came up

Mongostein ,

Need to look busy at work? Ping -i.2 <your IP address> will repeatedly ping your own router. Tell your boss it’s running a diagnostic or something.

captain_aggravated ,
@captain_aggravated@sh.itjust.works avatar

One man’s Linux is another man’s OS/2!

Speiser0 , in The Perfect Solution

Processors might no longer get twice as fast every few years, but now we can use the power of servers to write software that runs even slower.

coloredgrayscale ,

We can add caching so numbers that have been checked once can be quickly looked up from an inMemory database.

Rosco , in The Perfect Solution

Probably not a good idea to show your API key to everyone…

worldsayshi ,

Yeah encrypt it or at least put on a nsfw tag or something. Gosh. People flaunt their privates like it’s Onlyfans.

Rosco ,

Or at least use an environment variable, it’s not a good practice to have it written in plaintext in your code.

voracitude ,

What do you mean? I just see asterisks.

assembly ,

Same here. I’m pasting my password here and it will encrypt it so no one can see it other than me: *******

MacNCheezus ,
@MacNCheezus@lemmy.today avatar

hunter2

jjjalljs ,

I understood that reference

thanks_shakey_snake ,

Oh cool it works for my password, too.

mrsgreenpotato ,

How do you know it’s your password if all you see is astrisks?

pressanykeynow ,

Your password is seven asterisks, right?

Mastershelf , in The Perfect Solution

TIL Python dictionaries allow trailing commas.

GBU_28 ,

List

dalegribble ,

While there are not actually any trailing commas in the dictionaries present and you are correct to say the ones present are part of a list, you can also have trailing commas in Python dictionaries. OP might have researched “Python trailing commas” and learned that part.

Trailing commas are fantastic to reduce changed lines in git diffs. Makes life much better. Same thing with leading commas in SQL queries.

GBU_28 ,

Yeh

Ephera ,

Yeah, I think, that’s only really JSON which is so pedantic about it…

owenfromcanada ,
@owenfromcanada@lemmy.world avatar

Yeah…

sweats nervously in C

renzev ,

Python is so great (half-sarcasm) that a trailing comma on its own constitutes a tuple (immutable list):


<span style="color:#323232;">mytuple </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">4</span><span style="color:#323232;">,
</span><span style="font-weight:bold;color:#a71d5d;">assert </span><span style="color:#62a35c;">len</span><span style="color:#323232;">(mytuple) </span><span style="font-weight:bold;color:#a71d5d;">== </span><span style="color:#0086b3;">1
</span><span style="font-weight:bold;color:#a71d5d;">assert </span><span style="color:#323232;">mytuple[</span><span style="color:#0086b3;">0</span><span style="color:#323232;">] </span><span style="font-weight:bold;color:#a71d5d;">== </span><span style="color:#0086b3;">4
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines