« first day (2678 days earlier)      last day (2270 days later) » 

7:04 PM
2 to go...
 
wim
@AndrasDeak I'll put it again
yesterday, by wim
@PM2Ring What better time to learn about numpy than when you're fumbling around with 2D structures of numbers using a list-of-lists ?
 
We're finally at 900,000 questions tagged with !
8
The total view count stands at ~1.85 billion, which is 6% of total SO views, moving to #6 (#questions and #views) from #7, thus overtaking . Compared to last time (800,000), there has been a growth (in views) of 8%, which is the highest growth in the top 10 tags! The growth in views is staggering, mostly because the 2nd best growth (top 10 tags) is from javascript with a mere 0.9%!
24.76% questions are unanswered, an increase of 2.7% from last time, but overall slightly better than the average of 28.71% on SO.
We receive about 16-19k questions monthly, which makes us 2nd most popular after javascript!
Also, if you search [python*] or [django*] (paste exactly that in the search bar), we are already over 1M questions (1.042) :)
phew, now I can go and sleep in peace :D
 
Thanks @AshishNitinPatil Its fun seeing that. Rbrb
 
wim
overtaking PHP is a bit like beating up the weird skinny kid with glasses and taking his lunch money :(
 
@ZackTarr The data science guy in me likes fooling around at times :D
@wim but that's just #views, we're still 2nd most popular tag!
 
wim
7:14 PM
@MartijnPieters deleted
"I don't know" is certainly not a worthwhile answer to have lying around
 
Anyone hear about this yet? Facebook came out with their own VPN. Which is weird since they are know for gathering data to sell. gizmodo.com/…
 
"weird"?
 
wim
inaccurate description
facebook bought out Onavo is more like it
 
Your right thats a bad word. backwards works better I suppose. They came out with their own spy ware which is being advertised as a VPN. It probably does the VPN piece but likely is keeping a log.
@wim Probably true
 
wim
fits right in with "gathering data to sell"
not sure what's weird about that
 
7:23 PM
@wim are you reliving past traumatic experiences?
 
But what is that VPN used for, its labeled protect?
 
I don't understand what you don't understand.
 
me, too
 
No worries. Was just sharing the article. The main point was that VPN's are typically for hiding on the internet and this one is likely not going to give you that.
Not sure why one would need a VPN through the site but I guess there may be some uses out of it. Likely its what wim said and they bought out the company and added its functionality to a spot on the site
 
@wim great! I much rather have the community delete a post ilke that than me as a moderator; easier to swallow for the OP that way.
 
7:27 PM
rbrb
 
> the Onavo appears under the “Explore” list just above the “Settings” menu. I’d recommend you never click it.
Famous last words: See that button? Don't click it!
 
@Code-Apprentice But if they do click it. They will swear to the IT guys that they didnt even know it was there. Or that its new...
 
oh darn you over shot me lol I just sat down adn didnt see it lol
 
7:37 PM
Hey @AndrasDeak does this go along with that deep copy topic from earlier? stackoverflow.com/questions/48794882/…
 
no
Well, depends on what you mean. It's just plain old mutation.
 
wim
@MartijnPieters with great power comes great ... hesitance?
 
if you haven't read them, the links here might be enlightening
 
Okay awesome. Thanks. I like know what mutation is but not well enough to apply it or see it in use just yet.
 
it's pretty fundamental and if you don't have a firm grasp on the concept (along with how python names work), it will bite you when you expect it the least
 
wim
7:50 PM
ugh, can someone modify the dupe to something better?
 
rhetorical question? :P
 
wim
I don't want to re-open because Jean-François Fabre will whine like a baby, but that's really not an ideal choice
 
so why not edit yourself?
 
wim
because I don't know off the top of my head a target
 
I see
so when you said "can someone modify" you really meant "does anybody know of a better target"
 
wim
7:52 PM
yes
 
but the question has two answers so perhaps the exact dupe isn't all that crucial...
 
wim
+1 english for you
I think it's pretty clear the question is about why the global statement isn't necessary here
 
that's not at all how I read it
it's more like "omg magic happened to my list"
to which the answer is "how does mutation work in python" or something
 
wim
they explicitly wrote "without using return function or global statement"
 
that's right
 
wim
7:54 PM
and then reused the name as a local variable
what that has to do with cloning or copying a list? nothing.
I think it's a scoping question not a mutation question, but feel free to disagree.
 
I'm not saying the dupe is good, I'm just saying the global statement might not be crucial
but I have neither the power nor the interest to do anything about that question
 
wim
8:07 PM
tfw when you link a bad question in to room 6 release_the_hounds.gif
 
Calling iter on a list returns a list_iterator instance. Does anyone know if this class is an implementation detail or if I can rely on it to exist? Also, is there a way to access it without having to do type(iter([]))?
Hmm, pickle instantiates it exactly like that. Guess I'll do the same.
 
wim
I think it's impl detail. And I don't know any better way than type(iter([])).
the reason I think they're impl detail is that there's something weird going on with the reversed iterators, see here for further details.
 
8:24 PM
Alright, thanks. Looks like I'll have to loosen my iron grip around factory methods and add iter to the list of permitted factories.
 
@AndrasDeak Ive made it a long way without running into it. But yes I need to know it well so I can catch it in the future. Im sure its a hard "error" to find in many lines of code.
"You are going to go far my friend" stackoverflow.com/questions/48795620/…
Ouch... lol
 
Is there a way to unpack an iterable and set missing values to None? Looking for a better way to write factory, args, state, values, items, *_ = tuple(redux) + (None, None, None)
 
DSM
Needing that feels weird.
 
Blame pickle. The __reduce__ method returns a tuple with 2-5 values.
 
I love oneliners but there's nothing wrong with if len(redux) == _
 
8:35 PM
I spend all day waiting for other people's work to finish so I can finish up my work; they still aren't finished :(
 
@Aran-Fey itertools.chain with cycle([None])? :D
don't know if that would actually work
 
That'd probably hang xD
 
without the *_ of course
 
Then it'd crash, no? I gotta try these
 
DSM
@AndrasDeak: I tried something similar but it didn't work because it tried to pull an extra element.
 
8:39 PM
I was counting on the lhs setting the number of items to grab, but I won't be surprised if it errors
 
DSM
Frankly even using *_ is smarter than what I'd have done, my idiom is typically (tuple(redux) + (None,) * buffer)[:5] for padding..
(not that I do this frequently, I'm mapping my pad idiom into this context)
 
@KevinMGranger Hmm, I think that'd make my code less readable. The code goes like this:
factory, args, state, values, items, *_ = tuple(redux) + (None, None, None, None)
if values is not None:
    values = tuple(values)
if items is not None:
    items = tuple(items)
return factory, args, state, values, items
Not a fan of adding more if statements to that.
 
I don't know what you're doing but... have you considered not using pickle? :P
 
he's doing exactly that
 
which is correct: "a UI issue" or "an UI issue"
 
8:42 PM
a UI issue. "you eye"
or "you-ser" :P
how would it be "an"?
 
it feels so wrong to type 'a' ' ' 'u'
 
"a usurper", "a unique solution"
 
DSM
"a university"
 
I guess I stuck with that broken english rule where it should be 'an' for a vowel
similar to i before e except after c kind of thing
 
UI starts with a consonant ;)
 
8:43 PM
I think "a UI issue" is correct
 
DSM
"a house" but "an hour"
 
A E I O U are vowels o.o
 
j is a consonant and clearly both UI and user start with j
 
I know the rule is broken and I was using 'a ui' but it felt wrong to me somehow just wanted to clarify it :\
 
8:44 PM
The important thing is how the word is pronounced, not how it's spelled
 
DSM
Random thought: for some historical languages, we can use rhymes in poetry to determine how pronunciations have changed over time.
 
I think I've seen some weird things in Shakespeare? Is that possible?
I'm unsure because I've seen very little Shakespeare...
 
DSM
How difficult do you find listening to Shakespeare? I always wonder that about non-native speakers.
 
awfully
 
DSM
By contrast, how far back can you follow spoken Hungarian? A few centuries?
 
8:48 PM
I've only heard a few prominent lines spoken, but I've looked into some plays and poems and it breaks my brain
 
DSM
(I'm assuming there are classic Hungarian plays which use archaic language.)
 
@DSM uuuuh honestly I don't know, few centuries easily
there's a large temporal gap between first language fragments and stuff that's commonly taught in school
there's a fragment left from 1055 which is only legible if they tell you what it means
the oldest fully Hungarian piece of written text is late 12th century, and it's a bit better. The text is unreadable, but when it's transcribed to modern Hungarian it's sort of comprehensible
both words and grammar are very different
now I googled a bit and found some biblical texts from mid XVIth century, and while it's archaic both in wording and alphabet, it's comprehensible if one takes the time to read it
I seem to recall that during the reformation one of the aspects of the opposition between catholicism and the rest were that while the catholic church would only preach in Latin, the others started giving ceremonies and whatnot in Hungarian
unfortunately my history background is patchy to say the least
 
DSM
9:05 PM
Shakespeare sounds like a mix of old-fashioned and very "poetic" but comprehensible sentences and words and word usages that simply have to be learned to most modern (English-speaking) ears. There are a fair number of false friends.
 
one of my favourite poems is his Sonnet LXXV, but I can't appreciate it as much in its original as the Hungarian translation I'm familiar with
(it's a really really good translation)
 
DSM
That one has almost no words in it which wouldn't be understood these days. "surfeit" is seldom used as a verb anymore, but I don't think anyone would be puzzled by it.
 
yeah, it seems reasonable, but the sentence structure is just too exhausting
of course it's unsurprising that I find the translation easier to parse :)
 
9:32 PM
He made words up regularly, the number of words he used exceeds the word count of some european languages.
 
I'm somewhat skeptical
 
And in answer to the original question, yes, lots of shakespearean jokes don't make sense anymore because of changed pronunciation.
 
DSM
I think it's hard to tell which words he coined and which words he's just the first recorded user of.
 
A famous example would be the title of his play"Much ado about nothing": the title has double(and possibly triple) meanings, Nothing would be pronounced "Noting", making the title "Much ado about noting"
 
or the one with the brute
 
9:40 PM
I'm relatively sure he would have still pronounced it Bru-tay. At any rate, the character was real and not Shakespeare's creation.
 
no way
 
Marcus Junius Brutus (the Younger) (; 85 BC – 23 October 42 BC), often referred to as Brutus, was a politician of the late Roman Republic. After being adopted by his uncle he used the name Quintus Servilius Caepio Brutus, but eventually returned to using his original name. He took a leading role in the assassination of Julius Caesar. Brutus was close to General Julius Caesar, the leader of the Populis faction. However, Caesar's attempts to assume greater power for himself put him at greater odds with the Roman elite and members of the Senate. Brutus eventually came to oppose Caesar and fought on...
 
Mind. Blown.
next you're going to tell me that Caesar was real too
 
Also edible
 
wim
tup = tuple(redux)
tup += (None,)*(5-len(tup))
 
9:43 PM
@AndrasDeak Now saying that Caesar was real would be a bit to far...
 
wim
@Aran-Fey ^
 
I was looking for the article on google, and the next suggested search was "What language did Shakespeare write in?"
 
@wim That's only a microscopic improvement :P
 
9:59 PM
hey
can anybody help me with this https://stackoverflow.com/questions/48774830/manipulating-values-in-tkinter-python
I have been trying it out for too long with no luck
 
Are we back to this Brutus thing again?
 
wim
10:46 PM
@Aran-Fey well I thought that removes your if statements, but I guess I misunderstood something
 
Nah, the if statements do something else. They're turning iterators into tuples.
 
hey guys, i have a very general question, not specifically about python.
If I'm creating a project with a GUI and algorithms on the background,
wouold I name the GUI file as the name of the project?
i've lways been curious
 
I'd name the gui gui.py. If you're worried that your users won't know which python script they're supposed to execute, you're doing it wrong anyway - all the scripts should be hidden away in a folder, and the users should only see that folder and a Your Program.py
 
Right, that's what I was going for also, but I wasn't sure what exactly YourProgram would handle.
 
It shouldn't do much more than from project import gui; gui.start()
 
11:00 PM
I see, thanks!
 
11:38 PM
cbg. From a 10-second glance at this does it look familiar in proper python exception handling? A question was raised today that happens to have the same nonsensical error in the library I had at work today and I've traced all of it back to this, which I'm not sure I've seen before
 
exceptions are usually subclasses of some kind of Exception, but I can't say more
...but that doesn't look like an exception
 
@AndrasDeak the exceptions themselves are, but this looks like some kind of mapping of hex values to a specific exception
basically, this module just seems to throw "ConnectionError" really inappropriately
 
what makes you think it's coming from that class?
 
But they don't just raise an exception, they call a method on the parent class that then seems to use that method to translate to a methodn exception
An example starts here
 
that class seems to be a helper to use ModbusExceptions.IllegalFunction and to decode numeric codes to named exceptions
(based on my limited experience this doesn't look very pythonic to me)
you usually encounter a situation and raise the exact kind of exception you want to raise
 
11:43 PM
@AndrasDeak it almost looks obfuscated me tbh but I can't talk from a huge amount of experience. I don't see why the exception isn't just raised directly
From the exceptions.py there's not a whole lot that can be raised
 
ah, because the "exceptions" defined in the class are not exceptions and they are never raised?
 
And it just seems to be defaulting to ConnectionError when you input incorrect values. Then there's the random camelCase in doException which makes me wonder whether this is a bit of a hodgepodge approach
 
ModbusRequest.doException doesn't actually do an Exception
If you search for raise most of the raises use the actual exception types. The weird NotReallyException cases look more like this: github.com/riptideio/pymodbus/blob/…
if by "ConnectionError" you meant "ConnectionException", that's different from the class you originally linked, and it's raised manually (see e.g. github.com/riptideio/pymodbus/blob/… and async.py)
 
Damn it, I can't test until tomorrow :(
The question exists though: stackoverflow.com/questions/48796606/…
 
I suspect that your doException remarks on that comment thread are a red herring
 
11:53 PM
Very possibly so
I'll have to wait until tomorrow now. But the issue still seems common to both problems: the library throws an exception based on "connection" and in both our cases, we can connect just fine. It doesn't actually end up including any real info on the issue.
"1) When a parameter is wrong - it raises connection error." from the OP. I wouldn't expect an SQL query, for example, to say that my connection was broken if I had a malformed query
 
That's a different matter. The library might still be nonsense, but it is possibly a different kind of nonsense
 
But the assurance for me is that it is nonsense because I had a real hard time trying to understand how the exceptions mapped out across the library. Thanks for looking at it for me.
 

« first day (2678 days earlier)      last day (2270 days later) »