I mean I guess if it makes sense, but why wouldn't you be okay with leaking data if you even need a db? I could see how you might use that, but doesn't seem like something one would do given a situation where you had that much data to process...
like once you get that level of traffic, usually you have the resources to deal with the extra data
and if you're using a db that implies the need for permanence
so I guess if you're in the grey area of short term permanence and and not enough money/resources then maybe capped is a good idea... but then you could just cache the data somewhere imo
like reddis is probably a better option at that point
@Osakr 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.
Hey guys. I am working with HTTP requests atm and I am just wondering if it is possible to write a wrapper function for XMLHTTPRequest where I would be able to call the function like this. Would i need to use await and sync to do that? or do I need to insert a callback inside getUserMessagesByToken?
Hi, before I post this as a question at SO, I though i'd ask it here: I have an array, say `name=['a','b','c'];`, and a `values=[1,2,3]`. I want to end up with `{a:1, b:2, c:3}`
Yeah I know, but for the labs we're suppose to use XMLHttpRequest :P. However I managed to do a wrapper function with sync and await together with XMLHttpRequest. @karelG
Hey there fellows :) I'm kind of fan of syntaxic sugar and was asking myself if there was a shorter way of writting this ? argv.website === 'naissance' ? 'naissance' : 'fairepart'
@KostyukRostyslav 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.
There are fine, but I still can't find answare on one question. When I have webpack.config.js file and I have my babel.config.js. Do I need to import babel configuration manually or babel-loader will do it for me?
Basically I wonder if I could avoid adding a property into an object if a variable is false but from inside the object. So let's say I have this object:
var obj = { foo: 'bar', bar: 'foo' };
Now I want to rewrite the same object but I only want to add the second property if a new variable, wh...
@Osakr You should have mentioned that, as it really reduces your options. The duplicate I commented a bit ago may have more alternatives: stackoverflow.com/questions/11704267/… - Not to mention, the same answer that bergi provided in the marked duplicate also includes an alternative without the spread operator, using Object.assign. — Tyler RoperJan 11 at 16:45
well, some of yours question got asked by others. The thing with this community is that "decent" question gets dowvotes very fast if it is kinda straightforward or got asked already
Keep in mind that I have no experience whatsoever in this subject, and very likely, the result of listening to my advice is risk of fire or utter catastrophic failure.
imagine you are creating a segmented tree and you needed to create boundaries on each branch representing an interval. if you have a negative number that should be your left most boundary. your intervals need to represent the intervals at every step of the number line
Is it possible to construct a snippet of code in Java that would make a hypothetical java.lang.ChuckNorrisException uncatchable?
Thoughts that came to mind are using for example interceptors or aspect-oriented programming.
I wanted to create a pure, single-purpose function, instead of having addToMap mutate the object as a side effect. The trade-off though is that it has to copy the object everytime. I don't think this is a memory concern, but does it take a long time to copy a large object?
that's really weird. id on't see any information online related to firefox issues with cors on GCS, are you sure it isn't some kind of console setting hiding that information?
@forresthopkinsa are you configuring cors yourself? Some browsers are less forgiving about syntax when setting headers. I just use the cors npm package, might want to give it a shot: https://www.npmjs.com/package/cors
Also I would try going incognito, disabling browser plugins, etc
@KevinB I've only used heroku to deploy my express backends, not really familiar with google cloud but I assumed that you just deploy your own backend. I read that article, but it seemed to be a generic article explaining cors?
Note: CORS configuration only affects requests to XML API endpoints. JSON API endpoints allow CORS requests, regardless of CORS settings on the target bucket. Requests to the endpoint storage.cloud.google.com do not allow CORS requests.
@BrianJ i mock it up with code, so that when i demo it i can make code changes on the fly via dev tools to end up with a final-ish result
@KevinB, back to my question re: copying arrays. So you're saying that it is in fact "expensive" to copy objects and that you would just mutate the input object in addToMap? Note that Airbnb style guide (ESLint) complains about param re-assign, even in the reduce callback.
right. well im preparing for my first dev job interviews, so how would you solve that problem in an interview setting? I just thought pure functions without side effects are considered good practice. I realize I'm over-optimizing.
I build maps really often in those code challenges
it seems that using transform: translateY(1px); also causes the element to gain an extra position: relative;-behaviour.
Is there a way to suspress this?
Here is a example on codepen.io.
I would like to position the whitebox absolutely to the green one, not the parent (red) one.
If the property has a value different than none, a stacking context will be created. In that case, the object will act as a containing block for any position: fixed elements that it contains.
Did you even try?
Create a new Array first, then in your for loop, you can append each element to that array:
let arr = [];
for(var i=0; i<personal.custom.length; i++){
arr.push(personal.custom[i].name);
}
console.log(arr);
@BrianJ No, that's exactly what I'm trying to avoid -- users are uploading huge files (100+ GB) and so proxying that data is unacceptable. Besides, it's working in other browsers, CORS and all.