« first day (2789 days earlier)      last day (2382 days later) » 
00:00 - 21:0021:00 - 23:00

00:00
But anyway, you should be grouping these widgets together in a Frame.
FWIW, I use .pack layout for simple stuff, but it's a pain when you want to get exact alignment with a bunch of widgets. The .grid layout is better for that. Whatever you do, don't mix layout methods within the one container widget. And avoid the .place layout like the plague!
cbg
Can I get feedback on whether I got my things upside down here. I got a downvote, and I'm not sure if a passerby read wrong or if I actually got things wrong
@PM2Ring Maybe I need to do a grid layout inside a Frame()?
@Chenny I think so. You can use pack on the Canvas and the Frame, but use .grid inside the Frame. You can make a widget span multiple columns, the details are in the docs, and there are numerous examples on SO.
Okay i'll play around with it, thanks
01:25
Anyone familiar with issues in upgrading pip? I'm on 9.0.1 and trying to update to 10.0.1 -- it fails then suggests I ran the exact same command I just tried
01:48
I had a similar problem with permissions. Make sure you have access or try with a venv. I did that for my project and it worked for my venv.
02:25
My canned response for downvotes:
> That one downvote is quite painful and I am in physical pain right now. My fingers are melting, my eyes are burning and my nose is leaking pandas DataFrames
replace "one" with <NUM_DOWNVOTES>
news flash for Andras this is not "whining". I thought it was funny and wanted to share
03:02
@coldspeed I thot it was humerous
 
1 hour later…
04:27
yes, it tickles my funny bone too
04:39
cbg
hey, I know this is not the php room, but maybe you know
I feel your pain. But unfortunately, this is not the place to ask. I wish you luck
@coldspeed nowai this is a dup stackoverflow.com/q/50692266/2336654 (-: #Hashtag DontTakeMeSeriously
04:55
They had text data which they replaced with a (LINK TO A) picture
talk about retrogression
So confused
That turned from a dup to completely useless.
 
2 hours later…
07:13
cbg-ning
cbg =)
@Arne sup?
all good, thanks. the sun is shining and I moved to gitlab years ago, so I'm having a nice relaxed day
@Arne lmaoooo
damn
hub being acquired by msoft for a hefty sum
not really sure how msoft is seeing the value of git
@AndyK Yeah, that was an interesting piece of news
how are you?
07:26
@Arne I'm good although due to few personal stuff, it can be better. But anyway, I'l get through.
How about you, @Arne?
Could be better, but could be a lot worse, too. I'm looking forward to my first real vacation in ~10 years, which is nice.
Best of luck with whatever troubles you!
good luck & enjoy your vacation!
cbg
cbg and thanks =)
@Arne +1 for the vacation
07:45
Hellow :D I can't find reason why this doesn't work ImportError: cannot import name 'Cmd', python3
#! python3
import cm

class MyPrompt(cmd.Cmd):
import cm?
You gotta put the d back in :-p
Judging from the error message I'm pretty sure your import looks like from cmd import Cmd
@Aran-Fey Sorry import cmd, but still...
#! python3
from cmd import Cmd

