« first day (2917 days earlier)      last day (2014 days later) » 

4:00 PM
@jpp yeah I reflected on that when I looked again, I need to improve my verbal components on my solutions, noted and will be improved in future cases
ty
 
jpp
Also you should start using f-strings, they're better :)
 
@jpp I was for the longest, then I got a lecture on how its not viable for people on 2.7 and not everyone is using f-strings yet, i love f strings
 
who gave the lecture?
 
@vash_the_stampede The usual way to do that with Counter is like this:
from collections import Counter
lst = [('a', 1), ('b', 2), ('a', 3), ('b', 1)]
c = Counter()
for k, v in lst:
    c[k] += v
print(c)
 
unless the question is tagged you should go ahead
 
4:06 PM
hmm someone with like over 50k for sure , I woulndt have modified my ways if not but cant recall thsi was early in my SO career
 
Here's a silly one-liner:
sum((Counter({k:v}) for k, v in lst), Counter())
 
good i missed using f strings they are so clean
see! PM yes! you are the man I swear time and time again you come through
 
For production-quality code I wouldn't call sum on anything other than a collection of numbers.
 
holy cow im in love with solution you can then do sorted(d.items(), key=itemgetter(0) it works so well
stackoverflow.com/questions/52759073/… thsi was the problem i wanted to apply it to, im updating to include this you rock
 
Passing a non-scalar in as the default value for sum() tends to give you non-optimal performance
It's basically a party trick. There's a reason that CPython explicitly detects and forbids you from doing sum(["a", "b", "c"], "")
 
4:13 PM
break this down real quick if you could waht is happening what is happening in the second part of sum Counter()
 
@Kevin Agreed. That's why I said it's silly: it's a Shlemiel the Painter algorithm
 
It's effectively equivalent to:
x = Counter()
for k,v in lst:
    x = x + Counter({k:v})
For a list of size N, you're creating N intermediary Counter objects of gradually increasing size, which usually implies O(N^2) runtime
 
That is cool , what is more efficient that or the groupby path
defautldict would be most efficient correct?
 
@vash_the_stampede My 1st version is definitely more efficient than the silly one-liner. And it's better than sorting & using groupby, because it avoids the sorting step.
 
Defaultdict is O(N), sort-and-groupby is O(N log N), sum-of-counters is O(N^2) (worst case). So defaultdict is best.
 
4:17 PM
got it ty
 
defaultdict(int) is slightly faster than Counter, and it's a couple of bytes smaller (one pointer). But as Martijn pointed out a day or so ago that you have to be careful when using defaultdict(int). See chat.stackoverflow.com/transcript/message/44210432#44210432 and the following posts.
 
@PM2Ring defaultdict(int) would be nonsensical to me
 
jpp
There are certain people (no names) who will downvote any answer which uses Counter in an explicit for loop.
It's certainly a lot slower than defaultdict(int) in such a case, but where they are interchangeable complexity is the same. So I wouldn't be so harsh.
 
I've only ever used defaultdict when I'm using a container e.g. list or dict. int leaves me confused :)
 
@jpp Really? OTOH, I'd probably downvote an answer that modifies a counter as a side-effect in a list comp. Unless it was an example of what not to do. :)
 
4:24 PM
@Kevin Added the code: blackthunder01001.github.io/Numbairy . The code might be difficult to read but .. who cares. Repairing and simplifying it is a very boring and time consuming task.
 
Do we have an existing dupe for questions about class fields vs member fields? This is a current question that I'm looking at: stackoverflow.com/questions/52764822/…
 
@vash_the_stampede In stackoverflow.com/a/52763481/4014959 you should get rid of that stupid sum((Counter({k:v}) for k, v in lst), Counter()). And it's better to call sum on a gen exp than a list comp, since sum can add the numbers as they're generated. So instead of sum([i[1] for i in g]) you should do sum(i[1] for i in g)
 
