« first day (1540 days earlier)      last day (3411 days later) » 

12:15 AM
Yep. Though the conversation was more around when a company posts a "senior" opening, determining what they're looking for.
 
I wonder if they even know
 
I once went through the application process for a senior job. After a full-day onsite, I was turned down as "not senior enough". I'm still not sure what they were talking about.
 
most likely your looks
get some gray hair
 
heh, that's another problem I have.
 
Grow a beard
 
12:20 AM
@Zirak not everyone can grow one :(
 
@Zirak Actually, just shaved what I had.
 
@BadgerGirl Collect assorted fur and hair residue and glue it onto your face
 
@Zirak wear a wig upside down
 
wear a merkin
on your chin, that is
 
wow, I just googled that
 
12:23 AM
'MERKA
 
'MERKIN
 
@BadgerGirl image search, I hope
 
yeah
 
What are good benchmarks for Angular?
 
12:48 AM
You could start by looking at the running time of each procedure in your profile. If you doing a lot of network calls sometimes you can speed things up by not transmitting lots of files and transmit a medium sized file. Loading data from a image file sometimes takes a lot of time and it can be faster to pick part of a larger image then to transmit lots of files.
 
how can i use [].forEach on a DOM node element.attributes ?
[].forEach.call(element.attributes, function(attr) { /* do things */}); // not working !
 
@amin [].slice.call(element.attributes).forEach(function (attr) {
 
@SomeKittens how does it works ? why i should use slice first ?
 
m59
It makes it into an actual array
 
It converts element.attributes from a NamedNodeMap to an Array
 
12:56 AM
@amin Sure it does
Which browser did you test it on?
 
chrome
 
Your original code is working for me.
 
let me check again
no it's not working on chrome
chrome 39
 
m59
@amin it really is though jsbin.com/paxata/1/edit :)
 
Define "not working"
What do you expect to happen, and what actually happens?
 
12:59 AM
[].forEach(k.attributes,function(a) { console.log(a) });
VM1175:2 Uncaught TypeError: #<NamedNodeMap> is not a function
// in chrome log
// in chrome console
 
You forgot the .call
[].forEach.call
 
omg
@Zirak i am an idiot !
 
It's okay, happens to us all
 
:)
 
Remember to always doubt yourself again, and then again, and then again, before placing blame elsewhere.
 
1:01 AM
@Zirak you are a wise man
 
meh
 
Maybe a wise chip?
 
1:28 AM
Hi!
Anyone good with using Google Maps? I'm trying to display 2 maps (the same) on one page. It only shows one.
 
@SecondRikudo Steins;gate is messed up, it's awesome
 
Any ideas?
 
Make sure you name your <div id=""> areas different?
 
@Asher But why? They're the same maps just with different sizes.
 
@RahulKhosla an id should be unique to the page.
 
1:37 AM
@SomeKittens But that won't effect it surely?
I could draw two 500px square's with the same ID and it would draw two.
 
@RahulKhosla Imagine my name was SomeKittens, and you wanted me to move. You'll say, "SomeKittens, move!". How will @SomeKittens and I know who you referred to?
If you have two elements with the same id, "moose" for example, and you say "Element with an id "moose", render!", how will it know which one?
 
So would I just create the full map function twice?
 
Apply the same one to two different elements.
move(Zirak) and move(SomeKittens) would be the metaphor
 
m59
Why does this not work? (incoming code)
!!> var fn = ''.toUpperCase.apply; fn('test');
 
@m59 "TypeError: Function.prototype.apply called on incompatible undefined"
 
m59
1:40 AM
doh, got it
 
@Zirak @SomeKittens jsfiddle.net/owap6jLk
 
this does not have memory
@RahulKhosla That's because browsers accept broken html
 
@Zirak Say; both my maps use the same js functions.
 
m59
yeah, so it can't be done, right?
 
Ahh so they do not accept broken JS?
 
1:41 AM
@m59 It can
Challenge yourself and write it. Function..bind will be useful.
@RahulKhosla The html specification says that an id must be unique.
 
Yeah but what I'm asking is, does it accept broken JS?
 
No
 
Ok thanks
 
You're trying to select an element with a certain id. An element.
 
@Zirak getElementByID('map-canvas'); should change to getElementByClass?
 
1:44 AM
You can't get an element by class, since there can be several.
 
m59
@Zirak I tried everything I can conceive.
 
You can select all elements with a certain class, and then select one from them
@m59 I believe in you
 
m59
I can't imagine what context I'd need to bind, but I went ahead and just started binding all of them :)
 
