« first day (962 days earlier)      last day (3972 days later) » 

8:00 PM
@FlorianMargaine so?
 
@rlemon what should i do instead of this? $(/*element*/).bind('touchstart',function(e) { ... });
 
Course it should.
 
user1596138
@KendallFrey If you don't have permission probably the same response I got. Otherwise nothing.
 
user1596138
!!/summon 17
 
@Jhawinsss Already registered; still need 0 more
 
8:00 PM
@eazimmerman .on > .bind
 
@rlemon that's the way you run a function in another thread in golang. go funcname()
I love that.
 
ahh
hehe
 
so simple, so elegant.
 
!!/unsummon 17
 
@KendallFrey I can't leave my home.
 
8:01 PM
never touched golang
 
NICE
 
looking at dabbling in RUST
 
@rlemon is it better
bye
 
user1596138
@KendallFrey Haha nice try.
 
0
Q: Code Alteration During Runtime

StMotorSparkSince Javascript is an interpreted language, entire functions can be changed during runtime. I have recently been contemplating a framework that would allow for dynamic code changes (such as UI plugins) to take effect without having to reload the page, while still providing enough information to ...

 
8:01 PM
@rlemon golang seems nicer
 
Hey, I've done disastrous things before.
 
less features, more simple, more elegant.
 
@FlorianMargaine after I get into RUST we can compare notes
 
@KendallFrey you got married :O ?
 
// !!/purgecommands
 
8:02 PM
I just need to find the time
 
@Dave kneeslapper
 
that means you have ;)
 
@rlemon write a css parser + minifier in Rust
this way we can compare: github.com/Ralt/cssminify
 
user1596138
I just ignored the "Feeds" feed.... I don't know how to undo it.
 
@FlorianMargaine will do.
 
8:02 PM
@Dave the guy is 18
 
don't expect this for at least another 45 days
 
@rlemon I like that violence as a way of enforcing best practice has become a thing.
 
@Jhawinsss go to your chat profile --> prefs
 
I knew it.
 
@Dave I've never even made eye contact with a girl. Sheesh.
 
8:03 PM
@RyanKinal slap
 
@ShotgunNinja i can read profiles. Thanks.
 
user1596138
@Shmiddty What does simply "hiding posts" do? That's what I did.
 
Violence as enforcing best practices?
 
@KendallFrey Wow, did you go to a boys' school or something?
 
whats that mean?
 
8:04 PM
@BlackSheep 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.
 
@Jhawinsss it's a temporary ignore
it goes away when you refresh the page
 
user1596138
Cool
 
@ShotgunNinja Did your mother teach you about this thing called sarcasm?
 
user1596138
in PHP, 43 secs ago, by Bracketworks
People who ask questions where the first result of a Google search is the answer shouldn't be entitled to swing their arms around protesting the "rude" behavior.
 
7 mins ago, by rlemon
also, don't ever use inline event handlers or I will find you and hurt you
 
8:05 PM
lol you hid the post xD
 
@KendallFrey No, she must have forgot. What's sarcasm?
 
user1596138
So they actually did ban LMGTF links?
 
Ah, much better.
@Jhawinsss They did. You need to use a URL shortener now.
 
lol
 
8:05 PM
Hi, everyone.Quick question: stackoverflow.com/questions/16926364/…
 
so backbone.js whats up?
 
Basically trying to implement Paint in the browser
 
user1596138
!!/unsummon 11
 
works for me
 
@Jhawinsss Already registered; still need 0 more
 
8:06 PM
@rlemon I thought writing a css parser would be mildly hard. It wasn't.
 
user1596138
@CapricaSix Do it gawd dammit!!
 
!!/unsummon 11
 
And dragging around shapes is really slow
Any tips?
 
!!/unsummon 11
 
user1596138
They're all confused now.
 
8:07 PM
@FlorianMargaine I can't imagine it would be. I mean, not 'simple' but not the hardest of parsers
 
