« first day (1713 days earlier)      last day (3250 days later) » 

5:00 PM
import StringIO
io = StringIO.StringIO()
print >>io, 'Second line.'
io.getValue()
# AttributeError: StringIO instance has no attribute 'getValue'
wat?
 
Hi there!
 
@DSM @Kevin you on the slack we have?
 
io.getvalue?
 
Is anyone known to Kivy?
 
DSM
@JonClements: not me.
 
5:00 PM
or get_value()
ok.
 
@JonClements Don't think so. If I am, I never bookmarked it
 
Cabbage, @Unknown
 
@tristan You get that you contradicted yourself there.
 
@WayneConrad StringIO.StringIO.getvalue -> <unbound method StringIO.getvalue>
 
@Unknown That's it. I've been doing too much Java... camel-cased that without even noticing. Thanks for catching that.
 
DSM
5:01 PM
@Kevin: a friend of mine used to say that's what he liked about science, which is that even non-rockstar scientists can make a lot of contributions.
 
user559633
@AaronHall No, I didn't. I find that egotists that are insecure want others to see strength and confidence, while others that earnestly believe in their own superiority to be bothered when others don't share that view.
 
@tristan Thanks very much
 
@Wayne >> Haha! I'm in this chat for the first minute, and I helped one to solve his problem ^^
 
Wait, does get_value really exist?
 
5:03 PM
No, it's really getvalue()
But it was close enough. Actually, @vaultah got it right first.
 
@Wayne >> Go f*ck yourself! xD Just joking
 
@Unknown Niiice
 
Is it just me or does vaultah have a blank av today
 
It's not just you.
 
@Unknown I believe you when you say you were joking :)
 
5:05 PM
They seemed to fix the random-avatar-every-day behavior :( So I set it to blank
 
I think he generated so many avatars over time, that the system ran out!
 
@Wayne >> Never trust an unknown personality.. ^^
 
Aw. The truth is more boring.
 
AvatarOverflow
 
@Unknown I gotta either trust you, or flag you. I'd rather trust you :)
 
5:08 PM
Argh, my quadtree implementation doesn't work :-(
 
Anyone use matplotlib?
 
I don't want to write test cases ;_;
 
Is there a way to PM users?
 
@AF2k15 I use the docs sometimes.
 
IIRC only mods have private messaging abilities. For everyone else, there is only public communication.
You can create a "chatroom for [user] and [user]" room, but it will be visible to everyone, forever
 
5:09 PM
@AF2k15 here's the beginner's guide: matplotlib.org/users/beginner.html
 
@Aaron Hall I want to plot some points from a column of y data with corresponding x values, but all I can figure out how to do is define the axis ranges
 
@Kevin >> That's sad - Thank you.
 
x = np.linspace(0, 120)
y = np.linspace(0,17)
plt.plot(x,y)
do you know where I actually put my data in?
 
Is it true, that python is even more fast than C++? (in case you test it inside the cmd)
 
@Unknown You can invite a user to a new room for a chat. It's not really private, though--anyone could join.
 
5:10 PM
There are a thousand ways to measure "fast", so that question is impossible to answer succinctly.
 
Or, at least, I think you can. I've never done it.
 
Just like
Oh no multiline...
 
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
plt.axis([0, 6, 0, 20])
plt.show()
 
C++ is 104 times faster than Python in the N body benchmark though
 
WOW
 
in sort doc "reverse is a boolean value. If set to True, then the list elements are sorted as if each comparison were reversed." It's a bit strange I would expect the list to be reversed afterwards. So reversed(sort(...,reverse=False)) != sort(...,reverse=True))
 
And it's easier (in my opinion) and way more useful (also in my opinion)
 
@Aaron Hall thanks, I think that will help
 
Not sure what you mean by "it" there, but one of the attractions of high level languages is trading off computer time for programmer time.
If I can write my application in one hour instead of ten hours, I don't care if it takes 100 milliseconds to execute instead of 1 millisecond
 
DSM
@XavierCombelle: I think you mean sorted, but I'm not sure I'm following you. Isn't list(reversed(sorted(x, reverse=False))) == sorted(x, reverse=True)?
 
5:15 PM
Wat. SO has changed! I don't like change!
 
@DSM yes I mean sorted. the example which stumbled upon was
>>> sorted(["aef","xyz","abc"],key=lambda s:s[0],reverse=True)
['xyz', 'aef', 'abc']
>>> list(reversed(sorted(["aef","xyz","abc"],key=lambda s:s[0])))
['xyz', 'abc', 'aef']
 
I, too, don't like change.
 
War never changes
 
What change?
 
Anyone else waiting for fallout?
 
5:16 PM
@AF2k15 I've had problems like on Ubuntu trying to get plots, I found that the Anaconda distribution solved that problem easily.
 
I get the reference but war changes all the time. You don't see too much trench fighting these days.
 
@Kevin aww yes... you've worn the same underwear for 10 years - is that what you're saying?
 
DSM
@XavierCombelle: oh, I see what you mean.
 
83
Q: New navigation, alpha 2 released

Sklivvz Last month, we introduced a number of changes to the navigation for selected users: A new alpha-testing platform Unified question list with three tabs and a number of knobs to customize your question list selection New top nav We received a bunch of feedback—thanks! That was amazing! After...

 
5:17 PM
@ Aaron Hall thanks, I'm using anaconda already
 
@AF2k15 I have a significant amount of matplotlib experience if you need anything.
 
You can't answer whether or not war changes succinctly Kevin
 
Yes, Fizzy's helpful some.
 
Succinct
 
;-)
I guess it depends on your definition of "change"
 
