|
Speaking of Makefiles, is there a Makefile thread or a good resource for learning about Makefiles? I don't loving understand Makefiles I understand that the Python thread may not be the best place to ask these questions
|
# ? Dec 21, 2013 19:23 |
|
|
# ? May 29, 2024 02:20 |
|
Done and done. URL's back to the way it used to be.fletcher posted:Hmmm that's not good...XSS vulnerability on here? I'm not getting any alerts on this page. I don't either. I haven't seen any alerts anymore either, altho I did ask the page to stop popping boxes up eventually 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> Thanks I have this issue where if I don't know exactly how to do something before I do it I freak the gently caress out over it, but now that I've started working on that things have finally gotten going. QuarkJets posted:Speaking of Makefiles, is there a Makefile thread or a good resource for learning about Makefiles? I don't loving understand Makefiles Makefiles is for compiling things. Python scripts are interpreted rather than compiled (at least not by yourself, I dunno what the deal with .pyc files are). They're mostly used in C/C++.
|
# ? Dec 21, 2013 20:10 |
|
QuarkJets posted:Speaking of Makefiles, is there a Makefile thread or a good resource for learning about Makefiles? I don't loving understand Makefiles What do you want to do, exactly? I made this post one time: http://forums.somethingawful.com/showthread.php?threadid=2773485&pagenumber=365&perpage=40#post419124192 Maybe it could help you. Generally you want to consult the 'GNU make manual'. http://www.gnu.org/software/make/manual/make.html
|
# ? Dec 21, 2013 20:44 |
|
Thermopyle posted:Yep. It's not RESTful anyway, since it represents more than one resource. There's also no canonical URL for it since the arguments can come in any order, so the whole thing seems pointless.
|
# ? Dec 21, 2013 21:14 |
|
Okay well for now I have one version of that commented out and another version kept in.
|
# ? Dec 21, 2013 21:30 |
|
Misogynist posted:I think this is actually a little worse from an interface perspective. Most HTTP clients have great support already for taking arrays and properly making query arguments from them. Why shift this activity back down to the API consumer and make it more work for them?
|
# ? Dec 21, 2013 21:51 |
|
Mustach posted:Depends on who you consider the API consumer. In this case, humans are entering the URLs, and this form definitely reduces the work for them. A url isn't really a great interface. Humans would be better served by a widget on the page that let them switch which stock(s) they were seeing without messing about in the URL bar.
|
# ? Dec 21, 2013 22:04 |
|
Pollyanna posted:I don't either. I haven't seen any alerts anymore either, altho I did ask the page to stop popping boxes up eventually Are you passing debug=True when you start your Flask app? Might want to look into input validation and do a quick diff of the app on heroku vs your local code and then look at this.
|
# ? Dec 21, 2013 22:23 |
|
Pollyanna posted:Makefiles is for compiling things. Python scripts are interpreted rather than compiled (at least not by yourself, I dunno what the deal with .pyc files are). They're mostly used in C/C++. I'm well aware of that Dren posted:What do you want to do, exactly? I'll check that out, thanks
|
# ? Dec 21, 2013 23:00 |
|
As a way of organizing my thoughts re: getting my app going, I wrote up a little tutorial on embedding Bokeh plots in Flask. I've never written a tutorial before, so I'd like some critique/advice on it. Here's the tutorial. Is it confusing? Does it work properly when you follow it?salisbury shake posted:Are you passing debug=True when you start your Flask app? Might want to look into input validation and do a quick diff of the app on heroku vs your local code and then look at this. They haven't popped up since. Whatever was causing them isn't around anymore, I guess. vv
|
# ? Dec 21, 2013 23:59 |
|
Misogynist posted:I think this is actually a little worse from an interface perspective. Most HTTP clients have great support already for taking arrays and properly making query arguments from them. Why shift this activity back down to the API consumer and make it more work for them? But the client is a human being typing urls in. Dren posted:A url isn't really a great interface. Humans would be better served by a widget on the page that let them switch which stock(s) they were seeing without messing about in the URL bar. Sure, but...that's not what Polyanna has.
|
# ? Dec 22, 2013 00:07 |
|
QuarkJets posted:Speaking of Makefiles, is there a Makefile thread or a good resource for learning about Makefiles? I don't loving understand Makefiles I'm not sure what you're looking for with regard to make and python (i have a makefile borrowed from a coworker for making pip-style packages, but it's kind of hacky) but the make documentation is pretty loving terrible and there are a ton a weird make behaviors that exist to make sure makefiles written 35 years ago still work. The simplest way to understand it is that when you invoke make, it uses the makefile to build a tree. The base of the tree is the target your specify (or the one that is inferred). For each target, the makefile specifies list of dependencies, and a series of commands to make the target--this is called a 'rule'. Those dependencies are files, but those files can also be targets with their own rules. And that pattern goes all the way up until you get to source files. So make works its way up the tree, checks if any of the leaves are newer than their targets, and remakes the associated targets if they are, until you are back at the base and everything is up-to-date. The tricky thing is that there a bunch of implicit rules. For example if make needs a .o file, it'll assume it can make it from a .c file of the same name using gcc, and so on. So a lot of the example makefiles you see rely on implicit rules heavily and it isn't always clear what is going on. There are also a few different syntaxes, which you're allowed to freely mix in the same makefile, making things extra confusing (especially because a lot of the tutorials use older syntaxes that aren't covered well in newer docs).
|
# ? Dec 22, 2013 00:40 |
|
Thermopyle posted:Sure, but...that's not what Polyanna has. That's what I have right now, but that's subject to change. I'd love to hear of any other ways I can solve this problem.
|
# ? Dec 22, 2013 03:17 |
|
I wonder if there is some sort of way that a user could click on something on a webpage and then the web browser would load a page based on what the user clicked. Seems pretty unlikely though.
|
# ? Dec 22, 2013 03:21 |
|
Pollyanna posted:That's what I have right now, but that's subject to change. I'd love to hear of any other ways I can solve this problem. - The user enters the stock symbol into a text box - When the user clicks the "go" button, a javascript POST is done against a particular URL, sending the desired stock symbol to your app. - Your app is listening for POST requests on that URL and it returns some kind of graph data. - The javascript running in the browser receives that response, passes it to the graphing library. - The graphing library displays the graph in the browser. Now, your situation might be a little more complicated. I'm looking at Bokeh and how it works, and I'm not sure how much difficulty will be encountered when trying to get Bokeh to display a graph without refreshing the whole entire page (notice in my description above, the user never clicked the reload button and javascript never initiated a full page reload). If you do run into a lot of trouble getting Bokeh to display the graph, you might have to resort to more primitive means: - The user enters the stock symbol in a text box - When the user clicks the "go" button, do a full page reload: window.location.replace("www.whatever.com/stocks/AAPL") or window.location.href = "whatever.com/AAPL" That's just how I would approach it personally. Take with a grain of salt.
|
# ? Dec 22, 2013 04:09 |
|
My Rhythmic Crotch posted:There are about a billion different little nuances, so I won't get into details, but in general:
|
# ? Dec 22, 2013 04:23 |
|
To be honest, I have no clue what you're really trying to say, but never fear: the task at hand is not really all that hard. I bet Pollyanna will knock it out.
|
# ? Dec 22, 2013 04:41 |
|
My Rhythmic Crotch posted:To be honest, I have no clue what you're really trying to say
|
# ? Dec 22, 2013 05:00 |
|
Mustach posted:I know I've become a cranky old programmer when, after reading all of that, I thought "that seems like a lot of work to replicate a feature of every web browser". I know, I know, the web hasn't evolved that way, non-technical users have been trained by URLs filled with ?zhwa=afe8c798b7ad to ignore the address bar until they want to copy/paste, and if they didn't they shouldn't be expected to remember similar "tricks" across a variety of site, etc. But still, the web. lemme just pop http://forums.somethingawful.com/newreply.php?action=newreply&postid=423500815 in and make a new post here... yep. You're right this is pretty good. Much better than if there were a "reply" button.
|
# ? Dec 22, 2013 06:34 |
|
Dren posted:lemme just pop http://forums.somethingawful.com/newreply.php?action=newreply&postid=423500815 in and make a new post here... yep. You're right this is pretty good. Much better than if there were a "reply" button. I mean, he is arguing this specific use case wherein it really isn't any more difficult since you just type in the ticker symbol of your stock -- so this is not really a great point. A better one would be that the form she could make would also allow for things like fuzzy matching &c. So, in this particular case, the argument is really that a form would be potentially more feature rich than just going by the URL in addition to his initial point of 'people don't use the addy bar'.
|
# ? Dec 22, 2013 07:18 |
|
A URL is part of your interface though. Kind of the point, an app that takes care to create good URLs can make it very easy to find the resource you want. This is especially true if you semi know your entry point, don't have a bookmark, and have addresses in your history. Auto complete can often get you to your URL in one go, provided the URLs are human readable. No one is really arguing for them in place of your own UI work, but they certainly shouldn't be shunned as beneath concern.
|
# ? Dec 22, 2013 07:53 |
|
Dren posted:lemme just pop http://forums.somethingawful.com/newreply.php?action=newreply&postid=423500815 in and make a new post here... yep. You're right this is pretty good. Much better than if there were a "reply" button. I wish there wasn't a Reply button just so I didn't have to see this awful post.
|
# ? Dec 22, 2013 08:22 |
|
Building pretty URLs is fine and dandy, but I can see end-users bitching about having to type in the address bar. I should probably let the user type in a list of symbols they want and just navigate to the requisite URL. Something like:code:
|
# ? Dec 22, 2013 08:48 |
|
It's not your only interface. That's the point, you have a url which is friendly enough to be memorable, and then you have your actual interface with buttons and text fields and stuff.
|
# ? Dec 22, 2013 09:27 |
|
My Rhythmic Crotch posted:Now, your situation might be a little more complicated. I'm looking at Bokeh and how it works, and I'm not sure how much difficulty will be encountered when trying to get Bokeh to display a graph without refreshing the whole entire page (notice in my description above, the user never clicked the reload button and javascript never initiated a full page reload). If you do run into a lot of trouble getting Bokeh to display the graph, you might have to resort to more primitive means:
|
# ? Dec 22, 2013 14:28 |
|
Pollyanna posted:
Where have you repeated code? There is no reason to not have good looking URLs and they do make your app look better, have more memorable URLs, feel more modern, and function better.
|
# ? Dec 22, 2013 17:34 |
|
Pollyanna posted:Additionally, I can see that /AAPL,GOOG,IBM would be functionally identical to /GOOG,AAPL,IBM which sets off my "don't repeat yourself" alarm. I don't know if it's a false alarm, though.
|
# ? Dec 22, 2013 17:51 |
|
Looking for some regex help. I'm trying to standardize lat/lon coordinates into degrees-decimals from different input formats. Here's a regex to match degrees-min-decimals. It includes groupings to extract the data. code:
So it would validly match: 'N52 40.1234' or 'N52 32', but not 'N52 230999'. The quoted one I posted above will match the last one, when it shouldn't. I could probably work around this with separate regexes, but I think there's a way to do it with one. Dominoes fucked around with this message at 18:04 on Dec 22, 2013 |
# ? Dec 22, 2013 18:02 |
|
You can do conditional regex matching with a look-ahead regex. It can make the regex pattern really gnarly, so you'll have to decide whether it's worth it for code readability.Python code:
|
# ? Dec 22, 2013 18:42 |
|
Python code:
|
# ? Dec 22, 2013 19:02 |
|
What is a good IDE for Mac, for a total beginner who really would like installation + use to be as simple as possible. Using CodeAcademy's online one is probably not a long term solution.
|
# ? Dec 23, 2013 13:53 |
|
Definitely PyCharm. I have the Community (free) Version and it's great.
|
# ? Dec 23, 2013 14:09 |
|
Dominoes posted:Looking for some regex help. I'm trying to standardize lat/lon coordinates into degrees-decimals from different input formats. try this: code:
code:
|
# ? Dec 23, 2013 15:12 |
|
Dren posted:try this: Dominoes fucked around with this message at 19:56 on Dec 23, 2013 |
# ? Dec 23, 2013 19:51 |
|
I love how easily cross-platform Python and its tools are. I've been in a transient period for the past three months, using a laptop with Ubuntu. Since then, I picked up some new habits like using Git, Pycharm,IPython etc. To transition back to the Windows desktop, all I had to do was copy and past my code folder, and install git/pycharm/ipython. My programs and Django apps run with no additional configuration, PyCharm looks the same after setting up the fonts, and it recognizes my Qt etc modules now. My only gripe is that Qt fonts don't automatically scale. Dominoes fucked around with this message at 20:20 on Dec 23, 2013 |
# ? Dec 23, 2013 20:17 |
|
Pollyanna posted:Thanks I have this issue where if I don't know exactly how to do something before I do it I freak the gently caress out over it, but now that I've started working on that things have finally gotten going. Trust me, I know the feeling. I was afraid that I was just cargo-culting for a long time. Recently, I feel like I am finally harnessing the power of Python and other programming languages for my own purposes! Keep up the good work
|
# ? Dec 23, 2013 20:19 |
Dominoes posted:I love how easily cross-platform Python and its tools are. I've been in a transient period for the past three months, using a laptop with Ubuntu. Since then, I picked up some new habits like using Git, Pycharm,IPython etc. To transition back to the Windows desktop, all I had to do was copy and past my code folder, and install git/pycharm/ipython. My programs and Django apps run with no additional configuration, PyCharm looks the same after setting up the fonts, and it recognizes my Qt etc modules now. But why would you wanna develop on Windows?? Install an Ubuntu VM on your desktop
|
|
# ? Dec 23, 2013 20:25 |
|
fletcher posted:But why would you wanna develop on Windows?? Install an Ubuntu VM on your desktop This is exactly what I've been doing for a few months after I moved back from an Ubuntu-on-the-metal setup. I've got Ubuntu installed and running via VMware Player on my Windows 7 machine. Pretty much all the time two monitors have Ubuntu with PyCharm and terminal windows and whatnot on them and the third monitor has my Windows desktop.
|
# ? Dec 23, 2013 20:29 |
|
I've been putting off learning VMs. I play games sometimes and don't want to dual boot. The main downsides I've run into on Windows are it doesn't like to compile C, and the terminal's comparatively sparse.
|
# ? Dec 23, 2013 20:39 |
|
|
# ? May 29, 2024 02:20 |
|
Dominoes posted:I play games sometimes and don't want to dual boot. That's exactly why I'm back on Windows using Ubuntu in a VM. It will take you an hour to get Ubuntu running in a VM. 1. Download VMWare Player. 2. Download the latest Ubuntu ISO. 3. Run through the new VM wizard in Player. 4. Done.
|
# ? Dec 23, 2013 20:44 |