« first day (2672 days earlier)      last day (2501 days later) » 

00:02
@rlemon old but gold :P
@rlemon haha
00:18
jajaja
@rlemon oo this is real nice
Oh, also - did you end up making Gołąbki?
not yet
Make sure to get some real good cabbage though
My experience with (I had none with Canadian) American ingredients is that it's hard to find good quality stuff
Cabbage is for poor people
Also how did OP arrive to this solution lol
1
A: Refactoring Javascript Function: Array transformation

Kamil SoleckiThis is my approach. We iterate over our array, keeping track of our current value - and substracting from it as we push out each element to the output array. There is 3 cases: either our current count is >= input, so we just push and move on, current count is 0, so we just push everything l...

I can't even read it
It's some form of black magic
00:53
say i need to make
4 million HTTP HEAD requests
how do I do this without killing my OS's DNS service
Why would you ever need to make that many requests?
API validation for an API that returns 4 million unique images
i need to check that each path has image located there, and that it produces a HTTP 200
we host a lot of images for our client
I think you’re taken ng an opposite approach. Just add logging and reporting when a route returns a 404, then fix it. It’s not reasonable to test make ng 4 million requests
yes but to see if a route returns a 404, a request to said path has to be made
Yes, fix it later, whfn the 404 occurs
You can’t promise 100% uptime of 4 million assets to a customer
00:59
the 100% uptime isn't what we are trying to achieve
we are looking to preemptively find these 404's before they happen
Okay, say I was to break it down to 20,000 requests
I've managed to get ~3k requests out before the DNS cache shits the bed
save the images twice. half the chance of 404
quick math
202 + 202 is 404
01:26
Hi im planning to learn android programming. any advice?
You can program Android with JS now?
Yeah, with java scripts
no. can't join in android eh
is it a joke cus i started a chat about android here in jscript?
this isn't jscript, thank god
01:29
JScript was a reasonable technology
EczemaScript
i just googled it omg
so theyre different
@RonaldMunodawafa How many years of professional experience do you have with it?
I bet it's not as much as me
@KendallFrey I have never used it professionally since I have never targeted IE
Neither have I
I used JScript for a couple years
01:33
JScript.NET is number 1 programming language
@KendallFrey Please fork ECMAScript and separate integers from floating points
Why don’t you do it yourself, ronald mcdonald?
@RonaldMunodawafa integers are a subset of floats
@ndugger It won't become popular enough to be adopted because no one knows me
Nobody knows Kendall either
He just plays ksp all day in his underwear
01:36
Anyway, my Hue is getting cloudy
Brb
KSP is actually based on Kendall. He's a Kerbal
@ShrekOverflow Do you know much about the authorization extension? The rule it autogenerates seems to store the roles/permissions to user.app_metadata.authorization, but I think that's the old, non OICD compliant way of doing things and instead it should be context.idToken[namespace+'authorization'] or something similar. I can't find documentation though
What function is the prefix 'auto-' in 'autogenerate'?
@RonaldMunodawafa auto means 'self'
@david Thanks. I'm not a native speaker so when I come across certain words, I try to understand why they were used that way
01:44
no worries, english can be tricky
especially seeing as that's latin or greek or something
greek apparently
@Jhoverit haha nice
@david we recommend breaking roles / groups down to permissions
then the permissions can be assigned directly in the access_token in the scope claim.
@ShrekOverflow Yeah 100%, unfortunately this thing uses roles too for some logic
This allows much much better Authz management on both sides
the access_token or the id_token?
01:53
access_token
from what i'm reading the scope is no longer used to request fields though
thou shalt not use an id_token to call an API
really?
we're kinda using id_tokens to call all our own apis ><
01:54
I know
Which is why I said, just setup a call with me
i don't even know how to get an access_token
there is a LOT of things that've changed
when we log in we just get an id_token
very simple
okay... maybe i should take you up on that then
01:55
Declare a Resource Server in manage.auth0.com/#/apis
OAuth is such a pain to work with, and the benefits it provides are negligible
@ndugger try SAML / WS-FEd
Or I could just do basic username/password auth with a uuid session token and redis for a session cache
Then you can request an access_token for this resource server by adding audience parameter in your authentication/authorization request.
10x easier
01:56
@ndugger and make everyones life harder esp federated.
more passwords, more work to do when someone onboards / outboards
Hardly
I am obviously biased, but personally I find OAuth easier than all of the mess tbh
@ShrekOverflow Okay, it looks like we have some stuff in there already, but it's the management API. I've added in a new one called 'Resource Server'
10 lines of code and I am done next :P
:D
For the most part the changes will be much simpler 😛
response type is currently token id_token
should it be token access_token?
01:59
nope
token is access_token
or does token already give me the access_token
right
Is this an SPA ?
yeah
do you have a .authorize
method where you are authenticating / authorizing ?
i'm using the other dude's POC app thing that uses lock i think
02:00
WHich version of Lock 😃 ? Lock is good... Lock is go..
Because the code you'll update is mostly just a version swap and you'll be good to go
although I personally prefer auth0.js ... even less code, smaller bundle but 😛 For now lets not go that route
I'm retarded
I was trying to figure out why the room got frozen
God damn it
Okay i've got the ${namespace}authorization stuff appearing in the access_token now
but it's empty
because i've messed something up
it still has to be namespaced in the access_token right?
sweet there we go
@david yes
Now on your API end
parsing an access_token is literal black magic like simple
there will be a nodejs example :D
So you say i should be chucking the permissions I want inside the scope claim... Is the general idea that whenever I want to hit an API I request an access_token with just the permissions I need for that API hit (inside the scopes) and use that?
That is usually the best idea
I wrote connect-ensure-permissions to make that simple on API side
02:11
But is that an extra auth0 call for every API hit I want to do?
No
You can get a token with most common scopes that you anticipate
and get sensitive ones only when needed
for eg an application which reads and writes messages you can add read:messages write:messages
and delete:self after MFA
that's the key idea here
how do I put my permissions into the scopes field? via a rule? Do i need to manually check which scopes are requested, compare them with the permissions I get from the authz extension, and return the ones that pass?
right, so our admins could log in fine to do everyday stuff, but if they needed to do something spicy they'd get like an escalation prompt kinda like the windows ones
i can see how that would be cool
!!giphy meme
Lame
02:24
@ShrekOverflow Okay you've led me to some sweet documentation
is this the right path?
the right wey?
absolutely
we do need roles though
because there's a bunch of weird logic thrown around
i might just prefix in the scopes
role:blah, permission:blah
you can shove the roles too
instead of permissions
but we recommend moving to permission
02:27
we need both
why can't you move the logic to Rules :?
i think some people advocated for permissions only, but the rest of the company doesn't get it so they give us weird rules in terms of roles
we might be able to move it to rules, but this app is such a mess that it would be really really hard
baby steps imo
oh man i need to manually list out all the scopes in the API place?
02:47
@ShrekOverflow Can I still put all the roles and permissions in the id_token and use that on the front-end to decide what to display?
Hi guys
1 message moved to Trash can
@Sadiq Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
03:07
I'm learning js. And when i was trying that on browser console I couldn't undestand this behavior. If some one could help me whats that : https://hastebin.com/osunayerun.js.
What i want to know is what is the difference between calling method with brackets aka round brackets and without Roound brackets.
where did you get that fancy f?
its the activity i performed on console. that fancy f and the implementation right after is something is what i got when I hit Enter after this line : container = SomeMethod
The second one isn’t calling the function
It’s just adding a reference to it as var container
ahhh i see what you're doing, you just set container to the function and it printed out the definition
ok it seems intuitive. but i cant get :
var container = SomeMethod(). And after that when i write: container.username. It gives an error. Why cant it access username?
@david yes
03:13
@Sadiq because username is an internal variable and not a property
JS is not like Java
ohk... got it now.
but why does the error say cant acccess property? container is not an object
container is undefined
in the first example
because the function doesn't return anything
Everything is an object in JS, but your function doesn’t return anything, which means container is undefined
uhhhh, everything is not an object in js
@david most things are; it’s much easier to think in these terms
03:17
hell no, it's definitely not easier to think in those terms
God seems like js is good enough to shatter my programming concepts
so container is an object.. right
@david go look at the prototype of most things in JS; they all inherit from Object
Prototypal inheritance and the fact that everything extends Object makes JS confusing to most people
Function, String, Array, Proxy, Number, etc... they all extend Object
@ndugger yes i also read that Function, String, Array, Number, are subObjects.
The only things that aren’t objects are string and number literals, but you still have access to their prototypes
but if its an object then it should have treated username (in my e.g) as object property.
03:22
No
why so?
You created an internal variable
You never set a property
@KamilSolecki A non-sexy solution, a closure:
async function mapDirectory(dir) {

    let results = [];

    function innerMapDir(dir) {
        const filesInDirectory = await util.promisify(fs.readdir, dir);

        return Promise.all(filesInDirectory.map(async file => {
            if (isDirectory(file)) {
                results = [ ...results, ...await innerMapDir(getDirectory(file))];
            } else {
                results.push(file);
            }
        }));
    }

    await innerMapDir(dir);
    return results;
}
I think you want async iterators for the ultra-sexy one
that's not right. I missed some things.
user1596138
04:01
@Zirak credit for what? If I seemed demeaning over the bot code that wasn't my intention at all. I don't know how Workers work
06:24
@david Absolutely
that is what the id_token is for
@ShrekOverflow It's been a while since I've seen people talk about an id_token. Feels almost weird :P
@SomeGuy We now support cross origin auth too :P
also feel free to loop in
Loop in? What?
06:41
Have a stab 😛 You are more aware of most of this than I am (:
06:56
(at protocol recommendation part)
hii all
anyone knows about ext.js
sounds like such a generic title that you'll probably have to give us a link
07:12
extjs again :)
I thought it was dead
it is alive in older projects
;)
08:01
Like Java & Cobol, Angular, ExtJS, jQuery will never go away they'll keep making code garbage
08:14
@ShrekOverflow jQuery doesn't make code garbage.
Hundreds of thousands of "let's just throw jquery on the problem" code writers make code garbage.
Don't blame the library / language, blame the incompetent programmer.
Unless said language is php
jQuery isn't even a garbage-enabling language, like PHP is
By all means, blame php
And even though PHP is garbage-enabling, it's not an excuse to write garbage.
@Cerbrus I disagree.
@MadaraUchiha That was a joke
php is bad hurr durr :D
08:17
@Cerbrus So is your face.
At least my face is funny
Not sure if I should be proud of that...
ohhai
@Luggage exactly - the point was to avoid using let, so no pushing into an array - this is where it starts being uphill :P
this is the exact same solution that I had, when I decided: "lets see if we can hack this somehow"
@Cerbrus think of it this way - not everybody can become mr. bean in an instant
@KamilSolecki Yea, thanks...
no problem! If you need more kind words, hit me up
@Luggage async iterators would make it slower.
08:29
@MadaraUchiha are you familiar with the starting idea of this though? Maybe you know how to hack js somehow
@MadaraUchiha fine
@KamilSolecki What's the goal?
@Cerbrus or com.oracle.sun.java?
Say you have a recursive map, like this
9 hours ago, by Kamil Solecki
async function mapDirectory(dir) {
    const filesInDirectory = await util.promisify(fs.readdir, dir);

    return Promise.all(filesInDirectory.map(async file => {
        if (isDirectory(file)) {
            return await mapDirectory(getDirectory(file)); // We shall make the magic happen here
        } else {
            return file;
        }
    }));
}
@Cerbrus +1000. I wish this points should add to your SO rep.
08:32
now, the thing is, can we hack map in a way, that in its' return statement, even though it is being passed an array, it destructs it into few objects and pushes it back into the result
example
data = [
  [1],
  [2],
  [3, 4, 5],
  [6],
]

