« first day (967 days earlier)      last day (3975 days later) » 

7:04 AM
@JanDvorak well duplicate id's is invalid HTML right?
i think 99%
 
Correct; however, people still manage to use them every now and then
 
although isn't angular.js invalid html with the arrtibutes?
 
g2g, sry
 
i thought only data-attr were allowed?
kk
cya
!!/stat Connor extended[1]
 
@Connor Connor has 730 reputation, earned 14 rep today, asked 12 questions, gave 58 answers.avg. rep/post: 10.42. Badges: 0g 1s 13b
@Connor User Elusio proved elusive.
 
7:16 AM
@Darkyen hello
 
Greetings Mr Connor
how may i help you mate ?
 
in Lounge<C++>, 15 mins ago, by SomeKittens
I'm Learning C the Hard Way, and am working on use of valgrind. Problem is, it's "mostly broken" on OSX 10.8. Should I not worry about it, or is there an alternate I can use until I get my Linux back?
 
@Darkyen help me what?
 
just wondering why you pinged :D
 
@Connor That didn't make much sense. Use the help command to learn more.
@Connor That didn't make much sense. Use the help command to learn more.
 
7:23 AM
@SomeKittens Why not use the XCode ?
iirc XCode has special tools for that :-|
 
@Darkyen becuase you just entered the room
AFK
 
@Darkyen the whole point of The Hard Way is to avoid using tools like that
 
Is there something like a local codepen i can run on my own computer ?
i really like what codepen does :-/
LIVE EDITING
@SomeKittens Valgrind is a very mature tool.
 
@Darkyen Tincr
 
@BenjaminGruenbaum you really are amazing
 
7:28 AM
@Darkyen Edit from chrome developer tools right into your css files
 
@BenjaminGruenbaum too much pain :-(
especially since i am not just editing css, i will be playing with js and html the same time
Wait i left the room ?
 
@Darkyen It's 40 lines of code to emulate, you know. Add a listener to the change event of ACE editor, and update an iframe based on it
 
hmm
Also, are there any articles on game development ? ping me with them :-) ... as in planning and choosing right tools... blah blah
 
@hermantran 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.
 
7:48 AM
@web2students.com i think you could be weird, no actually just kidding :P
 
@Darkyen LiveReload
 
@Connor what you said is not joke but
 
@web2students.com but? yours was ? :)
 
the fact, i am really weird
 
are you kidding?
 
7:51 AM
guess
 
@niklaus 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.
@@web2students.com 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.
 
@web2students.com I never got it...the "just kidding" or "j/k" after a message. If your humour is so bad it (a)goes unrecognized, or (b)not intentionally sarcastic, what's the point of even saying it?
 
@Zirak lol, that's my point
 
New to javscript and using the prototype method to make classes, how should I group them in my code? Or should I expect to see a 3k line cluster fuck?
 
Zirak, on net we can't hear tone, talk with strangers, so we say jk so that other person understand it
 
7:54 AM
@Mikhail, no need to cluster fuck
 
sometimes my friends take my jokes seriously
 
Separate for dev, join for production.
 
@phenomnomnominal I have 4 classes in the same file! Its got tons of lines and my vim is breaking tring to scroll them
 
you may aswell put - spammers are chat/messages that are unwanted, people are not interested in it, and rules are conditions are similar.. ignore everything before the arrow < @Zirak @web2students.com
 
I just saw horrible code :'(
 
7:55 AM
So put them in separate files
@BenjaminGruenbaum, It's okay, It wasn't real. Just a dream.
 
@phenomnomnominal I don't know how :-(
 
@phenomnomnominal Thanks, I needed to hear that.
 
@web2students.com But it's stupid. If people take your jokes seriously, either change them or continue silently mocking your friends (the latter is awesome)
"All dogs are blue now. lol j/k" is stupid
 
are you just kidding? ^
 
@Mikhail, just, put them in separate files? Look up the module pattern.
 
7:56 AM
!!/tell Zirak 420
 
@Zirak hehe hehe hehe hehe..... hehe hehe ... hehe
 
@BenjaminGruenbaum It's real. It crawls under your skin at night, goes to your brain, and lays its eggs. The eggs hatch, and little bad segments of code embed in your brain.
3
lol just kidding XD
I had you fooled LOLOL
 
@Zirak Phew, lucky you said that, I was really scared there for a second
 
@BenjaminGruenbaum LMFAO
 
7:57 AM
@BenjaminGruenbaum plz give me access to really funny room
 
@web2students.com I move there jokes you say that are really funny.
 
