« first day (1873 days earlier)      last day (3092 days later) » 

crl
8:00 AM
{x:{x:yourObject}}< 2 levels
 
@PiyushDholariya Short answer: no way. That is what debugger is supposed to do. You can make objects inaccessible from console (by using closure) but you cannot hide from debugger. You can obfucate your logic, however, but if it is not commercial it is unlikely to hide your stuff well.
 
@Sheepy what if it's commercial?
 
I have seen commercial obfucators that simply blow up the browser when user open dev tools. Can't argue with the result.
 
@MadaraUchiha great, see you at 8ish
@nickB yeah
 
@BenjaminGruenbaum where?
 
8:02 AM
@nickB: Thanks for your efforts man
 
 
@PiyushDholariya : no no i was curious myself. Curiosity is good. Even I'm confused about closures. Hope anyone can make me understand in a proper way.
 
nickB closures are dead simple.
 
good noon guys
 
@Amitavin 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.
 
8:04 AM
@risn then explain please
 
they are simply functions that have captured their outer scope.
 
example ?
 
which javascript framework is good for .NET application like, AngularJS, KnockOutJS,EmberJS
 
Polymer JS
'cause I am using that right now.
 
Here is a code with a string object variable, "foo", whose value is "bar". Can you read or write it from the console?
(function(){ var foo = 'bar'; setTimeout( function(){ alert( foo ); }, 0 ) })()
 
8:07 AM
var x = function (abc) {
    var i = 10;
    return function () { console.log(abc + i);}
};
the inner function has captured the values of i and abc.
 
let me execute
 
I just know that a function inside another function which can access values of the parent function is supposed to be called as closures
something like that
 
crl
!!mdn closure
 
@PiyushDholariya Note that foo is not a property. But if you can seal off objects in a closure, their properties will be as inaccessible as the objects.
 
8:09 AM
yes, because it has closed over the outer scope including (in this case) abc and i;
that's it. easy peesy.
 
okay got it thanks a lot guys
 
ya, just like that how many functions can be inside a parent function? coz it gets complicated at depth
the term 'more the merrier' is violated here
 
no it doesn't because the js scope boundary is the function.
you just go 'up' one level.
 
@nickB Tel Aviv
 
what are the benefits of PolymerJS over other framework?
 
8:12 AM
@MadaraUchiha ok :(
 
@BenjaminGruenbaum : cool!
 
I may as well teach you how to change foo, so that you know what you are getting from us:
Set a breakpoint, reload, and when you step through the code you can change foo's value in the debugger.
This is the "nothing you can do" part. At least not for stupid sheep like me.
 
crl
you're a cheap sheep ship chip
 
no man you doesn't seem stupid
 
!!nudge 5 deploy
 
8:16 AM
@MadaraUchiha Nudge #5 registered.
 
crl
@Madara don't let those arrogant/asshole cdoubleplusers annoy you :)
3
 
^
 
@crl You aren't considered a real moderator until someone complains about you on meta.
Guess that means I'm a real boy now.
 
crl
hehe
 
Ya, stupid people work at alphabets
 
8:18 AM
everyone knows you can't increment a string anyways
 
@nickB where from you belong?
 
@MadaraUchiha How could someone complain about you?
Sounds like a interesting story :P
 
@Cerbrus More of a train-wreck
 
@Cerbrus You were out during The Big Lounge Drama™ yesterday, were you?
@ivarni I will admit that the war comment was a bit out of line.
 
@MadaraUchiha nudge deploy
 
8:21 AM
Apparently
 
@MadaraUchiha I thought so at first glance but then I spend some time reading transcripts
 
The only drama I saw was here, which is now cleaned up: meta.stackoverflow.com/questions/311451/…
 
@ivarni No, they managed to successfully bait me. I wasn't expecting this high level of trolling.
 
@MadaraUchiha where?
 
!!> (e => ++e)('1')
 
8:22 AM
@Sheepy Command > does not exist. Did you mean: 3, d, y, ^, !, π, ? (note that /tell works on commands, it's not an echo.)
 
It was my first lounge meltdown, I'll know better for next time :)
 
@Sheepy 2
 
1 min ago, by ivarni
@Cerbrus More of a train-wreck
 
> BartekBanachewicz Are you sure? Because I've had a really long day, and a war sounds very good to me. Test me.
@MadaraUchiha: That reply. <3
 
@Cerbrus The amount of noise in that room is unbelievable
 
8:24 AM
it seems there is fire in your belly
 
There are 7 people trying to be constructive and speaking to you at the same time
While 20 others just want to make noise.
@Cerbrus I was closer than I'd like to admit to suspending at least 10 more people in that room
I'll be better prepared next time. But I'm happy to see that despite some of the errors I know I've made during my interaction with them yesterday, meta support seems to be overwhelming.
So I guess I did something right :)
 
way to go madara!
@MadaraUchiha oh my, reading that thread is gonna be cinematic
 
like route 66
 
Wow. Brad Larson used some strong words to describe C++ Lounge. Glad we are a good model here :)
 
