« first day (1376 days earlier)      last day (3562 days later) » 
01:00 - 17:0017:00 - 00:00

1:42 AM
@WalleCyril Just made my first truck for y racing game. Wanna help?
 
let's make program
 
 
2 hours later…
4:04 AM
cbg all
 
4:38 AM
cbg peeps!
 
cbg all
 
4:53 AM
cbg
 
5:24 AM
Hello everybody!
 
any algorithms up anyone's mind to manage a human queue at a retail store..
 
6:06 AM
Cbg all
@tila I'd suggest a queue :p
Python has deques
 
@Ffisegydd more like a queuing algorithm....: ) not a queue processing structure
 
 
2 hours later…
7:49 AM
Hey i am in dilemma PySide or PYQT or QT (C++) or C# (Windows and Mono)
Need some desperate advice.
 
I have the following in Kivy code it is giving Invalid property name
error
 
@user3620828 please place large code blocks inside a dpaste link rather than posting them directly to chat
 
2 messages moved to Trash
Generally if it's more than 6 or so lines we prefer a link to an external site, prevents the chat from being clogged with code :)
 
8:20 AM
Here is the code dpaste.de/vwCN in the weatherapp.kv file
ANd here is the error message dpaste.de/Jv9B
Never mind. I was using = instead of :
 
Is there any python libraries etc that you can use to get the lat/long of your IP address using python, instead of using selenium => opening firefox => and then making a js call, which is all a bit long winded
?
 
i dont think that was what you are looking for....so i removed it
 
8:36 AM
Oh, :) just as I went to click it.. thought you was teasing me...
 
ah yeah - thats just a general call but not going to show for your specific ip
hmmmm there must be an easy way to do it
 
9:08 AM
Anybody else feel XLRD library is very poorly documented?
 
9:19 AM
where is everyone today?
 
here :)
 
here sir
 
Boo!
 
9:37 AM
Hey @Phillip that question you've just asked is kinda off topic for SO. It's basically a resource/library request :/
While it's fine to ask in here in chat asking on the main site, it's likely to get closed.
 
Its not really of topic - I am not asking for a lib - just for alternative mthods
 
10:01 AM
wife <3 Now cooking, asked her if I can help, she said "no, go to Stack Overflow"
so here I am, cbg everyone.
 
:D cbg @Antti
My GF understands that SO is basically my mistress.
 
too bad that cooking is one of teh things I almost love more than computers :P
 
user559633
well, hello then :)
 
user559633
go to cooking.stackexchange and then make unbreaking eye contact when she comes in the room
 
user559633
@Phillip-Marsden the term that you need is "geolocation." it's not a matter of simply getting a library -- you have to talk to someone that maintains a database of IP to region mappings
 
10:07 AM
though 1 thing I almost like more than cooking is to eat wifeys cookings.
arrgh. I need to get rid of this life :D
 
user559633
haha, why @AnttiHaapala
 
hmhmm
bc every silver lining has a cloud?
 
user559633
@Phillip-Marsden it seems like there's an API and a dataset here for you dev.maxmind.com/geoip/geoip2/geolite2
 
user559633
I don't understand @AnttiHaapala
 
user559633
10:12 AM
yes, i'm familiar with the idiom, not sure how it applies here
 
user559633
and why you need to "get rid of this life" specifically
 
a pessimist cannot be disappointed :P
 
user559633
you're disappointed?
 
not rid of existence but rid of life as opposed to no-life :D
 
10:25 AM
@Bestasttung o hai
 
10:48 AM
 
grmbl, grmbl, grmbl bounty posted grbml correct answer grbml OP doesn't bother to come to SO for the whole duration of the bounty grmbl expired now no award grmbl.
GRMBL!
oh, and cbg everyone.
 
:D
cbg
 
11:06 AM
On the other hand, unexpected gold badge; you never know what post goes viral.
 
11:18 AM
@MartijnPieters why is it easier to get upvotes in meta than in real
@MartijnPieters and link to your answer :P
 
@AnttiHaapala Eyeball count per tag is way higher. Plus being listed in the 'community bulletin' helps.
And by link to answer you mean the bounty post?
 
0
A: Pycallgraph not generating graphd output in debug mode

