« first day (2888 days earlier)      last day (2075 days later) » 

12:27 AM
Aha 4:3 on YouTube
 
Anyone use the workbox-webpack-plugin?
It doesn't seem to be caching my html pages
 
Hmm I can't decide between a 400 or 422 status code for when the data is correct but due to some other setting a request can't be handled right now. (More to the point: a post request tries to remove an entry from the database, however if there are still links in other tables to this entry it cannot be removed yet and the links first have to be removed).
 
There's a room about CSS?
 
400 seems "wrong" since it isn't a user error at all: the user syntax is completely valid. However on the other hand 422 would mean the number of status codes keep increasing, and I've read quite a few times that using as few status codes as possible is a good thing.
 
@Susi 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.
 
12:41 AM
I could even use 409 conflict I guess?
 
 
2 hours later…
2:53 AM
@KamilSolecki We have to do Lucky you in karaoke.
I'm obsessed <3
 
o/ hi badger
 
Hi!
What's up?
 
NM, building my desk 😃
 
Nice
Any life update?
 
Nothing much, just hoping to move to US whenever I can permanently.
rest, I wouldn't share on this chat 😃
 
2:55 AM
How do you plan to do that?
You can ping me on facebook for your love life updates.
 
My company will apply for an H1 next year again :)
 
Cool!
Everyone ping me their life updates. Ever since I got a full time job, I feel like so disconnected.
Here's mine: I'm living in Colombia, giving lots of talks all over the world, still no engagement ring, we will be in Europe for Christmas.
 
> still no engagement ring.
 
@copy
 
3:13 AM
If you like React, Auth and want to give to try marketing. Come work with me, literally in my team auth0.com/careers/job/….
 
3:32 AM
Oh my god it's impossible to get my browser to update this service worker
sw.js just won't un-cache itself
Well I got it to work on a different browser
Wait no actually it seems to be caching across multiple browsers
:O
 
4:05 AM
Why I'm Moving Most of My Social Activity to Slack, Then Creating a Second Slack to Avoid the People in the First One, Then Giving Up on Social Interaction Completely, Then Going Back to Texting
2
 
4:44 AM
🚽
 
@KevinB ?
 
?
 
5:55 AM
::) - still no engagement ring
 
@Edison 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.
 
have anyone used polyfills in your legacy projects..?
 
6:26 AM
@Edison ::::)
 
 
2 hours later…
8:21 AM
inb4 star this message if you want copy to give badger an engagement ring
or the other way around
@BadgerCat at this point, can't you just propose to copy?
 
I have created Login screen but when I click on login button it show error see screenshot below:
 
@funjoker 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.
 
Login.js:
import React, { Component } from "react";
import { View, Text, StyleSheet, Button, TextInput, KeyboardAvoidingView, ActivityIndicator } from "react-native";
import Auth0 from "react-native-auth0";

var credentials = require('./auth0-credentials');
const auth0 = new Auth0(credentials);

export default class Login extends Component {

    constructor(props) {
        super(props);
        this.state = { accessToken: null };
    }

