« first day (3050 days earlier)      last day (1896 days later) » 

12:14 AM
it seems like there hasn't been any progress with the AV1 encoder
which is unfortunate
 
12:55 AM
morn!
 
afternoon @Tavo :)
 
 
1 hour later…
2:12 AM
pastebin.com/raw/70CF1M7E how i can get the value of play_url from this json?
I did this:
var i = JSON.parse(data);
console.log(i.streams);
Result: [{…}]
 
2:32 AM
running Object.keys(jsonData) returns:
["thumbnail", "iframe_id", "allow_resize", "streams"]
it's in streams
access it like this: const {play_url} = i.streams[0];
if you need to access all the members of that array:
const play_urls = i.streams.map(j=>j.play_url);
 
 
2 hours later…
4:32 AM
Hey, guys, I am looking for a solution and I don't know where exactly ask this. My friend got an assignment to use Google search api to create a task to search hotles in particular city based and in case user wants to search within the city near by his location then it should search like that too. Can anyone help me out to find out the solution on any site or blog. Till now I got nothing from google, may be I am not using right keywords to search
 
@DavidKamer I was looking on that too but I couldn't figure out wether it will help me or not, let me check it propery, Thanks. :)
 
@avirk I think that's what you're looking for, but you might want maps api.
 
5:21 AM
Can someone help me figure out what I'm looking at:
gulp.task 'build', () ->
  gulp.src 'build/**/*.html', {read:false}
    .pipe parcel({outDir: 'dist', publicURL: './'}, {source: 'build'})
    .pipe gulp.dest('dist')
 
 
3 hours later…
7:59 AM
hello
 
8:47 AM
Hiiiii
 
@PawelFlajszer 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.
 
Just to make sure I get it right... if I have an array of objects name "dogs", can I access a single element by calling "dog"? does JS know the difference between singular and plural when it comes to names (strings)?
I assume it must be using some sort of dictionary and it only works if it finds it there
 
wtf
if "dogs" is an object you have to access the elements by dogs.element_name
 
so I must be wrong. ok let me give you an example
 
except you meant dogs.dog, which is correct
ok, better with an example
 
8:55 AM
godddd
can't bloody share it hahah
trying to with codepen but where the hell is the sharing option ;<
so most of it is just a sample array of objects called "contacts" the last line is what interests me
I'm accessing the array by using contacts.map which is fine, but then in brackets
"contact => contact["first name"])"
why does this even work?
 
because it's correct
what is suposed to not work?
do you know what arrow functions are?
> contact => contact["first name"]
is the same as
> function(contact) return contact["first name"]}
 
I've just moved from C
all I know is that if you misspell name it just won't work
here you're able to singularise a name and it works
 
just wondering how?
 
what do you mean by singularise
you're not singularising anything
it's an arrow function
that line of code is the same as this
 
9:02 AM
contacts (name - plural)
 
> x=> x["first name"]
try that
 
contact - singular, not defined
 
it will also work
 
well, yeah, I'm sure it will work
 
it is defined since it's the parameter of the anonymous function you just ddefinend
just take a look at the arrow function link I sent you
 
9:03 AM
thanks, I've been there before
 
do you understand that .map(function(contact){ return contact["first name"]}) will also work?
 
I do indeed
 
so, as I said, that's the equivalent of .map(contact => contact["first name])
because that's how you de fine an anonymous function as an arrow function
and it's implemented in the javascript standard, AKA ecmascript
x=>x+1 is the same as function(x){ return x+1 }
it doesn't have nothing to do with singular or plural
 
I'm not sure do you understand my question
contacts.map(contact => contact["number"]) will work
 
you don't understand why you can define a parameter "contact" that takes the value of each element in your array?
 
9:07 AM
contacts.map(abcdefg => abcdefg["number"])); won't work
 
it should
 
it doesn't though, it says it's not defined
shite
my bad ;-)
 
double check it's the exact same name
 