Martijn PietersThe GraphvizOutput class uses a temporary file to output the dot source to, and runs the dot command line tool on that file before cleaning it up again. However, you can regenerate the same file contents rather easily by calling the generate() method after running PyCallGraph: with open('filter...

Bounty posted on the 14th. OP last seen on the 17th. My answer posted on the 19th.
 
cbg cbg
 
12:10 PM
cbg again
 
12:25 PM
osrc.dfm.io <- Quite cool.
 
 In particular, vaultah seems to be a pretty serious Python expert with a surprisingly broad knowledge of C++ as well
aww
 
tilaprimera is a serious Pythonista who loves pushing code. tilaprimera is a fulltime hacker who works best in the wee hours (around 4 am).
 
Might have a play around with their API, see what I can get from it.
 
They don't have enough information to grade me :<
 
12:36 PM
I also found out that Github has a shop :o
 
Where else are you going to get stuffed octocats?
 
Unfortunately they don't have stuffed Octocats, the closest they have is this.
I assume it comes with the baby?
 
Only for Github Gold members.
 
: )
 
$100/month just to get a baby?
 
12:40 PM
I have a question:

Is it more common (read: best practice) to import python modules for other modules that 'depend' on it, then create the object in that class, or to 'inject' them in the init method of the class (rather than importing), perhaps in the main 'main' method of the program?
 
No thanks, I'll get one from the market.
 
I don't think one way is worse than the other; I've done both.
For example, I wrote a GameGUI class, whose __init__ method takes a parameter gameState. So my main file imports both gamegui and gamestate, and injects the second into the first during instantiation.
But I've also done it the other way; where a class takes no parameters for its __init__, and creates its own internal objects.
When deciding which is more appropriate, I think the most pertinent question is: when a class requires another class' instance to work, should the user be allowed to specify what instance in particular to use?
 
@Kevin - good idea
 
You might even settle on a hybrid solution, where the user may optionally specify an instance, or the class supplies its own otherwise
Unrelated to the previous conversation: walls you hit in program size. This is definitely something I struggle with.
The article mentions that projects of different sizes require different techniques to succeed. I wonder if I have any beliefs about best practices which I think apply universally, but really only apply to programs with less than 2000 lines of code.
Stuff like "clearly written code doesn't need comments". When you have a million LOC, suddenly there's a very large difference between "understand this function by reading five lines of code" and "understand this function by reading one line of comments"
It's not observable for smaller projects because you can hold the whole thing in your memory anyway.
 
1:01 PM
Linux kernel is 15,000,000 LOC O.O
 
I wonder what's the biggest code base written by one person.
Dwarf Fortress?
 
DSM's latest java program ;)
And all it does is print "I f**king hate Java"
 
@Kevin Initial version of git?
 
Google Chrome has more LOC than World of Warcraft? O.o
 
1:08 PM
I'm guessing it's not counting the scripting of content
 
Yeah must not be.
Still that surprises me nonetheless.
The "modern high end car software" is insane too.
 
My first car ran on 0 LOC.
 
My current car runs on 0 LOC.
 
I have no car :P
 
I don't know about my current one since I don't know how the "check engine" light logic works
 
1:10 PM
No neither do I.
 
you see, I hate this LoC thingy -- most of the non-white-space delimited languages can be written in on huge LoC // cbg
I mean -- if that is true, how would you count the real LoC?
comments count? blank lines?
copy-pasted content over and over again?
 
"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger."
 
You have to look at the percentage that comments and blank lines make up though.
I might even try that with the Github API to see if there is some correlation.
 
@Ffisegydd Most tools today, are intelligent enough to ignore them :)
 
But should they be ignored?
A good comment is worth 10 good lines of code[1]
 
1:14 PM
All the Code coverage tools I have seen seem to ignore them
 
exactly
 
[1] Said by Ffisegydd on 23rd July 2014.
 
© All rights reserved.
 
But, we still call it Lines of "Code"?
 
strictly speaking comment is a code
 
1:15 PM
Missus is in Germany for the week so that's my evening sorted! Using the Github API to look for correlation in the percentage of LOC with code size.
 
it is part of the syntax, isn't it?
 
