« first day (2085 days earlier)      last day (2868 days later) » 

7:08 AM
@William Hey! He's mine!
who keeps changing the room title? :D
 
"Stockholm syndrome support group for JS users"
thats what we should call it
 
we should call it Java
 
user3119231
good morning, my loyal programmers
 
You smaht
you loyal
 
user3119231
7:20 AM
^very interesting
 
oh fuck me
How did I fall for that one
 
user3119231
You did because you trusted me
 
well played
 
I was expecting a full blown video like "Node sucks"
 
Jes
7:35 AM
Hi friends
whats the regex to extract the digits in the following
WildFire version 100937-107816 downloaded by Auto update agent
([\d\s]+)
 
is it always with - ?
 
@littlepootis I heard @SterlingArcher is an ISIS supporter
 
@Maurice the reactions tells me that it's rebecca
 
user3119231
blame you @GNi33 and @StephanMuller
 
8:00 AM
hey guys
why does this not work?
var Task = function(name) {
	this.name = name;
	this.age = 34;
	this.items = [];
}
Task.prototype.addTask1 = function(t) {
	t.forEach(function(x) {this.items.push(x)});
	return this.items
}
t.forEach(function(x) {console.log(x); this.items.push(x)});
	                                                 ^

TypeError: Cannot read property 'push' of undefined
dont get it
run with command sweep.addTask1(['cleaning', 'running'])
 
@Ming The scope of this has changed in your forEach
t.forEach(function(x) {this.items.push(x)}.bind(this));
 
@BenFortune thanks. works well.
i always get this problem. but why does this change?
never could understand it
 
Because your scope changes inside functions
561
Q: How does the "this" keyword work?

Maxim GershkovichI have noticed that there doesn't appear to be a clear explanation of what the this keyword is and how it is correctly (and incorrectly) used in JavaScript on the Stack Overflow site. I have witnessed some very strange behaviour with it and have failed to understand why it has occurred. How doe...

bind changes this to whatever argument you pass it.
 
Task.prototype.addTask1 = function(t) {
	self = this;
	t.forEach(function(x) {self.items.push(x)});
	return this.items
}
how come the last return this.items works?
 
That works too, as does t.forEach(x => this.items.push(x))
 
8:05 AM
even though i change to self
@BenFortune is that just due to using rocket syntax?
 
@Ming Read the linked question.
 
Don't do self = this :(
can you do t.forEach(function(x) {self.items.push(x)} , this);
?
 
@Paran0a whats wrong with self = this that = this;
 
At leastdeclare them
 
That should be.. t.forEach(function(x) {this.items.push(x)} , this);
 
8:15 AM
@cswl Yeah I missed that "self".items.You're correct
 
that works. is calling this same as .bind(this)
 
@Ming I find self = this to be a bad pattern.
 
it just looks quite out of place, a single this word in the middle of nowhere.
fat arrow was a good suggestion too. but thanks for that advice.
 
Wait are fat arrows supported ?
 
user3119231
u mean like (arg) => { ... }
 
8:20 AM
@Paran0a depends where
 
@Maurice Yeah , @littlepootis In browsers? I guess node (v6) supports them?
 
Fat arrow is in Node 4
So, supported if you don't care about IE/mobile ;P
 
Yeah , I might consider it if IE11 supported it :P
Noone cares about safari :D
 
@littlepootis :D o/
 
user3119231
@Paran0a this tihng is called arrow function
 
8:27 AM
(Am playing TF 2 non-steam)
@Paran0a the entire mobile world is safari
 
8:41 AM
@Paran0a says the guy who cares about IE11 lol
 
@adds68 Welcome to the JavaScript chat! Please review the room 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.
 
Raise your hand if you can spot the iOS users in here!
Then slowly lower it before your co-workers give you a weird look
 
Well IE11 is not a bad browser
@OliverSalzburg I stretch at my desk all the time , I don't think I'd get any weird looks :D
 
8:57 AM
Heheh
 
!!riot
 
╯°□°)╯┻━┻
 
Yeeey. Caprica is back
 
guys whats the different
 
1 message moved to Trash can
@Arjun Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
9:05 AM
how to give default values in arrow function
var printNumber = (number=42) => {
    console.info(`Given number is : ${number}`);
};

printNumber(12);
printNumber();
 