in HTML / CSS / DOM & web design, May 29 at 19:08, by rlemon
in JavaScript, 37 secs ago, by rlemon
@Jhawinsss 1) specificity becomes harder to work with
2) they are no longer re-usable because ID's are singular
3) they are ugly.
4) because Ryan will break legs if you do.
^ also that
 
user1596138
@RyanKinal I remember that.
 
@rlemon yeah, but I was really surprised at how simple it turned out to be
 
Good times, good times
 
@BlackSheep this is pretty neat actually
 
8:08 PM
@TheSnooker Thanks :)
@TheSnooker trying to speed it up.
 
is there a native document.ready I could use?
 
someone said something at some point about premature optimization
 
@BlackSheep jQuery is the blacksheep of canvas
jQuery + Canvas === probably not a good idea.
 
he's using kinetic isn't he?
 
@Shmiddty I tried and failed
@rlemon Trying to find a way to do it ... not with JQuery
 
8:10 PM
@lawm In most good browsers, addEventListener('DOMContentReady', func)
 
@rlemon But couldn't find anything in the Kinetic docs
 
@RyanKinal ok.....
 
Er... wait... maybe it's DOMContentLoaded...
 
idk what you are trying to do
I just saw canvas and jQuery
 
I don't know. Fuck it. Put your scripts at the bottom.
 
8:11 PM
^ OMG THIS
 
i made my own library for canvas
took me a year
 
@lawm think about this logically. Why make the users execute some code then wait... when you can skip the execution and include the code in the body after the content
 
It'll be better for perceived page load anyway.
 
You can also use <script defer="defer"> ...
 
why make a pointless operation
 
8:12 PM
are you guys still letting lawm troll you?
 
@rlemon because I have a hypothetical game that uses the principle of appending text/asciiness!
 
user1596138
^^
 
@rlemon paint-like functionality where you draw rectangles by dragging the mouse around
 
and I want the game to autostart..
so why make the user press a button
 
Hey, this is the first time I've been trolled...
... by him...
 
8:13 PM
or load the script on the bottom of the page?
 
@lawm defer="defer"
 
@RyanKinal I'm really sorry if I seem like I'm trolling, I'm trying not to.
 
@BlackSheep what are you using Jquery for?.. the selectors? or is there more?
 
@lawm I know :-)
 
how a document is parsed (in a nuttshell) :
1) the head is parsed, all external content linked in the head is downloaded (the body waits for this)
2) the body is parsed top to bottom, the DOM elements are loaded in as they are read.
2.5) iframe content and image downloads are started when it is parsed, they are not guarenteed to be loaded unless you wrap them in an image/iframe.onload
 
8:13 PM
@lawm for my game the scripts are at bottom of the page.
 
user1596138
@Shmiddty Quote from lawm "because I have a hypothetical game that uses the principle of appending text/asciiness!"
 
@TheSnooker Listener for mouse events
 
user1596138
@lawm He has you on ignore.
 
@Dave but.. if it was a game library?
@Jhawinsss cool
 
8:14 PM
@lawm a library is just a collection of functions
doesn't change anything
 
@Dave yeah
 
user1596138
@lawm Notice where I replied to and your smartass won't think it was pointless to say anymore.
 
@lawm how you should structure your document:
- libraries/shims as well as style information in the head
- application code (runtime code) is in the body before the </body> tag
^ then you are golden. no more worries (cept images and iframes)
 
just make sure you don't execute until after window.onload if you don't have it in the head of the page.
 
@Dave but is it necessary for the library user to put their scripts on the bottom of the page?
 
8:15 PM
 
doesn't matter if you wait for onload
 
@rlemon So the game code first, lib code second could work..?
 
depends on what is in your code
 
@Dave okay, so I'll use onload?
Mind == Overloaded!!
 
window.onload = function(){
//begin
}
 
8:16 PM
@rlemon Its the div appending thing
@Dave THANK YOU!
 
I feel you are struggling to understand how documents are parsed and therefore your 'requirements' make no sense to us
 
@rlemon ugh nvm
hmm wait... lol
 
you could make your own listeners if you wanted to..
target.addEventListener(type, listener[, useCapture]); but I think JQuery has other checks in it and it's probably better optimized. This is always something that I struggle with too.
 
