« first day (1528 days earlier)      last day (3421 days later) » 

12:00 AM
Yeah I really want the Marina Bay Sands (my uncle was one of the architects) but they're worth like $800 now!
 
I'm going to bed, before I get all nostalgic and shit
 
damn @phenomnomnominal thats cool
see ya @Jonathan
 
Goodnight
 
12:19 AM
This is useful: oboejs.com
4
 
12:53 AM
@Loktar Starcraft !
 
1:21 AM
I just watched a youtube video on how to properly wrap a Christmas present. I love the internet!
 
@phenomnomnominal woah
 
@BenjaminGruenbaum nuts aye.
 
That seems a little expensive
 
I have a JSON file that takes 350ms to parse, is encoding objects as arrays going to make it faster?
 
1:43 AM
I'm very close to finishing my first big/complex javascript project, and I know my code is designed horribly. Would anyone be willing to take a look and maybe give me a tutoring session on how to improve it? Are there services that help with that sort of thing? I mean, the code functions, but I know I would hate having to read my code and try to decifer why it does what it does 6 months from now.
 
@NathanJones sounds like you need to change your definition of "finished"
 
@phenomnomnominal you're right, I meant it's going to be deployed soon (because of a deadline not set by me)
 
Ah. How big is it?
 
~3k lines of JS
probably chump change to veterans, but large to me
 
This will require some effort or some money
 
1:54 AM
what kind of effort?
 
Split code into more functions/modules/files (that alone is going to help probably) and post parts on codereview.se
Watch videos, etc.
 
i get a 'Heroku | No such app' error from that site
 
If you cut out the global structure (all modules with a short description of what they do and relationships), you can probably post that there too
Or here
 
awesome, thanks!
what videos would you recommend?
*video sites/channels
 
That should be good
 
2:14 AM
do you know any good videos/articles on promises?
 
Nope
 
how much code do you write per day on avg?
 
That really cannot be answered
 
Days where I delete code tend to be better.
 
I don't get that...when can you delete code?
 
2:25 AM
When you can do what it used to do with better code.
 
2:39 AM
I have a html page that displays my image fine, but when i use innerHTML to change it from a different one to it, it doesn't display, it only displays the previous image.
anyone had this happen to them
?
 
@wyattbergeron1 This might help: stackoverflow.com/questions/554273/…
 
CHecking it out
@NathanJones Im trying using pure js (no jQuery)
In standard html, it displays fine, but when i use javascript to insert it, nothing happens
 
any recommendation for angular js newbie? is egghead.io worth the investment?
 
If you're just changing an img element, just use .src = newUrl;
 
Ill make a fiddle
@NathanJones here: jsfiddle.net/m3f6qhw5
wait, that's missing variables
jsfiddle.net/m3f6qhw5/1 that's better, @NathanJones
 
3:08 AM
first thing -- change .random(...) to Math.random(...)
 
 
2 hours later…
4:45 AM
Hey guys, could someone please have a look at stackoverflow.com/q/27596693/251311
It's a question about 2-way binding implementation using rxjs
 
@AwalGarg nudge @Zirak link
 
can I assign to $scope in Angular instead of assigning to properties on it?
 
@user2309862 do you mean with controllerAs?
 
no,just setting $scope={//data} inside a controller...is it like exports in Node?
 
5:03 AM
no
 
5:13 AM
ok
 
@zerkms I don't think it's a good idea. Streams are uni-directional, creating another stream to lead data back isn't a solution
 
 
@madhu 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.
 
@CapricaSix okay :)
 
5:31 AM
Hi everyone
i need help with TweenMax plugin
var anim = TweenMax.to(x, .9, {set: 1, ease: Back.easeIn});
this code is not working alos not giving any error in console
what could be the reason?
 
hi guys
couple of basic questions about webrtc, im trying to learn this
anyone here?
 
MLM
5:47 AM
@yayu What is your actual question? "Don't ask to ask, just ask."
 
ok
how many peers can webrtc handle?
Suppose I setup a signalling sever. I and 5 friends connect to it. Do I have to setup a RTCPeerConnection with each one, or is it handled for me by the API, and I just broadcast messages to the group?
this is for datachannel
 
MLM
@yayu Here is the answer to your first question: stackoverflow.com/q/16015304/796832
Every endpoint makes a PeerConnection to all other endpoints
 
so by default there is a mesh network?
 
MLM
Since this is just a datachannel. You could make one person the central endpoint. Combine the data and make a channel to the others
Either approach will work, especially for data. If it were video, it would be extremely hard to combine video streams.
 
so have something like a routing table.. a is connected to m, who is connected to b...?
let's say its a multiperson chat
could you explain the "central endpoint"
 
MLM
5:57 AM
Here is nice diagram of the first approach I suggested:
For the second approach I suggested. The central endpoint is in the middle:
 
