« first day (1395 days earlier)      last day (3561 days later) » 

1:00 AM
Well, was going to work on sopython today, but bought a Wii U instead.
That also ended my 100+ consecutive days on SO.
 
 
4 hours later…
4:58 AM
cbg all
 
 
2 hours later…
7:05 AM
Cbg
 
Cbg :)
 
@Ffisegydd STEWIE!!!!!!!!!!!!!
cbg @mi5t4n
 
cbg @JonClements
@JonClements How's weather?
 
Well... the storm's passed... so it's actual quite nice today :)
 
@JonClements Which country?
 
7:14 AM
As per my profile: England :)
 
@JonClements Cool
 
@Jon Briiiiiiiiiiiiiiian!
 
I don't wanna get out of bed - it's all nice and cosy :( meep meep
 
@JonClements It's hot here
 
Isn't that normally the case for Nepal?
anyway... rbrb... need to get moving
 
7:19 AM
@JonClements See ya
 
cbg
btw the javascript flag is invalid :D
it is just a scirpt to remove a spammer from javascript chat :D
as a joke
 
7:42 AM
Cbg!
 
8:16 AM
How do bounties work again? Because this guy has put a bounty on a question I answered ages ago but I'm pretty sure my answer precludes anyone else from even answering it.
I've basically said "it's not possible to do this, here is why"
 
There are several types of bounties. Sometimes you want to reward an existing answer.
I guess this is not the case here.
 
Unless someone else comes up with an answer and gets 3 upvotes I'll get at least half the bounty
I suggested a different library to them that can do what they want (this was a month ago) but never mind.
 
@Ffisegydd only upvotes during the bounty period count for the automatic half reward...
 
If there is another answer, the OP can reward the bounty. The number of upvotes matters only they don't reward.
 
D:
@ypercube yeah I knew the op can reward manually.
 
8:20 AM
But looks like a good answer to me anyway... have a vote :)
 
But what he wants can't be done.
Unless someone writes some bespoke code for the matplotlib library and branches it into DAFT
 
maybe he's hoping one of the authors of the libraries will turn up :)
 
Possibly yeah.
 
cbg @Justin
 
Looks like a good addition to that module though (as I read the source, they are talking about directed graphs.)
 
8:39 AM
user image
3
I had a look at the source code for that graph library. Hasn't been updated in over a year and they've got an outstanding PR from that time.
Don't think I'm gonna bother
In fact the guy himself pushed an Issue that asked for it a month ago and got no reply.
 
Umm... not sure what he thought asking on SO and then a bounty would help then :)
 
Unless he just really wants to give me 50 rep for suggesting networkx to him :P
But then he could have accepted the answer too ;)
So I doubt that's it.
 
8:56 AM
cbg
 
cbg
 
cbg
 
(lambda n_cbg = 42: print(', '.join("cbg" for i in range(n_cbg))))()
 
9:12 AM
6 cbg ;
@AnttiHaapala I'm lost :D
 
@AnttiHaapala I'm new in python :)
 
loads sloooow (someone didnt use caching obviously)
@mi5t4n the code shoudl print 42 comma separated 'cbg's
 
9:16 AM
@AnttiHaapala Yup, saw that, cool stats!
Not sure about the last stat, that looks too high really.
 
but there are so many people WROOONG :D
 
Oh :D
 
5 % uses tabs for indenting python code, heresy!
 
I use tabs :(
 
@mi5t4n stop.
get an editor that uses soft-tabs: when you press tab, it will indent block by 4 spaces.
 
9:18 AM
@AnttiHaapala : Habit picked while programming in C
 
when I program in C i indent with tabs.
there are many more habits you picked from C you need to unlearn, so
unlearning the indentation rules is just 1 :D
 
I use IDLE
 
which platform?
operating system
I propose pycharm for the awesomeness if you have decent computer
 
I propose Sublime Text because it is, well, sublime.
 
You meant to say, follow PEP
 
9:20 AM
no
there are 2 things: a) preferably follow pep8
but b) never ever use tabs for indenting
(and not 2 without the 3rd: c) if you mix tabs and spaces, martijn will come in your dreams and turn them into nightmares.)
 
