« first day (2500 days earlier)      last day (2450 days later) » 

9:10 AM
watch bad out ass?
 
@hexicle Trying to add text to gifs?
I should probably rewrite that
It's long overdue.
 
is "You don't need to know the callbacks that will use the value before the task completes." in this ans about resolve(...)?
 
@Niing Yes
Think of it like a template
resolve will be "replaced" with the actual success callback once you call .then() (that's not exactly how it works, but it's helpful to think about it that way)
Similarly, reject will be "replaced" with the actual failure callback once you call .catch() (or .then() with a second argument)
 
Thank you:) ... But could you ping me again i didn't hear the ping since i'm in the same tab.
 
9:22 AM
@Niing Sure.
 
That's a weird request to make
 
@BenjaminGruenbaum You're a weird request to make.
 
yes
 
9:35 AM
emmm, guys
has someone been advocating two-space-indentation lately?
 
in the same ans, "Instead of expecting callbacks as arguments to your functions, you can easily return a Promise object", could you give me an example? I can understand the code given below, but i don't understand this line Q_Q @MadaraUchiha
 
@tereško I haven't been "advocating" it but I've been using it.
It has become the de-facto standard over the last few years.
 
@BenjaminGruenbaum any links?
 
// Instead of

function delay(n, callback) {
  setTimeout(callback, n);
}

delay(1000, () => console.log('a second had passed!'))

// You do

function delay(n) {
  return new Promise(resolve => setTimeout(resolve, n));
}

delay(1000).then(() => console.log('a second had passed!'))
@BenjaminGruenbaum I've been using this convention since my early days in mIRC :D
@Niing As you can see in the example, in the first example the delay function is responsible for both delaying and calling the function, whereas in the second example the delay function only does the delaying, someone else (the Promise) will tell what to do once the delay finishes.
Instead of passing a callback argument, you return a Promise and let the Promise handle what happens next.
 
9:56 AM
helpful, but now my question becomes why the executor you passed in new Promise() can omit the second parameter(, reject)? @MadaraUchiha
 
10:12 AM
@Niing If you have no need for error handling, if it will never be called, so you don't need it.
 
thank you:) i've tried to find the syntax from mdn, and i didn't notice
Ohhh, so basically promise make delay(1000, foo) become delay(1000).then(foo), so delay only has single responsibility, hence increase the readability. Cool
 
Hi,
I am looking for the name of an event. I tried to google about that but I can't get useful results.
I want a callback to be called when my page is not visible anymore (i.e. the user navigates to another tab on his browser) and another callback to be called when my page because visible again. Is there a js event for that?
 
10:30 AM
This? @ArnaudDenoyelle
 
@Niing I am exactly on the first use case described on the page, thanks :)
 
10:42 AM
@tereško github.com/airbnb/javascript is the most popular style guide.
 
11:14 AM
interesting, they encourage this:
// good
const itemsCopy = [...items];
 
Who does?
 
My first time. Hopefully, I don't fuck up.
 
11:43 AM
@BenjaminGruenbaum that guide sheet: github.com/airbnb/javascript#es6-array-spreads
@littlepootis make sure to wear a rubber
 
It was amazing!
 
did she scream?
 
Dead chicks don't scream
 
maybe not your dead chicks. You need to get better at it
 
@littlepootis is it chicken..?
 
11:48 AM
Yes, chicken breast.
 
with?
 
I was afraid it'll end up being undercooked, but nah.
@KamilSolecki salt, pepper and red chilli powder.
 
If you wanna make chicken super juicy and still cooked, then sear it on all sides for 2 mins on very high
then pop it in the oven for 13-18 mins
at 180-200 deg C
 
Ah, I've only used pan for now. I'll try that next time.
 
This way it doesn't dry out
Little more work, but eventually better
 
11:52 AM
cook like a boss Kamil
 
@KamilSolecki It did dry out, yeah. But I used some french dressing to compensate for that.
afk
 
Eva stalking the chat :P
 
@bitten can you approve Guy on Skype?
 
12:09 PM
 
12:39 PM
not sure I understand that
 
1:26 PM
-2
Q: Update DataGrid in Wpf c#

prashant krishnaI need a DataGrid in WPF application where I can update the data like Microsoft Excel and the updated data should reflect in SQL Database.