5:18 PM
@Ffisegydd ah that one. This change broke my extension and I had to fix it. Plus their "real-time notifications" don't work
I disabled it
 
Are you answering me about war, or jon about the underwear? @Kevin
 
And all the sudden, all my web sockets stopped working and there's no errors on the server
 
Or both?
 
@Unknown I'm a Kivy contributor, and there's actually a "Python" team too, though it seems to be pretty moribun
 
@Dracunos Yes :-D
 
5:20 PM
@corvid are they errors on the client side ?
 
@Unknown Ahem. I believe you meant "Go yam yourself"?
 
@XavierCombelle yep, just saying the connection failed, but providing no further info
 
@XavierCombelle Be careful. Python sort() guarantees stability, meaning that items whose keys are identical remain in the same order in the output as they appeared in the input, so there's no guarantee that reverse(sorted(x, key-...)) will give exactly the same output as sorted(x, key=..., reverse=True)
In the general case the two will only be the same when there are no identical keys in the input
 
sigh...
 
no cats! I'm trying to concentrate! :)
 
5:31 PM
B*tch don't be removing my messages!
 
(also a slight experiment - sorry mate)
 
Too late, the cat is in your memory now
 
It was a good cat gif. RIP in peace, cat gif.
 
I'm come over there and slap you silly.
 
post it again!
 
Ahh... okay - no - can't undelete a chat post
 
user559633
@Ffisegydd that's what mother cat gets for not incrementing the counter
 
Does...does she get a Cat Overflow?
 
DSM
The mother cat probably forgot the difference between rebinding and mutating operations.
 
Why exactly were my flags declined for these two answers? I wasn't very sure about them at the time of flagging, just curious what was the actual reason
 
You guys would love this movie youtu.be/a7k112vDJgk
 
user559633
such an adorable gif. the little kitten coming out to follow mom
 
Speaking of cats
 
Speaking of cats, I'm hungry.
 
@Ffisegydd you might want to phrase that one a bit better :)
@vaultah wasn't the message obvious ?
 
5:35 PM
@Ffisegydd I can use plt.plot() to either plot a curve like plt.plot(curve) or use it to define axis ranges like plt.plot(np.linspace(0,120),np.linespace(0,17)) but not both. How do I do both?
 
DSM
I didn't know they were making a live-action Ansatsu Kyoushitsu.
 
I want the curve shown with axis ranges that I define
 
@AF2k15 when you do the second thing you're doing something bad/wrong.
 
@DSM How will that even work?
 
If you want to define the axis ranges then use plt.xlim and plt.ylim respectively.
 
DSM
5:36 PM
@davidism: judge for yourself.
 
like plt.xlim(0,120) plt.ylim(0,17) ?
 
Yeah.
 