Expected result: [[1], [2], [3], [4], [5], [6]]
but to do that, from my understanding, we would need to force the arr.push() that is inside the map implementation to accept ... like a function that dynamically destructs the array?
@Sankar You can easily make that happen. Just gimme a bounty :D
@Sankar You can open a question with a bounty for 1k
and give it to cerbrus
Forget about that :D.
But ask a mod, that if they can give a bounty for a million dollar comment.
Well that's disappointing
Very
@MadaraUchiha ^
08:41
I think Sankar is no longer welcome in my cult. The rep sacrifice has been cancelled...
@KamilSolecki isnt that a flat map?
@KamilSolecki [].concat(...data).map(x => [x]);
Nope. If i give you, that's more like a rep gain activity(like ask someone to up-vote your answers). Hope we don't encourage that. So lets go in a legal way
You offered, I provided a way. That's not asking :D
php is not that bad
/me flies away
08:47
@SaitamaSama Are you saying it's even worse? :D
@Cerbrus you'd need to look at the ealier example though to fully understand what I mean
hey
anyone here have ok design skills?
TS : Is it possible to set restriction on array length in TS ? let a: Array<number>[2] alike ?
@HelloWorldPeace what kind of design
09:03
@Cerbrus quite the opposite :B
@HelloWorldPeace just ask your question
@RoyiNamir No, afaik
Gush , How can this phrase be nicer ?
 if (arr[0] && arr[1])
        t = `translate(${arr[0]},${arr[1]})`
      else
        if (arr[0])
          t = `translateX(${arr[0]})`
        else
          t = `translateY(${arr[1]})`
