|
I have a GET method for my page that takes a comma separated list of stock symbols. I want to make an input form that a user can type symbols into and tacks on a comma separated list to the URL, e.g. ?symbols=AAPL,GOOG. Using just one text field for input means that the user has to type "AAPL,GOOG,IBM,GM" etc. which looks really ugly. I had thought of simply providing a whole bunch of text input fields to use, but that's too cumbersome and probably wouldn't work anyway. What sort of form should I use? Is there a way to do this in JQuery UI? I'm using Flask, for the record.
|
# ? Jan 9, 2014 04:48 |
|
|
# ? May 15, 2024 03:44 |
Pollyanna posted:I have a GET method for my page that takes a comma separated list of stock symbols. I want to make an input form that a user can type symbols into and tacks on a comma separated list to the URL, e.g. ?symbols=AAPL,GOOG. Using just one text field for input means that the user has to type "AAPL,GOOG,IBM,GM" etc. which looks really ugly. I had thought of simply providing a whole bunch of text input fields to use, but that's too cumbersome and probably wouldn't work anyway. What sort of form should I use? Is there a way to do this in JQuery UI? I'm using Flask, for the record. Check out the "multi-value select boxes" in the Select2 jQuery plugin
|
|
# ? Jan 9, 2014 04:51 |
|
fletcher posted:Check out the "multi-value select boxes" in the Select2 jQuery plugin That wouldn't work, since the symbols are user-provided instead of being selected from a list.
|
# ? Jan 9, 2014 04:55 |
Pollyanna posted:That wouldn't work, since the symbols are user-provided instead of being selected from a list. It can do remote data sets, and the list of valid values is known!
|
|
# ? Jan 9, 2014 05:07 |
|
For things like this, I like having an autocomplete box that adds your selection to a list when you choose it. That list has an 'X' button on each item to remove it from the list. Go check out StackOverflow's method of adding tags to a post. EDIT: I got bored, here's a barebones example of what I mean http://jsfiddle.net/DP7tN/1/ EDIT2: Doh, should have clicked the Select2 link. Yeah, basically that. Bognar fucked around with this message at 05:56 on Jan 9, 2014 |
# ? Jan 9, 2014 05:16 |
|
Ohhh...yeah that works! Finding a list of symbols is a bit of a pain, though (since JS does not to my knowledge do regex/text parsing or anything).
Pollyanna fucked around with this message at 07:25 on Jan 9, 2014 |
# ? Jan 9, 2014 07:23 |
Pollyanna posted:Ohhh...yeah that works! Finding a list of symbols is a bit of a pain, though (since JS does not to my knowledge do regex/text parsing or anything). You can do regex and text parsing in JS. Check out the Auto Tokenization feature in the select2 demos. It only knows about red, green, and blue...but try adding some other colors! Once somebody looks up an unknown but valid ticker symbol, add it to your list of known symbols.
|
|
# ? Jan 9, 2014 07:59 |
|
nm..
epswing fucked around with this message at 20:46 on Jan 9, 2014 |
# ? Jan 9, 2014 20:11 |
|
Pollyanna posted:Ohhh...yeah that works! Finding a list of symbols is a bit of a pain, though (since JS does not to my knowledge do regex/text parsing or anything). ftp://ftp.nasdaqtrader.com/SymbolDirectory/nasdaqlisted.txt ftp://ftp.nasdaqtrader.com/SymbolDirectory/otherlisted.txt Javascript does regular expressions, but you don't need one. Just split the string on | and use the first element.
|
# ? Jan 9, 2014 20:26 |
|
substitute posted:sperglord warning
|
# ? Jan 9, 2014 20:40 |
|
jackpot posted:God, that's amateur. What's funny is the page that talks about the redesign is really nice looking - it's just clear they didn't let that team work on the rest the actual site. Or like was said, they're the same guys but they gave them a horrible timeline or something. That's actually another good point, something I ran into: What do you do if your stuff is handed off to a development team who aren't executing designs with what you would consider best practice? I mean, they're nice, fast, and competent, but it's a lot of little things that are clearly the result of sticking to what works to get it out fast. Specifically, I've encountered stuff like the aforementioned lack of relative padded elements, spritesheets instead of SVG/icon fonts, etc. I figure you can get about two, "Oh hey, I noticed" in before you look like a total rear end and sour any future working relationship.
|
# ? Jan 9, 2014 21:21 |
|
pipes! posted:I figure you can get about two, "Oh hey, I noticed" in before you look like a total rear end and sour any future working relationship. Okay that's the second time I've seen this comment in the last page of posts. What are the pitfalls of absolute padding? When has it bitten you? Why only padding and not margin, border, width, and other size elements? I remember there being a big push towards away pixel-based measurements overall many years ago, but when I talked to CSS people at conferences lately concern seems to have waned. I've just been using pixels again lately since it seems to work just fine for my projects, but it'd be good to know when that's bad.
|
# ? Jan 9, 2014 23:19 |
|
pipes! posted:That's actually another good point, something I ran into: What do you do if your stuff is handed off to a development team who aren't executing designs with what you would consider best practice? I mean, they're nice, fast, and competent, but it's a lot of little things that are clearly the result of sticking to what works to get it out fast. Specifically, I've encountered stuff like the aforementioned lack of relative padded elements, spritesheets instead of SVG/icon fonts, etc. Speaking as a designer who's worked for such organizations, the answer is "nothing." I spent the first few years of my career trying to get large, dysfunctional organizations to do it the right way. The only thing that saved my sanity was leaving for companies that cared.
|
# ? Jan 9, 2014 23:20 |
|
glompix posted:Okay that's the second time I've seen this comment in the last page of posts. What are the pitfalls of absolute padding? When has it bitten you? Why only padding and not margin, border, width, and other size elements? I find it to be a lot better of an approach for responsive sites and a SASS-based workflow (especially if you base everything on a handfull of core measurements), and it's also far, far better from an accessibility standpoint if the user resizes the screen. Try hitting CMD+ three or four times on this page versus this page. e: Ooh, it looks like NYT pages are scaling nicely now. Kobayashi posted:Speaking as a designer who's worked for such organizations, the answer is "nothing." I spent the first few years of my career trying to get large, dysfunctional organizations to do it the right way. The only thing that saved my sanity was leaving for companies that cared. Crap.
|
# ? Jan 10, 2014 00:28 |
|
What's wrong with just using icons? Spritesheets are a terrible hack to deal with the fact that HTTP has poo poo support for parallel downloads, which is fixed by SPDY/HTTP2. Spritesheets use more memory and are more expensive to decode.
|
# ? Jan 10, 2014 01:52 |
|
e: Wait, I think you might be agreeing with me, rereading your post? Well, here are my thoughts on icon fonts anyways because I already typed it. Nothing. But icon fonts are so much easier to use because when you're like, "Hmm, I wonder what that icon would look like in blue instead of black..." CSS code:
e: Also not to mention the fact that your icons can take the place of words which solves for screen readers and whatnot. Honestly you don't have to use icon fonts, but if you have a monotone icon set and you're not, you're handicapping yourself and creating more work. kedo fucked around with this message at 02:09 on Jan 10, 2014 |
# ? Jan 10, 2014 01:55 |
|
Wait, what are icons in this context? I only know of the ones on my desktop. Is that another way of saying symbols (e.g. Wingdings)?
|
# ? Jan 10, 2014 02:16 |
|
Yes. The icons you're thinking of are just graphical symbols being used on your desktop to navigate to programs in much the same way you might use Wingdings arrow characters on a webpage to navigate pages - which is why the overlap in terminology. Essentially it's just a stock or even custom font that you serve up with the webpage and then pull symbols out of it rather than individually link to an image of that symbol or use CSS to position an image of every symbol so that only one is visible.
|
# ? Jan 10, 2014 02:28 |
|
I've generally enjoyed using Font Awesome, which covers a lot of bases: http://fortawesome.github.io/Font-Awesome/ This is a pretty good icon font generator, if you have vector files to build a custom one with: http://icomoon.io/app/
|
# ? Jan 10, 2014 02:51 |
|
What do you guys think of this scanline effect? I want to use it on my hero graphics but wanted to check with some people who know more about design to see if they think it looks like poo poo. Link to image. EDIT: timg makes it look like poo poo so click to view the full sized image. Mister Chief fucked around with this message at 04:08 on Jan 10, 2014 |
# ? Jan 10, 2014 04:05 |
|
pipes! posted:I find it to be a lot better of an approach for responsive sites and a SASS-based workflow (especially if you base everything on a handfull of core measurements), and it's also far, far better from an accessibility standpoint if the user resizes the screen. Try hitting CMD+ three or four times on this page versus this page. They both scale the same for me? I just use whichever the design dictates. For example, a recent project's designer insisted the page wrapper should always be 50px from the edge of the window even while scaling. I think as long as the design scales and works as intended at any width then there's no problem. I don't think pixels should be shunned entirely as they serve their own purpose. e: vvv and that Heskie fucked around with this message at 14:30 on Jan 10, 2014 |
# ? Jan 10, 2014 12:23 |
|
pipes! posted:I find it to be a lot better of an approach for responsive sites and a SASS-based workflow (especially if you base everything on a handfull of core measurements), and it's also far, far better from an accessibility standpoint if the user resizes the screen. Try hitting CMD+ three or four times on this page versus this page. All (modern, including IE8 I think) browsers scale up *everything*, not just type like they used to, so using px no longer breaks things. Using px for most "measurement" things again now is perfectly fine.
|
# ? Jan 10, 2014 14:24 |
|
Whoa, my mind is getting blown over here. Do Chrome and Sublime somehow share their Find function? Example: I'm searching for "name": "Foo" in Sublime to find an entry in a database, and searching for Foo in Chrome to make sure it's showing up on a page. But when I change one, it changes the other. What is going on... Are my keystrokes getting passed to both applications somehow? e: Should mention I'm on OS X. kedo fucked around with this message at 21:20 on Jan 10, 2014 |
# ? Jan 10, 2014 20:11 |
kedo posted:Whoa, my mind is getting blown over here. Never seen anything like that, tried it on my machine and I was not able to repro. Windows 7 64-bit, Sublime Text 2.0.2 Build 2221, Chrome 32.0.1700.72
|
|
# ? Jan 10, 2014 20:45 |
|
kedo posted:Whoa, my mind is getting blown over here. OS X does that for apps that hook into the "native" search stuff (Cmd-E / Cmd-F / Cmd-G) I believe, so there's cross-app searching going on in quite a few. I can select text in one app, hit Cmd-E, then hit Ctrl-G in others to find it. It's pretty awesome.
|
# ? Jan 11, 2014 03:41 |
|
Mister Chief posted:What do you guys think of this scanline effect? I want to use it on my hero graphics but wanted to check with some people who know more about design to see if they think it looks like poo poo. Uh, it's an effect. Can you show us how it looks in context with the rest of the site? It's an effect that can look really bad or really good depending on how the rest of the environment around it looks.
|
# ? Jan 11, 2014 04:52 |
|
Yeah, I'll flesh the site out a little more then post a follow up.
|
# ? Jan 11, 2014 11:07 |
|
I've got a form for submitting search terms on my web page. Should I use GET or POST to submit the search terms?
|
# ? Jan 12, 2014 01:18 |
Pollyanna posted:I've got a form for submitting search terms on my web page. Should I use GET or POST to submit the search terms? For this you would use a GET (just like Google does). In general, POST is for things that are going to modify data and GET is for things that are just retrieving data.
|
|
# ? Jan 12, 2014 01:23 |
|
fletcher posted:For this you would use a GET (just like Google does). In general, POST is for things that are going to modify data and GET is for things that are just retrieving data. That's what I figured. But the URL looks bit funky (/stocks?symbol=IBM%2CGOOG%2CAAPL). Not a big deal to me, but is that discouraged?
|
# ? Jan 12, 2014 01:27 |
|
It's fine like that. No one will care. It's just so people can link the same search to other people.
|
# ? Jan 12, 2014 01:31 |
|
Pollyanna posted:That's what I figured. But the URL looks bit funky (/stocks?symbol=IBM%2CGOOG%2CAAPL). Not a big deal to me, but is that discouraged? You could always use a URL rewriter or routing module or something to make urls that look like /stocks/IBM-GOOG-AAPL if you wanted instead of using a query string. Dashes don't normally get escaped so it'd appear nice.
|
# ? Jan 12, 2014 02:13 |
|
I think Flask has URL rewriting functionality, although I thought I was already using it... In the meantime, something really weird is happening with my application. On my machine, when I start it up locally, symbol lookup works perfectly well, but once it's uploaded to Heroku it breaks. It manages to find data for the symbol, builds the plots and everything...and then somehow gets caught in the except IOError block, which is intended to check if the symbol actually exists (which it already has decided it does). Again, this doesn't occur on my end. Heroku logs: code:
code:
edit: I just realized that sometimes the instructions are out of order: code:
Pollyanna fucked around with this message at 17:30 on Jan 12, 2014 |
# ? Jan 12, 2014 02:24 |
|
Can anyone confirm for me that there's no reliable way of making a last minute ajax request in window.onunload? I've yet to be able to pull this off in Chrome, even with async: false. It works in window.onbeforeunload, except I don't want to make that request if the user decides NOT no navigate away, and as far as I can tell browsers don't notify you of the user's choice in that alert box outside of window.onunload being called. SO seems to vaguely confirm this as well, but you never know.
|
# ? Jan 12, 2014 20:46 |
|
DreadCthulhu posted:Can anyone confirm for me that there's no reliable way of making a last minute ajax request in window.onunload? I've yet to be able to pull this off in Chrome, even with async: false. It works in window.onbeforeunload, except I don't want to make that request if the user decides NOT no navigate away, and as far as I can tell browsers don't notify you of the user's choice in that alert box outside of window.onunload being called. SO seems to vaguely confirm this as well, but you never know. What are you trying to send? I'm not sure why it doesn't work with async: false. Could you use a 1x1 tracking pixel instead?
|
# ? Jan 13, 2014 03:46 |
|
DreadCthulhu posted:Can anyone confirm for me that there's no reliable way of making a last minute ajax request in window.onunload? I've yet to be able to pull this off in Chrome, even with async: false. It works in window.onbeforeunload, except I don't want to make that request if the user decides NOT no navigate away, and as far as I can tell browsers don't notify you of the user's choice in that alert box outside of window.onunload being called. SO seems to vaguely confirm this as well, but you never know. The user is trying to kill your website. You have no guarantees of any code being ran.
|
# ? Jan 13, 2014 03:49 |
|
kedo posted:Whoa, my mind is getting blown over here. To expand on Lumpy's reply, OS X has the concept of "pasteboards". When you copy something, it goes on the system's general pasteboard, which other apps can see. When you paste, the app you're in grabs the contents of the general pasteboard. Thus you can copy and paste between apps. There is also a system-wide find pasteboard that, you guessed it, contains the string you're searching for. Well-made apps will use the system's find pasteboard for their own search function. Sometimes it's mind-blowingly cool, other times I really do want to maintain two different ongoing searches goddammit.
|
# ? Jan 13, 2014 05:46 |
|
It's my first time dealing with a subdomain like this: this.is.a.subdomain.mainsite.com Are there any negative consequences to setting something up like this?
|
# ? Jan 13, 2014 23:53 |
Oh My Science posted:It's my first time dealing with a subdomain like this: If you use a wildcard SSL cert I think it will only match *.mainsite.com, not whatever.*.mainsite.com edit: whoops had subdomain.com instead of mainsite.com fletcher fucked around with this message at 00:28 on Jan 14, 2014 |
|
# ? Jan 14, 2014 00:20 |
|
|
# ? May 15, 2024 03:44 |
|
fletcher posted:If you use a wildcard SSL cert I think it will only match *.mainsite.com, not whatever.*.subdomain.com You're right quote:Matching is performed using the matching rules specified by
|
# ? Jan 14, 2014 00:23 |