how to request
 
I really need to disagree with this one: github.com/airbnb/javascript#strings--line-length
> Strings that cause the line to go over 100 characters should not be written across multiple lines using string concatenation.

Why? Broken strings are painful to work with and make code less searchable.
// good
const errorMessage = 'This is a super long error that was thrown because of Batman. When you stop to think about how Batman had anything to do with this, you would get nowhere fast.';
well, I see the point that it's easier to search it, but if that was a need, you'd assign the string somewhere else in a data file, and export it as a variable, then use that
 
@towc that's not always justified, but typically it is.
Sometimes you just have a long string, consider a long URL.
 
you'd still have it in a data file, and export is as longUrlThing. The one case where I can see that being a problem is when you're building the url using string templates
like https://randomsite.com/some-long-thing/?user=${something}
in which case, having string-building helpers in the "data" file is not a good idea most of the time
 
const longString = `A
very long
string`.replace('\n', ' ');
(not really)
 
but then you might use a different data structure for building previously-known urls. But that might be the exact opposite of what you need if you're the one providing site hooks
@Luggage still makes it hard to search (/A very long would yield nothing in vim, for example)
(/ just searches stuff)
and this I really don't agree with. Well, their reason I do agree with, but their solution I don't
> Use named function expressions instead of function declarations. eslint: func-style jscs: disallowFunctionDeclarations

Why? Function declarations are hoisted, which means that it’s easy - too easy - to reference the function before it is defined in the file. This harms readability and maintainability. If you find that a function’s definition is large or complex enough that it is interfering with understanding the rest of the file, then perhaps it’s time to extract it to its own module! Don’t forget to name the expression - anonymous functions can make it harder to locate the problem in a
// bad
function foo() {
  // ...
}

// bad
const foo = function () {
  // ...
};

// good
const foo = function bar() {
  // ...
};
if that's your reason, then why would you not want the second example?
I guess they're still trying to preserve names, but urgh
and giving 2 different names to the same functions? (foo and bar)
 
1:40 PM
i need an example of "intentional and actively prevents race conditions" in this ans
 
maybe it's a mistake?
 
hope so
oh, actually, second is back because stack trace, right
 
I meant that this one might be a mistake (2 names): const foo = function bar()
 
although that's not too big of a problem anymore:
const x = () => { throw new Error };
x();

/*
Uncaught Error
  at x (<anonymous>:1:23)
  at <anonymous>:1:1
*/
also, second is *bad because stack trace
> Never declare a function in a non-function block (if, while, etc). Assign the function to a variable instead. Browsers will allow you to do it, but they all interpret it differently, which is bad news bears
> bad news bears
I can't take this guide very seriously anymore :P
it does make interesting points
 
i used to struggle with coding style, but now i just ;;;;indentationWithSemi();.
 
1:50 PM
 
@Niing that errors btw
dis the original:
 
looks pretty
o_o;;
 
no, no it don't
look into fibonacci indent
 
barf
 
btw, how asynchronous nature of .then() prevents the race condition?
 
1:59 PM
Benjamin Gruenbaum, you clearly don't have any clue on this matter and still try to behave like the smartest man in the world. — asdfasdfads 2 hours ago
Nevermind, it's funnier if I don't explain it.
 
Is there a javascript obtimiser?
Can't find one
 
@KurtG What's an obtimiser?
 
@BenjaminGruenbaum I'm not sure if you're actually technically on the technical committee, but meh :D
 
Optimiser Madara
 
2:04 PM
@KurtG What are you trying to optimize?
There's no magic optimization powder you can throw over your code
 
A library I've built
Like, closure, without the renaming
 
@KurtG That's technically true, and yet not at all what I've asked :D
Performance? File size? Memory?
 
@MadaraUchiha core collaborator, not techncial committee (I'm on several technical committees, but when people say technical committee in Node they usually mean the technical steering committee)
@MadaraUchiha show the comment to Nitzan though.
He'll laugh
 
@BenjaminGruenbaum Lacks fundamental understanding :D
 
He's literally talking about a decision I was involved in that took research.
 
2:06 PM
@MadaraUchiha Performance
> Like, closure, without the renaming
 
@KurtG prepack.io, maybe
 
What a coincidence, I tried that.
 
closure doesn't really improve performance
 
Is that intended for improvement in performance?
 
what does your library do?
 
2:09 PM
prepack looks cool
thank you madara.
- I did not read it before I tested it earlier, and dismissed improvement as an anomaly
@MadaraUchiha if I feed the output back in ass an input, can I keep improving performance?
 
yup, definitely
it's estimated that if you do it around 1000 times, it will be faster than the correspondant optimized assembly
 
coughtroll :)
 
