« first day (1784 days earlier)      last day (3154 days later) » 

12:00 AM
Gaah, I was trying to get to 5000 before UTC midnight. :P
 
@OneRaynyDay ok gist.github.com/joranbeasley/96453c2fe6cb7164dc2f ... works fine for me (windows + py2.6 + wx2.8)
 
12:39 AM
@JoranBeasley Hey back! I'll check out the gist real quick :)
@JoranBeasley Ah I reproduced the error. I comma'd out this part:
        self.list_ctrl.InsertColumn(0, 'Subject')
        self.list_ctrl.InsertColumn(1, 'Due')
        self.list_ctrl.InsertColumn(2, 'Location', width=125)
 
ummm yeah ... if you ClearAll you need to re-add the columns ...
if you just ClearItems then you dont ...
 
So you're effectively not allowed a column-less listCtrl?
Because I was aiming for that :P
Just an empty listctrl with no columns(I would then repopulate it afterwards)
 
sure you are ...
Here's my situation: I call .ClearAll(), and then I try to insert columns
to quote you ...
 
Right... But see after the function ends from clear_all, it freezes
so does that mean you have to immediately insertColumn in the same scope you clearAll()'d from?
I was hoping to insertColumn from another function. Let me try that real quick
 
there is a new revision ...
you cant insert into any column if you have no columns ... so you can only do one (string)item per row
 
12:46 AM
ahhh... Okay let me try that on my program really quickly. That is probably the problem. I'm surprised it didn't give me an error message for something like that though
 
oops its not quite right
ok revision 3 is what you want i think ...
 
@JoranBeasley Oh but you're right though. I fixed it thanks to your help. I have no idea how it worked before, but here was my code before... :
 
I dont want your code :P
please dont post it in chat
 
Okay no problem
 
if you want to you can create a paste or gist
and link ... but its not a big deal
LC_REPORT needs a column style LC_LIST does not ...
 
12:52 AM
yeah I was about to post it in pastebin actually(I had that open before I had to go run an errand)
and yep, the person before me who used wx.python chose LC_REPORT. But yeah, I still need columns
it's just dynamically created from the input of a csv file :) Thank you very much though! The thing that threw me off was the listctrl not throwing an exception like... "Column does not exist, inserting string item was unsuccessful", but instead just straight up crashed.
 
Does anyone know how to calculate error bars for histograms in python?
 
it gives me a c++ assertion error ...
 
@JoranBeasley :o maybe it's the difference in IDE's? I'm using Canopy, but I have no error messages from it
 
Halfway to the mod-hammer.
 
@Anthony, calculating them shouldn't be hard as long as you have the original data. Do you mean plotting them?
http://matplotlib.org/1.2.1/examples/pylab_examples/errorbar_demo.html
 
1:00 AM
Cabbage :-)
 
pycharm is the best IDE :P
 
Cabbage fourth :D
 
Cabbage Alex ;-)
 
@AlexanderHuszagh I actually don't know what error bars are in terms of a histogram- I just have data and they want me to plot it. I suppose I should learn what they mean, but I don't know where to look.
 
1:21 AM
@Anthony, the error bars can be represented by either the standard deviation of the data or the standard error of the mean. Both are acceptable, but should be labelled. If you do not know what those mean, you should probably look it up.

Once you know the value, then you are good to go as long as you follow the plotting procedure.
 
I created an android app in kivy and it uses authentication in .py for uploading files. I apparently don't have access to a server, how can I proctect the authecation key.
 
user559633
name it DONT_COPY_PLZ.pyand trust people will respect your wishes
 
1:36 AM
Well, that could be a start but I wouldnt' rely too much on it.
 
1:50 AM
Any pointers?
 
user559633
int * mypointer;
 
Hmmm...okay.
 
 
1 hour later…
3:25 AM
Cbg
 
3:35 AM
 
live coding for a little while: livecoding.tv/davidism
 
3:53 AM
Is software development same as web dev
 
web development is a type of software development
 
