« first day (3393 days earlier)      last day (1562 days later) » 

12:00 AM
On SO, the best we can do is A: answer it, or B: link it to another question and hope the OP understands the connection
my alternative allows us to link a well written answer to it, and provide a second answer if the first doesn't connect well enough with the actual question
not to mention... someone else could provide a new well written answer to compete with the existing one
 
Ok. So this is an example of a common problem. What about those questions where people post huge walls of code and text and the answer is something stupid like a syntax error?
 
close
 
answer and close or just close?
 
answer and close
allow answers on closure, but delete later
no rep involved
 
Do you think: (A) Accepted answers should not exist (B) 1 accepted answer only (C) Limited, but greater than 1, accepted answers (D) Unlimited accepted answers?
 
12:05 AM
they should exist, but i don't think accepting should really do anything past displaying a checkmark
"The OP chose this as the best answer"
etc
 
alright i gtg
thanks for all of your suggestions, will definitively want to continue this convo
o/
 
o/
an interesting side effect of that system would be someone providing an answer, and then someone else linking an answer that user provided previously to the question
do you penalize them for creating a duplicate answer? or... what
afterall, they were just trying to answer the question, maybe they forgot they answered it previously.
maybe the answers are different in a way you don't understand
 
 
7 hours later…
7:44 AM
Hello
 
hola
 
How are you?
 
@KevinB that hardly seems fair. Maybe you write a duplicate answer because that's the only right answer you can give to the question, and not because it was copied from somewhere else
@Marc waiting for the morning coffee to kick in, you?
 
@Neil same here, coffee is still to hot to drink
 
I'm sure I'll feel more productive shortly
until then, chatting and checking my e-mail
 
7:47 AM
Long day ahead?
 
no different than any other day I suppose
 
Ah well weekend is getting close :D
 
Waiting on someone to verify something, and he apparently doesn't care whatsoever, so he doesn't even responsd
I hate to pull this card, but I did it this morning since I've been waiting since the 23rd.. I wrote him with my boss in cc
 
Verify what? code?
 
I'm hitting a problem I encountered before, that was fixed only because he adjusted some problem in the configuration
supposedly he pushed it to production, and yet, getting the same problem again..
 
7:51 AM
Won't it be reviewed before pushed to production?
 
I'd look into it myself, but they're very careful about who can see and change this configuration
the problem is in preproduction still
so I have to think he never really pushed to production as he claimed
in any case, I'm stuck. I need him to verify the situation in preproduction
 
That sucks, can't you just go to him and ask him?
 
I'm not in the same office, so I'm restricted to e-mailing him or calling him up
which I did of course. I called him yesterday and he said he would be on it. Haven't heard from him since
honestly getting a little tired of giving him the benefit of the doubt.
 
Isn't there a manager who can pick it up so you can continue with different tasks?
 
not really I suppose. Whenever other things come in, I'm dealing with them, so it's not like I'm doing nothing at all these days
I had just understood that this was urgent.. and if I'm hitting a wall, all I can do is report this to my boss and let him deal with it I suppose
I don't have any authority to force him to do anything
 
7:58 AM
I suppose you just have to wait for a reply or till your boss does anything
 
yep, that's what I've been doing since the 23rd
 
Let's hope for you, you will get an answer soon
@Neil i started a room can i ask you something?
 
can you not ask here?
 
Sure
I am writing my own lib. for JS valition for html forms (maybe other people want to use it, who knows). I made the first version and i am searching for feedback. I'd hope maybe you want to take a look? I have some improvement idea's and i'd like to confirm them
 
sure, I'll take a look
 
8:10 AM
@Neil thank you :)
 
@Marc is there a way to provide your own regex for password validation?
having presets is nice, but it should still be possible to make your own
 
@Neil never though about that, ill write it down
 
8:31 AM
@Neil Any more suggestions like code quality?
 
sorry, something came up at work
the code quality seems good
can't really complain about that
 
@Neil what do you think if i remove the error part and create a seperated class for it? For example. getError() & setError()
place those methods in there
 
@Marc I think you should provide some sort of element which gets a class when an error occurs
and perhaps even a second class indicating the type of error
so using css, someone with this could display custom error messages next to the control
 
