« first day (2791 days earlier)      last day (2140 days later) » 
00:00 - 19:0019:00 - 00:00

12:00 AM
It happens with Django, with Numpy, it even happens to an extent with Tkinter.
@wim It makes sense, since a heap's basically a binary tree.
 
I almost exclusively use the C++ api, but I will say that TF in python doesn't really involve the core language as much as other frameworks.
Not that that's an excuse not to learn it
 
Fair enough.
 
12:50 AM
Anyone watching game 3 tonight?
 
@chrisz ML is just so different to application development, which is probably why it's hard to understand
 
It really just depends on the person. The best ML people I work with are not developers at all
 
I still don't fully understand TensorFlow, other than being able to visualize the data and adjust the parameters.
A C-language and ML feel, kinda, opposite. With ML, everyone's after R or Python most of the times
 
1:15 AM
Hey, is anyone good with asyncio here? I'm a little confused by something.
 
morning cbg
 
late evening cabbage here
 
0/
 
@chrisz Define "watching". The game is on TV and blaring in the background but I'm sitting and solving problems on SO... o.o
 
I'm working on a simulation with Router and Host classes to demonstrate routing algorithms. I want any constructed host to start waiting for messages received on a TCP socket. I thought what I had to do was create a task for my host.update() method which just has an infinite loop that awaits for messages, but then the next asyncio.open_connection() call I await for never ends. What am I doing wrong?
self._update_task = asyncio.get_event_loop().create_task(self.update())
...yeah, I'll post an SO question, I shouldn't vampire in the chat. I was going to post way too much code.
Darn it, I'm an idiot. I had an infinite loop somewhere. How does one await nothing? (to give execution time to other tasks?)
 
2:13 AM
Got it, await a sleep(0). Welp, sorry for polluting the chat for nothing.
 
2:29 AM
no dinner for you!
 
3:07 AM
Cabbage gents and gals, long time no see
 
3:21 AM
hello Reblochon
 
3:41 AM
Cabbage
 
4:02 AM
cbg
 
0/
 
cbg
 
cab
 
recbg
@wim how about fullblown url support :D
 
4:21 AM
Is there a good cli for jinja2? I found this but it looks sketchy. github.com/mattrobenolt/jinja2-cli
 
 
1 hour later…
5:38 AM
cbg
 
6:23 AM
Do we have a question about applying difflib.get_close_matches to a list of objects with a string attribute rather than a list of strings? Like finding the closest match from a list of Person instances based on their name
 
6:39 AM
cbg
 
6:50 AM
cbg
 
Does anyone know a good question about sorting a list with a custom comparison function (i.e. with key=...)? SOPython has stackoverflow.com/questions/5212870/… and stackoverflow.com/questions/8966538/… and stackoverflow.com/questions/1972672/…, none of which are quite the same question.
And the top google results are stackoverflow.com/questions/2531952 asking how to make a cmp function work in python 3, stackoverflow.com/questions/11850425 asking why the cmp function even works, and a lot of questions like stackoverflow.com/questions/10645986 that are bad and too specific. The best one I could find is stackoverflow.com/questions/5213033, where the OP did something wrong and the answers don't explain anything
I might have to write a canon...
 
7:21 AM
cbg
 
cbg-ning
 
django rest keep raise 405 method not allowed. even though viewset used correctly
 
Um, Cabbage
 
 
2 hours later…
stackoverflow.com/q/50723900/1222951 no mcve / typo, only needs 1 vote
 
9:28 AM
So in the end that "unclear" is actually a no repro.
 
Did that answerer really recommend turning None, True and False into strings instead of null, true, and false?
 
Yes. It's a mess all around. And the duo made another Q/A about the same subject.
 
Can you repro this? I can't
 
@Aran-Fey No, can't repro.
 
How Can I prevent or log the "Too many redirect". I'm using Django and some pages happens this, and sience it's not an error I never get an alert
 
9:40 AM
Oh I just realized that both of those questions are essentially the same now
 
xyz
how to run "systemd" or alternate command for service running -> nginx python
 
10:15 AM
@MarcosAguayo perhaps your server logs might give a clue
 