Lol
JK (I didn't actually laugh)
 
@BenjaminGruenbaum yeah that's so funny how you moved them messages.... just kidding :P
is pissing himself!
jk
 
i will take you to court, my jokes are copyrighted @copyright 2013 , copying fully or partially is not allowed without my permission else you may go to ...etc see google to read all rules
 
Ah, borat not jokes.
@web2students.com Woah, please let me know if you are kidding or not, otherwise I would have no idea. I take the internet very seriously.
 
8:00 AM
no he/she not otherwise he would have put it on the end of the message like this "... just kidding :P"
 
give me access to room i wouldn't do anything
 
If you wouldn't do anything, why do you want access to the room?
 
I hate the anxious wait between reading something and knowing whether it was a joke or not.
 
@phenomnomnominal Me too, humor scares me. I like the comfort of hard colf truths.
 
does anyone know the definition to a joke?
 
8:01 AM
Something that is funny.
 
Java is sad sad, not funny sad.
 
@phenomnomnominal It's pretty funny
 
@BenjaminGruenbaum It's spelled "cold" and your mother didn't appreciate you enough as a child, leading to your present insecurities and cold comfort of your wife's quasi-semblance to your old aunt.
 
Jokes may have a punch line, i.e. an ending to make it humorous.
maybe thats what the just kidding part is?
 
8:02 AM
@Zirak YOU DON'T TELL ME, I HATE COLF.
 
@Zirak i just want feeling that i can chat there is enough for me
 
If you have to tell someone that something is funny, it probably isn't.
 
Poor Java, it had so much so much promise and now all that is left are pointers
 
!!what's a joke?
 
Colf:
> Medieval Dutch for club. Perhaps the originator for the word "golf."
 
8:03 AM
@Zirak joke An amusing story.
 
@Zirak, you should just make it reply 'your face'.
 
HA
 
O
 
8:04 AM
A
 
R
 
BOOBS
 
TITS
 
8:04 AM
wtf
 
We'd make a good cheerleading squad.
 
Breasticles?
 
talk about going other the top
 
@BenjaminGruenbaum plz
 
8:04 AM
Rowling?
 
@web2students.com Ok sure... jk
 
so who has a "logan" on their mind? ... just kidding
 
Logan - Wolvarine ?
 
@web2students.com The really funny jokes room is an elite club
 
wasnt it his real name or soemthing ?
 
8:06 AM
James Howlett was Wolverine, Logan was a nickname, something like that.
 
@BenjaminGruenbaum but it would run without me you can earn through elite club
 
@Zirak so you watched marvel superheroes aswel ?
 
I read comics. And I can google.
 
Anybody here tried to make a game for Kongregate?
 
delete ImportantArray[2]; // Just Kidding
 
8:08 AM
spell mistake, but it would not run without me ...
 
yay, commit #400 to the bot
 
hi guys.
 
@Zirak cool :D
 
@Zirak Bad request.
 
@Joseph82 hello!
 
8:10 AM
right now i am watching avengers getting there butts kicked by a robot watchcartoononline.com/…
 
@Darkyen i am interested in answering some js question but no 1 is asking a question
 
because we dont have any ?
 
I created this dummy code: jsfiddle.net/Joseph82/DSRyX/2 I want that each time one option is selected a new select field is created. The new created select seems not be managed from jquery code. But this works good only for the first time. Someone can help me?
 
read the transcript ^^ you might find some js questions or more likely useful porn
 
@web2students.com you want to answer JS questions? I've got one.
 
8:13 AM
For first time only?refresh the page for second time
 
@SomeKittens dont obliterate him, :-)
 
@Joseph82 You mean it only works for the first element, and not the elements you create
Look into event delegation
 
yes @Zirak
 
Should I implement a singleton class using the prototype pattern?
 
And that way of creating the select... shudder
 
8:14 AM
@Mikhail why would you do that ?
 
@Mikhail Don't use classical concepts like "class" in js, they don't match.
 
ahahah @Zirak
 
why cant you just do it
i_single = {
/* There goes your methods */
};
 
I'm a newbie :(
@Zirak can u sugget me a better way?
 
One sec
 
8:15 AM
ok
 
@Joseph82 You really need a code cleanUp, jsfiddle.net/ConnorM/DSRyX/3
@web2students.com I bow sir
 
@Connor he is new to room so i said that
 
@web2students.com cool, why would i want to know that... jk
 
Thank you @Zirak
 
@Joseph82 jsfiddle.net/DSRyX/4 I didn't give you the complete solution, but it shouldn't be too difficult from here
 
8:20 AM
ok, thank you @Zirak.
 
Enjoy
 
@Zirak, this means that the selection of jquery function is normally refered to the orginal DOM, not the DOM modified from the jquery function itself?
 
In your first version, jquery went through all the current elements selected and added the listener. The problem was you created elements later
 
All hail king zirak
 
breaking news, me going now bye
 
8:23 AM
ok, I understand! Thank you again @Zirak :)
 
@web2students.com or broken ?
 