nm
09:27
t = `translate(${arr[0] || 0},${arr[1] || 0})`;
t = translate.apply(null, arr.filter(Boolean))
@DenysSéguret translate is in a template string there
Then it's even simpler
t = `translate(${arr.filter(Boolean)})`
@DenysSéguret translateX / translateY
Do you need some coffee? :D
oh... missed that
@Cerbrus yes but it's been approximately 30 years that I'm in need of coffee
09:36
saw the video in the python chat, had to share
@Neoares Is that from Falcon Heavy?
the thumbnail?
Sept 2017, so nope :P
no, just watch the video xD
video of burning billions and billions with funny music
@Wietlol @KamilSolecki design using CSS grid
09:41
@Cerbrus no
its a history of flights of boosters
The other day I found an article where they said they had cured mice of cancer
And I thought, man, we are totally in the future now
it's weird.. it hit me like a wave
but then a tesla was thrown to the space
flying cars
@Neoares With a towel
what, did I miss something?
09:44
@Neoares Nothing more than the usual
I guess :P
@Neoares The tesla has the hitchhiker's guide and a towel in the glove compartment
hello, i have this warning with inteliji "binary operation is not compatible with type undefined" on the line "...&& myvar !== undefined &&..." myvar is a number basically
how to remove this warning ?
@Neyoh (), possibly
why did they send a towel to the space? o.o
09:45
@Neoares That is what's raising eyebrows? How about the tesla gift-wrap around said towel?
wtf
didn't know
is anyonoe else bored to death?
no, there are still tesla memes to be released
Nah, I'm bored to life
there are tesla memes?
09:47
south park towely?
@Cerbrus That's not the same. this code sets 0 if not specified.
@RoyiNamir 0 is the default value
ouch . right
So that's like not passing it
:-) right thanks
09:50
I just went through a wild goosechase to find out why I was getting a bug in preproduction only to find out that it was caused by a misleading error to a connection problem caused by a change in port
I received a CV from a candidate with " 83% Codingame Java (en PJ)" ? Is that good ? Is there more to this than liking to program and having some free time ?
location.href = "@Url.Action("GenericDetailsNew", "Generic"),?GenericID=" + ID; how to add target="_blank"?? any idea
@Cerbrus like (myvar !== undefined) ?
@DenysSéguret I don't know, but now I'm curious.. never heard of Codingame before
@DenysSéguret Actually, tutorial lead me to have 100% success
same for me
09:56
so 83% probably means little to nothing
Maybe there's some meaning to "as PJ"
Peanut butter + Jelly
man we're in the murican-free hour
stop talking bout peanut butter and things like that

« first day (2672 days earlier)      last day (2501 days later) »