10:45 AM
Cabbage
@Aran-Fey Short answer: don't do it, unless you can't figure out how to do it with a sane key function. There's functional.cmp_to_key, but it's pretty slow, partly because it has to handle arbitrary objects.
 
Ah, I see I phrased that in a misleading way. It's not about using a cmp function with key=, it's just about sorting a list in a custom order. Like sorting a list of Person instances by their name or whatever
 
11:42 AM
hi if any one have django realtime application using socketio then please send me to svijinraj@gmail.com
 
@vijinselvaraj might want to do a github search instead?!
 
@vijinselvaraj I agree with @shad0w_wa1k3r. Also, that feels rude and lazy. That's just how I see it.
 
@shad0w_wa1k3r hi i am searched for more times but i didn't get necessary one
sorry for my poor english
 
@vijinselvaraj, what for?
 
11:53 AM
@SeanFrancisN.Ballais i know little bit of english, so i mentioned for that
 
@vijinselvaraj What search did you try? The simplest search gives me at least one very relevant result - github.com/search?q=socketio+django
 
@vijinselvaraj, I mean what is the purpose for searching a real time Django application that uses Socket IO?
 
@SeanFrancisN.Ballais hi now iam working in realtime chat application, this github programs are more complicated and this does't run on my local, routing problems
@SeanFrancisN.Ballais realtime chat application
 
Have you tried checking out tutorials?
 
thank you for your response brothers @shad0w_wa1k3r and @SeanFrancisN.Ballais
 
12:07 PM
You're welcome. If you face difficulties implementing it, then feel free to come back here. We do better at (and mostly stick to) objective questions with MCVEs.
 
@AndrasDeak Just spent thirty minutes looking at the Wikipedia page for "involute" without understanding how one can wind a string around a curve with no thickness
Maybe a better metaphor would be "a curve obtained from another given curve by peeling the plastic wrap off of the given curve"
 
Would be nice if type hints had support for implicit typevars. Having to instantiate a TypeVar is kind of annoying
T = TypeVar('T')

def foo_annoying(x: T) -> T:
    return x

def foo_implicit(x: '<T>') -> '<T>':
    return x
 
12:23 PM
Are type hints included in CPython or is that mypy?
 
They're included in CPython, because they're part of the core language.
If your Python implementation doesn't implement type hints, then you're not implementing Python
 
Or at least not a recent version of python
When were type hints added? Was it 3.5?
 
PEP 484 says "3.5"
 
Good to know my memory isn't failing me yet
 
Let it be known that when I say "Python" without qualifiers, I mean "the most recent stable version of Python" unless context clues indicate otherwise
I have a similar policy for Nintendo game consoles
 
12:51 PM
A recent answer ends with "So, to fix it, just make classAtom = "" or some thing. But, this wont actually fix it." I appreciate their forthrightness in admitting their answer isn't an answer.
 
can i do something like '*' * len(my_var) in jinja2? I got as far as {{ my_var|length }}, and my daily pensum of doc reading for today is at near its max
 
Looks like this'll be our next HNQ: stackoverflow.com/q/50741579/1222951
@Kevin I faintly remember that question. Have a link for me?
 
0
Q: 'ToastNotifier' object has no attribute 'classAtom'

JNPI ran the code below; from win10toast import ToastNotifier toaster = ToastNotifier() toaster.show_toast("Hello World!!!", "Python is 10 seconds awsm!", icon_path="custom.ico", duration=10) I am getting below error : File "C:\Users\jnp...

I have since discovered that this is a known issue that the maintainers aren't in a hurry to solve
 
except:
    pass #not sure of this
^ lol
 
I did appreciate that comment. There's a certain purity to it.
 
1:00 PM
@Aran-Fey Ah, right. In that case you want to use attrgetter. There's some good info here: stackoverflow.com/questions/403421/… There may be better ones, but it's a bit painful doing searches on the phone.
 
@PM2Ring Oh, that's pretty good. I was hoping for something more generic though (i.e. not specifically about sorting by an attribute; just something showing that the key parameter exists). But I'm not really sure if that's worth having/writing a canonical for
That bug report though... "'ToastNotifier' object has no attribute 'classAtom'" The end.
 
I liked the reply even more :^)
> Try to close and open python
Beautiful. This whole thing should be hanging in a museum.
 