Am I out of a loop here? Is it normal to put scripts into site-packages? stackoverflow.com/questions/52764884/…
 
@roganjosh I have experimented putting scripts in Lib.
It works.
Not sure about site-packages
 
Oh, I know it will work
It's just putting stuff onto your PATH
But I'm not sure it is general/good practice
 
4:38 PM
Oh my god those comments
site-packages, Lib, wrong dupe, bad edits
All in one comment section
 
I've rolled back the edit
mad_ is starting to irritate me
 
yup
are they making you mad_?
 
Very
 
yam, I thought I already had :/
Now it's closed
I was getting distracted by all the other tripe going on
 
4:50 PM
@PM2Ring updated!
 
@vash_the_stampede You still have sum of a list comp in the last example.
 
@PM2Ring I changed it to a generator like you said
double check
 d = {k: sum(i[1] for i in g) for ...
 
@vash_the_stampede The very last line is d[k] = sum([i[1] for i in g])
 
oh the expanded I didnt update
 
:)
 
4:55 PM
on other news that made me happy
i got to use cycle and next with iter for the first time today
when all this time i never could realize what i would use cycle for
 
jpp
@PM2Ring I'm seeing the generator overhead is more expensive than list comprehension for small lists, the crossover is around 10**4 for me..
n = 10**4

%timeit sum([i for i in range(n)])  # 569 µs per loop
%timeit sum(i for i in range(n))    # 850 µs per loop
 
@jpp there is a crossover?
 
@PM2Ring "she" based on just "deb" might be a bit too speculative in my opinion
 
jpp
yep, 10**5, generator comp wins
 
@jpp Wow! Ok. Now you mention it, I've probably done that timeit test myself at some stage... :)
 
4:57 PM
Everyone join me in the "just use generator expressions all the time because it saves two keystrokes" camp, the weather is fine
 
jpp
@Kevin, Haha, I still favour gen comp
 
@AndrasDeak Perhaps, but Deb is in Texas, so I think it's a reasonable guess.
 
jpp
people forget (me especially) that generators actually have quite a bit of overhead
 
Or that, in things like join, they get expanded out into a list before work can be done on them
 
jpp
gen comp still better. The small performance difference is negligible for small lists, and you have better memory usage
 
4:59 PM
so generator it is ?
 
You're gonna have to prove that to me
 
@jpp in which case memory difference is also negligible
 
In the case of join
 
jpp
@AndrasDeak, My point is for small iterables it doesn't matter. For large iterables, memory becomes important, and performance for gen comp is better.
 
5:00 PM
one of my favs generator ♫
 
I don't know what a gen comp is and at this point I'm afraid to ask
 
a genexp, but rebranded
 
jpp
@Kevin, There are some good canonicals.. on SO.
 
Here are some sum of list comp vs gen exp tests, but on fairly small collections: stackoverflow.com/a/28584157/4014959 The list comps are about 10% faster
 
Gen Comp: Generation born after 2000 that know Python and not Excel
 
5:02 PM
@jpp your assumption that he's unfamiliar with the concept is amusing
Jul 12 at 20:43, by Andras Deak
Nice: Python docs will change “generator expression” to “generator comprehension” https://mail.python.org/pipermail/python-dev/2018-July/154554.html (I advocated for this two years ago: https://nedbatchelder.com/blog/201605/generator_comprehensions.html)
 
jpp
@AndrasDeak, I don't like this idea
 
But you were just using the term?
 
the amusement never ends :P
 
jpp
@Kevin, I guess I was. But shouldn't have. You knew what I meant :).
 
Groucho Marx: I sent the club a wire stating, PLEASE ACCEPT MY RESIGNATION. I DON'T WANT TO BELONG TO ANY CLUB THAT WILL ACCEPT ME AS A MEMBER.
 
5:05 PM
My first guess using context clues was that you meant generator expressions, but I've touched the electric fence of Assumption one too many times to leap to a conclusion
 