class MyPrompt(Cmd):
Still AttributeError: module 'cmd' has no attribute 'Cmd'
Let me guess, your file is named cmd.py
07:49
python3 --version
Python 3.6.5
Reminder for myself newer name file with same name that you are trying to import
:D
Yeah, that trips up a lot of people
jpp
jpp
08:11
cbg all
have a pretty fundamental question which is confusing me.. we know map is lazy and an iterator in 3.x. But, technically, is it also a generator?
I often hear iterator & generator used interchangeably, but not sure that's correct (in this instance, or in general)
Note I've read this answer which says every generator is an iterator
AFAIK a generator is a function that contains a yield a statement
jpp
jpp
Yep, which (AFAIK) isn't true for map. This answer is what confused me: stackoverflow.com/a/36487011/9209546
In that sense, builtin functions can't be generators I suppose
> generator
>
> A function which returns a generator iterator. It looks like a normal function except that it contains yield expressions for producing a series of values usable in a for-loop or that can be retrieved one at a time with the next() function.
> Usually refers to a generator function, but may refer to a generator iterator in some contexts. In cases where the intended meaning isn’t clear, using the full terms avoids ambiguity.
@Aran-Fey why can't they?
^^ that's from the glossary
jpp
jpp
08:26
iter(map(..., ...)) might be a generator since you can use next with it.
@Arne Well, how can a function implemented in C contain a python statement?
Honestly I think we'd be better off if we got rid of the term "generator" because all it really does is cause confusion
jpp
jpp
But actually even iter might not be sufficient; docs say If a container object’s __iter__() method is implemented as a generator... which implies iter can be implemented for non-generators.
so accessing a builtin will call the C implementation directly, no way for there to be a yield from inbetween?
Who cares if the iterator was created with yield or not?
jpp
jpp
I agree; from a practical perspective the main thing you need to know is it's lazy.
But, from a technical perspective, we should use the right terminology.
08:40
@Arne Not sure what this "inbetween" would be. As I see it, it's a simple matter of whether or not the function's source code contains a yield statement, and what happens between accessing the function and calling the function isn't relevant
I'm not sure either. I guess I was just embarrassed to not have made the "C functions can't be generators" connection :|
@Aran-Fey generators have methods and abilities that plain iterators don't
You mean send?
And throw
jpp
jpp
@vaultah, Yep, and I suppose that comes at a price. Maybe why iterating map(built-in-func, x) is faster than (built-in-func(i) for i in x)
08:51
That may be one of the reasons
What's preventing me from implementing an iterator with a send and throw method (i.e. a generator) without using yield?
jpp
jpp
@IljaEverilä, done
It'd make more sense to define "generator" as an iterator with a send and throw method, no?
Turns out manually implementing a generator is harder than it sounds
There, a generator
09:17
Cabbage
May I suggest a brief review of what the tutorial has to say about iterators and generators? docs.python.org/3/tutorial/classes.html#iterators
> Anything that can be done with generators can also be done with class-based iterators as described in the previous section.
Aha!
So in the end, a "generator function" is defined as "a generator iterator implemented with the yield statement", and a "generator iterator" is "the return value of a generator function". And "generator" can mean either "generator function" or "generator iterator" depending on the context. And 'generators' not implemented with yield don't have a name. Hooray.
09:34
@MartijnPieters Your python tag score?
You'll probably get there in a week or two at most (:
@Aran-Fey 3 days, I'd say.
Oho. Apologies for underestimating you :D
And yes, that's the tag score. I'd be the 2nd person to get a 100k+ tag score. No prizes for guessing who the first person was.
@piRSquared thanks for this. This wasn't even the first time that user did that, but regulars are usually reluctant to help new users learn the ropes here.
@ten5 if last time wasn't OK, what makes you think it's OK now?
10:03
/20/ cripes that's a lot
10:18
recbg
@MartijnPieters please read what's been discussed about rep/score whining in the room... :D
3
lol :D
10:37
@AnttiHaapala :-P
11:17
cbg :)
11:40
@wim I've got 14 execs to 2 downvotes
12:26
morning cbg
@piRSquared afternoon
how's the room feel about cookiecutter?
@piRSquared ?
Anyone here who can assist with some questions about selenium, geckodriver and firefox
12:30
maybe, maybe not, We won't know until you ask.
Well eventually I'm trying to access a page with selenium in a tor browser, from what I read I first need to be able to start a firefox browser. So I've installed python 3.6.5, selenium 3.12, geckodriver 0.20.1 and firefox quantum 60. When i tried to just write a simple code like:

from selenium import webdriver

driver = webdriver.Firefox()

driver.get("http://www.stackoverflow.com")
this did not work, nothing happened. so I found a topic that talks about this. and I borrowed some code.
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

binary_argument = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\Firefox.exe')

capabilities_argument = DesiredCapabilities().FIREFOX
capabilities_argument["marionette"] = False

driver = webdriver.Firefox(firefox_binary=binary_argument, capabilities=capabilities_argument)