Wonder why the devs didn't do anything about the issue? </sarcasm>
 
fwiw, {{ my_var|length * '*'}} simply works, I should have searched for an online parser in the first place and just tried stuff
 
This is the Guernica of program design
@Aran-Fey I mean... Maybe just that bug report by itself should have been enough for the dev to go "oh dang, maybe I should take out that except:pass now"
 
1:12 PM
They probably forgot about ever putting that in
 
Bare except is bad enough, but except: pass is the Python equivalent of sticking your fingers in your ears and shouting "La la la, I can't hear you".
 
I guess it would've been easy to find with a little bit of investigation, but who would investigate after a bug report like that?
 
My hope would be that the dev would read the title and think "hmm, didn't I do something risky and uncertain with classAtom the other day...?"
Then the only investigation they need is of the soul-searching variety
 
@Kevin no problem ;)
 
Depends on the size of the project I guess
 
1:17 PM
of course I was a bit late to the party, the dupe on overmeta is from 2013
 
Oh wow, that project is tiny. Forget everything I said; the dev(s) definitely should've investigated that bug
 
Welp, the non-answer answer got accepted. I guess we're done!
 
It's not a horrible solution/workaround if you use a sensible value for the classAtom, but I'm too lazy to read the win32gui docs to find out what values are sensible
 
1:30 PM
If the answerer provides a value more sensible than an empty string, I will happily retract my downvote
How to get the actual value of the string format code from the pathname pattern is interesting. I didn't know you could pass curly brackets to glob().
Or is he saying "glob doesn't do this, but wouldn't it be nice if it did?"
glob.glob("{}.py") gives zero results in my python scripts folder, so I assume that's the case
 
@Aran-Fey Not getting through: github.com/pandas-dev/pandas/issues/…
 
The guy still doesn't grasp the difference between a dict and json
 
1:47 PM
\o cbg
 
Hang on, which of these guys are we supposed to side with? The OP's dict looks reasonably json-y to me. Granted, None isn't a valid json value, but the json module can trivially convert that to null
I suspect Python os.rename() for files within multiple subfolders in a parent directory is another "you forgot to qualify your filename with a path" dupe
Or rather, it will be, when he determines that if file == 'metadump.xml': and if file != 'metadump.xml': can't be true at the same time
 
2:09 PM
@IljaEverilä picard_facepalm.png
 
2:20 PM
@Kevin It was discussed with the OP on multiple occasions that what they're dealing with is a Python dict, deserialized from JSON in a file and that it was all ok. Except for the Pandas issue.
 
2:34 PM
morning cabbage
 
cbg
 
@MooingRawr o\
 
2:54 PM
If your only tool is Pandas, then every problem looks like bamboo.
19
 
3:04 PM
wise words. What if our tool is only Python what does our problem looks like?
 
wim
@Kevin you can't. OP is smoking crack.
 
I am bamboozled by so many pandas questions these days.
 
wim
@AnttiHaapala hmmm......with what syntax?
it will be hard to distinguish a url and a local path, unless you enforce protocol/schema onto open
I do find the idea interesting, though..
 
Yeah I think the glob OP could have expressed themselves more clearly
 
wim
pathlib's glob already departed from unix style glob, so it could be a feature request to pathlib
 
done
 
rb folks
 
rbrb
 
wim
heh, so apparently if you accidentally disassemble a str of code on Python 2, you can get a bogus disassembly (but no crash).
 ~/git/requestbin   master ●  3
🐍 ...
>>> import dis
>>> dis.dis('x[1] += 2')
  1           0 LOAD_NAME                0 (x)
              2 LOAD_CONST               0 (1)
              4 DUP_TOP_TWO
              6 BINARY_SUBSCR
              8 LOAD_CONST               1 (2)
             10 INPLACE_ADD
             12 ROT_THREE
             14 STORE_SUBSCR
             16 LOAD_CONST               2 (None)
             18 RETURN_VALUE
>>>

 ~/git/requestbin   master ●  2
🐍 ..
>>> import dis
I guess it just takes the bytes as opcodes and doesn't care if it makes sense or not... the other side of duck typing :-|
 
thank you
 
