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

00:46
🚆 on the train to Montreal for PyCon Canada
01:03
Rhubarb all. : )
 
2 hours later…
03:01
recbg
 
1 hour later…
04:28
sleepy evening cbg
 
1 hour later…
05:53
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
?
06:11
@NimishBansal room rules
06:24
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
07:23
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
07:38
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
08:00
rbrb
08:14
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
08:36
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.
08:48
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)
09:02
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
@Mosho I guess
09:56
@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
Cabbage
jjj
jjj
cbg, is Punisher any good? @RobertGrant
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
jjj
:D thkns, Ill give it a try
11:02
The paint from my downarrow has started to erode off. I'm not sure what that says about my keyboard habits
11:38
@Mosho sounds like a sensible change
12:27
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
@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
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
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
"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...
13:03
@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
13:06
@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!!
13:15
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
13:42
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
14:16
\o cbg - FRIDAY \o/ :D
woo to Friday. Cbg all.
jjj
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
jjj
oops, sorry
14:25
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
14:31
@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.
14:34
... and you could get a 3 year old computer for AUD 100s
14:56
@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
DSM
Friday morning cabbage for all.
15:03
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
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
15:13
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.
15:19
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
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'
15:33
@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.
16:06
@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
wim
16:36
impressive hammering ---vaultah----
To be fair, that link was originally suggested by someone else
wim
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...
16:53
recabbage
wim
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
17:02
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
17:15
@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
@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
17:33
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.
18:04
@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..
18:19
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.
18:40
morning cabbage
19:00
cbg
there's a current mildly relevant meta to inheriting bans and limits meta.stackoverflow.com/questions/359471/…
19:18
@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.
19:29
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
19:46
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"
19:56
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
20:02
@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:
20:17
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.
20:41
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.
20:56
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.
21:10
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
21:18
Wow. I wish I had bugs where things turned purple instead of red. That sounds fun ^^
DSM
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.
21:25
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 :)
21:55
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 (2584 days later) »