« first day (2780 days earlier)      last day (2168 days later) » 
00:00 - 18:0018:00 - 23:00

12:09 AM
@konstant you've got several problems in one
 
12:38 AM
How do you navigate through suggestions in Sublime Text (talking about autocompletion)? What if I want to jump to last suggestion?
 
12:54 AM
Rhubarb all :)
 
duplicate, str-number concatenation stackoverflow.com/q/50548051/2823755
 
the top answers there are ancient :/
 
Ahh well, I asked too late
 
I mean on the dupe target
first .format in the third answer and no f-strings anywhere
 
Ive been reading about duplicates on meta and can't find any consensus. Yep they are old, I was going to add an f-string answer to it.
 
That answer is on SOPython's Common Questions list as a canonical answer.
 
ah, perhaps that should be revisited
 
How many canonical Q&A's can there be?
 
canonicals are not a real thing so as many as you'd like :P
 
The one you linked to is better. - or maybe not.
 
1:06 AM
but it's also closed as a dupe to something else that does have f-strings hidden in there... stackoverflow.com/questions/2823211/…
 
OK so what's the deal with dupes. My impression is marking something duplicate can be a bit arbitrary especially if it is not exactly exact.
 
In principle it should be more or less exact.
 
Up until recently I've thought that even though the details may be different, as long as the underlying cause/solution is the same then it is a dupe.
 
the official guideline is that if the answers to the target answer the original question it's fine
in practice I'm OK with anything that reasonably answers the original question apart from trivialities (your mileage for trivialities may vary)
 
Well nothing to fret over anyway
 
1:16 AM
Zero's self-answered Q&A
hold on a sec
that's exactly what's in the canon :|
@wwii where did you get that dupe link then?
I spent 15 minutes trying to update the canon page when it's already the best there is...
 
That is what I linked to isn't it? I found it in a search then went and looked at SOPython
 
I don't think so. At least I think you linked to the one that it's now closed as a dupe of.
 
Now I'm confused... the titles are similar ... that's why I thought it was the same. sorry
 
I guess that's what I get for believing someone on the internet :P
 
Can I change my link?
 
Done both
 
thanks
 
yessir
 
2:13 AM
interesting, if an OP pings you in a comment and then deletes their question, the notification doesn't go away
is this by design or unintended behaviour?
oh right, its saturday
 
3:11 AM
cbg
 
cbg
 
3:28 AM
cbg
 
4:12 AM
Hello, I had originally posted a question about finding out adjacent neighbours in a triangular tessellation. I have self answered my question but currently the code is really inefficient for large tessellations. I would be glad if any one has some suggestions for improving the speed. stackoverflow.com/questions/50537967/…
 
cabbage!
 
4:31 AM
cbg
@konstant Two rules of optimisation. 1. don't do it. 2. don't do it yet.
Start with reducing the complexity of your code. Work at it bit by bit, remove the fluff and strip out any unnecessary operations. Try and cache results as much as possible. Avoid unwanted loops. Don't use Ajax' code.
 
4:47 AM
Just from looking at it, you should be able to reduce the time complexity of your any(c in a for c in _vertices)
You compute that several times each time through your outer loop, and I believe you can make that O(1)
Same with len([x for x in a if x in _vertices])
Nvm, I'm mixing up your answer with Ajaxs
 
5:15 AM
heh
 
 
2 hours later…
6:46 AM
Cabbage
 
slow day cabbage
 
indeed cabbage
so slow indeed, that I actually went to the review queue
 
6:59 AM
I decided to give the tic-tac-toe kid some advice about DRY. stackoverflow.com/questions/50549536/tkinter-cant-call-function I'm almost tempted to fix his code, since it's so refreshing to see Tkinter code that doesn't use a star import. But I don't want to write something that retains all that repetition, and I don't want to re-write it to get rid of the repetition; I think it would be a good learning experience for him to do that himself.
 
7:13 AM
my laziness = your learning experience!
 
:) An old friend once remarked that programmer's editors should not have a copy & paste function so that kids couldn't easily replicate code like that.
 
