« first day (2179 days earlier)      last day (2994 days later) » 

13:01
@Kevin they used to wear these when working...
@Kevin I believe the reference work here is a little known film called "Back to the Future". Copies may be found on VHS tapes.
OTOH, denim itself is far older.
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
@AnttiHaapala Some of us still do :D
13:02
Although I rarely wrangle an ornery steer.
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
@Kevin wow... I'm writing this all down... very useful advice...
not funny at all if you're in a nuclear power plant :P
This may be useful A Short History of Denim [PDF], by Lynn Downey, Levi Strauss & Co. Historian.
Looking for trousers, not shorts. Duh!
13:04
@JRichardSnape the last time I didn't wear blue denim jeans for an entire day when I was in hospital because of my appendicitis.
hello all
@idjaw hello
@AnttiHaapala I guess when I'm 10K I can see that :)
there yet?
@AnttiHaapala thank you :)
13:06
@AnttiHaapala what a weirdly formal hospital that must've been
and very close
@idjaw needs 2 upvotes
@RobertGrant :P
ok come on 2 guys upvote idjaw ok?
haha
13 rep :d
worstof4 = lambda stack,overflow,home,work: round(sum(sorted([stack,overflow,home,work])[:3])/3)inspectorG4dget 33 mins ago
hahah
oh mr. inspector. you funny.
13:11
I upvoted two good answers
(And downvoted 30 bad ones, sorry mate)
the only two good answers
I get it. I appreciate the honesty.
ok
10007
congrats idjaw
:D
thanks all!
13:12
I've upvoted 3
need to avoid reversal :D:D
I CAN SEE THINGS!
next in queue, @holdenweb
Yay! Congrats, ijdaw!
holdenweb at 9,827
Morning cabbage.
13:14
you have only 10 delves wasit? so use them sparingly
Grats, idjaw!
yeah 10...and I think I gain an extra for every extra rep or something
thanks @MorganThrapp :)
@idjaw 1 for each 1k more
"The first 500000 points are the hardest" - Martijn Pieters, in about 3 days' time
caps at 35k
13:15
> 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
and also I've surpassed Kevin (again?)
Nothing happens on accident when it comes to Kevin. Kevin let this happen.
Congratulations on surpassing me however many times you did it :-)
Why? We will never know why.
I'm a relic of history. The world has moved on.
13:21
@poke wrong duplicate :P
Cabbage!
@AnttiHaapala why?
this is to flatten at level n
though yes, it is applicable after modifications
nvm, just need to add an explanation
OP said to their own solution “However this relies on knowing that you would like to go 'three branches down'”
no, it is for an arbitrary N, but exactly at that level.
So that means to me that they want to solve it without knowing exactly that.
13:23
morning
but lets see...
@poke It means that they want to be able to pass an arg saying how many levels deep they want to recurse in the flattening process.
nvm, I've added a comment there, if they ping then we reopen :d
Yes, you can all keep repeating that to me, but unless there is further clarification from OP, I’m not changing anything about it…
13:28
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. :)
It’s not self-deleted
He changed it and then undeleted it
Yeah, I just noticed that. Still, he does seem to self-delete an awful lot.
@Kevin nice answer taking care of possible duplicates. I referred to your answer in mine for handling dupes
TIL that you can't shuffle an enumeration.
@Kevin Funny about that. :) Of course, you can shuffle it after you convert it to a list of tuples.
13:37
@Kevin shuffle needs a mutable sequence
Yeah, I know. Like, I knew it, but I didn't know it, you know?
hmm I am worried about Kevin already :D
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 …}
Cabbage
13:41
@BhargavRao cbg
Yesterday I learned that

if all(u <= v for u, v in zip(t, t[1:])):

takes almost 50% longer than

t = list(t)
if t == sorted(t):

where t is a string.
I guess IP got you already
@AnttiHaapala Going tomorrow \o/
Wish me luck
@PM2Ring your Big-O skills are somewhat lacking...
I hate MySQL backed Django..
13:43
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%
@PM2Ring also, did you try zipping t with nexted iter(t)
Woohoo @idjaw has crossed 10k. It's time for party
You can do it with uneven distribution, though.
def random_positive_integer():
    if random.choice((True, False)):
        return 1
    return 1 + random_positive_integer()
