« first day (2895 days earlier)      last day (2275 days later) » 
00:00 - 16:0016:00 - 00:00

00:14
why is not not working? if (!current.right) current.right = node, break;
it's in a while loop
why does it need the braces
break is a statement
you're basically trying to do something like (current.right = node, for(...){} )
which is clearly illegal
@Meredith that makes sense, but I hate that it's true. you know any tricks around this
00:30
rewrite your logic to not need breaks
They're pretty sketchy
So is the comma operator for that matter
class BST extends BinaryTree {
  push(val) {
    var node = new BinaryNode(val);

    if (!this.root) {
      this.root = node;
      return;
    }
    let current = this.root;
    while (current) {
      if (node.val < current.val) {
        if (!current.left) {
          current.left = node;
          break;
        }
        current = current.left;
      } else {
        if (!current.right) {
        current.right = node
          break;
        };

        current = current.right
      }
    }
@Meredith this code is not short enough
Just copy the code from wikipedia
you mean make it recursive
Probably a good idea
js doesnt always handle recursion that well though
00:50
@KevinB are you kevinb9n on github
@Meredith omg, the whole point of a heap is to avoid recursion, but if you use an array to keep track of the nodes it should be appropriate. thx. I hope your not flooded from the hurricane
I'm leaning towards 'no' since you're a JS guy and that person seems to be a Java dev
@forresthopkinsa you what Linus thinks of java ?
he probably thinks it's the worst thing ever made
along the lines of how he feels about everything else lmao
heading home, ttyl
@forresthopkinsa no
i'm tentonaxe
00:59
Is anyone aware of proxy server that runs in browser? Using the browser as the proxy
well he does not have an opinion on javascript, the fact he went out of his way to say it sucks well ya
@csjohn what do you want to know
and what is it you are trying to do
@Rick If such a thing exists, the name of the project :)
I forget the name but
google put something out
I am assuming you want to use the browser on the server?
for preprocessing?
@csjohn unless you are referring to something client side?
@Rick Yeah I'm thinking of client side
@csjohn are you talking about service workers
01:06
@Rick Not specifically. I have a server that has clients (browsers) connected to it (sessions via webtunnel), and I'd like to run something on the client side JS to take traffic from the server and act as the proxy. Its just a proof of concept for school so it doesnt need to be crazy
@csjohn well service workers I think are your best option client side
but no support for ie or safari. otherwise, you can do it manually but
that might be more effort than it's worth
interesting... any idea if there exists a service worker proxy project?
@csjohn service workers function like proxies you will need to be more specific
Ok I now know where our wires got crossed.. the terminology isn't very forgiving here I'll try to be more explicit
I essentially want to use a bunch of browser instances to my demo app as proxies themselves for network traffic. So I have a server, it hosts a web app. Browsers visit that webapp and are now running my client side javascript. On the server is crawler, or some other job, and I want to take the traffic for that job, and proxy it through the browsers. The end result is masking the IP of the server, and instead showing up as those of the browser instances.
01:22
ok, I know what you are trying to do. However, what tool are you currently using to load the browser on the server?
Hm what do you mean by "load the browser on the server"?
@csjohn are you just interested in rewriting the url?
so that it corresponds to some id
I personally wouldn't use any package for doing something that simple, but you could use angular with ui router, but anyway, good luck.
@Rick Not particularly interested in rewriting the url, but could
Thanks for your input :)
Anyone know bash?
Ik its js chat but just wondering
super simpel
CURRENT=${/usr/bin/curl ifconfig.co}
@BenjaminGruenbaum zend?
01:35
that wont work
@snek BenjaminGruenbaum is afk.
the php thing?
: bad substitutio
nm got it
!!afk
 
2 hours later…
03:48
(removed)
(removed)
@FlameStinger 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.
@CapricaSix ty bot
@rlemon huh, I guess I previously had issues because I was doing {this.props.jsx} instead of just this.props.jsx in the render method..
04:31
hi guys, there's something i want to ask about js
@MabroChickenz 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.
@MabroChickenz just ask your question
is it possible to disable an html textbox based on value from another textbox ?

(e.g: if textbox with id="custom" filled with value "phone" then textbox with id="email" will get disabled while textbox with id="phone" stay enabled)

