« first day (2911 days earlier)      last day (2040 days later) » 

2:00 PM
s/to/too/
 
@Aran-Fey Agreed. Neither of them are great dupe targets, but Andrews answer(s) are worth linking.
 
Mmmm, I'm not a fan of linking to specific answers. Who knows, someone might write a better answer in the future. I'd much rather link to a related question
 
@Kevin Ah. Been there. Phone left in attic. And a machine under a carseat.
 
Fair enough
 
Anyone can lose a laptop. But losing a desktop...
 
2:07 PM
@PM2Ring I've added a link to JFF's question to my answer, thanks.
 
No worries
 
@PM I wanna do this length prop it is indeed a tad bit unclear as you stated
 
@vash_the_stampede This one ? Leave it, until the OP clarifies.
 
sometimes I wonder how Op was eve going to solve the problem without being able to explain it, and how did they get to that difficulty of problem without the knowledge to atleast explain it
 
@vash_the_stampede you've never had to maintain someone else's code?
 
2:21 PM
yeah, something tells me that those numbers are representing a value, unless he wants combinations of len of words
@OrangeDog Im a newb, only code I ever seen that wasn't mine is here
 
@Kevin if it is a laptop, perhaps one could use some metal with the wifi antenna :D
 
@vash_the_stampede We can make all sorts of guesses, and sometimes guesses can pay off. But with a messy question like that it's just not worth it. If the OP doesn't get their act together soon then we'll be voting to close it as unclear.
 
Yeah I figured that much I'm holding off as well
 
Which reminds me...
@vash_the_stampede The OP just edited, but the edit doesn't help. :(
sorry..my example is bad....but what i mean is x >= y >= z larger than some number — jacobcan118 1 min ago
:facepalm:
 
and it still makes no sense
unreal how is len('a22') > len(y) > len(z) > 10 lol
 
DSM
2:32 PM
Brief Friday cabbage.
 
can Travis be "slow" when doing checks? It takes like forever :-|
cabbage @DSM
 
@NasrinShirali sure depending on what it is that's running
 
@shuttle87 like the code I'm trying to push?
just a small c++ piece of code. it's hardly 50 lines of code I guess. for shunting yard algorithm.
 
Got a repo link?
 
2:36 PM
My god. There's a user with 785 questions, no answers, and 4270 rep. Some quality content from that source :/
 
@NasrinShirali the matrix specified in .travis.yml will run a build for every item specified in it, this can make the build times grow substantially
 
@shuttle87 also I looked at your repository, the tags were very helpful :-)
 
@NasrinShirali which one?
 
test/algorithm/string/reverse_polish.cpp
it ran already? and complains about missing file
 
2:44 PM
@AnttiHaapala yup, that was for it being slow but it failed so I've done something there. I changed the headers
they wanted the code to go inside .hpp instead of .cpp
 
Ran for 14 min 22 sec
Total time 32 min 15 sec
 
:-D that was so long
but it failed so my bad :-P I thought there's something going on with travis
 
@NasrinShirali argh, line lengths
is that a project requirement :D
 
@NasrinShirali oh nice, I'd be happy to guide anyone through a PR on that library
 
:-)))))) hahaha... don't look at it... :-)))) haha..
@AnttiHaapala I literally fell down my chair :-)))
 
2:48 PM
it is not a joke
I worked on a project where the requirement was that long lines must not be cut.
 
@AnttiHaapala I think I've been on one like that too... what do you mean by that exactly?
 
@AnttiHaapala seriously? why?! yeah, they told me that condition was too long and I had to cut it
 
@shuttle87 means that you must not break lines, instead let them flow to 300 characters, and everyone must use an ide that makes them "wrap" "nicely"
 
ugh yeah that's unfortunately what I thought you meant, I've had one like that and it was pretty annoying
 
Why would you even do that
 
2:51 PM
@AndrasDeak in the case of my project it was aggressive ignorance from some people running it
 
It probably always is
 
45k rep on stack overflow
 
Tooling (or lack of it) fuels the ignorance, one of the best things about a cap on line lengths is the in-terminal git diffs. If the people running it don't know anything about that a key benefit (along with many others) is just an unknown that is seen as irrelevant
 
@shuttle87 "forcing people to use shell is abuse"
 
haha
 