@m59 This might help jsh.zirak.me/ppxe
 
m59
that makes perfect sense.
 
1:49 AM
Do you know what you want to achieve? Can you describe it?
 
m59
I need to make a function which calls toUpperCase with the context of the first argument.
var fn = function(str) { return str.toUppercase(); };
 
@BenjaminGruenbaum So I just removed all the safeApply calls (some were incredibly silly - let's trigger another cycle in a $watch function). They were ~3% of the codebase and the app is MUCH snappier now!
 
Cool. Do you know of a function which takes a function fun and a variable thisArg, and calls fun with this set to thisArg?
 
m59
yeah, .bind :)
 
// in other words:
var fun = function () { console.log(this); };
var thisArg = { a : 4 };
magicFunction(fun, thisArg); // logs {a:4}
bind returns a function which does that, yes. What have you tried to do with it?
It's tricky, I'll give you that. You need to play with Function..bind and Funtion..call a bit.
 
m59
1:55 AM
 
Part 5 of my answer here may help
But Steins;Gate!
 
m59
2:34 AM
@Zirak can you help me talk it out?
 
@m59 I'll be very unresponsive, since I'm watching a show that's driving me crazy. But go ahead.
 
m59
''.toUpperCase.call doesn't work because it doesn't remember its parent, right?
 
!!> ''.toUpperCase.call('blah')
 
@Zirak "BLAH"
 
m59
yeah, but I haven't wrapped my head around what goes wrong when you reference that like var fn = ''.toUpperCase.call
.call loses its context?
 
2:39 AM
Because this is decided at call time, and nothing about fn tells it to assign this to ''.toUpperCase
 
m59
I've tried to bind that back in
heh, got it
 
Neat! What'd you get?
 
m59
''.toUpperCase.call.call.bind(''.toUpperCase);
 
Nice!
 
m59
To make it stick, I'm just going to write it out....
 
2:43 AM
Hey not that it's related to the topic but please take a look at Stephen's comment on answer. Does he make any sense? stackoverflow.com/a/27750975/3808877
 
@Steve 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.
 
m59
toUpperCase.call actually has a context of toUppercase, right @Zirak ?
Which is lost when assigning that reference
 
It didn't have the chance to lose one
Yep yep yep
 
MLM
@Steve Java != JavaScript
Try the Java room
 
m59
@Zirak and that second .call isn't necessary :)
 
2:45 AM
You have some redundancies, yes, but you're on the right path
 
@MLM I don't think it's a Java question, to begin with. It's a "does this comment make any sense question", no need to direct them across rooms.
 
m59
So, toUpperCase.call is the right idea, then you just .bind .call's context of ''.toUppercase and booyah.
var fn = ''.toUpperCase.call.bind(''.toUpperCase);
 
MLM
It makes sense but it references the Java code being bad which might be better suited there. In any case, just making sure he knows.
 
m59
can it be better?
 
Point taken and appreciated.
 
2:47 AM
Yes. Think what you actually want to get by doing ''.toUppercase.call
 
m59
a function that calls that function with a given parameter as the context
I can't wait to figure this out. Then it's quesadilla time.
 
Is there a difference between .toUpperCase.call.something and .toLowerCase.call.something?
 
m59
DOH.
Function.call.bind(''.toUpperCase);
 
NOICE!
 
m59
Quesadilla time for me?
 
2:51 AM
Quesadilla all night long
 
m59
o/
 
3:03 AM
i have a single page application that can only work with one variable, how do i make it work with more than one?
 
@13375 - you'll need more pages to get access to additional variables ?
 
Take a careful look at where the variable was made. Its usually best to have a limited scope. If you need another variable or function make a new one or pass the variable.
 
3:28 AM
Don't worry too much about complicated code. Just take your time to understand each part. Some variables are easier to change then others.
I can maybe take a look at your code if you need help.
 
 
1 hour later…
4:31 AM
@adeneo
I'm able to do it, but can't seem to get this fiddle to work when running jQuery:
http://jsfiddle.net/64x3pbzc/
 
 
3 hours later…
7:58 AM
0
Q: How to enable the active item to selected in dropdown in the pages when its onload