jpp
So list(x for x in y) will be a list of a generator comprehension.
Or, as some call it, syntactic sugar for a list comprehension.
 
@Kevin meh, pandas people are weird
@jpp except it isn't
 
jpp
@AndrasDeak, Yep, if you followed my meta, you'd know I made a fuss about this.
 
I don't think I did
I open python-specific meta posts and then I close them quick
 
jpp
It revolved around a very highly upvoted comment on a canonical with that statement.. meta.stackoverflow.com/questions/373233/…
 
5:07 PM
Hmm. Is there a situation where list(x for x in y) and [x for x in y] would have different results? regardless of efficiency.
 
jpp
I personally think if we really want to improve SO we should improve canonicals. Thankless task, though. No rep.
 
I saw that when it was new
you probably nudged Martijn here or there if I recall correctly
 
jpp
Yeh I commented / flagged / pinged / etc
 
@Kevin I don't think so, but "regardless of efficiency" makes all the difference. I'd expect "syntactic sugar" not to affect performance
 
jpp
But it's a -8 on Meta, so lost cause.
 
5:10 PM
nobody but Martijn can fix that comment, so if he won't then it's already a lost cause
 
@jpp list(x for x in y) is definitely silly. It gives you the extra overhead of the gen exp, and it doesn't get the speedup of listcomp's LIST_APPEND bytecode.
 
@jpp this is my Achilles heel. Help me find a dup target please stackoverflow.com/a/52765540/2336654
 
jpp
@PM2Ring, Yep & Martijn would agree with that too. As would we all. But that comment generated a question 2 years later.. stackoverflow.com/questions/30096351/…
 
And just in case you're wondering... yes, I have many heels.
spelling being another
nvm, OP deleted
 
@jpp I've already upvoted that question (and user2357112's answer).
 
5:15 PM
I do not understand why this answer keeps getting upvotes. This seems to me to be an absurd task. But people keep searching on how to do it and finding my answer. stackoverflow.com/a/38862389/2336654
 
Deb updated the question. She didn't change the indentation, but she added a function call to the code block, and in the updated text she claims there was no error message.
 
so still no MCVE
 
wim
5:32 PM
@piRSquared yes but it's not easy
 
That's what I was afraid of
 
Aran said as much
 
he did /nods_in_agreement
 
I enjoy toying with things that man was not meant to know, so I would like to see this now.
Does... Does it use ctypes
 
@Kevin are you rubbing your hands together with back slightly hunched forward and neck slightly craned?
 
5:41 PM
no
 
I'll keep pretending then
 
>:D
 
Umm... stackoverflow.com/questions/52765896/… - wonder what's inspired them to use ord() there...
 
wim
@Kevin No
It involves an ast.NodeTransformer
 
Nice and portable, the best kind of black magic
 
5:43 PM
@Kevin You mean not including the line before it saying list = set or similar? :p
@wim Sweet... ast doesn't get enough love... ;)
 
@wim isn't that functionally equivalent to just editing your source file on the fly?
 
wim
Hm, not really. It's adding another moving piece in between parser and compiler.
actually relatively legit. probably the most commonly known example is pytest's assert rewrites.
 
Huh? I just noticed that I got a downvote yesterday on this 2 year old answer (when I was still fairly new to Python 3): stackoverflow.com/a/39617185/4014959 I just added a better answer, but I don't expect the downvoter will notice. And I guess it might've been a random revenge downvote, rather than someone who thinks my original answer is bad.
 
@wim I can imagine that
 
wim
@PM2Ring I'm not the downvoter, but the hard slice to 2 is pretty lame
 
5:49 PM
Thankyou, anonymous upvoter. :)
 
jpp
@PM2Ring, I'd also suggest the question can be edited to be made a little more intelligible, e.g. no quotes for code.
 
@wim Why? We don't know what the data looks like in general, but I think it's fair to assume that it begins with a single big-endian unsigned 16 bit integer.
@jpp Good idea.
 
