Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sellyme
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
18 ms
·
151.
▲
by
sellyme
5y ago
How often am I doing it? Not very. But when there's a WHERE foo IN(a,b,c,...) query that has an arbitrary list as input? Could be any number of parameters in there (although I think most SQL drivers start complaining in the early qua
152.
▲
by
sellyme
5y ago
I'm pretty sure that would qualify as the number being "made up". If anyone disagrees, I'm happy to sell my database of 100B valid phone numbers.
153.
▲
by
sellyme
5y ago
> isn't this passing an array into a parameterized query for that use case? Yes, I definitely should have been more specific there - what I'm referring to is passing it as one parameter, instead of potentially dozens or hundr
154.
▲
by
sellyme
5y ago
> If you're using PDO directly in 2021, you're absolutely doing it wrong. This is somewhat the point. If using the language's standard libraries is "absolutely doing it wrong", that's an indictment of the la
155.
▲
by
sellyme
5y ago
Yep. Fortunately a lot of the use cases of IN() are with controlled values - often IDs obtained from a previous query - so string concatenation is safe (and a lot less hassle than the alternatives). Un fortunately that gets people into t
156.
▲
by
sellyme
5y ago
PDO explicitly does not support the functionality being discussed [1]: > For example, you cannot bind multiple values to a single parameter in the IN() clause of an SQL statement. You're required to roll your own implementation, som
157.
▲
by
sellyme
5y ago
Not only is it the case that you can do that, it's the case that you should do that. Which leads to the question of why it's not in-built functionality. Making secure code harder to write than insecure code is a great way to e
158.
▲
by
sellyme
5y ago
> It's trivial to write your own function to use parameterized queries and add in all the type checking etc you need. It's only a few lines of code. It's fairly trivial to do this, but now you're potentially adding t
159.
▲
by
sellyme
5y ago
> This means there's nothing specific to PHP about this problem. I don't particularly care if languages that I am not using have the same problem. It's up to people who use those languages to make those criticisms. > Ma
160.
▲
by
sellyme
5y ago
> You can Google php parameterize query and get atleast 2 different methods of doing this There's no way of doing this with a single parameter. You need to parameterise every single individual item in the IN clause to do it that way
161.
▲
by
sellyme
5y ago
> The docs for how you were supposed to do SQL were just full of the antipattern of building queries by string formatting and concatenation This is still to this day the recommended way to construct a "WHERE foo IN (a,b,c,...)"
162.
▲
by
sellyme
5y ago
If the bin chickens learn how to do this as well, we're doomed.
163.
▲
by
sellyme
5y ago
Usually when I find someone posting something I believe is completely false online, I double-check my own belief with reputable sources to make sure I'm not mistaken or out of date. In the 80-90% of cases where I don't find a good
164.
▲
by
sellyme
5y ago
I don't see how you could believe this point, unless you think things like "There's no bad music, only bad musicians" as well. Perhaps an elucidating counterpoint is an algorithm written in such a manner that it is delib
165.
▲
by
sellyme
5y ago
>security of half the world Chrome OS has less than 2% market share.
166.
▲
by
sellyme
5y ago
> so that under any circumstances, the code reads the same as the author intended I write all my code in notepad.exe with the font Wingdings. I hope that if you ever read any of my code you'll respect my intent with how it's di
167.
▲
by
sellyme
5y ago
Yes. I have several hundred Steam games that have been removed from the store (dozens due to DMCAs), and the only game I'm aware of having ever been removed from user's libraries was The Culling 2.
168.
▲
by
sellyme
5y ago
> The game has since been stable for about 500. There were a few patches to chess in the mid to late 20th century that disallowed promoting a pawn to an enemy piece (this was useful for forcing a smothered mate), and to prevent verticall
169.
▲
by
sellyme
5y ago
> How is it unrelated? A noxious branch is exactly something that many or most people would consider abhorrent and perceive as not in good faith. Because that quote fundamentally discusses cases where pruning said noxious branch is a ris
170.
▲
by
sellyme
5y ago
> Maybe bob@example.com says something Google doesn’t like so gets blocked from sending to gmail.com or any other email server hosted by Google, which is a huge swath of people similar in scale to the YouTube audience. If these people co
171.
▲
by
sellyme
5y ago
You're confusing a protocol (email) with a platform (e.g., Twitter). You can still pretty easily "opt in" to receiving their communications. You just can't force someone else to be the middleman. If they set up their own
172.
▲
by
sellyme
5y ago
I expect that's why they mentioned that it's officially unsupported behaviour. That doesn't seem too relevant to whose idea it was.
173.
▲
by
sellyme
5y ago
Yep, but reaching equilibrium once we've removed enough from the atmosphere is fine. Of course this strategy does have to go hand-in-hand with drastic emission reductions to prevent use getting back to the same point and having nowhere
174.
▲
by
sellyme
5y ago
> And it seems that I can never get it back to 100% if I move it by mistake. Move it to 0%/200% by whatever means you'd like, then use keyboard increments to return it to 100%.
175.
▲
by
sellyme
5y ago
It's a work of genius, that's just not necessarily a compliment.
176.
▲
by
sellyme
5y ago
I'm not usually a fan of capital punishment, but whoever said "no, it needs to look like a real instrument knob" is on track to change my stance there.
177.
▲
by
sellyme
5y ago
For what it's worth I'm a 25-year-old Australian who never encountered this specific syntax in schooling (it was always phrased "as <x> is to what?"), but am still very familiar with it from general interactions on
178.
▲
by
sellyme
5y ago
> Those security cameras aren’t hidden and always have a sign somewhere in the store noting their presence. My understanding is that this is not a legal requirement and is rather something stores do solely to scare away potential burglar
179.
▲
by
sellyme
5y ago
> Apple Stores are quite clearly not "public space", they are private spaces that they allow most members of the public access to. The definition of "public" vs "private" in the context of property is fairly
180.
▲
by
sellyme
5y ago
> if books had a webcam built into them Amazon is way ahead of you on this one, the Kindle Fire HD has had a camera since 2012. > would the pictures of people staring at them look different? I would suspect not, apart from being taken
More ›