if you do it up to ~10^7 times, you should have something that runs as fast as the original code would have ran in an advanced machine from 2025, given moore's law
bottom line: yes, it makes sense that if you keep repeating an action without any apparent costs, you end up breaking the laws of physics and with a better product
also, good thing you're more clever than the people who built the bloody tool. They would have never figured out that they can parse it multiple times if it makes a difference. Good thing there are people like you
 
I think you made your point a while back.
 
^
 
2:17 PM
do I need to be a dad to make dad points?
 
I think the fact that he thinks I was serious speaks of his "intelligence"
 
ok now :/
 
Play nice now.
 
are you really willing to deincentivize people from creating a better society?
I just realized that's exactly the thing that almost every troll does
I guess they become actually good trolls if, by trolling, they incentivize the right things, like human rights to a government
and that's where I actually find it funny
 
@towc are you stoned?
 
2:20 PM
I am, btw.
 
haven't got stoned yet
 
But I can hold my... flower.
 
not sure if to be proud or upset
 
Uproudet
 
I had an internal rant today about how little so many laws make sense
 
2:22 PM
Too you
 
@rlemon That was really smart
 
@KurtG I'm a genius.
 
I am*
 
For a horse.
 
and how the whole system is broken, like a huge legacy system that is unreadable, unmaintainable, and requires a huge amount of manpower, effort and money to keep going
 
2:22 PM
You are what?
 
You are Kurt. You are not smart.
 
Harsh.
 
why can't there be a more simple judgement system like "is this good for society?"
who decides that? I don't know, but that's not the problem current laws are fixing
 
@towc because not all people don't suck
 
Man shoots hitler: is this good for society?
 
2:24 PM
differing values, politics, so many reasons.
laws will never 100% match the society they are for
 
@rlemon the guy might have had good intentions and if he was properly informed and did what he could, then he shouldn't be punished, even if the end result was horrifying, imo
even if he sucked
@KurtG it's not up to me to do the judgement
 
Too abstract.
 
there are people so much better than me at judging
but if everyone can know the only law they need to know, then that's great, and society can function better
 
I covered something similar in an essay on lethal autonomous weapon systems and manslaughter on behalf of robotics.
Lack of common sense should still be punished
Whats the term, lacking thought/foresight
 
foresight*
 
2:27 PM
corrected it already. You're really adamant on demonstrating your intelligence
 
I am indeed very clever, thank you for pointing it out
because that's definitely what you did
 
If that is what you take from my statement, so be it
 
I'm don't see this leading anywhere productive.
(hint)
 
for future reference, how do I deal with this?
 
lets change the subject
 
2:28 PM
just ignore?
 
trump huh, what about that guy?
 
I might have the irrational belief that all humans can be reasoned with
 
you stop doing what you are, now. just move on. disengage until there in an new reason to interact with the person
 
let's talk about my homework instead
 
crap
 
2:30 PM
what am I?
should I release the basil from chains because I'm a basil enslaver?
 
homework
 
a race condition
 
is pootis your last name?
 
Apparently
 
actually, how would I have found out if it was a troll better?
 
2:32 PM
ok explain the race condition
 
I think it's wrong to just assume someone isn't stupid if they ask a question
 
If I explain the joke, it wouldn't be funny.
 
thinks
 
I got the joke.
 
@towc did you get it?
 
2:33 PM
who's to say
my basil plant won't talk
 
you have to water it.
 
I'm sorry, @towc
 
I need a break from everything
 
Madara is mod, but Benjamin has higher rank
 
2:49 PM
@KurtG what?
There are no ranks, I don't have a higher "Rank" than Madara. Being a mod is not a good thing - it's being a janitor, and we are grateful to those willing to burden themselves with it.
 
Don't you get to ban people, as a mod?
 