what is application development
 
what do you think it is?
 
using c# or java to make application such as business applications
 
@davidism, out of curiosity, what are you using to stream?
 
4:05 AM
obs
 
4:22 AM
huh, so there's an SE site for sw recomendations.
 
4:48 AM
Cabbage :-)
 
rbrb, hit a roadblock coding, will sleep on it
 
5:03 AM
Got another email from a gold medal computer scientist I see. Man I wish I had a gold medal...
 
CBG all
 
Need you folks' opinion on this answer:
49
A: Python configuration file: Any file format recommendation? INI format still appropriate? Seems quite old school

codeapeConsider using plain Python files as configuration files. An example (example.conf): # use normal python comments value1 = 32 value2 = u"A unicode value" value3 = "A plain string value" value4 = ["lists", "are", "handy"] value5 = {"and": "so", "are": "dictionaries"} In your program, load th...

I am going with that top comment. Looks like there's a massive trade-off
 
5:56 AM
imo cv-pls, opinion-based
 
Just fyi: this post is now reopened
 
X-/
 
cbg
Oh gosh that python question is even worse than what I usually ask, and I ask pretty bad questions
 
Couldn't help but comment.
 
6:49 AM
@bereal upvoted, that was funny
 
 
1 hour later…
7:55 AM
Not many people here can tolerate electronic music, but Etherwood releases his LP today and it's simply awesome m.soundcloud.com/etherwood/sets/blue-leaves
 
Cabbage!
 
Cabbage!
 
8:08 AM
Not funny. So I was doing that xkcd survey and I got to "Fill this text box with gibberish by mashing random keyboard keys". So I did hit some combination, which actually closed the window... Not funny.
 
...funny...
:P
So I've got an Angular app and for some reason when I use D3.js to select an element I'm selecting the element on the previous "page" (I say "page" because it's a one-page app).
And it's driving me insane. I can feel my soul melting.
 
Arg. I have just found the window with the survey. So I actually managed to move it to another workspace and minimize it at the same time.
 
9:07 AM
Does anyone remember where contact form for saying "Hey this website X is taking SO content and not attributing properly?" is?
nvm found it
 
9:31 AM
Fixed my problem \o/ you know it's a good hack when you have to leave a 9 line comment in the source code.
 
9:42 AM
I bet you are going to be amazed by it when you get to maintain that code a year later. Or when you get sober :).
 
I'm leaving the project next week :D
To be fair, when I inherited it there were loads of hacks that I've fixed. I think I'm net positive on hacks.
 
 
2 hours later…
11:27 AM
cbg
 
cbg
 
I have a namedtuple('Car', 'Price Mileage') ... and their are 1000s of car ... I want to add Price of all ... Is their any elegant one line to find sum of prices? I can solve this using for loop :)
Was wondering, there should a better way ...
 
sum(car.Price for car in cars)
 
Cabbage
 
@bereal Thanks
 
11:37 AM
CBG all
 
KGB!
 
11:54 AM
Are you now or have you ever been a member of the КБГ?
 
12:05 PM
Probability question. You shuffle a deck of cards, look at the top card, then put it back. Then you repeat this process until you have seen all 52 cards. What is the expected number of shuffles you will perform? Is there a name for this type of question?
 
@PM2Ring (▀̿Ĺ̯▀̿ ̿)
 
I think it might be sum(52/n for n in range(1,53)) but that's more or less a wild guess
What if it was "...until you have seen all 52 cards four times each"? I'm guessing it's not just 4*sum(52/n for n in range(1,53))
 
Oh nice, my guess was correct.
Thanks :-)
> Donald J. Newman and Lawrence Shepp found a generalization of the coupon collector's problem when m copies of each coupon needs to be collected.
Ooh, this is relevant to my interests.
Is... Is that big O notation there on the right? I don't know how to get a number out of this.
 
12:21 PM
@Kevin It's an estimate of the expected number, with an error term on the order of n, so you can't get a solid number out of it.
 