(b is included in pep8 but it's nice to highlight it as it's REALLY annoying seeing tabs)
 
Windows
Ok I will start work on that
 
@mi5t4n so if you want a text editor, many ppl seem to like sublime text
 
@AnttiHaapala I'll kee in mind
 
ST is very good.
 
9:22 AM
@mi5t4n for ide, get pycharm jetbrains.com/pycharm/download - community edition is good enough for about everyone
 
@AnttiHaapala : any good and free IDE?
 
pycharm
 
Pycharm is the best IDE out there, hands down.
 
I have never really even tried sublime text
 
@AnttiHaapala : Downloading :)
 
9:23 AM
I code with whatever crappy editor I have in my hands
bc I am over ssh so many times that using sublime would be counterproductive :P
and when I am on my computer, I use ide anyway
 
@AnttiHaapala Oh
 
btw, idle is almost less of an ide than sublime text :D
remember using idle hmm... in year 2001 or so
 
@AnttiHaapala : One suggestion from you
@AnttiHaapala : Since I'm new in python, should I learn 2.7 or 3?
 
@AnttiHaapala : Ok then, I'm going to uninstall 2.7 :D
 
9:27 AM
you need 2.7 only if you happen to need it...
this is the state of many popular libraries on python 3 - green is "it works", red is "it does not work"
many of the red ones are legacy libs,
only some are those which are the best of the breed currently, namely twisted for asynchronous networking
 
Well then, since I'm new I may not need all libraries, when I will need the, it will probably be supported :D
 
so then good bye 2.7 :)
 
yeah
or you can isntall them side by side
np
 
install side by side? can we do that?
 
9:31 AM
they should work on windows side by side, but definitely you should be coding in 3
 
well then lets go for future :)
 
you call 6 year old "the future" in computing?
hmm, anw I wonder why do newcomer ppl still want to pick python 2
 
@AnttiHaapala My bad then :D
 
I mean, where did you read and decide to pick python 2.7?
just bc of interest
 
@AnttiHaapala : Old usually means back compatible so
I picked it
 
9:44 AM
but this is more like original c vs ansi
 
user559633
resisting the urge to answer: stackoverflow.com/questions/25240283/client-server-network with "Okay!"
 
user559633
or just $30,000
 
@AnttiHaapala : hmm
 
user559633
done
 
9:46 AM
/closed
 
closed :d
 
-4 votes :D
 
user559633
-4 is nothing
 
need to be at least -6
 
-6 means closed?
 
9:47 AM
I can make it -5 :)
 
user559633
1
Q: Python: Check whether one element is between two other elements

jonie83There are two elements: A and B. I don't know which element is greater. I order to check whether a third element (C) is between them I do the following: if A < C < B or B < C < A: print("C is between A and B") Is there a smarter / faster way to do this?

 
butttt ah well, newbie there
 
user559633
second answer, good god. "yeah this isn't a solution but here's some words"
 
newbie to programming and python :D
 
@tristan voted to delete.
@mi5t4n No, just that it is at score -6. Voting on post quality and usefulness is orthogonal to voting to close.
You can have crappy on-topic questions; downvote but leave open.
And you can have great off-topic questions; upvote but vote to close too.
 
9:58 AM
oh
 
@MartijnPieters needs one more delete vote now
I'm sure someone going through the tools will see it...
 
We were just having a interesting discussion on wether Not An Answer flags apply to such posts.
4
Q: Why was this flag declined?

MichaelTSorry mods, another one of those "a one liner isn't enough of an explanation and I can't fit all of this in another flag" posts. So... Overriding equals and hashCode in Java To the question Overriding equals and hashCode in Java What issues / pitfalls must be considered when overridin...

In this case a NAA would be declined, for example; a moderator should not be expected to recognise that as a WTFBBQ? The keywords are there but, seriously, WHA?! answer.
 
user559633
StackOverflow is kind of amazing for upvoted closed/off-topic questions.
 
@MartijnPieters the problem is that the "not an answer" and then the delete vote options are completely different...
 
@AnttiHaapala the Python community can recognise it as a extremely low quality post and vote down and even to delete.
so it doesn't require moderator intervention.
 
10:13 AM
I mean, does the "flag as not an answer" go to the low quality queue?
 
