|
-JS- posted:Not sure what's going on without seeing code - but it seems to be possible after a bit of hacking on the example given by Google - https://jsfiddle.net/5psoshgn/1/ I'm not sure what changed here compared to the typical code. I understand that whether or not a polygon makes a hole depends on the clockwise direction of the polygon's points, but that looks like those polygons are still in opposite directions...I'm a little confused. For background, this is for a programming exercise where I'm given a CSV of polygons and their associated points, and asked to expose them so that a pre-made Google Maps API can draw them. I'm beginning to think that I should be looking at this on the data side, i.e. making sure that any new polygon I add isn't already in another polygon's area. That might be easier. EDIT: Except that won't work in the case of overlapping polygons, in which case it should just get the union of those polygons. gently caress. Pollyanna fucked around with this message at 18:08 on Feb 9, 2018 |
# ? Feb 9, 2018 15:57 |
|
|
# ? May 16, 2024 17:32 |
|
It sounds like the crux of the exercise is the polygon mapping behaviour. You may need to union your own polygons, before drawing them into maps? It does seem possible that as someone else mentioned clockwise/counter-clockwise might be the trick.
Nolgthorn fucked around with this message at 18:38 on Feb 9, 2018 |
# ? Feb 9, 2018 18:36 |
|
Yeah, that's more or less what I'm thinking, but...I have no idea how to do that. I'll have to figure that out...
Pollyanna fucked around with this message at 18:44 on Feb 9, 2018 |
# ? Feb 9, 2018 18:37 |
|
It's Javascript heavy but you need a list of all polygons and then output one polygon. It's an interesting challenge but it's possible that we're making the solution out to be more complex than it is supposed to be. This solution won't help at all if the problem is related to your 2d polygon being face-down. These guys are talking about polygon merging here. https://stackoverflow.com/questions/2667748/how-do-i-combine-complex-polygons
|
# ? Feb 9, 2018 18:45 |
|
Nolgthorn posted:It's Javascript heavy but you need a list of all polygons and then output one polygon. It's an interesting challenge but it's possible that we're making the solution out to be more complex than it is supposed to be. This solution won't help at all if the problem is related to your 2d polygon being face-down. The pre-written code assumes that there is a list of polygons, rather than just one big one. It's also entirely possible that I'm not expected to completely figure this out, but I'd rather assume the opposite so that I don't do poorly where I could have at least tried. That answer's a good one, I'll check it out - thanks!
|
# ? Feb 9, 2018 18:53 |
|
I had challenges for jobs where it ended up being exceedingly complex and I thought while writing it "maybe they just want to see how far I get" so I'd sit down and write a bit about what I was thinking and where I got stuck. I never got those jobs.
|
# ? Feb 9, 2018 20:31 |
|
Programming exercises that are entirely about "did they get it right yes/no" usually hint towards terrible jobs.
|
# ? Feb 9, 2018 20:59 |
|
you guys ever have issues with HTML inputs on mobile browsers where the input jumps while typing? For exmaple, you can see the cursor at the bottom of this form, even though I'm typing in this first field. I can't for the life of me figure out what's going wrong
|
# ? Feb 9, 2018 21:42 |
|
Pollyanna posted:Programming exercises that are entirely about "did they get it right yes/no" usually hint towards terrible jobs. So those are the only ones you've done?
|
# ? Feb 9, 2018 22:17 |
|
Grump posted:you guys ever have issues with HTML inputs on mobile browsers where the input jumps while typing? Is this a modal on iOS by chance? My coworker ran into this issue and something about modals and inputs don't play well together.
|
# ? Feb 11, 2018 22:31 |
|
Yeah it is. And after some digging, this looks like it’s a pretty huge issue. What did your coworker do to solve it, out of curiosity? Because all the proposed solutions I’m seeing aren’t anything I’d like to do
|
# ? Feb 12, 2018 00:26 |
|
iOS Safari? We had a lot of problems with it on my last project. It has a lot of weird behavior compared to desktop Safari.
|
# ? Feb 12, 2018 00:53 |
|
Grump posted:Yeah it is. And after some digging, this looks like it’s a pretty huge issue.
|
# ? Feb 12, 2018 03:09 |
|
I am so confused where to start. The last time I did web programming was for fun when I was like 12 years old. I learned HTML, XHTML, XML, MySQL and PHP. PHP back then was actually what the name says it is, "Hypertext Pre-Processor". Code was integrated into HTML files scripturally. Kind of like Server Side Includes on steroids. It gained popularity because it wasn't Perl. PHP was easy to use (too easy actually), and they kind of pressured turning it into something it wasn't, Object Oriented. PHP has obviously come a long way since PHP3, and now you have all the MVC frameworks to use to go with it. I spent some time with the last few years learning a couple frameworks, I think it was CodeIgnitor I spent the most time with. But honestly I've basically forgotten everything about it. But now I want to get away from PHP. I want something with strict typing (by default), code that is pleasing to the eye to look at (sorry Perl). People recommended Python and this is where I'm stuck. I'm not really grasping how it works in the real world. Reading tutorials on just the installation of it, they recommend python3, virtualenv and PIP3 (which I assume is kind of like Composer to PHP?), then installing Django (which is what I want to learn) and Gunicorn to talk to the WSGY. Like say I have a Linux server running NGINX. Where does NGINX fit in with Gunicorn, aren't they both HTTP servers? Is Gunicorn just meant for development? I also don't really understand what the WSGY model is or how it works. I am looking for a recommendation on a good book or web tutorials on Python/Django, that assumes you know how to read/write code, and understand HTML, but entirely new to modern server-side web development.
|
# ? Feb 12, 2018 04:16 |
|
Alpha Mayo posted:Like say I have a Linux server running NGINX. Where does NGINX fit in with Gunicorn, aren't they both HTTP servers? Is Gunicorn just meant for development? Yeah, they are both HTTP servers, but NGINX is mainly used as a load balancer/reverse proxy (99.99% of use cases? Something like that). So you have your app backed with a server (Gunicorn in this case), then you have NGINX running in front of it. Incoming requests hit NGINX which forwards them onto your app server: nothing hits your app server directly. You don't need to worry about it whilst developing, and tbqh you don't shouldn't need to worry about at all where you're at; it's a very useful thing for applications going into production, but not for what you want to do at the minute (i.e. get back into learning to develop), ignore it for the minute. edit: and I'd go through the Django guides on the website, starting here: https://docs.djangoproject.com/en/2.0/intro/ (also has a few recommendations for people new to Python as well) RobertKerans fucked around with this message at 12:12 on Feb 12, 2018 |
# ? Feb 12, 2018 12:01 |
|
RobertKerans posted:Yeah, they are both HTTP servers, but NGINX is mainly used as a load balancer/reverse proxy (99.99% of use cases? Something like that). So you have your app backed with a server (Gunicorn in this case), then you have NGINX running in front of it. Incoming requests hit NGINX which forwards them onto your app server: nothing hits your app server directly. You don't need to worry about it whilst developing, and tbqh you don't shouldn't need to worry about at all where you're at; it's a very useful thing for applications going into production, but not for what you want to do at the minute (i.e. get back into learning to develop), ignore it for the minute. People generally use nginx to serve all their static assets as well. Only request that need to get processed by your Django app get proxied. (Unless you are using S3 for static stuff or some other CDN solution, obviously)
|
# ? Feb 12, 2018 12:23 |
|
Ah, haha, I forgot the only thing I ever personally have to deal with directly beyond "use this preconfigured NGINX stuff" . Still, not really something you need to worry about at all when you're at very first steps stage
RobertKerans fucked around with this message at 12:58 on Feb 12, 2018 |
# ? Feb 12, 2018 12:53 |
|
Thanks, this also helped a lot with explaining it too. One thing I like about Digital Ocean is that have a lot of guides/tutorials for people new to this. So NGINX sounds like it would be on the front-end (user-facing) server, then behind the scenes it can forward the work to multiple Gunicorn instances running on different servers (droplets)? Is the load-balancing automagical, just have cloned Gunican/wsgy.py on each server (or more likely, wsgy.py on one storage volume that multiple droplets access)? I know these are questions about Deployment, but I'd still like to get to that stage even if it is with a Hello World app. Alpha Mayo fucked around with this message at 14:18 on Feb 12, 2018 |
# ? Feb 12, 2018 14:14 |
|
I'm trying to automatically download a flat file report form an internal LoB web application. The owners aren't providing an official API, but how hard can it be, right? Unfortunately it's got frameworks out the rear end so I'd rather not reverse engineer everything because it looks like a pain in the rear end. Is there a standard solution that would let me automatically log in with just user/pass thankfully, make a few choices and download the file to a defined location? This would be a temporary solution (lol we all know how that goes right) so the simplest one wins.
|
# ? Feb 12, 2018 16:32 |
|
mobby_6kl posted:I'm trying to automatically download a flat file report form an internal LoB web application. The owners aren't providing an official API, but how hard can it be, right? Unfortunately it's got frameworks out the rear end so I'd rather not reverse engineer everything because it looks like a pain in the rear end.
|
# ? Feb 12, 2018 17:08 |
|
Capri Sun Tzu posted:Mobile safari is difficult to work with when you're doing anything that depends on the viewport with the onscreen keyboard activated. I've also had issues with modals and inputs on iOS Safari and we resolved them by not using a modal. Honestly modals aren't a good look on a mobile device anyway, but post a solution if you do figure one out! code:
I wish not using a modal was an option at this point.
|
# ? Feb 12, 2018 17:14 |
|
mobby_6kl posted:I'm trying to automatically download a flat file report form an internal LoB web application. The owners aren't providing an official API, but how hard can it be, right? Unfortunately it's got frameworks out the rear end so I'd rather not reverse engineer everything because it looks like a pain in the rear end. I never done something like this, but sounds like something you can use headless chrome https://github.com/GoogleChrome/puppeteer https://try-puppeteer.appspot.com/ if theres a security risk, maybe you can put the result files in a password protected folder, using http basic auth.
|
# ? Feb 12, 2018 17:21 |
|
Grump posted:Yeah it is. And after some digging, this looks like it’s a pretty huge issue. Not the most helpful solution... We stopped using a third party modal and my luck that fixed it so I didn't have to do anymore research.
|
# ? Feb 12, 2018 21:17 |
|
Yesterday I was developing something and I added a `setTimeout` to my code. Compilation started warning about how `timers` was not defined and when running it in my browser it didn't work. It took quite a bit of frustration before discovering that Visual Studio Code had automatically placed `import timers from 'timers';` at the top of my file. I have no idea why. Anyone have any clue, is that a new feature? How and what is `timers` and why is it related to `setTimeout` it looks like a node thing? I couldn't find any setting I could turn off.
|
# ? Feb 13, 2018 02:06 |
|
Nolgthorn posted:Yesterday I was developing something and I added a `setTimeout` to my code. Compilation started warning about how `timers` was not defined and when running it in my browser it didn't work. It took quite a bit of frustration before discovering that Visual Studio Code had automatically placed `import timers from 'timers';` at the top of my file. I have no idea why. That's some fancy Node integration, which is not appropriate to do when doing web development.
|
# ? Feb 13, 2018 06:48 |
|
Capri Sun Tzu posted:What you're describing has the potential to be a huge security risk. Tei posted:I never done something like this, but sounds like something you can use headless chrome
|
# ? Feb 13, 2018 09:43 |
|
Nolgthorn posted:Yesterday I was developing something and I added a `setTimeout` to my code. Compilation started warning about how `timers` was not defined and when running it in my browser it didn't work. It took quite a bit of frustration before discovering that Visual Studio Code had automatically placed `import timers from 'timers';` at the top of my file. I have no idea why. Yeah VS Code does this thing where it looks through type definitions for the thing you're typing and imports it automatically if you tab-complete to that particular intellisense suggestion. I think the setting that controls it is `typescript.autoImportSuggestions.enabled`
|
# ? Feb 13, 2018 15:07 |
|
I've been writing CSS for like 5 years now and it's still just kind of all a jumbled mess. Are there any good mailing lists or tutorials on subjects such as new CSS features, best practices, etc?
|
# ? Feb 13, 2018 18:05 |
|
http://getbem.com/introduction/ BEM will change your life. e: Regarding mailing lists, these are pretty good and touch on CSS issues with some frequency https://wdrl.info/ https://web-design-weekly.com/ http://sass.news/ kedo fucked around with this message at 18:27 on Feb 13, 2018 |
# ? Feb 13, 2018 18:24 |
|
I was doing it wrong. Flask is much easier to start learning python with than Django.
|
# ? Feb 14, 2018 11:35 |
|
Neither is a good idea to learn Python with.
|
# ? Feb 14, 2018 15:26 |
|
I tried to learn Python, once for a job challenge and another that I wanted to develop an application for raspberry pi. I was struck by how the language doesn't let you break up lines. Gimme my brackets back.
|
# ? Feb 14, 2018 16:54 |
|
Nolgthorn posted:I tried to learn Python, once for a job challenge and another that I wanted to develop an application for raspberry pi. I was struck by how the language doesn't let you break up lines. Gimme my brackets back.
|
# ? Feb 14, 2018 16:57 |
|
Maybe I should just crawl back to php. I miss the good old days when register_globals was true by default.
|
# ? Feb 14, 2018 17:09 |
|
Alpha Mayo posted:Maybe I should just crawl back to php. I miss the good old days when register_globals was true by default. Is weird that people *pay* programmers. Programming should be something that society consider vandalism. Software have a negative worth value, and is trough testing and long tedious hours fixing bugs that software ever is worth more than zero. There's really too much code written and that's bad. PHP fault is that is very easy to write a lot of software and ~stuff~, making the world a worse place in the process. In 400 years people will look back at this era of programming like the dark ages. PHP is kind of like Gengis Khan this way. Tei fucked around with this message at 17:25 on Feb 14, 2018 |
# ? Feb 14, 2018 17:14 |
|
PHP brought us facebook
|
# ? Feb 14, 2018 17:15 |
|
Tei posted:Is weird that people *pay* programmers. Programming should be something by the society consider a negative. Software have a negative worth value, and is trough testing and long tedious hours fixing bugs that software ever is worth more than zero. I like to imagine that little mouse running around on a keyboard and these posts are the result.
|
# ? Feb 14, 2018 17:16 |
|
Alpha Mayo posted:PHP brought us facebook And Mediawiki based discussion threads and phpBB style forums. The other day I checked the phpBB source code. Because of course, phpBB still exists. Is not something that can be repaired. If you look at the source code of phpBB, to change it to something reasonable would take more effort than to decode all human DNA and turn humanity inmortal and without flaws. Lumpy posted:I like to imagine that little mouse running around on a keyboard and these posts are the result. I post like two kids in a trench coat. Fully believe is the best way to live. Tei fucked around with this message at 17:37 on Feb 14, 2018 |
# ? Feb 14, 2018 17:29 |
|
PHP has it's uses. If I want to bust out a quick proxy to avoid CORS, I'll PHP one in 30 seconds.
|
# ? Feb 14, 2018 18:07 |
|
|
# ? May 16, 2024 17:32 |
|
PHP/Perl CGI all these things are still very popular although not for any actual programming. right?
|
# ? Feb 14, 2018 18:35 |