Statistics has failed me, as usual. Time to write a program that simulates drawing from a deck one million times and tells me the average.
 
morning everyone
 
FWIW, I wrote some Python code to tackle the generalized Coupon collector's problem several years ago. It's not very fast, but for 52 cards, some expected numbers are 1: 235.978285, 2: 340.132394, 3: 430.911791, 4: 515.215572
 
@Kevin Monte Carlo FTW :).
 
Bleh. I don't get how to into TDD :\
 
12:27 PM
Here's a link to an xkcd forum thread with my code. Please ignore the first version, it's insane. :) Back when I wrote those posts the xkcd forum supported MathJax, but it no longer does so. Sorry about that. Variant of the Coupon Collector's Problem
Sorry. I should've said "Ignore the first version of the exact calculator in the 2nd code block". The first code block's just a Monte Carlo sim.
 
12:43 PM
I'll take a look in a bit, thanks :-) I'm actually working with a pool of 101 items, I hope that doesn't make it intractable.
 
Here are some results for 101 coupons. 1: 524.925129282, 2: 737.2352255, 3: 921.231759346. 4 sets and higher may take some time...
 
I need music. Anyone got anything heavy and fast and intense for music?
 
4: 1091.46845932
 
this is bretty good
 
12:58 PM
How about this old British early metal classic: Deep Purple - Bloodsucker
 
user559633
I'm reviewing an introductory python textbook before handing it to my girlfriend to her to learn from. The textbook mentions that Python 3 is the way to go, but yet, in their hello world, they expect you to use their custom module with the signature stdio.writelin(%s). All of a sudden, I feel sympathy for new programmers.
 
Friday cabbage
 
@tristan What do they gain from forcing people to use their strange module?
 
forcing people is fun
 
user559633
@wonderb0lt Waiting to figure that out. I think avoidance of dealing with print vs print().
 
user559633
1:06 PM
It has both stdio.write and stdio.writeln, so I think it's actually that someone was missing Java. I don't know how you can fuck up 'Hello, world!' in Python though.
 
YouTube always makes me feel self-conscious about my musical choices :| like I'll be listening to music I like then neck-tattoo emo-hair bands will be next on auto-play
 
@tristan Seems pretty easy
 
user559633
@wonderb0lt Yeah, I mean, they managed to do it. I think I'll just get a marker and cross out these parts though because that's missing the point.
 
@tristan Maybe they wanted to introduce the idea of standard input and output earlier? I dunno
 
user559633
@corvid sys has modules for that.
 
1:10 PM
is stdio some kind of non-builtin package?
 
user559633
Yes
 
Oh. That's dumb. Maybe the author wrote the library? I bought a WebGL book which basically amounted to "hey guys, why don't you use this library I wrote?" after the first chapter
 
user559633
I think I'm just going to write my girlfriend an intro to programming with python book
 
@corvid Surefire way to get many many stars on github and become a rich and handsome programming rockstar!
 
@tristan I would literally throw that book away.
 
user559633
1:17 PM
@Kevin I'm going to finish scanning through it, but it looks like they use their own goofy stdio package everywhere in it
 
@wonderb0lt And if the book is on async node, instant tons of stars
be sure to use the words "reactive" and "scalable"
 
Nothing like teaching nonstandard practices from page 1.
 
Should a beginner's book even have anything not included in python's built ins? You can do most things without external libraries pretty easily
 
user559633
I mean, beyond that goofy stdio, it has useful stuff and seems to have the greatest hits from cs101
 
How old is this book? Maybe the first version came out well before Python 3, and the author thought that Python having a print statement instead of a print function was a regression to the days of BASIC.
 
1:19 PM
FWIW, Lutz's Learning Python made me the man I am today
Although if you want your girlfriend to become the man I am today you may have problems
8
 
I do ;)
 
user559633
@corvid I think an ideal beginner's book would be Python3, stdlib only. Half way through, talk about the system it's on (sys/os modules), end with a tour of some very popular libraries
 