I don't think it does; moderators have to deal with those.
 
"This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether. "
this is the text for "NAA"
 
156
Q: Your answer is in another castle: when is an answer not an answer?

Shog9I think we can all agree, this sucks: If you've been around a little while, you've probably encountered hundreds of answers like this in various forums, some of them even marked as "The Answer" by well-meaning1 forum admins looking to close a thread. We could try to enumerate the commonly-obse...

ah love the pictures
 
Is there a better way at determining the position of an inline label while drawing an arc in matplotlib ? In my answer here stackoverflow.com/a/25228427/3109769 the angle values are printed on the line, since the positioning method is not optimal. The linked in question also does not work well for the particular case. I was just wondering if there are any predefined methods or so that can do this more efficiently ?
Or should I post a question for the same ?
 
10:30 AM
I'm scanning matplotlib.org/users/text_props.html to see if there is anything useful there.
Any of the attributes listed there can be used with the .text() method; you could experiment with the *alignment keywords.
 
@Martijn Melon for responding ;) BTW, Isn't that alignment supposed to be relative to the entire graph ? I mean like is there no built in way to autoalign a label near a curve ?
 
@user3197452 there are various ways of plotting the coordinates in matplotlib.
You can either plot relative to data (so say you had graphs going from 0 to 10,000 you could plot at the 1000 mark to be ~10% along)
Or you can plot relative to the axis (so basically goes between 0 and 1 where 0 is one side of the graph and 1 is the other (meaning the 10% would be at 0.1))
 
@user3197452 tbh I have close to 0 matplotlib experience.
 
@Ffisegydd Hmm.. thats wat I attempted to do there... It takes the vertices of the arc ... then plots at a distance from the midpoint of the line joining the end points of the arc ... Not sure if its a good method ...
@Martijn Matplotlib's loss ! ;)
 
(I actually looked at this question when it was first asked and decided it was too much work!)
 
10:44 AM
@Ffisegydd Haha :D I knew nothing at start ... Saw it had 0 answers and in the attempt to answer it learnt a little of matplotlib myself !! SO's gamification system is cool makes you learn stuff ...
BTW if you come across any way to position the labels relative to the curve better than what I suggested there please do drop a comment. I am eager to know !!
 
I don't really think matplotlib is the proper software to use for this problem, it's a plotting software whilst this issue is a diagram. You've done a damn good job though and I've given you a worthy upvote.
I would use a matplotlib.text object rather than a label.
 
@Ffisegydd Thanks !! :D :D
 
So you can get the coordinates of where you want it to be and do plt.text('test', coords = ...)
Or something like that (can't remember the exact syntax)
 
Yeah thats what I did there the get_angle_text function returns a list of the arguments that needs to be passed to plt.text ! :)
 
Ah I see
 
10:49 AM
@Ffisegydd Thanks for the upvote :D I got 100 + assoc points !!
 
10:59 AM
Close to a matplotlib bronze badge, need to get back on the answering.
 
But then you'd get to 5k before Jon can get to 50k..
 
That would truly be a shame.
I'm going to burst if I don't let this out; "awwww... who's a good puppy? You! Dats who! Yes you are! You got a +1 from daddy! Yes you did! You want a treat?" ... ok. All out of my system, now! ;) — Andrew Barber ♦ yesterday
 
That Puppy also has only 3 legs
 
11:15 AM
@Martijn You should consider donating your reps to the poor from time to time ;)
 
@vaultah It's Jon's distant cousin, I think.
@user3197452 I donate my time and attention, isn't that enough? :-)
 
11:29 AM
@Martijn Haha ... was just kidding :)
 
11:39 AM
@user3197452 :-P
 
/closed
 
Rather neat computer vision project: First-person Hyperlapse Videos. The second video has the interesting technical bits.
I'm guessing the "construct a 3d model of a landscape from a video" technique isn't new, since they don't talk about how it works. That's the most interesting part, to me.
Last I heard, the state of the art was that you could make 3d models of your desk toys by going over them with a consumer-grade webcam. I expect modeling a mountain range with a shaky camera is harder.
 
I don't see most of LQ questions :D
 