@AwalGarg The transcript is even better.
As if contribution to Stack Overflow somehow gives you a right to be a total jerk to everyone who tries to speak against you.
 
8:31 AM
@MadaraUchiha lol
 
What a pity. I don't plan to test whether my company has a porn filter. :(
 
By that logic, a 2.5k user like me is totally allowed to be an arrogant asshole dick to a new 1 rep user.
 
@Sheepy There weren't links or anything like that
Just very inappropriate language
 
tame badhaye aa su mandyu chhe? mungina maro ne
 
Because... after all... I have contributed like 2500 times more than him.
@PiyushDholariya English please.
 
8:33 AM
^
 
goodmorning
 
> Frankly, if it were up to me, I'd freeze the whole room and be done with it. The C++ Lounge has been getting away with completely unacceptable and unprofessional behavior for years. I welcome the members of the Stack Overflow community to read the last few days of the transcript from the Lounge and to give us a reason why this chatroom should be allowed to continue.
3
yay! lounge freeze!
 
Source?
 
16 mins ago, by Madara Uchiha
1 min ago, by ivarni
@Cerbrus More of a train-wreck
 
41
A: Request for community attention on a moderator's behavior

Brad LarsonThis is an extremely distorted depiction of what happened in the C++ Lounge earlier today. What actually happened was this: Stack Overflow moderators received several flags about offensive messages in the C++ Lounge. Among the messages that we saw in that chatroom was the following (warning: lan...

 
crl
8:49 AM
an you return/abort from a .reduce?
 
What a mess.
Damn
 
@Zirak :( where is it? (find /sys/class -name 'edid' -type f)
 
@crl as a work in progress?
 
@AwalGarg I don't know. It has been frozen before, and obviously get unfrozen every time. Is it the chatroom with most freeze count? We can use a counter!
 
crl
@rism array.reduce
state = ["foo", "", "foo", "", ""], stateValue= "foo"
state = ["foo"], stateValue= "foo"
state = ["", "foo", "", ""], stateValue= "foo"
state = ["foo", "", "bar", "", ""], stateValue= false
state = ["", ""], stateValue= false
need to do that, with a reduce it's possible, but sometimes you can know the result is false before the end
(the idea is a to check if the state array contains only 1 non-empty values)
hmm can filter first.. but I like to not do repeated loops
!!> ["foo", "", "foo", "", ""].filter(e=>e).every((e,_,a)=>e===a[0])
 
8:58 AM
@crl "false"
@crl "true"
 
That's... that's not good
 
crl
there should be a mapfilter function :)
 
the moment you do a filter you've iterated every item so at that point you're better off in a good ol' for loop
 
@FlorianMargaine How is that anything but extortion?
Goddamn
 
9:09 AM
@Cerbrus clearly.
@rism for performance reason? meh
 
"Pay this settlement, and you have to sign this NDA because we don't want the negative attention!"
 
@rism if a mapfilter makes things more readable, I'm all for it
@Cerbrus exactly.
"you don't want to pay and sign? ok, here's a police raid"
 
crl
!!> [].every(e=>true)
 
@crl "true"
 
!!> [].every(e=>false)
 
9:17 AM
@Sheepy "true"
 
crl
!!> []?1:2
 
@crl 1
 
crl
^ did that change recently?
!!> []==false
 
@crl "true"
 
crl
fucking inconsistent
 
9:21 AM
!!> [ []==0, []=="", 0=="" ]
 
@Sheepy "true"
@Sheepy "true,true,true"
 
Hmm. I must have remembered something wrong.
 
crl
so if [] is falsy, why []?1:2 returns 1?
 
Gooood question. Why? :)
 
