« first day (1779 days earlier)      last day (3394 days later) » 

18:00
Jon Skeet: Hey I think you're wrong, OP needs to give more info though, so you could be right
nikpon: GO FUCK YOURSELF
@Zirak oooh nice. I want to do that too. (say "GO FUCK YOURSELF" to jon skeet)
@AwalGarg fornicate with Jon Skeet?
Guys I'm struck
this.parentNode.removeChild(this.parentNode.lastElementChild)
Why this isn't working ?
@ZahidSaeed who stroke over you?
@AwalGarg That JS code ;)
18:06
@ZahidSaeed Sure it is
@Zirak It's not removing the element
@Zirak depends on what this is, TBF
@ZahidSaeed Sure it is
@AwalGarg this is input field
@ZahidSaeed exactly
18:07
I hoped for something more exciting
@AwalGarg Then what's the problem with this code ?
45 secs ago, by Zahid Saeed
@AwalGarg this is input field
@Zirak I'm a beginner
Why isn't it working ?
Bananas
sup guys
18:12
@Zirak can I please call you a noob for saying that?
@Zirak no question is a dumb question
@Zirak There can't be any input childs !
NOOB
HAHAHAHAHA
There are bananas in my chilli
18:13
I'm first refering to it's parent
and trying to remove it's child
that's the problem with this chatroom. you should be able to ask any question, yet the common goto is to poke fun
But it's not working :/
anyways, in other news,house buying sucks. Got outbid for this last one
Guys how can I wait for an event to occur within a function in javascript/Jquery
@shyamalparikh Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
18:14
@ZahidSaeed you studied basic forces of nature in school/college?
@shyamalparikh Use a callback function
@AwalGarg What is the link between JS and this ? :P
@ZahidSaeed I am trying to achieve something like this: stackoverflow.com/questions/32299639/…
that's not how you get help :( @ZahidSaeed
Is it possible with callback?
@shyamalparikh Which event you wanna wait for to occur ?
18:18
Am waiting for user to either press a button or Bootstrap Modal hide
A function waits for these events.... on event proceeds further
0
Q: Modal Bootstrap User Confirmation

