« first day (4022 days earlier)      last day (909 days later) » 

6:41 AM
Hey guys, how to prevent input from clearing after pressing on the . (dot key)? I have a number type of input.
 
 
1 hour later…
7:49 AM
Hi, Anyone can help me with a small issue I am having with map function in React? I have pasted the component her: pastie.org/p/2A7ISzGA8mkTsDZ84hPb5O . The error I get is TypeError: pokemon.map is not a function
 
8:35 AM
@Waiz React.useEffect(() => { getPokemons(); }, []); should be React.useEffect(() => getPokemons(), []); without the curly braces in the callback. Or React.useEffect(() => { return getPokemons(); }, []); if you want to keep the curly brackets
 
8:46 AM
@VLAZ if I remove the {} it will throw an error and if i add return as of your second suggestion it will also give me this error: Argument of type '() => Promise<void>' is not assignable to parameter of type 'EffectCallback'.
Type 'Promise<void>' is not assignable to type 'void | Destructor'.
Type 'Promise<void>' is not assignable to type 'Destructor'.
Type 'Promise<void>' provides no match for the signature '(): void | { [UNDEFINED_VOID_ONLY]: never; }'
 
Your getPokemons() doesn't return any data.
 
What would be the return in this case? is it return data,
I also have the issue with the right props to PokemonCard: Type '{ children: string[]; key: number; }' is not assignable to type 'IntrinsicAttributes & Props'.
Property 'children' does not exist on type 'IntrinsicAttributes & Props'
 
9:13 AM
@Waiz setPokemon(data.results[0].name); replaces the list pokemon with a string, hence no .map
@Waiz not sure if this is the problem but children and key have a special meaning, especially children is typically something like ReactNode or ReactElement afaik and used in JSX with nested Components and Intrinsic Elements
key does not need to be explicitly declared as number either, afaik it's string | number anyway
 
9:28 AM
Any suggestions please for solving this error?
 
for starters, remove setPokemon(data.results[0].name); since it's wrong
the problem with children depends on what you are trying to do, if you just want to pass a string list to the component then use a different name like items: string[] and respective items={} property
and remove key from PokemonCard's props
There are other problems with your code, first key shouldn't be index. Why don't you use the element.id instead?
And your usage of async/await will be a problem too, f.e. using forEach(async () => .. ) fires async connections and it's unclear when your Component should actually render the fetched data
and setLoading(false) at the beginning of the data fetching?
 
9:54 AM
scratch that last remark if setLoading is actually only meant for the initial fetch from API_URL
 
10:10 AM
@makadev I have updated the code and pasted the updated here: pastie.org/p/6JsLT2cxebVYSQAYVY9x4x . however, I am still not sure about the getPokemon function how to fetch and set the data the correct and more efficient way. Could you please come with a suggestion?
 
correct is basically everything that updates the component correctly after fetching the data, efficiency is another story.
 
Yes, well the correct way to fetch data would be my first concern :)
 
You could uncomment setPokemon((currentArrayList) => [...currentArrayList, data]); and comment/remove pokemon.push(data), that should rerender the component with every fetched "card".
Another option would be to move your fetch code for a single card into the PokemonCard component.
 
I did the uncomment and comment suggestion. Now I get an array of 20 items from the api, but the data is not being displayed as card components should have. it is a blank page.
I get a 404 error: GET pokeapi.co/api/v2/pokemon/undefined 404 - and this one: VM964:1 Uncaught (in promise) SyntaxError: Unexpected token N in JSON at position 0
 
so your element.id from the previous fetch doesn't exist
 
10:25 AM
It seems like that.
 
 
2 hours later…
12:16 PM
I'm so disappointed wit the starred posts list
 
Hmm.. ye, looks weird. I think I've seen it similar before, is that a bot or just downright broken?
Or do people realy use the star thingy? ;)
 
12:37 PM
more a starspam issue
|| starspam
 
the star feature is not meant to be used as a "like" feature. Please respect it
 
THIS -----^
 
True, well.. it's a weird feature and can be easily misunderstood as some sort of like like on social media platforms
 
12:59 PM
Hmm.. does StackExchange actually have real people doing support or is it just a bot/autoresponder. I've reported a scraper site which copies content f.e. from stackoverflow without any attribution and under a different license (CC SA-NC 4.0 and not the actual CC SA 3.0/4.0 from SE). As an anwser I got text block that pretty much says "this is ok as long as it follows the CC attribution requirements".
 
1:27 PM
@makadev I'm pretty sure it's real people but you got a template response.
For the record, I've reported scrapers that didn't respect attribution and I got a generic "Thanks, we'll take care of it but it can take a while."
 
@VLAZ Ah ok, was that recently?
 
 
2 hours later…
3:15 PM
Hi guys, I want to learn Vuejs should I go for youtube tutorials or official docs or a course? Any suggestions
 
@A5H1Q 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.
 
@makadev This year was the most recent one, I believe.
I will check my emails and come back to you.
 
3:30 PM
Hi <my email handle>,

Thank you for reporting this content. I've passed the information along to the person at our company who handles such issues. It's the diligence of users like you that helps us stay valuable!

Please note, bringing these sites into compliance (or getting them to no longer serve our content) is often a long and arduous process. You may not see immediate results. However, rest assured that we're working on it.

Due to the nature of this request and the amount of time it takes to process them, it is unlikely that you will receive any further follow-up emails regarding th
That was 8th of May 2020
 
I can't imagine how video tutorials could be useful for programing
 
It's actually a bit funny because they addressed me as my email: the this.part.here@gmail.com
And they know which user I am - the email I got included that information
 
Well, it's definitely another Text Block, mine doesn't have any concrete addressing, just a "Hello,"
 
To be honest - probably an improvement.
I find it grating when I get an obviously automated email that tries to greet me by name.
 