Well, I have mixed feelings about that. On one hand, I can agree with the sentiment. OTOH, I can recall so many times when that copy-paste saved my butt.
 
I've lost count how many times I tried to write DRY java code and ended up using ctrl+c/ctrl+v after a few hours of fruitless struggling
 
It's handy when you're developing stuff and you just want to test stuff quickly. But even then it's so easy to make a minor typo that is hard to spot due to the repetition.
Hi, @IljaEverilä. As you may have noticed, Lightness really hates answers in comments. In fact it's his slogan on his profile page. And they are against SO / SE guidelines. OTOH, I'm happy to defend our policy of pointing out the cause of a typo-like problem in a comment. But we do need to ensure that it really is a typo (or "brain-o"), and not due to the OP misunderstanding the language syntax, like what happened yesterday with that triple-quoting question.
 
What is a canonical for closing this into? Multiprocessing: main process is not terminated . There are 428 questions on "multiprocessing terminate process".
 
7:28 AM
I am irritated with that user John Zw-whatever who is a blatant dupe answerer.
I'm sure they've seen that question a hundred times before but they'll still answer it the 101st time. Highly non-responsive to comments as well...
 
so what do we do?
But equally, why the hell can't I find a decent canonical with those keywords? Why can't people title for crap?
 
not an expert on MP, but yeah you would need some insane google fu to find a similar question without any decent title cues whatsoever
same issue with pandas Qs... utter crap titles.
 
Oh my God so true. Feels pointless to me trying to organize these messes.
 
you've fought well soldier. Some battles are won by not fighting them at all.
 
good morning!
 
7:42 AM
mornin! How's our resident shadow walker doing?
 
@coldspeed In this particular case John Zw was helpful. The OP was simply trying to call a function. No need either to use multiprocessing or subprocess.
 
Thanks, but I would prefer they couldn't easily find this conversation by searching chat for their own name :P
A lot of people do that... I know I do
 
Well possibly the OP wanted os.fork(). Can't tell for sure
 
8:02 AM
 
@coldspeed doing good, thanks for asking. How about you?
 
8:28 AM
too broad stackoverflow.com/questions/50550294/… Questions like this mystify me. What's the point of doing challenges like hackerrank if you get someone else to do it for you?
 
8:40 AM
this question I originally considered a typo turned out to be pretty broad in the end...
 
@Aran-Fey For the love of God please fix that title. How could it me be more vague?
 
I don't think the question is worth keeping around anyway
 
Agreed. It's a "Please fix my rambling non-MCVE, and write me a tutorial" question.
 
8:55 AM
But either way. After a brief look I retitled it "Calling super().__init__(**kwargs) ?"
Further retitled "Calling super().__init__(**kwargs), and multiple inheritance?" It isn't that hard to think up a proper title - even it does subsequently get deleted. Even teaching the OP the right terms to use is some good.
 
Anyone here on Windows and would like to do a quick test? I just wrote an answer that works for me on Linux, but not the OP. stackoverflow.com/questions/50549715/…
 
9:16 AM
This may be relevant: "If csvfile is a file object, it should be opened with newline=''."
 
@Aran-Fey Thanks! I figured it was something to do with newlines. I added a if not row: continue, but I guess I better add that newline='' too.
I was going to post some of the OP's data into the question body, and post the corresponding output into my answer, but I can't because it contains shortened URLs.
I guess I should find or write a utility that replaces all URLs with example.com URLS.
 
9:36 AM
Replace all urls in code blocks with example.com? I could do that
 
9:50 AM
I guess it just needs to change the netloc and possibly the scheme, the rest should be ok.
 
Should be easy enough, but it'll take a while because I'm going to refactor a bunch of my userscripts
 
@PM2Ring I tested it, getting 13 results in example2.
so it works as far as I can tell
same moment as OP, who seems happy =)
 
10:10 AM
@Arne Thanks. Hopefully the OP will accept it next time they log in...
 
@PM2Ring Is there a template for 'upvote and accept please' that I can drop OP?
 
No!
never ask for an upvote, and only ask for an accept if it's obvious that OP doesn't know the feature exists
 
