« first day (2533 days earlier)      last day (2418 days later) » 
00:00 - 16:0016:00 - 00:00

12:10 AM
are subscribed users notified of commits to github PRs?
 
12:30 AM
Hi all
 
hello
 
@AndrasDeak Do you know why a init in my http.server class doesn't work very well?
__init__
 
you're probably doing something wrong
good night
 
I'm a bit of a noob when it comes to web programming, perhaps due to REST
Ok goodnight, thanks for the constructive conversation
 
 
4 hours later…
4:58 AM
Is there a reason one might receive a "maximum recursion depth exceeded" on Windows by not Linux with the same code?
 
 
1 hour later…
6:22 AM
cbg
 
6:48 AM
cbg
 
7:06 AM
@phill Check sys.getrecursionlimit() on both systems to see the most straightforward explanation
 
7:16 AM
It's set to 1000 on both systems.
 
A minimal example of the code in question might help saying this or that
And if it is more than a few lines, use a paste service.
 
7:32 AM
that's the frustrating part, this is an internal company tool and standing policy is no sharing of code, even if there isn't any proprietary code involved.
Ran pdb, it dealt with the normal imports at the top of the file, dealt the the click stuff for the program arguments, hit the main function then failed at: from setproctitle import setproctitle
 
@phill the worst kind of companies
 
jjj
recabbage
 
@AndyK made worse by the fact that the guy who wrote this and knows python well enough to port it from Linux to Windows is gone.
 
Umm... there must be better dupe for stackoverflow.com/questions/46359182/… - anyone?
 
@phill oh...
 
7:53 AM
@JonClements Best I can find: stackoverflow.com/questions/14802128/…
 
8:08 AM
@phill if the code is substantially different for the two platforms you should probably try identifying the differences
And the fact that the code breaks in pdb sounds weird to say the least. Correct version of python?
setproctitle sounds like fork which is quite different for windows (that's about all I know of the subject)
 
cbg, all
 
cbg
 
Hi @JonClements - long time no see!
 
Someone was looking for Clement yesterday :P
 
@AndrasDeak o\
 
8:29 AM
@holdenweb I've been around here and there - just fairly busy... All good with you?
@AndrasDeak Uh oh... what am I supposed to have done now? :p
 
9:00 AM
cbg
 
9:11 AM
@JonClements yes, all good with me thanks. You too, I trust?
 
9:23 AM
@JonClements you? As I said, they were looking for "Clement" :P
 
@holdenweb usual - SSDD - but fine thanks :)
@Andras oh good :) That's me off the hook then!
 
Single-sided, double-density?
 
10:07 AM
That's the one :)
 
10:38 AM
Cabbage
 
cbg
 
11:06 AM
hey all, I just tried to post a question on stack overflow, but it said I can only post one question every 90 minutes but I have not asked any questions in over two months!
Sorry it doesn't matter I managed to figure out my own problem!
 
182
Q: Error -- "you can only post once every 90 minutes" but I haven't posted in days

BryanI tried to post a SO question this morning, but I got an error saying: You can only post once every 90 minutes. However, I haven't posted in days, let alone 90 minutes. What gives?

 
ah thanks, makes sense, I am in the British Library!
 
11:43 AM
@JonClements I'm not sure that is strictly correctly marked as a dupe, since it's not something you could easily use sum to do (or is it?)
But of course I can't now provide a canonical answer because it's been dupe-tagged
 
@holdenweb But how does the linked question not answer that question?
OP wants to turn [2, 2, 2] into [2, 4, 6], which is really the same thing as the other OP who wants to turn [4,6,12] into [4, 4+6, 4+6+12]
 
Oh sorry - my dyslexia - I completely blanked on "cumulative"
 
12:36 PM
Hmm, does the re module have a character sequence representing "the empty string, regardless of whether it is inside a word or not?"? I don't want to write (\b|\B) all the time.
I don't have a specific practical use-case for it but it seems odd that it doesn't exist
 
For what purpose would you do that?
 
^ What poke said. What's wrong with r""?
 
My original use case was to use it in a pattern that I pass to re.split, so no characters would be left out of the return value. But it turns out that split requires a non-empty pattern match, so it wouldn't have worked anyway.
 
I cannot think of a use case where matching between any character would be useful.
 