wim
3:37 PM
Add the python tag for more viewership. — coldspeed 10 mins ago
lies ... :P
add the python tag for faster closure ...
 
Why not both :^)
My project has made it to the QA env, with much less glass-crawling-through than I predicted. Dare I hope that the QA to prod transition will be the same?
Somehow all the Oracle descriptor setting configuration code that I wept and bled over on Tuesday, turned out to be completely unnecessary in every environment other than my local one. They must have installed some secret environment variables that mortals such as myself aren't privy to
 
3:53 PM
I believe I have seen this passing here recently, is there a PEP that intends to make argument unpacking possible in list-comprehension?
 
>>> [*'abc']
['a', 'b', 'c']
like that?
 
@OlivierMelançon that idea was rejected
 
@Aran-Fey not a list comp
 
Yeah, I just realized. My brain is fried after working with wordpress
 
Rejected? :'(
 
3:56 PM
One of the few things I miss about 2.7 is being able to do:
x = [(2, "b"), (1,"a"), (3, "c")]
x.sort(key = lambda (digit, letter): letter)
key = lambda t: t[1] is comparatively less self-documenting, IMO
I guess I could do x.sort(key = lambda t: (lambda digit, letter: letter)(*t)) :-P
 
Or you could be sensible, and use itemgetter(1) ;)
 
wim
@OlivierMelançon what would the syntax look like?
 
I was hoping some day we could do something like that... flatten = lambda l: [*item if isinstance(item, list) else item for sublist in l]
 
wim
isn't that itertools.chain
 
Not exactly, since here a *packed_args could be considered as an expression in some circumstances
 
4:01 PM
But yeah, I'm also a little sad that tuple unpacking args is gone, but the reasons for its removal are good, as was mentioned last time we discussed it in here.
 
I think it would imply a pretty big change in the grammar
Do we have a link to what was mentionned, I'd like to read
 
wim
your code doesn't make sense
you use bind the name sublist but don't use it
and you assign an anonymous function to a name
so, what would the syntax really look like and what is the expected output?
are you asking for [*L for L in LOL] ?
 
Sorry I meant this: [*item if isinstance(item, list) else item for item in lists]
But yes, close to
 
4:05 PM
[try: *item except: item for item in lists]
 
wim
I think what you are asking about is discussed in the accepted answer: Unpacking generalizations
 
Yes, exactly
 
wim
it's not very clear to me what you're asking but it's already possible in comprehension
[elem for item in lists for elem in (item if isinstance(item, list) else [item])]
 
or write a function that returns either item or item,
 
@wim yes, that would be exactly that. Just more readable I think.
But it would necessitate an update to the grammar where unpacking would be considered a valid expression inside a comprehension only
 
wim
4:16 PM
OK. I still don't see what the isinstance had to do with your actual question.
But we got there eventually :P
 
Oh sorry about that. Suppose you have a list like that: [1, [1, 3], 4, [1, 2, 3]]
You want a flatten function that unpacks only lists
It's a thought I actually had when answering this question
 
wim
huh, why did that get closed as "too broad"
 
low effort questions are closed as broad (as they should be), but sometimes users oblige if the problem is simple enough in this case
I wouldn't have closed it, but now that it's closed, I wouldn't reopen it
 
I would have downvoted because there was no effort, but not closed, especially since it took a 2 sec edit to format it so it was readable
But yes, it's definitely not "too broad", I actually find it overly specific
 
It would have taken 2 minutes max to find a dupe, but meh
 
4:31 PM
I don't know those kind of questions are overly specific as to the exact format of input-output. There surely are dozens which are close but not quite, so I prefer to just answer
 
I bet I could find at least 3 exact duplicates
 
Ehm, bet taken?
 
Meh, only if it gets reopened
 
The question is specific, but the possible range of answers is broad. I'm not totally happy that the community closes questions for reasons that the asker can't possibly deduce ahead of time, but that's how it is.
 
Yea, probably. I guess I have not been around enough to have a good duplicate feel. I'm starting to for some overly asked questions, but not in general yet
 
wim
4:34 PM
what is the origin of the qatloos currency or whatever that kevin is always talking about
 
I stole it from original Star Trek
I dig the idea of a group of brains in jars that have a common currency which is pretty much worthless except among themselves
 