@Neil I think what you say i provide in setError()
I create an error element there and add a class
they can use that to customize the error message with CSS
 
8:52 AM
hmm, you see that's sort of a problem
what if you wanted to have your own sophisticated error message?
if anything, you should accept an identifier for a dom element to add a class to, and if it doesn't exist, you create it yourself
also if it already exists, you wouldn't need to handle the error message explicitly. Presumably it would be written in the dom element itself
 
` this.setError( field, (field.dataset.error) ? field.dataset.error : field.validationMessage);`
Here the error is being set with the value from the HTML input dataset if it exist. If not it will take the default field.validtionMessage
In the dom you would do: data-error="Please enter a password" on an input element for example
This gives the freedom to create custom error messages
 
'sup
So when I use .then(result => ...) in AngularJS but use typescript, is there a way I can put an actual type in there? Right now it's IHttpResponse<unknown>, although I know exactly what this 'unknown' is on this call.
 
9:10 AM
@Marc custom error messages yes, but not custom dom elements
that was my point only
you get a <div> I'm guessing with a class that you can use to customize that div tag, but you can't force a span tag, or add an icon to the left-hand side, etc.
 
@Neil Oke than i missunderstood you. Now it is clear
 
Otherwise, I don't really have any issues with your code.
 
@Neil I am not sure how to make it but ill Google around :)
Nothing at all? there must be something you would do different as classes or function :P
 
maybe, but nothing that I could legitimately say is because by doing it that way it is better
I can't penalize you for styling it differently than me
 
@Neil I'd like to hear different ways of people. It is extra knowledge I can learn from and make me better
@Neil If you would like to say your way/method I would be happy to see it
 
9:27 AM
well they're silly things, again
just styling issues
like the hanging > to close the tag I don't like :P
but I see why you did it that way
makes it easier to add an attribute on each line
 
Fair point, any things in the JS?
 
9:51 AM
return strength !== 'weak';
'weak' is sort of a magic number so to speak
might be worth creating a constant for it
but no, the js is mostly fine
 
mostly, i don't like that word :P
@Neil I wrote it down
 
if you write it down exactly once, it's fine
if you write it down more than once, then it's a magic number (or whatever equivalent you'd call it for a string)
again, not really a big deal
 
@Neil I mean i wrote it down as a point to change the code
 
fair enough
 
@Neil uhm ...
that is fine because the reader can read it. That "magic number" phenomon is usually for using numbers that represents something in code without any information. A example for that is strength !== 4. What's 4?
 
9:58 AM
that's not the only reason why..
 
> is usually for
 
if you decide one day that "weak" should be "insufficient", then by changing it in one spot, you break code elsewhere
it's also meant to prevent mistakes that come from inadvertently breaking code elsewhere in your program
 
I will/should create a const for those values so it is easier to change it in the future
 
I mean you're not gonna mess that up most likely
it falls into the "best practice" thing where you do it because it's correct
it's just a good habit to get into is all
 
i just use isWeak function :P
 
10:00 AM
I wouldn't have said anything except that you are pushing me for criticisms :)
 
pushing the red button!
 
@Neil I appreciate it!
 
it's already much better code than I typically see
 
@KarelG using the function is "de wai", however I do prefer calling strings in the exampple abole "mugic numbers" as well, 'couse if you use them you must be carfull to use exactly the same values across yur code 'couse only the right values do the magic
 
magic "strings"
return "You're a wizard, 'Arry!";
 
10:10 AM
just "magic"
 
heh, I am currently doing a harry potter marathon atm
 
goblet of fire is for tomorrow :3
 
@KarelG have you never seen harry potter?
 
10:12 AM
I do. Just rewatching it
 
goblet of fire, while I found it to be one of the best in the series, has the biggest plot hole
 
god. I've the same feeling
IIRC I rated it 8 on imdb
others are on 7
 
I mean, their plot to kidnap Harry is to impersonate a staff of Hogwarts for a full year and get him to join a tournament that you sabotage to have him win
 
*checks*
my ratings are: 6 - 6 - 7 - 8 - 8 - 7 - 7 - 7
last one could be a 6 but ... 7 because of the "show" at the end
😛
 
I'd give it 6 - 4 - 5 - 8 - 7 - 8 - 6 - 7
the second one just seemed way too similar to the first in a lot of respects
I mean the book is that way, not really the fault of the filmmakers
 