driver.get("http://www.stackoverflow.com")
this code opens the browser but it doesn't load the page I'm asking for with driver.get
@piRSquared better than nothing
so my question is why doesn't driver.get work in this situation
what I've kinda wanted to have is to have something that could reverse port changes into template though :/
@cybera The first code snippet did nothing? Not even throw an exception?
12:35
@Aran-Fey my bad, yes it threw an exception:

SessionNotCreatedException: Unable to find a matching set of capabilities
@Aran-Fey by that exception I found the topic that talked about a solution to it.
@AnttiHaapala I know @wim asked if he should write a packaging canonical. I think it would be cool to have a cookie cutter that the room thought was a good place to start... maybe. I've been working on a personal stripped down cookiecutter for personal purposes
@Aran-Fey With the latest code the browser opens and nothing happens, when I close it after a while another exception shows:
WebDriverException: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
Ok, I was just about to ask that :D
I've none of these problems when I use chromedriver, I don't get why this is so problematic :)
@TuukkaMustonen now that's epic: "seen 24s ago, talked 1957d ago"
7
12:43
@AnttiHaapala Let the code speak, not the person :)
Hey totally random question, does anyone live nearby Boston?
In USA
some might live nearer than me... they'd probably take two steps backwards now if you asked...
And the record was broken.
@SebastianNielsen i.e. you can state your question without preamble yadayada.
That is my question lol
hehe
I was just curious.
12:45
so supposed I do, then, that's it?
(I don't)
Ye :)
Sorry, I am wierdo
@cybera It seems that never Firefox versions don't work with selenium very well. I don't know what's causing the error, but you can try using geckodriver or the answers in this question
@Aran-Fey might be the !xul?
no clue
13:02
@Aran-Fey I tried the first thing, no visible change. For the second thing, I'm not quite sure how to install this xvfb, I'm on a windows and this program seems to be for linux or AIX(whatever this is) only
Oh right, you're on Windows. The path to the firefox exe should've given it away...
Well, sorry, I don't know how to make it work. You'll just have to google and try different solutions I guess
Thanks anyway man
Is there any new news re github?
Only that MS acquired it for $7.5b
I knew that 24 hours ago
or thereabouts
13:25
@AnttiHaapala talk about terse Finns ;)
@Cosmo what news could there be?
@AndrasDeak I dunno, it's a big deal
Guys, I can't seem to find the syntax word for the use of 3 dots. How is it called ? I'd like to read what it does. For instance in...
`linek[5, ...] = 1`
DSM
DSM
Ellipsis cabbage for all!
13:42
cbg
As far as I can find, I feel that ... is similar to :
but i want to be sure :(
@IMCoins it's : for "every other dimension", and uses the Ellipsis see DSM's subtle hint ;)
It's a python built-in with special use by numpy
I'll look for it, thanks. :D
So as far as I can see, it is the equivalent of : as i believed, but it does so for every unspecified dimension. interesting. :)
It's a no-op for trailing dims, arr[..., 0] is much more useful
@RobertGrant woot
which has now resulted in Microsoft handing over $7.5 billion worth of company stock
it is stock only... let's see how well it vests ...
14:00
@IMCoins There's an easy way to find out:
>>> ...
Ellipsis
Doesn't work in Python 2, natch
Another reason to upgrade to py3
Gotta have my context free Ellipses
DSM
DSM
14:20
help("...")
oh no i forgot to '\o cbg' in this morning, I'm so glad I don't have to clock in at work, pretty sure it would be often that I forget to clock in.
anyways \o cbg :D
went from pretty much all of his rep on one question to like... super killy-wow
cbg all
found the answer — LAS 2 mins ago
denvercoder9 alert
14:55
i think they found the answer below their question :D
Too bad that that answer prevents the user from pasting ostensibly valid text into the box, and prevents them from deleting more than one character at a time
I thought about telling OP to use %P mode instead of %S, because IMO it's easier to write validation rules if you have access to the complete text of the box instead of just the characters being added/removed, but in this specific instance it's not much different
Potentially OP is going to reach the point where he thinks "great, it works on integers, now I need to validate floats" and he'll change his function to permit digits and also ".". Then comes the nasty surprise when he discovers that it permits "3.14....159265..."
In the sphinx conf.py there is an option pygment_style set to 'sphinx'. Anyone know what other choices there are?
A fun curiosity: for grouping elements in a list python, I came up with the solution seq = sorted(seq, key=seq.index). This is one of the rare cases where you can't replace seq = sorted(seq, key=<whatever>) with just seq.sort(key=<whatever>).
@piRSquared Probably the same as these: pygments.org/docs/styles/#builtin-styles
Hmm, is the result of {1:x for x in range(10)} well-defined?
it would be, wouldn't it?
15:16
I'd think so
"well defined" being a concept distinct from "doesn't crash when I run it"
it can't help but loop in order, right?
yep. Well defined result
yep
loops in order
> you can specify the same key multiple times in the key/datum list, and the final dictionary’s value for that key will be the last one given.
15:18
Just checking.
Yep
I also tested it quickly
Testing is no guarantee :P
the result is {1:9}
@AndrasDeak you wot
On your machine and version. Today.
Well I mean
Any alternative result would be complicated to implement
15:20
You could even see ordered dict behaviour in 3.6 but that wouldn't happen with pypy
CPython does whatever Python requires of it, but it can also do as it pleases when Python does not specify anything in particular
what not of the result, of the process
If the language specification said "The result of {1:2, 1:3} is implementation-dependent", then you would not be able to deduce that just from running the expression in one implementation
well then it wouldn't be a set
wait are dicts not specified as hashsets?
That's implementation dependent :-)
15:22
Dicts are ordered 3.7+, sets aren't
/really/?
Interesting
wim
wim
@AndrasDeak citation ?
@Kevin I'm not even sure that applies
If you're saying "aren't dicts required to have unique keys?", yes. But dict literals aren't dicts, in the same way a picture of a pipe is not a pipe
@wim I mean I assumed that multiple times for 3.6 and was told "nope"
No citation
@Kevin I mean a dict comp, unlike a literal, has an implicit order to it
15:24
@AndrasDeak Yeah, dict literals and dict displays are apples-and-oranges. But my point applies in the general category of "syntax whose result is not objectively obvious unless you read the docs"
wim
wim
>>> sys.version
'3.7.0b1 (default, Feb 28 2018, 12:50:08) \n[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]'
>>> L = [random.random() for _ in range(100)]
>>> list(set(L)) == L
False
I only assume that there's no guarantee for ordered sets since the implementation differs
wim
wim
that's a shame
wim
wim
should have been an easy guarantee to extend to sets.
15:26
There was something about PYTHONHASHSEED...
Give or take a couple of underscores
@AndrasDeak fishslapping.mp4
I'm an injured man :P
@wim let's see how sets are implemented
wim
wim
seems to work for small sets
maybe the ordering is lost on a data structure resize
@Kevin oh I misread your original message containing the set literal
15:29
I haven't mentioned sets at all, up to this point :-)
@wim python has OrderedSet doesn't it?
or wel
@wim which ordering
insertion ordering?
Incidentally {1:2, 1:3} is also well defined, if anyone was worried.
I'm not sure if it's capitalised
@Kevin link?
15:30
;P
Apparently insertion sort dictionary ordering in 3.6 was just an implementation detail
docs.python.org/3/reference/…. The paragraph starting with "If a comma-separated sequence of key/datum pairs is given" applies to regular dict literals, and "A dict comprehension, in contrast to list and set comprehensions" applies to dict comprehensions
Perhaps it's wrong for me to call them "dict literals" since they aren't in specified in the Literals section of the docs
wim
wim
@AnttiHaapala yes
But "A dict display containing a comma-separated sequence of key/datum pairs" is a mouth full, so.
wim
wim
@Kevin are you asking about dict literals? the first key wins and the last value wins.
and IIRC that is guaranteed
so you can actually create a dict from a list of pairs, where the items weren't in any of the original pairs :P
15:34
>>> {x:y for x,y in ((True, 23), (1, 42))}
{True: 42}
Interesting.
surprisingly, or not, setobject.chas completely different code
@Kevin not sure if that was documented though...
The old setobject predecessor Kevin linked yesterday nicely used a dict with True data
wim
wim
@piRSquared I'm a firm -1 on cookie cutter for beginners
@AnttiHaapala Not explicitly in the section I linked, but you can deduce that behavior if you know that d = {}; d[True] = 23; d[1] = 42 causes d to have only True as a key
wim
wim
users new to packaging should write a setup.py by hand (it's only a ~10 line file)
15:36
the savings wouldn't be that dramatic for setobject, but there would be some space savings nevertheless
@wim reason being? beginners ought to learn it?
ok
@Kevin what I mean is that is it documented anywhere that the old key remains...
I'm writing my own cookie cutter to alleviate repeating my work
An excellent question.
wim
wim
it's necessary so you understand what cookie cutter is doing. you need to know which of the generated parts are useful and which parts are not useful/should be removed.
15:38
yeah, I'm starting simple then as I see what I need, I'll integrate into the cookiecutter
commenting
wim
wim
cookie cutter can be made minimal enough if you tune it, but there are some other horrible projects such as pyscaffold that throw in everything and the kitchen sink into the template and YAGNI
cookie cutters are nice for fullblown webapps :D
^ I'll try a full blown flask cookiecutter a little bit later (-:
wim
wim
If you're a contractor writing the same shopping cart over and over again, sure
15:40
but yea, if they do things like "oh here's your appveyor/travis-tox-ci-pipeline"
docs.python.org/3/library/stdtypes.html#mapping-types-dict mentions that it treats 1.0 and 1 the same when indexing a dict, but it doesn't say exactly what object is kept during indexed assignment
hahaha :D
Given that, I'm pretty comfortable with saying that the result of {1:2, 1.0:2} is implementation dependent
wim
wim
there is a dict literal in evaluation order here
it doesn't quite talk about insertion order into the dict though
Yeah that's over in section 6.2.7
wim
wim
15:45
given that right-left for sets was treated as a bug ...
oh right, "dictionary displays". yeah the bug ^ mentioned those too.
16:16
@Kevin let's use proper terms: undefined, unspecified, implementation-specified...
this would be unspecified
I see, since implementation-specified would imply that CPython documents the behavior somewhere independent of Python's documentation, and it doesn't
yes
or ... actually most of the CPython implementation details are "unspecified" still, because there is no requirement that "check the corresponding implementation documentation for how it does it"
wim
wim
16:54
@Kevin I mustn't be following because 6.2.7 says to me that the result is specified.
All I can determine for sure from that passage is that the value is well defined
17:15
Filtering substrings with condition is a confusing question with a confusing answer. Does anyone else smell burnt toast?
what's burnt toast?
It's a reference to the old wive's tale that someone experiencing a stroke will have trouble concentrating, and will smell burnt toast. The humorous implication being that the only reason I find the post confusing is that I'm seriously ill
I'm pretty sure there was a question similar to that recently, where wim complained about all the inefficient solutions being posted
Or did you know that already, and you were riffing off my reference, by implying that you have forgotten what burnt toast is at all, and your stroke is much more severe than mine?
The question is, how do I type that into google?
17:22
Given the edit by the OP, plus a large dollop of Uncle Kevin's Old Time Psychic Debugging Cream, I have deduced that he meant roughly the opposite of what he wrote
wim
wim
@Aran-Fey I don't remember seeing it before, but apparently I have already downvoted every answer on the dupe
and I didn't leave any comments, must have been having a bad day
ahh, right, I remember now. This was Ukkonen's thing and all the answers were O(n^2)
17:45
If we have a dupe target for "Q:how come my OS can't find this file that os.walk is giving to me? A: because it's only looking in the CWD", struggling with os.rename() function could use it
wim
wim
18:01
@Kevin how about that
Mm, it's in the neighborhood. But it's not the lack of absolute paths that's the problem, necessarily, but the lack of any path whatsoever
18:51
cbg
When I log off from my online banking, I get ...loggedoff.jsp?267WAYIV (and a lot more random letters/numbers after here)...appended to the logout URL. Is there a term I can look up to try understand what this is? The closest comparison I can make is a CSRF token but I don't know why it should be shown in the logoff URL
19:17
There are many encodings that output letters and numbers. I don't think that's quite enough information to go on
"Yes, I know that," you hypothetically think, "but maybe you can narrow it down based on the fact that it was on my online banking page's url. Maybe banks tend to use a small common pool of stable technologies, of which only a few are alphanumeric-looking encodings?". Unfortunately, I don't know much at all about the practices of banks.
I'm not going to post the whole thing in case it has security implications, but it looks like a redirect with a random string in the URL that I don't understand.
That said, en.wikipedia.org/wiki/Query_string#Tracking describes how a query string like the one you've got could be used by the server to ensure* that a series of pages are being accessed by a single user
I think the question is not so much "What encoding did they use" as it is "what's that data doing in the url"
(* assuming nobody's trying especially hard to fool them)
@Aran-Fey exactly that
19:26
My best guess is "the bank has no idea what it's doing", but then again I'm not a web dev
... it's a pretty big bank so I'd take the opinion that there's a reason
There's always a reason. Now the question is if there's a good reason.
Hmm, can eavesdroppers determine the url of https requests?
Cabbage
Wikipedia says host yes, complete url and query string no. So at least bad guys can't see your ?267WAYIV just by tapping the Internet cable outside your house
Assuming the bank is using https, and don't tell me if it doesn't, just quietly find a new bank
19:30
But it should be handled by a POST request so nothing should be in the URL?
It is using https :)
@Kevin That's surprisingly confusing, coming from an OP with that much rep; I guess that's due to a language barrier.
I'm not yet convinced that the string is sensitive, anyway.
I'll try a couple of logins/logoffs
And see if it changes
For all we know it encodes the collapsed/expanded state of the hamburger menu in the corner of the page, so it remains persistent across page loads. Or something.
It is different, and, at a guestimate, about 100 chars long
I'll check its length now
256 characters
Turns out I'm an awful judge of string length :P
19:39
Bear in mind that banks tend to be rather conservative. It takes them a while to adopt new technology, and they prefer to use stuff that has a solid reputation for safety rather than the latest techniques. They're happy to spend money on good systems, but they don't want to do that too frequently, partly for reasons of cost, but mostly for reasons of stability and reliability. So they're notorious for having ancient legacy systems with enhancements added on top.
afternoon cabbage
E.g., they may use stuff like format-preserving encryption to add security to an old system that stores unencrypted data. en.m.wikipedia.org/wiki/Format-preserving_encryption
That doesn't sound good
I'm going on the assumption that the bit I shared is not dangerous out of a 256 character string, so the bank is Halifax
wim
wim
20:29
anyone encountered this user before? they started out civil, but are becoming more and more rude
@wim he just seems extremely defensive lmfao
Never seen that person before
that ifstatement answer triggers me greatly
I have encountered them before, but they seem to work in bursts and I haven't had a head-to-head
He's funny.
"Your answer is slower than this.
- But yours does not correspond to what he asked.
- Yes, it does.
- No, it doesn't.
- Yes, it does.
- No, it doesn't."
This is what I read.
wim
wim
20:45
no point arguing with chimp
Someone responded to my criticism with "Well, we can let the OP decide if it's a good answer" today. That one almost made me laugh.
Talk about something positive instead of dwelling on the weird competitiveness of FGITW-bait.
how do y'all feel about protons?
I'm positively neutral about them.
They leave a strong impression on me.
20:54
Hello everyone
*waves*
I am using requests module to scrape a website, and receiving content back as bytes. When I try to do r.content.decode('utf-8')... i get the error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 458: invalid start byte
Any way i can convert the byte data to a normal string?
Thoughts on Microsoft acquiring Github? I hope it doesn't change much of Github but
@SShah Why not use r.text?
wait, theres r.text?, let me try one sec :)
loll I have used requests for a while and never knew there was r.text xD
I have often been troubling myself trying to decode the content after using r.content
00:00 - 21:0021:00 - 23:00

« first day (2789 days earlier)      last day (2382 days later) »