« first day (3419 days earlier)      last day (1521 days later) » 

5:06 PM
I hate racist blokes telling tasteless jokes, and explaining where people belong
I hate ignorant folks who pay money to see gigs and talk through every fcuking song
I hate people in nightclubs snorting coke and explaining where you're going wrong
I hate pointless status updates on Facebook -- FYI, we were never "m8"
I hate fussy eaters who cook them fajitas, they only eat pizza and chips
I hate stepping outside for a smoke and some guy coughs like your lungs are his
I hate the X-Factor for murdering music, the bunch of money-grabbing pricks
I hate them magazines aimed at insecure teens, that make ten-year-olds race to grow up
 
5:22 PM
</rant>
 
5:33 PM
guys I'm trying to test something and I need a public media source
something that'll serve an mp4 video (any mp4) with CORS enabled
need to be able to XHR the video
unrelated, why is Codepen so freaking heavy? it always pushes my computer to 100%
 
it's the NSA
 
must be
any ideas for the mp4 source?
tried archive.org but their media aren't cors enabled
 
need it to permit it
I'll try that one
 
> Access-Control-Allow-Origin: *
should be good
 
5:43 PM
mixed-content error, let me try with https
that did the trick!! thanks @JBis you've saved me
 
np :)
 
I am dealing with one of the most elusive web bugs of my career
and it isn't even for work
 
fun, what is it?
 
it seems to randomly start and stop occurring, even without any code changes
has to do with loading videos from object urls
give this a go:
when you click "Add Media" it'll download that BBB sample video to an IndexedDB database
then when you click "open" it should open the video, and it probably will
by "open" I mean the play button in the corresponding row in the table
but sometimes if you re-run the codepen and try to open it again, it'll give an error and fail
and when that happens it will continue to fail consistently, often until you wipe the database
and it's not due to the media getting corrupted because it happens with the same blob in the db
 
hmm
 
5:58 PM
an hour ago I couldn't get this code to work and now I can't get it to stop working
and there were no code changes
 
caching
 
it's definitely something to do with caching
because the problem never happens in incognito
90% sure it has to do with the browser holding onto object urls
 
In the past, had to throw a random value on querystring to bust the cache
 
its working for me or i mean never not working
 
but I can't count on being able to revoke the object urls so it's tricky
yeah I can't get it to break right now. argh
this is why I call it an elusive bug
 
6:02 PM
oh now its not working
 
Can you add a rand value to the URL's? https://myurl.org/video=abcd?rand=kj5jjk
 
> VIDEOJS: WARN: The element supplied is not included in the DOM
 
nah that's a different error
reload the page
it's because videojs and react don't play well together
I've now added a warning for that
it happens when you try to re-render the video component. you have to instead rerun the pen
 
oh i see
 
I know how to circumvent that problem but it requires a lot of code so I'm leaving it out of the mvce
the error we're looking for is "The media cannot be played" or something like that
the video will show a black box with an X in the middle
 
6:04 PM
do you get another error in your console?
 
ah I got it. yeah
 
can you reproduce out of codepen?
 
the original problem was not on codepen
just wrote the mvce in codepen
 
ok, just making sure
can you add a breakpoint somewhere? inspect the data coming in?
 
I mean it's binary data, there's only so much inspecting to be done
if the video plays successfully at least once then I know the idb row is not corrupt
 
6:08 PM
Yes, but my guess is it is not getting the data from the db (when it errors)
if its getting data it will probably get the proper data, but it is probably getting empty data
 
well I'm logging the object url to the console
hmm one sec
 
Hello all ,
Please help me I am trying to fix my issue and hardly working it on from 3 hours but still I am stuck and didn't figure out

https://stackoverflow.com/questions/60398362/how-to-set-textinput-above-of-the-keyboard-in-react-native
 
aaand the object url works
so it's definitely reading the whole blob properly
 
hmm, i've loaded in chrome and firefox like 10 times without issue
 