2:54 PM
(and the #1 starred github project by the guy is a shell productivity suite that they appropriated from me)
 
@AnttiHaapala well I have a sharepoint setup up just for that... !
 
argh say no more.
TMI TMI TMI
 
@roganjosh This guy has 6,703 points & 47 gold badges...
 
keep your SM sessions to yourself :D:D:D
 
@PM2Ring <weeps internally>
 
2:57 PM
@PM2Ring So what? I also have "one" unique silver badge :-D
 
@NasrinShirali To give a direct answer to this, shorter line lengths improve the readability of the code. There's a variety of benefits from capping the length of the code at some character width and this is the source of their request for the line length to be shortened.
 
every line of code should fit into your editor, so the max line length should fit into reasonable setups
 
so the argument is that
almost any line would fit because pycharm soft-wraps...
ofcoursesuchalonglineiscompletelyunreadablenotmuchdifferentfromanenglishlanguage‌​sentencethatistypedwithoutanyspacingorpunctuationbutwhocarestheydontanyway
 
wait, you are telling me that PyCharm is better than Python then? (pours some tea and is happy about making everyone SUPER uncomfortable :-)))) )
 
@PM2Ring interesting rep graph to say the least
 
3:02 PM
@NasrinShirali Gold badges are pretty hard to earn these days. In the early days, they were much easier to come by. A score : badge ratio like that almost always indicates someone who's managed to win most of their rep from asking questions. Some of those users have high score, but continue to ask really basic questions, because they don't really understand how to code, they just know how to cut & paste other people's work. :(
 
Comparing Python to PyCharm is like comparing a piece of bread to a toaster
 
@Kevin I know, this was a question yesterday
 
The toaster does a much better job of making toast, but the toaster doesn't taste nearly as good
 
I'd say bread to kitchen
 
Too much metal and glass
 
3:03 PM
@Kevin toaster is much better source of micronutrient minerals
 
@PM2Ring Also I see a lot of high reps answering question which are clearly a duplicate
 
one million percent your daily requirement of iron
 
yesterday, by PM 2Ring
There was a classic question an hour ago: Which one is best python or pycharm? (10k+) It was short, so I can quote it here in full: "In coding which version is good for easy coding python with version 3.7 or pycharm?"
 
@NasrinShirali That's a different problem
 
also, if you look at questions asked like 8years ago you'd see a question like, how do I loop? and that has 2K upvotes, that user will have 4k rep?
 
3:05 PM
High rep users answering dupes, especially when the dupe has been proposed, should be confronted
 
@NasrinShirali Well, how do you think they got that high rep? ;) Not (necessarily) by being excellent coders, but by answering everything they can. We call such people rep-farmers, although there are also other names for them...
@NasrinShirali They'd have even more rep, since 1 vote = 10 points, but there's a daily rep cap to stop things getting too silly.
 
@roganjosh Oops. I just answered a question that turned out to be a dupe, although there wasn't anything proposed in the comments at the time.
 
@Kevin you're playing Devil's advocate. You know the type of person I'm referring to :P
 
Yeah ;-)
 
3:10 PM
@PM2Ring would be amazing to write that in your resume. 70k rep on SO. :-D your activity? asking questions. and here's what I figured, wait for a new feature, then post a question on it. others will answer while you get reps
 
Occasional lapses are ok. And if it takes longer to find a decent dupe target than to just write a good answer. But at least we try to do the right thing. The problem is the high rep users who almost always answer dupes, and get defensive when you suggest that they ought to have hammered it instead.
 
Not only have I answered dupes, I've answered dupes of targets whose accepted answer is mine. But that's only because, sometimes finding the dupe target is hard even for me. How do I expect OP to find it. That said, if one is suggested and hiRepUser doesn't consider it, that gets a -1 in real rep.
 
@PM2Ring stackoverflow.com/a/52668623/10255652 question is unclear obviously but using the comments I think I figured out how to get OP result and stick to his guidelines
 
Wow. I guess my comment was too broad there. I was talking about obvious dupes sorry. I mean things like the "mutable default argument" type stuff
 
3:13 PM
so @PM2Ring next time, a new feature is added to a language, I'll be there asking a question and getting reps :-D That's my plan
 
Assignment expressions are due to come out in 3.8, so better compose those questions now
 