Hello,

All content on Stack Exchange is licensed under either CC-BY-SA 3.0 or CC-BY-SA-4.0. The Creative Commons licenses permit other sites to reproduce content that appears on the Stack Exchange network, so long as they follow the Creative Commons attribution requirements.

Because we have no standing to ask another site to take down content they have reproduced from our site, there is unfortunately very little we can do to address scrapers, and we are no longer pursuing these avenues as a company.
maybe
 
3:37 PM
Do note that it's valid for sites to re-host SO content. However, there are rules for attribution and that is what you can report them for.
IIRC, they have to link to the original target and also link to the profiles of the authors of the content. Also, these links shouldn't be forbidden for crawling (no nofollow)
442
Q: A site (or scraper) is copying content from Stack Exchange. What should I do?

PopsSince day one of Stack Overflow, all content posted on Stack Exchange sites by their users (i.e. you wonderful people) has been provided to the whole universe under the CC BY-SA license. For my fellow non-lawyers, that license basically means: Anyone can use any Stack Exchange posts at any time...

So not all scrapers are bad. Codedidact works by buidling up on SO content.
But most are bad. Some of those are even worse.
 
The site I stumbled up on simply uses the Title (for example StackOverflow Title: "How to search substring in string in language X") and copies the Answers as text without Authors and with remapped links to the same site. + Google Ads in between, in header and sidebar
so ye, no attribution
Dunno why the question is not scraped, maybe to reduce Googles penalty for duplicate content
 
@makadev Eh, most questions are bad anyway. Easier to just drop in the answer.
 
true lol
 
3:58 PM
Can a web component listen to changes to their innerHTML ?
 
@salbeira Not sure but maybe MutationObserver API can do it with the subtree flag and respective characterData for text changes and childList for html (childnode) inserts/removes
 
5:03 PM
posted on October 20, 2021 by Harry Souders

Hi, everyone! We've released Chrome Beta 96 (96.0.4664.17) for iOS: it'll become available on App Store in next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

 
5:35 PM
@makadev Yeah this is how I've done it, would totally work.
 
5:51 PM
posted on October 20, 2021 by Srinivas Sista

 The Dev channel has been updated to 96.0.4664.18 for Windows, Mac and Linux. A partial list of changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Srinivas Sista Google Chrome

 
 
1 hour later…
user16940297
7:10 PM
Kevin, are you there, I have a question.
 
i'm always here
 
user16940297
Is this statement true? In 99% of all cases adding an event handler in a loop is a very bad idea.
 
false
it's just usually unecessary
 
user16940297
ok, thank you for that.
 
8:26 PM
@JBis you should add a Jon Skeet Number query to james
 
Yes. And can you make James also give the full chain, too?
 
8:39 PM
posted on October 20, 2021 by Michaël Zasso

Notable Changes Fixed distribution for native addon builds This release fixes an issue introduced in Node.js v17.0.0, where some V8 headers were missing from the distributed tarball, making it impossible to build native addons. These headers are now included. #40526 Fixed stream issues Fixed a regression in stream.promises.pipeline, which was introduced in version 16.10.0, is fixed. It is now

 
8:57 PM
posted on October 20, 2021 by Matt

The Stable channel is being updated to 94.0.4606.104 (Platform version: 14150.64.0) for most Chrome OS devices. Systems will be receiving updates over the next several days. This build contains a number of features, bug fixes and security updates. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels 

 
9:18 PM
I wonder if there's a sort of function/string hybrid so that if I do console.log(someFunction) it'll display a string and not the function source.
 
there is
well, kinda
you could alter it's tovalue/tostring then coerce it when logging
 
I was thinking something like that, but I wasn't yet clear on if toValue/toString were magic methods
As far as I could tell, console.log(someFunction) is not quite the same as console.log(someFunction.toString()) though. Maybe I did it wrong
No no not even with console.log(someFunction+'lalala') I'm confusing myself
I need to read something
@KevinB That helped thanks. I was confusing myself because I forgot about the existence of toValue in my testing.
 
9:36 PM
right, it'd be +somefunction, tovalue would then turn it into the string
kinda messy, but, ¯\_(ツ)_/¯
 
close enough, I probably only "need" it because I'm over complicating it anyways
Like some sort of unhealthy addiction to "eloquent" code or rather an endless search for the meaning of "eloquent" code
Is there a support group?
 
i think one cure for that would be making use of react hooks
 
I'm late on the react train. I buried my head in the sand and wasted all my time haphazardly trying to create react while refusing to acknowledge react was already a thing
Will look into the hooks though.
 
eh, well, it's more a personal gripe
 
It's the thing we thought of and wanted to make when ajax was a hot topic
I fell way behind though with my personal gripes. You're right
 
9:43 PM
the normal way of doing things in react used to involve a few lifecycle methods such as componentWillMount, componentDidMount, and componentWillUnmount. Now, they have a single method that you're meant to use for all three, plus other uses. in other words we have a single function with an arbitrary name that does dozens of things based on how you use it rather than clearly defined named functions for each purpose
and for some reason this is seen as a far cleaner and easier to understand way of doing it
 
Does typescript help much with that?
 
¯\_(ツ)_/¯
no
but eh, hooks aren't that bad, you certainly end up with less code in your file with functional components and hooks than with class components
 
The more OOP way works still though, right?
 
i just don't agree that hooks are this massive new improvment
yea, the old way still works for now
no idea how long it'll stay that way
 
Well as long as there's not any overhead in leaving it that way and they can easily develop both mechanisms in parallel, but idk about the situation
It seems like the newer way with the hooks is more of an extension to the old way
I probably read docs less than anyone here. Never doubt the possibility that idk what I'm talking about.
 

« first day (4022 days earlier)      last day (909 days later) »