@JonClements It was, but link-only answers with negative score aren't generally welcome and I believe the flag type (VLQ) was correct for both of them.
 
k, thanks
 
@DSM it looks so good, except for the cgi of the teacher
 
DSM
5:37 PM
@davidism: I can live with it. Could have been soooo much worse.
 
@holdenweb yes I understand now
 
I haven't watched the last three episodes yet. I am predicting a lack of assassination.
 
@Kevin re. slack: yeah you need an invite, you can comment with your email if you want one. We don't use it very often (originally we were going to use it to discuss development work outside of chat to stop it cluttering, now it's only really used to have a private RO chat room).
 
Or you can add your email to your trello card (which also doesn't exist, hint hint) @DSM @Kevin
 
Are you guys talking about neko Samurai?
 
DSM
5:39 PM
@davidism: I've been reading the manga, not watching the anime. Only a few weeks left in story time.
 
@vaultah it was already downvoted... it didn't really need another flag at that stage
 
Oh yeah, I may have shied away from Slack last time because my email address contains my True Name.
I think I can trust that with other ROs though...
 
We already know it's not Kevinson. ... It's Kevinsonson.
 
This...this sounds like your True Name isn't Kevin Kevinson? O.O I may need time to adjust.
 
If it ain't broke, don't fix it. If if ain't fixed, don't broke it.
 
5:41 PM
Okay thanks @Jon
 
@vaultah the community can take action by itself - you have downvote rights etc...
 
DSM
Could be Icelandic. Kevinarsson.
 
so it's expected that instead of flagging you downvote if you don't like it
 
@DSM That looks like it will be good exactly in proportion to their CGI budget.
 
invite sent, you can delete that message now if you want @Kevin
 
5:42 PM
flag ONLY for issues you can't handle... otherwise, use your votes
 
Indeed, but note: I didn't raise flags for moderator attention specifically. These flags should have been dealed with in the LQ queue
 
Get Michael Bay on the horn, we need fight scenes and explosions
 
Has already noted it down, in massive letters, in his journal
 
I don't have many flags declined for this kind of answers so I'm slightly surprised
 
@davidism Ok, I am retreating back into secrecy
 
5:43 PM
@vaultah the exact reason that one was denied I guess
 
But if we get Michael Bay, we'll also get inevitable terrible dialogue
 
That's fine, it will be in Japanese so I won't be able to tell the difference
 
Anybody ever white-board a problem, and conclude: "Not Broke, Don't Fix it"?
 
yeah, then the whiteboard fell off the wall
 
rimshot
 
5:46 PM
@Ffisegydd do you know if there's an easy way of making x values show up as y values and y as x for plotting purposes?
 
Are you trying to modify them in a current graph? Or do you want to make a new graph with them flipped?
 
(it links to a specific related scene)
 
I could make a new one, either way
 
It's probably easier to make a new one, in which case just literally flip the arguments.
You could modify an existing one, but it's a bit more tricksy.
 
5:48 PM
it seems the problem is my curve still uses the original x and y
 
Have you closed the figure and opened the new one?
 
I like what I see, but I just wish the x axis was y and the y axis was x
ya
I can't switch the x and y values of the original curve, but seems there should be a way to switch them on the graph at least
 
Well 1) that doesn't make much sense as you should have dependent and independent data sets (unless you're doing something funky).
Wait, what? I'm sorry it's not exactly clear what you want.
 
right, I want the same curve, just want to flip the curve
 
DSM
Heh.
I don't think that's as clear as you think it is. :-)
 
@AF2k15 so you want what was originally the x to be on the y, and vice versa?
 
ya
 
This sounds like a terrible, terrible idea.
 
na maybe I'm not explaining this clearly
 
If you've got some relationship y = f(x), flipping them "because it looks better" is terrible.
 
5:52 PM
no math involved
 
Edward Tufte just vomited.
 
The universe runs on math :-)
 
this is purely a visualization thing
 
Visualisation of mathematical numbers?
 
user559633
@Kevin What does it walk on?
 