10:23 AM
4th got made by Newell
somehow a decision got made to let Yates (?) direct the remaining movies
sometimes he did not hve the right "feel"
 
what is the meaning of the below and how it works?
ReactDOM.render
in react js
ReactDOM.render(element, DOM)
 
10:38 AM
uhm, is it not better to check the documentation of React.js?
 
@KarelG ah, didn't know there was a change of directors
 
yeah just checked. After goblet of fire, all others got made by david yates
a little fun tip: prisoner of Azkaban got made by Cuarón
who did Gravity and Roma as well
 
prisoner of Azkaban had a different feel to it as well
felt darker
 
sorry @KarelG
 
 
1 hour later…
12:10 PM
I am looking for the name of scripts which you execute against your code base to change certain pieces of code matching some pattern. E.g. to migrate to a new syntax. I remember there was a certain name for such tools/snippets but I can't remember it.
Does anything come to mind?
E.g. to use let everywhere instead of var. Or template strings instead of concatenation.
 
Hmm, I am looking for the name of such refactoring snippets. A name like "monkey patching" but for the thing I described. I remember crawling through a github repo with a collection of such refactoring snippets and tools. Can't find it
 
12:52 PM
are you so sure there is a name?
refactoring would be the closest thing to what you described
 
1:46 PM
Hi, can i ask. Is an on hover event only applicable to current DOM elements, and should i add more, do i have to rebind the event?
 
in what sense?
it's an event that triggers when mouse hovers over it
if nobody is listening, nothing happens
 
yes
so basically the event is firing fine, but obviously im loading more posts in WP, so the newly loaded posts its not applying to
So I was thinking to rebind it once the button is clicked
 
yeah, each DOM element can be bound to the event individually
so if you add new elements, you'll have to bind them
taking care of course to not bind a second time the existing elements
 
ok, thats fine. Thanks for clarifying :)
 
that's what's happening from a "native" perspective at any rate
depending on the framework, that may be handled for you
 
1:51 PM
ok, no worries. :) Thankyou for clarifying the above :)
 
 
in C#, 45 secs ago, by Squirrelkiller
Anyone working with Cypress? I'm trying to assert that an element is empty, but it won't accept that the element is indeed empty.
 
I worked with Cypress before
 
@neil I tried the below...
 
Why'd you stop? I like it very much so far.
 
1:59 PM
@KirstyMarks Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
Because i am not a tester :D
 
argh,...
 
1 message moved to Trash can
 
how do i blooming format code again :S
 
ctrl+k
 
2:00 PM
@KirstyMarks Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. 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
 
argh!
 
1 message moved to Trash can
 
@KirstyMarks the bot said it o.O
 
ctrl+k before hitting send
 
@JBis the bot is kinda too quick with removing codeblocks atm
 
2:00 PM
@KirstyMarks Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. 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
 
argh!
 
xD
 
> hit Ctrl+K before sending
 
fgs!
 
1 message moved to Trash can
 
2:00 PM
i did lol!
 
Wait a sec I'm getting the popcorn
 
nah
 
why? :P
 
Can't wait for the next development in this epic fight
 
ok i give up, i did cntrl k and it looked formated :S
 
2:01 PM
hoverState = (e) => {
  var profiles = document.querySelectorAll('.profiles__wrap__profile');

  profiles.forEach(function(e){
    $(e).hover(function(){
      $(this).find('.profiles__wrap__profile__content__views').slideDown('fast');
    }, function(){
      $(this).find('.profiles__wrap__profile__content__views').slideUp('fast');
    });
  });
}
see?
 
oh yea, i did control K over it :S
 
now what's your question?
 
ok, so the above, i wanted to use to rebind an on hover event when i click a button to load more cards. But its not rebinding it :S
it obviously is on the first instance, but not on the button click to the new elements :S
 
but it binds it the first time?
 
2:03 PM
mixing jquery with javascript :/
 
are you sure new elements have profiles__wrap__profile class?
 
is it anything i may need to do after the AJAX has finished?
yep, and sorry @KarelG XD
 
also, this would bind existing elements a second time
 
you need to add the hook again tho
not sure if you are calling these after the elements got added to the DOM (post-ajax)
 
