« first day (2589 days earlier)      last day (2367 days later) » 
00:00 - 22:0022:00 - 00:00

12:46 AM
🚆 on the train to Montreal for PyCon Canada
 
1:03 AM
Rhubarb all. : )
 
 
2 hours later…
3:01 AM
recbg
 
 
1 hour later…
4:28 AM
sleepy evening cbg
 
 
1 hour later…
5:53 AM
G'morning cbg
 
cbg
Good Morning
python-social-auth getting "AuthStateMissing: Session value state missing" error...tried this yet no luck ! github.com/omab/python-social-auth/issues/534
Any idea?What exactly causing this?
 
hey is there anyone who know pyqt
?
 
6:11 AM
@NimishBansal room rules
 
6:24 AM
cbg
 
QLineEdit in PyQt5 has setDragEnabled.but QPushButton dont have setDragEnabled.So how could I able to drag QPushButton and drop it into COmbo or a listview
 
7:09 AM
 
7:23 AM
whats that?
 
cute animal
 
what is that? Emo parkour?
 
@piRSquared sometimes that's about it. The voice of Woody Harrelson freaks me out in particular
 
7:38 AM
hehe, yea
 
And the actor who voices the black guy voices everyone from Denzel Washington to LL Cool J
He's an amazing actor but his voice is overused
@JeremyBanks missed opportunity to call it PyCan;) Hope you'll have fun
 
8:00 AM
rbrb
 
8:14 AM
cbg
 
hey guys which testing framework is latest ? I mean which has lots of features ? which one I should probably start using ?

unittest or unittest2 ?
 
@jeyanthinath you should be using pytest.
 
@AnttiHaapala I am using pytest to run test , but to import I used unittest
 
8:36 AM
you're doing it worng
you don't use unittest any more
you just use py.test
you'd also use fixtures and bare assert.
 
cbg...! Is session will lost if redirect to another domain in django?
 
no?
@SaravananN but then the new domain naturally cannot see your session
 
@AnttiHaapala I'm python-social-auth app for facebook login. when redirected to facebook.com it agian return to our domain then getting error "AuthStateMissing: Session value state missing". when checking cookies response cookie is blank??
referenced this github.com/omab/python-social-auth/issues/534, yet not resolved.
 
Possibly Facebook isn't redirecting back to your application with the state URL parameter
 
@RobertGrant I have checked facebook redirected with state parameter, it works in localhost. issue only in production server.
 
8:48 AM
Okay, well then it looks to be a problem with your config with Facebook, or you have an inconsistency between your environment and production
Good luck :-)
 