    _onLogin = () => {
        auth0.webAuth
          .authorize({
I am using correct domain name but still I am getting webpage not available see imgur link screenshot shared above
 
anyone can write an internet draft: tools.ietf.org/html/draft-wkumari-not-a-draft-06
 
8:49 AM
@Alesana then it's probably not client-side caching
 
Can I make an object from a subset of key from another object with destructuring? I have a Coordinates object and want an object containing only the latitude, longitude and accuracy. My current approach would be to use {latitude, ...} = coords and then use those three to make an object again but I wondered whether there was a better way of doing that.
let x = {{latitude, longitude, accuracy}} = coords or something like that.
 
9:42 AM
@geisterfurz007 lodash _.pick
const x = _.pick(coords, ['latitude', 'longitude', 'accuracy']);
 
Hi all, I am using auth0 with react native app for authentication. when I click on login button I am navigated to new url in browser but it says web page not available can someone please tell me what is this issue Is it domain issue or callback issue. How can I fix it ?
 
@funjoker You're trying to access https://authorize/......
That's not a real domain
 
@MadaraUchiha If you check the code above and see the _onLogin() see audience which is the domain name
 
@MadaraUchiha Any VanillaJS? I'd rather not include lodash in my project for that only ^^". If not, that's fine, it was just something I wondered about when I wrote that code. I don't mind putting the object together, I was just curious if JS had some black magic that could do that :D
 
@funjoker Impossible to tell without seeing what you're passing as credentials
@geisterfurz007 You can fairly simple create a helper function
But if it's just for the one place, destructuring then creating a new object is likely to be more readable
const { latitude, longitude, accuracy } = coords;
const x = { latitude, longitude, accuracy };
 
9:48 AM
@MadaraUchiha see credentials:
module.exports = {
    clientId: "{AUTH0_CLIENT_ID}",
    domain: "{AUTH0_DOMAIN}"
};
Above code is in auth0-credentials.js
 
@funjoker You're..... supposed to replace those with actual values
Don't just copy/paste from the docs
 
@MadaraUchiha No I have made .env file and in that I have done as follows:
AUTH0_DOMAIN="sumaempleos.auth0.com"
 
And what's supposed to replace that in your code?
Do you have a build step?
 
Yeah that's what I ended up doing. Having essentially the same thing below each other had me wondering if there was something I could do with destructuring that would give me the object with one line. But if there isn't, that is what I will be going with.
 
@MadaraUchiha Build step ? No
 
9:52 AM
@funjoker Then why would your node application even attempt to read your .env file, and replace the values?
 
@MadaraUchiha Sorry got it. auth0-credentials.js should look like this :
module.exports = {
    clientId: "AUTH0_CLIENT_ID",
    domain: "AUTH0_DOMAIN"
};
Am I right ?
 
Does it work?
 
@MadaraUchiha No it doesn't work
 
Right
Because that's not how env files work in node
There's no magic here, you will need to read the file and use the values from it
There are libraries that can help you
Specifically, look at dotenv
 
Ok got it.
Instead of using 3rd party libraries I will go with values
 
9:56 AM
But in any case, there's nothing, short of a build step (i.e. manipulation by webpack or something similar) that can make a string literal like "AUTH0_DOMAIN" to mean anything other than exactly that string.
You can access environment variables with process.env
 
Ok so you mean process.env.AUTH0_DOMAIN might work ?
 
@funjoker Please read the dotenv documentation.
Like I said, there's no magic here, nothing will magically take values from the .env file
 
Oh ok I will go through docs thanks
 
10:34 AM
The fuck is wrong with people
 
Absolute madness these days.
Have you seen the linked ones in the original request for this as well?
redis, node, jira and django all did the same thing.
 
@BenFortune lmao...lookin at this listening to master of puppets
 
11:12 AM
Dafuq
I find it hard to take anyone seriously if they take offense to the words "master" and "slave". Especially in a programming context.
 
so master of puppets should be renamed to parent of puppets?? Metallica is ruined :( :(
 
lmao that sounds terrible
 
@SurajRao "Parent of humanoid poseable dolls"
 
where do I find documentation about the funny characters you prefix before a package's version during an npm install of the same package...?
 
11:24 AM
@BenFortune Yes, let's make questionable decisions and then lock the thread because we don't like the backlash
@deostroll Basically: ^1.2.3 = 1.2.(x >= 3), and ~1.2.3 = 1.(x >= 2).(y >= 3)
So 1.99.99 matches ~1.2.3 but not ^1.2.3
 
12:04 PM
Hi all, Any idea how to implement login screen with auth0 but when the user enters emailID and password after clicking on login button he should be navigated to Home screen. Currently I am able to implement the login screen but it open's new browser tab and there you can login I want to login through my react native app and not from browser
 
12:14 PM
"There is no point in continuing the debate. We’ve all had our say. If you
want to keep talking, go to Twitter."
well he seems nice
 
fuck twitter
 
best is someone pointed out they still call this branch 'master'
:D
 
@rlemon Literally no one had their say.
 
that's what I've gathered. "we're gonna do this" "NOOOOOOOOOOO!!!!" "well good talk, we're gonna do this"
 
Someone pointed out that they didn't even discuss it with the rest of the higher ups
 
12:24 PM
I still think it's hilarious that the banter is pretty much ignored, and the most concise, well put and accurate response gets told to take it to Twitter
what a joke.
 
Yeah, I think lots of people are missing the sarcasm in some of the comments
It's blowing up on reddit
> It's 2018 and we are still kink shaming our code??
lol'd
 
> Oh no, the parent died. We need to make sure that we kill orphans reliably.
XD
 
12:41 PM
@BenFortune Impressive...
 
Hi. I have this RXJS code :
merge (interval(100) ,from ([0,1,1,1,1,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]) ) .subscribe(a=>console.log(a))
How can I make it stop yielding values once one of the sources completes ?
(I want it to stop after the last `3`)
At first I thought about the "zip" operator - but it still yielding values after the last 3
 
12:56 PM
takeUntil
probably
but don't ask me about it, I don't know about rxjs
 
My bad. it seems that `zip` does work. maybe I've seen previous console results.
Thanks for the effort
(for those who want demo)
 
1:29 PM
@SomeGuy Ken White tweeted about my project :P
 
why do they always have to add that it's really really important to get finished if A) what we're waiting on doesn't depend on me and B) if you're still uncertain, see A
all that does is stress me out without doing any good
 
@ZachSaucier nice
 
@Neil they're sharing the stress with you. Distributing it among everyone else so they feel less bad
 
@ZachSaucier that's probably true
Still it makes me want to pull my hair out. If it is really really important to get finished, talk to the guy who's bottlenecking the whole project if anything
maybe he doesn't want to be stressed either, but at least he's responsible for the slowup
 
2:04 PM
@SomeGuy If you haven't already watched it - youtube.com/watch?v=XfNt6MsLj0E
I bet $10 that this'll fancy you.
 
I like how the number of organizations, individuals, and technology is "approximate"
we're no longer dealing with whole number of individuals
We've gone to quantum development
 
@Neil or we have devolved into the autocratic era, approximately 4.2x 10^3 people had brain damage today in the Battle of Java.
 
@ShrekOverflow well that would explain why I don't remember that battle
 
@Neil Its an ongoing battle fought daily at the massive trenches of Outsourced development houses
I ran into a dev today who wanted to manage memory, in Java.
 
poor soul
He'll never be the same again
 
2:19 PM
@Neil nope.
In his youth he fabled with C, and even flirted with C++ but all is lost now.
 
He'll be forever wanding the halls of pipeline wondering if he should ever nop
 
2:32 PM
Hi everyone!!
 
@AntonioJiménez 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.
 
I have this number 0.000937869, and I would have the conversion to 9378,69e-7 (2 decimals without loss of precision). I tried to use toExponential() without luck.
Does anyone know any way to do it?
thanks :)
 
@AntonioJiménez Why not 9,37869e-4?
 
because I have to send 2 decimals to the server
 
But why?
This doesn't make any sense to me
 
2:41 PM
It is an external API. I can't do anything :(
 
Hi Guys,

I had a dicussion with my customer yesterday seems they are ok with integrating third party to convert html css stylng to pdf ...
 
one digit before the , is standard format
 
I am thinking of google drive API
 
If you're sending a number, surely this would work just as well
If there's specific formatting required, it seems like you're not sending the number you claim to be
 
No, I have an error when I send more than 2 decimals
 
2:43 PM
What error?
 
It is an api error where they say that the number can not have more than 2 decimals
 
Could it mean that it's expecting 9,37e-4?
 
yes, it's working, but I don't want to loss precission
9378,69e-7 is that I want to send
 
Why not 937869e-9, then?
That would seem simpler
 
yes, it's ok
 
2:47 PM
I'm pretty sure you won't find anything prebuilt to format this way, since it's such an odd use case
So you'll probably need to do it yourself
 
ok, thank you very much :)
 
Does anybody here use Deskmount for monitors?
 
hi, what a best way for get params from URL. like ?utm_source=facebook (get the utm_source value)
 
client or node?
 
client
 
3:02 PM
well there are multiple client AND node capable packages on npm
or you could just steal a fn off SO
there are many parsers there as well
which is to say, there is no built in mechanism in JS to do this. node has a parser util you can make do it, but otherwise it's a custom function / library
 
ok thank you, I thought use something like location.href
 
hi
location.search
 
I took the question from a 'parse a url I have as a string' and not 'parse the current document url'
 
but that doesn't work in IE
 
thanks! location.search get all params, but how get only one param?
 
3:12 PM
@KevinB neat
 
@KikeSanchezQ. that's where the parsing comes in
use a built-in function, a library, or a function you can find elsewhere
i linked to one a few minutes ago
 
ok @KevinB thank you very much I just saw it. Great!
 
@ShrekOverflow Right on the money :)
@ZachSaucier That's cool, man! :D
It's a useful freaking extension
 
user1596138
3:35 PM
@ShrekOverflow A specific mount or? I considered getting mounts so I could mount both my laptop and my main monitor at the same height
 
@LuckyKleinschmidt mount those mounts with mounts on top of mount everest after mounting your horse with a mount
:D
 
user1596138
My horse doesn't support VESA mounts
 
user1596138
I don't think anyway... Guess I could try
 
@LuckyKleinschmidt That's because you don't have an Apple horse, but their taking away the vesa mount port in the next version
 
@LuckyKleinschmidt I am going to go with it
 
user1596138
3:43 PM
Ugh. Apple this apple that all day today
 
user1596138
This year they will unveil some revolutionary stepping stone in mobile hardware: The stylus or something equally mundane
 
@LuckyKleinschmidt It's the ii. It's you buy apple owns it
 
user1596138
> This stream is best experienced on an iPhone, iPad, or iPod touch using Safari on iOS 10 or later
 
user1596138
Koolaid
 
oh yeah!
No one thinks it's good when a single or only a few companies control something, but when it's technology, they eat it up.
who wants to buy me this lol?
 
4:10 PM
const enc = new TextEncoder('utf8').encode(body);
console.log(enc);
const dec = new TextDecoder('utf8').decode(enc);
console.log(dec)
how come this doesn't give me back the original body?
it just prints
[object Object]
 
Does it also do that when you use utf-8?
 
my intuition says that body is an object. so when you pass that to encode it's .toString()'d and you just get that object's string representation
otherwise you'd probably need to show what the other stuff in your code is
 
user1596138
@Nerva You do get what you encoded lol
 
user1596138
As stated above
 
user1596138
body.toString() is [object Object]
 
user1596138
4:19 PM
Maybe you want to stringify it or something, idk. Not sure what you're expecting to encode from a HTML element
 
would Math.random() < Math.random() be 50% probability?
 
I'd say so
const res = { true: 0, false: 0 };
new Array(10000).fill().forEach(() => {
  res[Math.random() < Math.random()]++;
})
res
getting a 50/50
trying to prove it sounds pretty interesting
 
@towc sweet, thanks. It's more or less been 50/50 for me so far, but working with random numbers can be a real treat.
Lol, yeah. Probably have to use limits to prove it
 
what are you using this for?
@DavidKamer don't think so
 
A comodity market simulator
I'm building and explorable explainable for a client
@towc I honestly don't know. I do applied advanced math, but rarely anything theoretical that isn't only seen by me.
 
4:30 PM
random a,b uniform in [0, 1]
prove P(a < b) = .5

given a, P(a < b) = P(a < random) = 1 - a
avg a = .5
P(a < b) = 1 - a = 1 - .5 = .5
I think this is satisfactory
 
@towc Nah, that's easy
 
(and yes, I'm aware Math.random is [0, 1) or something)
 
given any pair of (different) numbers, the probability of the lesser one coming first is exactly 50%
So the only discrepancy is when they're ===
Assuming each generated number is independent, which is obviously an approximation
 
@towc the random number is pseudo random and attempts a distribution
 
Distribution isn't even important
 
4:33 PM
@KendallFrey oh, so it doesn't even matter if the numbers are uniform, or what their range is, or even how randomness is chosen, as long as you have the same chance for both generation methods on either slot of the pair
neat
 
@KendallFrey if the two calls are part of the same distribution?
 
Yes, as long as they're indistinguishable and independent
 
@DavidKamer are you going to be picky after I helped you out?
 
@towc no lol, I was just conversing.
 
4:35 PM
Harder question: What's the expected value of |a-b|?
Where a and b are uniformly random between 0 and 1
 
I just want to express that I thought it could be more complicated depending on whether Math.random() and Math.random() at the sencond call were part of the same distribution or different uniform distributions.
 
ooooh nice
expected means "most likely to happen", right?
 
uh no
mean
average
 
intuitively I'd say 0.25
let's see
 
I think 0.375
 
4:37 PM
@KendallFrey a-b could be expected as centered around 0 by a factor of n where n is the scale of the distribution?
 
@DavidKamer Yes but the question was |a-b|
aka abs(a-b)
 
I know lol
I was just pointing out the inner function's nature
 
@KendallFrey just so I don't sound insane, the expected value on a fair 6-sided dice is not 3.5, right?
 
if a-b was centered on 0 with an order of magnitude lower than a or b if a and b are derived from the same distribution, I would say that you would get the same result only the negative number reflected across the y axis
 
Oh, it's 1/3
interesting
@towc Wrong, it is
 
4:39 PM
don't spoil the proof plz
@KendallFrey oh, TIL
I seem to remember otherwise
 
is @rlemon on?
 
No he's been switched off to conserve energy
 
haha
So this isn't a JS question, but ill ask anyway.
 
how would I go about making a serial port available over the local network
so if i have something like /dev/pts/1 to ip:3000
 
4:42 PM
A server/proxy?
 
I want to access a serial device connected to my pi from anywhere on my local network
so open a port on the pi, and use socat?
basically bind a com port to an ip port
 
huh, I am getting 0.25
random a,b uniform in [0, 1]
find avg |a-b|

equivalent to
random m uniform in [0, 1]
random n uniform in [m, 1]
avg |n-m| = avg n-m, as n >= m
avg n = avg [m, 1] = 1 - (1 - m)/2 = (m + 1)/2
avg m = .5
avg n-m = (.5 + 1)/2 - .5 = .25
maybe I'm making some wrong assumptions
 
0.25 would be the expectation for a = 0.5
as soon as a moves away, the expectation rises
 
trying to think of an easy way to see what the distribution actually looks like
I guess I need to canvas it
but urgh
 
a histogram would work fine
 
4:53 PM
@KendallFrey so a gui, regardless
that I'd need to partially make myself
 
done
1000 data points
 

« first day (2888 days earlier)      last day (2075 days later) »