have you tried hovering over existing and new elements to see if there's a difference?
 
2:04 PM
yep, the original elements are fine, the new ones arent
ok @KarelG makes sense.
 
how do you re-bind it?
could be that you did not :P
 
hmm, ok well then now we're down to the absurd
 
ah :S
 
you could try putting a breakpoint and verifying that it is getting run
 
oh i thought it had with the above function, my bad
 
2:05 PM
the first time for sure, but also the second time
 
@KirstyMarks if it gets called yes
 
well i had on the button click, but as @neil said it would have double binded to the original elements also :S
need to think about this ha! Thanks for the help guys :)
 
well that's why I said to check new and existing elements
if the double bind creates a problem, then existing elements won't work but new ones will
 
ah ok.
 
you should still avoid that even if it doesn't cause problems
 
2:07 PM
ok
so calling the function post AJAX appears to fix it, but i will google how to rebind to new elements
 
could be that the issue is with the button itself
if the button gets recreated, then it won't have the "click" event bound
 
oh, hmmm!
 
hey guys, uh I need some help with a small issue
Imagine you have this string converter
  NMSLLog(Array.from(arguments).toString());
Is there a way to make it only accept 1 argument
I can only return a viable string value by using Array.from(arguments).toString()
Else it just doesnt work.
It will output the object type
not the string. However, if I use two optional arguments and 1 string, it will collapse them into one string (which is expected behavior considering .toString() )
Maybe Im overthinking this??
 
@KarelG I'll add more of a delay
 
Wait, I think I may be able to use array selectors in it
so like... arguments[0] i guess
Ill try it
sorry made another big fuss of something I solved in 5 seconds
 
2:17 PM
@KarelG Are you a Czech pop singer who was really successful in germany?
 
I'm ... uhm ? no?
 
||google "Karel Gott"
 
@TaylorS please allow me to hit your head 🙂
 
Lazy botz
 
2:19 PM
Karel is a fairly common name
at least from what I've understood
 
depends of the location
 
@Squirrelkiller put it in quotes
 
Ya but Karel G
 
G has a meaning yes. But I am not him :P
 
2:20 PM
I doubt he'd admit it even if he were
for all you know, I could be Neil Diamond
 
imagine you got a diamond tag :D
 
Hello ! :D
 
@Adrian 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.
 
@KarelG then I would be Neil Diamond Diamond
 
quick question: what are the literals (the %c) formatting symbols called? I want to look em up to get all the different variations (for removal purposes)
 
2:22 PM
@TaylorS hmm, string formatting?
I don't know if the symbols themselves have a name
 
React question: If I'm setting up a this.setState({ item:item }); and item is an object how do I access item properties? Such as item.title ? I tried doing this.state.item.title but that crashes everything as its undefined
 
I was sure they did somewhere, I dont remember.
You can use them as "replacements for attributes"

like... `console.log("Hello There good %s", {variable here to replace %s});`
I heard somewhere theyre called literals or something.. idfk anymore lol
 
they had that in good ol' C++
whenever I needed to look that up, I'd just search for String formatting
 
yeah I remember that too..
 
@TaylorS back in your younger days, eh?
 
2:24 PM
Meh, i played around with C++ and C# VERY early
but gave it up because.... 11yr old mind !== Software Development
 
you were potty trained first I hope
 
I only started playing with C variants and unity last year
 
C++ is not an easy language to start on
 
yeah, thats why i went to C# and winforms XD
 
We started with C++ in college - still don't know why
 
2:26 PM
Most of the universities in England as least, start with C++ in the first year
 
Nothing about string formatting even on MDN: developer.mozilla.org/en-US/docs/Web/API/Console/log
sigh
 
they taught Java at my university
 
Bruh java
 
that said, they taught C++ at my high school, and I ultimately started off with that
 
We finished using COBOL and CICS so who knows
 
2:27 PM
your lucky, the closest thing to programming we get to learn in our region is IT foundations (basically teaches ya how to type <html> in a .html file and boom your an IT)
 
we didn't use an IDE. they taught us how to compile using make files and a linux prompt
debugging would have been hella useful back then
 
.-.
OOF
Well, now I dont think your so lucky
I atleast have eclipse
 