:D
(you'll need it)
((thank FSM I don't need to work with FB auth any more))
 
@RobertGrant ok
 
14 hours ago, by JGrindal
You'll have to do some research, but you seem like a keen mind with a sharp wit about you, so I believe you'll prevail.
 
=D
"How to gently tell people that you are done spoon feeding solutions to them."
 
hmm, I upgrade to django 1.11 and when I use MyModel.objects.create(id='some_id', **kwargs) now, the object gets created with an id of some_id, where before django's default AutoField id field would generate the id automatically
can anyone confirm this change happened? (I don't mind not passing id, just making sure the version upgrade is the cause of this change)
 
9:02 AM
new versions usually come with release notes that detail API changes
 
I didn't upgrade from 1.11.6 to 1.11.7
fishing for someone who knows is a lot easier than going through 10+ sets of release notes
 
I agree!
 
@Mosho I guess
 
9:56 AM
@Mosho grown up talk time: people aren't here to give you loads of free help for detailed stuff that's in documentation. And even if someone does help you, you have no guarantee that they did a good job unless you...read the documentation. Getting used to not always doing what's easy is a good idea.
If I appear harsh it's because I just watched episode one of The Punisher and frankly given what I just saw that guy do, anything now seems reasonable
 
10:27 AM
Cabbage
 
jjj
cbg, is Punisher any good? @RobertGrant
 
cbg
 
Good so far. Better than Iron Fist; worse than Daredevil. But then, that applies to almost all TV.
 
I don't know what Iron Fist is but what it should be is a cross-over between Iron Man and The Addams Family
 
jjj
:D thkns, Ill give it a try
 
11:02 AM
The paint from my downarrow has started to erode off. I'm not sure what that says about my keyboard habits
 
11:38 AM
@Mosho sounds like a sensible change
 
12:27 PM
Cabbage
 
cabbage
 
I can't figure out how this OP gets their current output. But clearly it's obvious to the 3 answerers... stackoverflow.com/questions/47350334/…
 
they are looking for a transpose...
 
@AndrasDeak I assume so, but there's some kind of transposition happening already.
 
it's just clear as mud, and nobody should be guessing
at least Cory yielded
 
12:43 PM
@AndrasDeak Oh, good. I wasn't expecting him to delete, but my comments often have that effect. :)
 
@AndrasDeak Aye, but still: bits, xor, and taking the 1st of all etc. I wonder if they're at cryptopals :P
 
:)
if they're your cryptopal, you help them
 
Oh no no no, not like that.
 
Cabbage
 
I helped by voting.
 
12:46 PM
When dealing with algorithms... I know logorithms... like log_2(16) == 4 (log base 2 of 16). What does it mean in logorithms when we say just O(log n) ... What is the base... What does that translate to in my basic understanding of logoritms...
 
it doesn't matter
log_a(b) = log_c(b)/log_c(a)
so the difference in changing a base of the log is a constant prefactor difference which doesn't affect the big-O scaling
 
Ooooo
I see
 
it can be your favourite logarithm
 
anyone experienced with SQL Alchemy here? I need help modifying its behaviour which would most likely involve monkey patching
 
@Johnston What Andras said. But often the analysis that led to the formula uses base 2 logs because the complexity is a function of the bit length of n.
@Johnston BTW, what is that thing in your avatar? Is it perhaps a speed camera, or a stereo camera?
 
12:51 PM
hahaha. @PM2Ring it's one of those things you look at the statue of liberty with on top of the empire state building
I don't know what it's called
 
@PM2Ring it's one of those binoculars you put money into, at tourist locations
 
Ah, right.
 
@Petar exactly
So when we say O(log n) what are we saying?
 
I say oh log enn :P
 
@Johnston That the complexity / run time is a linear function of the number of bits in n
 
I thought O(n) was linear @PM2Ring
 
@Johnston yes it is linear to O(m) where m is the number of digits in n
 
@AnttiHaapala I really don't want to scroll up to read more of that discussion. But you have my full permission to slap him with a wet fish. ;)
 
so guy thinks there are exactly 2 C compiler implementations with different packing behaviours: Windows and GCC.
hasn't probably even heard about 64-bit processors yet...
 
ask him what clang does
 
12:57 PM
"what's that"
 
I don't actually have enough (or barely any) domain knowledge to form an opinion
 
@AndrasDeak basically what he asks is that Python should actually support the layout of each and every possible struct layout of at least every platform where Python is supported, at the same time, in ctypes...
 
maybe it should :P
 
@AndrasDeak there is a struct module for that...
 
1:03 PM
@AndrasDeak No, it shouldn't. It should do what you tell it to do. If you don't specify endianness or alignment and hence opt for native endianness and alignment then don't go crying when it breaks on a system that uses different endianness and alignment. But that argument's almost impossible to win with people who live in Microsoft land.
 
well either they're wrong or everyone else, and who are they going to believe?
 
Is it true that O(n) is better when you have few elements...O(log n) is better when you have many elements
 
where did you hear that?
actually, when you have "few elements", scaling is irrelevant
 
FWIW, I got tired of having that argument with C programmers back in the days when Windows was still 16 bit and used annoying segmented addressing schemes instead of a flat memory space.
 
big-O is about asymptotic behaviour, i.e. what happens when you go to large n
what big-O doesn't tell you is the prefactor of the scaling, which can be huge
if you have a huge prefactor with O(log n) and a small prefactor with O(n) you might have to go to n=1e6 for the former to be faster
 
1:06 PM
@Johnston It depends on the algorithms. But in general, a O(log n) algorithm will be a little more complicated & hence have more overhead than the equivalent O(n) algorithm, so the O(n) can win when n is small.
 
but ^ that's not because of O(n) itself; it just happens to be like that in practical situations
it's not something intrinsic to O(log n) vs O(n)
 
I was just looking at the graph
And O(n) goes up evenly and O(log n) levels out
 
I'm out :)
 
@AndrasDeak I totally agree.
 
Thanks people!!
 
1:15 PM
no problem
Boston Dynamics' Atlas can now somersault. I like it how there are multiple doomsday scenarios racing one another ;)
all we're missing are some mysterious ground movements in Yellowstone
 
Hammered
 
1:42 PM
The comment above mine got to me
That’s like saying “I wonder why surgeons use scalpels if there so bad at controlling the bleeding.” — piRSquared 1 min ago
 
2:16 PM
\o cbg - FRIDAY \o/ :D
 
cbg
 
woo to Friday. Cbg all.
 
jjj
Re: Atlas. Its so cool how it(?/he/she/whatever pronoun is apprioprate here) hangs in the air when jumping on these bigger ones. Thks Andras
 
still not Andreas, but you're welcome
 
jjj
oops, sorry
 
2:25 PM
quick question: is there a way to freeze room? I saw Davidism do it but maybe I was mistaken...
 
@AndyK you can place the room in time out.
Freezing is an automated process that happens to rooms with no traffic.
 
@davidism that's what you did a few days ago?
 
Nope. I probably set a time out, but freezing is not something ROs can do.
 
timeout is temporary, freezing is beyond half-way to deletion
 
you did a timeout @davidism
thanks for the info
 
2:31 PM
@davidism I had a look at the sopython Slack yesterday. It wasn't easy: it didn't want to open in my old Firefox. I ended up installing the app on my Android phone.
 
Huh, weird.
 
@PM2Ring you've got a very old one then..
 
Hey @piRSquared I noticed in the transcriptthat you were messing around with various string formatting options. I found your code a little confusing to read because you shadowed the built-in format function.
@AnttiHaapala Yes, I do. :) I guess I need to move to a new distro...
 
... about time :D
 
I tried installing Chrome on Puppy Linux, but that was also too old to open Slack.
 
2:34 PM
... and you could get a 3 year old computer for AUD 100s
 
2:56 PM
@PM2Ring yes. Prior to that I had stumbled upon f strings. I think @AndrasDeak had mentioned it. So I went a little nuts experimenting to get a better understanding
 
yup
came up when we were convincing Jfach to port their codebase to python 3(.6)
 
f-strings are nice, but as you noticed, they do have their limitations, especially when you want to do dynamic stuff.
 
@AndrasDeak that's about the same
 
thanks
 
DSM
Friday morning cabbage for all.
 
3:03 PM
unleashed my little monte carlo (written in python) on the department cluster for the first time
cabbage, DSM
and rhubarb from me
 
rhubarb Andras
 
DSM
Rhubarb for Andras!
 
anyone wants to help me do a very simple calculation im having hard time with ?
 
@Prakhar Welcome, please read our room rules: sopython.com/chatroom
 
thanks
 
3:13 PM
That SQL injection answer earlier still needs one delv.
 
gone
 
Thanks
What are you up to @poke, haven't seen you around much lately.
 
I have been out of office for the past two and a half weeks. Only been back since Monday but this week has been… well, as you would expect when you weren’t there for a bit :P
 
I think f-strings are cool. In the right circumstance, it is absolutely more readable. However, what piqued my interest was performance. But, as we're discussing, f-strings are limited in their dynamism. In fact, you (I) can hack something not too ugly that takes away from the readability of f-strings but leverages its improved performance.
name = 'Cool Cat'
age = 3
f"Imma {name} and imma {age}"

'Imma Cool Cat and imma 3'
Or
fmt = lambda name, age: f"Imma {name} and imma {age}"
fmt('cOOL cAT', 4)

'Imma cOOL cAT and imma 4'
 
@piRSquared “what piqued my interest was performance” – They are as performant as str.format.
 
3:19 PM
Not according to the blog... and now I have to test... rbrb
%timeit'Imma {name} and imma {age}'.format(name=name, age=age)
%timeit f"Imma {name} and imma {age}"
%timeit fmt('Cool Cat', 3)

196 ns ± 2.6 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
14.2 ns ± 0.332 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)
265 ns ± 15.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
In fact, my lambda messed things up badly
So, the f-string is fast but doing what I did to add dynamics eliminates performance. Blah!
 
Hmm, you’re right. I thought that f-strings were just syntactic sugar! Good to know!
dis.dis('f"foo {bar} baz"')
  1           0 LOAD_CONST               0 ('foo ')
              2 LOAD_NAME                0 (bar)
              4 FORMAT_VALUE             0
              6 LOAD_CONST               1 (' baz')
              8 BUILD_STRING             3
             10 RETURN_VALUE
Interesting
 
DSM
Submillisecond differences in string performance don't really bother me too much. :-)
 
FWIW, you can do automatic concatenation of f-strings if you need to split up a long one.
a, b = 3, 7
s = (f'a {a} very '
f'long {b} example')
print(s)
#output
a 3 very long 7 example
 
that’s a very short long example
 
That auto concatenation seems to be true of strings as well
'hello' ' world'
 
3:33 PM
@MartijnPieters re: that decorator question. You could have a deferred decorator that took a list of imports that will only be tried once the function is called. But that's silly and I don't want to take the time to write it now I want to write it.
 
@davidism yeah, but why? Is it such an inconvenience to have to import something?
 
I know, the question doesn't really explain why this needs to be done.
We're been sniped.
 
@piRSquared Yes, that's been standard behaviour since forever (IIRC). But it's nice that it also works with f-strings.
 
4:06 PM
@MartijnPieters well, I wrote it. Debating whether metaclass magic is better than string import magic. :-)
 
