« first day (3433 days earlier)      last day (1516 days later) » 
03:00 - 18:0018:00 - 00:00

6:01 PM
@AndrasDeak any advantage of np.newaxis in place of None in that situation? Because that's what I do but it looks like None does the same thing.
 
Not that I know of. I presume it's meant as an alias for clarity, but it really is just None and I almost never see the longer version in code. And they can't just switch np.newaxis to something not None because that would break so much code.
 
brief cbg
 
cbg
 
Cabbage everyone, I am sure this questions needs closing: stackoverflow.com/questions/60623018/… can't find the perfect duplicate tho
 
closed
 
6:36 PM
@Aran-Fey I just heard that all your universities have to shut down by Monday the latest
 
Wait, really? Guess this semester will be even less productive than usual
 
yup, and your chancellor said something along the lines of "the population aged 14-30 is the primary carrier of the virus on account of them having the most extensive social network, so they have to be in the center of mitigation", which makes a lot of sense to me
by the time you recover you can deep dive into your projects :P
 
no compulsory attendance for a month, neat
...although it's not as if I physically attended many lectures to begin with
 
hehe
That's not exactly "shut down", though. If you make attendance optional but still carry on with lectures "most" students will go anyway for fear of dropping out
 
I wonder if the lectures will be live streamed for the next month or pre-recorded videos
 
6:42 PM
that's what our universities are starting to push for...but there's mostly no infrastructure to support it
 
I also wonder how many teachers just gained a lot of free time because they already had recordings of 8 year old lectures
 
I wish I had :)
 
are you guys gonna be doing e-learning for a month, too?
 
doubt it...
Just today we got a rector's memo that employees in risky population can excuse themselves from teaching in person, but electronic means must be provided for the students. In my own case the corresponding infrastructure would be "whatever I can do on my own". I'm not even sure whom I could ask for help.
 
Well, take care not to let the younglings with their extensive social networks infect you
 
6:48 PM
Hehe, I'll try. I did ride a bike to work yesterday, after ~8 years of not touching my bike.
for now the two subways I take to work is by far the largest source of infection to me
I'm hoping that by the time the small faculty of phys/math students come down with the virus we'll have thousands of sick engineering students who make up most of the student body, so precautions will be made before my students get sick
there was also going to be a conference in Germany next week that would've served as a nice entry point of the virus into our department, but the conference was called off last week
 
god bless you @AndrasDeak
 
@αԋɱҽԃαмєяιcαη I have to absolutely quote you on this one. God bless indeed.
Blessed cabbages everyone :)
 
The whole world is adopting the hermit life style, eh
 
@CeliusStingher thank you
 
@Aran-Fey it's awesome, isn't it? :P
 
6:52 PM
@Aran-Fey Please let my boss know, I got declined home-office request together with a "Every year the same s**t happens"
 
@CeliusStingher lol
 
@AndrasDeak I don't notice much of a difference, I don't know any other people :P
 
Just as long as the virus doesn't spread to puppies :)
 
7:14 PM
I'm pretty much being asked to work from home in the next week or so.
 
{coworker[0]} came back from a cruise on Monday, and now he gets to work from home for the next two weeks.
 
@αԋɱҽԃαмєяιcαη think Diamond Princess
 
it's keep spreads :(
but upon checking i just see it's keep improving by 60% yet.
 
by whatever measure of "improving"
on our continent it's just getting fun
 
7:20 PM
@AndrasDeak do you have lectures at the moment? we're currently in exam season, so it's just been memos like "students, stay at home if you feel sick".
 
Yeah, 4th week out of 12 or something.
 
The speed of the virus has spread somewhat slow
only in Italy i see it's keep spread quickly. i think that's due to multiple crowded places there.
 
It's kinda freaky how many big conferences have been cancelled all of a sudden.
 
I have to confess I am quite amazed by some ratios. So, for instance for what I'm seeing right now, there's 631 deaths in Italy with 10,149 infected cases
 
@MisterMiyagi DPG's very cautious, for good reason
 
7:23 PM
One of our big research centres is likely to be shut down this week.
 
@MisterMiyagi an MPI?
 
However, there's been 1635 closed cases, so out of 1635, 631 people have died, that rate is close to 40%
 
Or something like FZ Julich?
 
@AndrasDeak There are rumours that Jülich will close down the campus.
 
How serious is this other type of measurement compared to deaths/infected?
 
7:24 PM
@MisterMiyagi wow
 
@AndrasDeak Don't tell me you would have attended DPG ^^
 
@MisterMiyagi no, because I pulled myself out weeks ago :)
@CeliusStingher we don't really know the number of infected, because it seems that the vast majority of cases are mild and are never diagnosed
The largest threat seems to be that even if a small percentage of the total susceptible population get infected the medical system won't be able to handle it eventually, so people that can be saved under nicer circumstances might die. So the main task is to slow down the disease in order to spread out its spread over time. Ease up the strain that's put on medical systems.
 
@AndrasDeak damn, let me know if you ever attend a conference with high energy physics people around
 
@MisterMiyagi unlikely :) We'd have went to the condensed matter gig in Dresden
but I'll let you know!
 