@KurtG I do, like you, Tobi :)
 
are they payed? Seems like stackoverflow depends a lot on its members
 
Or did you think we wouldn't notice?
 
theyre not payed?
 
2:54 PM
What is it that you want? A suspension on main too?
We can arrange that
 
me? @MadaraUchiha
 
Let's see, a user who registers 2 days ago, around the same time the latest Tobi alt is destroyed, with a proxy IP address, who contributes just enough to join chat, then stops, and joins this room
Not to mention, the mod tools link back to your original account
 
are you talking about me? @MadaraUchiha
 
You're only making this worse for yourself, we'll keep deleting your alts, and eventually we'll increase the suspension on your main
@KurtG Yes, you.
 
I just joined javascript chat
Link on stackoverflow
"chat"
 
3:00 PM
@MadaraUchiha looks like it's a regular Ireland IP to me, nothing fishy for @KurtG
Looks like a legitimate user
 
My name is Kurtis Gonzales
 
I don't trust the irish. (just kidding). :)
 
Wait, your gravatar is funky @KurtG
 
Do you even believe in them, Luggage? All the photo evidence I've seen of the Irish looks like it was taken with a potato.
 
It's like the gravatar is giving me one signal and your cyber trace is giving me another @KurtG
 
3:02 PM
my gravatar?
 
I wish I didn't have to write code on Windows Server using notepad :(
 
That is horrible.
 
Have you tried installing notepad++?
 
@Luggage ha, I should have spoken in chat and not hangouts.
 
@JonClements what happened?
 
3:07 PM
@JonClements Is this a joke
 
@KurtG the connection on the gravatar is from Santa Barbara by the way. Where are you located?
Welcome to the room by the way
 
Oh did I type that out loud... never mind me
 
why does gravatar matter?
 
@Luggage Your Gravatar has cyber traces to your physical location
Didn't they teach you that in school?
 
checks myself for cyber traces
applies ointment
 
3:10 PM
if( !self.checked ) self.wreck();
 
@JonClements how have you been? Here for business of pleasure?
 
Aren't gravatars somewhat deterministic?
 
determined by what you upload
 
:|
 
@BenjaminGruenbaum UK currently in Ireland, and thanks
 
3:13 PM
 
@BenjaminGruenbaum Haven't popped in for a while so thought I'd say hi... How've you been?
 
@JonClements Flying to Prague this weekend for a weekend out with a friend, then I get back and a week later I'm going to Amsterdam between the 12th and the 18th, then after that I'm flying on the 22nd to the USA
So lots of traveling after a pretty chill preiod
 
Any of those going to end up on youtube?
 
New job at Peer5 in case I haven't had a chance to tell you.
@ssube not actually speaking anywhere this time around. Participating in a lot of things but I don't feel like speaking.
Nothing is "burning"
Speaking of which. I'm in Prague this weekend if anyone wants to grab a beer - ping me.
3
 
ah, that's a shame. Hopefully you have fun anyway. :P
 
3:16 PM
@BenjaminGruenbaum sounds like you've got ants in your pants or something :)
 
@KurtG You see, I happen to know John (the guy whose picture you've taken), and I also know he doesn't have an identical twin name Kurtis
 
I haven't traveled in a good two-three months, missed the TipRanks trip
 
@MadaraUchiha really?
because like, he for sure copped that pic. I expected @BenjaminGruenbaum to email him :P
but do you really know him/
 
@rlemon I don't know what you're all talking about. @KurtG is a new user here.
We should really be more friendly to new users.
 
I was friendly. months ago when tobi joined
:P
 
3:21 PM
why would you use the pic where the guy is glaring into the camera and doing his best eternal vampire face?
 
@SterlingArcher i.imgur.com/xkPOdjh.jpg
 
Room Owners: RFC
@JonClements if you need access let me know
 
Don't have access - not sure I need it but I'm curious :)
 
3:37 PM
@JonClements What's your GH username?
@JonClements try it again :)
I invited you
not entirely sure how that works on GH
:38752394 ha, people already complain about us being too mean. You really want to invite Torvalds here? :P
 
do it
 
@ssube got it thanks
 
cool cool. @BenjaminGruenbaum I just made him a collaborator on the repo, not sure how you wanted to add folks.
 