I also have answers to things closed as dupes. It does happen to anyone. Some people seem to search for those questions to answer. There's a certain 400k+ user I've not seen recently answering basic questions
 
<<writing down the date @kevin gave her! >>
 
@Kevin ugh I don't like this PEP
 
3:15 PM
Even though nobody is yelling at me, I think I will update my posting strategy in the direction of "not fast-gunning a question I'm pretty sure is a dupe".
 
All set ,told Siri to remind me ... in a couple of days I'll be a 10k, clicking everywhere
on SO :-))
 
Lowering my criteria from "don't answer if you're 60% sure" to "50% sure", approximately
 
@shuttle87 why?
 
... I thought you were joking, Kevin. I don't think I've seen you do it
 
@NasrinShirali But the question is: when will 3.8 come out? About that day or hour no one knows... Unless it mentions it in the PEP and I missed it.
 
3:17 PM
@NasrinShirali I think I'll need to see some examples of code where it improves things because it's a construct that historically has been bug-prone
 
@Kevin already done
 
The early bird gets the worm.
 
DSM
s/destined/doomed/g
 
@shuttle87 it is not bug prone because it is not powerful :D
 
@NasrinShirali The current consensus in the community is that list comprehensions should not be used for their side-effects. Assignment expressions would let you carry state from one iteration to the next, which sort of violates that purity.
 
3:20 PM
@PM2Ring I'm becoming painfully aware of this issue today e.g. stackoverflow.com/users/7420623/ryguy72
 
... Or would it? I forget how scoping works there
As usual I'm useless unless I can test things in a REPL
 
What should we do about that "combination from multi list" question? It looks like the OP is a bit mixed up regarding greater than vs less than:
i want 3 >= 6 >= 10 > 10 — jacobcan118 48 mins ago
 
@MartijnPieters is operator finally boils down to comparing two pointers. True if they both contain the same memory address.
 
@vash_the_stampede I don't think he actually wants len(x[0]) == 3 and len(x[1]) == 6 and len(x[2]) == 10. Maybe (len(x[0]) <= len(x[1]) <= len(x[2]) <= 10) and (len(x[0]) + len(x[1]) + len(x[2]) >= 10)
 
yeah I understood that @PM2Ring and ran that comparison the thing is it produces multiple results that way which would make a list
if we change it to == each len we get the exact result op wanted
 
3:28 PM
@stillanoob yes, that's exactly it.
 
@MartijnPieters A.foo is A.foo fails because there are two different objects involved and hence, the two pointers have different addresses in them.
 
@stillanoob right again. See docs.python.org/3/howto/descriptor.html for the background why that fails when foo is a bound method on an instance.
 
morning cabbage
 
@PM2Ring was able to use combinations and convert to >= 3 >= 6 >= 10 which was in comments
 
3:34 PM
@MartijnPieters id(A.foo) == id(A.foo) goes through because both the objects happen to be allocated at the same memory location (one after the other) by malloc. Yeah, I have been through that doc (for 2.7 though).
 
does anyone see this question titlte "f*ck this site"
 
LOL, look at the comments under the answer :-D
 
@wim now that's more like the spammy off-putting case ^
@vash_the_stampede if you see something like that with content to go with it, flag it as abusive
 
@AndrasDeak yup, and the comment :-)))
 
I don't see anything beyond establishing that the OP is the author of the library
 
3:42 PM
"What is your affiliation to Langform?"
 
yes?
 
what happened to your cristal ball :-( right before you posted it I was talking about the comments under the answer of the link you tagged cv-pls
 
How do I pin python dependencies?
CBG BTW!
Is this good enough lxml==2.2.0
 
@jpp that dupe does nothing to explain the issue to the OP
They're treating the loop as though it was enumerate and giving them indices. Instead, they're using the integer values in the list as indices
Grr, phone makes it impossible for me to monitor the main feed and chat at the same time :P
 
Hey @vash_the_stampede That combinations stuff is a bit complicated. And you should try to use iterators directly, rather than building intermediate lists. Take a look at this:
from itertools import product
a = ['a0', 'a1', 'a22']
b = ['b', 'b11111', 'b2']
c = ['', 'c', 'c333333333']
res = [(u, v, w) for u, v, w in product(a, b, c)
    if len(u) >= 3 and len(v) >= 6 and len(w) >= 10]
print(*res)
 
3:57 PM
@NasrinShirali I know
I just don't see anything interesting in those comments
"what is your affiliation of <project>" is exactly how you ask someone if they're an author or other stakeholder of said project
 
I know but I wouldn't be so direct.
 
I ran my stuff through valgrind again with a debug build of python. Turns out this is 4GB of frozenset. Is there a way to track why they're not being collected within python?
 
and also @AndrasDeak, if he'd asked this question then answered with the same saying he's written this library to answer the question, let's say after 2 months, we wouldn't be having the same view about his question. So maybe it was his question, came up with a solution, and wanted to post it here.
 
Yeah, I agree, but that still makes it questionable :)
 