@AndrasDeak ah well, wanted to diversify anyways. ^^
 
@AndrasDeak Agreed, I'm still impressed by the ratio mentioned above. I hope cases start to decline soon as Europe moves away from the winter. And I'm hoping there's not a raise here in South America as we approach the winter.
 
7:47 PM
@CeliusStingher we've had a girl from Ecuador pass through here and end up in Prague sick, but she probably picked the virus up in Italy (backpacking with friends)
 
Yeah, we have 17 cases, all of them from Italy/Spain/France
 
@Aran-Fey oh, and specifically the practical course I teach involves a short quiz each week...not exactly something you can shift into e-learning
 
does the quiz involve anything to do with favourite colours and the unladen weight of a swallow?
 
sometimes, but they get two tries ;)
 
8:03 PM
@CeliusStingher The stats are all skewed in plenty of ways, so it's super-hard to get realistic figures with an emergent virus
Don't forget about High-Rise Syndrome, which appeared to suggest that cats are more likely to die with increased height if they fall from high-rise balconies up to ~6 storeys, after which their chance of survival tended to increase the higher up they fell from
 
@AndrasDeak Huh, don't you have any kind of e-learning platform where the students could take an online quiz?
 
This just happened to be a side effect of people not bothering to take splatted kitties to the vet, so it gave really odd results, because only those that were likely to survive were taken to the vet. I imagine there's a similar situation with this virus. If you're not particularly sick, would you want to thrust yourself into the limelight?
I would imagine that a lot of cases simply aren't self-reported, either through not wanting to become one of the numbers on the news or just because people don't even realise they have it
 
Can anyone explain why we need to pass an explicit cls argument to super().__new__?
class Foo(dict):
    def __new__(cls):
        return super().__new__(cls)  # <- WHY

    @classmethod
    def fromkeys(cls, iterable):
        return super().fromkeys(iterable)

    def __str__(self):
        return super().__str__()

Foo()
Foo.fromkeys('abc')
str(Foo())
 
stackoverflow.com/q/60625222/4799172 dupe. And while we're at it, is it worth taking action against this answer in the dupe target (link-only-answer from 2009)?
 
8:28 PM
@Aran-Fey incidentally we kind of do, but that's mostly by accident. And we don't use it as a quiz platform...and I can't imagine translating our 10-minute short quizes for that (which all involve deriving formulae and integrals)
 
Oh, you're making the students do actual work. I see. I'm used to boring ol' multiple choice questions
 
hehe, yes, sadly for all of us
 
it's not necessarily a bad thing for the students
long-term
 
so we tell ourselves :)
 
Well, I can tell you that my multiple choice questions aren't working
 
8:32 PM
ABBA EDDA ACDC (Edda is a Hungarian band)
 
a month after the semester ends all knowledge about the subject in my brain is gone
 
 
1 hour later…
9:44 PM
@Aran-Fey AFAIK it's because __new__ is some weird hybrid that isn't actually a class method, even though it looks like one. Basically super().__new__ fetches __new__ from the class, not the instance (since there isn't one), thereby not binding the first argument.
 
Hmm. Shouldn't all classmethods behave like that, then?
 
Anyways, __new__ looks like a class method but is actually a regular method. type.__call__ looks it up on the class (receiving the bare function, since function.__get__(cls, None) returns the function) and explicitly passes in cls.
 
I thought that might be the case, but that doesn't explain why it interacts strangely with super()
 
does it not?
 
stackoverflow.com/questions/60626278/… typo, screenshot of code, an upvote and an answer :/
^ closed, thanks guys
 
9:52 PM
class Foo:
    def __new__(cls):
        cls.cls_meth()
        cls.reg_meth(cls)

    def reg_meth(first): print(first)

    @classmethod
    def cls_meth(first): print(first)

Foo()
 
function.__get__(cls, None) <- you meant function.__get__(None, cls) there, right?
 
I can never remember which order is correct
 
instance, owner
 
that's the one
s/cls, None/None, cls/g
 
@MisterMiyagi That demonstrates the mechanism behind type.__call__ calling __new__ as if it were a classmethod, but it doesn't have anything to do with super(), does it?
 
9:58 PM
hello
 
Both Foo.__new__ and Foo.fromkeys are functions that are called with a class as the first argument, yet chain-calling with super() behaves differently. Where's the mechanism that causes that difference?
 
super() => super(cls, cls) is a standing for the parent class, i.e. dict in your case. So super().__new__ does the equivalent of dict.__new__.
@Aran-Fey fromkeys is a classmethod (emulating magical C thingy).
 
Wait, isn't super() equivalent to super(cls, cls)? How can it be super(None, cls)?
 
looks around innocently
 
oh. It's @classmethod's fault. I see
Because __new__ is a regular method, cls.__new__ returns an unbound method. But if it were decorated with @classmethod, it would return a bound method.
 
10:02 PM
i don't use classes at all. but looks like i shall start to use it.
 
note that according to the data model, __new__ is a static method – which kinda has the same result. It's too late around here to check whether it actually is or Python just pretentds.
 
oh, I misremembered that. I could've sworn it's a classmethod
 
().__new__(().__class__)
staticmethod, obviously adjusts monocle
 
my brain is... struggling to keep up today
I'm gonna need a minute 5 minutes to figure out that line of code
 
@Aran-Fey you should be resting, what with your zombie infection
 
10:07 PM
that's a good suggestion :/
 
alright, alright. Good night
 
personally, to me, there's nothing like sleeping 20 hours a day to get better
@Aran-Fey which is not to say that I want you to leave :) Just take care.
good night
 