@rlemon Basically.... [let me type]
 
!!/summon 7
 
8:18 PM
/me plays a tune whilst @rlemon is on hold
 
!!/rage
 
@TheSnooker Command rage does not exist.
 
<!DOCTYPE html>
<head>
<title>sample</title>
<script src="jquery.js"></script> <!-- include you libraries -->
<script> <!-- and your static functions -->
 function id(id) {
     return document.getElementById(id);
 }
 function foobar(elm) {
    elm.textContent = 'FooBar';
 }
</script>
<!-- and any style information -->
</head>
<body>
<div id="foo"></div>
.. some html code. all of it. screw you.
<script> <-- any of your actual code should be in here -->
  foobar(id('foo'));
</script>
</body>
</html>
 
!!/unsummon 7
 
@rlemon One correction: Styles before scripts.
 
8:20 PM
@rlemon what if you put your scripts at the bottom of the body?
 
So the not working div appending code I showed earlier on dropbox would be used as the library. The user's code would be the thing that activates the library's print function. So how can I make the library only accept the user's code when the library detects a window.onload?
 
@Zirak Can you make mustache work in other rooms?
 
@TheSnooker you can put them all in there if you like. I just like shims / libraries to load in the head
@RyanKinal does it matter? the DOM isn't touched until everything in the head is downloaded
 
@rlemon Pretty sure it does. Though I don't remember why, lol
 
8:21 PM
@FlorianMargaine I never knew that...
 
unless you are working with the sheets via js in the head... I don't see how it could
 
@rlemon Does this make sense at all? So the TextContent code I showed earlier on dropbox would be used as the library. The user's code would be the thing that activates the library's print function. So how can I make the library only accept the user's code when the library detects a window.onload?
 
@lawm you don't have too
function go() {} in the head is fine
it's a static function
 
@rlemon hmm
 
if you want some code to execute when the page loads: don't wrap it in .load just put it at the end
see what i'm saying?
 
8:22 PM
@rlemon "While script files block subsequent downloads, those already in progress will remain downloading."
 
@rlemon but the library!
 
^ that's why... download speed
 
People put the library anywhere
in the head..
but the script that executes the library... as long as it goes before the library..
 
@RyanKinal ahh, but if your downloading that large of a script file... I protest there is something else wrong
 
Oh god im going crazy
 
8:23 PM
@lawm you are WAY over complicating this
 
@rlemon fffffffffff
 
shut up and follow me for a second.
 
ok..
 
@rlemon But you're also waiting on execution, not just download.
 
I just figured out how to put my keyboard in UK mode... and it gave me a thought... what if I turned my keyboard into like Japanese mode and typed in my password.. would that make my password equivalent in Japanese?
 
8:25 PM
If you give me your password, I'll try it.
 
<!DOCTYPE html>
<head>
<title>sample</title>
<script src="jquery.js"></script> <!-- this code file here is run first. -->
<script> <!-- we know not of the HTML yet. -->
 function id(id) {
     return document.getElementById(id);
 }
 function foobar(elm) {
    elm.textContent = 'FooBar';
 }
</script>
<!-- everything before this point is run BEFORE the body code is known by the browser. -->
</head>
<body>
<div id="foo"></div>
.. some html code. all of it. screw you.
<script>
    // ALL OF THE CODE IN HERE KNOWS ABOUT EVERY ELEMENT THAT EXISTS ABOVE!
@lawm read this fully
I commented throughout
 
@rlemon i have a script after the </html> tag and it works fine, but it is a 2d rendering library
 
@eazimmerman that is the browser fixing your fuckup
 
@rlemon ok..
 
chrome is all like "wow, this code shouldn't be here, i'll just move it somewhere sensible"
 
8:26 PM
Browsers do a lot of that shit
 
<html>
<head>
</head>
<body>
...
</body>
</html>
<script src="cocos2d/launch.js"></script>
 
it can get annoying
 
where should it go?
before /body?
 
<script src="cocos2d/launch.js"></script>
</body>
</html>
 