so, like, if you wanted to split on any point where a lowercase letter is followed by an upper case letter, you might do re.split(r"[a-z](\b|\B)[A-Z]", "fooBar") ==> ["foo", "Bar"]
Again, this does not actually work, but it's what I wanted.
 
12:41 PM
But even if that worked, it wouldn’t make sense to do \b|\B there since the \b wouldn’t match in that case
 
That's equivalent to r"[a-z][A-Z]" though, isn't it
 
You cannot have a word boundary between two alpha-numerical characters
 
Yeah, bad example. How about... A digit followed by any character, whitespace or not. "foo1 bar2baz" ==> ["foo1", " bar2", "baz"]
r"(?<=\d)(\B|\b)(?=.)" might do it if split accepted empty matches
 
(there is no word boundary around numbers *cough cough*)
 
You mean, there's no boundary between foo and 1? Agreed, but I expect a boundary between 1 and space
 
12:46 PM
yeah
I just mean that you cannot split bar2baz into bar2 and baz using word boundaries
 
True, true
 
I would accept it if we just agreed that there isn’t a usecase for \b|\B.
>>> re.findall(r"([a-z]+\d?)", "foo1 bar2baz")
['foo1', 'bar2', 'baz']
 
I'm halfway to convincing myself that any time you might want to use \b|\B, you could instead use a literal empty string plus non-consuming matching paren groups
(?<=\d)(\B|\b)(?=.) ought to behave identically to (?<=\d)(?=.) for example
Or, er, perhaps the captured groups would be different but the matched segment would be the same.
This is independent of the question of whether there is actually a time where you'd need this behavior to begin with, an example of which I still haven't come up with
 
heh
 
@poke heh... like your comment on that Q :)
 
12:55 PM
:)
Btw. am I the only one who has been getting a super tiny favicon for a few days?
 
Not noticed - but then there's been a stonking "NEW" thingy that's distracting so... :)
 
In college they taught us the underlying theory of regexes using a very feature-poor syntax: we had | and * and character literals and ε. I just find it curious that this barebones definition has functionality that re doesn't have amidst its many bells and whistles, regardless of whether said functionality has any practical use.
Or not "functionality" per se, because you can probably prove that any grammar expressible in tinyFormalRegex is also expressible in pythonRegex. But the latter might be less concise.
 
@Kevin No, they taught you about regular languages which can be expressed using a “regular expression”. But in practice, every thing that calls itself “regular expreession” is actually way more powerful and can easily describe non-regular languages.
 
"expressive power" perhaps
 
1:17 PM
@poke That's surprising to me. I know that some engines are powerful enough to, for example, match balanced nested parentheses. But I assumed those were in the minority. Or perhaps most engines are in the middle: more powerful than tinyFormalRegex but still not powerful enough to match "any number of As followed by the same number of Bs"?
 
The regex module on pypi is fairly cool :)
 
regex is exactly the engine I was thinking of that qualifies as extra-powerful. It has recursive groups so you can in fact match nested parens with it.
 
I don’t know a single regex engine in programming languages that is really limited to regular languages.
I know that some don’t support more complex things like look behinds (just aheads) since they are expensive and require backtracking, but you usually have a lot things that allow you to match context sensitive languages.
 
@Kevin For supremely powerful... its not like the author of pyparsing doesn't pop by now and again :p
 
And cbg to you too, @JonClements :D
 
1:30 PM
Talk of the devil and all that :p
So like I was saying... it's not like the winning lottery ticket doesn't pop by now and again :)
 
Flattery will get you everywhere, keep talking
 
Well... I would keep talking but Theresa May is spouting out whatever at the moment so... I'll defer to her for the minute :)
 
\o cbg
 
Great error message shared on our internal Slack this morning: Apologies, we're having some trouble with your WebSocket connection. We've seen this problem clear up with a restart of [our app], a solution which we suggest to you now only with great regret and self-loathing.
 
I understand very well the deep shame that comes with having to reveal to the end-user the internal workaround you tried to keep secret because it reveals that the whole platform is made from duct tape and spit
But "try turning it off and on again" is one of the more moderate members of that category. Better that than "try these fifteen elaborate steps, no we don't know why it helps or which of them are actually necessary"
 
1:36 PM
Duct tape? Nah... that's what proper frameworks are made of... The really cutting edge ones use that little sticky bit on post-it notes to gel everything together...
 