for some reason, my music player went from playing "Children of Boddom" to Will Smith's Miami! I really don't know how to feel now.
 
4:06 PM
@AndrasDeak double downvote on that self promo question. Ugh.
 
TIL the typing classes only pretend to be classes
>>> typing.List.mro()
[<class 'list'>, <class 'object'>]
>>> isinstance(typing.List, type)
False
 
@PM2Ring ... I was wondering how to use product like that
@PM2Ring if this ends up being the desired path you should post that, It is a wonderful expression
 
@NasrinShirali get more direct :P At the end of the day, we're supposed to be objective on SO or the whole premise of the site falls apart
 
hahah im jealous
 
@NasrinShirali fresh?
 
4:13 PM
If something is wrong, the ultimate message you need to convey is "this is wrong". You can dress it up with formalities but that should still be the take-home message
 
@OrangeDog I didn't realize I was dancing, but I was :-P so yes, fresh it is.
 
@vash_the_stampede It's just a basic product thing, and it's not really efficient for big lists. It would be better to filter the lists first. But we can't do that if the OP can't explain exactly what they really need. So I've voted to close that question as unclear.
 
@OrangeDog what happens if you call gc.collect() manually?
 
@roganjosh yeah, that's correct
 
@PM2Ring do you mind if I update with that product line, I wont use the entire comprehension that is yours I will stick with the filter i used to be fair :)
 
4:20 PM
You used to be fair?
 
@vash_the_stampede Use the whole thing. Your filter isn't very efficient. ;)
 
hahah I know but Its not right, you came up with that so I would still want you to have the oppertunity to post a superior answer
 
@AndrasDeak This is all with calling gc.collect() manually
 
oh...
 
@vash_the_stampede Thanks, but I got sick of waiting for the OP to clarify the question. But I won't downvote your answer. :D
 
4:23 PM
Can't track frozensets specifically with Pympler :(
TypeError: can't set attributes of built-in/extension type 'frozenset'
 
recbg
 
@Aran-Fey at least it's consistent with typing.Any chat.stackoverflow.com/transcript/message/43788994#43788994
 
@OrangeDog I'm almost certainly off the ball on this but your issue, as it has unfolded, reminds me of a presentation from Raymond Hettinger on YouTube about dictionaries keeping a memory footprint of their maximum size.
 
@AndrasDeak Huh, I totally forgot about that. TIL I'm more forgetful than I thought
 
Like I said, I'm almost certainly wrong that it has anything to do with your issue and yet it's stuck in the back of my mind
 
4:26 PM
@Aran-Fey TIL that @Aran-Fey is likely to TIL the same topic more often than others.
 
@PM2Ring I agree it should be closed it was deemed unclear OP was lackluster in response to clarify and if anything made it more unclear
 
@roganjosh Good point. But frozenset is immutable, so its size can't change.
@vash_the_stampede It's annoying, because it could have been an interesting question.
 
very much so, I think the solution you presented would have been the most optimal, cant see a way to trim it down further that i know of
 
If I refactor a module mymod.py to a directory in which all contents of mymod.py go into the new mymod/__init__.py, should most things continue to just work? What could break?
 
@piRSquared To be fair, I'm sure there are a few newcomers in the room who didn't see my previous TIL, so the repost was to their benefit :P
Pretty sure turning a module into a package can't break anything (except for code that does so on purpose)
 
4:31 PM
@PM2Ring huh, has it been a frozenset from the outset of the issue?
In which case, my thoughts need to be consigned to the bin :P
 
@roganjosh I haven't been following closely, I'm just going off chat.stackoverflow.com/transcript/message/44174519#44174519
 