nice assist vaultah
 
wim
aah ok. is there a unicode codepoint for the quatloo
 
Is there a tribble emoji?
I mean, there's 🖖
 
Planned for inclusion in Unicode v2,200
 
5:12 PM
 
Well I was planning on using these exclusively in Nebraska... so I'm out.
 
Nebraska is centered over a vortex in space-time that causes the fine structure constant to be off by 0.001%, and incidentally makes quatloos sublimate into a harmless yet unpleasantly musky gas
 
super disappointed with the tensorflow tutorials. They're outdated and written for python2
 
They were fine for me... but then I read them back when I was using Python2
@Kevin then I must keep one of those vortexes around me...
 
5:27 PM
I just discovered a subtlety of itertools.tee. Did you know that when passed a tee object as argument, tee not only reuses the same state, but also returns the exact same tee as first return value
 
@piRSquared *vortices
@OlivierMelançon nope. Is that documented?
 
@AndrasDeak chrome teaches me how to spell. I did that and it told me I was wrong
 
chrome's wrong, you're right :)
 
/gasp /doesnotknowwhattodowithself
 
blasphemy
 
5:30 PM
google-free quiz time! What is the plural of platypus?
 
@AndrasDeak Not it is not. What is documented is that the initial generator should not be reused... but tee smartly let you reuse it when it's ok to do so
 
@piRSquared platypuses
If I recall correctly platypi is as wrong as octopi
 
platypodes
 
I was gonna say "platypi", but I changed my mind after I saw how ridiculous that word looks
 
Platypus are semiaquatic, therefore they should be pluralized the same as "fish"
 
5:31 PM
@piRSquared really? Neat :)
> platypus (plural platypuses or platypus or (common, hypercorrect, pseudo-Latin) platypi or (rare, pedantic) platypodes)
"rare, pedantic". I like that.
 
Qualities we all aspire to.
 
Speaking of animals in Australia, and by extension Australia in general, last night my friends played a trivia game, one question of which was "select all island nations". We picked Australia and we got marked wrong. There was much yelling at that time.
 
Largest island, smallest continent
 
Wikipedia says islands can't be continents and vice versa
An island or isle is any piece of sub-continental land that is surrounded by water. Very small islands such as emergent land features on atolls can be called islets, skerries, cays or keys. An island in a river or a lake island may be called an eyot or ait, and a small island off the coast may be called a holm. A grouping of geographically or geologically related islands is called an archipelago, such as the Philippines, for example. An island may be described as such, despite the presence of an artificial land bridge; examples are Singapore and its causeway, and the various Dutch delta islands...
 
5:37 PM
That's silly
 
Mostly I object on the basis that "continent" is not a terribly well-defined term
It's one of those "I know it when I see it" deals.
 
chrome is wrong and now wikipedia?! Who(m) shall I trust?
 
@Kevin that I'm not sure about
 
I know it when I see it while I'm aboard the ISS and it's still visible
 
stackoverflow.com/questions/50746992/… I listed several dupe targets
 
5:39 PM
Any landmass that isn't enclosed by another landmass?
 
wim
if australia is an island, what is tasmania?
 
> Generally identified by convention rather than any strict criteria, up to seven regions are commonly regarded as continents
 
@wim another island
 
I think the fine print involves the small stuff
the question is not whether Australia is a continent, it's whether Iceland is one
 
Iceland was also on the list and I think we got marked right for picking that one
 
5:41 PM
yup, since it's an island :P
Ice-land is pronounced as island in Olde English
(it's not)
 
wim
iirc iceland is just icelandic for island
 
The old "tricking foreigners into using generic descriptors in your language as placenames"
 
like when some Chinese loved tangerine so much they named their language after it
 
or maybe the Anglican pronunciation of the icelandic word for island
 
wim
and greenland's name is the world's oldest scam
 
5:43 PM
or may the world's (c)oldest scam
 
In Discworld, Mount Oolskunrahod translates literally to "Who is this Fool who does Not Know what a Mountain Is"
 
@piRSquared Ha, talk about optimistic
 
So I spent 10 minutes writing down the documented and undocumented reasons why they should not use tee in some particular situation. And what they answered is that they liked the example I wrote with tee and that they are going to use it...
 
That's why you don't hand out footguns with a warning sign
 
Well the footgun was meant to show a commonly handed footgun so the user can recognize that it is one when someone else passes it to them
But they just took the footgun
 
5:46 PM
Common mistake to think that generic askers think twice about what they read on the internet
 
I just feel they didn't even read the text surrounding the code...
 
@chrisz Ok. Done
 
tyty :D
 
You should make 'em work for it. Change all the variable names in the footgun so they can't just copy and paste it in. Maybe hide a syntax error in the middle.
Ooh! upload the code as an image >:-)
 