yeah I can't seem to repro with that particular sample video
 
6:12 PM
can you send the one you can produce with?
 
Not one I can share, only a link to someone else's GCS that charges them every time someone uses it
give me a sec
 
well thats interesting
could you curl and post headers?
and are you able to reproduce on another browser?
 
< HTTP/2 200
< x-guploader-uploadid: AEnB2UoSYHZkzNry3deRYyaqXVUjC3GcZzQ2yAEOe-MHRWKb2mXWtyNV0QO8h-F-yLzUzhO6Vpter3WZXXf8mDSJX4nDNLnXHw
< expires: Tue, 25 Feb 2020 18:14:20 GMT
< date: Tue, 25 Feb 2020 18:14:20 GMT
< cache-control: private, max-age=0
< last-modified: Sat, 01 Feb 2020 08:10:26 GMT
< etag: "0de853989015720384ed29be3f874dd0"
< x-goog-generation: 1580544626940394
< x-goog-metageneration: 1
< x-goog-stored-content-encoding: identity
< x-goog-stored-content-length: 567209
< content-type: video/mp4
haven't tried lol
not sure I want to add that factor into the mix, but it's a good idea
 
hmm
> Cache-Control: public, max-age=3600 vs cache-control: private, max-age=0
but that shouldn't cause any issues
 
no it shouldn't because it only makes the network request once
 
6:17 PM
exactly
 
it saves the response to the local idb
augh
 
user12960916
Hi this is my first time using the chat rooms, can some tell me if anyone is allowed to ask a question or if we can only answer the ones people are talking about in the chat? Thanks!
 
what encoding is used for that video?
 
h.264
same as the sample
 
yeah thats standard
@csscoder ask away and welcome o/
|| welcome csscoder
wonderful james
 
user12960916
6:19 PM
I wanted to know if there is a way to display which button is clicked
 
|| formatting csscoder
 
@csscoder Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
at least that worked
 
|| welcome csscoder
 
@csscoder 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.
 
6:20 PM
did you reset him
 
user12960916
oh sorry
 
yeah not sure why he stopped working
 
I'm not sure this will work in an event handler like that
 
1 message moved to friendly bin
 
friendly bin, I like it
brb
 
6:23 PM
@csscoder Repost your code but please format it
 
user12960916
<html>

<body>
     <script>
   var clicks = 0;
   function clickME(el) {
   el.disabled = true;
   clicks += 1;
   document.getElementById("clicks").innerHTML = clicks;
}

    </script>
<p>Clicks: <a id="clicks">0</a></p>
<button type="button" onClick="clickME(this)">Button1</button>
<button type="button" onClick="clickME(this)">Button2</button>
<button type="button" onClick="clickME(this)">Button3</button>
<button type="button" onClick="clickME(this)">Button4</button>

    </body>

</html>
In this code I have 4 buttons. When they are clicked the total number of clicks get displayed. Now i
 
Great!
 
OKAY I have a link that reproduces the problem
try adding this as a media url:
never mind url is too long. sigh
 
Url shortner ?
 
I'm just baking it into the pen
okay reload the pen
 
6:29 PM
hello
 
@Student404Mus 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 just want to ask about linux bash history?
 
Now here's the trick: Open it in Incognito and it will work
go for it @Student404Mus
 
that's is lol
how to see previous edits of clients...
It may take some time but I try to explain. here is the question...
 
<html>

<body>
	<script>
		var clicks = 0;
		function clickME(el) {
			el.disabled = true;
			clicks += 1;
			document.getElementById("clicks").innerHTML = `Clicks: ${clicks}; button: ${el.id}`;
		}

    </script>

	<p>Clicks: <a id="clicks">0</a></p>
	<button id="1" type="button" onClick="clickME(this)">Button1</button>
	<button id="2" type="button" onClick="clickME(this)">Button2</button>
	<button id="3" type="button" onClick="clickME(this)">Button3</button>
	<button id="4" type="button" onClick="clickME(this)">Button4</button>