5:53 PM
Which have some inherent relationship y = f(x) (even if you don't know what f is).
 
DSM
@tristan: wow. Just-- wow.
 
And you flipping them means you're plotting y = f^-1(x)
 
imagine having a curve, putting your curve in paint and rotating the curve 90 degrees
 
I wanna see a visualisation of non-mathematical numbers
 
that's what I want to do
 
5:54 PM
Yes I understand exactly what you want, and I'm saying it's a poor idea.
And I also don't understand why you can't just do plt.plot(y, x)?
 
@tristan On the back of The Great A'Tuin, AFAIK
 
well its a continous function so I just do plt.plot(curve)
 
I'm quite happy to add unittest to my library. Just catched two bugs
 
In which case what you've actually done is plt.plot(range(N), curve). You just don't realise it.
Where N is the number of datapoints you have. In which case, flip those two.
 
ic thanks
 
5:56 PM
Caught
 
user559633
@Kevin That's what it stands on.
 
Not much walking room, I gather
 
@Ffisegydd yay it works!
 
Hmm, someone put a ton of items in the reopen queue again.
 
There's automated stuff
just happens to work a bit better than your &quot;first&quot; attempt <g>
 
6:01 PM
Lol, first question was an audit, and I actually thought it was decent. sad trombone
I fail the most audits in the reopen queue. Which is funny, because it's always when I decide to reopen them, not leave them closed.
 
seriously, how could you not notice that?
 
DSM
Ever since the "don't skip audits" message I don't deal with the queues, which I didn't find much fun anyway.
 
Anyone known to Kivy?
 
Grouping in a 36 hour window actually sounds like an interesting problem, and they gave expected input and output. And there's a good accepted answer. There's absolutely no way to know that it's an audit.
 
Python does destructuring bind for arguments. Cool!
There's a "don't skip audits" message? When was that added?
 
6:05 PM
@davidism did you not notice the edit?
 
@davidism I think you're right. That question is clear (enough) after the edit.
 
Similarly to how parents find amusement in seeing the world through their child's eyes, I like to think we draw amusement from seeing Python through @Wayne's :P
 
DSM
@WayneConrad: yeah, even a,*b,c = 1,2,3,4 does what you'd think these days.
Although I do miss destructuring in lambdas.
 
@Jon if you mean that judging to reopen based on the edit alone, then yes, I usually catch that but I was fooled by the question in general this time.
 
@Ffisegydd Haha! :D
 
6:06 PM
@Ffisegydd Perhaps because in general functions are mappings, and so there may be several x values corresponding to a single y value?
 
DSM
@WayneConrad: as for the audit skipping, one of the mods had a heuristic he was using to detect mischief of some kind. He sent individualized "don't do this" messages.
 
True + True = 2
 
@DSM Ah. He must have started doing that after I mended my ways. There was a period where I just skipped most audits.
 
@Unknown Yup. True = 1.
 
True + True should be DoubleTrue, an even more true form of True.
 
6:08 PM
@Kevin No, it's DoublePlusGood.
 
Because some things are more true than others.
 
@holdenweb yes but generally when you plot some data you supply x and y (otherwise you're allowing the computer to guess what you want for x, which could be very bad). Note this is different to supplying x and f (in the case of y = f(x)).
 
DSM
Like double secret probation!
 
In the case of matplotlib if you omit x it just says "Okay we'll fill it in using 0, 1, 2, 3...N-1" for you automatically.
 
<awed whisper> double secret probation...
 
6:09 PM
@Unknown True - False == True
 
DSM
@holdenweb: eh?
 
@davidism the review failed you, because you failed to notice a lot of missing info and blatant just putting stuff into the question itself
 
yeah, hence the sad trombone :)
 
@Ffisegydd Of course, but there's still no guarantee that all the y values are unique. Consider y = x**2 over the x range (-1, 1) for example
@DSM My bad. Eduited
 
No I understand, but we're not discussing mappings here, we're discussing two arrays of data (where it doesn't particularly matter if there's unique values).
 
6:12 PM
Badly ... [commits hari kiri]
 
Anyway brb need to get some grub
 
@Jon don't worry, I wasn't actually complaining, and I do know how to use the queue :)
 
I'm not sure about the moral ambiguity in 3.x ... in 2.x it was simple: a half truth is a lie (as shown by assert True / 2 == False). These days I don't know what to think.
5
 
heh
 
Is that anything like seppuku?
 
DSM
6:15 PM
The moral of the story: measure once, cut twice: True // 2.
 