Just add a raise in the middle of the code. raise Exception("If you see that being raised, you didn't pay attention to what I said")
 
5:48 PM
call itertools eatertools, spell out tee as T
 
Upload a picture of handwritten code
 
I'm dizzy from attempting to build a conda channel and a distribution into that channel... Off to look into devpi
 
INFO:tensorflow:Saving dict for global step 20304: accuracy = 0.989, global_step = 20304, loss = 0.033256516
{'global_step': 20304, 'accuracy': 0.989, 'loss': 0.033256516}
yaay it works
 
Click here to listen to my answer in audiobook form
 
finally got that MNIST tutorial to work on py3
 
5:51 PM
0.989? pfp!
(-:
 
iirc the world record is 99.79% (.9979) or something?
fun fact: if you account for the remaining .21, you end up overfitting and your model goes for a toss
 
That's the one with drop connect and adam optimizer, I think
 
indeed the drop connect one
cool stuff
 
and convoluted nn
 
convolutional* :D
cuz convoluted=confusing, which CNNs are, but not literally...
 
6:01 PM
No. They are literally confusing (-:
but convoluted means to blend with near by stuff.
That gets used as a synonym for confusing because confusion can occur when complicated things get blended together.\
rbrb lunch
 
cbg. all
 
Other useful related words are "convolve" & "convolved".
 
This morning we briefly discussed "involute" and "evolute"
 
DSM
cabbage(cabbage) = cabbage for all!
 
How fare the numbers?
 
DSM
6:16 PM
I'm currently trying to find my way through a giant maze of twisty little functions, all alike.
 
Mm hmm, it is much the same in my own code mine
 
wim
^ eatertools
 
Nice
 
There should be one, and preferably only one, spoon
 
The Zen of dining
 
wim
6:22 PM
although the correct spoon is not always obvious, unless you're british
eatertools.tea
 
DSM
Nice^2.
 
I would take a knife, why? So I could slice strings/list of course.
 
puns will become stale in 3... 2... 1...
 
DSM
I'm willing to indulge. We only get something as cute as eatertools.tea about once a month.
 
and I like pun jokes :)
 
6:28 PM
@wim Uhh, just taking a guess here, the middle spoon?
 
I just use whatever one is closest to the plate.
 
I thought it was always the one that farthest from the plate
then moving to closest until you get to dessert, with the small spoon
 
I find it rather weird people care enough to tell someone they are using the "wrong" utensil
 
I'm sure one of us is right, and a 50% success rate isn't bad.
 
If I want to struggle to cute my steak with a butter knife, leave me be!
 
6:36 PM
Given that there are 6 different possibilities. We're ahead of the curve.
 
There are different kind of knives?
 
@MooingRawr In a world where people get really angry over other folks playing games on easy mode, I'm not even surprised
 
wim
I only care enough to tell people when they are using os.fork wrong
 
rbrb.
 
6:38 PM
@MooingRawr being a snob truly makes sense only if there are non-snobs you can look down on
 
falling down only makes sense if there are people to hear you
- the old oak, to their friends in a lonely forest
 
6:55 PM
Reminds me of a bit in the Discworld novels where the protagonists are traveling through a forest of magical talking trees and one of them addresses The Luggage, asking "Did it hurt?... Becoming joinery? Is it good?"
A question which The Luggage contemplates for some time before finally shrugging. A rare moment of vulnerability for a character whose motivation is 90% bloodthirst
The possibility that it might not like being an unstoppable monster, and preferred life as a tree, seemed very sad to me
 
00:00 - 19:0019:00 - 00:00

« first day (2791 days earlier)      last day (2140 days later) »