errakesh converting this UL to dropdown <ul class="list-group showdiv"> <a href="developmentService"><li class="list-group-item {{{ (Request::is('developmentService') ? 'active' : '') }}}">Bespoke Software Development</li></a> <a href="UserExperienceService"><li class="l...

 
 
1 hour later…
9:17 AM
Anybody know a relevant event for onselect for mobile browsers?
the event doesn't fire when I select text in an input tag on my mobile devices
 
9:41 AM
I guess you're out of luck
 
yeah, I was just wondering if anyone else had run into the problem
It seems that it fires on mobile if you select a portion of text, and then tap on the selection
 
I guess that makes sense
you don't want to fire it before the user is done selecting
 
very true
 
 
1 hour later…
10:58 AM
@phenomnomnominal absolutely none.
@SomeKittens awesome, glad to hear.
The person wh o did them is quite incompetent :D
 
11:10 AM
!!define wh
 
@darkyen00 No definition found.
 
11:43 AM
!!work or Transistor or Saints Row 4
 
@Zirak Transistor
 
As you wish
 
Understanding scope in Javascript! goo.gl/DM1ehh
 
11:58 AM
@Zirak Try German with me!
Also, what's Transistor?
 
@SomeGuy But it's weird to learn a language one won't actually use and sharpen. I don't have people to talk in German with, or German literature/shows to watch. I do, however, want to learn Russian one day
It was just on sale in Steam
Same guys who made Bastion. Lots of fun so far.
Amazing soundtrack, too. Here's the theme: youtube.com/watch?v=41tIUr_ex3g
 
@Zirak You don't have German literature you want to read?
I'd like to learn Russian too, though
There's a lot more Russian literature I'd like to read
 
12:19 PM
@SomeGuy The kind of German literature I want to read involves really, really, really knowing the language, or clawing my way mercilessly
 
morning!
 
@DevStarlight 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.
 
does anybody know how to play a webRTC video in local and non-upload to the server?
 
12:54 PM
 
That looks... Interesting...
 
@SecondRikudo I am thrilled.
 
:o $50 tho
 
1:12 PM
@SecondRikudo I guess they won't charge subscription fee later ;-)
I pay $7.99 for Wartune a month :-> // yes i am sorry ass player
@SecondRikudo in my guild there is a char called Madara
 
@darkyen00 He's fake.
There's only one real Madara and you're speaking to him.
 
be the real then :P
 
Not that I mind spending $8/mo for a game, I just don't have the time to play it.
 
^ I got this playing like 1hour per day in 1 month :->
 
@darkyen00 If I had 1 hour per day to play games, I wouldn't be playing Wartune :P
 
1:26 PM
@SecondRikudo 1 hour per day multiplexed*
 
1:45 PM
hi all , does anyone know how to link javascript with a submit button with php?
i need when submit button is clicked for a new tab to open but php does the validation ect
 
1:56 PM
What did i just read ?
 
@darkyen00 haha sorry man , i just realised it makes no sense
@darkyen00 i was wondering how to be able to pass a variable from html to php using javascript s php needs to process it , i dont know much about javascript
 
21
Q: How can I help a child learn to program?

bjb568How could I help a smart preteen child (pre-teen) learn programming? He does well in school, and he has skipped 2 grades and is an introverted stereotypical nerd. He is very interested in web development and has mastered the fundamentals of HTML, CSS, and JS, which I don't know anything about (I'...

Isn't bjb 13?
 
2:13 PM
Hello JavaScripters
is JS - the good parts still considered the "proper" way to design JS code?
 
Never heard of the latter
As for the good parts - Crockford's linter is a bit too strict at places, but his coding style does make sense.
 
@Gordon Somewhat. It's currently a bit outdated (Crockford himself changed his design styles since then), but still a very good resource for beginners and intermediates.
As for design patterns - I don't like it, in fact I loathe a lot of the things he shows there, but it may be a good passageway for people who come to js from other languages.
@BenjaminGruenbaum recommends it
 
@Gordon for your or a friend?
 
I just sampled the latter. Singleton pattern makes sense in OO languages. Javascript can do better.
 
@BenjaminGruenbaum for me. I didn't do any serious JS in years and would like to catch up
 
2:19 PM
@Gordon Ah, the good parts is definitely worth your read to understand the language but take any solutions he suggests with a grain of salt. Modern JS changed a lot in the last 6 years.
 