@Arne It's bad etiquette to ask for up or down votes, but it's acceptable to educate OPs about accepting.
 
Just found the template I had in mind
You are right, it was just about accepting
 
dun dun dunn
and asking for accepts on your own posts is often also seen as shady by some (e.g. me)
it's better to have someone else do that
 
10:15 AM
Which is why I thought it might be nice if I propose it instead of PM
 
yup
 
ah, too late :p
 
For my own posts I use If my answer has helped you, please consider [accepting](http://meta.stackexchange.com/a/5235) it., I sometimes modify it and put it on answers by other.
For questions, I use If one of the answers below fixes your issue, you should accept it (click the check mark next to the appropriate answer). That does two things. It lets everyone know your issue has been resolved to your satisfaction, and it gives the person that helps you credit for the assist. See [here](http://meta.stackexchange.com/a/5235) for a full explanation.
 
I'll bookmark the comment template page
 
I also don't like harrassing askers until a few days have passed without them accepting
 
10:19 AM
@AndrasDeak As you can see, I don't actually ask for an accept, I ask the OP to consider doing it.
@AndrasDeak They might not return for a month or more.
 
@PM2Ring yeah right :P
@PM2Ring that is quite possible
fortunately we're in no rush for rep
 
I think my record for an accept is a little over a year; but I've heard of it taking 2 or 3 years in extreme cases.
 
I think I had one after more than a year
 
True. But a question looks unfinished without an accept. ;)
 
Mar 22 at 11:19, by Andras Deak
Accept on a dupe I answered 2.5 years ago... probably a new record
 
10:28 AM
@PM2Ring I'm not sure if I understood you correctly: Are you asking for something that will display urls in other people's questions/answers/comments as example.com, or something that will rewrite urls in your own answers/comments to example.com when you submit them?
Wow. This has to be the lowest-quality self-answered Q&A I've ever seen.
 
@Aran-Fey The system won't let you submit a question or answer if the text includes shortened URLs. So they need to be converted before you try to submit. I guess that's easiest to just do locally, rather than to mess around with a script that modifies stuff in the SO editor textarea.
 
So it's choice #1: Display links in existing posts as example.com
 
Could any of you give me a 10-second reaction to Cleaning up the top questions on “python 2 super” according to Google - good, bad, waste of time?
 
@Aran-Fey If the post already exists it doesn't contain problematic URLs...
 
Now I'm completely confused :D
I thought posts can't contain example.com urls?
 
10:37 AM
FWIW, I just used this as a dupe target. Fortunately, the top answers are all good, and there's even a highly-upvoted pathlib answer. And the dodgy answers mostly have comments pointing out their flaws.
@Aran-Fey Sorry. I thought they could, but I haven't tested it. I assumed they're ok, because that's what example.com was created for.
 
^ @PM2Ring, @Aran-Fey, @AndrasDeak I was asking you three
 
@Aran-Fey I just tested, and yes, http://example.com is fine, but https://t.co/CPYGRI9ttY brings up the dreaded red outline and a text bubble explanation linking you to meta.stackoverflow.com/questions/313621/…
 
@smci nope, python 2 and I'm off
 
Sigh
 
i.e. waste of time I guess :P
 
10:50 AM
@AndrasDeak: but the legacy 2.x material is clogging up the site. Noone's suggesting people would start on 2.x these days, but they do have to understand existing 2.x code, textbooks etc. We can't simply take a flamethrower to SO's 2.x material, and neither its internal search nor Google are good enough to discriminate between 2.x and 3.x material. So we are obligated to put a modicum of organization on it.
 
@smci Sorry, I was busy. But why are you bothering the general SO Meta community with that? If they're sufficiently interested in Python to care, they'd visit this room.
 
@smci I'm not invested enough to look at all those questions, but I'm sure that it's a major mess. I really don't have the energy to deal with that mess though
 
I believe the term is "tilting at windmills" ;)
 
Nah, I don't think so. When the top google results are messy and unhelpful, that's a very real problem
 
I'm getting pretty close to declaring SO broken - neither Python nor Meta communities seem to care about this sort of housekeeping, yet that plus the constant stream of dupes and rephounding are making the site cluttered and like a write-only storage mechanism for half-baked non-generalizable items. At what point would you guys consider SO broken?
 