@Joseph82 if you for any reason want to create elements with jquery do something like this
$('<option>', {value: 'option1', selected: 'selected', text: 'Option 1'});
 
Ok, @Connor Thank you
 
@web2students.com jk, right?
 
@BenjaminGruenbaum Definitely
LOL, no he's being serios
 
8:29 AM
@web2students.com can you answer a JS question I'm having?
 
@BenjaminGruenbaum yes!
 
@Connor I have created a select field in this way: var select = document.createElement('select'); Now I want attach the option to this field
 
var sexyOne = $('<option>', {value: 'option1', selected: 'selected', text: 'Option 1'});
@Joseph82 what do you mean? ish
@Joseph82 ok
 
@Connor ok, now it is clear. Than you
@Connor And if I want that just the last inserted select can generate new select field?
 
var text = document.createTextNode('My Options Text');
select.appendChild(text);
select.value = 'option1';
 
8:33 AM
@KendallFrey Would you mind if I steal your search pattern? I really like it
 
I need to control if the element is in the last position in the DOM (under form node)?
 
@Joseph82 then hold on
 
and I think I need to remove the onChange event from the select fileds that are not in last position
right?
 
@Joseph82 right, jsfiddle.net/ConnorM/DSRyX/6 im not doing any more code lol, i need to be busy
 
Thank you @Connor don't worry and thank you again. I'm so
scanty. Can you suggest me the way for learning jquery? Any good manual or tutorial
 
8:38 AM
@Joseph82 you make stuff and read up on what you need, and learn it as you need it, what i done anyway
 
@Joseph82, step on, learn JavaScript
 
w3schools can be a good first step?
 
!!/tell Joseph82 jQuery
 
8:39 AM
 
w3schools is satan.
 
aahahha really?
why?
 
@phenomnomnominal yes, part of the builderburg group, along with google, and apple
 
too terse?
 
well, it's getting better, but, it's just bad
 
8:40 AM
:9889422
 
ok @phenomnomnominal I'll follow your suggestion
 
.
@Joseph82 MDN
 
Ok, I'll start from it! :)
 
LOL -w3schools
 
huh, I wonder. After some requests I filter out w3schools from google (simply adding a `-site:w3schools.com`)
!!/google w3schools
 
hah
 
JUST -w3schools works
 
you can apply it to you google account
!!/jquery off
 
@phenomnomnominal api.jquery.com/off
 
//global
var balls = [];

//following is inside a function
why this is wrong ?
	var distx = balls.[j].x - balls[j+1].x;
and this is right ?
	var distx = balls.indexOf(j).x - balls.indexOf(j+1).x;
both does the same thing, does it not ?
 
8:47 AM
no .
balls[j]
well it depends
is j a number or an object in balls?
because neither of them are really right
 
Problem: I have a very large mug which I desire filled with coffee. I don't have a large enough coffee-making receptacle
 
I understand , You can call me dummy
 
If j is a number, aka the index of the object in balls, then you want to use balls[j].x
if j is a ball, you want to use balls[balls.indexOf(j)].x
 
huh? If j is a ball, j === balls[balls.indexOf(j)]
And you just need j.x
 
haha fuck
yes
 
8:50 AM
in my case j is a number
I understand it should be balls[j].x
 
@CallMeDummy I expect you'll get an error if you use the latter. j isn't an object in the array, so it doesn't have an index, it IS an index
 
more importantly, indexOf returns a number, which won't have an x property
 
wtf, I seem to have contracted dyslexia during the night. I've woken up apparently unable to....do...words...
 
I understand, I think I am too confused to get the basics wrong. Thank you
 
is this worth it? raphaeljs.com to support svg in older browsers, its 89KB?
 
8:55 AM
@CallMeDummy Also, you have a pretty serious syntax error (which is the source of the problem, I believe)
balls.[j].x
See the dot before the brackets?
 
When I introduce this variable the whole program stops T_T ,especially when I put the minus symbol in between
var distx = balls[j].x - balls[j+1].x; // actual statement

// if I modify like this then it works
var distx = balls[j].x ; //- balls[j+1].x;
@Zirak that was actually a typo , I typed the same code too many times that I screwed it up
 
What's the error? Are you sure there's a ball on j+1 ?
 
@Zirak yes
 
What's the error?
 
before that line do console.log(balls[j], balls[j+1]);
 
8:58 AM
@Zirak it simply stops
 
anyone?
 
@phenomnomnominal will that work in jsfiddle ?
 
With what error!?
Check your console
 
okay hold on
 
@CallMeDummy it depends, how important is it that you support browsers
 
8:59 AM
umm where is the console ?!
 
what browser are you using?
 
Firefox , on jsfiddle
 
shift+ctrl+j
 
thank you
it says balls[(j+1)] is undefined. But how can this be ? Is it because of any Out of boundary index ?
 