I would argue that blank lines are code, they serve a purpose.
 
@PeterVaro Thats true, will executable code make sense?
 
in some languages, like Nimrod, it is deeply embedded inside the AST -- and you can use it on runtime
anyway, my point was: it is super hard to establish the rules of line counting -- also, the less code you made withe the more functionality/features provided the better
so IMHO this whole LoC is only good for non-technical employers
 
when it makes .pyc files, Python throws out comments and string literals that aren't referenced anywhere (exception: docstrings). From this perspective, they aren't code.
 
1:21 PM
they can look at the numbers and can tell: well, all my employees are working so hard, they even write 3k LoC a day each
@Kevin so it is clearly language specific wether comments are part of the code base or not
which leads us to the point: can you compare for example a C LoC to a Python LoC?
ofc not :)
@Kevin also what about docstrings? are those comments or not?
 
Not by the definition I was using in my above statement, "text following a pound sign which is not inside a string literal"
(donning an artsy beret) really, one may as well try to judge a painting by the number of brush strokes used.
3
 
@Kevin nice metaphor!
 
I must go on this course edwardtufte.com/tufte/course_advanced O_O
Someone lend me $240 for the fee...and $x for the flight to and from USA.
 
@Ffisegydd A matplotlib question, I guess
 
@thefourtheye a poor question. OP isn't giving the information.
It always astounds me how people think we can read minds.
 
1:36 PM
People get jobs talking to computers because they're no good at talking to people.
I smell an XY problem here. I bet this guy has a dozen global variables and doesn't want to write a dozen functions to manipulate each one.
I'm hoping my comment will elicit a confirmation. Something like "It's only three lines in this sample code, but it's closer to 300 in my actual application"
 
Still thinking about that article. I wonder if I subconsciously discard all project ideas that would require more code than I'm comfortable writing.
 
So I have a coworker that brought this up. I'm making a desktop app that a couple of people at my workplace will end up using. He's an artist in his spare time and when I showed him the tkinter gui he was NOT digging it, so he suggested making an html/css interface that we could just throw on the shared drive and have the program accessible through the browser, since the shared drive is just a network location. Does that make sense?
 
@Al.Sal sure it does
although it all depends what is the goal of the project
 
An app's first job is not to be pretty, it's first job is to do something useful. If using html/css interface causes you more work in the long run than simply using Tkinter then tell him to suck it up.
 
1:44 PM
Are you more comfortable with HTML/CSS than with Tkinter? Is there any reason to think that the end result would be more aesthetically pleasing than what you've got now?
 
but using a browser-based UI can be a good idea -- designers are already familiar with HTML/CSS/JS
also it makes it available through a phone or a tablet
without all that extra effort
 
@thefourtheye, your edit just broke it, now yo need to pass the dict
 
but it also means, you need something (WebKit or a full-scale browser) to render and make your UI work
 
@wwii Yup, I thought that it would be better this way :-)
 
Well, we talked about it and ideally we'd open the already extant tkinter interface to the users, and then work on the alternate implementation as as a side project because the code that does the heavy lifting is very distinct from the interface, as it should be.
 
1:47 PM
@Al.Sal anyway, I personally don't like web apps -- but also don't like wx, qt or tinter based GUIs either
 
I don't know if this needs to be said, but if you're going to have an HTML front end, there's no simple way to hook that up to business logic written in Python.
 
Part of the appeal for me is that it would give me a chance to get familiar with html/css. @PeterVaro, what do you like?
 
I like the native UIs -- but as I said it is a personal preference
 
(Assuming that there's no server side, which I expect is the case since it's just a file sitting on a drive)
 
Could you theoretically have a Flask app sat on a shared drive?
 
1:49 PM
with MAMP, LAMP WAMP + Flask it is not that hard to set up a local webserver
;)
but this solution is just ugly as hell, and makes it depends on so many things..
 
PS, for context, this application fills in some information customers want into whatever tabular format they're asking for. it's a daily task that is pretty time consuming to vlookup, etc etc in excel.
 
If it were me, I'd focus on making the existing Tkinter interface look better
 
Does he not like the interface itself (button placement, menu options, etc) or does he not like the way Tkinter looks in general?
 