10:54 AM
Python 2 resources will certainly remain relevant for several years, so we don't want to get rid of that stuff. OTOH, we don't want to make it too easy for people to stick with Python 2 instead of migrating. ;)
 
@smci who said it's not?
 
@smci good (but not invested enough to help atm)
 
@AndrasDeak I'm not here for a Monty Python... if it's broken then why don't we abandon it and go elsewhere?
 
There's so much stuff that's broken, and the thought of trying to fix it all is more than a little daunting. So we need to choose our battles.
 
There are huge problems on SO to begin with, and 2 vs 3 is a huge issue on its own
@smci even broken it beats anything else hands down
 
10:57 AM
@Aran-Fey Yes that's my concern. Prospective new users would take one look at the anthology of crap churned up by a search on site:SO, and baulk.
 
And frankly, at this point in time I have no yams to give for Python 2 super problems. ;)
 
@AndrasDeak But in this case I researched it and it turns out it's a small and manageable problem: there are only 6 canonical ways to get super wrong in 2.x, and they could all be covered in one question. But if I wrote it I'd be accused of rephounding. So what can I do? Write it as community wiki?
 
That's a possibility. You could even try asking for the Q to be made CW so you don't get any rep (except bounties)
Or choose one from the 6 and clean it up
Trying to ask for help on something other than Sunday would help too
 
@smci You've identified a problem, you're happy to work on creating a solution. And you're happy to have the Python community review that work. So IMHO you deserve any rep you get from that.
 
4. Understanding Python super() with __init__() methods 2009, closed 2015 as dupe of What does 'super' do in Python?, although the @AaronHall answer is much better than the accepted 2008(!) answer; please upvote the AaronHall answer.
Maybe we improve the @AaronHall answer, make it CW (if he agrees), succinctly explain the 2 vs 3 differences, then close everything else into it.
 
11:06 AM
...why make it CW?
 
@Aran-Fey Because many times when I suggest improving/modernizing an old answer and using it as canonical, I get attacked on Meta and downvoted by people who think I'm doing it for rep. Seems to happen in R a lot too.
 
I upvoted Aaron's answer without reading all of it, which is a bit irresponsible, but since it's Aaron we're talking about I'm willing to take my chances on that one
...editing an answer doesn't give you any rep, does it? O.o
 
@Aran-Fey In the cases when the posters of existing old, obsolete, highly-upvoted answers refuse to update theirs, what do we then do? On some occasions I had suggested adopting a different Q&A as canonical. Some people accused me of that motivation.
 
@PM2Ring So you want urls like https://t.co/CPYGRI9ttY to be automatically replaced with example.com before you submit your post? I'm not sure I see the point in that. Wouldn't it be easier to write example.com instead of https://t.co/CPYGRI9ttY in the first place?
 
The accepted answer to What does 'super' do in Python? is from 2008, very brief, and badly needs to go bye-bye.
Thanks for the opinions anyway
 
11:13 AM
It's brief, but still correct and useful. Deleting that would be a waste. It just shouldn't be at the top
 
@Aran-Fey Of course. But in this case, the OP linked to a file of sample Twitter data on Google Drive. I wanted to paste a few lines of their data into their question body. But I can't do that because their data is full of links like https://t.co/CPYGRI9ttY.
 
@smci If you're using an existing Q&A as the canonical, I don't see how people could have a problem with that. Unless they think the answers there are of a lower quality. If you're using your own Q&A as the canonical, then I guess it's reasonable to question your reason for doing so. I don't know what to do in that case. I recently asked a related meta question and got quite conflicting suggestions.
I think I'm probably going to try the "post a self-answered Q&A and don't care about the haters" approach sometime in the near future
@PM2Ring Gotcha.
 
@Aran-Fey Oh, good. :) And as I said earlier, there's no need to have a script that does it in the browser, it's simpler just to do it locally.
 
