3,081 karma · joined September 17, 2012
For a list, the only way to implement it is by iterate through it (see the `list_contains` function in the CPython code).
But for the special `range` object, it can implement the `__contains__` efficiently by looking at the start/stop/step (see the `range_contains` source code).
Although the Hack 1 is for demonstration purpose, in most cases you can just do `999999 in range(1000000)`.
In my test, the same `999999 in foo` is 59.1ns for the range object, 27.7ns for the set, 6.7ms for the list. The set is the fastest, except converting the range object to the set takes 21ms.
The specific term is: https://www.cloudflare.com/service-specific-terms-applicatio...
My first language is not English, so I learned this late: pigeons are perceived as dirty birds due to its presence in urban environments, but they are the same species of doves which is perceived as clean. In my first language they are just called "pigeon" and "white pigeon".
Run the following command to confirm:
ffmpeg -codecs|grep sanm
^ (jump to the beginning)
ctrl+v (block selection)
j (move cursor down)
shift+i (bulk insert?)
type ><space>
ESC
Instead, the bot asked a few questions to clarify which account is for the pin and submitted a request to mail the pin, just like the experience talking to a real customer representative.
Next time when you see a bot that is likely using LLM integration, go ahead and give it a try. Worst case you can try some jailbreaking prompts and have some fun.
In Prometheus' term, the "beneficiaries approved" is neither a counter nor a gauge. It doesn't tell you the percentage of H1b holders amongst all full time employees and certainly don't include H1b contractors. It also don't include other temporary visa types like L1 or H4, both could be "cheap foreign labors".
The "# of layoffs" also doesn't provide much information about how many H1b holders are part of the layoffs.
The goal of combining the two columns seems to be giving reader a fuzzy feeling that they are correlated, to support the author's narrative.
If you can articulate why certain code is better with convincing justifications, I would say that's "good taste". Coding styles are often examples of these.
But if you can't articulate or don't have a convincing reasoning for preferring certain coding patterns, isn't it just "opinionated"?
https://learn.microsoft.com/en-us/windows/win32/sysinfo/regi...
DNA of every baby born in California is stored. Who has access to it? - CBS News https://www.cbsnews.com/news/california-biobank-dna-babies-w...
Otherwise, it's more of a strategy to set a higher price tag, and the reseller and all the middleman taking all the extra revenues.
Google lays off its Python team | Hacker News https://news.ycombinator.com/item?id=40171125
Do I read this correctly that it replaces `\n` at the end of the line with a whitespace? CJK users probably won't be happy with the additional whitespaces.