Pretty much any OO pattern is quite heavy-handed IMO
 
The main advantage of "The Good Parts" is that it's short and to the point and disspells a lot of stuff. This is also probably worth your time.
The patterns book is good and I'd recommend it - that said there is not a single pattern there today I'd actually use as is.
 
@BenjaminGruenbaum In what sense is it good then?
 
Crockford for example hates using this and using new, I disagree with that today since new is often the only way to get meaningful objects in the debugger.
@JanDvorak it shows you a lot of ideas on how to do stuff.
 
@BenjaminGruenbaum do people still put things on the prototype?
 
2:23 PM
so... read/forget/do-it-yourself?
 
@Gordon I put functions on the prototype all the time.
 
I heard the new ES6 has classes
 
@JanDvorak read, understand the problems discussed, understand the solutions offered, code some and formulate your own idea about them.
@Gordon yes, and they're sugar for prototypical inheritance.
 
which has existed for ages, just the syntax was bad
 
Prototypical inheritance works just fine in practice, it's about sharing functionality though and not fields - you can share fields too by doing "super" if you'd like MyParent.call(this)
@JanDvorak it wasn't bad, it was just verbose imo.
 
2:25 PM
@BenjaminGruenbaum same difference ;-)
 
thanks. I am off to read that JS Garden thing now
 
Enjoy :)
 
@BenjaminGruenbaum What are the problems with initialising fields by sticking them into the prototype?
 
@JanDvorak that two objects would share the same field value?
MyType = function(){};
MyType.prototype.x = {y:3};
var a = new MyType();
Var b = new MyType();
a.x.y = 6;
b.x.y; // 6
 
@BenjaminGruenbaum Writing to a property creates it in the instance, doesn't it?
 
2:27 PM
That's also why it's not a part of ES6 classes, I even have an answer on that somewhere if I can find it.
@JanDvorak yes, but as you can see in my example it fails if you're accessing a property of an object for example.
The simple solution is to just do:
MyType = function(){ this.x = {y:3}; };
var a = new MyType();
Var b = new MyType();
a.x.y = 6;
b.x.y; // 3
 
anyone here know angularjs?
 
Oh. That. It could lead to accidental sharing of mutable objects. I can see why it would be a problem, thanks.
 
sure.
@redshift did you read the room description?
 
oh cool ok
can someone help me understand what an angular 'model' is?
is it basically a container of data?
 
essentially
 
2:33 PM
just wondering how to associate the word 'model' to that
why not call it angular 'data' ?
DVC
 
He has no idea what he's talking about?
 
i know that i know nothing, sir!
 
crl
!!mdn insertAdjacentHTML
superVeryLongFunctionName
 
3:17 PM
@redshift wasn't talking about you.
 
<script type="text/javascript">
$(document).ready(function () {
$("#s_btn").click(function() {
// pass to php here
});
});
</script>
how can i pass the #s_btn" to php?
 
Visual metaphor for the..erm...'low-quality material' that shows up in chat:
 
@LukeSmith You can't. The pipes of the internet are too thin. You can send a piece of HTML but not the element itself.
 
@JanDvorak i am trying to get when the submit button is clicked for the anchor tag thats created using php to open
@JanDvorak at moment it only works via a link but i want the submit buton to do what the link is doing
 
I don't think I understand
 
3:27 PM
@JanDvorak ok. I have a form with a submit button , this button submits to php, and creates a link thats generated from the database . This link must be opened when the submit button is clicked
 
As in, the server, after receiving a submission, redirects to the page the link was pointing to?
 
how to return from an amd module with callback funciton ?

// datastor.js file
define(['external-library'], function(el) {
el.doSomething(function(data) {
// now the data is available
return data;
}
});
//
 
StackExchange user's system is so poor
and delete system is so poor..
 
720
Q: How to return the response from an Ajax call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable inside the function and return that one, but none of those ways actually return the response. f...

 
and merge account system so poor
 
3:33 PM
posted on January 03, 2015

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} See you at AEA, Bostonoids!

 
@JanDvorak thanks
 
@Catgocat A chain is only as strong as its weakest link. Now if you don't mind leaving...
 
@JanDvorak I am alright here. I'm sorry that bothers you.
 