But... I already started working on it :( Look:
function replace_urls(post_text){

}

page.transform_answer_text_before_submit(replace_urls)
You want me to delete all of that? :(
 
Feel free to keep working on it. :)
We probably need to have a room meeting to formulate a policy regarding old Python 2 answers. Clearly, there's just too much stuff to fix it all. It would not be fun, and it'd take forever.
True, a lot of the Python 2 stuff is low grade that we can afford to ignore. Some of it is worth making minor mods to, either to make it compatible to Python 3, or to add a Python 3 solution. But in some cases, particularly when text vs bytes issues are concerned, that takes a fair bit of work, and new code would need to be written from scratch.
I think our prime targets should be high scoring pages with lots of page hits, especially those that have been used as dupe targets.
BTW, I just got an accept from CSV Tweet guy. :)
too broad / unclear stackoverflow.com/questions/50550476/… I don't want to discourage this guy, but it is too broad, and very unclear.
 
11:46 AM
Thanks PM2Ring and Aran-Fey
 
12:03 PM
Strange I can't find a canonical for BeautifulSoup how to find XML tag? although there are 127 results for BeautifulSoup get tag XML. Suggestions?
 
@smci Personally speaking, I am against CW - in my opinion it encourages the tragedy of the commons. Where lots participate, it still has the dryness of answer by committee. It works better for wikipedia because there's (supposed to be) one answer/article. I much rather see personally owned, curated answers.
 
There's still just the three of you here. Still Sunday.
 
@PM2Ring I intend to start moving the Python 2 material in my answers to the bottoms or striking it altogether in about a year.
For answers with unlabeled Python 2 material whose answerers refuse to curate them, critical comments and downvotes work well. Of course, labeling the material is also an option - they don't need to be CW for that sort of editing.
I'll probably the doing my transition edits sooner, actually.
If you stumble across one of my answers that needs a 3 update, please leave a comment!
1 hour ago, by smci
@Aran-Fey Because many times when I suggest improving/modernizing an old answer and using it as canonical, I get attacked on Meta and downvoted by people who think I'm doing it for rep. Seems to happen in R a lot too.
 
12:18 PM
@AaronHall Don't be too hasty, though. Some parts of the world move slowly. I just saw a question half an hour ago from a new learner who's starting on Python 2.6! stackoverflow.com/questions/50551752/…
 
@smci that's incredibly inefficient. You use your time more efficiently and get more rep if you just write your own answer. Just make it way better than whatever currently exists.
 
Back in a while. I'm busy re-writing some code...
 
@PM2Ring I'll be careful not to leave 2.6'ers high and dry - but they might have to read past the 3 sections first...
 
@AaronHall But it will get buried on "dinosaur" questions used as dupe targets with 20+ answers, with the top answers having scores in the high hundreds, or possibly over 1000.
:really gone:
 
@PM2Ring Yes, just like mine... :P
But they'll eventually rise...
eventually.
 
12:23 PM
I'm more worried about bad questions than bad answers. Dealing with a good question that has bad answers is easy. Dealing with an unclear question that's been interpreted 3 different ways by the answerers and is being used as a duplicate target is a lot harder
 
@AaronHall I agree with you, but I get all sorts of savaged if I propose anything that involves rep change to an existing highly-upvoted-yet-obsolete answer, or people accuse me of repjacking and downvote me. So, what to do.
 
@smci don't propose it.
 
@AaronHall so I learned, the hard way
 
Comment and downvote. And flag other comments that don't concisely communicate the criticism.
 
@AaronHall Making any kind of suggestion on Meta seems to descend into a gladiator arena or snarkfest... I welcome your critique of what i've posted on Meta
 
12:28 PM
"I downvoted this answer because it is obsolete and the answerer refuses to update the answer in spite of other comments that graciously suggested the right improvements".
@smci Here's a tip - just do the right thing on the main site, and you won't have to deal with incumbent stakeholder anger over your proposals that upset their apple carts.
If you do, your rep goes up, your knowledge goes up, your ammunition for downvotes goes up, and nobody's mad because you did it the right way.
 
@AaronHall Yes so I learned. Some denizens of Meta talk a huge amount but do very little constructive, but they get off on sniping at other people. Also they will happily comment on things outside of their area of competence. You ask about language A and you get "But we do it this way in language B"
 