crl
!!whaie ?
 
9:24 AM
@crl That didn't make much sense. Maybe you meant: why
 
crl
yes I meant that
 
@crl because you touch yourself at night
@crl That didn't make much sense. Maybe you meant: what
 
It is similiar to why "2"+"2" is "22" but "2"-"2" is 0 (instead of ""), just more subtle. If you don't trust yourself to remember all the rules, always use ===
 
turnary checks for presence, not values
 
crl
!!learn why because rlemon touches himself at night
 
9:26 AM
@crl Command why already exists
 
crl
I'm stupid
@rism wat?
 
!!> Boolean([])
 
@Cerbrus "true"
 
!!> !![]
 
@Cerbrus "true"
 
crl
9:27 AM
@Sheepy "2"-"2" = "2"-(+"2")
or something like that, hmm nvm, I mean - forces number, but + no since it's also the concatenation operator
 
@crl Yes. My point is, "+" does not always force number but "-" does. Each operators has their own conversion steps, including == and ? and even ()
 
crl
!!> [+[], +[1]]
 
@crl "0,1"
 
So... just stick to ===, and make sure you cast variables into the correct type.
 
wooo
time for some more stupid questions :D
 
9:34 AM
Ah, I remember now.
!!> [ [] == 0, [''] == 0, [] == [''] ]
 
@Sheepy "true,true,false"
 
@crl I was referring to your "so if [] is falsy, why []?1:2 returns 1?"
 
crl
@rism I know but what is 'presence'?
 
@crl I think rism means "whether it has some value or some object", and array is an object. Which is quite correct... and quite different from most other operators.
 
o.k. so [].toString == "". When you do a []==false js actually does [].toString()==false but when you do if([]) JS just looks to see that object exists. Since turnary is iffy it does the same.
i..... think ;)
 
9:40 AM
hey @rism have you used express/multer?
 
@PiyushDholariya India
 
@rism Usually. Counter example:
!!> Number(0)?1:0
 
@Sheepy 0
 
So after loading a html form via ajax success: call....
it should be submitable right?
 
@rism Ah, sorry I made a mistake. I forgot the new.
 
9:43 AM
okay
 
have you ever wished that you could define a private global object for a closure?
 
