asking for programming help June 10, 2007 10:17 AM Subscribe
I am finishing work on a short python program for my master's thesis. I am a newbie at python, and would like to ask for help optimizing the program in AskMe, by posting the actual script and having people with more experience give it a look. 2 questions:
1) does this sound too do-my-homework-ish?
2) the program is about 130 lines, would it be kosher to post the whole thing inside the question (not on the front page, obviously)? Or should I just link to the .py file on a server?
If you're going to post the whole script into the MI, be mindful of things getting et; & and < and >, etc. You may want to pre-process those with a find/replace on the trouble entities if necessary.
posted by cortex (staff) at 10:30 AM on June 10, 2007
posted by cortex (staff) at 10:30 AM on June 10, 2007
<code>
posted by carsonb at 10:36 AM on June 10, 2007
putting your script between these will keep your < 's, &'s and>'s from being 'et'>
</code>posted by carsonb at 10:36 AM on June 10, 2007
Definitely better off linking to the .py or posting it to a site such as nomorepasting.com. Might I also suggest asking on #phython channels on your perfered IRC server?
posted by furtive at 10:37 AM on June 10, 2007
posted by furtive at 10:37 AM on June 10, 2007
heh.
<code>
posted by carsonb at 10:38 AM on June 10, 2007
<code>
putting your script between these will keep your < 's, &'s, and>'s from being 'et'>
</code>posted by carsonb at 10:38 AM on June 10, 2007
1) If you have specific questions, then it's fine. If you say "make it work better" then no.
2) Most definitely link. There are tons of "paste code snippet" sites. You get syntax highlighting, line numbering, and freedom from having to manually replace every < with < so that it's not mangled. Plus with python being whitespace sensitive means you have to use <pre> and doing so in a metafilter post or comment means you have to use <br> instead of hitting return otherwise it will come out double-spaced.
posted by Rhomboid at 10:47 AM on June 10, 2007
2) Most definitely link. There are tons of "paste code snippet" sites. You get syntax highlighting, line numbering, and freedom from having to manually replace every < with < so that it's not mangled. Plus with python being whitespace sensitive means you have to use <pre> and doing so in a metafilter post or comment means you have to use <br> instead of hitting return otherwise it will come out double-spaced.
posted by Rhomboid at 10:47 AM on June 10, 2007
I don't think it would be any more of a problem than all of the "Can you take a look at my life/relationship/STD and tell me how to improve it?" questions that flood ask.metafilter every day.
posted by cmonkey at 11:31 AM on June 10, 2007 [4 favorites]
posted by cmonkey at 11:31 AM on June 10, 2007 [4 favorites]
jessamyn has spoken, and all, but I think cmonkey is mostly right.
posted by Kwantsar at 12:24 PM on June 10, 2007
posted by Kwantsar at 12:24 PM on June 10, 2007
I think posting it to comp.lang.python instead would get you better answers.
posted by grouse at 12:25 PM on June 10, 2007
posted by grouse at 12:25 PM on June 10, 2007
I don't think it would be any more of a problem than all of the "Can you take a look at my life/relationship/STD and tell me how to improve it?" questions that flood ask.metafilter every day.
And at 130 lines it'd be shorter.
posted by Wolfdog at 1:09 PM on June 10, 2007 [3 favorites]
And at 130 lines it'd be shorter.
posted by Wolfdog at 1:09 PM on June 10, 2007 [3 favorites]
Let him do it himself. You're not a number, you're a free man.
posted by sluglicker at 2:31 PM on June 10, 2007 [1 favorite]
posted by sluglicker at 2:31 PM on June 10, 2007 [1 favorite]
Put the program itself on a pasteboard site, <code> & <tt> fuck all whitespace bigtime, and <pre> doublespaces everything. You might convert tabs to spaces in your code (if you're using them), just cause it makes dealing with web pasteboards easier (it's a pain having to paste in tabs).
posted by blasdelf at 3:25 PM on June 10, 2007
posted by blasdelf at 3:25 PM on June 10, 2007
Thanks for all the advice. I'll phrase it is a specific question.
grouse: "I think posting it to comp.lang.python instead would get you better answers."
Yeah, but I like you guys.
posted by signal at 3:27 PM on June 10, 2007
grouse: "I think posting it to comp.lang.python instead would get you better answers."
Yeah, but I like you guys.
posted by signal at 3:27 PM on June 10, 2007
comp.lang.python is one of the most welcoming and kindest fora I have ever participated. I think the people there are generally even more helpful than Ask MetaFilter. And especially for Python questions.
posted by grouse at 3:31 PM on June 10, 2007
posted by grouse at 3:31 PM on June 10, 2007
Why can't your master write his own damn thesis?
posted by CitrusFreak12 at 3:35 PM on June 10, 2007 [5 favorites]
posted by CitrusFreak12 at 3:35 PM on June 10, 2007 [5 favorites]
I strongly second the suggestion for comp.lang.python. Another good place (for beginners) is the python tutor list.
But before you do... any strong reason why you want to optimize your program? Do you think that you will save more time optimizing it than you will invest in optimizing it?
posted by aroberge at 7:24 PM on June 10, 2007
But before you do... any strong reason why you want to optimize your program? Do you think that you will save more time optimizing it than you will invest in optimizing it?
posted by aroberge at 7:24 PM on June 10, 2007
and <pre> doublespaces everything
not if you use <br>s instead of newlinesposted by Rhomboid at 7:38 PM on June 10, 2007
wait - these days you can get a masters with 130 lines of code in a language you don't know? saweeeeeet!
posted by quonsar at 4:03 AM on June 11, 2007
posted by quonsar at 4:03 AM on June 11, 2007
You are not logged in, either login or create an account to post comments
posted by jessamyn (staff) at 10:23 AM on June 10, 2007