I just worry you'd go to all this trouble to design a web interface... And it's just as ugly as the first one
 
True. I'm actually pretty happy with the interface myself and I'm about ready to wrap it up. But I like the idea of getting more used to HTML/CSS in my downtime
and hah, he dislikes the way it looks in general.
 
2:01 PM
Tell him to shove it ;)
 
Oh, ok. "I want to use this as a learning experience" is a pretty good justification.
That's pretty much the purpose behind all of my hobby projects.
 
yeah, it's cool that the final product comes with learning experience (almost) every time
 
Nice slide about the look and feel of tkinter de.slideshare.net/r1chardj0n3s/tkinter-does-not-suck
 
Yesterday I got mad at Tkinter because my primary reference source doesn't mention that you can register an event listener for "the window was destroyed" events
 
classic effbot. But it's still being worked on right? Maybe bryan oakley should take a look at it... lol
 
2:06 PM
> This is the Tkinter introduction, last updated in November 2005
 
...
wow i cannot read
 
Cbg
 
The Internet is littered with a million half-finished Tkinter reference pages.
I know! I'll write a Tkinter reference page that will outshine them all!
(six months later)
The Internet is littered with a million and one half-finished Tkinter reference pages.
 
Why I get this error: cannot concatenate 'str' and 'tuple' objects? dpaste.de/pAXP
 
That usually happens when you try to concatenate a string and a tuple
 
2:11 PM
@Kevin xkcd.com/927 ... hehehe
 
Perhaps you should try t += str((u.id, u.username))
 
@Kevin: Thanks, I know but how should I do this correctly? I have no idea
 
DSM
Morning cabbage to all.
 
Morning
 
moin'
 
2:15 PM
mn.
 
@Kevin: hmm "need more than 1 value to unpack"
 
DSM
@mamasi: I think you're confusing an object (a tuple) with a string representation of it. Are you trying to build a string, or are you trying to make a tuple of tuples (as in your "expected output")?
 
@DSM: I'm trying to make a tuple as in "excepted output".
 
DSM
Then why set t = "("? That makes t a string consisting only of a left parenthesis.
 
In that case you probably want to do
items = []
for u in test:
    items.append((u.id, u.username))

items = tuple(items)
tadaa, no string manipulation required
(for the LOC conscious, skip the loop with items = tuple((u.id, u.username) for u in test)
 
2:22 PM
@Kevin: thanks, nice solution
 
@DSM This kind of thing happens often enough that I think it deserves a pithy name. I propose "map-territory confusion"
 
DSM
Yep. The original would have actually worked if t = "(" had been t = tuple() and there was no t = ")" at the end.
 
A map describes territory, but it is not territory; a string representation describes a tuple, but it is not a tuple.
 
DSM
Hmm. Map-territory. Map/land might be pithier.
 
I'm just using the terms that I stole from here :-)
 
DSM
2:25 PM
Oh, come on. I was just looking up "Ceci n'est pas une pipe" to make a Magritte joke.
But it's already referenced there..
Okay, map/territory it is.
 
Ooh, I was right about my XY suspicions from here. I will dance the Dance Of Rightness.
 
DSM
"I think that the answer it's the same, i just want to take less work :/": Quantitative differences can motivate qualitatively different solutions.
 
This is true. If it had been five hundred globals, I would have proposed a different answer.
Most notably, it wouldn't have five hundred instances of Button(root, command=..., but for six I wasn't willing to go to the extra effort.
 
DSM
I was sure I'd said something similar before.. digging through my comment history: "Different solutions are appropriate for different regimes because they scale differently. If you give an abbreviated example -- which is fine, btw! -- then please mention the sizes involved in your real problem too."
 
Since it would also require me to explain the "early binding trick" necessary for registering callbacks that refer to a loop variable
 
DSM
2:30 PM
I need some new thoughts on things..
 
Cbg all :)
 
DSM
Midmorning-local-time cabbage for Ian.
 
> Good morning, sir. Good afternoon, madam. It crossed noon while I was talking to you so I technically was correct.
-- Professor Frink
 
DSM
aargh dynamic variable names once again
 
