@eicksl 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.
Is it a good idea to have sounds stored as base64 strings inside an object and load them into <source> and <audio> elements once the page loads? e.g., like this
I suppose if I'm questioning my own idea, it's probably bad.
If I've a function func(f_param, s_param) then I've a local variable var local = f_param || s_param -- if I call the function with f_param as null, will it init it the local with the second parameter?
@hfbachri_ You can write the method types just fine
But you need to be aware that there's no safety net that would enforce that in code
You have no compiler, no type-checker
You can write that a function returns a number, and trust that the people on your team wouldn't break that promise without consulting/changing the documentation
Again though, take a look at TypeScript, it sounds like what you want.
@Shad Yeah, although I have much less free time on my hands :(
@MadaraUchiha yes, ofc. The stories we hear about you are endless. Between slide pooping, picking up little people, eating raw chicken, being a vegan bodybuilder (and losing the game a lot), doing a lot of OSS work on node, it seems you've done it all
I'm reading about pushState - say I have a list of 5 objects and I add the list element to pushState and 5 more items gets added dynamically after that. If they trigger the popstate event (going back), will it display only those 5 items again?
@noyon07 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.
Hi! I'm really new to nodejs, and I'm having a problem using JSON / NodeJS / JavaScript. Basically, I'm using Twitter's node library to upload a image, then tweet it. After it tweets the image, I'm trying to retrieve the URL of the uploaded image but for some reason I'm getting an undefined error, I'm not really sure why
@DestinyFaith 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.
@ShrekOverflow from my undersanding the V8 turbofan updates are more about leveling out performance for built in functions. I recently found that foreach was faster than "for", even when I cashed the length of the array for(let i=0,n=arr.length;i<n;i++
@Rick you build node first github.com/nodejs/node, it runs, make -j4 and make test pass and you ping me
Then we'll find you something to work on together - you'll make a PR, we'll review it and land it, repeat a few times until you find something you like working on and we'll take it from there.
Usually people find one or two things they focus on - few generalize. thefourtheye is doing a lot of things all around for example and is in the leadership now :D
So proud of how that dude pushed himself in the project, I had nothing to do with it but it was inspiring to see :)
just the single direction traversal in a single array
for (let out = 0; out < 4; out++) {
console.time('non-random');
let x = Array(MUL).fill(3).map(() => new Delta(3));
let total = 0;
for (let i = 0; i < MUL; i++) {
x[i].y = x[i].x;
}
console.timeEnd('non-random');
}
for (let out = 0; out < 4; out++) {
console.time('forEach');
let x = Array(MUL).fill(3).map(() => new Delta(3));
let total = 0;
x.forEach((el) => el.y = el.x);
console.timeEnd('forEach');
}
The tests don't seem comperable for the reasons you mentioned. Why don't you use a new Map.
that seems like that would be more comperable to your java
@ShrekOverflow generating an array in those dimentions seems like you are using O(n^3) new Array and fill will loop twice along side the scopeing loop. where your java simply adds items to an object object
for (let out = 0; out < 4; out++) {
let x = Array(MUL).fill(3).map(() => new Delta(3));
console.time('singlelist');
let total = 0;
for (let i = 0; i < MUL; i++) {
x[fixedRand(MUL)].y = x[fixedRand(MUL)].x;
}
console.timeEnd('singlelist');
}
This takes ~3267.744ms
THe java code after fixing the random index
Single List took 4505.0ms (in appropriately named this is a java basic array now) I tried that too.
In array of arrays though something very interesting happens
for (let out = 0; out < 4; out++) {
let x = Array(WIDTH).fill(0).map(
() => Array(HEIGHT).fill(3).map(
() => new Delta(3)
)
);
console.time('doublelist');
let total = 0;
for(let i = 0; i < MUL; i++) {
x[fixedRand(WIDTH)][fixedRand(HEIGHT)].y = x[fixedRand(WIDTH)][fixedRand(HEIGHT)].x;
}
console.timeEnd('doublelist');
}
@ShrekOverflow Seems like it's time for more auth at work... The rest of the company is adopting salesforce and they want it to automatically create users on our SPA...
We're spinning up a machine that will act as a go-between linking salesforce and our app... it will need to call endpoints with an access token
from reading it looks like I want to use the client credentials grant flow to get a token, but because our application is set to "Single Page Application" I can't change the token endpoint authentication method away from 'none'
so I can either make an 'integration user' and give it the permissions I want, or I can change the application away from SPA... any suggestions?
actually... how does the client credentials grant thing work with the authorization extension... can i tell it which permissions i want? we're still using namespaced fields on the token rather than scopes