"First, set your local timezone to UTC+12 and set your user nickname to 'Señor_Bañaña_420'..."
 
Fun fact: For the longest time I was always saying “try turning it on and off again” in my head instead of the reverse.
 
Race condition :-)
Simultaneously turn it on and off with your index finger and middle finger respectively. For biologically ordinary humans, this should resolve in the correct order.
 
Didn’t say at the same time
but I guess I just thought that they should probably just turn it off and keep it that way.
 
Turn on your computer, then turn it off and become a lumberjack
 
1:39 PM
Turn it on, and then realize that computers are just not for you, so turn it off again and hang up.
 
Good Evening
 
I wanted to render a perspecitve-y sequence of As and Bs, kind of like the one at en.wikipedia.org/wiki/0.999...#/media/… but with two vanishing points, but I couldn't find a button in Paint.net that could do that. So I settled for an ugly lemniscate
 
Ahhh... I bet the original MS Paint would have had that button :)
Why photoshop became so popular when that was available - I just don't know :p
 
Good old "do that effect from the 0.999... page on Wikpedia" button
Other than the circular text, I composed the rest of the image in paint, because I can't figure out what the paint.net equivalent of "transparent selection" is
 
1:55 PM
photoshop became so popular because humans got more lazy :D It's the same concept with peeling oranges and putting them in a plastic box to sell...
 
anyone try out that SO salary calculator?
 
Humans have always been lazy. We've just gradually become more able to get away with it thanks to "the wheel" and "not being in danger of tiger attack 100% of the time"
 
@corvid You mean the latest Equifax phishing app?
 
yos, anyone try it out?
 
Yes, and I am working cheap
 
1:57 PM
There was never a golden age of virtue. There is graffiti preserved at Pompeii that's exactly as gross as what you'd find written in a modern gas station bathroom
 
Oh great who touched Kevin's cloning machine... :\
 
And look what happened to those smutty Pompeiians...
 
only length-1 arrays can be converted to Python scalars
 
From smut to soot
 
            for i in range(len(predictions)):
                predictions[i] = float(float("%.3f" % float(predictions[i]))*int(100))
Anybody an idea?
 
1:59 PM
I'm getting the idea that you really like the word float? :p
 
Are you getting an error message, or...?
 
@LandonZeKepitelOfGreytBritn If you are seeking for advice how about asking a question ?
 
Trying to round to 3 decimal places?
 
@PaulMcG yes please
 
What exactly is predictions ?
 
2:00 PM
@JonClements a list containing values like 1.742682e-5
 
Anybody can help me to configure the tenserflow?
 
@yode ping me inb a minute
I ll help you out
on Linux?
 
There was me thinking tensorflow was more complicated than rounding a number...
 
@LandonZeKepitelOfGreytBritn Thanks advance
This message strike me one week...
 
@JonClements I am just not familiar with Python that much, but am familiar enough with Linux ;)
 
2:01 PM
Not all three-decimal-place numbers are exactly representable as floating point numbers. For example, 0.100 rounds up to 0.1000000000000000055511151231257827021181583404541015625. Although thankfully most of the time Python graciously chooses not to show the full value.
 
 
@LandonZeKepitelOfGreytBritn round(1.742682e-5, 3) -> 0.0
 
@PaulMcG let's try
 
And I have try any thing that I can try
What information I should provide to you?
 
2:03 PM
"{:.3f}".format(round(1.742682e-5, 3))  -> '0.000'
 
(I'm in windows 10.that black windows is Anaconda
Sorry my English.What is "inb a minute"?
 
@PaulMcG hmm so what do you suggest?
predictions[i] = float(float(round(predictions[i], 3))*100)
gave the same error message
ie only length-1 arrays can be converted to Python scalars
 
What is the type of predictions[i]? I'm guessing, not a float.
 
Sounds like predictions is not a list of scalars, or a list of 1-element lists, but a list of lists that are longer than 1
 
@PaulMcG oh yes, indeed!
 
2:06 PM
predictions[i] = list(map(lambda x: round(x,3), predictions[i])
something like this ^
 
I have seen this post many many times
 
@PaulMcG Thanks! :)
 
@yode It's a typo of "in a minute". In other words: wait 60 seconds.
 
Oh..Thanks..
 
@yode so are you on Linux?
 
2:11 PM
I'm in windows10
 
what distro? Ubuntu?
@yode oh shit... Last time I used windows was a few years ago...
 
Sorry to hear that. :)
But anyway thanks for response. :)
 