The man may be a science master, but he's splitting his infinitives like a barbarian.
 
2:36 PM
I wish there was a Python package for electrocuting SO users over the internet...
@DSM and capitalised variable names, truly this man is a monster.
 
I don't get that question. it's just find/replace "vars" with "globals", isn't it?
 
DSM
I'm not in a goodPosition toComplain at theMoment.
 
I don't think I'm using the right method to plot this line. I think there is an easier way. Take a look at the paper I gave a link to and it is equation 10. I'm sure now I don't need to do this. I essentially need to plot y = (−0.86928 + 0.052481x)tanh(2.66503 − 4.44255x) − 1.251617 — Michael Roberts 1 min ago
 
DSM
@Ffisegydd: eps does what?
 
Your response seems to have been cut off. "That's simple as."
 
2:39 PM
It's a parameter.
 
As simple as what? pie? brain surgery?
 
@DSM but what aboutUsingbactrianCase??
 
@Kevin it's just simple as :P
Maybe it's not a saying in 'Murica.
 
Not in my area.
 
DSM
@Ffisegydd: I know what it is, I'm wondering what it does. It doesn't seem to be used in the function.
 
2:41 PM
This is a difficult phrase to google.
 
I think the OP is confused. Originally he had eps in place of Z meaning his function just returned a float (see the edits).
 
@Ffisegydd Is this one still unclear?
I'll be happy to throw a 5th vote against it if it is.
 
@Martijn I can see what he's trying to do but it's not exactly crystal clear, I've decided to walk away from it personally as I think the OP will need more help understanding the solution.
 
DSM
@Al.Sal: I love quoting this--

> Recall that intercaps became popular in programming languages that did not
> allow underscores within names, such as Pascal and Smalltalk. In suppressing
> the visual separation between words, one seems to be reverting to the early
> Middle Ages, when handwritten words were not separated, and thus flouting
> an important readability tool that is a thousand years old.
 
@Ffisegydd I can't call it, so I'll refrain from voting. I know the feeling however, walk away from questions where you feel you have to spell it all out to the OP.
 
2:46 PM
@DSM Maybe we should go further back to roman times typophile.com/files/roman2_5320.jpg . Then again, that's kind of what R does
 
I wish pandas linked to the source code from the documentation. In fact I wish all packages did this... So if you are still unsure of something in the docs you can click an easy link and be taken directly to the source code.
 
@Ffisegydd: case study just posted. Staying away apart from a quick formatting edit.
@Ffisegydd I love Github search for that.
 
Yeah I've gone into Github and found it manually but I'm lazy :P
 
DSM
I think most pandas devs use some flavour of IPython so when we need to check something it's just obj??. So its utility might have been underestimated.
 
Seems like source code links would be difficult to maintain.
If you just link to some line number in the most recent code, when the code changes, that number goes out of date. If you link to a line number in a particular version of the code, then you should still go through the docs and update them to more recent versions periodically.
 
2:54 PM
You can link to commits (in Github and I assume others). There's a way to do it I think but yeah using IPython is probably easier.
 
It would be nice if you could say "this link points to the first line of the frobnicate function in the latest version of the file that defines it"
 
DSM
heeps2 is not my best choice of variable name ever.
 
what else are you going to call your second heeps?
 
DSM
I wrote the code, and even I can't remember what "ep" means, although "he" means "HierarchicalElement".
 
3:07 PM
@Jon BRIIIIIIIIIIIAN!
 
Yo
 
@Ffisegydd STEWIE!!!!!!!!!!!!!!
 
DSM
grumble between Scylla and Charybdis grumble
 
I get that reference.
 
Oooo, 2k to go for 50k...
 
3:33 PM
cabbage, all
 
Greetings
 
@Rolf cbg
 
cbg all...
 
Hi
 
heya @Mirko - how ya been?
 
3:37 PM
I wonder, would there be any objections against NOT using return in a function that doesn't return anything?
 
Bananas!!!! Now there is air in the summer.... but I have to study the frameworks of Python... @JonClements
 
@RolfBly Nope, that's usually how it's done.
If you don't want to return anything, you don't need return
If you see people ending their functions with just blank return, they're probably recent immigrants from a more brackety language. "but I need something to indicate the function is done!"
No, you really don't. The change in indentation level ought to be enough.
 
