Sometimes the time stream causes an amnesia hangover so I find it's best to have a "please return pants to ordinary configuration" placard by the exit, with handy explanatory diagrams
2100s Kevin: Does anyone know how far back in time you can go before the locals start looking at you funny for wearing yellow radiation protection coveralls
> When you have stanky old wizard eyes like me, sometimes you see things that are real, and other times it's, like, crazy, crazy, crazy, in your face all the time. > [forlorn resigned sigh]. All the time.
-- Simon Petrikov, on the burden of 10k viewing privs
I see yet another self-deleted wrong answer there by Moinuddin Quadri. If he spent a little more time reading the question before FGITWing it he might not have to delete so much of what he writes. :)
Like it's something I could trivially derive from things I already know about enumeration and shuffling, but there was no discrete indivisible "you can't shuffle an enumeration" factoid in my brain
@Kevin like, you can take a subset of natural numbers and then shuffle them. What you cannot do is to shuffle the natural numbers itself, so that on wikipedia and in college math classes they would say that ℕ = {1, 2, 23419873219847298347, 42342123, 2342342341 …}
It's kind of like how you can't randomly choose with even distribution from an infinite set because the probability of choosing any particular item is 0%
@AnttiHaapala I figured that the all version should be O(n), the sorted version should be O(nlogn). And the all version can bail out early as soon as it detects an out-of-sequence item.
wish I had enough experience in Python/Django and Mongo.. I would write all the missing pieces/ rewrite all the functionality MySQL supports.. Somehow.. All of it!
@AnttiHaapala No, I didn't try that. But I wasn't too bothered about efficiency because the main algorithm was really dumb. It was a brute-force search that was effectively O(2^n), and I figured there had to be a much better way. Since then I've implemented a better way. My new code isn't the best algorithm known, but at least it's pretty easy to understand. stackoverflow.com/q/39807066/4014959
@AnttiHaapala yeah I've used that as well, which is fine if everyone using the data goes through an API that uses that, but it does make sense to put it in the db
you can use a jsonb column if you want, for unstructured json blobs, in postgresql
if you're not stuck with django, whose ORM is pathetic, you could use sqlalchemy which makes it easy to also query jsonb columns, so you get best of both worlds.
parliament elects, they couldn't agree on the candidates so instead they chose a relatively unknown woman then to run unopposed on the reround, and she was elected.
@WayneWerner Algorithm questions are on-topic on SO, but sadly they tend to get down-voted due to lack of code. And really, a question like that needs answers from people who know enough about that sort of data processing to give decent guidance.
This time I've got a nested list, like [[0, 1, 0, 0, 0], [0, 1, 0, 0, 1], [1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] and I want to do sth, when all numbers are 0.
regardless, if you use _ in Python, other programmers will know that you mean not to expect to use that variable. Unless you're dealing with i18n and you've aliased it
all will, but that's why you're using not any(_)
any(_) will return true if you have any truthy values in your sublist(s)
@DSM I don't think so... but first in with... "omfg - there's heisenbugs everywhere! There must be millions of them - it's an invasion.... HELP!"... just in case...