@yode wo zhende bu zhidao, yinwei wo yiban shiyong Linux, dui bu qi
 
谢谢。
哦,对了,我这有ubuntu16.0.4,能配也可以
window10的子系统
 
狗は可愛い
 
2:16 PM
哎,估计不行,还有cuda/cudnn和vs等要求,估计配起来工程很大。。
Can anyone can help me configure the tenserflow in windows 10?
 
first step: put your computer in the garbage
second step: get mac or linux
 
Can't say I know anything about tensorflow, no
 
My situation is samilar to this post.But even I seen that post many times,I cannot go out..
 
Tensors are, like, a physics thing, right? Important for building suspension bridges. Why is a bridge-planning app such as Tensorflow so popular?
 
Window is so out of time now?
 
2:20 PM
@corvid :D :D :D
 
:39275950
 
Wow... chat has just really padded out the usernames.... normally it truncates.... not seen that before
 
Windows is kind of a pain to develop on imo, but it's probably because I've been deving on mac since 18 years old
 
I only keep using Windows because I can't be bothered to learn the keyboard shortcuts for any other OS
 
2:22 PM
only you @Jon
 
Bring me a Linux distro where ctrl-c, ctrl-V, alt-tab, and windows-D all do the same things they do on my current box, and I'll install it the next time I upgrade hardware
 
How can I print a float number without decimal point if it is integer, but with needed decimal places if there are any?
E.g. the result of (1+3)/2 should be printed as 2 whereas (1+4)/2 should be 2.5
Any ideas?
It's for a code golf challenge, so it should be rather short...
 
Some one implemented an idea I had for Glaucome test. @JonClements and others dissed it I think. youtube.com/watch?v=pBcEuoJohy4
The filed of vision test machines are worse than 1080p displays
 
@Wally don't see where I come into this... can't remember the last time I saw you let alone remember you mentioning anything about that :)
 
2:26 PM
This was months ago. I don't remember if it was you
 
>>> x = 1.0
>>> y = 2.5
>>> print([x,int(x)][x.is_integer()])
1
>>> print([y,int(y)][y.is_integer()])
2.5
I doubt very much this is the most concise solution, but let's get one down as a baseline
The record to beat is 34 characters
 
That's almost half as long as the rest of my code though... :-(
 
Happy Hobbit Day Everyone!
 
You could do print(str(x).trim('.')).
Assuming x is already a float.
 
2:30 PM
Alternate interpretation of requirements: render a float as an integer iff its string form looks like an integer, even if it's not actually an integer. Ex. 1.000000000000001 normally prints as "1.0" so it counts as integer-y.
 
@MorganThrapp Hm? My str doesn't have a trim method...
 
Sorry, strip, been in C# too long.
 
wouldn't "1.0".strip(".") just be "1.0"?
 
I just found print(x==int(x)and int(x)or x) but that is still huge
 
Oh, do floats print with a .0? I honestly forgot that.
 
2:32 PM
yep
 
You could do .strip('.0').
 
too much c# for you ...
 
Careful with that, though:
>>> x = 10.0
>>> str(x).strip('.0')
'1'
Perhaps .replace(".0","")?
 
Sorry to repeat..Anybody can help me configure tensorflow in my window 10?
 
Bah, forgot that strip doesn't just trim that set from the end.
 
2:34 PM
@yode Nobody was able to help fifteen minutes ago, and I don't think anybody new has come in since then, so it's not likely that anybody can help now.
 
The problem with .replace is 10.05.
 
@MorganThrapp Oh, right.
 
@Kevin that looks like the shortest way to go to me so far... but still long enough to disqualify Python in cross-language golf challenges :-/
 
(str(x) + "$").replace(".0$","").replace("$","") :-P
 
it's getting longer again :P
Anyway, thanks for the input so far.
 
2:36 PM
What challenge is this for?
I haven't golfed in ages, so I'm super rusty.
 
>>> str(2.5).partition('.0')[0]
'2.5'
>>> str(2.0).partition('.0')[0]
'2'
 