wim
Don't think that's a fair assumption from the question as written (at least not without mentioning the assumption)
OP must specify exactly how "a string and its length" is encoded, not just give one example.
 
@wim I did mention the assumption: "The length data looks like a big-endian unsigned 16 bit integer, and the string data looks like it's using the Latin1 encoding. If that's correct, you can extract it like this:"
@wim I guess it could also be encoded using cp1252, so I just added some info about that.
 
wim
So you did. My bad.
blatant copy of accepted answer 8 years late here
 
6:06 PM
if it's a blatant copy you can flag for plag
 
wim
not that blatant
the original code is from itertools docs anyway
so funny that that question is on +37 and almost exactly same question is on -29 ... WTH
 
that must have been some meta effect
This question is not too broad. It's also being discussed on Meta: meta.stackoverflow.com/questions/283177/…George Stocker ♦ Jan 11 '15 at 13:49
meta + George Stocker == fire
anyway, enough garbage
 
wim
ah, yep. that would do it. THE HOUNDS.jpg.
 
@AndrasDeak It's not exactly plagiarism. The author said "from docs.python.org/3.6/library/itertools.html";, but then they have "Author: joltE", although they only wrote a generic listcomp to turn the tuples generated by combinations into lists. I'd prefer to view it as clumsiness of attribution rather than downright plagiarism.
 
wim
put this CPython PR after answering a SO question (linked in the PR text) awaiting core dev review. I'll give it about a 30% chance of being merged...
 
6:41 PM
@vash_the_stampede [(line.strip()).split() for line in f] can be written as [line.strip().split() for line in f]. But since you're using the no-args form of .split() you don't even need .strip, since .split() will drop all the whitespace anyway. So that listcomp becomes [line.split() for line in f]
 
@PM2Ring reference link to this
 
stackoverflow.com/a/52727874/4014959 I'm finally getting around to looking at it. :)
 
I know the solution you are referring to I recall it
OH that one haha my baby
yeah I overkilled that fixing thank you for looking at it btw like i said i dont have people in my circles that could be like oh thats cool or this or that, etc so it was nice to share ty
 
When you do something like zip([keys]*len(content[1:]), content[1:]) Python isn't smart enough to optimize the content[1:], so it actually builds that slice twice. That doesn't matter much here, since content is tiny, but it would be dumb if it had a million items in it. It's cheaper to just do len(content)-1
 
ohhhh okay I see I see makes sense
 
6:47 PM
assignment expressions will save us from this dilemma... Once it's released :>
 
>:(
 
its cool like you guys are super into memory efficiency and know all about it and it plays a huge role in your solution path, im catching on like somethings i know now are better off outside of my list comprehension etc, but yes i see now creating a slice there is no good
 
that's not particular to list comps; you'd do the same thing in a regular loop
 
I don't think we're overtly concerned with memory efficiency
 
@PM2Ring overall though not bad right the concept i went for haha that was first time i did anything like that
 
6:50 PM
In some contexts, there are things that are _similar to content[i:j] that just gives you a reference into the existing object, so you can create such views cheaply. But that doesn't apply to plain Python lists.
 
@roganjosh is that sarcasm everything in here boils down to some converstaion about O(n)
 
@roganjosh that'd explain the absence of sausage rolls then :p
 
waste not, want not
 
@JonClements what sausage rolls? :P
<segfault>
 
</segfault>
 
6:53 PM
What were we talking about again? Moon landings?
 
@vash_the_stampede I'll have a discussion about speed but generally I don't care too much about memory. It wasn't sarcasm. I'm just used to having to have solutions "instantaneously" for end users
If Joe Bloggs could just wait more than 0.25 seconds for a list of options, that'd be great
 
wim
ooh new atlas video
 
O(N) can refer to both speed and memory. In the absence of additional context, it more often refers to speed.
 
@JonClements you seem in rather good spirit today haha
@roganjosh i got you
 
6:58 PM
@JonClements what have you just subjected me to?
 
@roganjosh yeah... rathergood is a bit old fashioned now...
 
@JonClements reminds me of the era of this. And Burnt Face Man and Salad Fingers
 
Salad Fingers!
talk about nostalgia
I like it when the red water comes out
 
But first... I must caress this rusty spoon
 
recbg
 
7:11 PM
umm... Now strangely reminded of the short lived series on BBC2 (I think) called "Stressed Eric"... :)
 