success: function (content) {
 $("#results").html(content);
 
@djsmiley2k If the html has no form it is not submittable. If you put the html in another form then your form will be overridden and is not submittable either.
@r3wt No. What make you think you want that, that closure doesn't provide?
 
@r3wt what do you mean?
 
anyone familiar with a database versioning tool that does not require $ ?
 
9:54 AM
@Sheepy how about if I forgot to close the form D:
oh wait duuur the input button is outside the form :DD
 
@djsmiley2k Forms are automatically closed - like p, tr, li, option, body, html, and some other elements - if you didn't close it.
 
@Sheepy yeah, input button was outside of closign tag.
Fixed that, but still won't submit
	echo '<form action="ajax/attachToJira.php" method="post" class="upload" method="post" role="form" id="' . $jiraID . 'Form" name="' . $jiraID . '" enctype="multipart/form-data" ><div class="row"><div class="col-md-6 form-group">
		<div class="fileUpload col-md-5"><input class="attachBtn form-inline" type="file" id="' . $jiraID . 'File" name="' . $jiraID . '"></div></div>
		<input type="button" id="submit" value="Attach" /></form>
</div>';
 
if(a){ } else if (!a && b){}<-- There, !a && is redundant, right?
 
@djsmiley2k Try copy the result HTML from browser's network tab's respond data.
 
@Cerbrus yes
 
10:01 AM
I thought so. Gotta get some caffeine...
 
@BenjaminGruenbaum just asking, still got interest/time for that review? if not, that's completely fine as well :)
 
@Cerbrus Do you know about express/multer?
 
express is more better than multer
 
crl
multer is using express...
and 'more better' hurts
 
:27246306 Please select relevant file for datafix: T048 with JIRA ID: ITODF-425<form action="ajax/attachToJira.php" method="post" class="upload" method="post" role="form" id="ITODF-425Form" name="ITODF-425" enctype="multipart/form-data" ><div class="row"><div class="col-md-6 form-group">
		<div class="fileUpload col-md-5"><input class="attachBtn form-inline" type="file" id="ITODF-425File" name="ITODF-425"></div></div>
		<input type="button" id="submit" value="Attach" /></form>
</div>
 
10:06 AM
@AwalGarg I got time, but it won't be before the weekend.
 
sure, np
 
yeah it can be
 
@feniixx Nope
 
Damm
I'm having trouble with it
 
!!welcome feniixx
 
10:11 AM
@feniixx 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.
 
Good. First, put the code into your favourite editor and format it (with indent). You should see something wrong.
Second, are you expecting the button input to submit on click? If yes, check your doc on input element.
 
@CapricaSix you don't need to remind it ... If I ask and nobody reply then what am I supposed to do?
 
What about the relative action url Sheepy? I'm no PHPer but that's a killer in MVC.
 
<form action="ajax/attachToJira.php" method="post" class="upload" method="post" role="form" id="ITODF-425Form" name="ITODF-425" enctype="multipart/form-data" >
	<div class="row">
		<div class="col-md-6 form-group">
			<div class="fileUpload col-md-5">
				<input class="attachBtn form-inline" type="file" id="ITODF-425File" name="ITODF-425">
			</div>
		</div>
		<input type="button" id="submit" value="Attach" />
	</div>
</form>
Is that better @Sheepy ?
Was it the fact I closed the form before the div or something weird like that?
 
Anyone know how to change the name of a file uploaded with ng-file-upload?
 
10:14 AM
@djsmiley2k See my second point.
 
@feniixx Caprica is a bot .
 
@rism Doesn't matter. We use relative path all the time, and button type input does not submit form anyway.
 
@feniixx I'm reminding you not to ask a specific user to help you. Just post your question.
 
@Sheepy type? :D type="submit"
not sure why I had type = button :/
 
ok
 
10:16 AM
@rism Shush ;-)
 
If it is submit, then the code's form can be submitted and that's all I can help :(
 
ty sheepy :)
 
Let us have secret codes, that, when posted in the room by a regular, makes caprica post a corresponding rule of the room.
 
sorry Cerebus, did i spoils your fun?
 
Not quite yet
 
10:17 AM
yey it submitted :D
 
Glad I helped :)
 
Cerebus (/ˈsɛrəbəs/; also Cerebus the Aardvark) is a comic book series created by Canadian cartoonist Dave Sim, which ran from December 1977 until March 2004. The title character of the 300-issue series was an anthropomorphic aardvark who takes on a number of roles throughout the series—barbarian, prime minister and Pope among them. The series stands out for its experimentation in form and content, and for the dexterity of its artwork, especially after background artist Gerhard joined in with the 65th issue. As the series progressed, it increasingly became a platform for Sim's controversial beliefs...
Doesn't look like a wolf to me :P
 