I was placing both different names like A MUPPET
for a quick test
thanks man, i'm just being stupid
 
!!giphy fail
 
@rlemon
 
just pretend it never happened xd
 
user8444404
9:34 AM
0
Q: Shadow/Flash displaying when dragging image

vickey colorsWhen user upload image and when he try to drag the image , the image will display flash / shadow along with dragging, but i don't want to display the shadow.... codepen : https://codepen.io/kidsdial/pen/xMNbVz $(document).ready(function () { // dont have a webserver so ...

 
10:54 AM
Wondering... In React Native I obviously have to change the state regularily. Now I am starting to get testing done now that I have time (I focused on the code first because I had a pretty strict deadline I had to get) I guess it would make sense to have the state-altering functions return the new state and then have a method that takes a function to actually alter the state which I can then call in the appropriate places instead of altering the state from those functions directly.
However I am not super sure because I have not done a whole lot of testing but as void functions are generally
 
 
2 hours later…
12:31 PM
Are class properties initialized before or after the constructor has run?
 
12:49 PM
hi :-)
 
@paul23 During the constructor, after super().
 
1:26 PM
oh great, the moment you are looking for a solution of a problem for quite some time. And you think "yes I found a so question". Only to notice it is your question without any replies.
 
 
2 hours later…
3:20 PM
Hi, so actually this is an odd request as I'm sure I have the right answer but I need advice on how to properly debug. I'm having issues getting this code to work and I'm sure it has to be related to something else in my codebase. The issue is I'm not sure what and I need advice on how to debug properly
This was my question a while back: stackoverflow.com/questions/54672811/…
I'm not looking for an answer
I need debug/troubleshooting advice only
Please let me know what I can do to properly investigate what could be the underlying isssue
 
Hi
I cann't understand the difference between the onmouseenter vs on mouseover events both they gives me the same response for me
 
@Euridice01 That code should just work
So, the most likely explanation is that jQuery isn't being loaded properly.
 
the edit tells me there is a typo somewhere
 
hi, is there a way to serialize a object to a json array? at the moment i do JSON.parse(data.replace(/&quot;/g, '"')) but don't feel safe with the data replace
 
if jQuery didn't load, there would be ref errors.
@tahtoh JSON is a string data format. JSON.parse will not result in JSON anything
 
how can i do it then to result directly to a json array, my input resembles this "[{\"SeqFlux\":0,\"Actif\":true}]"
 
3:38 PM
JSON array isn't a thing is what I'm getting at.
 
@tahtoh: You mean an array that JavaScript can use? That's just an "Array"
 
so you have a string of broken JSON and you wanna parse it into an object?
 
yes
i can have the object directly too
 
so then what is the issue?
 
the broken json was just me using Json.encode
i want to create an array out of that object
 
3:40 PM
replacing &quot; with " doesn't make an array tho
 
Let's take a small step back: Where are you getting the data from, and what do you want to do with it?
 
@Cerbrus jquery is loaded properly. I even added a CDN link.
And the odd thing is even without jquery, i used regular javascript, it doesn't work
so something is up
but I'm not sure what
 
I'm pretty sure there is a typo in your ID
that's almost the only explanation
 
No it's right
I double checked
I'm like 100% sure the code is right
 
@Cerbus from my view i send the Object a list of object, i want to take that list
 
3:45 PM
I'm not looking for an answer but debug possibilities
Like I want to understand the DOM better
 
and transform it to a valid json
 
or how the page finds elements
 
@tahtoh View? What language?
 
I think maybe there's a mismatch of when the element gets added to the page and when the code runs
or something like that
 
@Euridice01 If you enter $('#formId') in the console, what does it show you?
 
3:46 PM
im using asp.net
 
It shows me the object
 
with jquery
 
so I tried to use the console
and when do I the above and submit
it works!
Like if I enter the code above in the console manually, it works
but not automatically
 