@csscoder here's an idea ^
 
user12960916
6:36 PM
Ugh I'm almost out of battery, I'll try this when I have a charger with me. Thanks! Also a little confused on how these chat rooms work, is the chat room itself always here? I just hope I can come back if I run you're example and have questions incase I don't understand something.
 
user12960916
*your
 
Let's assume we have an ssh account over the internet.
Both users, X and Y have access to an account called Z.
The user X made a change to file called A.txt located in Z. The user Y came at a late time to see what X had made to the file A.txt. Is this possible, i.e., does the user Y have the ability to do that?
 
@csscoder yep the room is always open
 
user12960916
Alright thanks
 
@Student404Mus Note that unless they edited the file with ed or cat this has nothing to do with bash history
also note that there is no notion of "accounts" on Linux, there are only users
so if two people can log in as the same user, the machine cannot differentiate between them
 
6:39 PM
ok ok
that's what i meant exactly
 
anyways, no matter the user configuration, file revision history is not typically saved unless you specifically set up something to do that
you can see in the bash history that the file was opened, but bash history is not meant to be a secure log. It's trivial to execute a command without it being logged to the history file.
On Ubuntu that's as simple as prefixing the command with a space
 
@forresthopkinsa still not getting an error
both chrome and firefox
 
even with that signed url?
clear the table, re-run the pen, add the signed url to the db, play it, re-run the pen and play it again
 
works for me
 
you're not in incognito right?
 
6:53 PM
nope
 
aaahhhhh
 
reinstall your os
nah, just get a new comptuer
 
it's getting to that point
I just saved the pen try refreshing it
 
Thank you @forresthopkinsa
 
what chrome version are you on? and os?
@Student404Mus no problem
 
6:54 PM
also, on safari (idk if you need to support) i get
media add err: OpenFailedError: SecurityError IDBFactory.open() called in an invalid security context
 
I think that's just a codepen thing
 
what if the other user set that already?
how do I know about file revison?
 
in the actual app it's not running in an iframe
@Student404Mus you won't know about file revisions except for seeing the "Date Modified" field in the directory listing
if you want revision history you'll have to find a software for that
 
I see
 
Mac: 10.15.4 Beta (19E234g)
Chrome: 77.0.3865.120
Firefox: 73.0.1
 
6:58 PM
your chrome is outdated
can you try updating to 80
^ this is the bug in action
 
updating...
if it errors work on 80 than it maybe a bug
got the error on 80.0.3987.122
might be a browser bug
 
I ran it on 82 (Canary) with no bugs, 80 also errored - if that helps
 
82 no error?
 
No error, using the same process on both
 
@forresthopkinsa I think you have found a browser bug
can't reproduce on older versions, can't reproduce on latest firefox
which super sucks cause you can't fix it
 
7:38 PM
@Cameron Oh gosh thank you for testing Canary
I'll file a Chrome bug
@JBis Such a relief to hear that
 
Canary is my main browser at work, so no problem
 
if it's fixed in Canary then I probably don't need to file a bug but I really want to know how to fix it for C80 users
 
But we still don't know what produces it
What's the signed url exactly?
And why should that make a difference when it's stored in a db
 
Also 81 will probably be released next month, is it worth the effort to fix it?
 
Yeah :/
@JBis I have no idea and that's driving me crazy
This bug breaks my whole app
The signed url is just a GCS link to a file, the signature itself is not the cause
I can reproduce it on localhost without GCS
I'm just using a GCS signed url because that's the only feasible way to link to the file from codepen
It's not just this file either, it's all the h.264 files I've transcoded
 
7:45 PM
So why does it only occur with specific links????????
so weird
 
I hypothesize that the Google BBB sample was progressively encoded and mine is not
That might be the difference but I have not tested that
Also: why doesn't it happen on Incognito??
 
You'd see it in the video if it was progressive
 
