Open Side Menu Go to the Top

01-15-2016 , 04:29 PM
yeah, sanitizing can be painful

As part of our due diligence before we got VC we had to list out everything we were using and what the license for it was. That was pretty painful.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
01-15-2016 , 05:25 PM
Glassdoor's new UI is tilting the **** out of me. Multiple scroll bars and forcing the up/down arrows to navigate in the job list instead of an individual listing that I clicked into.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-15-2016 , 06:18 PM
I feel like if your optimal UX is searching "Position Y at Company X Glassdoor" in Google, you are clearly making bad design decisions.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-15-2016 , 06:46 PM
Quote:
Originally Posted by PoppaTMan
Glassdoor's new UI is tilting the **** out of me. Multiple scroll bars and forcing the up/down arrows to navigate in the job list instead of an individual listing that I clicked into.
i found a game: try to scroll slowly until you just find the point when the save/apply box jumps on your screen and displaces what you were just trying to read
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 07:15 AM
Quote:
Originally Posted by clowntable
If you decide to go the node.js route, please set it up to use ECMAScript 6 (which gives you more familiar class syntax etc.)
Details on how to do this? I was reading up on JS on some w3schools.org page and was like, ok, some of this seems kinda messy, then after reading your post I googled ECMA6 and found: http://es6-features.org/#ExpressionBodies (and everything else it describes)

DO WANT, YES PLEASE.

Don't think I'll have time tomorrow but maybe Sunday I'll dive in to try writing something.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 07:57 AM
noob question - so they want it show up in your "comments" in your source code?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 01:00 PM
goofy, this is what you want. http://babeljs.io/

Kind of a pain to configure but there are tutorials on tools like gulp, grunt, webpack out there etc. I got a basic understanding doing a $10 React course on Udemy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 01:18 PM
Telling a beginner to hop into babel build systems is crazy imo. Start with ES5, once you've figured it out in 3 months check out ES6.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 01:22 PM
Fwiw I'd count myself a novice programmer and I found using ES6 way easier and more enjoyable than ES5. It's not like following a tutorial and copy pasting a gulpfile requires some deep knowledge of what's going on.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 03:11 PM
eh? ES6 is just an extension of ES5 so not sure how it could be easier to learn. Especially when you get into the weirder parts of like destructuring.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 03:27 PM
It struck me as a cleaner, more intuitive syntax. Like, arrow functions for anonymous functions are the same syntax in ES6 that I'm used to in C#. Default parameter values look sensible instead of the ridiculous
Code:
if (z === undefined) {
  z = whatever; // kill me now
}
Little things, obviously, but little things add up.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 03:35 PM
I use em but arrow functions don't seem too much cleaner to me and default assignments inside of the parameters themselves are a little "wait what?". The old style of defaults was just