ok, so in the first one, lets say we have A,B,C, D. D makes a new message, which reaches its neighbour C, which forwards it to its neighbor B, which forwards it to A... until all peers have the new data
and in the second, any node transfers new data to central node, which transfers it to all other nodes...
 
MLM
No, in the first, D will send it to the others itself.
 
oh, i see now
will any of these configurations scale? if we have, say hypthetically 1000 peers at a time?
 
MLM
In the second, we choose one of the A, B, C, D to be the central endpoint, Say D. Everyone sends their data to D. D combines and sends that info to the others
 
now if I want to make a chat with "rooms" so that a peer can create a new room and other peers can join
so not all peers have to be concerned with the data for all the rooms
 
MLM
6:05 AM
Either approach I suggested would work for the "room" concept.
 
hmm
let's say we have 1000 users. And I want a bb/forum. Every user can see the list of threads, and subscribe to it (downloading all previous posts of the thread from other people subscribed to it) then these will be inefficient. Too much data being given to all the peers.
 
MLM
@yayu Chrome only supports up to 256 connections btw(in the first question I linked). How could you possibly manage to reduce that amount of data?
 
@MLM I was thinking of experimenting with something like a DHT as a learning exercise
each post is being seeded by someone subscribed to the thread the post is appearing in
when someone new joins, he downloads the posts from the seeders and then becomes a seeder himself
 
MLM
The first approach seems to fit the bill from my understanding
 
can I make a kademlia network?
so if there are 256 peers online, each peer needs to maintain a Peerconnection with with only 8 other peers (2^8=256)
and when it looks for a post or thread, it hops the network to find who has it
in maximum 8 hops
 
MLM
6:21 AM
Maybe, you could send a request to everyone and the first one who answers, sends over the data.
I am sure you could merge downstream data and keep cascading but this is all up to you to code. I assume you are talking about a structure like this:
 
if there are say 16 peers total.. I first arrage peers in a ring 0-15-0. Then peer 0 I connect with peer 1,2,4 and 8. peer 1 I connect with 2,3,5,9 etc.. each peers is connected to 4 other peers (because 2^4=16) and each peer is reachable by every other peer within 4 tries. Now let's say each peer is storing a copy of a thread. for simplicity peer 0 stores thread 0, peer 1 stores thread 1 and so on
suddenly peer 1 is interested in finding thread 15.. who has it?
 
MLM
@yayu If you think you can build it, try it
 
is it possible?
in webrtc?
 
MLM
Why not? State some actual concerns. Sounds a bit confusing to implement but sure
 
yay Christmas tree
 
7:06 AM
@Zirak okay, how would one do that?
 
7:26 AM
alright lads?
 
@MontyMonro 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.
 
hi
if i have object with some variables and function how do i call function and pass parameter in following condition
var obj = {
score:100,
s:function(t){

}
};

TweenLite.to(obj, 2, {score:1, onUpdate:sc});
instead of score:1 i want to call s() in TweenLite
 
You mean like obj.s()?
 
yeah
 
Hey @CapricaSix
 
7:38 AM
instead of score:1 in my code i want to call s() and pass argument and do some calculations in obj.s()
 
So call it
 
@SterlingArcher how to call it? i tries s:3 but its not working
* I tried
 
I don't understand your problem, just call the function
 
@SterlingArcher not able to call as we call normally eg. {obj.s(), onUpdate:sc} we have to specify it in this format {prop:value,[prop2:value2]}
 
MLM
@Dramorian Your question is very vague. Do you mean: TweenLite.to(obj, 2, {score: obj.s(), onUpdate: sc});
 
7:45 AM
@MLM no
@MLM i just want to call function. I dont want to assign value to score
 
MLM
@Dramorian Like Sterling said, then call it. obj.s();
 
@Dramorian you need to clarify your question then, because you're making no sense
!!afk sleep
 
@SterlingArcher i have one div <div class="d"></div>. I am trying to animate this div with TweenLite js. i can simply do it by providing css properties but i want to do it using object so that i can use same conept in my main problem
 
@Dramorian SterlingArcher is afk: sleep
 
var obj = {
s:function(t){
$('.d').css('opacity',"1");
}
};
@MLM i have one div <div class="d"></div>. I am trying to animate this div with TweenLite js. i can simply do it by providing css properties but i want to do it using object so that i can use same concept in my main problem
i want to call s() in TweenLite js to animate. In tweenLite we can not call function like we do normally i.e obj.s()
 
8:15 AM
hi
 
@TusharKhanna 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.
 
is there any way so that in my html page i can give accept parameters(application/json) ?
 
hi all
 
Actually i am getting 406 Error from Tomcat with Description "The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers." I am sending Response from Spring MVC application in the form of a string
 
@copy toptal programming things are they hard ?
 
