is it safe to create a API that retrieve sensitive data from mongodb using a function on SERVER, and deliver the data to WEBSITE using es6 fetch (my server Access-Control-Allow-Origin only allows requests from WEBSITE)
or could someone bypass Access-Control-Allow-Origin?
type RowInfo = {
/* visibility */
hidden?: boolean; // if true, the row is hidden
/* row height is specified in one of the following ways: */
hpx?: number; // height in screen pixels
hpt?: number; // height in points
level?: number; // 0-indexed outline / group level
};
Do the question marks after the object represent ternary expressions? I'm also seeing that the can represent a null conditional operator too?
Hmm am I doing something totally wrong when on "reviewing" I tend to get a lot of inline styles. And specifically only inline styles for "margins/paddings". Where after building the a site first I notice "this specific divs should have a smaller margin, or larger left margin while keeping the standard other margins".
I could make a class for each div of its own, but that quickly pollutes the namespace.
@AaronHall it isn't much different from javascript. If you know javascript and a typed language, just combine the two with the variable definition on the right side. The type declaration reminds me of golang
I know some Haskell, and I know how to google and I understand that Mozilla's a good reference for JS (right?) with the less reputable W3 schools likely to show up in the search results too...
@JBis I wouldn't - promises are actually much harder to understand than just saying "await makes sure the function continues after the call has returned succesfully".
Hey Paul, what do you make of this: https://codepen.io/SkylerSpark/pen/ELwmoa I think its pretty good so far, still trying to research how to connect that color tab to the color of my cloth ctx in the canvas config...
I make methods most certainly always out of lambdas. Due to lambdas adopting this and super from the place where they are created. - Thus this and super are set to the object itself.
Not complicated, just silly. One can understand it easily, but it's silly. Just like how you should not use mutable objects as default parameters in python: it's not that difficult to understand but from a programmers point of view it's silly.
@DavidKamer It's a problem with callbacks. - When you use a member method as a callback the this during that callback will not be the original object's this. Rather it is the this of the object issuing the callback.
I need to extend some libs and my group doesn't have a lot of JS'ers... we have an intern that claims to know it, but I've seen a lot of people claim to know Python who didn't know it to my satisfaction...
Well, luckily Typescript is kinda new, so there probably aren't a lot of others who would be better to do it... I do have some old JS pros I can get to review my code, however, but since they're not in my group, it will be really one-off reviews...
To be honest I tried doing similar in python - I failed due to libraries badly interoperating with the various flavours of asynchronous code. (Async, greenlets, threads - some libraries expect one or the other)
@AaronHall yeah webassembly will likely replace JS on the front end (at least partially) at some point, but I doubt node.js is going anywhere anytime soon
@AaronHall You gotta get your head around the fact that you never want to stop execution of JS. If its gonna take a while, async it. Don't sit there processing shit thats gonna take awhile.
I'm really missing the generators and ability to just move data around.. In node it's really slow when you have (say) an array of key, value pairs. Need to do some dictionary operations on it and then export a slice of the data.
like building a tool in C and calling it externally (not in the way that the node docs tell you to call c/c++ code). I'm talking about something I've never done that I want to experiment with
Python is fast for data analysis because numpy (and other libs in the data stack) use LAPACK and BLAS, which use specialized processor directives and are written in C and Fortran.
And obviously you can create everything in javascript - it's turing complete after all. It's just not nice and the language doesn't promote structuring code in such a way that they're optimized.
yeah, but that kind of forces people to take a step back and ask "why am I doing it this way" 9/10 times it's logically much simpler than doing something like that
Hi All, I am a newbie for angularjs and im currently using fullcalendar. Im facing issues in rendering eventRender function in mouse hovering. can you please look into this stackoverflow.com/questions/56472588/…
@tharindu Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
Thus ['option_a', 'option_b'].includes(mypick) is faster than new set(['option_a', 'option_b']).has(mypick)
Even though using a set is in theory the right thing to do (I don't care about the order, I only care whether or not the chosen pick is in the sequence of options).
Ability to overload operators for one thing. Using of "magic methods" to overload most operations for another. Better more complete generators to help lazy evaluation...
IE to calculate a rotation using 3 matrices: rot = A <dot> B <dot> C you'd have to do something like: A=[]; B=[]; C=[]; rot = matrix.matmul(matrix.matmul(A, B), C)
Uh yes? Since it's expressive? (@ is a well defined operator, and you can look at a glance the operands are matrices, thus anyone with a background in linear algebra knows what is being done there).
@ is defined as the "matrix multiplication operator", or "other multiplication where * should be used for memberwise operation".
That's part of the language definition. The actual calculation would hence be part of the matrix() class definition. Using the __matmul__ method.
If you do matrix operations you would need it. Simple as that, I most certainly would not ever "comment" "we're doing a dot product here to get the lenght of a vector along another vector".
Those things one should know, or look up when you see a dotproduct happening.
Wait you see a "multiplication symbol meant for non element wise operations" - and you also see that it happens on 3 matrices (part of the type). How do you not connect the dots?
Quite often mathematical notation is the cleanest way to write comments.
But point being: operator overloading really clears up a lot of "boilerplate" code, that distracts from actual problem level code. And from experience context always makes it clear, and since it's often used a lot if you start using it. It's also easy to understand if you didn't beforehand.
The problem with polish notation is that it is non intuitive if function lenght increases. And thus it doesn't align well with the mathematical "explanation".
I recon it would actually require more understanding of mathematics to decode polish back to infix notation than to just notice 'special' operators.
It's mainly used to write programs for peripheral measurement equipment. As being visual it is inherently truly asynchronous. (each function operates the moment it has received all inputs), and then pushes the outputs.