most post i see will disable the textbox in first input
yep you can
mind to link me a tutorial ? i'm new to his kind of stuff
04:38
you think I have tutorials in the back of my pocket that I pull out whenever I need something
user8871181
yourInput.disabled = true;
@demonhunter24 ahh thanks for the answer. for the top part is it $("#myinput").keyup or $("#myiput").change ?
1 message moved to Trash can
@demonhunter24 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
@demonhunter24 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
thank you for your example mr demonhunter, i'll take it from here :)
user8871181
xd ok
04:48
good evening guys
05:18
Hello everyone
@f-CJ 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.
 
1 hour later…
06:33
hello
I am having problem with Node ACL in node and express i posted my question here
https://stackoverflow.com/questions/52394370/node-acl-not-working-when-trying-to-assign-permissions
Can anyone please have a look thanks
oi morningerino
06:54
I forgot to bring my usual 600 mL bottle of water to work with me yesterday
I realize only now how much that hit me
Stay hydrated, folks
@Neil they don't have water at work
@Rick I bring my own from home
I mean I could buy bottles of water, but really I don't see the point
I just bought one of those ikea 600mL water bottles and I reuse that
but they don't have paper cups and a water dispenser
do you need paper cups and a water dispenser to drink the water you bring from home?
user6718998
hi
07:08
@Thewise \o
user6718998
pastebin.com/1VesBxzp anyone knows why I get undefined for state.data.map ?
user6718998
Material Ui
user6718998
I am trying to select all items from table, not working
@Neil I am conflicted about the benefits of keeping track of a water bottle over simply getting a paper and using a water dispenser. I feel the burden of the water bottle might be more costly.
why would it be more costly?
I paid 2 euros for a water bottle that has lasted me over 3 years
that's like, better than a euro per year
07:13
if you think about it before you leave work to make sure you have it on you. If you go out after work you are going to be that guy with the water bottle. seems like a hassle
gist.github.com/patrickroberts/c84d99145ec55cac78068ceb772915e5 wrote a nifty little userscript to auto-insert MDN documentation links while writing answers. Works on comments and questions as well though.
Well I bring too many things to not use a backpack anyway
I need to bring my own laptop to work everyday, so that includes cables and whatnot
I bring my lunch and laptop to work everyday, but my laptop usually lasts long enough without a charger so I don't bring that unless I know I'll be on it non-stop
HAMMERTIME!
really =w=
07:18
@Neil what is like working for a tech company in Europe. you get free lunches?
well they have a sort of meal system
is it free?
fuuu i forgot keys to my officw
fml
Each company is entitled to whether or not to provide the service, and if they do, I think they get a tax break
Money given in this way is done in such a way as to oblige you to consume it paying for food
This includes say, going to the supermarket, but you can't use it to buy alcohol or non-food products
Again, stupid logic, but I suppose it's to prevent corruption
The money given in this way isn't taxed
So that's why
You can't "pay" your employees by giving them food vouchers, because nobody would like that
user6718998
hmm anyone got some time to look up my question ? :)
07:23
I have this image in my mind of Europe being this dark place where everyone is a Nazi, and everyone is stoic. clearly, it's not a very accurate image, but it's just a stereotype in my mind.
@Thewise your state doesn't have a data property.
@Rick No, you're way off. You're confusing yourself with Germans.
(That was a joke, don't shoot me please)
!!s/shoot/gas/
@ThiefMaster (That was a joke, don't gas me please) (source)
Well I figured if it wasn't true for Europe it wouldn't be true for Germany lol
I guess not
07:28
Nowadays you only find nazis in eastern germany ;)
user6718998
@PatrickRoberts so I need to add data in this.state ? if yes, how it should look like ?
You would think the Soviets would have made them less Nazi-like. I guess not.
@Thewise well based on the callback to map(), data should be an array of objects with an _id property.
The Soviets? They're more nazi-like than the Germans
1 message moved to Trash can
@Thewise Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
user6718998
07:35
you mean like this ?
user6718998
@PatrickRoberts
user6718998
because then if I try to select all, nothing happens
You're saying the Soviets are worse than Nazis. I mean that sorta makes sense. However, Russia has always come across as ignorant poor people who are hyper-paranoid. Not that this has any basis in reality just a stereotype probably learned in social studies.
No, I didn't mean to say they are ignorant
I just meant that after soviet soldiers who were hungry and cold finally won the war, they didn't exactly treat the local germans well afterwards
07:43
Well, that makes sense. But you would think that there would be fewer neo-Nazis in eastern Germany because of that fact.
Well I don't have any idea how many neo-nazis there are in germany
Just like I have no idea how many neo-nazis there are in Peru
You guys don't have a yearly census
@Rick That is not true
@ShrekOverflow which part
> Russia has always come across as ignorant poor people who are hyper-paranoid.
07:50
I said it was a stereotype. but it does not seem too far fetch considering historical figures like Stalin, Trotsky, and that bald guy, and this new guy that fights bears
I am saying it is a stereotype, it probably has no basis in reality. probably a result of the American education system.
@ShrekOverflow are you Russian?
08:11
I am sure Russian have stereotypes about us. I am sure they think we Americans are a rambunctious boisterous bunch who cause way too much trouble.
Hey guys, quick question here instead of posting on SO: Do you know how to type the response from an helper calling`fetch()` with `flowtype`?

In that case, the helper is :
`const callJsonAPI = (url: string, requestOptions: RequestOptions = {}): Promise<{}> `
and the call to that helper is
`const { prop } = await callJsonAPI(//)`

Now, I typed this with
`Promise<{ prop[?: Array<any> }> `
but I get a `Cannot call await with callJsonAPI(...) bound to p because property props is missing in object type [1] in type argument
@AlexandreGomes 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.
08:55
This seems like a straightforward issue not enough for a SO question...I have a JS object which is console logging as:
Data {
fooBar: {}
}
where Data doesn't have a colon, how would I read this key? Or is Data {} not a regular object key?
hmm, maybe it's a symbol?
data is your object
or the name of your variable?
I don't think this is supposed to be valid json, just a representation of the data contained within
Data is the Object it's not a variable
there are more of these colon-less keys nested as well
09:00
they are sperate objects
that come from different constructors
so i would need to merge them or apply the constructor somehow?
I would just ignore them.
they don't interfere with anything you would normally do.
it's messing up my object validator
you can use JSON.parse JSON.stringify if you really want to get rid of them
but I would have a preference for keeping them.
@ShrekOverflow what are they?
09:05
stringify then parse removed them, thanks, still not sure what they are really
@Rick My S/O is russian, and usually I have found the rest of the family pretty normal vOv. The only difference I notice is that they don't smile as much.
I said it was a stereotype!!!
that has no basis in reality.
Hi there, anyone known with bash scripting and javascript? I want to open a chrome browser to a specific website (start chrome www.google.com) and then I want to run javascript in that same addressbar.
@JeroenE 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.
@JeroenE Ok, you can open up the browser. You can even set the address. What you cannot do is inject javascript to run on that page
This still leaves you with plenty of possibilities. If the page you're opening is yours, you can add the script you want to have run just the same
09:21
Neil, yes you can. You can do this: javascript:window.open('http://www.website.com/').ready(Button.startButton()); but for some reason it doesn't work in CMD with this line.
Why does the pixel 3 have a notch!!!!!
@JeroenE Well it seems you've answered your own question then :P
I have always gone google, but this time I might have to go Samsung.
this is really disappoining
@Neil: Nope, as it doesn't work in my CMD. So I'm missing something.
But maybe this is the wrong chat for that.
well I mean that would work if you were already on a webpage
but if you're using node, I don't know if this is possible
09:28
Hi anyone using node js under corporate proxy?
i can't use it due to error of rollback failed
what difference does that make
but still i can't install package
09:52
hi my friends
is there a solution to observe a database table for changes (changes happens from outside)?

- using socket.io, sequelize?
do I have to check it with polling on the sequelize side?
hi guys, i found a big BUG in iOS 12 Safari, is about Array.reverse() api, anyone can see this ? i hope apple can fix this bug. stackoverflow.com/questions/52390368/…
@abelyao 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.
@CapricaSix okay, so sorry, just, it is a big bug.
10:11
Anyone, how to catch xhr cancelled request?
@abelyao CapricaSix is a bot, and it'll always respond that message the first time a user posts here :)
but you do have quite good responses on that question, so you should be able to work with those?
10:27
@BasheerAhmedKharoti check the readyState imho
If it isn't DONE, don't process it
np
@paul23 thank you paul, i am a fullstack developer, i do web project creation in my usual work, include front-end an C#.NET or PHP in back-end.
ok?
10:43
@paul23 He's doing his gameshow introduction
That's where you give a quick sentence describing yourself and what you do, see?
@Neil Sorry, I am not good at English communication. This is translated by Google. If the answer is not correct, I am sorry.
@abelyao No, don't apologize! You didn't say anything wrong
I just hope more people will see this problem, because if calling the reverse() api, it means array's order is important, but it is not reliable now.
@abelyao Well it's important to give visibility to the problem, but I suppose you could find a way around it, right?
hello everyone, On my windows command prompt, C: takes me to C:\users\user_name instead of root C: and also, F: takes me to F:\Work\git. whats the issue?
10:58
Windows will do that by default
when you switch drives, it'll take you to the last folder you were in
ohhh lol
@neil
still not changing
F:\Work\git has become default whenever I am changing to F:
@Neil I can change my code, but many of the running websites will be affected. Maybe I shouldn't post about bug on stackoverflow ?
@RahulJain on Windows, some git tools is based command, maybe it execute in your F:\Work\git ?
@abelyao Nothing wrong with that, but don't take it as your responsibility to "fix many websites". You could report the bug to the safari devs but I doubt they don't know about it yet.
@paul23 You are right, thank you. At first I was not sure is a bug in safari. one similar questions in Apple Developer Forum but 0 replies.
11:21
I just realized that webstorm removes/resolves backslash when copying source code.
that is a pain when working with regex.
11:49
that sounds odd or like a bug
It's nice in IntelliJ that backslashes and quotes are escaped if you paste something between quotes tho
hmm only happens if you copy from "within a single string"
(Or regex, where it is bad)
var chai = require("chai");
var sinon = require("sinon");
var $ = require("jquery");
var assert = chai.assert;

function saveUser(user, callback) {
    $.post("/users", {
        first: user.firstname,
        last: user.lastname
    }, callback)
}

describe('saveUser', function() {
    it('should call callback after saving', function() {

      //We'll stub $.post so a request is not sent
      var post = sinon.stub($, 'post');
      post.yields();

      //We can use a spy as the callback so it's easy to verify
sinon says
Hi in the above code example for using TDD, i am getting an error like so

1) saveUser
should call callback after saving:
TypeError: Cannot stub non-existent own property post

I am using mocha, chai and siono. and can figure out the error
*CAN NOT figure out the error
12:05
@snow ok, I don't know if this is your problem, but here is an issue with your code
You call an async function saveUser with a callback and shortly thereafter check if it has been called
It may be called, but it may not be called..
so what should i do? use a timer?
A timer will just make it improbable, not eliminate the problem entirely
Really the only way is to provide a callback in case of error
Since one or the other will be called
Just verify that you don't hit the error callback
huh. ill do that
but whats weird is this is a coding example from a "reputed" source
Hey Guys
could you please help me creating this graph
@Neil check this out https://codepen.io/SitePoint/pen/vGOrwj

this is browser base, same code, but works
12:19
@snow it works if it gets called before the assert takes place
If it waited for the call to be made, that only works if it gets called
But that's not a check, that's just waiting for the callback to be called and/or a timeout
My guess is that that code works because it's using a stub
it wouldn't work in a "real" call
If we're going to assume that code is correct, then you shouldn't have any problems, should you? :)
isnt testing based on certain assumptions :P
guys
anyone using Bitbucket pipelines here?
@snow Yeah, but a test can also be written incorrectly
@Neil could you please tell me what post.yields() does here? isnt this what is executing the ajax?
@snow I don't use that library, I couldn't tell you for sure
But based on the comment, it seems that's what's preventing the actual call to be made
12:27
whats your preferred testing setup?
users
production
testing? what's that?
school really set me up right. I ship everything once 51% of the tests pass
That's a majority afterall. Can't argue that logic
12:31
with the difficulties i am facing learning about it, i might keep doing the same
users/production indeed. you can have as many tests as you want, but your users will find bugs anyway ;)
(of course this doesn't mean you shouldn't have unit tests as well)
but writing tests costs money, users give me money
flawless logic
@LukeRamsden 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.
I'm stills truggling writing tests for my code, because else I would have to add ~25% of time (which equal +25% increase in cost) on my bill and the clients won't like this
12:45
I worked SQA for so long it should bug me that I don't test more.
but it doesn't, until things break
but that's future rlemon's problem
@rlemon I swear devs do this on purpose: leave obvious bugs inside just so they can have user engagement/talk in the media.
no, that's stupid
they use eastereggs for that
Why else are so many things shipped "half finished" and only finish like a full year after they have been brought to the market.
because then they can make money for an entire year while the product is still in dev
Because time is money?
12:49
it's early-access software, you just don't get a banner like on Steam
@rlemon which means they release software without full test coverage and do that on purpose.
They purposefully want to make money asap
Doesn't make it right, though
Just not as malicious as you're implying
@paul23 releasing software with bugs costs money
that's well known
also not releasing software costs money
that's well known
companies ride a line where they need to make money
that's it
there is no crazy marketing goal here
Well it's mostly visible with games in the last few years. Office software tend to be at least feature complete.
It works well with multi-player games because it allows you to get feedback en-masse from actual players on how they want the game to develop and improve, along with bringing in much-needed revenue to continue development.
It's not a bad idea as long as it's done properly, but most teams screw it up.
13:00
Still I do understand the lack of testing: as a single main developer in a company of 4 people writing formal test cases often add nearly 50% of production time, in comparison with just using smoke tests and early releasing. The manager likes the buzz words but he doesn't like the time it takes; and for me writing tests is really dry work that sucks the joy out of programming :/.
It's definitely something that is more geared towards larger teams.
ndugger ndugger ndugger
I hope it's like beetlejuice
@ndugger ndugz not drugz
13:24
@rlemon unless you can charge the client extra for fixing those bugs afterwards ;)
(pretty unethical, but it wouldn't surprise me if there were companies doing just that)
it becomes ethical when you give them 3 months of free support first tho
user1228
Hey, I've got a question for the chat, if y'all would entertain me... I'm working on a pull request for newtonsoft.json which requires intimate knowledge of how == and === behave. (continued)
user1228
Essentially, I'd really like to create a suite of tests that express every coercion rule and what the expected behavior for each operator should be in each case. I was hoping to find documentation outlining these rules, but I've been spectacularly unsuccessful in locating any definitive source. Would anybody have any idea where or for what I should be looking? I'd appreciate any help. Thanks.
user1228
13:42
If that's not perfect its 1000% closer than anything else I've found. Thanks!
14:18
technically, you can only be 100% closer
that's the Dwight Schrute in me talking
14:29
Hi all, can someone please tell me how can I fix merge conflict on bitbucket see screenshot below:
@MadaraUchiha I read that but couldn't understand it
@MadaraUchiha eslint: no-mixed-freehand-circles - do not mix freehand and non freehand circles
2
Should I checkout master and then git pull ? After git pull should checkout to my branch and then make changes ?
@MadaraUchiha I went through the article but couldn't understand can you please give me some direction ? How can I resolve that conflict ?
14:53
Oh neat table, is there a also a table to what evaluates as "truthy"?
Starting with "examples" isn't really good when you wish to see a clear overview
the clear overview before the examples is not clear enough?
> In JavaScript, a truthy value is a value that is considered true when evaluated in a Boolean context. All values are truthy unless they are defined as falsy (i.e., except for false, 0, "", null, undefined, and NaN).
is that complete?
the "i.e." makes me doubt it.
if you wanted to verify, then you could go look at a list of falsey values
15:05
hi
user1596138
user1596138
Recommended? Don't mind if I do
15:21
how did you not have that one already?
@KevinB gotcha
asked because I was going through a library and I saw a "kevinb" signature hahaha
Joe
Joe
regarding NPM best practices, I stumbled across a few projects that are using multiple sub directories with multiple node_modules folders and multiple package.json files
this seems insane to me... is there a realistic use case for it? I would always opt for 1 package.json per repo
@paul23 e.g. means "here's one example", i.e. means "here's what I mean"
Joe
Joe
yep "for example", verses "in other words"
"example:" vs "in other words:"
lmao nice
Joe
Joe
15:25
:D
/highfive
Joe
Joe
great minds...
that's right
15:43
well, i've seen that setup before in cases where a single project includes both the backend and frontend
00:00 - 16:0016:00 - 00:00

« first day (2895 days earlier)      last day (2275 days later) »