@davidism just import the decorator, already! :-D
 
I kind of want to see a code-golf answer to the question about golf scores stackoverflow.com/q/47354640/2301450
 
wim
4:36 PM
impressive hammering ---vaultah----
 
To be fair, that link was originally suggested by someone else
 
wim
anyone here know what happened to Nadia (answerer of the dupe target)? She was very active in SO earlier times and then disappeared without a trace
 
@vaultah How about this?
open('golf.txt','w').writelines([input(s)+'\n'for _ in range(int(input('Number ')))for s in('Name ','Score ')])
@wim She also posted the top globals() answer in our canonical "variable variables" question: stackoverflow.com/a/1373201/4014959 In her defence, she does say it's a bad idea. But still...
 
4:53 PM
recabbage
 
wim
That answer looks fine to me, after davidism edit.
 
please don't post new questions here as per the room rules
 
even if that was OK, one-boxing a question with not even a "hi" would just be rude
 
5:02 PM
Ok, i'm sorry.
 
friday morning cbg
 
@PM2Ring that confusing binary post has been edited and gathering reopen votes. I'm reluctant to vote because now it's a huge block of code and it's only barely more comprehensible (I guess OP wants to store the numbers in the loop?). The original confusion is still present of course...
 
If my post was resolved in the comments, how do I put it as RESOLVED?
 