I guess that's what those unit tests are for... yay tests!
 
I think my thought process was triggered before that
 
All tests pass! Tests are great. Who knew?
 
I work at a place where a number of our projects are very research heavy, and so they skimp on testing. We just hired an employee to retroactively "test" a monolithic piece of software that's about 5 years old and none of the original developers still work here. His poor soul.
 
4:39 PM
^ my condolences for your loss of a colleague in 5 months time
 
wim
@user3483203 retrospectively, not retroactively
user really has 16k rep
 
Should I hammer this with Kevin's "user input" canonical ? stackoverflow.com/questions/52669848/… Or should I just let it accumulate more wrong answers?
 
@PM2Ring It seems the OP has edited the code, which removed the syntax error. So the question now lacks a mcve. I wouldn't hammer that.
 
@wim You mean he's earned 16k, but has generously given 10k away? I guess that's a bit better.
@Aran-Fey Ok. I'll leave it. The typos are fixed, but they still need to loop & give an error message on bad input.
 
wim
@PM2Ring No
downvote and close the tab
 
4:56 PM
One of the bad answers just got repaired. So I'm happy to leave it.
 
@PM2Ring Oh, that's true. If you read the question as "Can somebody finish this code for me?", then it makes sense to hammer it I guess.
 
5:12 PM
@MartijnPieters Someone opened an issue for ASGI in Werkzeug: github.com/pallets/werkzeug/issues/1322, and I also created a project for it: github.com/pallets/werkzeug/projects/1.
Nathaniel's blog is really good, I've been through that post before. One of the things I'm thinking about is how to be compatible with multiple asyncio implementations.
 
@davidism ta
 
> HyperIO is a asynchronous compatibility API that allows applications and libraries written against it to run unmodified on asyncio, curio and trio.
 
I think my biggest challenge is turning Twitter views into code contributions. :-|
 
wim
does Tom Christie contribute on werkzeug?! I thought he will have more than enough on his plate with apistar
 
Am I losing my mind? How can you get a NameError here?
Lol, I'm not losing my mind. Chameleon question.
 
The code in the traceback is clearly missing the self.
 
They also originally claimed tree.inorder threw the error but now we see that they also have an inorder method
 
5:56 PM
> No clue why I was getting the error but its working after I restarted the kernel. Thanks, everyone.
The old "not actually running the code that I thought I was running"
 
wim
restarted the linux kernel? LOL
 
Sometimes I tell people to reboot when really I just want them to start a fresh Python session, but I don't trust that they actually will
"I'll just press Enter in my REPL like eighty times so all the previous code scrolls up out of view. Should be good enough, I'm sure"
 
wim
heh. you could ask them to try and pickle.loads(this_string_which_reboots_their_computer)
 
6:13 PM
cbg again
 
Reminds me of the bit from that one Hofstadter book where the tortoise plays a record titled "This record self-destructs when played on Brand X record players"
 
I was reading this question and "The shelve module does not support concurrent read/write access to shelved objects. " would you think it is rational to make a comment and tell him to implement a blocking read/ blocking write FIFO ?
then he won't be getting that error I assume.
 
If you have a good design in mind for an inter-process blocking object, then I'd say that's worth a full-fledged answer
 
No idea how it's done in Python, but it will be a very good exercise for me, right?
I just know the concept though
 
6:22 PM
You could probably construct something using a Lock, assuming all the processes trying to access the shelf all come from the same parent process. If he's asking "how do I stop any process from accessing my shelf file, even if I didn't start that process?", that's harder.
 
@NasrinShirali Then lean how it's done in Python? Or whether it's not possible. It's kinda pointless asking if it will be a learning experience :P
 
@roganjosh umm like the other time you told me not to put effort into one of the questions.
 
I'm vaguely recollecting the question and it was a mess
 
@Kevin I'll read on that then. I did it in another language once for a Lab, might be helpful here if the main idea is the same. Thanks
@roganjosh some very messy dictionary, for a very specific scenario.
 
"[my Python program] is called by another process/processes..." makes me worried that it's the latter case
 
6:27 PM
@NasrinShirali I need to rethink what I say here. Your point is very valid. I can't draw some arbitrary line
 
Looks like Linux has OS-level support for locking files. I wonder if that's applicable here?
 