Of course, no one's going to be too mad if you did an explicit return None and put something in the docstring to indicate it's deliberate behaviour :)
 
This is true.
 
Thanks.
Debates on coding style can heat up, I noticed. So I'm always wondering 'if an expert saw this, would I look ridiculous?'
 
3:49 PM
I like arguing about code style because it's hard to prove me wrong :-)
Not like actual factual debates where the other side can say "I looked in the interpreter's source code and here it is, as plain as day: you're wrong and dumb"
 
cbg agn
 
I just have to make sure not to directly contradict PEP 8.
 
DSM
There's a reason I stay away from the python-internals tag..
 
cbg @tila
@DSM your veterinary skills aren't quite up to putting together the reptile once you've opened it?
 
DSM
There always seem to be bits left over..
 
3:53 PM
@DSM bah... just throw the bits in the bin and pretend you didn't notice...
 
Nobody really needs a pelvic splanchnic ganglion.
 
DSM
You know what? You want me to google that. So I'm not going to.
 
I'm pleased to see that its Wikipedia article has an "In Popular Culture" section.
 
I have an image of @DSM as Zoidberg now.... :)
 
DSM
@JonClements: that's probably why I don't have a spleen today. Some doctor probably felt the same way..
 
3:55 PM
(since popular culture is where I learned of it to begin with. validation!)
@DSM I can't recommend ever looking up anything remotely biological. The resulting Wikipedia articles tend to have a lot of amateur photography.
 
cbg @davidism
 
cbg
 
cbg @davidism
Urgh I've started writing my thesis >_<
So many maths...
 
DSM
You can never have too much math.
 
@Kevin 'they contribute to the innervation of the pelvic and genital organs', so without them mammalkind would become extinct, I reckon.
 
4:00 PM
@RolfBly as long as puppykind survives - who cares? :p
 
Sounds like a bad pick up line. Hey baby, wanna innervate my... No, never mind. I don't want to continue with this joke.
Let's instead argue about whether "math" should ever be pluralized with an S.
Or rather, you guys argue about it while I go buy lunch.
 
@Ffisegydd switch sounds good to me. I'll merge the ng branch to master later today and make a 1.0 release.
 
@Kevin you're buying us lunch? That's very kind of you sir...
 
DSM
At first I thought the delivery costs would be prohibitive, but that's silly: he could call local businesses to send them.
 
Supper's ready. Rhubarb, y'all! (Actually it's salade Niçoise with salmon.)
 
4:05 PM
@RolfBly enjoy :)
 
thanks..
 
@davidism awesome.
 
Lo Jon :)
 
sopython.com will be undergoing maintenance during the evening of 23/07/2014. For God's sake don't panic, we don't need another incident.
 
ANARCHY
 
4:09 PM
@Ian cbg!
 
There we go, fits without needing ...
 
:D
@JonClements & @Ffisegydd how are we both?
 
@Ian are you asking us how Good and Evil Ian's are doing?
 
@Ian content with my lot.
 
:D - no no no, Evil Ian has been banished from the Kingdom
 
4:12 PM
Ummm.... the Commonwealth games opening ceremony might be interesting tonight...
rbrb in a bit...
 
4:39 PM
@Kevin I wanted to ask for a while now, I just keep forgetting it.. what is the status of KS?
 
I probably need to re-do the built in types. Wasn't quite satisfied with it the first time around.
 
oh so are you actively developing it ?
I was just thinking about it, the other day in the C room we were talking about language bootstrapping (language compiler written in the given language)
and was wondering about any plans on writing KS in KS :)
 
Absolutely. That's been my objective since the beginning.
 
it sounds so exciting..
:)
 
I haven't done anything on it since May, but I doubt I'll leave it alone forever
 
DSM
4:53 PM
I could spend another hour tracking down this memory issue involving some technicality about what c++ is assuming, or I could wrap it in shared_ptr and get on with my day. I'd tell you what I decided, but, you know, spoilers.
 
@DSM ;)
 
01:00 - 17:0017:00 - 00:00

« first day (1376 days earlier)      last day (3562 days later) »