Okay, so you have a class / instance in ASP.net that you want to transfer to your JS code, @tahtoh?
 
yes
 
3:49 PM
@tahtoh: Maybe this can help? stackoverflow.com/a/41477203/1835379
@Euridice01: I don't know what to say. The code in your question should work just fine...
 
@Cerbrus doing that
generates exactly
what i linked
not valid json
but a string representation
 
Hello
How do I extract the value of a promise from an array of fulfilled promises?
Each array element is a fulfilled promise which has inside of it two items. PromiseStatus and PromiseValue
how do I get PromiseValue?
 
@J.L.Louis promiseArray.map(p => p.PromiseValue)?
@tahtoh and the accepted answer's method, using JavaScriptSerializer?
 
promises[0].PromiseValue is not a thing
it's undefined
 
@J.L.Louis Then this isn't correct.
 
3:56 PM
> Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: foo}
if you're seeing this, those are not actual property names
that's the status of the promise
 
that's exactly what i'm seeing @rlemon
 
okay, you access the value by awaiting it or accessing it in a then
you don't access the value directly from the returned promise
 
promiseArray.map(p => await p)?
 
In debugging mode I can expand it and see the actual value
so I know it's there
 
@Cerbrus Promise.all
but sure
 
3:58 PM
Oh, yea.
 
@J.L.Louis yes, it's there.. in the promise.
 
Can you tell I never work with promises? xD
 
you have to await it, or use it in a then
 
@Cerbrus i know that's what makes it hard but if something like this didn't work for you. What would be your troubleshooting? Like besides checking the value in console. Is there anything else I can do?
 
3:58 PM
the only two options are await or .then
 
the promises has already been fulfilled
as you can see, they're 'resolved'
so the value should be in there, right?
no need to wait for it..?
Apologies if I sound insane, I'm new to JS
 
@Euridice01 1: make sure the script loaded. 2: make sure scripts are running in the right order. 3: check if the jQuery selector gets any results.
 
@J.L.Louis not* pending just means you can probably resolve the value out now.
the promise object is still a promise object
you still have to use .then or async/await to pull the actual values.
there is no other option when using promises.
it's how they work.
 
I see
So I have this list of fulfilled promises
 
"Resolved" means "I have the value ready for you, when you want it". await more or less tells the promise to return the value when it's there.
 
4:00 PM
^
 
@Cerbrus
 
if you have an array of promises, regardless of the state, you can use Promise.all to resolve them all to values.
Promise.all(arrayOfPromises, values => {

});
 