Some of the episodes I linked to I haven't seen
"Never before have dead bodies been so manageable"
@JonClements recently I revisited Brass Eye. I was not disappointed.
 
@AndrasDeak I shouldn't have mentioned Salad Fingers. Went out for a cig and what popped in my head was "Ewww, Hubert Cumberdale, you taste like soot and poo" :P
 
@vash_the_stampede If I was answering that question without the CSV module, I'd read the data like this:
 
I can't remember the names of the other 2. Was there Marjorie?
 
7:24 PM
content = [row.split() for row in data]
keys, *content = content
string_keys, subjects = keys[:2], keys[2:]
students = [{k: v if k in string_keys else int(v)
    for k, v in zip(keys, row)} for row in content]
And I'd process it like this:
for d in students:
    valid = [v for k, v in d.items() if k in subjects and v]
    try:
        mean = sum(valid) / len(valid)
    except ZeroDivisionError:
        mean = "No subjects"
    print(d['Name'], mean)

for k in subjects:
    valid = [d[k] for d in students if d[k]]
    try:
        mean = sum(valid) / len(valid)
    except ZeroDivisionError:
        mean = "No students"
    print(k, mean)
 
recbg
 
@PM2Ring can I save these messages ? i just copy them and save them but does chat have a built in save message
lol I cant believe you are still looking at that btw hehe
 
@vash_the_stampede No, chat doesn't have a save feature. But everything is archived in the transcripts.
@vash_the_stampede I got distracted by a few other things. :)
 
i have a folder called pm2ring
lol best reference
 
... gotta ask. Where did PM 2Ring, as a name, come from?
 
7:29 PM
i dont know if you want the answer to that
 
Oh but I do
 
May 12 '17 at 13:21, by PM 2Ring
@MarcusS It's in homage to A M Turing.
 
Ahh ok. Being a Mancunian, we have a tribute to Turing
They use the garden each year on gay pride for the vigil and there's a monument of him in the park
 
So it's A. M. Turing, but 12 hours later?
Aww, the time difference between England and 'stralia is only 10 hours. So close.
 
@Aran-Fey gets closer when our clocks change for daylight saving
 
7:39 PM
Uuuuh sanity check: git diff foo.py master:foo.py should "work", right?
nevermind, git diff HEAD master foo.py works
 
@PM2Ring Could just do: keys, *content = (row.split() for row in f) to start with there I guess...
 
@roganjosh Here's a pretty good photo from Flickr of that Turing memorial
 
@PM2Ring It's my city and I've also been to the vigil :)
 
speaking of famous programming persons , everyone here seen imitation game correct
 
@roganjosh Excellent.
 
7:49 PM
also one more question, obviously there are smart people but exactly how smart are these people that create the programming languages, who decided to create these functions and recognized that they would be needed and are comonly usd
 
This smart > <
Oh, man, they could have devised chat better to allow more than one space. Trashed my joke and made it an insult :/
 
@vash_the_stampede I'm ashamed to admit that I still haven't seen The Imitation Game. But I did read Andrew Hodges' Alan Turing: The Enigma when it was still fairly new. FWIW, Hodges was a PhD student of Sir Roger Penrose.
 
It's not like Python emerged into the world fully formed. Maybe 90% of the built-in modules weren't "yes, with my timeless wisdom I foresee that my users will require a Counter object" but rather "aah these jerks won't stop bugging me to implement a histogram, I'll put it in the next release if it buys me a second of peace"
 
