Live data from Hacker News

Null

popey.com

121–130 of 196 posts

Re: Null

#121
post #109

Reminds me of the first time my DnD group tried out roll20.net. The chat box allows players to type things like "/roll 1d6" or "/roll 2d12" to simulate rolling dice (in these cases 1 6-sided die and 2 12-sided dice). I quickly tried "/roll 1dNaN", crashed the chat, and we went back to physical dice for the rest of the session.

Also fun is `/roll 9999999999d2` which IIRC Roll20 blocks but many virtual tabletops just hang on.

Re: Null

#122
post #7

>While I’m not a QA or security professional, I have developed a knack for doing “stupid” things with software which causes it to malfunction. A person after my own heart. I've had many a dev go "why would you do that" In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

We have an excellent (and big) QA department, but 13 years ago when I started at this company we were only just beginning to hire dedicated testers. We had a mature product which was a communication handset and it worked well and was stable. Our software engineers had pressed every button they could think of in every menu and there weren't any problems.

Then we hired Kevin.

Kevin had the handset for 40 minutes before piping up "crashed it". The lead comes over to have the sequence explained to her, and says "huh, nice edge case". Half an hour later "crashed it again" (in a completely different way). Explains the sequence to the lead again. An hour later this happens again and he explains the sequence and she finally bursts out "Why would you even do that?! How did you think of pressing those buttons like that with that timing?!!".

Good testers just think differently than software engineers.

Re: Null

#123
post #28
post #7

>While I’m not a QA or security professional, I have developed a knack for doing “stupid” things with software which causes it to malfunction. A person after my own heart. I've had many a dev go "why would you do that" In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

Why do you require software to be more resilient than other things? If I pour water in the gastank of my car, it will also fail to drive. Or gas in the sprinkler tank. So the car should somehow prevent the enduser putting the wrong thing in the tank?

With physical things, if I do something stupid, I blame myself. With software, if it allows me to do something stupid, I blame the software. Unfortunately, the same mindset carries for clients, employers, and other various people using software who will report said stupidity to me, my client, or my employer.

Re: Null

#124
post #100
post #31

Earlier quoted context omitted.

I assume it's a joke to test if reality is a simulation or a dream.

When Elon Musk was talking about reality vs simulation, I couldn't help but think he's onto something If you were going to play a simulation game, you would not be a normal participant. You would not play a normal person, you would play the successful guy at the top launching spaceships and making money. So - the chances of Elon Musk being in a simulation are very high compared to normal people.

I would assume most simulations would be more academic/business related, like how we have tools that simulate a wind tunnel, rather than for entertainment purposes

Re: Null

#125

Earlier quoted context omitted.

And at least you get to strongly compare by adding an extra = (e.g., ===, !==). I just wish the extra character (i.e., the not-as-default versions) weakened instead, like a tilde. But yes, all strings are truthy. Except an empty string! And maybe some little-used nullish characters? Doubtful, but...

> But yes, all strings are truthy. Except an empty string! And maybe some little-used nullish characters? Doubtful, but... Or "0"

But not in PHP 8

Re: Null

#128

Earlier quoted context omitted.

Found some GitHub issues [1] with something similar: an enterprise firewall blocking a repo because it contained the string "arglebargleglopglyf" [2] in some tests. The text was flagged as malicious because of its presence in the repo github.com/wireghoul/htshells [3]. However, the whole point of the word in the htshells repo is that it's an invalid command that breaks Apache, so it could have been almost any random…

This one from link 3 caught my eye: "".__class__.__mro__[2].__subclasses__()[40]("/etc/passwd").read() Looks to be a Python 2 specific way of trying to read a file in a sneaky way. I say Python 2 specific because Python 3 strings only have 2 supertypes now, so __mro__[2] is out of range, but __mro__[1] is 'object', and I'm guessing they were going for a file like class, but right now object.__subclasses__()[40] point…

FWIW it’s looking for the `file` class which does not exist anymore an was a direct subclass of object: `open` now creates a TextIOWrapper>.

You can still reach TextIO though _IOBase, in python 3.9 it’s object’s 101st subclass, then 0, then 0.

In 3.8 it’s 99, 0, 0.

Re: Null

#129
post #100
post #31

Earlier quoted context omitted.

I assume it's a joke to test if reality is a simulation or a dream.

When Elon Musk was talking about reality vs simulation, I couldn't help but think he's onto something If you were going to play a simulation game, you would not be a normal participant. You would not play a normal person, you would play the successful guy at the top launching spaceships and making money. So - the chances of Elon Musk being in a simulation are very high compared to normal people.

The entities running the simulation knew you would think like that, which is why they put Elon Musk there so the simulated you thinks "nah, if I were simulated my life would be awesome".

Re: Null

#130

Earlier quoted context omitted.

You can do this with any language with a type system by wrapping reads with a 'Tainted' type. ie: fn safe_read(path: str) -> Tainted { Tainted(unsafe_read(path)) } And then you can apply functions to Tainted or whatever type that convert it into something structured / validated. So long as your functions only take in those validated types (ie: you do not write functions that take str) you can ensure that new reads wi…

You can do some actually useful stuff with a real type system, instead of replicating Perl's stupidity. For example, you can convert the input into a safe representation, suitable for the exact place you'll be using the string, instead of "validating" it.

Exactly. What you need is not a “tainted” type and assume everything that’s not it is safe. That’s not the case. Html-escaping a string does not make it safe for SQL or whatever.

What you need is a safe type for each use case, and ways to convert values to that (or mark them as that depending on your TS).

Post reply on HN