You could ask someone from the comments to post the resolution as an answer. Or you could answer your own question.
 
or delete the question if it's unlikely to help future readers
if it does get an answer, accepting it will signal that it's RESOLVED
 
5:15 PM
@AndrasDeak Thanks. Well, at least the mystery is solved: that big block of bits is really the successive values that k_xor_e takes in a for loop.
 
Yup, that's what it looks like based on the code. But their confusing bit is unchanged in the question :/
I'd be inclined to close it as no mcve so I'll just leave it alone
 
Cabbage
 
cbg
 
@AndrasDeak I agree we should leave it closed. He's doing some odd things there: he should be working with bytes, not bits, so a lot of that code will need to be re-written. But I'll post a comment telling him how to make the list he wants.
 
okay, thanks
 
5:33 PM
I'd kinda like to help the poor guy. It's a pretty ambitious task to implement DES in Python if you don't really know how to do bitwise stuff. Trying to do it with text strings of bits is madness.
 
6:04 PM
@PM2Ring I assume their goal is to learn, so it's not that instructive to do something this wrong
 
@MartijnPieters ^ that user is another duplicate like the one I pinged you about yesterday, but the original user no longer exists, so I'm not sure what to flag it as. I guess since there's only one account now it's ok?
Not that they've gotten better at asking questions. sigh
 
I wonder how many more times would this user post the same question before reducing it to a mcve
 
@davidism I can't find the account either..
 
6:19 PM
I have the link to a question by the original op. But it was deleted by community, which I assume means they asked for deletion.
 
Here is the previous 'question' for reference: stackoverflow.com/questions/47331389/…
Yeah, self-deletion of the account.
 
So do we just leave it since there's only one account now?
I'm assuming SO knows about duplicate users when handing out quality bans.
 
I've annotated the account. Normally, new accounts would get severely rate limited but they managed to work around this this time (won't go into details as to how).
I've also initiated a private message thread with them about this behaviour.
 
Thanks.
 
6:40 PM
morning cabbage
 
cbg
 
cbg
 
7:00 PM
cbg
 
there's a current mildly relevant meta to inheriting bans and limits meta.stackoverflow.com/questions/359471/…
 
7:18 PM
@RobertGrant looking at the documentation was the first thing I did
 
Update: the first 10 episodes of The Punisher are pretty cool
And yes, I started on it this morning.
 
7:29 PM
Who has time for that?
I bought two PS3 games on Wed and still haven't had time to play them ;-(
 
cbg, frands
 
"Turn that fraud upside down" -> frand
 
7:46 PM
If you selectively turn only one letter upside down...
 
That had negative impact on my understanding
 
Haha, I've always thought of "frands" as Brightwing from Warcraft greeting a friend.
 