I wouldn't expect it to make a difference since the whole file gets buffered anyway?
How would you see the difference
 
Nvm I'm thinking of interlaced
 
7:50 PM
your app is interesting tho
is there a way to play it while its downloading in the background? Or would it have to be two separate requests?
 
what does (for of )give you vs map?
 
|| mdn map
 
|| echo np
 
7:53 PM
np
 
I don't think there's a feasible way to progressively stream data through IDB to an object url
 
8:13 PM
hmm we've inherited some new codebase, which is really sweet modern code: it just uses all different libraries than we use.. Like "sequelize instead of bookshelf", I wonder if there is value in moving to a single library codebase - or if it's actually better to stay on top of multiple solutions so you forcibly prevent vendor lock.
 
8:26 PM
Hi all ,
please help me in this question . Thanks
https://stackoverflow.com/questions/60402611/how-to-focus-second-field-when-click-on-next-button-in-react-native
 
user12960916
<html>

<body>
	<script>
		var clicks = 0;
		function clickME(el) {
			el.disabled = true;
			clicks += 1;
			document.getElementById("clicks").innerHTML = `Clicks: ${clicks}; button: ${el.id}`;
		}

    </script>

	<p><a id="clicks"></a></p>
	<button id="1" type="button" onClick="clickME(this)">Button1</button>
	<button id="2" type="button" onClick="clickME(this)">Button2</button>
	<button id="3" type="button" onClick="clickME(this)">Button3</button>
	<button id="4" type="button" onClick="clickME(this)">Button4</button>
 
user12960916
Hey forresthopki, I had a question about the button example you sent earlier. There was a part of the code which I didn't understand.
 
user12960916
Why do you need the ${} around the clicks? Is that the same as when you print an index like this: [0]? Like if you wanted to get the thing at position 0?
 
|| mdn template strings
 
8:29 PM
@csscoder ^
 
Zac
does a video file have to be in base64 to be uploaded in a multipart form to be uploaded to a server?
 
@Zac 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.
 
@Zac no
 
user12960916
Thanks JamesBot
 
Zac
then why aint it working jbis
i am confusion
 
8:31 PM
because it doesn't wanna
 
Zac
it never does when im coding
let me try it again
 
maybe if you provide some code we can help
 
Zac
i got it to work, it was a typo.
thanks tho JBis, couldn't have done it without you
 
lol
 
user12960916
I read the link and since I just started learning Javascript, when I refer to code it's easier for me to remember what the code means if I see () since I'm not used to the ${} because that's what I used in my intro Java classes. I tried following this example they had:                                                                                                                                                                    let a = 5;
let b = 10;
console.log('Fifteen is ' + (a + b) + ' and\nnot ' + (2 * a + b) + '.');
 
user12960916
8:44 PM
These are the changes I made to my code:
 
user12960916
//document.getElementById("clicks").innerHTML = `Clicks: ${clicks}; button: ${el.id}`;
            document.getElementById("clicks").innerHTML = ("Clicks:" (clicks) + "button:" (el.id));
 
user12960916
But when I run this new line it's not running the same way
 
user12960916
Could someone please tell me what I'm doing wrong?
 
err
well
it's invalid
document.getElementById("clicks").innerHTML = `Clicks: ${clicks}; button: ${el.id}`;
is correct
 
user12960916
In the example the used ' ' and () which I also used similarly, could you specify which part is wrong in the other way or is the whole thing not valid?
 
user12960916
8:47 PM
*they
 
but document.getElementById("clicks").innerHTML = ("Clicks:" (clicks) + "button:" (el.id)); is syntactically incorrect
 
user12960916
oh ok
 
"Clicks:" (clicks) in particular
the () isn't necessary (but isn't a problem), what you're missing is a concatenation operator
+
 
user12960916
document.getElementById("clicks").innerHTML = ("Clicks:" + clicks + "button:" +el.id);
 
"string" + somevar + "string" + somevar etc
 