I'm not very active on Meta, but I'm pretty sure some of the residents live in an alternate dimension :D
 
"parallel universe"
 
So to sum up, again, for an accepted outdated answer, 1) Flag comments irrelevant to the criticism. 2) Leave a comment that directly communicates the criticism, no sugar coating. 3) Downvote, and move on.
I've seen an accepted at ~100 upvotes go to 0 and ask for a mod to delete in less than a year.
 
Got it. Any wisdom on this recent interaction Relevance fail: Canonical question with 110 votes ranked second after obscure question with one vote and less generic wording? on pandas? All the bickering about Google was offtopic - the question was clearly about SO internal search
 
12:42 PM
Actually, that works for any accepted answer where the accept was a half baked assertion from 2008, the asker has abdicated for their part in it, and there are marginally better newer answers.
 
re-cbg
 
@smci yeah, don't use on-site search, I suppose. You can do site:stackoverflow.com search terms in Google if you want a better search, probably.
add subdomains as applicable...
 
@AaronHall Yes I already got the "on-site-search considered broken, cannot be fixed, don't bother giving reproducible examples". I'm not even convinced it's totally right, but either way I don't see why they didn't say that succinctly and politely instead of misrepresenting me with silly strawmen. My motivation was simply to help make SO suck slightly less badly.
 
ok, well I could also point you to the advice I gave you about arguing on meta. Do a stakeholder analysis: employees might think you're trying to make them look bad, some people probably take any site's on-site search being broken or poor as a given, people who use Google for SO searches wonder what you're complaining about. They're a sensitive bunch.
Unless you're strongly arguing for something everyone seems to want or at least that they don't view as hurting them, you're probably going to get your ideas shot down.
 
12:57 PM
@smci You need to operate very diplomatically if you want to get community support and cooperation. If you say "X is a problem, and to solve it A, B, and C must be done" then some people may agree completely straight away, and they may even want to offer assistance. Others will agree that X is a problem, but they need time to decide whether your plan of attack is correct.
And others will think you're being pushy and take exception to your tone on principle, so they'll just look for ways to disagree, primarily focusing on the flaws they perceive in your plan. So you need to approach things in a way that invites cooperation & collaboration. Eg: "It looks like X is a problem. And I think that doing A, B, and C may resolve it. Any suggestions?"
"some people probably take any site's on-site search being broken or poor as a given" I certainly do! Sure, I give the on-site search a try, but past experience has taught me to have low expectations.
 
@PM2Ring Ok but when I previously tried the less prescriptive way of suggesting, I get people arguing with the premise (without suggesting any alternative), attacking my motivation (rep etc.), telling me noone cares... anything but concise actionable responses.
 
> “Dost thou love life? Then do not squander Time; for that’s the Stuff Life is made of.” - - Poor Richard’s Almanack, 1746
 
@smci As I indicated earlier, there probably isn't much point in bothering SO Meta with problems relating specifically to Python. If they don't use Python they won't really understand the significance of the whole Python 2 -> Python 3 issue.
 
@PM2Ring True, but that also seems to be true of any question requiring much language or package familiarity. Look through my other posts.
 
> “Well done is better than well said.”
- Poor Richard’s Almanack, 1737
A lot of great wisdom here: fi.edu/benjamin-franklin/famous-quotes
 
1:09 PM
SO Meta is great for discussing very general stuff that affects the info on the whole site, or large sections of the user population. It's also good for very specific issues, like weird stuff happening to a particular question or answer, or a particular user. But for medium-scale stuff that is only of relevance to people following a particular tag like Python, it's not so good, IMHO.
@AaronHall Although I'm not American, I've always admired Ben Franklin. However, if he were alive today he'd probably get banned for sock-puppetry, due to his use of hundreds of pseudonyms. :D
 
@PM2Ring sock-puppets are allowed - doing stuff that you can't do with one account is banned (like voting for yourself)...
 
1:36 PM
Ben probably did a bit of dodgy sock-puppetry, but he mostly did it so that people wouldn't realise he was the dominant contributor to stuff he printed.
 