Anyways. Quick Q. In project I'm working on we have for base AngularJS and also we use UnderscoreJS. Since I'm not a single dev. on this project I can see in code, that there are different undef. checks like _.isUndefined, !_.isUndefined, angular.isDefined, angular.isUndefined, !!. The Q, is what is better to use? From readability point of view it seems angular methods are clear, but from performance point of few it seems !!, that this approach is better.
@Arjun you already did that. var printNumber = (number=42) => { console.info('test: ' + number); }; printNumber(12); printNumber(); just ran it in console.
 
@Arjun That's exactly how you do it, it's ES6 though so make sure it's supported in your browser/server.
 
You can even do ... var printNumber = (number = (n = 42) => n) => {
 
Why would you want to default to a function?
 
9:20 AM
@1983 You don't, it's returning n
It's pointless like, he's just saying you can do it
 
Then I'd need to see the entire function, because that snippet doesn't make sense.
 
Any input regarding my quick q?
 
@1983 Sure it does ^^
 
@cswl @BenFortune number defaults to a function here.
Maybe I'm missing some context.
 
@1983 Defaults to a function that returns n.
 
9:24 AM
Right, but otherwise you'd pass in a number. What's the point of defaulting to a function?
Substitute that in @Arjun's original code and you get nonsense.
 
Ah I see what you mean now
 
Phew, I thought I was losing it!
 
user3119231
Am I the only one who only uses console.log?
 
nop
 
I was implying that you can even have a default value of an arrow function in an arrow function... others had already pointed out that his method was correct ..
 
user3119231
9:43 AM
how can I get the element in an object with functions? (e.g. e.target.maketoggleable)
 
Hi, i want to write arrow function in javascript classes, so far i tried this
class Number {
    printNumber = (val) => {
        console.log(`Number : ${val}`);
    }
    }
 
@Arjun What's the point?
 
but that giving me token is required in visual studio 2015 && custom.js:27 Uncaught SyntaxError: Unexpected token = in chrome
 
class Number {
  printNumer(val) {
    console.log(`Number : ${val}`);
  }
}
That seems a lot clearer and shorter
 
@OliverSalzburg i know that, why cant we write arrow methods in classes ?
 
9:49 AM
@Arjun Why do you want to? It makes no sense
 
hello all

can any one answer this question
http://stackoverflow.com/questions/38139567/trying-to-disable-the-selected-options-from-select-box-if-it-is-selected-in-anot
 
@OliverSalzburg OK
 
That syntax is proposed as class properties... but that would assign printNumber to every instance of Number.. rather than being in the Number's prototype.. basically doing this.printNumber in the constructor..
 
@cswl ok
 
10:30 AM
$("#div1").load(function() {
alert("The div has been loaded.");
}); replacement load function ??
 
@VijayaRaajaVelu Is that a question?
 
yes @OliverSalzburg
 
@VijayaRaajaVelu Then you need to rephrase it
 
Add some words to your question to make it more clear :D
 
i want to call a function after #div1 is loaded in page.
 
10:45 AM
Sounds like an XY problem, but you might want to check out developer.mozilla.org/en-US/docs/Web/API/MutationObserver in case it isn't
Hint: You can't use a selector to select a DOM element that doesn't exist
And jQuery .load does something completely different. You might want to have a look at the documentation of the methods you're using
 
@SomeKittens Haha, that's good enough. Making it for fun?
 
what is he making? I'm losing track of the conversation at some point
 
11:01 AM
A game
 
what game?
 
Jun 26 at 21:46, by SomeKittens
@SomeGuy do you know of any place to get a bunch of assets for a top-down spaceship game (Canvas)? I'm using OpenGameArt right now but the selection is poor. Willing to pay reasonable amount of $$$
 
sweet
thanks for traversing the chat log for me ;)
 
Haha, sure, no problem
What have you been up to, by the way? More wargames?
 
anyways, I'm getting a tiny bit closer to my Podcatcher (client) every day now
 
11:04 AM
Sweet!
 
playing around with networking on Android right now, will finish my book in 2 weeks or so
 
Is it going to look ugly as balls or are you working on a good UX too? :P
 
and after that, it'S go time
 
Wow, that's neat. How's it been so far?
 
first, it's definitely going to look ugly as balls
and I'm going to code against a fake API that definitely will be subject to change once I start coding the server
 
11:05 AM
I’m using a switch statement with a regular expression to detect what type of input has been submitted by checking if the first letter is either a C, I, J or R and that it ends in 6 digits.

