« first day (2806 days earlier)      last day (2367 days later) » 
01:00 - 19:0019:00 - 00:00

19:00
Let's see, my Python 3 install is using tcl 8.6, and my 2.7 install is using 8.5. This may explain the seemingly contradictory behavior I've experienced in the past
@Kevin The best I can find is stackoverflow.com/questions/31762577/… but I remember answering, or at least commenting on, a question a few months ago where the OP was able to open a PNG file in Tkinter without using PIL.
Ah, here we go, a comment from Terry Jan Reedy a Python core dev who maintains IDLE:
tk 8.6 supports .png. The Widows 3.4.z installers install tcl/tk 8.6.z On *nix, it depends on what the system comes with and what a user upgrades to. That is why your program could work with one machine and ont another. OSX will have 8.5.z unless a user somehow upgrades. The PSF 3.5 installers for OSX will install 8.6 if it is then possible. — Terry Jan Reedy Dec 22 '14 at 22:40
And
Correction: the PSF 3.6 (not 3.5) installers will, hopefully, install tk 8.6. For 3.5, one can use a different installer, such as one from 'Homebrew'. I am not on OSX and don't know the pros and cons of alternate Python-Mac installers. — Terry Jan Reedy Oct 22 '15 at 2:26
@coldspeed I just had to get an ugly green identicon :P
Stop it you'll give me trust issues
19:17
whoops, don't want that secret to get out
wim
wim
@coldspeed re-opened :P
for carrots 🥕🥕🥕
That's very clever, had not seen that
take my carrot right now
@wim Um, that's "caret", not "carrot".
he knows
19:19
I thought he was doing that on purpose ^
k
wim
wim
OP is from the future
Andras seems to know what everyone knows... that's gr8
at least I'm pretty sure he's an educated guy etc etc
okay, there's a vote war descending on that post
I dislike downvoting the accepted answer, it's perfectly reasonable
wim
wim
19:21
LOL
user2285236
@coldspeed Thanks. I am embracing anonymity. :)
it is, but there's also a built-in solution for that problem
wim
wim
It's reasonable, but suboptimal
Also, @wim is that caret thing documented somewhere? I ctrl-f'd caret and ^ on the datetime page and couldn't find it
@user2285236 LOL, wrong default username guy. Also, hi ayhan!
wim
wim
19:21
someone downvoted my answer too shrugs
It's documented in man strftime
@wim it's called caret and you know it
@coldspeed Frivolity is ok in here, but it looks unprofessional in an answer. IMHO.
wim
wim
Python just uses strftime for that stuff
user2285236
Hi :)
Ah, that makes sense
19:22
@wim not me. If any reason, it'd probably be because you reopened the post. But eh
+4/-3 yikes
I'll gladly turn my downvote into an upvote if you remove the veggies from the answer. Way to many people think it's called carrot and propagating this madness won't do :P
lol... the nits that people pick on, I tell you
this is a very wim-specific nit, I know he can do better
wim
wim
Was yr downvote for putting salad into an answer? Seriously?
19:25
it would be nice to have that niche feature be solidified in a good Q&A
guess he's more of a carbs guy
carrot means no, and even if it meant a caret including it in an answer on main will only propagate this confusion. This is how you end up with "begging the question"
like, English will be your fault from now on
@coldspeed that being said I'm not a huge fan of vegetables
@wim what version of python are you using that allows the caret, I keep getting invalid format string
@AndrasDeak and "for all intensive purposes".
@user3483203 works in 3.5-3.7
@PM2Ring noooooo
19:33
@user3483203 Also works in 2.5, 2.6, and 3.1
>>> sys.version
'3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]'
>>> getDate = datetime.date.today()
>>> getDate.strftime("%Y-%^B-%d")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid format string
I believe this is a glibc extension. It's not in the C standard or the Python docs (which give a list of standard-supported format codes and say that anything else is up to the C library routine). — user2357112 46 secs ago
wim
wim
this is not a Python thing
it's a strftime thing, as I said earlier.
so perhaps it doesn't work on windows
Silly "intensive porpoises" meme thingy: memegenerator.net/img/instances/36680492/…
19:34
@wim that should probably be part of your answer. Consider [edit]ing it :P
wim
wim
@user3483203 you on windows?
@PM2Ring never seen it, fortunately
@wim, yes worked fine on ubuntu, but it definitely seems system dependent, for example:
administrator@testvm1$ docker run --rm -it python:3.6-alpine
Python 3.6.5 (default, Jun  6 2018, 23:08:29)
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> getDate = datetime.date.today()
>>> getDate.strftime("%Y-%^B-%d")
''
>>> getDate.strftime("%Y-%B-%d")
'2018-June-22'
>>>
the alot yes, several times, love it :) Unsure about the former
yeah, I think I remember the riding-a-manatee part
wim
wim
19:49
@AndrasDeak yeah. done.
LOL at the physics note on the bottom of datetime docs.
@user3483203 wow, crazy failure mode.
@wim thanks
wim
wim
great job, 3.6-alpine. no exception, but here's an empty string... ??
perhaps it just included relativity
Hello Guys, have anyone ever dealt with shadows in segmentation?
20:06
cbg. I got a big HTML file, and actually this fails to open on most pc of my friends. How do I effectively split this in parts? it has like 334826994 symbols...
python executable already ate 2gb of memory with text in variable
@MaxLunar holy moly...
why is it html?
wha tdo you mean "split this in parts", the same way that you split any file in parts :D
it is extract of one old chat. I dont know why it is html either, I didnt created it.
wim
wim
20:28
wow, if statement in golang makes a scope
weird
20:41
I just got a Job posting for GoLang dev 60k-80k :\
that seems... low
Really depends on where it is/what level it is
wim
wim
json.loads(json.dumps({'False': 3, 'false': 2, False: 1, 0: 0})) # guess the output
I mean really guess it !
what was the desired experience/description?
wim
wim
don't type it into your interpreter (yet)
20:43
{0:3}?
that's the craziest I can think of
Didn't click into the posting just saw the title and pay
wim
wim
nope
not an error, right?
wim
wim
it's not an error
heck, I'll just copy it
wim
wim
20:44
you can figure it out using the wet interpreter
I think the first 2 will get joined but not the third
but I don't know which value for the first 2
way too late for wetware
wim
wim
there are no surprises, just 2 levels of weirdness to see..
I get NameError: name 'json' is not defined :p
yeah, I couldn't have guessed that
20:45
jokes aside, I don't understand that output
Well that's strange
yikes
Although the more I think about it it does make sense
actually, you're right. Keys in JSON MUST be strings
anyway that weirdness is guaranteed on python3.6
DSM
DSM
Apparently duplicate keys are allowed by the spec, but they're not always supported.
20:47
unless i dont understand json at all... which if that's the case I look like a fool :D
well thanks, the world 'False' looks wrong now
semantic saturation FTW
So Wim are you going to give us the answer or should I go open my repl.it
that is also not what I expected
it's different on python 3
20:51
oh ?
I added some quotes to that one
I'm also just not gonna leave that up in case someone's late to the party and it influences their guess
this is why my guess is in spoiler mode :D
oh but
yeah it is different in p3 anyways
20:55
@miradulo thanks, I'll have to think about why that works. Sorry for the late response; I was in commute and forgot to get back to you
oh, right, I think I know why: because the result spans from 0 to bins.max(). When I said "not sure how bincount works" this is exactly what I had in mind: I didn't know if it only used bins corresponding to unique values in the input, or every integer (now that I think of it the former wouldn't make much sense)
I've just earned the badge which has only been awarded 22 times. Really?
For something so ubiquitous, I'd imagine more would've earned it by now?
@AndrasDeak Yeah, I was trying to be clever and make a mistake in the first version with ptp!
:)
it's a neat solution none the less
time for ping pong will be back to rbrb later :P
huh!? You can't rbrb2rbrb!
21:02
@coldspeed I'd expect to be much more ubiquitous across languages
You're right, but only a bit. 57 awardees
MP's at the top of one of those lists and not the other
Top of the list... nice
rbrb \o :D
cbg
Had my skills test for that devops job yesterday
went well. I was surprised by how involved it was. They gave 2 hours and I needed nearly the whole time.
wim
wim
21:20
@MooingRawr well done
21:36
@AndrasDeak thanks :) I saw a similar use of ufunc.at deep in a Divakar answer once that prompted me to figure out how it worked.
he's like that I guess ;)
are his answers as confusingly great in matlab as well?
yup, all sorts of multi-dimensional magic
such as this one
though that answer doesn't have to be that cryptic nowadays, since matlab has started supporting array broadcasting (which is what bsxfun used to do)
wim
wim
huh. Divakar compared to Ramanujan.
more surprising than 22 list gold badgers, there are only 22 numpy gold badgers.
looks especially like magic to me having never touched matlab :P
@wim soon to be 23 if you answer 13 more questions!
Anyone know how to get related fields after a join? Explore has views... When I do explore.views it returns a sql statement.
Explore.query\
.join(Model, Explore.model_id == Model.id)\
.filter(Model.name == model_name)\
.filter(Explore.name == explore_name)\
.first()
wim
wim
22:06
@miradulo true, it's my next one tracked ..
Is there a way to order stackoverflow.com/help/badges?tab=tags&filter=gold by number of times awarded?
SELECT view.id AS view_id, view.date_created AS view_date_created, view.date_modified AS view_date_modified, view.name AS view_name, view.settings AS view_settings
FROM view, explore_view
WHERE %(param_1)s = explore_view.explore_id AND view.id = explore_view.view_id
you can try to scrape those
Is what it returns
actually, lemme try this
wim
wim
I turn my nose up at web scrapping
22:08
each badge is enclosed into same div
it would be great if each div had its own id
@wim not that I know of
im not sure. i never used bsoup, and knowledge of regular expressions is low too
Yeah I don't know if you can order them. Ha someone got a gold badge in in 2012... and has remained the only gold-badger ever since.
wim
wim
meh my parsing got stuffed up by
i got the solution - find all that matches the pattern number+space+awarded
help
([0-9])+\ awarded
this pattern worked in regexr.com, but not in python
:c
no need to regex
I'm glad wim's version suffers from ellipses, just like my half-finished one
I guess we should parse the urls instead
wim
wim
oh the short tag name, yeah, don't really care.
A good interview question would be to go down this list until the candidate couldn't tell you what the thing was
I would fail at line 33 ...
what is the wpf?
wim
wim
/me blank stare
22:33
.Net front-end thing. That counts as "knowing what the thing is", right?
if so I fail at 40
wim
wim
22:56
it's a framework, not really a "front-end thing"
"some windows bs" would be acceptable answer :P
..okay we tied :(
wim
wim
23:42
Oh good, they fixed that bug:
>>> import ast
>>> ast.literal_eval('1+2')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Python-3.7.0b5/lib/python3.7/ast.py", line 91, in literal_eval
    return _convert(node_or_string)
  File "Python-3.7.0b5/lib/python3.7/ast.py", line 90, in _convert
    return _convert_signed_num(node)
  File "Python-3.7.0b5/lib/python3.7/ast.py", line 63, in _convert_signed_num
    return _convert_num(node)
  File "Python-3.7.0b5/lib/python3.7/ast.py", line 55, in _convert_num
what? why 1+2 is malformed
i dont understand this one because it is not a function call
1+2 is not a literal
I suspect it used to work because 1+2j is a literal
hm, but '1-2' works fine (at 3.5.4)
and so it no longer supports complex numbers the wrong way around, interesting.
@MaxLunar try 3.7
23:48
but that isnt works with *
@wim: Hooray!
also, what could go wrong with addition/subtraction in literal eval?
wim
wim
It's just wrong and contrary to the documentation. binop is not a literal.
@MaxLunar literal as in literal
> The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None.
Now if only there were some way to represent an empty set in literal_eval.
23:51
ha!
wim
wim
in 3.6 you got weird stuff like
>>> ast.literal_eval('2017-16-22')
1979
>>> ast.literal_eval('2017-06-22')
SyntaxError: invalid token
so they got rid of the easter eggs :(
wim
wim
they also fixed the dataclasses repr bug
hmm, so what am I going to patch now?!
quick, break something
wim
wim
they are fixing the bugs faster than I can find them
23:52
you can patch out that nasty assignment expression syntax if it makes it into 3.8
i'm waiting for effective threading in new python versions. I dont like the processes.
"Effective threading"? As in no GIL?
yup.
python doesn't have a GIL
wait WHAT
23:54
cpython does, and I suspect it'll have for a long while
aren't stuff like jython and ironpython mature enough to use?
ok, I should correct myself
i'm waiting for effective threading in new cpython versions.
Aren't Jython and IronPython still on Python 2?
wim
wim
threading works perfectly well thank you
@user2357112 I have literally no idea
wim
wim
they are both effectively dead afaik
23:55
:(
whats with the performance of threading?
wim
wim
even pypy is remaining python2 focused
Someone else said stackless is dead too, so what alternative implementations are left? Only pypy?
wim
wim
micropython
I thought that was a special lightweight thing for embedded applications or something
wim
wim
23:57
@user2357112 first you need a way to represent an empty set with a literal
which is not to say that it's not a valid alternative implementation, just not one I'd imagine to use for general-purpose programming
and again I just have vague memories from reading about it a few years ago, so I could be completely off the mark
Is Grumpy dead? I feel like it was probably dead on release, but I don't really know.
It is. Not really built for things like speed, rather space and controlling microcontrollers. @AndrasDeak
@Simon "not really built for things like speed" <-- python in general
wim
wim
jython was never good in the first place
23:59
Ok. I'll rephrase that. Pypy has been optimised for speed, micropython has not @AndrasDeak
wim
wim
I suppose you could say it's "mature" like a vinegar
01:00 - 19:0019:00 - 00:00

« first day (2806 days earlier)      last day (2367 days later) »