8:18 AM
I have a div, containing some checkboxes. And in this div I have a button. The button click event should open a "preview" iframe, in this iframe, i have to display only the checked elements. I use fancybox. How can I pass the checked checkboxes as a $_POST[] array to the iframe on the click event?
 
@Julo
 
@4esn0k 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.
 
@4esn0k ?
 
@Julo0sS, you can create a <form method=POST target=your-iframe-id>, then submit this form
with javascript
 
@4esn0k i'll try this now
 
9:14 AM
guys :)
I have a htmlCollection, like : myHtml.getElementsByTagName("label");
I have an array containing the labels i have to keep (with ids)
my array is like "myLabels" and contains the labels id's, so [0,1,5]
I have to remove the "unwanted" labels from my "myHtml", but face the problem that when I remove my element, my htmlCollection length is changing...
 
Hello everybody
 
hi
 
@Julo0sS Hi buddy... Start from myLabels.length and count down
 
well here is the example it's a little bit more complicated... : i get some svg data : var mySvg = getSvgFileData(file); (it returns the whole svg "text" as a html object)
i retrieve my layers this way : var myLayers = mySvg.getElementsByTagName("g");
now i have to remove the unwanted "g" from the "mySvg" var and not from the "myLayers" collection... here is my problem...
@Shea length is ok now ;)
 
Ale
9:28 AM
Good morning! (ugt)
 
hi
 
Ale
Going to take my CS exam tomorrow
 
9:45 AM
@Julo0sS Had to step away for a few minutes, all good then?
 
10:09 AM
@Shea almost...^^
@Shea solved my first problem, now facing another one^^ x)
 
Mornin
@Ale good luck
 
Ale
@BenjaminGruenbaum Thanks!
 
10:27 AM
Good morning
 
This is gonna be fun
 
LOL
link? (then delete it)
 
Shhh about it though :P
 
I don't mind giving them tips, I want them to do well after all :)
I finally got around to fix this
 
10:48 AM
 
/r/funny
 
No matter how old I am, I am never old for pokemon
 
feedback plz
 