shyamal parikhHow can I create a JQuery function that waits till user confirms whether or not he really wants to delete data. How can I achieve something like this: function UserConfirmation() { ShowModal(); //"Global" Delete Confirmation Bootstrap Modal //Now wait till the user decides whether ...

@shyamalparikh So you mean if the user clicks the button then show or hide the modal, right ?
It's simple
Then ?
Can u please have a look at the question I posted. It would be clear
$(function(){
    $("button").on("click", function(){
        // Do this, Do that !
    });
});
18:21
@shyamalparikh *you
Well that is all right. I know that. What I want is a particular function waits for these events
Only when an event is encountered the function proceeds further
Like a While loop waiting for true condition
"u" is disrespectful. You might get kicked if you persist.
Oh sorry!! Would take care
$(function(){
    function doSomething(){
         // Do Something
    }
    $("button").on("click", doSomething);
});
1273
Q: How to return the response from an asynchronous call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable inside the function and return that one, but none of those ways actually return the response. f...

18:25
I want the Modal to be in the layout html so that it can be called from any function. Hence calling a fixed function would be counter productive
then that function has to provide a continuation.
By talking to a promise, preferably
Well I am new to Javascript so don't know much about promise. Will have a look
Hi New to JavaScript! How are you?
@SomeKittens Did you contribute to closing my question because of our debate yesterday? stackoverflow.com/questions/32287398/…
Would be great if you can provide an example. May be a code solution to the question
@call
18:29
"Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Paulie_D, easwee, SomeKittens, Bannings, karthik
@shyamalparikh Those in the answer don't suffice?
@Callum Fine and you?
@shyamalparikh Pretty good.
@HelpingHand If I closed that 14 hours ago, and our debate was 12 hours ago, what does that tell you?
@shyamalparikh Why you wanna do that BTW ?
18:29
@SomeKittens It wasn't closed during our debate.
@ZahidSaeed Can you please elaborate
??
Hi guys, I only started to use tests in my project and would like to ask, if it ok to install library npmjs.com/package/faker in project's node_modules if it'll only be used in tests. Maybe there is a way to separate project libraries and libraries for unit testing.
@JanDvorak Promise seems to wait for the time defined. It would be great if the wait extends till the user responds to the modal.
@SomeKittens It tells me that's not possible. It wasn't closed during our debate.
"Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Paulie_D, easwee, SomeKittens, Bannings, karthik
18:32
@shyamalparikh it doesn't. Please reread.
@HelpingHand You've got quite the martyr complex going
@JanDvorak setTimeout(function() {
resolve(42); // after 3s, resolve the promise with value 42
}, 3000);
This is optional right?
@shyamalparikh think of other ways to resolve the promise
@SomeKittens You know what... All I'm going to ask of you is to revisit my question since I've edited it.
ignores the "whiner" bell a little harder
18:35
@SomeKittens SO doesn't have any pointers about this so I thought I might contribute.
$(function(){
    function promiseFunction(){
         callToFunction1();
         callToFunction2();
         callToFunction3();
         // And so on...
    }
    $("button").on("click", promiseFunction);
});
Yeah, I'd re-close as Too Broad now.
@ZahidSaeed that's not a promise, that's a plain callback.
So, I'm in a 7h road trip and finished all of the books in the car. I think I've found a new time killer: reading the transcript :P
@JanDvorak He simply want to call a function again and again
With some other functions as well
18:37
@towc oooh boy. You might want to see a psychiatrist afterward
@ZahidSaeed That's not possible with promises, but I'm still going to call you out on misnaming the callback.
1 message moved to Trash can
@shyamalparikh Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
@JanDvorak Then what's the promise function ? :P
@SomeKittens I can see that happening, yeah ;)
How's everyone? Got a new job or something @SomeKittens?
Got one a while ago
18:40
Congrats :D
A promise is an object, not a function. Of course there's a Promise constructor that returns a promise, but isn't a promise itself, much like Array is not an array and String is not a string..
A promise has some nice function, but none of them are promise
By the way, how do you feel when someone with pretty much no experience on a subject congratulates you on that?
Looking for reviewers on this README. Is it clear? Do you get a sense of what Gustav does, and how to achieve that? What more should be added? gist.github.com/SomeKittens/022899f0e4327dfb627b
( @Zirak & @ssube )
function delay() {
  // `delay` returns a promise
  return new Promise(function(resolve, reject) {
    // only `delay` is able to resolve or reject the promise
    $(MyModal).click(function(){
        //Find out which button is clicked and determine what to return as resolve("____")

})
  });
}
Will something like this work?
As in, I have no idea how to adult, like jobs, kids and such, but I still congratulate people about those things
18:42
@JanDvorak ?
@towc hah, still nice to hear
For example I actively hate who congrats me for my programming experience when theirs is a very small fraction of mine
@towc That's just, well, I don't know.
you understand that it's non-trivial
They're complimenting you on your knowledge of programming,
I've never had a proper job, but I'd expect that at my age. I'm not going to stop congratulating people on getting a new job, though.
18:44
If they appreciate what I do I'm glad, but not if they actually tell me way too enrhusiastically
Or when too many people just congratulate me...
Somehow it's annoying
@ZahidSaeed $("button").on("click", promiseFunction); ----- 'promiseFunction' part is dynamic....
I'm like "you have no idea what you're talking about, just stop"
Or "I totally don't deserve this. Stop please"
@towc that's stupid
I knew WikiHow would have this crap: Read this Towc :p
I can see a reaction like that when it feels obligatory (Your once-monthly "Good job" from your boss)
but I know that Usain Bolt's running is spectacular, even if I've never run competitively in my life.
18:48
"You barely got to the next year at school because you kept just playing games, don't make it look like you know the meaning of effort"
Well, the difference between me and bolt is that I do below average stuff that way too many people think it's godlike
because you're in the 0.0001% of the planet when it comes to canvas.
and you're comparing yourself to the 0.00001%
@SomeKittens looks pretty clear to me
@SomeKittens shouldn't I?
@towc No, silly
don't compare yourself to anyone but your earlier self
20
A: 10 Million Questions - Let's Share Some Stories That the Number Doesn't Convey