@Kevin Yeah, it's saying he has a "python application" which is called "by another process/processes"
 
Best case scenario, all the processes can take turns using the shelf with just one or two subprocess calls to flock (or whichever of the commands on that page is appropriate)
Worst case scenario, I have completely misinterpreted the purpose of those commands and they aren't useful at all
 
@Kevin finally, I have something I like working on :-D I'm going :-p
 
6:34 PM
Do we have a dupe target for "how do I get functools.wrap to preserve the original paramters of the decorated function when I do help()?"? stackoverflow.com/q/52671111/953482 Could use it.
Because I am a bad person, I never wrap my decorators, so I have no personal knowledge on the topic
 
wim
Hynek has an article about it here hynek.me/articles/decorators
But my answer would be more along the lines of: this is one of the many reasons why Python decorators suck. Avoid them.
 
I skimmed that page for a bit a minute ago. It suggests decorator.py and/or wrapt, but I'm not sure they're suitable for the OP's use case. In particular. they want to be able to perform work when the function is initially decorated.
If they were desperate, they could just stick the time.sleep(1) just below the decorated function's definition, and it would do basically the same thing. But maybe the actual code has scoping concerns that makes that impractical
 
off topic: my new co worker typed "places near me" on his work desktop and the search returned area around his home address. He has never logged into the desktop through google, I wonder how google knows. Any ideas?
 
wim
I saw this question and almost answered
 
Hynek observes that inspect.signature() can find the original parameter list of the decorated function. Curious that it doesn't get propagated to the help page. I guess there are situations where that wouldn't be the correct behavior. Still, it would be nice if we could opt-in to it.
@wraps(f, keep_original_params=True) or some such
 
wim
6:43 PM
but do not have good batting average on saying "it's not a good design to do $THAT, this is a better design $NOT_THAT"
 
"Try not doing the thing you're doing" tends not to draw in the accolades, it's true :-)
 
wim
A decorator performing some non-trivial work seems really bad to me
also, OP is still on Python 2.7 so obvs doesn't care about good design
 
@MooingRawr So not signed into chrome or google?... weird
 
The higher scope of my decorators tend to just, like, initialize empty dicts for memoization and stuff.
 
recbg
 
wim
6:49 PM
The only one I really use is @property and various incantations of it. Or when some framework forces me to use decorators and there isn't a better framework around.
 
I like @property and @lru_cache. @staticmethod and @classmethod are good when I can remember the difference between them.
One of them gets a reference to an instance. Sometimes. Maybe.
No, one of them gets access to the class object. That's dumb, why would I want that? I could just refer to the class by name. I'm in the class definition, it's not like I'd have to even scroll up very far to find it.
... Is this a polymorphism thing.
 
wim
it's a descriptor protocol thing
modifies the meaning of "the first positional argument"
 
class A:
    @classmethod
    def frob(cls):
        print(cls)
class B(A):
    pass
A.frob() #<class '__main__.A'>
B.frob() #<class '__main__.B'>
 
@MartijnPieters I added some timeit code & results to How do I perform multiple operations in a list comprehension.
 
wim
as for staticmethod, beats me. has no good use-case and exists only to keep java weenies happy?
 
6:55 PM
@wim They seem to be the main ones using it, IME.
 
I like staticmethod because I like defining plain old functions in namespaces and I can't be bothered to write an entire new module in order to create that namespace
 
wim
classmethod good for factory functions
 
Not that I actually do that very often, but I'm conforted when the Zen is upheld
 
I was pleased to see my plain old listcomp beating Martijn's partial and the various itertools offerings. :)
 
wim
bad uses of decorators: @mock.patch (better to use context manager) @app.route (better to use a router) @click.command (better to use an argument parser) @lru_cache (better to use an explicit cache key)
 
7:01 PM
one more reason to hate pipenv - doesn't support entry points
 
wim
pipenv is awful
but poetry, one of the other projects mentioned in that issue, is a pretty interesting one.
 
@PM2Ring really? For seven values?
 
@wim piptools-3.0.0 is nice for just keeping requirements.txt up-to-date
 
@MartijnPieters I admit it's not really a fair test, but I did the best I could given the constraints. Eg, I put your partials creations in the setup phase, not the timing loop.
 
