|
Rocko Bonaparte posted:There's a lot of modules in PyPi to work with subversion, so I was hoping somebody could recommend a few before I just try to figure what a bunch of them can or can't do. I have to deal with a situation where subversion is being used basically for software distribution (sad) to some Windows machines. So we'd use it to revert and update to a specific revision of the repository. Is there a general heavyweight module for this, or at least one more suitable for this kind of thing? A friend of mine has had good experiences with pysvn. I've never used it myself, though.
|
# ? Dec 18, 2013 03:36 |
|
|
# ? May 9, 2024 05:34 |
|
BeefofAges posted:A friend of mine has had good experiences with pysvn. I've never used it myself, though. Thanks--I'll try to start there first.
|
# ? Dec 18, 2013 17:31 |
|
PySide/PyQt question, how do I clone widgets to add over and over? Because if you just try to add widgets already set up from a variable, it will just take it and move it somewhere else instead of making two. For anyone not familiar with grid layouts the four numbers just represent row, col, row span and col span so nothing important in this example. If I do grid.addWidget amount or desc again it will still only create one, not two. Code: Python code:
|
# ? Dec 19, 2013 05:35 |
|
Use a function to construct a QLineEdit with the correct properties, and call it a bunch of times. Cloning widgets is not supported, as it wouldn't be a good API.
|
# ? Dec 19, 2013 05:42 |
|
Suspicious Dish posted:Use a function to construct a QLineEdit with the correct properties, and call it a bunch of times. Cloning widgets is not supported, as it wouldn't be a good API. That makes so much sense and is so easy that I did not think about it well, I'm learning! Thanks.
|
# ? Dec 19, 2013 08:42 |
|
Just checking to make sure that you aren't loving stupid enough to bet money on the type of bets that these faggots want you to make.. If you are actually stupid enough, you should prolly bet on motherfuckin winning bets, plenty enough missiles imo. edit: i'll let this stand since it got quoted several times Pivotal Lever fucked around with this message at 21:36 on Dec 19, 2013 |
# ? Dec 19, 2013 12:01 |
|
Pivotal Lever posted:Just checking to make sure that you aren't loving stupid enough to bet money on the type of bets that these faggots want you to make.. If you are actually stupid enough, you should prolly bet on motherfuckin winning bets, plenty enough missiles imo.
|
# ? Dec 19, 2013 12:51 |
|
Pivotal Lever posted:Just checking to make sure that you aren't loving stupid enough to bet money on the type of bets that these faggots want you to make.. If you are actually stupid enough, you should prolly bet on motherfuckin winning bets, plenty enough missiles imo. Yeah, I was gonna say the same thing.
|
# ? Dec 19, 2013 15:38 |
|
Pivotal Lever posted:Just checking to make sure that you aren't loving stupid enough to bet money on the type of bets that these faggots want you to make.. If you are actually stupid enough, you should prolly bet on motherfuckin winning bets, plenty enough missiles imo. Good point. Please tell us more.
|
# ? Dec 19, 2013 17:57 |
|
Pivotal Lever posted:Just checking to make sure that you aren't loving stupid enough to bet money on the type of bets that these faggots want you to make.. If you are actually stupid enough, you should prolly bet on motherfuckin winning bets, plenty enough missiles imo. Just sort of want to empty quote this post because it is maybe one of the best posts I've ever read and I would also like to hear more so please, keep posting.
|
# ? Dec 19, 2013 18:44 |
|
Pivotal Lever posted:Just checking to make sure that you aren't loving stupid enough to bet money on the type of bets that these faggots want you to make.. If you are actually stupid enough, you should prolly bet on motherfuckin winning bets, plenty enough missiles imo. Missiles?
|
# ? Dec 19, 2013 20:24 |
|
I mistook CoC for GBS 2.1, sorry! This thread could use more missiles, tbh.
|
# ? Dec 19, 2013 21:28 |
|
So uh, I can't wait for Python 3.4, enum looks handy.
|
# ? Dec 19, 2013 21:42 |
|
Pivotal Lever posted:So uh, I can't wait for Python 3.4, enum looks handy. Python's getting an enum? Finally I can't believe this was the accepted method: Python code:
|
# ? Dec 20, 2013 02:47 |
|
Pivotal Lever posted:I mistook CoC for GBS 2.1, sorry! This thread could use more missiles, tbh. We need some sort of global lock to make sure output can only happen on one thread at a time.
|
# ? Dec 20, 2013 15:52 |
|
And then, to continue to post a lot, we can just create more python information forums, and then try to merge the results from them later.
|
# ? Dec 20, 2013 17:23 |
|
Incase anyone was curious:
|
# ? Dec 20, 2013 19:16 |
|
Dominoes posted:Incase anyone was curious: How did you scrape data for this? I'm having a hard time figuring out how to get data from webpages etc.. e: Thank you! semicolonsrock fucked around with this message at 20:21 on Dec 20, 2013 |
# ? Dec 20, 2013 19:20 |
|
Yahoo has a quasi-API (manipulating get URLs) for realtime and historical data. It can pull 200 stocks per query for realtime, and 1 for historical. Tradeking has realtime data with 2500+ stocks per query, as well as tools to monitor your account and place orders. Yahoo's API is open, Tradeking requires a brokerage account. Guide on Yahoo realtime data Tradeking API docs Guide to using Pandas to pull Yahoo historical data. I haven't implemented it, but I verified it works. The tradeking.py and yahoo.py modules here show my implementation. Most of the trouble and much of the code for both APIs involves exception handling for the weird results the APIs can return in nonstandard situations. Other bits are to standardize the input names and output format between APIs, which makes it easy to hot-swap them, or add a new one without messing with code outside the API modules. Note that the quote and real functions in both modules use the same API pull. The real functions are messier because they aggregate data from several pulls, to work around the stocks-per-query limits. Here's how to find a single bit of realtime data for a single stock using Yahoo, and one stock's historical data, without the exception handling/formatting/name standardization etc. Python code:
Dominoes fucked around with this message at 19:49 on Dec 20, 2013 |
# ? Dec 20, 2013 19:28 |
|
Dominoes posted:Incase anyone was curious: That looks lovely! Well done!
|
# ? Dec 20, 2013 19:32 |
|
Dominoes posted:Incase anyone was curious: This looks really nice are you going to add some charts? (I love charts)
|
# ? Dec 20, 2013 23:15 |
|
Double-clicking an item from any of the trees brings up chart of that stock's historical data over the past year. I'm working on making it show useful info, like marking the buy and sell points for roundtrips, as well as what the optimal ones would have been. Marking lines of where the price would have to climb or fall before the program triggers a sell for a currently owned stock etc.
Dominoes fucked around with this message at 23:58 on Dec 20, 2013 |
# ? Dec 20, 2013 23:48 |
|
Dominoes posted:Incase anyone was curious: You dick, don't get ahead of me (Nice job!) === Version 1.1 of my app is up, too! http://rpazyaquian.herokuapp.com/stocks/NTDOY There's a few problems with it at the moment, though:
|
# ? Dec 21, 2013 00:20 |
Pollyanna posted:Version 1.1 of my app is up, too! Woohoo! Way to go!! Pollyanna posted:
#1 Maybe use a try/except and catch the IOError (should be caught anyways when communicating to external services in case they go down) #2 I think you want request.args, haven't used Flask before though #3 Probably a way to avoid generating an actual file each time, not familiar with that library though. Should be able to just stick it inside of a <script type="text/javascript">alert('hello world')</script> type of thing. If it turns out you have to actually generate a file, use a randomized filename so you don't run into an issue where two requests try to write to the same embed.js file each time (and make sure they are temp files so they get automatically cleaned up)
|
|
# ? Dec 21, 2013 01:03 |
|
I don't know what happened since I started working on v1.2, but now SA keeps flashing "hello world" alert boxes at me fletcher posted:Woohoo! Way to go!! v1.2 is up! http://rpazyaquian.herokuapp.com/stocks?symbol=AAPL Thanks for the help. #1 and #2 have been addressed. #3, I'm still working on, but the file name is randomized so there shouldn't be a problem...
|
# ? Dec 21, 2013 04:09 |
|
Pollyanna posted:[*]I want to have the URL for accessing a certain stock symbol to instead be something like '/stocks?symbol=GOOG' as opposed to '/stocks/GOOG/. Out of curiosity, why do you want this? I think the latter version looks nicer.
|
# ? Dec 21, 2013 05:06 |
|
suffix posted:Out of curiosity, why do you want this? I think the latter version looks nicer. Yes, this is true. The other way is old and uncool. Not having query parameters is new and cool.
|
# ? Dec 21, 2013 05:34 |
|
suffix posted:Out of curiosity, why do you want this? I think the latter version looks nicer. ...Uh. I dunno Is this really that much of a bad thing? Now that I think about it, maybe it IS easier the other way...but then how do I display multiple plots on a single page? Can't I submit an array of values for the get method? I can go ahead and display many plots that way.
|
# ? Dec 21, 2013 05:52 |
|
Make the last part of the url a comma separated list.
|
# ? Dec 21, 2013 06:18 |
|
Pollyanna posted:...Uh. I dunno Is this really that much of a bad thing? Okay, yeah, supporting multiple plots a fair reason to use query parameters. Other typical reasons are to use web forms, or because it's easier to set up with PHP or CGI scripts. There's little practical difference, but in a traditional RESTful URI layout you have a resource, like GOOG, and a canonical path to that resource, like "/stocks/GOOG". That gets messy for queries and multi-gets, so query strings are often better for that, IMO. Mostly when people do stuff like "?p=index", it's because it's the easier way in PHP, so I was curious why you were doing that when you get pretty URIs for free. For multiple plots, you could use comma separation, like "?symbols=GOOG,AAPL", or repeated parameters, like "?symbol=GOOG&symbol=AAPL".
|
# ? Dec 21, 2013 06:42 |
|
Trying to do ?symbols=GOOG,AAPL gets me an error where it returns the whole thing as a single string. For example, this codePython code:
With /stocks?symbol=AAPL,GOOG, it tries to go through every character in "AAPL,GOOG" and dies after failing to find the plot for ",". This is the way to pass a comma separated list in HTTP, right? Or do I have it wrong?
|
# ? Dec 21, 2013 08:33 |
|
Pollyanna posted:Trying to do ?symbols=GOOG,AAPL gets me an error where it returns the whole thing as a single string. For example, this code for i in symbol.split(",") Edit: I've used php far too long (because when I was a lot younger that was all I had or knew about) and every time i want to make a quick easy web demo I default to php because I'm too lazy to learn a framework. I think seeing that code makes me wanna give flask a shot finally, since I already know python. Guess I'll see how that goes! Jewel fucked around with this message at 08:52 on Dec 21, 2013 |
# ? Dec 21, 2013 08:34 |
|
Jewel posted:for i in symbol.split(",") Is there a version of that slowly growing image? Cause that's how I feel right now. It works now Thanks!
|
# ? Dec 21, 2013 08:45 |
Pollyanna posted:I don't know what happened since I started working on v1.2, but now SA keeps flashing "hello world" alert boxes at me Hmmm that's not good...XSS vulnerability on here? I'm not getting any alerts on this page.
|
|
# ? Dec 21, 2013 09:33 |
|
Pollyanna posted:Is there a version of that slowly growing image? Cause that's how I feel right now. Well done, Pollyanna, I've watched you grow in this thread from someone most posters rolled their eyes at, to someone who created a working heroku app. Keep it up! </sincere> edit: I say this as someone this thread would've rolled their eyes at during my most enthusiastic Python phase It's a compliment, my friend! Pivotal Lever fucked around with this message at 11:38 on Dec 21, 2013 |
# ? Dec 21, 2013 10:28 |
|
Pivotal Lever posted:Well done, Pollyanna, I've watched you grow in this thread from someone most posters rolled their eyes at, to someone who created a working heroku app. Keep it up! </sincere> GEEZ DAD. Err, uhh, umm.... GEEZ WEIRD INTERNET DAD.
|
# ? Dec 21, 2013 17:21 |
|
Is there a better way to hack a makefile to support virtualenv thanBash code:
Edit: Maybe not, these are scientific projects and it would be nice if each came with a snapshot of its environment ~~forever~~. Is there a middle ground? I don't want to be mucking with symlinks because I don't trust other people so I want to keep it simple. Another question: Python code:
\/ \/ SurgicalOntologist fucked around with this message at 18:40 on Dec 21, 2013 |
# ? Dec 21, 2013 17:36 |
|
Python code:
code:
Python code:
code:
|
# ? Dec 21, 2013 18:16 |
|
Thermopyle posted:Make the last part of the url a comma separated list.
|
# ? Dec 21, 2013 18:58 |
|
|
# ? May 9, 2024 05:34 |
|
Mustach posted:Seriously, please change it back to the nice way. '?symbols=GOOG,AAPL' and '?symbol=GOOG&symbol=AAPL' are worse than 'GOOG,AAPL', at the very least because the first have three characters that are a pain to type on a phone. Yep. Pollyanna, to be clear, your URL should look like: http://rpazyaquian.herokuapp.com/stocks/GOOG,AAPL,MSFT
|
# ? Dec 21, 2013 19:14 |