@davidism Dang. I made the same mistake you did when I looked at that audit. I claim that "human factors" are at play.
 
@davidism glad you still use them - helps the site... I just stopped using them even before audits can into place - when you actually spend time bothering to do so without a thought, it gets very demoralsing
 
When in doubt, blame the hardware
 
and then if you get caught by an "audit" it's even more so
 
@Jon I only participate in Reopen, Low Quality, and occasionally Edit and Close. I don't have a high opinion on the usefulness of the other queues.
Wow, a lot of the stuff that got put in the queue are good candidates for deletion.
 
6:20 PM
@holdenweb >> Do you know a way, to equalize a SoundLoader(...) obj?
 
A what now?
 
@Unknown why are you pinging Holden in particular? Please read our room rules: sopython.com/chatroom
 
DSM
Time to port algorithm from Python to C#! #midafternoonthursday
 
Augh davidism beat me to it
but yeah, please only ping specific users if it's part of an existing conversation of some kind
 
David and jon have the room rules and salad language on permanent clipboard
 
6:22 PM
Interesting autocorrect there
:-)
 
DSM
Wait, yesterday Dracunos was all
yesterday, by Dracunos
Why list, though? I'd understand typo-ing line, or liek
 
I use swipe, I get some interesting typos
 
DSM
And now that's what you get for "permanent"?
 
How the hell did you find that so fast?
 
Mad search skills, presumably
 
DSM
6:24 PM
I remembered JRS's "listless" comment, so there was a good word to search for.
 
user559633
@Dracunos after 75k rep, you get access to helpers -- personal assistants at SO that will do tasks you tell them
 
I claim conspiracy
 
@davidism >> He said, that he's known with Kivy.
 
Interns? @tristan
 
Hmm, if he said something like "Yeah I know Kivy, what's up?" then that does qualify as an existing conversation
 
6:26 PM
Did he? Looks at messages since Unknown's question. Nope, he didn't.
 
I know enough kivy to cut and paste the pong tutorial
 
Maybe he misread Holden's "hari kiri" message by two characters? :-D
 
DSM
@Unknown: doesn't matter much, many of us speak English as our second language here :-), but one minor grammar point. We say "John knows Kivy", not "John is known to Kivy" (which makes it sound like Kivy is a person who is familiar with John) or "John is known with Kivy".
 
@tristan At failing an election an you still get some goodies, then when you are called up, you get more goodies... it's a win win
 
6:28 PM
yeah i put pong as an easter egg on one of our applications that runs kivy
 
@davidism >> Yes he did. I got a message. But it's a few minutes ago.
 
its like a $20,000 instrument
and if you do the magic you can play pong on it
 
That's a fun idea, I like it when people do that
 
Maybe he interpreted Holden's True - False == True message to mean "yes [I know Kivy]", since it evaluates to True.
 
@DSM >> Thank you! :D but - that sounds so easy... xD
 
6:29 PM
I played an mmo where you could play tetris in a little window or something like that when you were bored. Which is often in an mmo
 
user559633
@Dracunos This makes me sad. Playing a video game in a video game when you're bored of the video game.
 
user559633
Instead of just...doing something else
 
I get addicted to "idle games" for about a week at a time, and I like to read or listen to podcasts while my autoclicker grinds gems or whatever.
 
Well in mmos you have to wait for stuff to happen, like a rare loot drop
 
At least I'm getting some kind of half-productivity out of it.
That's time I would have otherwise spent on reddit or something.
 
user559633
6:32 PM
@Kevin Yeah, I...may... have started a headless session on wall puncher
 
heh :-)
 
My most recent compulsion was Realm Grinder, which I give a B-. I didn't "finish" it per se, but I did get the "get 300 of [most expensive item]" achievement, which is close enough.
 
Reddit can actually be a cool place if you delete all the subreddits you're auto subscribed to and subscribe only to stuff you're actually interested in
I have scuba, whatisthisbug, programming, dcss, mildlyinteresting
 
Since Python does named arguments automatically, and I can't stop a library client from using named arguments, that means I can't ever rename an argument that's part of the library's public API... is that right?
 
6:35 PM
Countless hours of entertainment to be found on whatisthisbug
 