@ssube In my opinion all moderators who'd like should have access to /moderation - no reason to block anyone. @ThiefMaster still has access for all I remember too :D
 
oh, absolutely.
 
3:44 PM
The goal of this room is to help coordinate things that the more mods know about the better.
 
There is no reason to hide our discussions from moderators. I would make the repo public, but sometimes we have to speculate about socks who turn out to be innocent.
 
until the revolt.
 
@Luggage just because they know it's coming doesn't mean they can stop it.
 
@ssube or badmouth @towc - we do that all the time in the repo
 
@BenjaminGruenbaum darn... was going to try out the whole ignorance is bliss thing... sighs :)
 
3:47 PM
@JonClements feel free, Madara is on top of things - so feel free to be as involved as you'd like.
@JonClements how have you been by the way? Still Python?
 
Of course... playing with erlang a bit recently... not getting too far with it as keep getting involved with other stuff
 
not erlang on windows server in notepad, i hope.
 
he's pioneering erlang on windows mobile
 
Somehow I'm sure that's a thing
 
!!afk rimwooooooooooorld
 
4:03 PM
I'm looking for a way to get access to a function's closure
I don't mind using a debugger.
 
new Promise(e): the e runs synchronously, but resolve() or reject() inside it not?
 
They actually might be called synchronously, but there is no guarantee of that, so you should assume they are async.
 
@Niing they all run synchronously, but the thens you add to the promise are run "asynchronously".
e is guaranteed 100% to be called synchronously.
So are resolve/reject (if . you don't defer them inside e)
Reacting to them is asynchronous though since the only way you can know that is with a then (or await which is identical for those purposes)
 
so... they're called synchronously, but processed asynchronously?
 
It might help to think in terms of console.log
console.log('before');
new Promise(console.log('inside call'));
console.log('after');
@phenomnomnominal I couldn't help myself and got the bassbreaker
eeepp
 
4:17 PM
@Niing With .then(cb), cb is always called on the next tick (roughly)
2
 
you mean the callback given to the .then?
 
Even if the entire Promise constructor is synchronous, .then() will always be called at least one tick later.
@ssube Yes
 
Wow, now it's clear, thank you
 
in new Promise(e).then(f), e will be called right away and the earliest f can be called is the next tick
e can choose to defer res and rej or call them immediately
 
@ssube Yes, even though the promise is already resolved
 
4:20 PM
e is a value, it's always computed eagerly
 
it's a shame nobody has an infographic of this for people who are new to promises
 
i was thinking about that why the next statement following the new Promise(e) always ahead the resolve(...) inside e
Now it's clear: next tick
What i meant is:
 
1 message moved to Trash can
@Niing Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
Oops
var p = new Promise((res, rej) => {
    console.log("Run immediately");
    res("Last one");
});
p.then(val => {
    console.log(val);
});
console.log("Secondly");
 
4:28 PM
Why do people go out of their way to implement promises
 
we should never have given bears the right to bear arms
 
Despite the heartache and drop in response time
 
@ssube fixed
 
that's really weird
 
@rlemon They need the little doodly arms
 
4:31 PM
 
lol
 
Why put emphasis on "resolve() is not onFulfill()" in this answer?
 
@rlemon haha, party elevator
 
4:46 PM
knock knock who's there
that's how HTTP works
 
@rlemon Luggage is afk: rimwooooooooooorld
 
caves...
mofokin caves man!
 
new plants, huh?
 
plants and animals are lacking
needs more variety
same with furniture
also food should have a nutritional value to it, and not just 'x for y hunger'
a meal made with some shitty cuts of cat shouldn't be as filling as something with better cuts of muffalo.
 
5:26 PM
@Tobiq please don't email me random projects
thanks.
 
5:46 PM
@rlemon that seriously happened?
 
@rlemon Can you submit back-ended games?
for js13k
 
read their site
why are you asking me?
 
ask them dude
I don't participate or have anything to do with that
 
no problem
 
5:57 PM
@BenFortune do I have you on hangouts?
 
I was asking because you posted your submission
 
no I didn't
 
@BenjaminGruenbaum <3
 
@rlemon I don't really use it, we've chatted like once :P
 
can't find you
 

« first day (2500 days earlier)      last day (2450 days later) »