Byte came in here to improve his code golf ranking. Alerting possible competitors of the existence of the challenge he's working on would do the opposite of that :-P
 
Hahaha, fair enough.
 
doe not call up Any that you cannot put downe
 
@Rawing x = 20.01 breaks but good try :D
 
2:39 PM
dang! I was so proud of myself, too!
 
Don't feel too bad, I thought of the same answer as you too <3 and then I got sad when I hit 20.01 :\
I don't like golfing :\
 
I think the only foolproof solution is .strip('0').strip('.'), but that's huge.
It is 1 shorter than x==int(x)and int(x)or x though.
It does require a cast to string though. :/
 
>>> ".0".join(filter(bool,"1.0".split(".0")))
'1'
>>> ".0".join(filter(bool,"2.5".split(".0")))
'2.5'
>>> ".0".join(filter(bool,"20.01".split(".0")))
'20.01'
 
Oh I like that answer
 
@Kevin It was a random clash in codingame which is closed now anyway.
But that integer float formatting thing was a recurring problem.
 
2:47 PM
Earl Zope II is dead, long live Earl Zope http://blog.gocept.com/2017/09/22/earl-zope-ii-is-dead-long-live-earl-zope/ https://t.co/c30MoceZvw
Zope gets a new release, supports Python 3 and WSGI.
 
Neat.
 
Does it have a maze of twisty passages, all alike?
 
Yes, and it also has a maze of twisty passages, all alike; and furthermore, a maze of twisty passages, all alike.
 
cheeky, but [x,int(x)][x==x//1]
 
Nice.
 
2:52 PM
Sorry to repeat..Anybody new copemate can help me configure tensorflow in my window 10?
 
x==x//1   could be just   x%1
 
@yode Nobody was able to help thirty minutes ago, and I don't think anybody new has come in since then, so it's not likely that anybody can help now.
I don't think the room is full of tensorflow experts that just don't feel like helping you unless you beg hard enough. I think the room is full of people that don't know enough about tensorflow to help you.
 
Sad news.
 
@yode - try posting a specific question, which will be seen by many more folks than the handful that hang out here
 
But acutally a duplicate question
I can find many similiar post.
And I have tried any method in those post.it just put such same error..
 
2:55 PM
If you tried every solution in those similar posts and none of them worked, you can probably justify writing your own post. Make sure you go into detail about why each existing solution didn't work for you
 
TensorFlow is so unfriend to me..
 
If you say "I tried X, Y, and Z, and they gave me error messages A, B, and C", then people are unlikely to close your post as a duplicate of a question whose answer says "try X, Y, and Z"
 
you need to ask a specific question. "Help config tensorflow" is super broad.... What do you need help with, what is it you are trying to do, what went wrong. Create a MCVE, maybe you will find your own answer.
 
3:06 PM
It's hot :o
 
It's the first day of autumn, therefore it cannot be hot. Get thee behind me, summer
 
40 C today with humidity last time i checked.
@Kevin not Autumn until sometime at 4 pm est today :D
 
It's hoodies-and-cocoa season, your senses are lying to you
Cozy up by the fire because obviously the chilly weather has made you delirious
 
Oh yeah, it is the first day of Fall, isn't it? I should drink some pumpkin beer tonight.
 
rb folks
 
3:10 PM
Yes, consume the pumpkin spice, so that the Pumpkin King might confuse you for his own kind and leave you be during his nightly wanderings
 
The pumpkin spice must flow
 
I'm over in Chicago atm, things got toasty
 
Linus is wise in the ways of man but doesn't know what dark forces he's dealing with. Having the Classics memorized doesn't help in the Unseelie Court
 
** When you realize that seasons are different in different countries**
Or are they
 
3:16 PM
I think they have different seasons in the southern hemisphere. Or maybe it just seems like it because the fastest tall ships of Her Majesty's Fleet take six months to cross the intervening seas
Good bandwidth (think of all the spices you can bring back!), bad latency
 
@PaulMcG not really
>>> a
2.3
>>> a%1
0.2999999999999998
Python fscks that up somehow...
 
wim
1
Q: convert list of keys to nested dictionary

Riptyde4I'm trying to figure out how to create, for example, a dictionary that looks like this: d[keys[0]][keys[1]][keys[2]] from a list like this : keys = ["key1", "key2", "key3"] ... I've tried the following: keys = ["key1", "key2", "key3"] d = {} entry_ref = d for key_num, key in enumerate...

waiting for the inevitable functional reduce monstrosity ...
 
>>> 1.3%1 == 0.3
False
Huh, interesting.
 
wim
>>> 1.3 - 1 == 0.3
False
 
0.3 isn't exactly representable as a float, so that's not the surprising part.
 
wim
3:25 PM
float equality is near-useless
you usually want abs(a-b) < epsilon
 
or math.isclose
 
I usually use the epsilon method but this isclose thing may take the cake... cool
 
Sure, that's the practical approach. I just thought this might be one of the once-in-a-blue-moon instances where the arithmetic works out perfectly. Evidently not.
 
maybe there should be another operator for fp numbers equality
like =~ or smth
 
a == b ish
 
3:32 PM
If they created a new equalish operator, I wonder what logic they would use for non-float types
"Hello, World!" =~= "Hey Earth"
 
they would always try the best compare possible so for non-floats it would work exactly like ==
 
Obviously should both be equal along with "Greetings Planet" :)
 