user12960916
8:49 PM
Like so?
 
yup
 
user12960916
Makes sense, thanks
 
but the previous version should be preferred in modern code
 
user12960916
Just wondering, is there a reason why?
 
shorter, cleaner, less work
more powerful
 
user12960916
8:50 PM
Powerful?
 
you just get a lot more options with template literals
string concatenation works, always has, but with template literals you just inject the variables directly into the string, no concatenation needed
supports multi-line too
 
user12960916
Oh, thanks for explaining!
 
also it looks cool `` and clean
 
there's also... tagged template literals, but i've never messed with that
 
Zac
` my better ${string}! `
 
9:21 PM
don't use tagged templates
 
10:05 PM
why does typeof JSON.stringify(undefined) return "undefined" instead of string?
 
because undefined isn't a string
 
user12960916
Does anyone know a good website where I can read about how to do searched in an array of objects in Javascript? For example if you have multiple names on a page and start to type Sa then all the names that start with Sa will start to show. I found this linkhttps://www.geeksforgeeks.org/javascript-array-filter/ which I read but there only doing things like getting the even numbers or odd, but I want the search bar for the user so they can type and then searches are filtered
 
!!mdn array.filter
 
user12960916
Thanks!
 
10:16 PM
> Filtering invalid entries from JSON
wow
MDN is literally calling an array of objects json
 
well I mean, that is javascript object notation
 
10:33 PM
hmm does anyone know of another library for sql query building, other than knex?
I'm having so many problems due to knex queries being mutable (and no easier way to copy a query, so you have to mutate it).
@KevinB Well yes, but why can't json stringify "undefined" values?
Like why does JSON.stringify({b: undefined}) return {}
 
Why should it return a property that has no value?
The JSON spec doesn't allow for undefined values.
 
ow
So it's not a way to truly stringify/hash a POD for javascript :(
 
@KevinB Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
it's a blockquote.
lol
 
1 message moved to Trash can
 
10:39 PM
Bot sees { and } so it thinks the stuff is code :P
 
hello world!
 
@RazaChishti 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 there any way to get real-time rates of gold and other precious metal in a website?
 
it sounds like you're looking for a public API
 
anyway, what i was gonna say is there ahs to be a value, and none of the values would be... acceptable for undefined
"undefined" is a truethy value
false is !== undefined
null is !== undefined
it would be basically impossible to json.stringify/parse safely while expecting the source to match the end result
unless... they added the undefined token
 
10:47 PM
But right now the JSON.stringify -> JSON.parse cycle doesn't give the same object prototype, and thus I either have to be very fuzzy in my typing or just ignore any advantage of typing the moment I use json.
t={b: undefined};
JSON.parse(JSON.stringify(t)).hasOwnProperty('b')
JSON.parse(JSON.stringify(t)).hasOwnProperty('b') !== t.hasOwnProperty('b')
 
you might be able to do some magick with the replacer/reviver functions
 
@KevinB oops I'll make it not delete for ROs
 
i wonder if it'd make sense to just have it ignore blockquotes
anything that starts with >
 
What's the trigger for code anyways?
 
the reasoning is if it's a block quote, it can't be a code bock
 
10:56 PM
Why is the world such a bad place :(
1
Q: npm install on synology gives zlib invalid distance error

paul23Well while this isn't ideal (yet) we're currently running a build script through synology. Part of build is of course installing all packages. However at this point a lot of errors happen. We install using: npm ci --only=production (though same results with npm install). And the following error...

if people would be just nice and update their software the world would be a much happier place.
 
$$
In my projects i actively avoid including modules that i don't absolutely need
 
@KevinB yeah that too
Although if someone is quoting code I'd rather them format it as code rather than quote
 
I don't think the chat format parser can handle code in quotes?
 
> code in quotes
 
oO magic? Do you first add the 4 spaces or add the spaces after the quote sign?
 

« first day (3419 days earlier)      last day (1521 days later) »