@Sheepy now to submit it via ajax instead, and have it 'finish' the previous ajax call too
 
Example:
rlemon: enorandcalls 42
caprica: @<user-with-id-42> Please avoid pinging random people with your questions unless they are already helping you by will.
 
This is where my head realyl starts to hurt :D
 
10:20 AM
Not a wolf? That consolates me. 🐑 🐑 🐑
@djsmiley2k You can't "finish" the "previous call" if you have received html from the previous call - it is already sent. And you can submit the form the same way you send the first ajax. Search on SO if you need code.
 
@Sheepy yeah I think I didn't explain that nicely
boss wants me to use synconious calls.
Yes I know there depreciated.... :/
 
Even worse, "synconious" calls don't exist
 
So Idea is that we load this form, user submits, we load the 'next' form (it's going line by line through a textbox'
@Cerbrus yeah I can't spell, and right now getting a bad cold too :P
 
Let me repeat. You can't "finish" the "previous call" if you have received html from the previous call - it is already sent. Doesn't matter whether it is async or sync.
(And it is already fully received - i.e. done - if you are using onload, onsuccess, readyState===4 etc.)
 
Synconious sounds like a great name of a band
 
10:32 AM
Or the greek god of contact management.
 
!!google Synconious
 
Wow. One single result.
 
I get three ?
 
I got three when I do it manually too. I expected Caprica to return all three :p
 
10:40 AM
!!google google
 
Going off. Have a good night~ 🌜
 
:o
gn8 @Sheepy
 
🌜
 
10:44 AM
sheep tight
 
guys, maths question (not homework): I need to simplify sqrt(-24+10i), and according to wolfram alpha it's 1+5i and I have no idea why, mind helping me out?
I've tried a couple of things like multiplying by the conjugate, multiplying by itself over itself...
nothing really seems to help
@BenjaminGruenbaum ^
 
@AwalGarg Inaccurate: it has an accepted answer.
 
how do you split a sqrt(a+b) into a sum of 2 sqrts?
 
@Neoares is there a way to do it?
 
idk
just wondering
 
10:48 AM
@towc just factorize it into the form a^2 + 2ab + b^2, no?
 
but sqrt(-24) is 24i
 
@Neoares wat
 
nvm
 
@AwalGarg this
 
@AwalGarg hmmm... how?
@Neoares i*sqrt(24)
 
10:49 AM
I don't have a pen and paper around me :/
 
true
sice i = sqrt(-1)
just square both sides
 
@AwalGarg wait... that was quite helpful actually, solved it!
thanks!
 
np
 
I totally forgot about i === sqrt(-1)
Just shows how much I used that since learning about it.
 
:o
I used it on electronics
on 2nd career
 
10:53 AM
@Sheepy ok hmm
gonna have to bug boss to see what he thinks we can do
 
@djsmiley2k Sheepy went to sleepy
 
@rism fair enough
 
Gotta lotta wool to grow tomorrow.
 
This is one of the few things annoying about my boss
he has his way of doing things, and wants me to follow them (that's fine)
cept it's deprecated.
 
I am trying to run the function in the factory file
through the controller file
but the function will not run
any idea why?
This is how the console looks: imgur.com/6mdyBjp
 
11:02 AM
hello everyone, can someone help me know what global.randn is ?
it seems its not part of javascript!
I am porting a javascript application to c++. would be great what kind of library the former app is using for such methods
 
Well, that didn't take long. You can practically set your watch by the time it takes between the completion of a moderator election and the first complaints to show up on Meta. — Robert Harvey ♦ 9 hours ago
 
@Hossein are there other methods called by "global.*"?
sounds like you have a javascript support library offering these c++ equivalents
 
@Neil: Yeah, another one is global.zeros(n)
 
@Hossein Not sure what randn is supposed to do, but it isn't pure javascript
maybe you just need to update the support library
 
global is nothing in core JS, btw. It is defined by node (likewise is self)
 
11:11 AM
@Neil: the actual statement is like this : global.randn(0.0, scale) this basically generates a random number it seems, but since there are other calls to other methods, I thought its better to find the actual library before mistaking something with something else!
 
jsfiddle.net/qow3Ludz please help with this. I am sorting an array ob objects .. and its not outputting properly .
 
@AwalGarg: Ok then it must be declare somewhere in the app if its not a library
thanks by the way guys
 
!!> Date(2015, 11, 15)
 
@shortCircuit "Wed Dec 02 2015 06:17:13 GMT-0500 (Eastern Standard Time)"
 
11:17 AM
why
 
@shortCircuit See the link
 
the no more old ie link ?
 
Yes
If you meant why no more old IE
 
duh :D no
 
11:19 AM
I mean why Date(2015, 11, 15) is Wed Dec 02 2015
 
@SterlingArcher hahaha i.imgur.com/LJzrwMn.jpg
 
@GNi33 SterlingArcher is afk: home and signing lease
 
but when I add a new to Date it does fine
 
@Hossein Definitely see if you can fix it by updating the library, since it may be doing something more than simply generating a random number
But if you can't find anything, Math.random() generates a number from [0, 1)
 
!!> new Date(2015, 11, 15)
 
11:20 AM
@JacquesMarais "2015-12-15T05:00:00.000Z"
 
@shortCircuit Oh I see now.. Wow, that's weird..
 
If anything, make a function called randn that performs that call so you can change it easily later
 
@shortCircuit I think Date without new doesn't expect any parameters, so it just gives today's date.
 
hm, that makes sense .. is there any better way to write that code .. looks very messy
 
What code? The new Date(2015, 11, 15)?
 
11:23 AM
no no the sortByDate function
 
Oh ok
I'll see if I can figure out a better way
 
Woo! We started a chatroom war with Lounge! Bring it on!
 
what? how?
 
@shortCircuit Well, I'm not really used to that type of ES6 yet..
Sorry :P
 
11:32 AM
np
 
I think it is time we revoke Lounge's license of claiming that they are the best chatroom on Stack Overflow.
 
c++ lounge?
 
@shortCircuit Yep
 
3 hours ago, by Awal Garg
> Frankly, if it were up to me, I'd freeze the whole room and be done with it. The C++ Lounge has been getting away with completely unacceptable and unprofessional behavior for years. I welcome the members of the Stack Overflow community to read the last few days of the transcript from the Lounge and to give us a reason why this chatroom should be allowed to continue.
 
11:46 AM
As much as I hate the guys in the Lounge, I don't want to promote internet censorship.
 
I think it should be done sparingly
Though I also can't allow just anything to be said
it isn't an internet chatroom, it is stackoverflow's chatroom
 
Also if the Lounge gets frozen, all the diarrhea will spill over into the other rooms.
 
c++'s been frozen before
 
@KendallFrey Truer words have not been said
 
is the id of a input field passed in $_POST ?
or even in the $_FILES ?
 
11:50 AM
name is, and that is a PHP thing, not HTTP thing.
 
<input class="attachBtn form-inline" type="file" id="' . $jiraID . '" name="file" ></div></div>
hmmm
 
that is terribly ugly
 
I know.
:D
can I just add x=blah and have it come accross? :D
$_FILES['file']['x']
 
pkill -9 lounge
3
 
K I'll just abuse the name field :D
 
11:56 AM
@shortCircuit JS end process.
 
Some serious shit is going on in C++ lounge.
 
yep
 
I think it's going on based on some kind of misunderstanding about someone said something playfully and some took seriously
 
I don't get what the start of that was though
 
@nickB I noticed:)
 
11:58 AM
@GNi33 they were talking about rape and disrespecting women in general
maybe it was in "good fun", but something of that caliber that could be taken out of context shouldn't be said at all
 
seriously? because if it's just about that one sentence that Madara quoted, I don't get all the flack
 

« first day (1873 days earlier)      last day (3092 days later) »