@PM2Ring im saying these people are at the peak of intelligence across the board correct, just using python I'm amazed at what must be underneath and watching this devcon on the history of programming
its incredible
 
I...just realized that the weird behaviour I've been seeing in our code is probably due to my not actually fixing a bug when I thought I fixed it more than a year ago :'(
 
7:55 PM
@vash_the_stampede people specialise in things. There is some incredible thought and talent behind Python, but it's no different to any other profession
 
@vash_the_stampede What Kevin said. Generally, people don't design languages in a vacuum. They are familiar with earlier language designs, and the tools that are available to help with the tasks of creating a grammar and a parser for it. And it's not just a matter of being smart, there's an aesthetic component involved in language design. So a good language designer is also a kind of artist.
 
Peak of intelligence, PHP exists as a language. Pick one
 
@PM2Ring last question, okay so everything is built ontop of something else, like python is built ontop of something underneath it correct? is there any next level that is being built on top of current languages ?
 
KevinScript, natch
 
Well, yeah
There's drag and drop programming games for kids that are built in Python
I'm not so sure you can go much higher level than Python before things become a bit esoteric
 
8:02 PM
Some of the early languages were pretty clunky by today's standards. But at the time they were amazing. The creators weren't able to leverage an existing body of work or knowledge. And they had to write compilers or interpreters that ran on a tiny amount of RAM. So people like Grace Hopper are justifiably considered to be legends.
 
Rear admiral
 
youtube.com/watch?v=Tr9E_vzKRVo yes shes mentioned in here and well worth watch if you have time
but probably nothing you dont already know
 
yes, we know all
 
that's news to me!
 
8:35 PM
@roganjosh umm... think that OP is after something like: s = 'PYTHON'; new_string = s + ascii_uppercase.translate(str.maketrans('', '', s))
 
@JonClements I think they're probably after a proper encryption library and chose a poor example
@JonClements asked for clarification in another comment.
@Aran-Fey damn you're fast at dropping CAPS
 
one word: userscript :P
 
@roganjosh No, that's a fairly standard key generation technique for a simple substitution cipher.
 
@PM2Ring stackoverflow.com/questions/52768451/… Does it apply here?
I was, admittedly facetious in my first comment
 
@roganjosh Yes. You just need to drop the letters from the alphabet that occur in the key word. And drop dupes from the keyword itself.
 
8:50 PM
@PM2Ring the point is lost on me sorry
 
We get tons of questions on substitution ciphers. They're good for coding exercises. Sure, they're easy to break, but who cares? :)
 
It's literally just tagging the uppercase alphabet on to a string
 
wim
got a tumbleweed here, 38 views... anyone feel like taking a stab at it? Why would you execute code in a local scope just to update the global scope?
 
@roganjosh nope - it's adding the letters not in the string to the end of the string...
 
@JonClements ... OMG
 
8:52 PM
more obvious in:
>>> s = 'THEQUICKBROWNFOXJUMPED'
>>> s + ascii_uppercase.translate(str.maketrans('', '', s))
'THEQUICKBROWNFOXJUMPEDAGLSVYZ'
 
I've totally misread the question, sorry
 
although as @PM2 mentions - probably want to remove dupes
 
Or without using translate to do the deletion:
from string import ascii_uppercase
keyword = 'PYTHON'
key = keyword + ''.join([c for c in ascii_uppercase if c not in keyword])
encode = {u: v for u, v in zip(ascii_uppercase, key)}
You just have to make sure that keyword doesn't contain duplicated letters.
 
@wim (speaks up from the back of the room) Isn't that the sort of question that will elicit opinion based answers?
 
wim
9:09 PM
@W.Dodge No
 
whats the most sophisitcated quesiton that has been asked on SO, or narrowed down to just python on SO
by that I mean a question of lvl on few users could answer
 
I have a few unanswered ones about CPython internals/implementation details...
 