there's no such thing in javascript
arrays are just objects, so you can look for any property on them, and if it doesn't exist it will just return undefined.
 
9:08 AM
"but there are a lot of situations where you need the ability to create objects from a class" - no. — ThiefMaster 16 secs ago
 
I have 5 objects inside the array balls[]; so if j = 0 then balls[j] and balls[j+1] should exist
 
so you have 5 balls? you know.. 2 are usually enough ;)
 
XD
and also I am breaking the loop j = 3, so balls[j+1] is always there
 
do console.log(balls)
fuck it, just show us your code, this is exhausting.
 
it still gives the same error Timestamp: 9/6/2013 2:46:11 PM
Error: TypeError: balls[(j + 1)] is undefined
Source File: fiddle.jshell.net/_display
Line: 105
 
9:17 AM
please send us the link to your fiddle
 
jsfiddle.net/codebazooka/5694H/3 inside function ball2ballCollision()
 
You probably mean j < balls.length - 1, since you're accessing the next element inside
 
Yeah, and you have another error after that
dx is undefined, just looking now
I think you probably want this:
balls[j].dx *= -1;
balls[j + 1].dx *= -1;
balls[j].dy *= -1;
balls[j + 1].dy *= -1;
 
(I'll be back in a few minutes)
 
@Zirak , thanks, the program runs again @phenomnomnominal but balls[j].dx *= -1; is same as balls[j].dx = -balls[j].dx ?
 
9:27 AM
yeah, I assumed you wanted it to reverse direction
 
intteresting
 
You need to rethink your collision detection
 
@phenomnomnominal yeah, its not working and screen flickers a lot
 
yep, i have the feeling that you're checking against all the balls, multiple times
look into a quadtree
 
(4 minutes. not too shabby)
 
9:30 AM
I don't know what exactly what a quad tree is but one of the site which was referring to said its overhead for simple games. But I think I have no other choice here
Thank you
 
9:44 AM
^_^ The good news is collision does occur and screen is no more flickering. The bad news is some of the balls don't bounce back after collision. ;p .
 
10:00 AM
@ThiefMaster but, but that would require us to be adults wouldn't it?
2
@AaditMShah I disagree. I think classical inheritance in JS is stupid, but it's not always a bad idea to implement. Also, it's fairly easy to implement anyway.
 
10:30 AM
0
A: No ways to have class-based objects in javascript?

Benjamin GruenbaumShh, come here! Wanna hear a secret? Classical inheritance is a tested and tried approach. It is useful to implement it in JavaScript often. Classes are a nice concept to have and having templates for modeling our world after objects is, and can be awesome. Prototypical inheritance focuses on ...

My take
Enough with all the hate for classes, they're just another design pattern.
You shouldn't have to use them often, but that's like hating Iterator or Factory or Mediator, it's just a design pattern and it has its use cases.
The problem is with languages like Java making people think every thing must have classes, the problem is not with classes the mselves.
 
god
I had the tilt about concurrency in Go yesterday
and... damn, it's really good.
and easy.
Your getCar() is composition, not inheritance :-) — Florian Margaine 1 min ago
 
@FlorianMargaine I beg to differ. My getCar is inheritance, it returns a vehicle, it follows the LSP just fine :) It's subtyping, only not in the Java way, but subtyping nontheless. — Benjamin Gruenbaum 10 secs ago
 
discussion to be continued over comments :P
it's not because you call a property typeOfThing that it's not composition
 
user1125394
10:45 AM
it's just a method that does some shit
 
@FlorianMargaine No. Subtyping is not about calling apples apples. It's a well defined computer science concept. If you follow the LSP you're doing subtyping, period. Note, I'm returning an object created by the Vehicle constructor, I'm extending it by adding another property to it. In languages like Java/C# this wouldn't be possible — Benjamin Gruenbaum 3 mins ago
 
@BenjaminGruenbaum Your curly braces indentation is funky. I don't know how to edit, since I can't seem to find what your core pattern is
 
@Zirak If you want to edit, just edit. Any style that's reasonable it OK with me :)
@FlorianMargaine Just because it's not subtyping the Java way, doesn't make it any less subtyping. Java being a bad language does not mean JavaScript's way of doing inheritance like this is any less valid.
Yeah, the returns are messed up, this is what I get for writing code in the stackoverflow answer area
 
You also have some trailing whitespace. I will one day murder you. Just a heads up.
 
@Zirak I code with sloppy indentation and just press Control+K+D every minute or two
@Zirak ty
 
10:52 AM
My pleasure
 
A colleague always writes trailing whitespaces. Like, he always presses space right away after a }. I hate that.
A colleague always writes trailing whitespaces. Like, he always presses space right away after a }. I hate that.
 
Also, to those of you who don't know the legend: govindtiwari.blogspot.com
 

« first day (967 days earlier)      last day (3975 days later) »