1 2 3 4 cc @davidism
 
why doesn't this work?

re.sub(r'/[^a-zA-Z0-9_]/g', '', "hi_there_($)_(%)")
trying to remove the ($) and (%)
 
define "doesn't work"
 
7:56 PM
try: re.sub(r'[^a-zA-Z0-9_]', '', "hi_there_($)_(%)")
 
@james Because Python doesn't use that slash syntax to mark regexes.
 
@PM2Ring how do you add the global tag then
 
you can edit/delete chat messages in the first 2 minutes after posting
 
Regex matching is global by default
At least, for re.sub.
 
ok thanks
 
8:02 PM
@james What cᴏʟᴅsᴘᴇᴇᴅ said. However, Python provides a couple of ways to specify regex flags. You can pass them in the flags arg when you compile the regex, as mentioned here. You can also specify them at the start of the regex pattern itself, as mentioned here in the (?aiLmsux) section.
 
Global isn't a flag though, because the methods and arguments affect how many matches are used.
 
Cabbage peaches and pears. Potato all?
My best salad speech in history.
 
This one time a user got really mad at one of the JavaScript ROs. I re-produced their rant:
 
8:17 PM
Pretty good. : p
@davidism 2015? You have a good memory.
 
hunger strikes
 
Hey, proper python questions here. My tornado server needs to communicate with another REST API. I've been using tornado's AsyncHTTPClient, but it doesn't support cookies and the API I depend on uses a session cookie. I know, ugh.

So I'm thinking about using http.cookies.SimpleCookie to parse all Set-Cookie headers and just send them back on the next requests I make. Is that bad or is there something else I should be doing instead?
If you think I should actually make a proper SO post out of that, I will.
 
8:41 PM
Hmm, looks like SimpleCookie parses Cookie, not Set-Cookie. Guess I shouldn't have trusted that gist.
Ok, this is definitely not viable. Screw that. I'm almost ashamed of having asked that question after reading some more about how cookies work. I'd be ignoring expiration and a bunch more cookie info.
 
8:56 PM
Probably not a good solution for you, but FWIW: I've been using aiohttp lately, and I found it quite nice to use, including for managing cookies automatically. I think it might be able to plug in to Tornado's event loop. Maybe something to consider if you get stuck. @JacqueGoupil
I remember having difficulty trying to use SimpleCookie and other standard library HTTP tools for non-trivial stuff in the past, before giving up and moving onto packages like requests and aiohttp.
 
9:10 PM
Right now I also have a version working with requests, but it's synchronous. I found trequests which allows you to use requests asynchronously with tornado but it doesn't support cookies. I also gave a try to aiohttp, but I've hit this issue: github.com/aio-libs/aiohttp/issues/1176
 
@JacqueGoupil Darn. Thanks for linking the issue, that's good to know.
 
Yeah, I'm pretty bummed out that doing something as simple as an HTTP request is causing me so much trouble. I wouldn't be desperate enough to look at cookie parsing otherwise.
 
What does "not working properly" mean?
 
well, it's supposed to command all 30 LEDs to turn red, however, when I run it, some turn red, some blue, some purple, and some don't turn on at all
 
9:18 PM
Wow. I wish I had bugs where things turned purple instead of red. That sounds fun ^^
 
DSM
@JeremyBanks: have fun in Montreal! Only one of the guys on my team could go, and it wasn't me. :-/
 
I'm wondering if I have a capacitance problem
 
what LED you to this conclusion? (:
 
lol, well I'm using multiple rather long wires and it's going through a breadboard
so I could try plugging directly into the RPi
 
@DSM Thanks! Maybe next year.
 
9:25 PM
OHHHH, I wonder if it's because they want 5v logic and the Pi uses 3.3v.....
hehe, that's probably it
 
booo hardware problems
 
@JeremyBanks Oh, talking about PyCon? I'm in Québec City, but two of my coworkers are taking the bus tonight to be there :)
 
9:55 PM
I took bait and gave feedback on my close vote. Now OP is asking for justification on SO rules. Honestly, I don't know where to point them. Anyone else have an answer for this person? stackoverflow.com/questions/47357470/…
 
[help/on-topic]
 
well, asking the rationale against these questions is opinionated :PP
 
^
 
But the bottom line is that 12 devs will have 12 different answers and none will be objectively better than the rest. It just holds no value.
that question can also be closed as too broad (open-ended, half a rant, etc.)
on second reading probably not even half a rant, I have to give OP that
 
00:00 - 22:0022:00 - 00:00

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