@PM2Ring also: t_plus_1 = iter(t); next(t_plus_1); all(map(lt, t, t_plus_1))
@BhargavRao \o/ \o/ \o/
13:44
@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.
@idjaw let me find something that makes you feel unwell :d
@AnttiHaapala :D
@idjaw perhaps a top-voted php question :d
should be good
congrats, @idjaw welcome to the del-taco'ed questions club ;)
13:46
@idjaw enjoy
Why am I so excited to be in a party that shows all the garbage SO has to offer....
I wanna see garbage SO questions too :(
ah sorry :P
it was too new
13:48
need 20k for speedy del
@AnttiHaapala I saw that one yesterday! haha
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!
POWER ALMIGHTY!!!!
I think I felt the electricity run through my veins
I bring my mechanical keyboard to work every day. Was the first time i forgot it today.. this work keyboard is giving me anxiety
13:49
!!!
@d-coder MySQL > Mongo
@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
DSM
DSM
Working-from-home cabbage for all.
o/
@clickhere Time to wander around the halls carrying a sheet of paper, with a serious expression on your face
13:50
user image
3
^ artist's impression of @idjaw, right now
@WayneWerner might just have to go home and get my keyboard
@khajvah Yes.. but migrations screws me big time!
@RobertGrant and it's not even my final form, bro
@clickhere If I had to type on a non-mech keyboard for more than a few minutes at a time, I would
@d-coder yeah Django is piece of shit
13:51
@d-coder @khajvah just thrust the mysql into somewhere where the sun doesn't shine ok?
switch to postgresql!
@khajvah It seems like anything large enough becomes one
@AnttiHaapala good pun
I have never used MySQL actually
@khajvah : Django is cool..
mysql is bad
13:51
@WayneWerner yeah
it is really bad
it is still better than nothing...
but it is worse than any alternative for most of the cases.
But will it webscale?
BTW postgresql 9.6 is out
@RobertGrant no only mongo webscale
@idjaw Oh great... had 10k rep for all of 5 mins and you're already corrupted :p
Does it have built in geo datatypes yet, I wonder
why PostgreSql
Does it have any added features ?
@JonClements I let the power get to my head
like no migrations ?
:P
13:53
> Full-text search can now search for phrases (multiple adjacent words)
Actually, I could recommend postgresql here if it had an equivalent of Oracle's Flashback thingy
that's something I need
@d-coder that is the one recommended by django
what does the flashback thing do?
It keeps a history of changes to a table, and who did them
13:53
I see.. I used to use MySQL when using Django 1.4 till 1.6
(And it's fast)
then I switched to mongo.
(And it works across a multi-write node cluster)
@RobertGrant yeah no such thing, I use sqlalchemy continuum
So cool
13:54
@d-coder just drop mongo, just drop mysql
The Antti Book - The definitive guide on what not to use
See what I did there?
Now I picked MySQL again.
That was my mistake!
@d-coder switch to postgresql.
I am actually joining "relational-dbs for everything" school
Mongo is cool too..
I know no ACIDs there but still
13:55
only Facebook and Uber and such have definite use case for mysql.
@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
@d-coder anyhow, your "no longer migrations" is a hoax
@AnttiHaapala didn't facebook modify MySQL for themselves ?
Tomo I have to present a demo to my team..
your data will still have a schema... only, you're not enforcing it
13:56
Although putting it in the application means clustering etc Just Works
@khajvah exactly
But still this migrations stuff keeps cropping up
migration issue isn't a DB issue
@d-coder with postgresql, the database ensures that your data is in the given format
@d-coder build a big wall?
Or is that just for illegal data migrations?
13:57
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.
rbrb for now folks. Time to go do work things.
@AnttiHaapala there is a package for json support
for django
@khajvah it will still suck
yeah but if you already use django, you are pretty much stuck with its ORM
So can I migrate from MySQL to PostgreSQL ?
like within in a jiffy ?
13:58
@d-coder do you want to keep the data?
No data production data at this moment
then yes
django orm to sqlalchemy is like comparing saturn missiles to saturn v
@AnttiHaapala well, saturn missiles are easier to use :P
14:00
not responsible for fubaring your db though :)
That's what you want - loads of different tools that might do what you want
@d-coder yes, if your data isn't broken, you can dump the data from django as json, then reload to postgresql
I have zero data in MySQL.
@khajvah yes, but harder for space travel.
@d-coder then, just follow the django postgresql guide
@d-coder are you on what OS?
14:00
@AnttiHaapala the entire Django summed up
@d-coder there's a dmg app
what's postgresql written in?
I see..
@khajvah C
not some stupid C++
I always wondered why heroku gives PG as default DB :P
14:02
meh, I wanted to read its code.
yeah my C is terrible
though I might be able to read
If you know C++ you should be able to read C
I don't how to be as nerdy as you guys are..
14:03
unless you only know boost c++ ;)
@AnttiHaapala: I noticed in the transcripts that you were talking about D-flat the other day. :)
I don't know the patterns and tricks of C
@d-coder easy, just stop having a life.
@PM2Ring I did.
Well, I didn't know that tabs and spaces were different things, I mean. — Dragoonknight 17 hours ago
@AnttiHaapala I am sad now. I have to work till 10pm today
downvote and delv ^
@AnttiHaapala roomba to the rescue
@AnttiHaapala : haha
doesn't help if someone upvotes the ans
What's a word for when someone "politely demands" something?
14:10
@corvid asks?
It's a trap
@AnttiHaapala is this about c#.js?
closed woo
14:19
@khajvah I guess that's too broad, or primarily opinion-based. But I don't think it deserves downvotes.
maybe even off-topic?
Agreed about the downvotes. It's not a bad question, it just might not be a really good question for SO anymore. Maybe programmers.se?
there is data science.se
hoho at presidential elections in Estonia :D
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.
if that could happen in the US :d
@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.
14:30
Yeah.
@AnttiHaapala they tried to do that, but people have been supporting the idiot they put in to oppose her as a joke
DSM
DSM
@AnttiHaapala: it's rare, but can happen. John Quincy Adams, for example (there was no majority in the College so he was chosen by the House.)
@RobertGrant people like memes
@DSM yeah past is past :D
14:32
cabbage @linuscl
@DSM he was also a diplomat...
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.
when all the numbers in all your lists are 0? And exactly 0, i.e. False, or None would mean something different?
DSM
DSM
@AnttiHaapala: I was thinking of the election process itself, not his being an unknown (given his family, he was very well-known..)
14:34
@linuscl cause I think not any would work for you
@DSM that was more like a remark that back then someone who's a diplomat could be elected as a president of the US,
now they'd be like "oh those diplomats are so weak"
@WayneWerner thank you :( bye
DSM
DSM
@linuscl: ?
@linuscl yeah: all(not any(_) for _ in yourlist) will produce True for all zeroes, and False for any 1s present
technically it will also produce true if your lists contain all falsey values
i.e. [[0, False, None, [], (), {}, set(), '']] would be true
@WayneWerner nice :) what's the _ in your command?
14:44
throwaway variable
in the REPL it's the result of the last command
DSM
DSM
I'm still trying to figure out the ":( bye" part.
but in code it's just a way of indicating "no, this variable isn't of any importance - I'm just using it, but you shouldn't be depending on it later"
in the newer versions of Python I believe you don't have to worry about list comprehension variable leakage, but that used to be a thing
thanks! :)
but if all numbers are 1, all() will also produce a True, I believe
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)
14:49
x = [[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]]