12:27 PM
Hah
Where's the hate of the scipy stack come from ? :P
 
turtle graphics questions are easy rep. They're always CS 101 problems :-)
"I need to go forward and turn right 100 times. Is there some kind of command to make code repeat?" Well gee, that's a tough one...
 
@Ffisegydd I've never used numpy nor matplotlib
No hate for them, I just know nothing about them
 
:P
That's good, more questions for me.
Incidentally based on some advice from Martijn I follow stackoverflow.com/questions/tagged/…
So it catches things that are tagged python 2.7 even if they miss the python tag
 
I usually use * for those situations, like [*python*]. Or maybe that's what you did :)
 
I didn't know you could wildcard :o
Nah I hand typed it all up :P
 
12:38 PM
@vaultah, maybe you could mention extend in that post you made a minute ago
whoops, too late. jonrsharpe posted an extend answer
 
Yea
and I deleted my answer
3 answers to the basic question is too much
 
I wonder if seq += items uses extend under the hood, since it would be faster than constructing a brand new list
 
>>> a = [1]
>>> b = a
>>> a += [2]
>>> a is b
True
My tests say yes.
 
SCIENCE!
Assuming that the same id hasn't been used by the interpreter.
Which is entirely possible.
 
My test agrees with your test
 
12:46 PM
hg.python.org/cpython/file/18a311479e8b/Objects/… this may help someone (who can read gibberish) to find out the answer
 
>>> seq = [4, 8, 15]
>>> items = [16, 23, 42]
>>> old_id = id(seq)
>>> seq += items
>>> new_id = id(seq)
>>> print old_id == new_id
True
 
Actually no we need to find iadd
 
I expect in-place add calls list_inplace_concat, which indeed calls extend
 
static int list_ass_item
Good name
 
12:50 PM
cbg cbg
 
high-class programmers will use tail instead of ass when implementing linked lists
 
cbg()
 
@Kevin First world scientist problems: I really want to shorten "analysis" when making file names but I can't because my colleagues are immature children :P
 
haha.
Reminds me of Arrested Development, where Tobias Funke is the world's first analyst/therapist, or "analrapist"
 
1:01 PM
Lots of cv-pls' today.
 
Done
 
"I searched on google..." did you /really/
 
@Zacrath I wonder if Monday grumpiness has something to do with that.
 
rbrb
 
Data analyst friends, please determine if close votes vary depending on the day of the week.
 
1:03 PM
TO THE DATACAVE!
 
It may be hard to separate the "voters are grumpier on monday" effect from the "question writers are more deserving of close votes on monday" effect
We need a tool to objectively decide whether a post is dumb or not.
 
I don't think you can access close votes via the data explorer.
But you can tell when it was closed.
 
could also be the january 2nd gym effect. It's monday morning, I didn't do anything all weekend, this time I WILL be productive. and these questions follow...
 
Ummm... got an upvote on my moderation questionnaire thing on MSE... better late than never I guess :)
 
Late upvotes are my favorite. If you get an upvote on a year old post, it must be useful to someone :-)
As opposed to brand new posts, where you're more likely to get upvotes for being correct than being useful.
 
1:16 PM
@Kevin Does it give you that warm feeling inside you belly?
 
Maybe a couple microfuzzies.
 
How can I put string into queryset filter value?
request.META.get("QUERY_STRING") - string type
queryset = self.model.objects.filter(request.META.get("QUERY_STRING"))
request.META.get("QUERY_STRING") == is_active__exact=1
Currently I have: too many values to unpack
 
@Kevin Results from the datacave!
 
I would expect request.META.get("QUERY_STRING") == is_active__exact=1 to give SyntaxError: can't assign to comparison
And request.META.get("QUERY_STRING") - string type to give SyntaxError: invalid syntax
 
Tuesday is the day when questions are most likely to be closed.
 
1:24 PM
@Kevin This was only information, in request.META.get("QUERY_STRING") is this string: "is_active__exact=1" ;)
 
Ok, sorry for my poor reading comprehension ;-)
too many values to unpack usually happens when you do multiple assignment, but the right hand side of the statement has too many values. For example, a,b = [1,2,3]
 