"only a few users could answer" is a very bad fit for stack overflow
I prefer simple questions with epic answers
 
Yes im saying if someone like aran asks a question the population taht could answer i would assume would be narrow
there are questions like this that exist that have limited responses based on who could even answer
wow nearly 300k for one answre
 
less because rep cap
check out the answerer's profile as well, worth a read
 
9:17 PM
already there
i wish i had infinite life so i could learn everything time is so limited
 
You don't need an infinite life, just a brain like Martijn's that somehow remembers everything
 
wim
You just have to look at the questions from high rep users
Because they can usually answer their own questions, unless it's something extremely esoteric or difficult
 
Coding is only a human construct, after all
 
@roganjosh I decided to write an answer for the hell of it, even though the OP hasn't shown any effort or responded to your comment. Oh well, I guess I can always delete it if it gets too many downvotes. :)
@wim A question from Raymond Hettinger would be scary. :D
 
wim
@user2357112 you could improve your answer by answering the question
("no, it's not different from executing the code at the global scope")
 
9:29 PM
@PM2Ring I've commented on a few of his answers saying: "umm... interesting approach - wouldn't it be better if you did..." and he's edited them and commented back saying: "oh yeah... you're right" :)
(although in their case it's more a case of that they've forgotten something rather than didn't know something to start with :p)
 
Raymond Hettinger is clearly a smart guy but I do find his presentation patronising
 
Hettinger's favorite question is "Who learned something new?", and that's easy to answer :P
 
wim
I had already found the same commit btw. Wasn't really sure what to do with the Q when I realised there wasn't actually any good reason for this code.
 
Has anyone watched Jon Skeet present?
... hand puppets
 
@roganjosh yeah but he could only be superior in so many categories, for instance what is the extent of his knowledge on beach volleyball
 
9:34 PM
I watched his thing at SO HQ in NY... got massively distracted by those trousers though... :)
 
there too many subjects to learn in one lifetime and master for anyone :( terrible fate for us all
 
@vash_the_stampede you could probably die happy not knowing Astrology
 
often confused with astronomy
 
@wim: It seems like deleting or self-answering would have been reasonable options.
Anyway, answer expanded.
 
@JonClements Cool! I've commented a few times, and I even got a response once, IIRC.
 
9:38 PM
The confusion acts as a good filter on who is worth talking to
 
@PM2Ring also engaged with Tim Peters and Mark Dickinson a few times as well
 
Unless I'm getting confused with Tim Peters...
 
wow good point I filter women who are compatible with me with very abrupt socially unacceptable statements, it narrows the field down quick and works like a charm hahaha
have a great evening all, will be back later going to go explore whats going on in my brain :)
 
night
 
@PM2Ring umm.... any reason to not use str.translate in your answer to that Q - since it's dealing with characters which it's supposed to do, then you can avoid the .get(c, c) thingy...
If you were building something up that wasn't a character->character mapping then it'd make sense...
 
9:53 PM
@JonClements Using .translate would be too easy. :) And this is probably homework, with silly restrictions on what methods can be used, so I did it using basic stuff.
 
fair enough :)
Is used = {' \n'} checking they're paying attention or meant to be {' ', '\n'} ?
 
@JonClements Oops. I better fix that. It's an artifact of a previous version that passed a string to set
I should know better than to post answers when I'm falling asleep. :)
 
Hoping to be doing the same myself in a little bit... touch of insomnia recently though... sighs
 
have some lavender tea or something
 
The earlier version had used = set(pass_phrase).union(' \n'), but then I realised I couldn't build the key string using that. :)
 
10:07 PM
@Andras ugh... sounds yucky :)
 
wim
@PetterFriberg FWIW, here's my personal collection of python duplicates so far. — Aran-Fey 7 hours ago
^ anyone mind mirroring that to dpaste or somewhere else?
or gist
 
@Aran-Fey Thanks. Does that contain the canonicals from the room 6 collection?
 