Yeah...
Now I feel like I should put my meta advice (about python2->3) in a meta answer. Maybe someone else could do it so that I don't have to?
It won't be accepted well, simply because people are impatient and want easy immediate solutions.
 
How so? It's your opinion.
 
Would someone like to do a quick timeit on a couple of Numpy answers? stackoverflow.com/questions/50552478/…
 
1:52 PM
Here's a relevant meta Q&A: meta.stackoverflow.com/q/348295/541136
 
Having all your code in a library is nice. I just wrote a complete userscript in 10 lines of code. I now have a "copy code to clipboard" button on every code block.
 
This is a more comprehensive Q&A, more generalized than 2->3 meta.stackoverflow.com/questions/272570/…
 
2:37 PM
stackoverflow.com/questions/50552896/… That's not unclear! But it's even clearer now that the OP edited the question.
 
opened
 
3:02 PM
Thanks.
 
3:59 PM
@AndrasDeak Speaking of late accepts, I just got one from Jun 27 '16!
 
Nice
 
4:17 PM
This OP must be using an obscure definition of "it works" with which I'm unfamiliar... stackoverflow.com/questions/50554094/no-module-named-astropy
 
They're probably saying that the installation didn't fail :P
 
I guess so.
I saw a classic "Lacks minimal understanding" Q a few hours ago. Luckily I was able to find a good dupe target pretty quickly. stackoverflow.com/questions/50551119/… I guess he didn't write that code, he just cargo-culted it.
I see Martijn's using the old "It's easier to write a new answer than to try and find a decent dupe target among the zillions that probably exist" approach. ;)
 
You folks who "remember having seen a dupe to that obscure question" and start looking for it for 15 minutes are really brave
 
After a while you develop a knack for finding the dupe targets you've seen before. Or you stash links somewhere handy. If I find myself starting to swear at Google, I give up. :)
 
I can never be as mad at Martijn's answering obvious dupes as I should be, because the quality of his answers just makes it worth hammering the other way round
 
4:31 PM
Hi
 
One of my secret weapons when all else fails is to include "Martijn" in the search string. That tends to guarantee that I'll get a good quality answer.
@Aran-Fey True. Note that he hasn't got any votes on that answer, though.
Greetings, @marmadukeandbob
 
Wow. All the top results for "split string twice" are similarly unclear garbage as that question
 
And that target even has an eval answer!
 
Very proud of myself for finding that question :D stackoverflow.com/q/50554305/2301450
 
@vaultah Wow. Twinsies.
 
4:44 PM
But really, a general "split on 2 delimiters" isn't really appropriate when the question is about splitting on newlines then on spaces, since Python has features designed to handle that specific very common case.
 
@vaultah how was the exact same code posted 4 years apart? Is it some tutorial somewhere that displays that error?
 
> Hi I'm a beginner working with code academy.
 
I feel like I've asked this question just recently, but do we have a dupe for "I iterated over a list and tried to use the value as the list index, so now I'm getting an error" kind of questions? Like for x in lst: lst[x]
 
So this is code they found there, not code they wrote?
 
@Aran-Fey yeah we had that, and there was a dupe for it I think
 
4:50 PM
I answered a Tkinter threading question yesterday. The OP liked my answer, but then he chameleoned on me. But at least he gave me an upvote & accept first. And the required modification was pretty simple. Or so I thought. But when he saw the new version it turned out we'd had a communication problem, and what he really wanted was a bit more elaborate, and it took me over half an hour, and some major structural changes to make it do what he wanted. I hope I've gotten it right this time...
@Aran-Fey I feel you have to. I can't remember if I found a good dupe target, or decided they were all rubbish. :)
 
May 5 at 13:15, by Andras Deak
In need of a good loop-over-values dupe, I found a mediocre one https://stackoverflow.com/questions/50189756/python-simple-if-elif-mismatched-re‌​sult
May 5 at 15:15, by Andras Deak
@PM2Ring I found https://stackoverflow.com/questions/37619848/python-loop-list-index-out-of-range for the iterating-over-values problem
I think that's the best I had found
 