Code:
var func = function (arg) {
arg = arg || {};
...
no ifs needed. meh whatever.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 03:35 PM
Quote:
Originally Posted by goofyballer
Code:
if (z === undefined) {
  z = whatever; // kill me now
}
So, that's pretty ****ing dark.

Is everything okay, goofy?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 03:57 PM
LOL, wp


Grue - can you expand on your example of what it normally looks like? That syntax looks weird to me, is the {} where some kind of assignment goes or is that an empty object definition? (although wouldn't the || then just evaluate the whole thing to "true"?)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 04:04 PM
Arguments in JS are "instantly" locally scoped regardless of existing or not. In my example if you called func(), arg is undefined, as in the primitive type undefined. So its falsy and empty object (or whatever you wanted for your default) would be assigned to it on line 1 of that function.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 04:08 PM
What if someone passed in 0? That would only work for parameters expecting objects, right?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 04:08 PM
Maybe a better way to explain it is behind the scenes of any function the bolded is invoked.
Code:
var func = function (arg) {
    var arg = arg || undefined;
sort of. as long as arg is truthy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 04:09 PM
Yeah you're boned if someone passes a falsy argument such as zero which is what the complaints about JS in general. Which is why um you be very careful with numbers are arguments for reals. However most web inputs send numbers as strings to start, so you can just delay using parseInt until you need it. '0' is truthy of course.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 05:00 PM
Quote:
Originally Posted by goofyballer
LOL, wp


Grue - can you expand on your example of what it normally looks like? That syntax looks weird to me, is the {} where some kind of assignment goes or is that an empty object definition? (although wouldn't the || then just evaluate the whole thing to "true"?)
The && and || operators return one of the operands when they evaluate to true.

Code:
'cat' || 'dog'   // returns 'cat'
'cat' && 'dog' // returns 'dog'
The || operator is commonly used for default values (like Grue's example), and && is less commonly used as a guard against null objects, like so:

Code:
myObject && myObject.someFunc();   // does nothing if myObject doesn't exist
I like that use of ||, but I have some reservations about using && that way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-16-2016 , 08:43 PM
Quote:
Originally Posted by Grue
Telling a beginner to hop into babel build systems is crazy imo.
I think its more just a good idea to put off learning them because they're annoying. I think he's a professional c++ programmer so he could probably use make instead of gulp.

Quote:
$ babel script.js --watch --out-file script-compiled.js
Then just include the compiled javascript file in your html.

You also might want to look into systemJS. I haven't used it but from what I've seen it looks easier to set up than gulp/webpack. You just call some bootstrapping function from a script tag with some basic config options and it does all the module importing and es6 compiling.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-17-2016 , 12:19 AM
THIS IS SO COOL



Openlayers displaying vector data I downloaded from here and converted into GeoJSON. Of course, it's probably not great that I'm including 17mb of JSON in the data that my Node app is sending the browser...even just serving up this data is full of challenges, like I guess to do this in a not-miserable way I'd have to have several different detail levels and set up data pipes and constantly be requesting/refreshing the appropriate detail level + tiles for just the area of the screen that I'm looking at. (I guess I probably just described how every map website ever works)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-17-2016 , 07:51 AM
you got a computer to render two whole colors?

The future!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-17-2016 , 08:16 AM
How are you finding node? I've never used it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-17-2016 , 10:42 AM
Quote:
Originally Posted by goofyballer
Details on how to do this? I was reading up on JS on some w3schools.org page and was like, ok, some of this seems kinda messy, then after reading your post I googled ECMA6 and found: http://es6-features.org/#ExpressionBodies (and everything else it describes)

DO WANT, YES PLEASE.

Don't think I'll have time tomorrow but maybe Sunday I'll dive in to try writing something.
Easiest way is to just write ES6 code and use a command line utility to transpile it back to od JavaScript.
https://babeljs.io/docs/usage/cli/

You can automate the process but that's where the confusing list of obscure options start if you've never worked with JS (imo).
You probably want to set up something like babelify eventually instead of using the CLI:
http://egorsmirnov.me/2015/05/25/bro...y-and-es6.html

As you can see this will lead you to wonder WTF browserify is for and then gulp/grunt :P
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-18-2016 , 05:31 AM
Quote:
Originally Posted by ChrisV
How are you finding node? I've never used it.
I don't super feel like I'm really using it yet, given that my server code is all of 63 lines long, and half of those lines are just there because I felt like doing something more so I added gzip compression and caching to that whole 17mb-of-data-I-was-sending thing (only shrank to 5mb, still sucks). It seems cool, but I'm still a little confused as to how we get to a place where this is THE jam for server-side web stuff when the JS language itself doesn't appear to offer anything uniquely awesome for that purpose. Like, as a C++ programmer, everything I'm doing in JS so far feels like it could be just as easily be done in C++ (with the bonus of type safety and not making stupid errors in code that a compiler would normally catch), except for a lack of library tools. I have to admit that it's pretty ****ing awesome to just be like

Code:
var http = require('http');

http.createServer(function (request, response) {

  // read url from request, send data back in response, not very long

}).listen(portNumber);
and, lol, there's a web server running on my PC? It seems too easy to be true. But when I think about it, I can't think of any good reason why this kind of library support isn't there in C++, like, all this code is doing is loading a pretty simple (API-wise) library that's designed to run a HTTP server on whatever given port, and you pass it a function to do **** when it receives a request.

I imagine there are a lot of environmental factors at work, like, web programmers are used to JS on the client side so being able to write JS on the server side too makes their lives easier.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m