« first day (3440 days earlier)      last day (1733 days later) » 
00:00 - 16:0016:00 - 00:00

00:27
@αԋɱҽԃαмєяιcαη I don't have point of references for bpython
:D works like a charm
pycharm, eh?
:D no am VSCode fan
I'm sitting here frustrated that GUI emacs doesn't have a separate alpha background setting. So I set my terminal background to transparent, went full screen, and now I'm watching myself code by the light of my computer. About to go live on twitch again...
@AaronHall I've seen your twitch background. are you sure your eyes not tired ?
00:40
I'm always tired by this time of the day.
:d i was going to ask that question few moment ago but forgot
You are welcome to join me, it's always better to have someone to chat with while I code or pretend to code
you've to fix the connection
There was a network error. Please try again. (Error #2000)
yea
working now?
yes it's fine now
signing up now :D
00:44
nice.
Hey guys, I was wondering if anyone knew how to anonymize location data properly or had good reading on that.
@Skyler that's has been disused on data science before. check
01:07
@αԋɱҽԃαмєяιcαη thanks for joining me for a bit - too bad the connection wasn't good...
@AaronHall you welcome. yes it was keeping connecting and disconnecting.
I blame twitch.
name checks out
huge server latency.
nix puts everything in a "build" directory so black skips everything in it (not explicitly named)
this seems like a bad call on black's part, but maybe I'm wrong. - do I need pyproject.toml? that seems to be the new hot thing all the kids are doing
01:14
the documentation stated that
By default Black looks for pyproject.toml starting from the common base directory of all files and directories passed on the command line. If it’s not there, it looks in parent directories
[tool.black]
line-length = 88
target-version = ['py37']
include = '\.pyi?$'
I'm not sure what the i means in the include
looks a lot like a regex
yea to match .py files
agreed... oh, i should be optional due to the ?
01:18
yes
ok, I grock it
are we ever going to be able to treat mypy'd files like cython'd files?
if you mean "don't know what they are and what to do with them", I already am
almost 10 teaspoons of sugar in a can of coke...
 
1 hour later…
02:51
I ran cython on a file with a four line recursive fibonacci function and it generated a 3229 line .c file.
@smci hey, what's up?
A question about subprocess/pexpect Anyone want to advise this OP/close as dupe? stackoverflow.com/questions/60701869/… Also, this Differences between subprocess module, envoy, sarge and pexpect? seems bad to me, is it improveable?
03:23
that's an old one
cython is pretty verbose in the C code it generates
probably do it in less than half the lines of code manually
oh.. a 4 line function generated over 3k lines? why?
 
2 hours later…
05:39
cbg guys o/
hi
 
2 hours later…
user10984358
08:15
If I have a list of names (boys and girls) and sort them such that girls come first and boys come second in name order is there a better way than this?
user10984358
>>> boys={'Alex','Bob','Chris'}
>>> girls={'Anna','Bella','Christie'}
>>> names=['Christie','Bob','Bella','Chris','Alex','Anna']
>>> sorted(names,key=lambda x:(x in boys,x))
['Anna', 'Bella', 'Christie', 'Alex', 'Bob', 'Chris']
user10984358
I know the boys and girls name will be in the set
user10984358
For my actual use case it is for a command line tool where certain flags have to be before certain flags no matter the order in which they are given, I just named boys and girls here
hm
command line tools should be able to parse keyword arguments just fine
user10984358
they told me I had to make sure the order of arguments was correct, that is why I was thinking what to do
08:21
will the boys and girls dict together contain exactly the same items as names ? (as in, len(boys) + len(girls) == len(names))? if so, you could have just converted the sets into lists and combine them
avoids the sort. but i'll admit i have a hard time actually figuring out what you're trying to solve
user10984358
len(names) <= len(boys)+len(girls)
gotcha. this seems fine as-is. though it's weird to me that the code you're passing information to needs things in correct order of args. is the code at the receiving end "not python"?
can you give some details on how you must pass these on the command line?
like, i imagine most languages should still have kwargs or similar concepts right?
user10984358
its not python at the receiving end
08:23
cbg
what is it? ./curious
cbg!
user10984358
@MisterMiyagi I just have to ensure flags from "set A" (boys) will always have to be after flags from "set B" (girls)
user10984358
It is for an automation script they want the command to be constructed based on certain scenarios
Names are good fun... I wouldn't say "Alex" was strictly a boys name.... it's most likely to be but...
lambda x:(x in boys,x) i think you can get away with just lambda x: x in boys
user10984358
08:26
noted!
otherwise, i'd probably guess we can leave this as ugly and treat it as an "extenal dependency". I'll admit though, i don't quite like this approach.
actually, sorted arguments make sense for sub-parsers
I'm sure argparse also can lead to such quirks
i suppose i've never had to deal with such a scenario before, i have a hard time envisioning why this would be needed
user10984358
08:28
the testing engineers who asked me write this said the order of flags had to be maintained, idk if that matters or they are being paronoid maybe
oh no, if they said it has to be done, it's genuinely a thing...probably.possibly.maybe
the question in my mind is essentially, why is it a thing
user10984358
I could try running the commands in mixed order manually and see if does the same thing
I've also encountered a few shell scripts that do manual CLI parsing and are… weird.
Be aware that the possible outcomes are: A) It works. No one cares. B) It works not. Everyone blames you.
I suppose that essentially means the script is just eating all args in a *args type of setup...but then im unable to figure out how we can have len(names) <= len(boys)+len(girls)
user10984358
Just didnt want to spend another 10 mins learning the command line :/
08:32
@ParitoshSingh names are the set flags, boys/girls are the possible flags
is there some reliable way to check whether a class' instances can have a __dict__, without having access to an instance?
that means the code on the receiving end must be able to bifurcate between boys/girls flags somehow, and it can't be on the basis of length since you don't actually pass all possible girl flags at once, right
Hello!
I could check whether the class does not have __slots__, and otherwise if __dict__ is in __slots__, but the spec allows __slots__ to be an exhausted iterable.
And cls.__dict__ gives the class' dict, not the slot
I asked that question on SO a while ago and if I remember right the answer was '__dict__' in dir(cls)
does dir also cover inheritance?
no clue
08:35
alright, worst case have to walk the MRO myself. That's doable.
Thanks a lot, that was faster than expected. ^^
also, found something that asks it the other way here maybe useful?
yes indeed, if only to remind me that there are "sane classes" and "well buddy, that's your fault"
"sane classes" and "interesting classes" ;)
08:58
boys and girls, some classes are born with __dict__'s.. and others are born with __slots__'s. You'll learn more about this when you get older...
oh cool.. i just realized we can edit a post after it's sent =)
okay.. i won't quit my day job for standup =/
and some are born with both
and life's simpler if you don't know about either!
would have made mine simpler...
I ran into a few old posts where some users were stuck trying to try to somehow monkey patch the built-in classes.. I'm curious why they get stuck on that. Must be a feature of some other language they're used to and they're coming to python from that.
like one poster wanted to add custom methods to string for encryption. not sure why he's not satisfied just writing a class with the interface he wants.
09:42
@roganjosh more confusing messages... apparently people that have symptoms: should, if possible, avoid leaving the house "even to buy food or essentials"... isn't that just going to make a lot of people think: "ahh right... I'd better go and stock up now then just in case..."!? :p
BoJo will personally fill the pantry of those with symptoms
people were already madly stocking up this weekend
supermarkets are probably doing great business right now
some stores have reported doing better than the xmas period :)
I'll have to remember this and buy stock next epidemic
10:02
Well... let's hope that Black Plague Friday doesn't become a thing... the current one is crazy enough as it is...
@ParitoshSingh Yes, you can, if you want to preserve the original order of names, apart from shifting the girl names to the front. You could eliminate the lambda by setting key=boys.__contains__, but many people don't like to use dunder methods explicitly like that.
heh.. black plague friday
On the topic of CLI args & options, it sometimes makes sense for options to be specified in a particular order. IIRC, ffmpeg and the ImageMagic utilities do that.
why are the 40°N latitude countries the most affected by the virus?
wind currents?
cbg-ning
anyone familar with django here?
10:10
@AndyK yes
Repeating my post above, the questions on subprocess/pexpect/sarge/envoy are a mess. Where do we direct that OP?
@shad0w_wa1k3r thanks. I'm trying to load a csv file into one of the model I've created
model denom is related by a foreign key to another model, retail
denom has 2 fields
some countries don't have the same infrastructure in place for reporting and tracking the stats on the disease
@smci frankly, that looks like a "no MCVE" for me. I guess they forgot to grab stderr, but it is not reproducible...
denom_name and retailer
retailer is link to the table retailer, which has one field , retail_name
10:14
what do you mean by loading a csv file into the model? Do you want to populate the model with data from the csv?
Isaac Newton had to work from home for a year or so because of the Black Plague. During that time he did his initial work on the development of calculus, and his theories of optics and gravitation.
@shad0w_wa1k3r populate the model
the view to load the csv file has been created
okay, where's the struggle?
it seems to work because I'm having an error when trying to populate the model
it gives me this ValueError: Cannot assign "1": "Denomination.retailer" must be a "Retailer" instance.
I put my view in a paste bin
@PM2Ring didn't know that - interesting :)
10:16
Django handles foreign keys by ids usually (unless otherwise specified). I usually try to populate foreign keys (if pre-existing), with fk_id=obj.id instead of fk=obj.
In your case, retailer_id=1 will work, rather than retailer=1
@shad0w_wa1k3r smart man! let me have a try
@shad0w_wa1k3r that's slightly prone to weird stuff if type(obj) isn't actually the right one
Yes, usually better to use fk=obj, unless you know what you're doing
is print(f"{var=}") written correctly for output such as "var = 42". my google fu is failing me
oh, it's a 3.8 thing. got it
10:26
ah thanks. "self documenting expressions"...gotta remember that for next time
that's a cool trick.. I've been doing f"var={var}" all this time, so I can just do f"{var=}" .. l like it
@MisterMiyagi Well they tried do create an MCVE, but it isn't really V. But do we just close this as a dupe of any other How do I use subprocess? question? Does it matter that they changed to using pexpect? There isn't really any good umbrella question on subprocess/pexpect/... and that stuff ages so quickly...
That's what I do too, since I'm still using 3.6
yep, ended up just writing that.
I don't think we need 3 stars for that, though.
10:33
you can put spaces around the = in the f-string interpolation
Umm... just had an opportunity to throw a quick 3.7+ breakpoint() into some code...
Is this simple typo? OP meant write __init__` not _int_ stackoverflow.com/questions/60718905/…
@smci I can't really say what "we" should do, subprocess is a bit of a fuzzy field in which OPs generally have little idea what they do (it's a bit like pandas) and I don't know of any consensus. Personally, I think just because a subprocess is another program doesn't free the OP from the need to provide a reprex, even if it means mocking the subprocess program by some script. Same as any reprex.
So close as "needs more information" or "is seeking debugging help but" and let the Roomba eat it.
@MisterMiyagi Sure. Please do post them a comment that their MCVE doesn't currently do ie.
Also, this one is vaguely off-topic new-user in Machine Learning What is a “decision function” in machine learning? ... "what does this code from the lecture do?"
@smci That's what the cv is for. Added one.
10:48
@JonClements not to mention the whole handbreak U-turn of policy in general
It's not a U-Turn - it's just a change of direction after re-evaluating :)
I'm just watching the BBC with self-employed people in some serious mess trying to get advice :/
Is it a show with a large studio audience? )
@JonClements Oh I honestly thought you were talking about SO management again. You're talking about the UK govt non-action on Covid.
It's a giant teleconference thing. BoJo kindly decimated the entertainment industry yesterday by saying "don't go to bars, pubs, restaurants, cinemas" without making it policy... so no insurance payouts for all those business and no trade either. Smart.
10:56
Can't some of those claim from a budget/not pay business rates (if under a certain size) that's being allocated for this? But yeah, you'd think if he's advising the population to not go bars/pubs etc... it should be an official government shutdown so there's no wiggling room for insurance companies and stuff...
It's like some companies being stubborn refusing refunds and stuff because the FCO hadn't declared it strictly "essential travel only" so therefore it was the consumer "choosing" to not go etc...
By the way, do you all actually see Brexit going ahead, next January? With no trade treaty? The shelves are already bare, markets are crashing, recession etc.
Exactly. It seems that we haven't decided what we're going to do about rates etc. so these people have no idea what they can do. It's just starting into the abyss
@roganjosh That's eerily similar to Trump repeatedly suggesting tempo suspending payroll tax.
@smci interesting question. I dont think it's even been raised
@smci reactionary politics :'(
@smci That definitely should be closed as a typo.
11:00
@smci shrugs
@roganjosh But will Brexit though? People pointed out that the UK would then not have first-tier access to the EMA (European Medicines Agency) when the vaccine is presumably being trialed, mid-2021. And many medical and service-industry workers would not have their work visas renewed. And many other implications.
Wow... I'm impressed by the effort taken to post stackoverflow.com/questions/60721001/…
@smci well, I'm not qualified to answer that. I can only say that I haven't seen Brexit discussed throughout this
@roganjosh mind you... even though I was bored to the back teeth of it after 3 years... I think I'd rather that than this :)
ooo... and Odeon's closed all its cinemas...
There's hope for humanity :P
11:08
@JonClements oh, for sure. I don't even know how to take all of this. I have enough cash for the short term but being self-employed is a bit of a nightmare scenario now. Then again, big companies are going to sink too, so maybe salaried people aren't better off. I'd prefer to be pragmatic and I'm not panicking but it's impossible to even guess how this plays out
and importantly - you're not sure of salad! :)
In the face of uncertainty, you control what you control. :)
Well, yeah, I do have my own farm now :P
also, I don't know if it's just me, but every time I see Covid I read it as Corvid and have a momentary "umm... why's it called that if they think it might have come from bats or something..."
@JonClements Me too. And I'm thinking of reopening it because the core of the question is why "it requires the value entered in as many times as there were wrong answers"
11:12
oh is it closed?
@JonClements Hammered to Kevin's canonical about getting user input.
@JonClements actual cabbage (and sprouts in the small pots). It's gonna be a little while before harvest :P
@PM2Ring not quite sure I'm following re core of the question?
OTOH, the OP isn't responding to comments, so maybe there's no point in reopening.
11:16
@roganjosh Nice... cant say I'm overwhelmed by the lack of brown though :)
@JonClements Well, the OP already figured out how to get the input properly. They mainly want to know why their original recursive code behaves like it does when given input which isn't a single lowercase letter.
Think I saw a comment regarding that?
@JonClements Yep, the 1st one, but it doesn't go into details.
Fresh cabbages
11:31
@JonClements It most likely originated in bats, but probably got to humans via another species, possibly pangolins. nytimes.com/2020/03/05/opinion/coronavirus-china-pangolins.html
Umm... reading "Did pangolins transmit the coronavirus to humans? Is Covid-19 their revenge on us for bringing them to the edge of extinction?"... I can just hear: "Find out in Part 2! Coming to an area nearer to you than you think next week!"
11:47
@JonClements oh, the Association of British Insurers has released a statement just now saying that the vast majority of businesses wouldn't be covered even if they were officially told to close
A whole bunch of music festivals & concerts in Australia have been cancelled or postponed due to Covid-19. abc.net.au/doublej/music-reads/music-news/… That includes the 30th anniversary of Bluesfest, one of the largest annual music events in the country.
"This morning, New South Wales Health Minister Brad Hazzard used special state powers to force the immediate cancellation of public events with more than 500 people."
user10984358
apologies, my connection was laggy and i replied to an older message :/
Just posted in The h Bar:
Hi actually I want to write a ML model for predicting next 5-years property prices based on past years prices and some characteristics so which model can be suggested? Its just a practice data
11:57
@stack kaggle has a competition and dataset for this kind of thing (I'm not sure it considers the future prices). People share scripts to help others
anyone know of an article that covers bfs where you record the paths?
i cant find on google
can you suggest which model can be used for this @roganjosh
@stack I've suggested where to look to find out what others use
Okay Thankyou @roganjosh
@PM2Ring made me chuckle... :)
12:00
Any number of regression models, SVMs, ANNs etc. It's best to see how their performance is evaluated there
So my doubt for predicting we should use only one model or can we use many models?
You could use ensemble learning to train multiple models. The point is that you need to evaluate performance to decide which to use
so after analysis and cleaning I should apply all the regression models for the data and should see the evaluation performance right?
Correct. Different models will be evaluated with different metrics. It's not possible to know what model is best a priori, you can only make an educated guess at that and then test it
12:06
So conform we can say for predicting future prices of property based on past years we should use only regression models right?
That was just a suggestion
yes but we cant use classification or ANN for these types of data right this is my doubt
Well, part of my suggestion was ANN so I'm not sure where you got that idea from
@Permian No, but you might find these old BFS answers of mine helpful: stackoverflow.com/a/47156946/4014959 & stackoverflow.com/a/47178439/4014959
You mean ANN can be used for this right?
12:11
Yes
Okay why not regression in your opinion?
11 mins ago, by roganjosh
Any number of regression models, SVMs, ANNs etc. It's best to see how their performance is evaluated there
@stack that's literally the first example in the first chapter of hands on machine learning. There should be lots of info what kind of models make sense in there as well.
I didn't say "not regression" or "not ANN". In fact, I said the exact opposite. Did you visit the kaggle competition and see what people are using, as I recommended?
Yes It is bit different based on characteristics of houses predicting the prices they are using the regression but here based on the past years prices I want to predict the future years prices
12:16
It's the same principle. You're not trying to do some time series analysis (as I understand it), you just want to predict an outcome 5 years down the line
yes
So, the features and models in that competition should be relevant, you'll just need a different dataset that allows you to see prices 5 years apart
Hello Everyone
Hello :)
so that datset consists of characteristics of houses and prices but not years
12:19
Good news: I'm telecommuting every day for the rest of the month. Bad news: I'm already sick of it
12:31
vent that frustration with babbling on random topics in room 6!
at least that's my plan for the near future...
I have a doubt.Please help me in resolving it
Sure.
I have a API where i can get some 87634 data. I will be posting this data to some monitoring tool(Splunk)
Per post i will be passing 1000 data (which is limit for Splunk)
so this will be running in For loop. it will run for 87 times posting 87000 data.
Anyone have any idea how to get remaining 634 data too.
Run 88 times instead
Yeah thats possible. Do we have any other solution
12:37
87634 factors to 2 * 43 * 1019, so there is no bunch size below 1000 that makes each call the same size
is there a reason why you don't want to loop 88 times?
can you clarify "running in For loop. it will run for 87 times"? By default, a for loop runs until you are done with all your data, not a fixed number of times.
If you're thinking "I could loop 88 times, I guess, but then I'd have to do a lot of annoying special-casing to determine whether I'm in an iteration where I have 1000 elements to send, or whether I'm in the final iteration where I have 634", you don't necessarily need special-casing. You're allowed to slice lists with indices beyond the length of the list, which comes in handy for sequences that don't split into even pieces
>>> x = list(range(18))
>>> for i in range(0, len(x), 7):
...     print(x[i:i+7])
...
[0, 1, 2, 3, 4, 5, 6]
[7, 8, 9, 10, 11, 12, 13]
[14, 15, 16, 17]
Here's an example. The first two iterations produce slices with seven elements each, and the final iteration produces four elements. No special casing required.
@MisterMiyagi It will take the count(total/1000) after getting total data count from the api .It is not fixed one
I'm curious why you need to pass data from the API through Splunk?
See also Splitting a list into even chunks for an overview of different approaches
@Kevin @MisterMiyagi Thank you. Thats helpful
12:46
When I was using splunk, it was for live log files, not for analysing a fixed dataset.
@roganjosh that data contains user details where i can see last login time, default folder size of the user also. So monitoring team will use that for deleting inactive users after seeing the results in dashboard
Ah ok, so it has to pass through splunk to be part of the dashboard? Otherwise, all the analysis could just be done in Pandas
Yeah
@PM2Ring :(
Heh... I missed that one ^^^ :p
12:54
@PM2Ring And that's why I teach my cats to talk bullshit on violating special relativity!
@MisterMiyagi bullyam
@MisterMiyagi hope you're kinder to your cats than that Schrodinger guy... he called it a thought experiment, but I have a suspicion he just had it in for cats... :)
maybe he did..maybe he didn't.
@MisterMiyagi sounds like a job for Philomena Cunk
13:03
@JonClements No worries. There have been enough days of me waking up, staring into the kind eyes of my fuzzy friends… to know who runs the dead-or-alive experiment around here.
Many years ago, I read a book by Schrödinger, but I can't remember which one, unfortunately. Anyway, Schrödinger was actually a cat lover. He chose a cat for his famous thought experiment because he wanted the readers to have some empathy for the poor cat.
Note that Schrödinger was writing just after WWI, where humans did some pretty nasty stuff to each other, like using mustard gas as a weapon, which is not merely corrosive & toxic, it can also induce tumours & mutations.
@MisterMiyagi ahhh yes :) Seems you must be worth keeping enough to them if you're still waking up each day though :p
@PM2Ring reminded me of "Dulce et Decorum Est"
So he couldn't expect people to automatically have empathy for another human, but as a cat person he assumed everyone would have empathy for a cat.
@stack Given the worst recession in possibly a century is upon us, "predicting next 5-years property prices" is no longer about whether buyers prefer kitchen remodels vs extra bedrooms, it's a macroeconomic forecast of homeowner default rates by area, which banks become insolvent and get bailed out, which currencies tank - which are political questions, not really numerical ones. You might as well look at 1930s data.
An abundance of optimism there :P
13:19
@roganjosh for those of the view point that very few humans might be left alive in 5 years time - it's remarkably optimistic :)
It's given me a well-needed chuckle :D
@stack Just to take one example: seems like the price of oil will be low for the next 5+ years. Which countries/regions/industries will that affect, and how much? Does it still make much economical sense to buy a Tesla?
@JonClements No, that's excessive pessimism. But we're in for a nasty recession, and maybe a lost decade.
Right... gonna grab a bite to eat and take a break for staring at data and see if I can't concoct an MTG deck that'll actually work with a few cards I'd like to try out...
13:41
Wonder if I can come up with something that makes good use of Nyxbloom Ancient...
Although something with Thassa and bouncing stuff for ETB effects would also be funky...
Practical uses for an extraordinarily large amount of green mana: Genesis Wave; Kamahl, Fist of Krosa; Gelatinous Genesis; Helix Pinnacle.
Never played MTG. Did they invent "mana"?
I suspect not
Wiktionary indicates that it was ported from Polynesian into English in the 1860s
I'm reading their wiki and it says "However, the mana system also provides numerous benefits to the game such as pacing and variety, and is one of the key innovations credited with the Magic's overall success.". Now I'm curious where the concept comes from; there's some citations for me to follow up
@Kevin I've seen YT videos where it's used to create insane Hydroid Krasis'
13:48
I understand that Hydroid Krasis enjoyed some success in standard as part of the Wilderness Reclamation archetype
I think the guy was using Magic Mirror for no max hand size and draw and then also other stuff so that gaining life caused drawing, or you could exile from the graveyard to draw etc...
So the idea being you end up with your entire library in your hand and hundreds of mana to spend each turn
Apparently Larry Niven is responsible for popularizing the idea of mana as an energy source that could be used to cast magic spells. This was in the late 1960s.
"The concept of mana was introduced in Europe by missionary Robert Henry Codrington in 1891 and was popularized by Mircea Eliade in the 1950s. It was first introduced as a magical fuel used to cast spells in the 1969 short story, "Not Long Before the End", by Larry Niven." That answers that :)
Exercise: determine the first video game to use the acronym "MP" to denote (magic|mana) (power|points)
Okay... got 4 Mythic Rare and 14 Rare wildcards to use as well at some point...
Might be worth getting some more scry lands and/or castles
13:57
@Kevin are we allowed to use time travel?
I imagine you'd know the answer to that if you had done so already?
Yes, but ontologically consistent time travel only. You can't go back and change events, for example releasing your own version of Diablo in the 1980s. But you can go back and take part in events that are already in our timeline's history, for example convincing the Square development team to give their final fantasy one last shot before calling it quits
Now I'm afraid to arive in 1980, with a copy of Diablo ready for the press, only to be greeted by Kevin. And getting an F for cheating then and there.
Video game credits were often anonymized in those days, so we can never truly prove the identity of the Miyagi-san in the "special thanks" section, but I've got an inkling...
I see you thought this through already.
14:08
The magic number at the heart of the Fast Inverse Square Root could only have been invented by going back in time and giving the number to one's past self
I've long suspected that all magic bit patterns originated that way.
Time travel certainly seems easier than coming up with them yourself.
@Kevin toughie. It seems we might need to distinguish between MP and whether the pool recharges
I have a class Foo whose instances have a foo attribute. Except some of them don't; they instead have a bar attribute and a foo property that returns bar.foo. Which of these designs is less ugly? dpaste.com/2RR4SS2
Or is there a better design that I didn't think of
this suggests that mana was around in Ultima 3, in 1983. I haven't found anything earlier yet
I'm leaning towards design #1 there
14:16
@Aran-Fey I'd take #1, but without the inheritance
unless there are other bits that need the inheritance, of course
Yeah, the inheritance is mandatory there
design #1 it is, I guess
in that case, I'd take #2 since it's more correct
I'm not fond of #2 mostly because, if foo is part of Foo's interface, I would want that to be specified within Foo's body
or would an ABC work as well?
I don't think abc does instance attributes, no
A get_foo() method would be doable
14:20
have you considered a mixin?
ABCs can denote attributes via properties
The Odoo tag seems to produce low-quality questions that are borderline non-Python stackoverflow.com/questions/60709886/…
hmm, true. Guess I'd just have to use a property instead of an instance attribute in RegularFoo
How would a mixin help here?
@smci in the context of Odoo I think they're ok
it seems you want to inherit from a common Foo to get some of its attributes/methods
which ends up being exactly what case #2 does, so I'll just stop rambling now
@roganjosh Ok, but they're about an API, not about Python.
14:22
I wonder if you could do something in the style of composition-not-inheritance using descriptors...
@smci Where do you draw the line? You could say the same about pandas, no?
At times like this I wonder how I'd ever get anything done in a language other than python
...well, I guess I'd just have to go with the get_foo() method
Hmm, I assumed instance descriptors were a thing, but it turns out they are not a thing. So much for my idea.
I was thinking you could have a single Foo class, whose .foo instance attribute could either be set to a regular value, or to an object that implements __get__. If instance descriptors existed, then .foo would act like a property only in the latter case
well, if foo doesn't change, then you can use a non-data descriptor that computes the value once and overwrites itself on the instance.
functools.cached_property works that way.
user10058946
Hi guys, I have a doubt regarding splicing in Numpy.
14:34
Oh, cached_property is a 3.8 thing. No wonder I've never heard of it, then
user10058946
x=np.ones((3,3))
print(x)
x[:,[1,1,1,1]]
You mean slicing, not splicing, @codeguy?
user10058946
Just execute this and explain me the third line
excuse me?
user10058946
yeah @roganjosh
14:35
fresh CBG everyone
@codeguy If you're saying "can you run this and tell me what the output is?", then surely you could do that using your own environment
Okay... didn't know MTG had "Clue" tokens...
Or perhaps you're saying "when I run this, I don't understand the output. Please run it yourself, and look at the output, and explain what's going on", which is a more reasonable request
I think I'm just gonna stop pondering this and start writing code. Been stuck on this for way too long already anyway... time to make some actual progress
@codeguy using ones (or any other array of the same value) isn't very useful to understand slicing.
Usually, you want unique values to see what ends up where.
user10058946
14:38
I did that, but the output seems to duplicate the last dimension. It's actually the array of ones, but Iam confused @Kevin
user10058946
the matrix dimension changed from 3*3 to 3*4
[1,1,1,1] are four fields
basically, you instructed numpy to give you the column 1 four times.
Life goal: come up with a package name that my spell checker likes to pick.
look up fancy indexing == advanced indexing, @codeguy
user10058946
x[:,[0,1,2,2]], also giving same result.
that's because all your values are 1s.
try it with x = np.arange(9).reshape(3, 3) instead
user10058946
14:42
sure buddy @AndrasDeak, actually that was the concept
@codeguy OK my dude, you need to change how you ask for help.
@codeguy The main thing you should realize before going further is that you're not doing us a favour asking here for help, it's the other way around. Let that sink in for 5 minutes.
@AndrasDeak dude, where's my car?
behind you!
@JonClements in the lisp docs :P
@ParitoshSingh oh no it's not?
14:44
it's right there, behind you!
@AndrasDeak facepalms :p
@JonClements Theater performances are strongly discouraged. Soz.
ahhh... but see... it's a virtual one... so it's fine :)
exits, pursued by bear
Oh no it isn't
.... must resist.....
"(bear with me)" is a modern classic
another one in the same corner of my mind is "for the time being"
Air horn sound has my vote for #1
All that's in my mind is the Russian woman that can't stop laughing about bear guards
15:04
@roganjosh haha... I like the fact that Stanley Johnson has said that if he wants to go to the pub, he'll go the pub, regardless of what his son has said :)
@JonClements don't blame him! Kids are still in school round here, people are still in the office at work (but I can work from home just fine for now) so I don't get what difference it makes if they don't have a complete policy
Can you imagine what the Johnson family lunches must be like... :)
I probably could but I think I'd feel worse for doing it :P Ol' Stan had a horrendous comment a couple of weeks back but I'm trying to recall. Something about people being plebs and too stupid to understand the news
Ah, that was it. Illiterate
15:33
cbg , surely this has to be a dupe but I cannot find any :/ can someone help . Thanks
@shad0w_wa1k3r I made it!
I can import a file through Django
15:56
@roganjosh Got a way to go until he's a Philip though hasn't he :)
00:00 - 16:0016:00 - 00:00

« first day (3440 days earlier)      last day (1733 days later) »