Thanks
Maybe Martijn's gonna like this dupe...
 
To get to 650k rep, how did they do? Get 200 rep literally every day since the beginning of times?
 
usually more
 
isn't 200 the max?
 
5:02 PM
only from upvotes
bounties and accepts can go above
 
ooooh!
Regardless of the order?
 
I'm not sure, it's possible that if you reach 200 earlier than you won't get more upvote rep
I.e. if this is the case: 200 from upvotes then an accept leave you at 215, accept then 200 from upvotes leaves you at 200.
I've only hit repcap once four times, so I'm not an expert
 
@PM2Ring - for your timing request, i get Mr T's answer twice as fast as yours.
 
please see sopython.com/wiki/… for code formatting in chat, and practice in the sandbox if necessary :)
 
I am so sorry
 
5:14 PM
how about doing what I said the first time and practice in the sandbox?
 
@AndrasDeak I am going to to that.
 
thanks
 
@wwii Wow! Thanks.
no MCVE / too broad stackoverflow.com/questions/50554544/… If this OP is trying to do some cracking, I don't think his target needs to be too concerned. ;)
 
5:33 PM
Hey, I'm trying to bind my left click to do a function where it'll check if the coordinate it clicked at is within this border. canvas.bind("<Button-1>", lambda event, arg=data: self.linePress_check(left_pt1, left_pt2.x left_pt1.x, event))
I've never worked with lambda functions before so im not sure how to implement them to work here
 
Aren't you missing a comma between left_pt2.x and left_pt1.x?
@Chenny would it help if you tried implementing it with proper functions?
 
oh, yeah thanks, but it still doesnt work
What do you mean?
I'm using tkinter btw
 
def callback(...):
    ...

border.canvas.bind("<Button-1>", callback)
whatever you can do with a lambda you can do with a proper function (and more)
 
Oh so this function, I want to be able to pass in some coordinates
like the x and y and check if its within there
 
5:36 PM
you just need to look at the docs to see what that callback will be passed when it's called, and just define your function accordingly
 
Sorry I don't understand
 
tkinter should tell you what arguments it passes to the callback; in your lambda example you assumed it gets passed an event and something you call arg
if that's correct you need to define def callback(event, args): ...
then if you want to bind the value of left_pt1 during function definition (rather than on function call), you'll need to pass def callback(event, args, left_pt1=left_pt1, left_pt2=left_pt2) to achieve that
>>> x = 42
>>> def foo_late_binding(): print(x)
...
>>> def foo_bind_on_def(x=x): print(x)
...
>>> foo_late_binding()
42
>>> foo_bind_on_def()
42
>>> x = -1
>>> foo_late_binding()
-1
>>> foo_bind_on_def()
42
what I'm talking about ^
the first function always uses the current (nonlocal) value of the name x at the time the function is called, the second function binds the value of x as a local name when the function is defined
you'll need to understand the difference and figure out which one you want in your callback for the variables that aren't explicitly passed during the call
 
Oh so when I define the function, I need to set that variable equal to what i want in the parameters
 
if you want the value to be set when you define the function rather than when it gets called later, yes
of course you don't need to use the same name inside your function, but this is a typical pattern
 
Oh i want the value to be when its called
 
5:48 PM
OK, then what you had with the lambda should be better
 
so when I click, it'll check the value of the left_pt1
 
yup
then you have to start debugging and explaining how it "doesn't work"
that being said I'm leaving for a while, but if you want help you'll have to give that info anyway
rhubarb
 
okay
o/
 
sum1 = int(input())
sum2 = int(input())
def addition(sum1, sum2):
    if (sum1 + sum2 >= 7):
        print('Good')
    else:
        print('Bad')
print(addition(sum1, sum2))
When I run this code,
I get
8
9
Good
None
Could some body explain why None appears?
 
Your function doesn't return anything. Functions that don't return anything implicitly return None.
>>> def f():
...  pass
...
>>> print(f())
None
 
5:56 PM
@Aran-Fey Thank you!
 
00:00 - 18:0018:00 - 23:00

« first day (2780 days earlier)      last day (2168 days later) »