This works well unless something that doesn’t match the criteria is entered as regex returns *null* which means when the switch statement tries to access the (now non-existent) array I get *“Uncaught TypeError: Cannot read property '0' of null”* because regex returned ‘null’ so index *[0]* does not exist.

I can fix this by wrapping the switch statement in an if/else statement to check for *null* and mo
 
@JacobWood Welcome to the JavaScript chat! Please review the room 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.
 
I'll try to set it up as "your own podcast service", where you can install the server on any machine you want (I'm going for my RasPi) and just connect to it over a web app or an Android app
 
That's a little longer than I expected, I seriously appreciate any input though!
 
Android app will be the first on the list, just because I'm into that right now
 
Oh, that sounds like a neat idea
What will you use for the server? PHP? :P
 
11:09 AM
I'm not sure yet tbh
but PHP is an option because I want to learn Laravel, yes
on the other hand, I want to learn Node and Python too, sooooo
 
@JacobWood You could have a simple if (!output) return "Not found"; before the switch...case
@GNi33 Haha, one project at a time, though :p
 
exactly
 
Completely forgot that if I call return then the function ends -_-
 
Android's real fun for now
 
Sounds good to me, thanks!
 
11:11 AM
Sure, no problem
 
if I would have a better system, it would even be enjoyable I think
 
@GNi33 Well, that's a first :P
I haven't given it a fair shot yet, though
It'll probably be a while until I do. I'm prioritizing better now
 
it's weird sometimes, but that's just stuff you gotta get into
but so far I have 4 "finished" projects as a reference and to play around with, which is nice
 
Hey, that's pretty neat
 
and I tried to make my git commits as reasonable "learning steps"
so I can just go through my git log to see why the hell I did what I did
mental note: I should write more code comments
a lot more, actually
 
11:13 AM
Hahaha, yeah, especially when you're just learning things
I went back to some of my old Lisp code, and didn't understand anything. Had to re-learn a bunch
 
yeah, I think git will help me out big time in the near future
 
How's that?
 
like I said, those learning projects I got there have commits packed to certain features pretty much
always started with a completely empty Android project and went step by step from there, one commit at a time
so I can later take my git log to see where I went from what to what
 
Ah, right, of course
Ooh, did I tell you about a presentation I signed up for?
I'll be presenting "Intro to x86 and Reverse Engineering" at a local meetup
 
nice!
 
11:19 AM
Plan on reverse engineering CMU's binary bomb live on stage. Let's hope it doesn't explode in my face :P
 
is it going to be filmed?
I demand video and slides to be uploaded right after your set ;)
 
Sadly, no. But I think I'll record a practice session before it actually happens and put it up on YouTube
 
that'll work for me
 
Live demos are always so exciting and scary
 
yep
 
11:21 AM
@JacobWood i don't recommend accessing the 2nd dimension in an array without a check if the 2nd dimension exists
 
I remember one I did at school. Wrote a C program for class, with tests and everything
Went almost without a hitch, except most people didn't understand pointers, making most of it pointless (teehee)
2
 
:D
 
Should have known my audience and explained pointers in depth first
 
or just showed them that one youtube video
 
Haha yeah
 
user3119231
11:23 AM
lol.
 
user3119231
	console.log(cursorX - (cellMarker.offsetWidth / 2) + ", " + cursorY - (cellMarker.offsetHeight / 2));
	console.log(typeof(cursorX) + ", " +  typeof(cellMarker.offsetWidth) + ", " + typeof(cursorY) + ", " + typeof(cellMarker.offsetHeight));
	console.log(cursorX + ", " +  cellMarker.offsetWidth + ", " + cursorY + ", " + cellMarker.offsetHeight);
 
but seriously, it explains it so well
 
user3119231
leads to:
 
user3119231
NaN
number, number, number, number
444, 93, 278, 292
 
user3119231
can't figure out why the first line gives NaN.
 
11:24 AM
Happy birthday, Canada!
 
@Maurice Subtracting number from string.
 
Your concatenation coerces everything after it into a string
So cursorY is treated as a string
And you're subtracting from it
 
user3119231
totally true. My bad.
 
user3119231
thank you very much. I missed that string point. (I even did a typeof log)
 
11:34 AM
wow, programming in vim in this machine with these graphical options and a certain vimrc is actually a true pleasure 0.o
like, you just want to code to see the code get parsed with no delay and the pretty colors and characters be displayed
 
