« first day (1434 days earlier)      last day (3512 days later) » 

6:00 PM
I would love to give a talk (there is somewhere I maybe could), but I feel less than qualified. If I choose to write up a proposal, maybe you guys could heavilly proof-read it
Honestly, I could give a talk about how much I've learned from being in this room, lol
 
I'm kind of over the rooms lately tbh
alot of the same stuff over and over :/
 
@Loktar wtf is your new pic ?
 
user enters using jquery, everyone says OMG STAHP LEARN JS
 
I totally get what you mean, but I have learned soo much from the people here
 
@AbhishekHingnikar orc
 
6:02 PM
@Loktar do you miss me bashing js? :P
 
@BartekBanachewicz its been a while :(
 
Does javascript have something like exit;?
 
The search in this ajax is executing only once each keypress (with its timeout of 100ms between allowed requests), but the like button is accumulating. The first click works. The second click (of any one) is executed by the JavaScript twice. I'm using once() and re-enabling it after a timeout. Why is the execution multiplying?
 
I don't write in JS lately so I don't have strong feelings for it
 
JavaScript is like android. Horrible but widespread.
 
6:03 PM
(The third click is three times or more...)
 
@AbhishekHingnikar lol sounds like my mom
 
@Loktar :P
 
If anyone wants to speak at a js conference, this is the one that I was thinking of writing up a proposal for: spacecityjs.com -- I know that a good bit of you guys are way more qualified than me to do something like this.
 
@AbhishekHingnikar but I'd like to improve the state of js
 
your mom is widespread ?
 
6:04 PM
so wide bro.
 
@BartekBanachewicz i'd like to improve state of android too
 
I'd like to improve the state of programming in general
 
according to the video I'm watching, var b = new a() is the older, less favourable version of var b = Object.create(a); -- is this true? I have some rewriting to do when I get home... lol
 
81
Q: Understanding the difference between Object.create() and new SomeFunction() in JavaScript

MattI recently stumbled upon the Object.create() method in JavaScript, and am trying to deduce how it is different from creating a new instance of an object with 'new SomeFunction()', and when you would want to use one over the other. Consider the following example: var test = {val: 1, func: functi...

 
Thanks for doing the search work for me
 
6:10 PM
wasn't hard :P
tl;dr doesn't call the constructor
 
@rlemon come speak in Houston spacecityjs.com -- they're actively seeking speakers.
 
function Foo() {
  console.log(1);
}
Foo.prototype.bar = function() { console.log(2); };

var a = new Foo();
// logs 1
var b = Object.create(a);
// no log

a.bar();
// 2
b.bar();
// 2
easy example to follow along with
 
That seems obvious, am I missing something?
 
Huh, interesting
 
Waitaminute. It's weirder than that. You load the page and click on button X five times. It works each time (only one call each click). But then you click any other button, and it executes five times. Huh???
 
6:13 PM
@KendallFrey it is just an example for him to make it obvious
 
uh, ok
 
It helped
 
@NickDugger Object.create(a) is like saying Object.create(Foo.prototype)
 
@Loktar see? I still learn things in here
 
@aliteralmind must be adding event handlers repeatedly
 
6:14 PM
+1 to @NickDugger learning stat
 
@rlemon that's kinda odd. Any reason why you'd only want to create an object from an object's prototype?
 
less overhead
 
Huh, alright
 
object creation isn't cheap
 
<insert your mom joke here>
 
6:16 PM
@KendallFrey: Right. Been trying to figure out how. I'm only using the one() function, and I see in the log it's only being called once on each click. So how is it executing multiple times? dpaste.com/3KA9237
 
Also, I am serious, someone here should come and speak about JS in houston: spacecityjs.com/#speakers -- if you scroll down to see the FAQ, they can help cover travel expenses, and put you up in a hotel.
> However, we will help you with travel expenses – including a flight, hotel or AirBnB, and a speakers' happy hour.
 
nice
 
@aliteralmind i can has jsfiddle?
 
Well, it's Django. Give me a minute to grab the rendered source...
 
@NickDugger I nominate Lemon, Benji, Florian or dystroy.
 
6:19 PM
wow fuck you too buddy
 
If none of you guys do it, I'll submit a proposal, and you'll then subject many people to my ignorance. Is that what you want!?
 
@Loktar :P
 
haha no worries
 
Not doubting anyone else's skills, but I just think that they are most likely to participate.
Except for @Loktar, he doesn't even have 20k yet.
 
how many talks has @rlemon given?
 
6:20 PM
@Loktar is a scrub
 
@Loktar Not sure, but I'm sure as hell would like to hear one :D
 
@KendallFrey: Not sure how useful it's going to be, cause it's supposed to hit the database... jsfiddle.net/bfy1qzy2
 
@SecondRikudo meh not me
@rlemon is too opinionated
 
@Loktar on programming? none
 
@Loktar It would be smart to include the jQuery library
Since, you know, you are using jQuery
 
6:22 PM
@NickDugger okay so if you wanna know when to use what. think about it. if you constructor does nothing, use new. if your constructor does any work that will slow you down, use Object.create
 
@rlemon dude respond to my opinionated comment with an opinion omg :p
 
@aliteralmind nothing happens
 
@Loktar where?
sorry i'm only half paying attention
 
bah nm no fun now
 
@aliteralmind Use jsFiddle's echo service.
 
6:24 PM
@Loktar "it is my opinion that you suck a bag of sticks".replace(/st/,'d');
2
 
haha
 
@rlemon I think I understand now, and I also understand that I should move some of my methods into the prototype, and I also understand more about the prototype. This has been very informative.
thanks
 
@KendallFrey: Here's the live site, but only ONE user can use the site at a time. It's just a demo. 104.131.200.120/colorliker The like buttons are the problem. Open the console, click the green's like button (yes/no) four times, then click on any other button to see it go nuts.
@KendallFrey: And the click on a third and see it turn into a strobe light.
 
@NickDugger I mean, besides the obvious limitations if you need to run the constructor.. function Foo() { this.bar = 1; } would be super fast on 'new Foo' but if you were doing anything heavy like creating a crapload of properties Object.create might be better.
function Foo() {
      for( var i = 0; i < 1000; i++ ) {
        this[i] = i;
      }
    }
it is silly code, but it would outline the perf difference
 
6:26 PM
@SecondRikudo: Thanks. Will look. Actually, if I put in the hard-coded links into the regular fiddle, it might make work...
 
Nah, I mostly have a bunch of objects that just have... actually, lemme grab a sample from a repo
 
alright dudes im out for the weekend, might come back next week sometime o/
 
I should switch and use Object.create for my demo
function Particle(x, y, r) {
    this.x = x;
    this.y = y;
    this.r = r;
    this.vx = 0;
    this.vy = 0;
    this.image = (function (r) {
        var can = document.createElement('canvas'),
            ctx = can.getContext('2d');
        can.height = can.width = r * 2;
        var grad = ctx.createRadialGradient(r, r, 1, r, r, r);
        grad.addColorStop(0, 'rgba(' + particle_settings.color.r + ',' + particle_settings.color.g + ',' + particle_settings.color.b + ',1)');
        grad.addColorStop(1, 'rgba(' + particle_settings.color.r + ',' + particle_settings.color.g + ',' + particle
probably is a little expensive
 
@rlemon github.com/ndugger/vorge-engine/blob/master/vorge/… -- and then I do new vorge.event({ ... }) in my code.
 
That is the particle code for the demo I posted earlier today
5 hours ago, by rlemon
guys new demo. http://rlemon.ca/stardust.html #friday!!!
don't do that this.foo crap
use the prototype chain
 
6:28 PM
alright, but why?
 
someone correct me if i'm wrong, but to my understanding when you do it inside the constructor it is passed as a property of that instance.
when you attach it to the object prototype chain all instances reference one
objects are not as heavy, and performance is improved (again, assuming you don't have a limitation which requires each instance has it's own private function)
 
But, if I add it to the prototype, and then do object.create, won't it create a new object from the prototype, effectively adding them to the new object, making that useless?
 
@aliteralmind Looked at code, too much jQuery, did not follow
 
@NickDugger Object.create clones properties AND methods in the prototype
function Foo() {
  console.log(1);
  this.value = 2;
}
Foo.prototype.bar = function() { console.log(this.value); };

var a = new Foo();
// logs 1
var b = Object.create(a);
// no log

a.bar();
// 2
b.bar();
// 2
 
@KendallFrey It's only the like function I'm working on. The second half. dpaste.com/3KA9237#line-50
 
6:31 PM
@NickDugger Adding to the prototype chain retroactively applies to all already created objects.
 
I have a <div> and a counter. When a div is clicked upon, using jquery, I increase the counter. However, I would like that when I click on the div a second time, the counter is decreased, instead of increasing again. How do I do that?
the jquery click handlers don't exactly allow that
 
Okay, but then @rlemon why is this.foo = function bad?
 
because you should use the prototype for foo
 
@DemCodeLines Use a boolean
 
function Foo() {
  this.bar = function(){}
}
^ every time you make a new Foo() you create a new function for EACH instance of it
 
6:33 PM
@KendallFrey: Hard coded the urls into another fiddle, but Django won't allow requests from a different server. jsfiddle.net/hmLyamf3
 
Ohhh.... that makes sense now
 
function Foo() {}
Foo.prototype.bar = function() {}
^ every instance SHARES this function
 
Alright
 
@aliteralmind Use the echo service, Luke
 
@NickDugger :)
 
6:33 PM
Danke
 
don't take me word for word, that is just how I understand it
 
@aliteralmind Eliminate everything not related to the problem, like Django
 
might be going on slightly different under the hood
 
@SecondRikudo: Okay. Will take a closer look. Have to step out. Been banging my head on this...
@KendallFrey Right...
 
Nah, it makes sense. However, back to my issue, I'm still nto sure if I should do new foo() or object.create(foo) github.com/ndugger/vorge-engine/blob/master/vorge/… -- I can make a new event object by doing new vorge.event() but I don't actually do anything within the constructor, so should I do object.create(vorge.event)?
 
6:35 PM
Object.create(vorge.event.prototype)
 
And then put all of my properties and methods inside of the vorge.event's prototype?
 
can't tell ya man :P
you have to weigh it against your project (i'm not reading it all)
 
TELL ME YOUR SECRETS
Alright, I will go home and see what works
 
!!rlemonsecret
 
@SterlingArcher That didn't make much sense. Use the !!/help command to learn more.
 
6:37 PM
@NickDugger you saw the demo I posted yea?
particles.push(new Particle(Math.random()*width,Math.random()*height,particle_settings.size));
I call new Particle (it is an expensive as fuck constructor)
 
Yeah
 
but because I do this once, on init, and never again it isn't horrible
you don't notice the performance hit
if you are needing to create objects on the fly, see which serves you better
and that will all depend on what the constructor function is doing, and if you need it to do that.
 
Alright
 
(you can also use Object.create to clone regular objects)
 
J L
Does anyone have any experience with JS data visualization libraries? I'm looking at D3.js and Dygraphs.js, both look pretty solid.
 
6:39 PM
Object.extend({}, source) is my preferred method to clone objects tho
 
J L
wondering if anyone had opinions
 
The guy in the video I'm watching just went over that
 
No one in here has opinions
 
d3.js is the best thing out there for visualizations though
 
6:41 PM
they are completely useless in there @NickDugger
 
tons of support, demos, and extensions
 
J L
@TravisJ Yeah that's what I'm reading, thanks for the reply!
 
I'm dd'ing a hard drive (backup)
300gb hdd, the resulting image shows 86gb
been running for an hour now..
 
@rlemon I'd argue that 75% of that current code is simply there to make the engine go, but the parts are rusty and I'm swapping them out as I go
 
:/
 
6:42 PM
@JL - Plus, Mike Bostock is a genius. This is his site for d3 bost.ocks.org/mike
(He is the author of the library)
 
yay :)
 
@TravisJ yeah he is.
crazy smart guy
bleh decided not to leave work early had to run another build
 
I'm stuck until this drive image is done
then I have to clone it back to another drive :/
 
does your sister work with you?
 
6:44 PM
@rlemon that whole project is one large learning exercise. Some of the code is bad, because I haven't "optimized" it yet. I'm going over it, once piece at a time
That makes sense, right?
 
@Loktar gf's sister. I don't have a sister
 
Is it possible to define my own "search on page" handler with javascript ?
Ie when someone does CTRL+F, I want to reuse the browser search field, but define myself where to find the elements ?

I've never seen that, I don't know if possible...
 
@NickDugger sure
 
ahh gf's sister duh
forgot you only have a brother
 
I'm just pointing out, they do NOTHING in that function but slow you down
@Loktar I suppose I could just make the gf hold the laptop and run on battery
 
6:45 PM
@Loktar - Yeah, really impressive. I read one of his blogs about visualizing algorithms and enjoyed the perspective he provided.
 
And I hear ya, and will change them. I didn't think they would, but it makes sense
 
actually that is totally what i'll do if it isn't done by then
@NickDugger the performance drop probably isn't that great, but you are just creating 3 anon functions where they are not needed
let me see if I can dig out some old POS canvas stuff I had before
 
I get irritated by my i variables, but I suppose I could just set it to 0 each time, and it's not a problem, because they're not nested for-loops
 
no need
for( var i <- scoped to your for block
 
No it's not...?
 
6:48 PM
I read that it's faster to declare it outside of the loop
Maybe that was just the length variable... I don't remember anymore
 
@SomeKittensUx2666 he's calling it twice, I meant the next var i will rescope (reset is a better term probably) it
 
Yah, it's a reset - but they're in the same scope
 
for( var i = 0, count = scene.map.tiles.length; i < count; i++ ){
	var tile = scene.map.tiles[i];
	tile.draw(scene.map.tileset.elem, self.canvas);
}
var player = scene.player;
player.self.draw(player.sprite.elem, self.canvas);
for( var i = 0, count = scene.events.length; i < count; i++ ){
	var event = scene.events[i];
	event.self.draw(event.sprite.elem, self.canvas)
}
@NickDugger how I would have written it
 
you dont lint/hint
unless you mean in the past how you would have written it
because you'd get yelled at for i already being declared.
 
@Loktar I do not
I should
 
6:51 PM
You should
 
@rlemon there are some good st plugins
 
He should
 
my build process is not very automated
or efficient
 
jshint gutter
 
or good
 
6:52 PM
it just does it on save and gives you gutter warnings in ST
 
@Loktar Eh, I don't like the gutter
 
So, putting scene.map.tiles outside of the loop won't give a better performance? I was told that if it's in the loop like that, it has to count the length every time it loops
 
@SomeKittensUx2666 why not?
 
too many false positives
 
eh true since it cant see the entire app
 
6:53 PM
mainly due to me not being done yet
I have it run on build (ctrl + b)
 
but its good for catching simple mistakes imo
 
@NickDugger look what I did there
 
So I type a bunch and build
 
var i = 0, count = arr.length; i < l <-- there is no recalc @NickDugger
 
6:53 PM
so pretty !
 
@rlemon ah, I see now. I wasn't paying attention
Alright, makes sense
 
nice yeah I use gulp-jshint for my builds
 
Oct 22 '13 at 16:44, by rlemon
I'm a bad programmer.
 
but the gutter one usually gets me most of the way there for simple stuff
 
!!s/pro/bro/
 
6:54 PM
@SomeKittensUx2666 Oct 22 '13 at 16:44, by rlemon I'm a bad brogrammer. (source)
 
lol
damn brogrammers pops collar
 
@rlemon I watched the video you linked me to
 
I've never jslinted D:
Amibad?
 
pops 2nd collar
@SterlingArcher meh
 
!!should i finish rlemons work or finish my game
 
6:55 PM
@AbhishekHingnikar You should finish rlemons work
2
 
I mean its a good practice imo
 
:tips trilby, collar was already popped, to reddit I go!:
 
okay cap 6
 
well.. in many peoples opinions
 
@CapricaSix FINALLY SHE YOU IS ARE ON MY SIDE !
 
user1596138
6:56 PM
Is there a reason I don't ever see anyone do a login over websocket?
 
user1596138
Everyone seems to do a post first
 
I should make a youtube comment bot that just corrects people whenever they say fedora
99% of the time they are talking about trilby's
those hipsters don't even know what they are being hip with!
 
@Loktar do you think it will help me? I mean, aside from methods I don't know I generally have good code structure
 
user1596138
@AaronSiciliano ...I don't get it
 
I wonder what would happen if I ran a recent script of mine through it
 
6:57 PM
@SterlingArcher I think so definitely
it just reinforces good practices
 
user1596138
@AaronSiciliano I'll just delete your POS OS and give you the machine back. You're better off ;)
 
@rlemon I don't understand why people would get it wrong
They're so obviously different
 
\o/
3 missing semi colons and bitches about .12 instead of 0.12 (x4)
so not bad, not bad at all
(ran my latest demo through it)
 
is your latest demo any diff from the codepen one?
 
yea a bit
 
6:59 PM
Wow, now I feel like a shitty programmer
 
ah looked almost the same
 
it is actually better performing -- saw some stupid code in it and corrected it
 

« first day (1434 days earlier)      last day (3512 days later) »