all_zeroes = [not any(_) for _ in x]
print(all_zeroes)
# [False, False, False, True, True]
Or:
x = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]

all_zeroes = [not any(_) for _ in x]
print(all_zeroes)
# [True, True, True, True, True]
ah, yes, it also works for [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]
-> False
so all then makes sure that you have all zero sublists
gah! Heisenbug!
Send beer.
Be strong.
all([False, False, False]) # -> `False`
all([False, True, True])  # -> `False
all([True, True, True])  # -> `True`
14:52
@Kevin Tennants?
@JRichardSnape I may or may not be able to send beer....
@RobertGrant Nice
@JonClements I'll wait until I observe it to confirm.
all(_ for one, _ in one_for_all)
Is this a doctor who reference because I only watched like 80% of Tennant's run
@JRichardSnape awesome... while you're doing that... I also have a box that may or may not have a cat... can you keep an eye on that one too? :p
DSM
DSM
14:54
Is there a rule that we have to send beer to people who come across Heisenbugs now?
@Kevin fix that
How can he watch fewer episodes? He's already watched them!
Unless you're skipping the farting reptile episodes, those are unnecessary
I still need to watch the one where he goes to Space Hell and fights the literal devil
@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...
14:58
Sends a copy of XCOM2
@RobertGrant sounds awesome... is there a bonus pack that also comes with a couple of beers and a decent sized kebab? :p
Not had a kebab in years
You need to fix that, Bobby.
I can't make it decades yet! I can only time travel at 1s/s.
15:14
@JonClements I always confuse heisenbug and schrodinger, so last time I called it the heisenberg box
cabbage guys :-)
cbg
any ideas on the best server for Python Flask app? for windows
self hosting :-)
no pythonanywhere :P
15:16
you have to accept pretty low standards if you're on windows anyway
Ouch!
Anything guys?
install linux
@khajvah Other than that :-)
Never used Linux, heard its pretty hard to learn
and its not for noobs like me
well you are trying to host a web application
hosting isn't for noob either
15:24
lawl
stackoverflow.com/q/39815647 typo, and the answerer has gotten sucked into a chameleon question
> the question was marked as duplicate, so I just rephrased it as yet another dup
With a crap solution
Yeah, it doesn't actually address the problem in the question.
Although I guess "here's a complete rewrite of everything" would incidentally exclude a typo.
Or produce more.
15:43
@poke ... sounds like an assignment
@AnttiHaapala Huh?
homework :D
why?
perhaps not
ah nvm, it was one of the commenters
I think you misunderstood: That new question was opened because the old one was closed as a duplicate
yeah ^^

« first day (2179 days earlier)      last day (2994 days later) »