Hi. what is this syntax which i see sometimes at JS files
/// <reference path="..\..\SignalR.Client.JS\Scripts\jquery-1.6.4.js" />
/// <reference path="jquery.signalR.js" />
 
8:28 PM
relative paths
 
@rlemon Not sure if this is clear: jsfiddle.net/BKsvP
 
.. indicates previous (parent) directory
 
and why do i need that ?
 
// have a solution

// in the library file
mylLib = {
    start: function()
    {
        // do initialzation stuff
    }
}


// in the html

...
<script>
myLib.start();
</script>
</body>
</html>
 
im talking about [///]
 
8:29 PM
that is not valid html
where do you see this
 
@RyanKinal is this to me?
 
@RoyiNamir Comment indicating documentation, usually for a doc parser.
 
@RoyiNamir Visual Studio refs
 
@lawm Sure. Why not.
 
8:30 PM
@RyanKinal eh... ok
 
@BenjaminGruenbaum who writes html in VS?
seriously...
I mean come on people
:P
 
@rlemon plenty of people, it has surprisingly awesome support with web essentials
 
I do... sometimes...
 
@RoyiNamir ahahaha
that is a comment
a js comment
 
if the library depends on the document, it usually has an event listener for when the document loads or is ready
 
8:31 PM
@RyanKinal but.. wheres the onload? in the initization?
 
@lawm No need
 
// I am a single line comment in js
//////////////////////////// if there is two / the line is a comment regardless
/*
I am a multi-line comment in js as well as a comment in CSS
*/

<!-- I am a comment in html -->
 
Ok rlemon. thanks.
 
@rlemon Yeah, but comments with triple / and a <reference are for visual studio
 
@RoyiNamir so the developer was just showing your that he includes those two references
 
8:32 PM
@eazimmerman But the library's user might call the library's function before the document is ready!!
 
// I am not a CSS comment because CSS for some retarded reason doesn't support single-line comments
2
 
^
 
/* except if you write them like this */
 
I hate that
 
this is Js file
what references ?
 
8:32 PM
/* Fuck you, CSS */
 
@BenjaminGruenbaum ahh, ok well I assume then it is for some factoring / folding shit?
 
@RoyiNamir it's for Visual Studio, am I speaking to myself here?
 
lolllllll
 
css uses // in urls
 
ahh
 
8:33 PM
@rlemon no, it keeps tracks of references so you get code-completion from other JS files you use, and errors if you use implied globals and such by mistake
 
no @BenjaminGruenbaum you are certainly not.
 
so its like a reference dependency thing read your comment after sending this
 
@BlackSheep try to minimize with [//] and see what happends
as opposed to /**/
 
Whats the difference between this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript
and this?
pooeyobject = {
poo: function()
{
// do the poo
}
}
 
8:34 PM
@rlemon ?
 
@eazimmerman solution: encase urls with quotes like everyone else.
@BenjaminGruenbaum I was hoping it would check the code on 'build' and include missing dependencies.
 
Now I know @lawm is trolling
 
@RyanKinal but what if the fn ISNT called at a reasonable time?
@BlackSheep lol
 
Well ........
Reference Directives
A reference directive enables Visual Studio to establish a relationship between the script you are currently editing and other scripts. The reference directive lets you include a script file in the scripting context of the current script file. This enables IntelliSense to reference externally defined functions, types, and fields as you code.

You create a reference directive in the form of an XML comment. The directive must be declared earlier in the file than any script. A reference directive can include a disk-based script reference, an assembly-based script reference
 
@lawm Then shit breaks.
 
8:35 PM
@RyanKinal oh...
@RyanKinal then how come jquerys all cool with it??
 
As long as you've documented your lib, and your user is smart enough to follow the documentation, then you'll be fine.
 
@lawm if I recommend a book + website can you promise me over the next week you will read the website then try to find the book?
 
no matter what the fuck happens?
@rlemon I do have a book
@RyanKinal ok..
 
it's the wrong book. or at least, you are not reading it
 
@rlemon learning javascript, php, mysql, css?
 
8:36 PM
I like putting code in the head section and not having code anywhere else. Fuck me right?
 
@lawm They're not. If you try to select stuff through jQuery without their ready function, shit will break if you do it at the wrong time.
 
@lawm knowing how the browser works with the document is step one
 
Complete with motherfuckin flyin squirrels on the cover?
@RyanKinal oh!
Ok
 
@lawm read this website (free) eloquentjavascript.net
 
So I'll just say in my docs: "Do your fuckin shit to my library after the window is fuckin loaded!"
 
8:37 PM
then pick up a pdf of "The Definitive Guide" and skim through it
 
@rlemon its bout classes?
ok
 
@lawm what does your library do?
 
but FIRST read eloquentjavascript.net
seriously..
 
@BenjaminGruenbaum its just a reference for intellisence it doesn't actually import the script when running....right?
 
if you ask another question that is not directly about something from that book/site then I will lemonrage on you
 
8:38 PM
@BenjaminGruenbaum well the main problem I was having was the ready document requied for it
 
@RoyiNamir Like @rlemon said, as far as JS is concerned, it's a comment
 
I mean with vs2012 POV
 
@lawm your code isn't a library if it isn't standalone.
 
okay. Thanks. Bye guys
 
8:39 PM
jQuery swallows errors and hides them from you
(does it still do this) ^
@lawm I want to help, but it feels you are over your head and I can't walk you through it all
 
@rlemon Hell yeah it does.
 
that site should take only a few hours to get thought
you can skip the canvas and audio shit
@BlackSheep I just noticed your pic is a sheep.
 
Going home. Later folks.
 
user1596138
These bitches at the office are enough to make me want to find a new job.
 
@Jhawinsss So do that
 
8:43 PM
who was making the canvas ms paint?
 
user1596138
Going to do so as soon as I can.
 
I have your fiddle open and I have some tips
 
user1596138
Also, this is a print publication, it has maybe a year or two at best.
 
Lazy question: (sorry rlemon) so if I haz an object and so I want a property to actually be a function that does something but then returns to set the property?
 
wut?
 
user1596138
8:44 PM
Nvm
 
So like car.steer("90"); steers 90 degrees but also sets the car.steer?
 
user1125394
you feel you're yelling when writing sql queries
4
 
@lawm object.defineproperty
 
so i can get the current "steer" if I want to?
 
user1596138
@xcx Yes!
 
user1596138
8:44 PM
@xcx I was thinking about that earlier.
 
user1596138
like SHOW TABLES is more like SHOW ME THE FUCKING TABLES BEFORE I CUT YOU!!
 
@phenomnomnominal ??
 
@xcx You know, select works just as well as SELECT :P
 
sorry I brb
but still reply
 
function Car() {
  this.steer = 0;
}
Car.prototype.steer = function(val) {
  this.steer = val;
  this.steerCar(this.steer);
};
var car = new Car();
car.steer(90);
console.log(car.steer); // 90
 
8:45 PM
Instead of ??ing why not just google, and then come back and ask more questions.
 
@lawm see my message above.
 
@xcx SQL commands are case insensative
 
@rlemon lol
 
@rlemon That won't work.
 
why not?
 
8:46 PM
Car.speed = "70"; speeds it up, var speed = car.speed;?
 
can't a object have a method and property of the same name?
 
@rlemon It'll access the object's property and see it's not a function.
 
ahh
 
Because you have two steer properties? One will overwrite the other.
 
!!/$stat TheSnooker
 
user1125394
8:47 PM
@BenjaminGruenbaum yes I know, but the guiy had the good idea to use cols and tables highercesed
 
@TheSnooker Command $stat does not exist. Did you mean: stat
 
@rlemon of course not, functions are properties in javascript
 
dammit
 
@BenjaminGruenbaum makes sense
 
user1125394
so I'm doing all higher-cased, forthe fun
 
8:47 PM
!!/stat TheSnooker
 
today is not my day
 
@TheSnooker TheSnooker has 178 reputation, earned 15 rep today, asked 18 questions, gave 15 answers.
 
@rlemon so the function's return can set the property's value?
 
function Car() {
  this.steer = 0;
}
Car.prototype.Steer = function(val) {
  this.steer = val;
  this.steerCar(this.steer);
};
var car = new Car();
car.Steer(90);
console.log(car.steer); // 90
 
@rlemon whoa
 
8:47 PM
Will work, but not ideal.
 
what bout:
 
Custom getter and setter using object.defineproperty
 
setSteer, getSteer
 
function Car() {
   this._steer = 0;
}
Car.prototype.steer = function(val) {
   if(typeof val === "number"){
      this._steer = val;
   }
   return this._steer;
};
var car = new Car();
car.steer(90);
console.log(car.steer()); // 90
 
user1596138
Anyone know of any promising companies in Indiana?
 
8:48 PM
Unless you want to use defineProperty, which is ES5 (so no old IE)
 
@BenjaminGruenbaum you mean console.log(car.steer());
 
bah
 
@ben that won't work either.
 
otherwise it returns the function
 
@BenjaminGruenbaum I prefer Title case over underscore prefix.
 
8:49 PM
Yeah you need to call the function.
 
@Jhawinsss The Indiana Archaeology Foundation
 
car = {
speed: function(newspeed) {speed = newspeed}
}
car.speed = "90"
 
@GuilhermeOderdenge 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.
 
@lawm that sets a global.
 
@lawm please read that site.
 
8:49 PM
Why would you assign speed as a string?
 
...
 
!!oceans 12 or world invasion battlefield los angeles or james bond skyfall
 
@OctavianDamiean oceans 12
 
@phenomnomnominal duno
 
    car = {
      speed: 0,
      Speed: function(val) { return car.speed = val; }
    };
    car.Speed(90);
   alert(car.speed); // 90
 
8:49 PM
Oceans 12 it is.
 
^*2 thats the correct JS version
 
@rlemon yeah?
wait ill be back later but im still confused
 
@Jhawinsss ask for a professor Jones
 
should work
minus the fucked up indentation
 
user1596138
@TheSnooker What...?
 
8:50 PM
might need some () in there as well
 
@Jhawinsss Indiana + Jones, are the bells ringing now? :P
 
user1596138
@OctavianDamiean Clever shits you are...
 
I iz teh clevr shitz.
 
user1596138
browseemall.com is a POS.
 
user1596138
8:52 PM
Doesn't work worth shit for me. I'd rather run a VM just for IE than use that BS.
 
user1125394
@rlemon c# style
 
@Jhawinsss browserstack.com and IETester for me
 
user1596138
@BenjaminGruenbaum Thanks I'll check them out.
 
!!oceans 12 or world invasion battlefield los angeles or james bond skyfall or play some GT5
 
8:54 PM
@OctavianDamiean oceans 12
 
@Jhawinsss Pinpointe has a handy "preview in all browers" feature for emails.. it basically does what you said.. runs a bunch of VM's and takes screen shots of the emails in different clients.
 
wow, really ...
 
!!work or reddit or chat.stack
 
@eazimmerman reddit
 
user1596138
@TheSnooker I would use browsershots.org if I just wanted screenshots though...
 
8:56 PM
oh yeah forgot about them
 
@black123 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.
 
a very small Chinese man walks into a bar, walks upto the largest guy there and karate chops him in the throat. *Hiyya! - the man falls to the floor*. The Chinese man says "Karate Chop from China!", he then proceeds to the second largest man there and kicks him in the kidneys. *Hiyya! - the man falls to the floor*. The Chinese man says "Karate Kick from Japan!", he then proceeds to the third largest man there and says *Hiyya! - the Chinese man falls to the floor".
The third largest man says "Crowbar, from K-Mart"
eh, was funnier when I read it the first time
 
@rlemon That wasn't Chang, was it?
 
Kevin*
!!/mustache black123
 
8:59 PM
hah, great one
 
mamamia
 
!!/mustache Caprica Six
 
all I was thinking when I say his picture was "but... he is white"
 
May the 'stache be with you, always.
 
!!/undo
 

« first day (962 days earlier)      last day (3972 days later) »