wim
I think we should refrain from posting timeit results when the question showed absolutely no hints that performance was an important factor
 
7:05 PM
It's just.... humongous overkill for something that outputs 7 random values.
 
@wim I wrote the timeit code because I was curious about the relative speeds.
I just edited my code to create a list (or array) of 50 + 20 items. Here are the results.
loops = 500
jpp              : [0.025625186994147953, 0.025764200996491127, 0.03122780400008196]
PM 2Ring         : [0.21989007600495825, 0.2200367909972556, 0.22065802400175016]
juanpa_starmap   : [0.3094131350007956, 0.3110805670003174, 0.31563361900043674]
Patrick_chain    : [0.3122365829985938, 0.31262181099737063, 0.3137894630053779]
Patrick          : [0.3130071220002719, 0.31769691400404554, 0.3179219129960984]
Ralf             : [0.31566168300196296, 0.3157304769993061, 0.3234770689959987]
 
wim
@PM2Ring I'm not saying that you shouldn't run timeits if you're curious. Just that we should refrain from posting them, if it's not relevant.
 
@wim The OP might not care; other readers (including the answer authors) may find the timings relevant.
 
wim
why? if they have big data they will have to rerun their own timings with their data anyway
 
Besides, it's not like I'm often in the position to write code that runs faster than Martijn's. :D
 
wim
7:17 PM
 
@PM2Ring what question is that pertaining to
 
your code is sexy I wanted to get in on that one too, mine would have looked like tanmay most likely
I always say cats are sleeping on PM
 
7:37 PM
@wim apparently that exactly
 
@vash_the_stampede :)
 
"Very low qualify" has been added to close reasons?
Am I behind the times here or has a change been pushed live just now?
It would be nice to edit my first comment to change "qualify" to "quality" but that feature won't work properly on my phone
 
wim
I don't see that.... are you sure someone hasn't typed it in manually?
 
8:00 PM
@roganjosh I think someone is serially downvoting you
 
They are
And it didn't get reversed the first time
 
Oh well. I was a bit slow on this one. I wasn't expecting to see answers from 2 high rep users.
 
I'm not arsed tbh. I dish out criticism on answers and questions, so if that's the only way they can respond then fine
 
@PM2Ring My versions were never intended to run fast, I was making a point about how you could find a hundred different ways of spelling the expressions.
 
@roganjosh I reversed those 4 downvotes with an upvote :)
 
8:08 PM
I'm more interested in being blown out of the water with a good answer I can learn from or comments telling me I'm wrong
 
Serial downvoters generally don't write good answers, I think
 
@MartijnPieters Fair enough. And that's a very valid point. I suspected that it would be a little faster if the if condition could be avoided, and was quite surprised when the difference was noticeable, even on a list of 7. The variation in all the answers is fairly minimal, though.
 
wim
ascii art questions are fun
 
@Aran-Fey no, they don't. They'd rather take some pathetic revenge rather than discuss the issue and maybe learn something
 
wim
@roganjosh that's the spirit!
 
8:12 PM
hoho
 
wim
serial downvoters usually don't leave comments, because they aren't downvoting the content they're downvoting the person ..
 
memory usage graphs from warehouse... celery workers... "wonder why warehouse is migrating away from celery"
 
@wim They are. Did you see the 7 segment clock I posted yesterday? I basically recycled the techniques from that to do the dice. :)
 
@wim Well, it'd still be preferable if they left comments. Something like "You suck" or "I hate you". That would make the whole thing a lot funnier.
 
@wim we don't always see eye to eye, but what does that matter in this instance? I have a lot to learn and you may well be the one to teach me :)
 
8:16 PM
@Aran-Fey Or something from Monty Python: "Your mother was a hamster, and your father smelt of elderberries."
 
I wouldn't mind a downvote with that comment (:
 
wim
@roganjosh I don't understand your response, sorry
 
@PM2Ring Do you always print the 2 and 6 the same way? If you are printing rolled dice, then sometimes the pips on those sides are rotated.
 
why so few room 6 regulars? (I got my name on the list in August)
 
8:23 PM
My name is on that list, too. doxxed by PSF, nooooooo
 
@PaulMcG I'll leave that variation as an exercise for the OP. ;)
 
@wim we've disagreed in the past, and add some pints of cider on my end. I think my usefulness on SO has ended. Rbrb :)
 