Probably not all of them
Actually, not even close
I never realized how many questions there were in that list. 118!?
 
10:23 PM
time to implement multiple import protocols ;)
 
That collection is ok, but it's certainly not perfect. Some of the questions have multiple suggested targets that may be applicable in different circumstances, or because new targets have been added and there was no good reason to remove the old one, just in case it could be useful.
 
Am I missing something ^^^? How should I be reading that data?
 
And of course there are some old targets that are ok for Python 2, but not so useful for Python 3. But we still need them for Python 2 questions.
 
wim
the list on SOPython is really bad
do not wholesale dump it into your collection, pick and choose carefully.
 
@wim feel free to suggest edits if you want?
 
10:30 PM
@JonClements Just paste it into the "import" dialog located here i.stack.imgur.com/EZFmR.png
 
um... I don't see that?
oh - it's a userscript fine...
(sorry - completely missed some context there)
 
context is pinned ;)
 
mumbles something... mumbles some more :(
 
wim
human browsable version dpaste.com/02DKEV7.txt
 
Don't feel too bad. I only pinned it a few minutes ago.
 
wim
10:38 PM
@JonClements just make the page(s) editable
suggesting edits and waiting for someone to care enough is not fun
 
@wim we're still talking about sopython here yeah?
 
wim
yeah
anyway the userscript looks like a better way of managing this stuff than the website
 
@wim For sure. I wouldn't call our collection bad. It's definitely better than nothing. I often get useful targets from it, although most targets I find using Google. Although Google can be a PITA when dupe hunting because it seems to give such a high priority to titles, and to keywords in the question, rather than keywords in the answers.
 
wim
@Aran-Fey where is the storage for the dupes list? I suggest to put it in some collaboratively writable db
 
It's local to everyone's browser. I can't query a remote DB every time you open the close dialog
 
10:45 PM
Aran-Fey's userscript is for general use, though. It's not just for Python, so different users will have different dupe lists.
 
I guess I should add a feature that lets you import additional questions into your collection (rather than replacing the whole thing)
 
Also it would be suboptimal to have all the gold badgers collide. Most closures are tag-specific
heck, all of them are
 
wim
@Aran-Fey why not?
 
@wim as @PM2Ring says - it's not perfect but it was an attempt (similar to what Aran-Fey is doing now) to at least try - don't knock it so hard please :)
 
And even different Python gold badgers will want custom lists. I don't need Pandas dupes because I don't know Pandas, and am extremely unlikely to hammer Pandas questions. Conversely, someone who ignores Tkinter won't need Tkinter dupes, but I do.
 
10:49 PM
@wim Hmm, I guess I could, huh? I honestly expected the data to grow faster. We're looking at what, a few dozen kilobytes? That's manageable
Problem is, I don't have a remotely accessible DB
 
wim
If the idea is for people to work together, then they need this feature so people can access eachothers lists too
and dupes that are on many peoples lists should get a higher rank
@Aran-Fey this is not much data and would probably be within the free tier of AWS
 
I'm pretty sure Aran intended this as another tool to help one's own work easier, not to create a social network for closing dupes
 
@wim but what's to stop someone just polluting that DB with crap?
 
wim
auth
 
What Andras said. I have no plans of turning this thing into a social network
 
10:54 PM
that really makes things more awkward script side and doesn't actually answer the actual question I asked :)
 
wim
don't think that's awkward
projects like adblock work the same way
 
How would this auth work such that no one can just put misleading crap in it?
 
wim
whoever is db admin can grant/revoke credentials
 
note that there are even confused gold badgers
 
wim
OK I just installed the script
how do I load your data into my local storage
 
10:58 PM
navigate here, click "import", paste the JSON dump
 
@wim sure... in signs of abuse but if no-one notices before then you've got a database serving out duff data and then someone has to go in and clear it up... really can't see how it's practical...
 
wim
ah ok, on user profile page
 

« first day (2917 days earlier)      last day (2014 days later) »