@TaylorS I was in a course like that
 
I played around with minecraft modding to begin with, and tbh, it really reminded me of a slightly different subset of C#
It was fun, but I never learned how to properly debug, so I never got a single MC mod project working.
 
they spend a week talking about inputs and another week talking about css
and if you're lucky, only at the very end, they teach you how to do a very very simple hello world in javascript
 
2:29 PM
This react.state is playing on my nerves got stuck on it for the past an hour or so lmao
 
that course was designed for people who aren't familiar with programming at all
 
@TaylorS js does not have it
 
it would be a nice addition
 
Neil thats way more advanced then what we did... We played around with lego robots + blocks.

And then they taught me about HTML elements. NOTHING about inputs, lol if my class full of mouth breathers had been tought inputs, they woulda quit the class
The teacher knows less about JS then me, but I wont blame her, she was only ever told to learn the basics
 
you can use substitution in console.log tho
 
2:31 PM
thats what its called??
 
the newer languages will do things like var a = "Neil"; console.log("Hello, $a!");
all languages should have this imho
so intuitive
 
console.log('hey, my name is %s and I live in %s!', name, countryName);
 
string substitution, thanks karel
developer.mozilla.org/en-US/docs/Web/API/console they have some info in the previous course, console... not console.log lol
 
but it does not format the content like other languages do ( eg %d for numeric values)
 
ik
 
2:33 PM
I rather prefer to use template literals
 
Ive been using it, I just wanted to know what it was called lolus
 
hmm my knowledge might be wrong
%d is supported ._.
TIL
 
Its a better look then string literals
and its smaller
although
if you take into consideration extra chars for the references, its not
maybe its just my syntaxer that makes default strings all colorful
 
'%c'
 
thats a format statement
 
2:38 PM
had to re-read that doc I just linked.
 
used for styles
you can put css statements into it
Useful for color coding a statement in a big mess or something other :P
I know theres substitution for Objects, Strings, Digits, and Css, any others I need to worry about removing from the strings?
nevermind I see em in MDN
 
3:29 PM
Do anybody know if babel transpile node_modles by default?
 
I don't think so. But could be wrong.
 
Ok, I will read the documentation again. Thx anyway @JBis
 
4:04 PM
o/
@Neil well, right, that's my point.
:shrug:
 
4:36 PM
like, with the current system, it's next to impossible to find a good duplicate for this: stackoverflow.com/questions/59990310/… because all of the answers are tailored to each specific question and the questions themselves don't know what is wrong and therefore are all over the place with their content.
you would have to already have a target question in mind to be able to find it
 
5:27 PM
That's the problem i hoped SO Docs would solve
by allowing us to reference a docs entry as an answer, or even close it with a docs entry
 
5:40 PM
@KevinB I disagree.
General answer of the difference between calling a function and passing a function.
 
?
 
With a "discussion answer specific comment" explaining how it applies here
 
you disagree that it's hard to find a duplicate for that?
or,
what
 
Duplicate question? Maybe. Duplicate answer? No.
 
it's literally impossible to find a duplicate for that question using the existing duplicate closure search. you'll have better luck with google, but i still expect it to be quite difficult'
 
5:43 PM
An answer explaining the difference between calling a function and passing a function would work here.
 
right
i'm not saying it wouldn't
so i don't get what you're disagreeing with i guess
 
With the se clone idea we were discussing, that would be possible
 
yes
i was advocating for that system by presenting a failure of the current one.
 
Oh, i miss understood your point lol. I thought you were saying that in the new system, a question like that would be a problem. My mistake.
 
guys please is there a way to get the content of a blog url, then convert it to base64 example url: blob:mydataurl.com/dssksdlhsldfhkssdkjhs to base64 ?
@JBis please do you have any idea of this url: blob:mydataurl.com/… to base64 data ?
 
5:50 PM
I don't understand the question. Are you talking about simply converting a string to base64? Or what?
@KevinB Do you think people will care if answers belong to the community and not them? (It will be associated with their user, but for legal and copyright purposes it belongs to the community/organization)
 
no, that's just kinda how the internet works
well,i mean
some people will care and get upset over it,
but like, that's like getting upset that we drive on the right side of the road
L
 

« first day (3393 days earlier)      last day (1562 days later) »