@Aran-Fey good night. get well soon.
 
what has happened with Google results on "Python enumerate"? Even the PEP is above the docs
 
it's the work of Big Forvarinrangelen
it's the last two hits on the first page of duckduckgo, but the onebox is on point as usual
 
10:26 PM
@AndrasDeak <holds out a big not sign> begone, vile demon
I'm not sure what the biggest protest could be in Python for a placard. not feels weak
I've also totally lost the comment I was supposed to be replying to with link to enumerate :/ The main feed has been brutal on links for dupes etc tonight
I've downloaded 6 books tonight, all (IIRC) from .edu domains. I'm somewhat confused; it seems that Universities are making copyright texts freely available. When I was at uni, I used to have to torrent books or find other underhanded ways of getting PDFs. Are they paying some kind of special license?
 
Is it their own IP?
I wouldn't think there's a way to make someone else's property freely available. So it's probably more ignorance than magic. Unless it's their own books, in which case they can probably do that.
 
Let me dig out my memory stick and find an example. I'm almost sure that it isn't their property but that's a good point
 
anyone else notice a big performance hit using set.intersection() ?
 
10:41 PM
Compared to what? MCVE?
And how did you profile your code?
 
cProfile
 
@AndrasDeak I think you're right. I noticed a few Unis offering PDFs for books I was searching for and conflated it with URLs like https://web.ist.utl.pt/~fabio.ferreira/material/asa/clrs.pdf. I guess I was just more surprised that nobody is taking the links down when all you have to do is add "pdf" to the end of the book title
100% hit rate on what is collectively probably ~£500-worth of books seems strange, with no tricks, is all
@Todd Big hit between different Python versions or what?
 
@roganjosh Another hack that I definitely don't do when looking for a book is finding the Amazon preview, selecting a good paragraph of text and then using quotes "" for google's exact match with filetype:pdf and 90% of the time you can just find the book pdf
 
@jamylak I've never struggled to find books :P I'm just surprised that it was definitely easier now to get the PDFs than having to torrent when I needed them at uni. And there's no way that an author would miss the trick of just adding "pdf" to the end of their book title
 
@roganjosh Yeah it's weird how easy it is
 
10:53 PM
i'm trying to use an alternative @roganjosh to get a some comparison.. wish I had a better alternative though than looping over set items and comparing
maybe set.intersectaion(set) would be faster than set.intersection(list) idk
 
@Todd But what is the core issue that you're seeing? Are you suggesting something has changed? "performance hit" is too open-ended
 
no
just profiling my code and noticing that intersection takes some time
 
mmm, with cprofile
 
eh.. intersection is way faster than looping as expected
 
10:56 PM
you can also time {*set1, *set2}
 
i'll try that
 
although set1.intersection(set2) is much clearer
 
I don't know how you're testing this overall (a function with other things going on?) but cprofile is not very fine-grained
 
(also better extensible with multiple sets)
if your code's bottleneck is set.intersection then it's probably already optimal without a larger refactor
 
@Todd It would be way faster, if you can change the design so they are already sets that would help though it may or may not be possible
 
11:02 PM
i just did
seeing if that has any improvement
 
You could save a few milliseconds by using & instead of the .intersection but I doubt that would have any real improvement
 
little faster set to set intersection, but not enough to make a difference
i'll just figure out a caching scheme for the operation
 
What is the logic of the program?
 
the logic of the program can be summed up as, do a dozen loops within loops within loops to find one thing that might not be what is needed, in which case start looping again... all that in a loop =)
 
Please make an MCVE. I'm gonna have to go to sleep but it's tough for us to help with that
Rbrb
 
11:15 PM
i'm going to implement a sorted list class so lookups are faster
i've already replaced what I could with dictionary lookups
 
Would a heapq not help?
 
hmm.. lemme check that
that actually might be useful
thanks andras
 
no problem
 
anything that has a listlike interface that has faster lookups than looping on a list
 
you can probably also do that with a thin dict wrapper
 
11:26 PM
a dictionary might be good for caching values
doesn't seem to work for this.. but this heapq is interesting.. in the middle of putting into the code
 
I can't comment on that since it's unclear what you're really trying to do and how
 
doesn't look like heapq has a fast way of finding a specific element
bisect seems to be what i need
 
11:52 PM
Does anybody have a favourite library for parsing text files whose format changes often?
 
@Todd please see our code formatting guide to chat and practice in the sandbox if necessary
 
okay
 
heh
 
03:00 - 18:0018:00 - 00:00

« first day (3433 days earlier)      last day (1516 days later) »