ummm sure ... what?
 
@WayneConrad you can deprecate it, then remove it later
 
user559633
ah, misunderstood :)
 
@WayneConrad that didnt make sense ... oh maybe @davidism clarified that
 
def my_func(new_name=None, old_name=None):
    if old_name is not None:
        warnings.warn('use new_name instead')
        new_name = old_name
 
6:36 PM
So basically Wayne's saying, since the user can do foo(bar=23), you can't ever change def foo(bar): to def foo(qux):, or else it will break backwards compatibility with your user's code
 
Much better said, @Kevin. Thanks.
 
you can break compatibility all you want ... even huge libraries do it all the time
they release python3 for example :P
 
You can't do it, for certain definitions of "can't"
 
Interesting idea David
 
much like how you can't rob a bank.
 
user559633
6:37 PM
flagged as not constructive
 
You totally can, but the police will be displeased
 
fixed the code, should use warn rather than raise
 
I like to use semantic versioning, and for me it's a failure if I break the client unless it's a major version bump.
 
@WayneConrad so yeah, deprecation phase out is the way to go
 
user559633
@WayneConrad so yeah, same, with deprecation warnings
 
6:38 PM
Perfect. Thanks.
 
Seems like a sensible approach.
 
user559633
davidism has it :)
 
user559633
in my work-api, i do sem versioning, with a dev branch for nightly stuff. when i'm about ready to deprecate things (have some idea of what i've been coding), i'll go through an litter deprecation warnings in branch Current - 1
 
It really bothers me that DeprecationWarning is ignored by default, because the users most likely to need to see them are the ones who are least likely to know to enable them
 
How do you enable them?
 
6:45 PM
Is there a way to center justify in Python? Eg, I want to say "Hello World".cjust(100) and have it get wrapped in spaces.
 
yeah but I forget what it is
 
@Morgan you can do it with string formatting.
 
'{:^30}'.format('centered')
 
>>> import string
>>> string.center("Hello", 23)
'         Hello         '
 
6:46 PM
In [3]: 'Hello world'.center(20)
Out[3]: '    Hello world     '
Ugh
 
Perfect, thanks.
 
oh, you don't need to import string to do it.
 
+1 for vaultahs
 
Which of our answers you pick depends upon whether you need it centered in a field that's 20 wide, 23, or 30.
Any other width, you're out of luck.
 
Damn, I need 83. :/
 
6:47 PM
Melon
 
I have a feeling that the answer to Averaging a list in Python, “Type Error: Cannot perform reduce with flexible type” is, "your list is full of strings, not floats", but I'm not sure. Does csv do literal evaluation on the file you feed it? When it sees "1.5" in a cell, will the result be a string or a number?
OP is playing games with me, not telling me the contents of his list
 
> Thank you for reviewing 20 reopen votes today; come back in 5 hours to continue reviewing.
 
@WayneConrad Open/closed principle says it stays forever... but this answer may surprise you: stackoverflow.com/a/30832840/541136
 
Ended at 666 reviews. I didn't even plan that.
 
6:51 PM
Meh, I'll go for it without any empirical data
 
Is "the lungs of sheep or pigs used as food, especially for pets" the first meaning of the word "lights" that comes to mind if the word doesn't have any context?
 
Not for me, no
The first meaning that comes to mind is, a general term for objects that illuminate their surroundings
 
I didn't even know that was a definition of the word.
 
@AaronHall That's a nice answer. Thanks.
 
Ah, my shot in the dark was successful for the csv question
 
6:54 PM
Thanks @Kevin @davidism
 
@Unknown Nope, and no idea why you think I might, but it appears you now understand this wasn't a good move. Welcome to SOpython!
 
DSM
@Kevin: +1, although it's a little odd to be using csv in a numpy context anyway (as opposed to loadtxt or genfromtxt or something.)
 
In fact it transpires I was mistaking Kivy for something else, so I retract all claims of knowledge. Sorry about the misunderstanding
 
@WayneConrad I appreciate positive feedback as much as anyone. Thank you. I also appreciate criticism. "Instruct the wise and they will be wiser still"
 
I can't say anything bad about it. It makes sense.
 

« first day (1713 days earlier)      last day (3250 days later) »