@Cerbrus ah I see
My code as of now is
   await Promise.all(promises).then(() => {
        console.log("Promises fulfilled!");
        for (let metric in metricsEndpoints)
        {
            metricsDict[metricsEndpoints[metric]] = promises[metric];
        }
I've already use the Promise.all to wait for the fulfillment of the promises
now I'm trying to transcribe the value of the promises to a new dictionary
but the Promises themselves are being copied, not their values
 
No
 
4:05 PM
so I've already use Promises.all(promises.then()..)
 
You're mixing up concepts
If you already are using async/await
Just const values = await Promise.all(promises)
 
@rlemon, that worked! Thanks!!!
 
Having issue
 
@Cerbrus yes even with that it doesnt work
 
@tahtoh what do you think JSON is?
 
4:11 PM
I am making a function that will get the content-length of a url based on the head request.
Here is a test example with SO:
var http = require('http');
var options = {method: 'HEAD', host: 'stackoverflow.com', port: 80, path: '/'};
var req = http.request(options, function (res) {
        console.log("in the request");
        console.log(JSON.stringify(res.headers));
    }
);
req.end();
 
a format for js data
 
When I run it in node directly it works perfectly, however when I put it into react/electron application most of the headers are not there.
 
it's an encoding for data similar to JS Object notation. but it's all one giant string.
that's the point
 
I can't figure out why this is like this. I know that's very vague but I can try to answer questions.
 
so this statement is kinda weird.
is the string valid json or not?
 
4:14 PM
@rlemon yes i know but still in my case i need the array without the keys of the object being in a string
[{"x":"y"}] needs to be in my case [{x:"y"}]
 
umm
those are the same object
 
still
in datatables
 
the second is not valid JSON, both are identical as far as an object is
 
it doesnt accept the first
 
nahh, that's impossible.
{"x":1} and {x:1} are identical objects.
 
4:16 PM
well not accepted in datatables
which makes me wonder what i need to do
 
well that's not the issue. they are the same object as seen by JS
 
data: [{&quot;IdFlux&quot;:null,&quot
this is what
is generated
by
string json = JsonConvert.SerializeObject(datalist);
datalist is the list of object
 
well that's not valid json
&quot; isn't "
it's an entity representing that.
 
well its generated by the convert
or Json.Encode
they all generate the json with quot
 
well that's wrong. fix that on the server
not the JS side
 
4:21 PM
when im doing this
            string json = JsonConvert.SerializeObject(datalist);
its server side
 
yea, not my forte. but if that's outputting entities for quotes,
 
these are the only headers I get when running from electron/react {"cache-control":"private","content-type":"text/html; charset=utf-8"}
 
you wanna correct that
 
4:34 PM
@rlemon This is my trial code I still doesn't see the difference btw onmouseenter & onmouseover events jsfiddle.net/m763ratx
 
the example code I linked you explains it
the comments and the outcomes
1 hour ago, by rlemon
@PHPFan https://developer.mozilla.org/en-US/docs/Web/Events/mouseover#Example
continue to look at that example. it's designed to outline the difference.
 
alright
 
do you also know how to stop a ajax call from submitting even if it's just a ajax call to load a partial view?
 
like, stop one that's already started?
 
cause if i send the ajax call with the validations, when partial view is reloaded with the ajax call it shows the validation errors
i don't want to validate
 
4:45 PM
...
 
except if the field had the error before posting with ajax
 
4:58 PM
Quick question about nodejs
Is async.parallel really parallel (as in simultaneous) ?
It is my understanding that nodejs is single threaded.
 
yes and no
The javascript that starts all the async actions runs syncronously, all javascript runs synchronously. but, it fires off actions, such as http requests, one after the other without waiting for the prior to complete, thus having them working in parallel
 
I understand that the actions themselves are async, but there is this add-on library 'async' (let async = require('async')) which has this parallel function. Does it actually execute its parameters in parallel
if not, what is the purpose of this library?
 
?
 
since nodejs executes things in async anyway
 
it serves the same purpose as promise.all
that's it.
it allows you to run code once they've all completed
 
5:04 PM
ah, so there's no point in using async.parallel if I'm already using promise.all
 
yeah i don't see much purpose in the async library anymore.
 
okay follow up question:
 
There was a time in the past when it was a lot more useful, when promises weren't as supported
but even then you coulda included a promise library instead
 
I am performing 10 request using a for loop, and waiting for them with Promise.all, I notice that they are returned sequentially
Is there a way to 'fire them off' simultaneously - to improve performance?
 
It sounds like you're already doing that
You're not using await are you?
 
5:06 PM
no, just Promise.all(<array of request promises>)
 
Yeah, so they're already being ran simultaneously
 
but the for loop is iterating through a list of urls
 
promise.all does some magic to ensure that the results are returned to you in the correct order
(the order the promises were passed in)
 
I measured the amount of time it takes for one request to return (about 1 second), it takes 10 seconds for 10 of them to return - doesn't that indicate that they're not really being done in parallel?
 
maybe.
but, it could also mean the backend you are sending requests to isn't handling more than one request at a time
 
5:09 PM
hm
interesting
lastly, what are those (\things) called
I've been calling the 'endpoints' - is that the standard term?
 
example?
oh
yeah, endpoints is fine
 
url.com/thing1, url.com/thing2
Now i have two 'endpoints'?
is that the common term?
 
endpoints, routes, urls, i don't think there is a common term
 
Ah, understood. Thanks!
 
5:24 PM
urls/routes could be different than endpoints
or maybe just urls
bc you could have: example.com/user
and a get, post, delete and update route associated with that url
*put not update
route or endpoint... I guess
 
Hi i'm getting a different kind of error in angular material can any body help ?
 
@atulkumar 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.
 
route is the only term I'm unsure of as far as how to apply it, so i just use it to describe client side routeing at this point...
 
my usage varies based on context
 
yeah, I do the same
 
5:31 PM
Route when talking about the app i'm currently working on, endpoint on targets, urls for everything else
 
that seems reasonable
I think URLs or URIs are the only thing that are technically separable though.
but I tend to think of routes as both endpoints and urls, and api endpoints not as urls per se
 
compiler.js:2427 Uncaught Error: Unexpected value 'DecoratorFactory' getting the following error in the angular input
 
user8729657
6:10 PM
@DavidKamer, does react have a learning curve?
 
I think so, but if you don't try to learn React as anything but a view library (i.e. manage your expectations of what it does by itself) React itself isn't that hard to learn
 
user8729657
I'm still new to it, but from my understanding is that these components are small applications that run in the even loop so instead of reloading the page to display new updates it just handles it with states
 
user8729657
i think
 
user8729657
im not sure what states are yet
 
that's an interesting conceptual way to look at it. Basically the render is handled at the component level meaning that when you change the state of a component, the view for that component changes. You can pass down props to the children components, making it so that they share state with the parents.
8
Q: React: Do children always rerender when the parent component rerenders?

Gabriel WestIt is to my knowledge that if a parent component rerenders, then all its children will rerender UNLESS they implement shouldComponentUpdate(). I made an example where this doesn't seem to be the true. I have 3 components: <DynamicParent/>, <StaticParent/> and <Child/>. The <Parent/> components a...

but 90% of the stuff like this is unnecessary in most applications. You only need to know how to accomplish stuff and not why it works that way beyond a good conceptual foundation. This stuff usually comes after you have a good idea of how a "virtual dom" works.
you can probably get away with knowing componentDidMount, componentWillUnmount and render and build almost any application. Knowing the other stuff just makes it better.
 
user8729657
6:25 PM
I understand, I wanted to just use this framework for my UI to my online weed store. semantic-ui.com/usage/layout.html and write a few things using react
 
getting ready for private sale?
I thought they hadn't announced a date yet
 
user8729657
Who cares :)
 
well, when there is legal options available... lots of people
> the goal of having private stores licensed and open for business by April 1, 2019.
so April 1st is the goal.
lets see how piss poor the pc's do with it
like the entire rollout so far :(
 
user8729657
LOL
 
user8729657
I just wanted to sell some apps, and open my own shop online @rlemon, and aren't you the one that has a front end Javascript portfolio online?
 
user8729657
6:31 PM
id like to take a look if you have anything please
 
I mean, I have a personal website. but it isn't really a portfolio.
I don't write small sites I can show off.
I work for a company that does automation control for the agri industry
 
user8729657
Ah, link me I'd like to see some cool stuff
 
rlemon.ca
but again, it isn't really a portfolio
just something to fill the space.
 
user8729657
This ones dope, I'm taking it XD codepen.io/rlemon/pen/wpnyG
 
user8729657
that will be like for my landing page for my shop
 
6:57 PM
I can't really help at all bc the Indiana State Police are practically a gestapo about weed. They'll probably go after me over a technicality if they get a chance..
I hope they legalize it nationwide here soon, but until then anything to do with weed I have to assume is illegal for me to do anything with lol
I don't particularly care if weed is legal, but I hate worrying about rules, so one less rule is a good thing most of the time.
 

« first day (3050 days earlier)      last day (1896 days later) »