But think of the possibilities of having two jonrsharpes. You'd finally have an equal in the noble game of table tennis.
 
user559633
@jonrsharpe That's hilarious.
 
user559633
I think I might pick up Learning Python for her. I learned from Dive into Python, which has a "Hello World" of an ODBC connector, so that might not be ideal
 
1:23 PM
@wonderb0lt One benefit is that it locks your students in to staying with your book, because they won't understand the IO in other books / tutorials. :evil grin:
 
Fun fact: if your printer defaults to black and white, Windows Photo Viewer will not let you switch it to colour
 
The ideal Python tutorial involves a journey into the mountains to discover your spirit animal. I'm astonished this is not commonly done.
 
Thanks, Microsoft - I guess using the standard print dialog you've used everywhere else was just too difficult
 
What happens if you discover that your spirit animal is non-serpentine?
 
Python needs the var or let keyword :-(
 
1:25 PM
@AwalGarg why?
 
Well, if it's a fox, you have to abandon Python and go Rail at things.
 
Does the tkinter module have a version? I mean apart from Tk/Tcl. Like wxPython has different version than wxWidgets, PyQt has different version than Qt used etc.
 
@JRichardSnape Even the cunning mongoose has a place in the pantheon of ethereal programming guides.
 
@jonrsharpe I can't figure out where the variable is declared
 
@AwalGarg What's the difference in the two? Just scoping? I still have no idea when to use var vs when to use let
 
user559633
1:26 PM
I'm going to write a book in which it opens by having you figure out how to get Qt5 working and ends with a final boss fight against @MartijnPieters
 
user559633
[eek, didn't mean to ping -- was using the @ for spelling guidance and accidentally hit enter, sorry]
 
@tristan I am totally buying that!
 
Spoiler - you will always lose the boss fight
 
@corvid doesn't matter in a sane language like python. I just want some keyword as an aid to identify what scope a variable belongs to, and where is it declared.
 
So for syntax highlighting type stuff?
 
1:27 PM
@tristan Are you sure you were not looking for inspiration for the end of your book by trying to anger me? :-P
 
user559633
@IntrepidBrit ofc
 
@corvid that'd be another plus point of it, yes
 
How many wings would you like your final form to have, Martijn? Common choices are "one" or "eight".
 
user559633
@MartijnPieters Haha, I like the ':-P' because it's the equivalent of 'ha ha only serious'
 
I heard, that if you ping @MartijnPieters 5 times, he will appear behind you.
 
1:28 PM
yet he risked the follow up @...
 
@tristan Sure! I'm going to f.ing rip your head off when I use that! :-D
 
user559633
@Kevin Zero at first, but if you manage to make it to the second stage of the fight, he grows two black feathered wings
 
@bereal If it's a busy day he'll just fire an arrow into the support beam behind you, with a threatening message attached.
 
Can Martijin ask a python question so difficult not even he can answer it?
13
 
s/j/a/
 
1:29 PM
(Watch the progression from :-P to :-D, and draw your own conclusions about my mood!)
 
user559633
Wish me luck, job interview
7
 
good luck
 
Good luck!
 
@tristan good luck!
 
@tristan show them who's the boss
 
1:30 PM
Good luck, and don't call me job interview.
 
@tristan: good luck! (no weird smileys, all serious)
 
Good luck!
 
Break a leg
 
Remember me when you reach the top
 
@bereal Then say Martijn's already got a new job and offer your services.
 
1:30 PM
Don't be too hard on the interviewer! :-P
 
@tristan Good luck!
 
Quick Question about PyQt, Also Good Luck Tristan, Is it possible to create tabs based on a Output result? so if i got 4 different names would it be possible to create four tabs for each name? and if i reran the program and i got 5 names this time would it create five tabs?
 
That sounds like something that could be possible.
Having never actually used PyQt, I can say no more.
 
Alright I've been looking around but haven't found anything similar to this. Ill keep looking thanks!
 
Just take the code that makes one tab, and put it in a for loop that iterates five times.
 
1:33 PM
or an arbitrary number of times
e.g.
 
I was thinking of using an Loop but i thought maybe there was a more forward way rather than having to iterate each tab.
 
for name in names:
	make_a_tab(name)
 
well, a for statement is one additional line so it's really quite difficult to be more straightforward than that
 
(also, apply the Kevin caveat to me, I have never used PyQt in anger)
 
I meant like a setText(tab) type of line that the library tends to use over and over again in PyQt
 
1:35 PM
@Kevin No! for name in names: make_a_tab(name)
 
Eugh, yuck, my indentation is not 4 spaces :(
 
@Zizouz212 PEP-8 would like a word with you...
 
lol
Out of curiosity, is there any good puns with [licensing]?
 
"To kill [licensing]"?
 
@JeanP PyQt is a wrapper on C++ library. So usually no Python tricks when using it.
 
1:39 PM
@Fenikso Yeah i know, I was just confused on the setText command and if it could be applied to a set number of tabs individually
 
@JeanP Anyway, what platform are you using PyQt on?
 
doing a thing to a set number of things individually, is usually accomplished with a for loop. I feel like there's a miscommunication happening somewhere.
 
Yeah i feel like im just over complicating my program
@Fenikso Im on OSX and Windows atm for PyQt
 
Hey all,
I'm new to Python. I am a bit confused in selecting python or perl.
Actually, I have to use memsql for faster speed, capacity (instead of mysql as RDBMS) and I know that php is much slow then perl. I am totally confused about perl and python. Please help me knowing which one is suitable to use perl OR python. (i have millions of rows in database tables and i need queries to be performed, using php is time waste. Now PERL or PYTHON??)
 
"Which language is faster?" cannot be quickly answered except by testing actual code for both on your actual machine
 
1:44 PM
^
 
Hi, @JeanP. So are you sick of Tkinter already? :)
 
Also the language on top is probably not your main concern. A good optimized queries are.
 
That said, Python is ranked faster on the N-body benchmark :-D
 
Also, you're quite likely to get a bit of a biased answer to "Perl or Python?" in a python chat room.
5
 
(Although I suspect this doesn't matter even a little bit since your program is so heavily I/O bound)
 
1:46 PM
Has someone else faced an issue with No module named pkg_resources. I trying follow this popular question but it simply doesn't work stackoverflow.com/questions/7446187/…
 
What @Fenikso said is very likely right
 
@PM2Ring Well... I hate to be admit. I have only gotten my toes wet with TKinter. I've been so used to iOS Development and XCODE environment that I googled someting similar for Python and found PyQt and QT4
 
PyQt is very good and mature, apart from having like infinite bugs in GTK look and feel :-).
 
It makes sense to use a GUI framework that's similar to what you're used to. Besides, Tkinter is rather limited, and has various annoying quirks. Just ask Kevin.
 
Yeah, I've only been programming with python for a little over a month. It was a nice transition though from Swift and ObjectiveC
 
1:51 PM
You might try Kivy. It seems mature but for iOS supoort and docs are less.
 
20k cabbage all
 
Pineapple @davidism
 
Your invitation to a steak dinner with Jeff Atwood should be arriving in the mail any day now.
 
That's really all I wanted.
 
When do you get to meet Joel Spolsky?
Maybe that'll be the new 100k reward.
 
2:03 PM
You can meet him by [the rest of this comment is visible only to Stackoverflow Premium members]
-- And I said, "no soap, radio!" and we all had a good laugh.
 
@davidism Well done!
 
I always believed in you.
 
Can't rest though, there's potential privileges at 30k now.
 
We all "believe" in davidism.
4
 
:-|
 
2:11 PM
:)
 
Totally unrelated, but ublock says it's blocking 180 things on this Youtube page. WTF Google?!
 
What are the privileges after 20k?
 
I'm getting out before they zero in on my location. Rbrb, going to work.
I paused the video and the count jumped to 282. They know.
 
By surprising, I mean you often approach problems in unorthodox ways with orthodox python, if that makes sense. So, you think outside the box and then do it properly, the 'one way'. — Peter Wood 2 mins ago
Makes a nice change from "Y U so downvotes?"!
 
Can someone help with No module named pkg_resources. My answers I have online tend to be in vain.
 
2:15 PM
@AbhishekBhatia that error message throws up a lot of hits, can you be more specific than "tend to be in vain"? What have you tried, and what happened?
 
cbg
 
This is the error I get:`raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['curl', 'https://pypi.python.org/packages/source/s/setuptools/setuptools-18.2.zip`
No module named pkg_resources is when I am debugging an developed app in kivy using adb logcat.
 
Have you tried the solutions on stackoverflow.com/q/7446187/3001761
 
yeah:(
 
Then I suggest you write up a proper question, detailing what you've done and what the outcomes were, as well as additional details about your situation (OS, version(s) of Python, (non-)use of virtualenvs, etc.)
 
2:21 PM
I have done that already if I may post it here stackoverflow.com/questions/32390136/…
 
Why not edit it to include the things I just asked for? Did you only try the accepted answer?
Can you curl other things?
 
One of these days I'll get cx_freeze to work. :/
 
Well I tried all others I could find stackoverflow.com/questions/22148144/… . But no headway. The weird thing is I can install dropbox easily on same machine through terminal.
 
@jonrsharpe Nice. And I agree it looks like the OP has a major XY problem on their hands.
 
2:37 PM
@PM2Ring seems pretty likely
 
I didn't understand what PM 2Ring. Can you please explain.
 
The solutions mentioned in stackoverflow.com/questions/7446187/… most certainly wouldn't apply since the error in the buildozer compilation. But I posted it because it seemed to be the first thing to rey.
Also, buildozer uses python p4a recipe instead system's.
 
Someone have a look at this for me. Answer on a question with a large bounty, seemed to be urgent, no feedback from OP - have I missed something in the question / explanation? stackoverflow.com/a/32334301/838992
@jonrsharpe That's a nice compliment
 
Hm... how can you remove all non-numbers from a string?
 
2:50 PM
re.sub?
 
40
Q: How do we remove all non-numeric characters from a string in Python?

grizzleyQuite a simple question, but I'm a python noobie. How do we remove all non-numeric characters from a string in Python? How can I do that?

 
@JRichardSnape isn't it? It's nice to get some actual positive feedback once in a while!
 
Once I got a feedback from a user telling that my answer is good.
 
Absolutely - sometimes comments can be carnage no, I'm not bitter, not bitter at all
 
Haha I get plenty of those, too!
 
2:51 PM
After the user left I flagged the comment :P
 
eh?
 
@BhargavRao too chatty? Or not constructive?
 
not constructive
Best way to get free flags
 
Very ascetic of you, Bhargav
 
You could have made your answer worse and gone with obsolete
4
 
2:52 PM
It’s absolutely constructive to leave good messages that make the answerer happier.
 
@jonrsharpe LOL
 
Hadn't thought of that
:P
But tis unfortunate that someone flagged my 150+ upvoted comment on meta. :(
 
A challenge from a coworker: name a video game that became a good movie.
 
2:55 PM
Princess of Persia?
 
I wish I'd bookmarked a comment I saw a few days ago...
Question: How to obfuscate a Python program?
Comment: Write it in Perl.
 
Prince of Persia contains the word "mixed reviews" in its Wikipedia article, so it doesn't count
 
Super Mario Bros.
 
jonrsharpe PM 2Ring Please check the question now if it makes more sense, I have made the edit.
 
@PM2Ring I've seen that one. Quite recently...
 
2:57 PM
@MorganThrapp I'm going to pretend I didn't read that.
 
@PM2Ring I think I know that
 
C'mon, what's not to love about this guy?
 
Ah - we need to get to the magical 10k, @pm2
 

« first day (1784 days earlier)      last day (3154 days later) »