use a case insensitive regex which is what the i means at the end of the regex, .test is better suited here since it returns a boolean so it's easier to deal with, and then use charAt to get the first letter
@towc yo dawg, i heard you like code..
 
it's like christmas all over again
in the middle of the summer
 
what am I looking at
 
the whole thing
just so pretty (' 0.0 `)
 
@towc what do you mean with 'no delay' btw?
 
11:41 AM
that vim isn't lagging at all
soooo smooth
 
does it often lag?
i've never used it to write code in
 
it used to on ubuntu, probably I had quite heavy plugins
 
your antialiasing is also really nice
 
You use it like that , with transparent bg?
 
looks way better than windows
 
11:42 AM
@Paran0a yeah, I can read what's behind it (like the docs of something) and look at the pixel-values of pages I'm writing
@bitten debian arc dark ;)
 
@towc does that theme handle font antialiasing also?
 
He sharpened the screenshot in photoshop!!!!
 
@bitten no, but with this debian DE you can customize literally everything
 
user3119231
is there a way to get an element which "lays" under an absolute element?
 
@Maurice ?
 
11:44 AM
I don't think there is , if I get what you're saying.
 
@towc it looks so pretty
@Maurice do you mean visually?!
 
user3119231
 
user3119231
I need to get "b" cell
 
in JS?
 
but A is also under that element?
 
user3119231
11:44 AM
exactly.
 
depending on the position of something else on the page?
 
It's also over A , A1, B1,A2,B2,A3,B3
 
it's been friday here for almost 14 hours
 
user3119231
Situation: If I release my mouse now I just want to get the nearest element, to change column positions. A simple "order your columns by drag and drop" script. Is there generally a function which lets me retrieve an element through this black wrapper? ## nevermind, I just loop through all columns and check which is closer.
 
11:46 AM
you guys should head to asia on thursday night
then travel westerly back to the states
 
Is there anyone here that extracted xml values that containes multiple namespaces with oracle sql
 
then you'll have the longest friday
@Maurice something like elementFromPoint?
 
Hi, silly question but does anyone know the rationale behind readonly textarea's being non-scrollable?
and is there an easy fix?
 
user3119231
@bitten you lady, are the mvp today!
 
ty
but i'm not a grill
:#
 
user3119231
11:48 AM
<3
 
still <3
 
@Jonathan Can you give an example?
 
Sure one sec
 
@SomeGuy btw... the new Blink album is out and on Spotify :)
 
11:50 AM
i can scroll this
 
I think it's pretty good actually
 
oowwww
Awesome
 
@GNi33 Danke!
 
Good news, must be some custom styling we have
 
Gern geschehen
 
11:51 AM
@Jonathan okay.. perhaps overflow
 
Rofl that's why I was confused ,I clearly could scroll :D
 
No, computed style has overflow auto :(
 
make a fiddle?
 
Trying to reproduce, but the problem is not in the HTML
 
Clearly
 
user3119231
11:57 AM
brain.exe stopped working - time for weekend
 
Before I start searchign for eventHandlers... Any other CSS properties than overflow which can cause this behaviour?
 
check the event listeners
 
It's not breaking on scroll, mousewheel, pointer events, click ....
0.o
:D
Wow
Element inspector
we have some code that places a div over the textarea o,0
when it is readonly
/facepalm
 
I hope there's a good reasoning behind that :)
 
Well, I work here for around a year
so my guess would be no
No wasn't it, it was pointer-events: none, not sure how I missed that the first time
 
12:11 PM
GMO-Free what?!
 
@AntonMedvedev Welcome to the JavaScript chat! Please review the room 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.
 
user2620028
12:29 PM
@anton they are all hipsters and direly concerned with eating food that they didnt grow themselves
 
12:44 PM
Hi :)
 
I don't care what I eat as long as its dead.
 
Is there a clean way of dispatching parent events from an angular controller? For instance handling click events of the body via an ng-include module inside the application?
 
@Abhishrek \o nice
But why non-steam? Steam's tf2 is where the fun's at.
 
Did tf2 finally get competitive?
 
the download spoils the fun
 
12:53 PM
@Paran0a It has been in closed beta for a few months. (I've got a few passes, btw)
Now, the stress test is open for every premium player with two-factor auth.
It will be open to everyone in the next "neato" update.
I don't really know what "everyone" means.
But it will probably be open to free-to-play players.
@Abhishrek but it's worth it. Because multiplayer.
 

« first day (2085 days earlier)      last day (2868 days later) »