11:02 AM
:(
 
(on that edit, with promises)
 
11:17 AM
I understand the first the answer, the second one is above my level of understanding
although I don't matter ;P
 
Of course you matter....
Now go jump off a cliff. lol jk
Actually, the second half was a little over my head as well, then again.... I have a bit of catching up to do
My head hasn't exactly been completely in it this past year.
 
11:34 AM
I feel stupid
Is there some way to prevent auto-run in codepen?
Everytime I type while (condition) { }... hang
 
@Neil there is no option to disable that feature I think. but try disabling javascript, write your stuff, save it and then run it.
 
@Shea :D
 
@Neil for writing javascript, I use jsfiddle
 
@SiddharthP I think I found something
Thank you anyway
Found a auto-preview checkbox
 
12:12 PM
what is this fascinating badge? It make me look like a pokemon
 
12:27 PM
finally past the shortest day of the year! \o/
 
user image
2
Not sure why that made me lol
 
12:41 PM
idk, but that's going straight to my Facebook, even though I love Jesus and don't believe in Facebook
lol
 
@BenjaminGruenbaum There's a whole class of jokes with "fuck off jesus"
 
I can't believe I am remote debugging! WOHOO!
 
welcome to 2012!
2
 
you suck
 
12:53 PM
2.9
but yeah, remote debugging on chrome/android rocks
having a real dev tools on your desktop, and seeing the thing on your mobile is amazing
it allowed me to debug some real issues
 
....welcome to 2012?
@SecondRikudo lol awesome!
 
like once, I had a webservice that didn't work... turns out stock android browser (back then, with the old one) needed a special CORS header to work...
 
Any one have Idea how to implement data tooltip feature in IE(Internet Explorer)
 
@DineshChandra That didn't make sense. Try again.
 
@DineshChandra Out of 367 ways, which one do you want?
 
12:56 PM
@DineshChandra the title attribute
 
lol
 
something like this jsfiddle.net/shail/vSTLU/2
I have done this for chrome
for that is no longer working for IE
 
15 hours ago, by Jonathan
Just do what everyone of us should do, drop support for IE -.-
 
which version of IE are you talking about?
It should work properly on IE10 and 11.
 
12:58 PM
Its 9.0 plus
 
Not sure about 9. The bootstrap documentation should tell you if it supports IE9 or not.
Anyways, supporting IE9 is waste of time.
 
it should
wat ._.
supporting IE9 is waste of time? wtf?!
 
Yeah, support IE8, 10, and 11.
No one uses IE9.
 
source?
 
@AwalGarg
source?
 
1:01 PM
@BenjaminGruenbaum there's not much code for your monthly challenge ;)
 
Guys I have an array of values (strings) That I want to turn into checkboxes, then append to target
 
I don't memorize links, TBH.
 
Would you go values.map(toCheckbox).forEach(target.appendChild.bind(target))
Or do it all in the .forEach?
 
The latter.
 
the former
 
1:02 PM
@AwalGarg Why?
@FlorianMargaine Why?
 
SRP
it's not like you gain anything in perf anyway
 
@FlorianMargaine You kinda do
You loop twice instead of once
It could mean stuff when there's a lot of values
 
meh...
I prefer SRP for these cases
 
@SecondRikudo One, it would be one loop, so possible faster. Two, cleaner code.
@SecondRikudo Would you use a named function or an anonymous callback?
 
@AwalGarg Probably an anonymous callback
Unless I'd need to do it in more than once place
 
1:05 PM
I would use a named function, and forEach only.
But you know better...
 
@SecondRikudo that's a terrible reason
 
@FlorianMargaine How so?
 
A named function would be faster, in any case.
 
@SecondRikudo I hope you don't create named functions only when you need to reuse them...
 
@FlorianMargaine I always name inline functions regardless
It's much nicer when debugging
 
1:09 PM
@SecondRikudo how?
 
heya,
I'm tryin to do this : var img = new Image(); img.onload = function(){console.log("image onload");};
not working... any idea?
 
@Julo0sS You are not assigning an src?
The image hasn't loaded?
 
var img = new Image(); img.onload = function(){console.log("image onload");}; img.src=url; //url is setted earlier
@AwalGarg no...
 
@AwalGarg compare
(function() { (function() { (function() { throw new Error('foo'); })(); })(); })();
(function name1() { (function name2() { (function name3() { throw new Error('foo'); })(); })(); })();
in node
 
@SecondRikudo anon function doesn't necessarily have to be in a single line...
right?
 
1:12 PM
@AwalGarg Doesn't matter
> (function() { (function() { (function() { throw new Error('foo'); })(); })(); })();
Error: foo
    at repl:1:49
    at repl:1:69
    at repl:1:75
    at repl:1:81
    at REPLServer.self.eval (repl.js:110:21)
    at repl.js:249:20
    at REPLServer.self.eval (repl.js:122:7)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
> (function name1() { (function name2() { (function name3() { throw new Error('foo'); })(); })(); })();
 
ahh, node
 
Not just in node
Try it in your console too
 
@Julo0sS jsfiddle.net/k88k4p37 no-repro
 
:20593131 function drawInlineSVG(ctx, rawSVG, callback) {
	//console.log("draw function");
	var svg = new Blob([rawSVG], {type:"image/svg+xml;charset=utf-8"}),
		domURL = self.URL || self.webkitURL || self,
		url = domURL.createObjectURL(svg),
		img = new Image();
	img.src = url;
	console.log("svg : "+rawSVG);
	console.log("domurl : "+domURL);
	console.log("url : "+url);
	console.log("img : "+img);
	img.onload = function () {
		console.log("image onload");
		ctx.drawImage(this, 0, 0);
		domURL.revokeObjectURL(url);
ctx = canvas context, rawSVG = my svg code (<svg>......</svg>)
 
1:18 PM
@AwalGarg Now try it with names :)
 
@SecondRikudo I saw, good point.
 
log img gives me [object HTMLImageElement]... so it is created/loaded, right?
 
log img.src, what do you get?
 
Good afternoon.
 
1:24 PM
hi
 
I have a question. When you create a hover for a link. And you want to make it 'fade' as in: from red to green or something. What is then the fast and most x-browser solution? using a CSS transition? Or a Javascript solution?
<a href="#">test</a> Just a hyperlink reference.
 
oh, you are another guy. Sorry.
 
And when test is originally red and you hover on it it will fade to green in 0.5 second or something : )
 
@Duikboot How x-browser?
 
@FlorianMargaine function fails somewhere, drawInlineSVG callback is not called...
 
1:28 PM
@Julo0sS Do you know how to use the debugger?
 
How? You mean from what version? Of browser X?
It should be working on a IE7. :-)
 
@SecondRikudo what do you mean, i use firebug
 
btw @SecondRikudo They still have proper line numbers, in the stack trace. But named functions FTW!
 
@Duikboot then some .on('mouseover', function() { $tooltip.animate() });
I let you fill in the blanks
 
Yeah, I know :) but it's about what is the fasted thing
 
1:31 PM
and I hope you're using jquery, if you have to support ie7.
 
Using CSS or JS. Or will CSS not support that in IE7?
 
IE7. What did you expect?
 
:D Nothing good. @FlorianMargaine
 
IE7 barely supports floats
 
So you want to write code that runs faster than the browser could run? o_O
 
The third one is very similar to how I work on laptop :(
 
OH: We are the programmers, so we know more than you.
 

« first day (1528 days earlier)      last day (3421 days later) »