SomeKittensSelf-answer Self-help As a programmer, it can be incredibly easy to feel like you're just treading water while everyone else is writing code that you'll never be able to touch. I've watched many friends (and myself, several times) fall victim to impostor syndrome. The solution is as simple as ...

^^^ Go reread that
18:57
@towc hi
@SomeKittens (commenting as I go along:) From my areas of knowledge, Source, Transform and Output have different, more formal names: Sources (yay!), Filters and Sinks.
(it originated from Extract, Transform, Load)
Sinks makes sense, but Filter is a subset of what such a node might do
Typically, the input opbservable in Transform and Output nodes is called iO
Why uppercase O?
it was inputObservable and I just shortened it
@SomeKittens right, I'm learning and that's awesome, but I do also realize that I still have a huge way to go, and I'm pretty much a noob in what most of my friends think I excel
@ʞɔᴉN hi :D
19:04
@towc And how does that make "Hey, you're learning cool things" less sincere?
am I only allowed to say that if you're #1?
@SomeKittens It's pretty clear, though seems simplistic. How do you handle circular dependencies? Do you instantiate the given dependencies? What if I want to give you an already instantiated one? Do *I*, the user, wire things up, or leave it up to you?
Complete examples would be great (seems like you have them in stock!), as are some references to the concepts.
@Zirak have examples, what would you want for references?
once it's created, the result is cached
I do love those learning compliments (as long as they're not patronizers), but I really hate the "hey, you must be one of the bests" ones
@SomeKittens Examples of other such systems, maybe papers on the matter, where you drew inspiration from, etc
@SomeKittens ooohhh, more questions! Is the cache global, or per pipeline? Can I invalidate the cache? Can I control it?
@towc oh, in that case they're just misguided, no need for hate
19:08
How do I pass parameters to dependencies? If the parameters are different, will they be cached differently?
@Zirak A lot of this came from Luigi, I'll put a link there.
@Zirak Global, no, no. At least at dev preview stage.
@SomeKittens Why isn't a Source just a function?
Why observables and not async iterators?
@Zirak makes init simpler for the time being
@Zirak Rx has a lot of tools that are useful, especially in transforming
I'd be curious to see an implementation of the buffer Transform example with async iterators
user3233318
19:22
Is there a prefix to make clear that the method is a factory method?
makeSth?
user3233318
I think it should be a verb right, since it is not something that is going to be used with new.
user3233318
I am using make. I think new could add confusion.
Don't use factory functions. Problem solved.
user3233318
19:25
I am using it to create callbacks for addEventListener.
@user148098 :-(
user3233318
Why sad face?
because most likely you shouldn't be doing that
user3233318
Why not?
Why do?
user3233318
19:30
I need to add data to the callback.
use a closure
user3233318
I am using closure, in my factory function.
user4959035
0
Q: How to load *.babylon exported from blender using JavaScript/FileApi/XHR?

Matthew TiptonI'm pretty fine working with the .babylon file format. Exporter which was developed for Blender 3D editor works perfectly and if to load the exported model using the next code: // won't write the full code // because it was fetched from the playground and it's very standard and works BABYLON.Sce...

@MatthewTipton Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
Sure you can do just that outside the factory
IIFEs can also have arguments
user3233318
19:32
Or I can do inside the factory. Do you have a good reason why using factory is bad here?
too verbose
user3233318
That is not a good reason. That is a question of taste.
Java go home
user3233318
I have seen people pushing particular programming styles in JavaScript lately.
If you want to write Java in Javascript, you technically can. But don't expect positive reviews from us.
Hey, I've been pushing not sleeping in a raging fire for quite a while, too.
user3233318
19:36
Why discriminate code with a different style? I am not trying to push Java features. I just want to name a function instead of using a nameless function.
Why name a function that you're only going to use once?
I think he answered that a while back: makeSomething
what did I come in on today? lol
(and yes, you can still do (function mkCallback(i){...})(i) )
@Claies you must be new here
19:38
Pretty sure neither the extra carbon dioxide nor the raised temperature can be good for your health. But that's, like, my opinion, man.
user3233318
I think it makes the code easier to read. It is a style choice. I don't know why such hate towards naming a function.
sorta, I kinda lurk a bit, just started actually talking recently
creepy
:)
yep, I'm good at that
just look at my picture :P
it's not particularly helpful to name a function whose only purpose is to bypass a language feature
user3233318
19:39
Is there another reason besides "more verbose"?
user3233318
I am not bypassing any feature.
user3233318
Functions that return functions is a language feature that I am using.
Then why do you need to wrap the callback creation in a function? Show your code.
If you're trying to freeze a variable, there are less verbose ways to do that.
an IIFE with argument is a pretty readable one
user3233318
what is a good website to share code online?
user3233318
Never mind
I've got 1 day, 2 hours before I find out whether this person is going to sell their house to me... :| .... ugh....
user3233318
So?
I would like to note you could have just stored a singleton loadListener in the prototype.
Hint; bind
... or just inline it in its sole usage site
user3233318
I know about the other ways of doing that. The only thing that I don't know is why you think this way is wrong.
19:46
I didn't say "wrong", just "most likely unnecessarily complex"
@user148098 document.body.children[1] o_O
user3233318
After seeing the code do you think it is unnecessarily complex?
yes
I would inline it
There's not even a variable to freeze and if there was, there is a nice place to store it anyways.
user3233318
Ok, I get it. You would inline it, that means everybody should inline that also. Because everybody that don't code like you is "unnecessarily complex".
So, are you not accepting "less verbose" as an argument, or are you against style advice in general (not that this is just a style advice) ?
/me grabs some popcorn
19:50
@user148098 You probably know that different languages have different ways of doing things, oftentimes more than one way in the same language. That's why there's idiomatic code and best practices. Your example doesn't represent idiomatic code.
It's not a personal insult, it's a sense you get as you write more and more in the language.
user3233318
You may say it is not the way people usually do it, but to say is worse than the regular way is too much. Sometimes there is more than one way of doing things, and one way is not better or worse than the other.
@user148098 it isn't too much.
Some ways are better than others.
but, if you knew the way you are trying to do it is the "better" way to do it, then you wouldn't be asking questions about it, right?
19:54
Don't take it personally, this isn't your baby boy.
user3233318
I asked about the name of the function. Not this.
Do you want answers, or advice? If it's the former, then we have to disappoint you.
you asked an XY question, and then got upset when people tried to find out what the use case for your solution
getting my kicking boots ready...
@JanDvorak nah, not kick worthy. He's harmless.
19:56
K. But he still smells of vamping
Reminds me of the screenwriting quote somebody pointed me to “In writing, you must kill all your darlings.” - William Faulkner
user3233318
What I wanted was to know why such discrimination on a particular style of programming. And I already have what I was looking for.
@JanDvorak Just a weird sense of entitlement
And then you rejected the answer as a personal choice, and got upset
what's vamping? I'm totally out of it apparently lol
19:57
They already said why. It's not a personal reason
@user148098 And as said, it's idioms of the language.
@JanDvorak Nah, not vamping, just first-time encounter with new opinions.
Much like the Matrix, some don't take it well
user3233318
I think you guys are right. It totally looks more verbose. I think I will go with bind.
@Claies Help vampire: They suck all the help out of you.
19:59
I'll give them something else to suck

« first day (1779 days earlier)      last day (3394 days later) »