@vaultah clever :P
 
wim
@roganjosh tbh I don't recall any occasions
@PM2Ring Yes. I am teh one that starred it.
@AnttiHaapala who is on there?
 
@PM2Ring I've put together a set of notes starting with this, then moving into rolling Yahtzee rolls, then detecting and scoring the rolls - I've thought it would be a good workshop, titled something like "Learn Python by Playing Around". And my 2, 3, and 6 choose a random rotation when they get printed.
 
wim
8:29 PM
oh man, I hit the blame button and got github's pink unicorn error page
 
Here is a replacement for TIL: TIGBB (Today I Got Burned By) TIGBB two 3rd party libs that both import the same name. Took me a little while to figure why my deployment environment couldn't find the defined classes, I'd just 'pip install'ed the wrong one.
 
@PaulMcG Ah, Yahtzee! I haven't played that since themid-1980s. I occasionally think of writing a Yahtzee program, but I never manage to get around to it...
 
@wim well, you are, Martijn, and apparently vaultah with one of his pseudonyms that doesn't seem to pop in ;) and Zero Piraeus
 
@PM2Ring I skimped on it, no multiple rolls just a single roll. I'd run it until it rolled a Yahtzee, it prints "YAHTZEE! 50 points!" and then ends
 
This answer is directly attributable to this room. stackoverflow.com/a/52672822/2336654
 
8:34 PM
I did a simple deck of cards a year or so ago. I was going to make a Freecell game, but lost interest when I realised that it'd be a PITA to control it from the keyboard. :)
 
^ Brainwave API
 
wim
there is another Antti on there
 
@PM2Ring Yes, my "playing around" notes also made a simple deck of cards, so you could shuffle, deal them, and play War.
 
wim
@PaulMcG do you mean both import the same (other) name, or both provide the same import name
This is just a TIL in disguise: "TIL Python import system is not namespaced enough"
 
@wim Both import the same name. The libs are awsauth and requests-aws. Both use import awsauth.
The one I wanted was requests-aws
 
wim
8:41 PM
Hmm, I think you meant that both provide the same import name
according to johnnydep:
$ johnnydep requests-aws --fields import_names
name                           import_names
-----------------------------  --------------
requests-aws                   awsauth
└── requests>=0.14.0           requests
    ├── certifi>=2017.4.17     certifi
    ├── chardet<3.1.0,>=3.0.2  chardet
    ├── idna<2.8,>=2.5         idna
    └── urllib3<1.24,>=1.21.1  urllib3
Martijn added by Guido himself. nice.
 
@AnttiHaapala August 2002: github.com/python/cpython/commit/…
@wim :-)
>>> print(multi_dice(*random.sample(range(1, 7), 6)))
+ - - - - +   + - - - - +   + - - - - +   + - - - - +   + - - - - +   + - - - - +
|  o      |   |  o   o  |   |  o   o  |   |  o      |   |         |   |  o   o  |
|         |   |  o   o  |   |    o    |   |    o    |   |    o    |   |         |
|      o  |   |  o   o  |   |  o   o  |   |      o  |   |         |   |  o   o  |
+ - - - - +   + - - - - +   + - - - - +   + - - - - +   + - - - - +   + - - - - +
 
DSM
Pineapples for poke on 200k!
17
 
Total lines of code for two functions: 6.
 
rbrb
 
@MartijnPieters lollerskates. But it was BDEVIL himself who added you
 
8:51 PM
gratz poke!
 
tweet here:
I finally hit 200k reputation on Stack Overflow earlier today (while on vacation) – whooo! #StackOverflow
 
@AnttiHaapala yes, that's when we were both at Zope Corp.
 
at least I started using Python before Martijn was a contributor :P
 
I kinda forgot those 2 :P
 
wim
9:04 PM
and quite a few contributors that are active on SO but not in rm 6
 
9:19 PM
cbg
 
9:31 PM
Oh I see I gotta be super crafty with this dice game
everyone bringing out the big guns
 
10:07 PM
@AnttiHaapala Ashish is there too
Sorry, 4sh1sh :P
 
wim
10:17 PM
I expect to see a lot more people on there now that workflow has moved to github.
s/expect/hope/
 

« first day (2911 days earlier)      last day (2040 days later) »