wim
 
isclose has the benefit of overloadable tolerance values, so you can define for yourself exactly what counts as "close". Can't do that with an equalish operator.
 
yeah equalish operator would need to use epsilon
it would be something like yesterdays lambda ->
 
3:36 PM
@JonClements The implementation phones home to the International Astronomical Union to make sure that the body in question is actually a planet. So that "Hi Pluto" doesn't try to sneak its way in
 
@ByteCommander We were trying to determine if a float value was integral, and if so, print it like an int with no trailing decimal. So this:
for x in (2.0, 2.3): print([x,int(x)][not x%1])
2
2.3
 
wim
PEP440 has ~= but it's for something else :)
 
also, that answer is a code dump and straight plagiarism from the docs, flag pls
 
@Kevin Umm.... but that would equal "Hey Goofy!" wouldn't it?
 
3:38 PM
Are Goofy and Pluto equal, though? Only one of them walks on two legs, talks, and owns a home.
 
And of course low rep op upvoted the plagiarized answer because they can't read the docs themselves.
Gah, I am more frustrated than usual with users in lately.
 
@PaulMcG hmm, nice. Seems to work this way. Thank you!
 
wim
not saying that's an answer worth saving, but what's wrong with copying a code snippet from official docs?
 
Nothing, as long as the answer explains what it does, and it's not just a straight copy. Copying content wholesale is plagiarism, even if you say where it's from. You're getting rewareded for someone else's work.
 
@davidism are you working full time on flask?
 
wim
3:40 PM
it's a bit of a stretch to call it plagiarism, when the answered did actually link to the relevant section of the docs.
 
If I write an essay that consists solely of another author's book, then I say other author wrote it at the end, that's still plagiarism.
 
i dont think it applies to docs
 
It does.
 
1. you get nothing for helping on SO
2. your work is to find relevant thing in docs which is not easy for beginners
 
Neither of those things make it not plagiarism. I really don't want to have this debate. I just want the people voting and answering in to not promote low effort and low quality.
 
wim
3:47 PM
That's not a problem unique to
 
Great, now someone upvoted the question. Also, it's a dupe, and they outright admitted they can't search or read documentation or try anything themselves. Argh!
 
 
We recently discovered a tasty, red grapefruit-infused vodka for some good vodka-and-tonics with a wedge of lime. It may be getting close to that time, @davidism .
 
Take this, it will aid you on your journey
 
Ahh, that does help a bit. :-)
 
wim
3:53 PM
Might be time to walk away and take a 30 mins break from stackoverflow @davidism
No amount of angry comments can stop the deluge of bad questions (and the bad answers they attract) ...
 
Remember to portion your anger because if you spend all of it online before noon, you won't have any left later when something truly anger-worthy happens to you. What if your car gets smooshed by a steamroller and you only have 5% rage remaining? You can't work up a good head of steam with a tank that empty.
 
Still needs a dupe hammer.
 
If you explain an answer and use an example from documentation and you link to the example directly, that's still plagiarism? (not trying to antagonize, just curious)
 
You can use examples from documentation. You can't only use that.
 
nope, its not
 
00:00 - 16:0016:00 - 00:00

« first day (2533 days earlier)      last day (2418 days later) »