However, that error can't occur on a line that has a single assignment, such as queryset = whatever. So it's not clear why you're getting it.
Perhaps something inside the filter() function is failing.
 
@Kevin If I put this manualy: queryset = self.model.objects.filter(is_active__exact=1)
it works fine
 
well, putting the value without quotes changes the meaning of the line entirely
 
1:27 PM
yes
 
@mamasi Ha, it works without quotes.
 
Instead of passing a string, you're passing a named argument integer
I suppose you could do some keyword argument packing magic, like filter(**dict([request.META.get("QUERY_STRING").split("=")]))
But that's quite ugly.
@Ffisegydd Interesting. Maybe bad question askers are too hung over on Monday to post.
 
My working hypothesis is that on Monday people are motivated to do actual work and on Tuesday they're like "Ah bugger it I'm going to SO..."
 
Seems reasonable :-)
 
That is of course just the day that the posts were closed, Can't get dates of actually close votes I don't think.
 
1:47 PM
morning everyone
 
mornin'
 
cbg
evening, you're wrong
 
Time is an illusion anyway.
 
lunchtime doubly so
 
Good "rising of the Leo constellation over my local horizon", everyone.
 
1:55 PM
I say "morning" no matter what time it is
so... how exactly does one query a many-to-many relationship in sqlalchemy?
 
dunno
 
By the power of Greyskull.
 
Wave a dead chicken over it
 
those were the first two things I tried :(
don't question my methods
 
@corvid there's a secret incantation but you have to pass a gruelling initiation to join the brotherhood...
 
2:00 PM
xyzzy! klaatu berada nikto! alohamora!
ia! ia! Zalgo fhtagn!
 
Nah that's for Python 2. That's a SyntaxError in Python 3.
 
Wait, that last one is for parsing HTML with regex. Man, this tome of forbidden knowledge is poorly laid out.
 
You want:
xyzzy! klaatu berada nikto! alohamora!
ia! ia! Zalgo fhtagn!()
 
They need a better forbidden copyeditor.
One of my computer's services is marked as "Automatic Startup" but I still have to start it manually every time I reboot :-I
Computer, why. Why do you do this.
computer stahp
 
2:33 PM
Wow - that duff answer went -6 before it got the 3rd delete vote
 
2:52 PM
hmm ?
 
01100011 01100001 01100010 01100010 01100001 01100111 01100101
 
Through my keen deductive skills I think he's saying...cabbage...
 
@corvid what do you mean "query a many-to-many"?
 
@Peter did you find a solution to your problem?
 
@Ffisegydd it wasn't that hard, thanks to the two 'a's and double 'b'
;)
 
2:54 PM
>>> "".join(chr(int(x,2)) for x in "01100011 01100001 01100010 01100010 01100001 01100111 01100101".split())
'cabbage'
 
@Ffisegydd nope -- not even on #qt
 
I still think it's worth trying to ask a question.
Or possibly trying on the mailing list.
(If they have one)
 
@Kevin very nice :)
@Ffisegydd okay, I will do -- thanks
 
The worst that could happen is it gets closed.
 
I'm expecting for someone to one up me with something like "you could just use string.binary_decode, you know"
 
2:57 PM
@Ffisegydd indeed,
 
mumble mumble stupid standard library which has everything you could possibly want mumble
 
@PeterVaro closed and for everyone to see that you're stupid, or deleted and not seen by anyone :d
btw which probelm?
 
is there a quick way to make an numpy array from nested list?
so create an array out of lets say nth item of nested list?
[[1,2,3],[4,5,6]...] and turn into [3,6...] array
 
@rodling so you have a nested list [[1,2,3], [4,5,6], [7,8,9]] and you want a numpy array [3, 6, 9]?
 
I dunno about numpy, but you can do
>>> x = [[1,2,3],[4,5,6],[7,8,9]]
>>> print zip(*x)[2]
(3, 6, 9)
 
2:59 PM
 
DSM
Cabbage, all.
 
back, cbg all
 
@Ffisegydd yes
 
(sorry for reposting it, I'm too tired to search for it again ;)
 
I guess just stick a numpy.array() around that expression. I assume you can create arrays from lists
 

« first day (1395 days earlier)      last day (3561 days later) »