converting my ejs templates to dustjs
{#categories}{#. category=.}
	<section class="category {category.slug}">
		<h2 class="name">
			<a href="/{category.slug}">
				{category.name}
			</a>
		</h2>
		{#category.forums}{#. forum=.}
			<article class="forum {forum.slug}">
				<h3 class="name">
					<a href="/{category.slug}/{forum.slug}">
						{forum.name}
					</a>
				</h3>
				<p class="description">
					{forum.description}
				</p>
			</article>
		{/.}{/category.forums}
	</section>
{/.}{/categories}
 
can anybody help me answering this post? stackoverflow.com/questions/27754767/…
 
3:44 PM
Looks very specific.. I've never seen whatever 'webrtc' is discussed here.
ohh i see. thought it was some video thing.
 
hello guys
I need regex that
removes all special characters
from string
and leaves letters and numbers :)
 
@macroscripts Good luck with that ;-)
 
@DevStarlight - blobs can be read clientside with the FileReader API, even WebRTC streams
 
@JanDvorak I am not asking for free ;)
 
then add 0-9 in your regex next to A-Z
 
3:48 PM
@macroscripts Whom did you pay to let you ask?
 
and know how to replace text in JS?
 
:20762533 yup i know something.

var str = "abc's test#s";
alert(str.replace(/[^a-zA-Z ]/g, ""));
but this throws out numbers too
I want regex that leaves letters, numbers and blank spaces ;)
 
Do you know how it works?
@macroscripts those emoticons are kinda annoying ;-)
 
str.replace(/[^0-9A-Za-z ]/g, '')
 
see the a-z? just do the same for numbers
 
3:50 PM
@adeneo thanks! I'll keep an eye then over there!!
 
"32189312_ss".replace(/[^a-zA-Z0-9]/gi, '')
that works..
Search for ocurrences and replace what is not a-zA-Z0-9
by ''
 
yesterday, by Second Rikudo
Reminder: Most of us agreed not to help obvious and continuous help vampires
 
the ^ symbol is equivalent to "not"
 
yesterday, by Second Rikudo
Reminder: Most of us agreed not to help obvious and continuous help vampires
 
I'm eating kolaches by the handful this morning. so fat
 
3:51 PM
@Catgocat also, your regex is inefficient
 
@JanDvorak Why is that.
 
@JanDvorak I am not a person like that. I ask and I am willing to offer a counter service.
I just don't want to waste time on something
 
like a handy?
 
I don't know.
 
@macroscripts str.replace(/[^\w\.]+/g, '') ??
 
3:52 PM
no
 
hah, that's what popped into my mind, too
only a mouthy
 
@DevStarlight - The answer is the Filereader, look it up on MDN and try some stuff. I can't set up a working WebRTC stream to test it with now, so there's not much I can do, you'll have to test it yourself, but that's the way to read streams and buffers clientside
 
@macroscripts You're not a help vampire, you're looking for a freelancer?
 
I'll write a regex for $100
 
@DevStarlight also keeps underscores
 
3:53 PM
Me to. "a regex". There. $100, please.
 
@Luggage Good try. Take care.
@adeneo this guy can get something from me.
 
@macroscripts We are serious. You offered us money. We gave you a regex. We want the money.
 
39 more points :D
 
@macroscripts whatever he obtains from you may be compensated by us.
 
@JanDvorak not that much. I can write this myself. I would just need more time. You can get a rep.
 
3:55 PM
@macroscripts If you can write it yourself, why come begging here and throwing around claims of money that you aren't going to fulfill?
 
@JanDvorak 100$ ?
 
@macroscripts You didn't put a price tag
 
@JanDvorak No way.
 
5 internet-bucks
 
@macroscripts str.replace(/[^0-9a-zA-Z]+/g, '')
 
3:57 PM
Or maybe eight star-bucks will do.
yesterday, by Second Rikudo
Reminder: Most of us agreed not to help obvious and continuous help vampires
 
speaking of starbucks.. i need to get some work done and it's not happening at home..
 
@adeneo thanks for the tips, I'll keep my research over there ^^
 
@DevStarlight - over where ?
 
@BenjaminGruenbaum for your poll, I figured it was years of experience, but my coworker (who left) had many, many more years on me but his code quality was shit, so was he senior? I suppose so, but was he better than me, a (technically, but not titled as) junior? No
 
@adeneo MDN
 
3:59 PM
anyway the regex you have is what i was going to lead you to. I barely do any regex and only know tht baseics, though
 

« first day (1540 days earlier)      last day (3411 days later) »