« first day (383 days earlier)      last day (4582 days later) » 

12:01 AM
@SinthiaV You can add that same effect manually. It would take a good bit of code but if that's all you need out of jquery I think it would be worth it.
 
This page uses it.
That's why I am wondering...
I am using an IFrame so I only have to load the chrome once, so jquery would only load once as well.
 
iframe :(
 
12:21 AM
what do I do if I'm getting an npm warn mongodb when installing socket.io? Command used: npm install socket.io
 
Dont know o/
 
it's just a warning... so... ignore it? o_o
 
it's never good to ignore bugs though :c
 
@rlemon I think that is more like it. Thanks!
 
12:33 AM
var timeout = duration / 20; and opacity += 0.05; seem to look smoother to me
play with it
it's not a difficult script to whip up
i'm sure that can be improved 10x over
 
I think jquery is like swatting a fly with a sherman tank most of the time.
 
It is.
 
I wish it were modular
 
I'm making the DOM-shim modular ;)
 
cool
 
12:37 AM
at some point.
The problem with "modular" is that CDNs don't work like that
CDNs expect one file everyone should have one file
 
and js...heh. you kinda have to trick it into being modular :P
 
ahh first problem with that @SinthiaV, the element is not completely faded in, before the callback needs to be completed, or the function needs serious refactoring.
opacity is increased after it is set to the element, but before it is checked for 100%
so when the callback is triggered opacity is really .95
 
I just heard Dave Chappelle ask what if the internet were a real place you could go? It would be disgusting and intolerable.
 
:( facepalms self
 
Oh no way! Now he's talking to Ron Jeremy! Disgusting and intolerable. lol
And goats!
Ok. Seriously. I don't think any one script, tool, language, whatever is a silver bullet like Mr. categories.
 
12:46 AM
whats mr categories :S
 
wHiTeHaT, but I guess he left.
So never mind him
 
i ignore him, mainly because hes an idiot
 
That too
 
my back hurts.
 
@rlemon be on top next time
 
12:50 AM
I like that username, very creative: wHiTeHaT
 
@Raynos can't be helped.. was answering a question and had to use jQuery....
the overhead is killing my neck
 
@rlemon >_> y u do tis. cannot unsee.
 
probably a coincidence... but i blame jQuery all the same
@Raynos ahh you misunderstand.. op requires jQuery
op always wants the cowbell
 
@SinthiaV The internet is a real place and I'm there now... it is disgusting and intolerable... what's his point?
 
i gave up
 
12:53 AM
@Josep Dave Chappelle just made it very funny
 
now time for beer + other thing then nap
night yall
 
night, @rlemon
@SinthiaV who is Dave Chappelle?
 
Google him
 
@Joseph lol
 
12:55 AM
never seen the guy :\
but then again... never seen Saturday Night Live either
 
SNL=not funny Dave Chappelle=rolling on the floor
 
I heard some second hand SNL jokes from like 10 years ago and they were funny... never took the time to watch it though... Is Dave Chappelle on comedy central?
 
hm... maybe I'm just a young fuddy-duddy... but somehow Bob Hope is funnier O_o
 
1:11 AM
Whoa.
 
what? XD so I like dry humor :P
 
1
A: JavaScript library for sequence programming

RaynostoArray: [].slice.call(arrLikeObj) Clone: [].slice.call(arrLikeObj) Count: arr.filter(predicate).length DistinctCount: arr.filter(uniquePredicate).length First: To return the first or the first matching a predicate, to return null when array is empty arr.reduce(function (el) { if (p...

ES5 array utilities are powerful :)
@rlemon You misunderstand, I was implying something else
 
1:27 AM
var chain = function (arr) {
  var o = {};
  Object.getOwnPropertyNames(Array.prototype).forEach(function (key) {
    o[key] = function () {
      var ret = [][key].apply(arr, arguments);
      return Array.isArray(ret) ? chain(ret) : this;
    };
  });
  o.unwrap = function () {
    return arr;
  }
  return o;
};

var chained = chain([]);
chained
  .push(4)
  .push(5)
  .push(6)
  .filter(function (v) { return v == 5; })
  .push(3)
  .unwrap()
Because chaining is awshum.
ES5 you so aweshum.
In the answer above I make the following quote.
> Do I really have to do all of them? they are pretty easy to build up from the primitives.
I do find them easy to do, but how do I distinquish between something easy and something I find easy. Do you look arrogant/cocky if you mention "its easy to do, you should do the rest yourself"
Basically rather then saying "its easy, do the rest yourself" what should more useful thing should I say instead?
 
"You can pay me 30 dollars/euros/rupees per hour and I can write the rest for you."
or maybe that's worse
 
o/
I meant it may be daunting to just say "meh this stuff is easy, do the rest yourself" and the proper thing to say is to show him to write the rest himself.
I just showed him examples without comments or explanations. Which is fine if you can read js.
 
or the classic, "The remainder is left as an exercise to the reader."
 
The point is, it's the classic I grok this stuff a lot more then you, I will assume you have a decent grokking of js.
It's the thing lecturers do, you know.
 
1:51 AM
Most of the things that the OP is asking for are trivial programming exercises anyway
 
That is true. But noobs be noobs.
I mean, you'll be suprised how many people fail at trivial programming exercises
Or but differently 99% of "programmers" are incompetent.
 
Incompetent programmers... I am the 99%
 
I am too.
Example:
1
A: DOM callback for node creation

RaynosMassive Warning: DOMMutationEvents as defined in DOM level 3 are deprecated. document.addEventListener("DOMNodeInserted", function (ev) { var node = ev.target; if (careAbout(node)) { runCode(ev); } }); The DOMNodeInserted event is documented in DOM events level 2. Of course browser ...

RAYNOS Y U RECOMMEND DEPRECATED APIs
 
lol XD
 
This is what happens when you dont read DOM3 events
 
2:26 AM
@Incognito
> It's presently being re-defined from it's old "ES3" version to it's present "ES5" version
I know what your trying to say, but it doesnt sound right
You should say it's currently ES5, the guys are working on ES6
and for legacy platforms there is an older ES3 version
> Really, it's just a way for you to request more data from the server without having to reload the page.
It's a way of sending a HTTP requests without getting the browser to do it. For the browser to do it, it has to either go to a different page, refresh a page or open a new page
 
@Raynos That was fast! I was just about to post the link here.
 
> Lastly is the window object. It's everything that's not the DOM
Ugh. thats a horrible "assumption" statement
"not DOM, not XHR, must be window"
I know what you mean, but theres a lot more to it.
The window interface is tiny if you go look in the WHATWG spec
 
@Raynos I did kind of just glaze over on that one.
 
To me, there is WHATWG HTML, DOM4, XHR2, DOM3 Events, CSSOM, CSS3, etc.
at some point get people to play with curl would be good.
 
@Raynos I don't want to slam them with APIs at this stage, just keep them at a simple abstract concept of "cars drive places" rather than "racecars are built to race"
 
2:31 AM
> Do you actually get HTML?
That's basically "do you know how to present information semantically using HTML"
and to me, that's very difficult to get right
 
It is, it's very difficult. But there's a huge gap between the issues you have and the ones we see daily in here.
I'm not sure how to describe that.
 
I know what you mean with "window API" but it's really "miscelanious API"
Also no mention of CSS anywhere
@Incognito I know what you mean, when I say "present semantically" I meant "present perfectly semantically"
Where as "present semantically +-10% error margin" is reasonably achievable
 
What I'd like to express is using HTML in a separated way from your JS/CSS, and you atleast attempted to run the validator on it.
Without making that last part sound half-assed.
@Raynos I don't really want to talk about CSS, I mean, it'd be nice to make this a web-all-in-one but I don't want to take away from my focus which is understanding quality JS.
I feel all of these technologies I've mentioned build up to JS and are knowledge that impacts the dev's JS ability, but CSS is fairly good at being it's own mysterious black box that doesn't really impact your JS code outisde of changing classes or setting styles via the DOM or elements.
 
I see, your right.
I also saw this comment later on in the slide
 
I got one question, what does the > in the following mean:

ul li > a

Code:

menu.find('ul li > a').bind('click', function (event) {
 
2:40 AM
> You need to understand multiple browsers differences
Personally I say you shouldn't have to care about browser compatibility, have a shim do that for you. However you need to understand whats cheap and whats expensive.
I do think we need to move away from doing cross browser normalization by hand and obvouisly I dont think jQuery is the optimal solution
People need to know cross browser compliance is a problem, they shouldnt need to worry about the dirty details
 
@Raynos The browser differences justify the shim. Understanding they exist is what I really meant, not expecting someone to deal with everything.
 
ok thx
 
@Raynos Corrected that, pushing adjustments in a moment.
@Raynos Do you ever sleep?
:P
Also thanks for the feedback on this, I really appreciate it.
 
¬_¬
I have problems sleeping
its called internet addiction
its also called "RAYNOS Y U FAIL @ LIFE"
 
doesn't ul li > a have something to do with parent, child, etc.
 
2:53 AM
@Raynos Lol, you're not failing half as hard as most people.
 
@Ator here's the Selectors4 API go read it.
 
@Raynos thank~
 
Oh you were trying to help, @Shawn31313 you go read it :P
 
Sizzle actually does selectors4?
 
@Incognito problem is I have higher standards
 
2:54 AM
I thought it was stuck in 2.1.
 
@Incognito of course not.
 
LOL!
 
I just always reference the latest API
I don't care what your shitty selector engine of choice does
Ill write a selectors4 shim at some point
 
Yeah, it's like x > y, y is a child of x.
 
@Raynos Yeah, I have that problem too. Then I let them all go out the window at the last moment and do something that makes life reallllll interesting for a while.
@Ator Just wait till you find out the rest of the stuff in the manual, it'll blow your mind.
 
2:56 AM
I know so little of the w3c documents :\
and even then, as a js dev I'm in the top 1% of spec knowledge
This is sad. COMMUNITY Y U NO GOOD
 
@Raynos We allow the proliferation of bad knowledge.
 
True :(
Someone asked me the other day "How do you know all these good practices"
and I couldn't answer it :\
 
That's basically what we're trying to fix. I mean, nobody learns anything over night, and there's a lot of content to get through.
 
I'm comfortable with everything except $=, *=, etc.
I always confuse them :/
 
@Raynos I learnt most in here.
Well, JS specific.
Back when I was user######## I said the worst stuff because good knowledge was hidden really well and bad knowledge looked good enough.
@Ator You know there's a manual for just about every library, right?
 
3:00 AM
Yeah, I'll check them out later though. I'm too hung up on making a web app right now
 
Night everyone, I'm headed to sleep.
 
nigh
night
 
3:20 AM
night all
 
And I just woke up
 
 
2 hours later…
5:02 AM
@Raynos okay, thanks. I'm getting The Good Parts soon and well, I'm learning from you guys here, so it's cool.
 
Hi all, just checking out the js chat here to see what its like.
 
Nice
 
5:49 AM
@Raynos What do I use instead of innerHTML when I'm making a function that decodes HTML entities?
function decodeEntities(string){
var elem = document.createElement('div');
elem.innerHTML = string;
return elem.textContent;
}
 
 
1 hour later…
7:07 AM
@Amaan elem.innerText?
I would actually use document.createTextNode, though.
 
 
2 hours later…
9:13 AM
0
A: Run Javascript function when the DOM is "ready"?

ThiefMasterThe best practice is using jQuery and its $(document).ready(function() { .... }); function. Instead of .... you put your own code. Note that it basically does the same thing @Shadow2531 suggested, but also in old browsers not supporting that event.

^ using jQuery is a "best practice" now?
 
9:59 AM
0
Q: Review js code with charts

Neir0Is that code looks like shit? Can anyone understand how it work? link

 
10:20 AM
hello
any help for javascript?
hello anyone?
 
Why isn't the document.referrer empty after page refresh ?
 
10:51 AM
This might seem kinda nooby, but what is stopping this from writing "blah <br/>" every three seconds?
http://jsfiddle.net/H5ETn/
 
In short, scope
When you give setTimeout a string, it will execute in the global scope, but your function was defined in the onLoad function, so it can't find it
 
alright, thanks!
 
If you want to pass an argument, just wrap it in an anonymous function: jsfiddle.net/H5ETn/3
 
what is the coding to make a div's content to equal a string?
it's something like:
document.getElementById("foo").innerHtml = "bar";
 
hello
any help?
 
11:07 AM
with?
 
@AndyE downvoted and commented :P
 
hello i have following variable: var point1 = new google.maps.LatLng(41.9105, -87.6719); i want pass value of this variable to a second variable: point2 how to? i,m a very newbie
 
@Dennis which is what you should be doing in almost all cases anyway...passing a string to setTimeout is effectively the same as calling eval
 
Right
 
@Tgwizman that would work, but innerHtml is kinda ugly if you're a dom purist
 
11:13 AM
what should I use then?
 
It also opens an XSS vector
 
var bar = document.createTextNode("bar");
document.getElementById("foo").appendChild(bar);
 
@Amaan ...
 
@cHao ehh...
 
11:15 AM
@Amaan you don't. You use a regex if needed
 
hi ladies
 
Actually, would that work for multiple nodes created by a function to attach to one specific div?
 
@Tgwizman yeah. you attach each node in turn, and at the end you have them all
 
Let me rephrase that... Is there a way to detect all the nodes that were created by said function, then attach them via a different function?
 
@cHao @AndyE wtf is up with @ThiefMaster
 
11:19 AM
dunno...i'd expected a bit better from someone with 35k rep...lol
 
I'll just test it out
I might end up having to push each new node to a nodeArray, then doing something like:
for(var i=0;i<nodeArray.length;i++)
 
@Tgwizman there's no built-in way to tell what function created a particular dom node...though you can use css classes with elements to emulate it
 
how do I attach things to the newly created node?
More specificly, how do I give the node a string to display?
 
I do aswell :\
there are a lot high reppers who aren't competent enough
I hit this wall every day. Of course there are plenty of good guys
@Tgwizman Node API & EventTarget API
 
@Raynos I'd rather do the coding myself. I'm not much of a library guy.
well... I gotta go anyways...
see yah
 
11:29 AM
I mean, the DOM API >_<
 
@Tgwizman the newly created node is a text node, not an element. you can add stuff like bar.nodeValue += 'some other text';, but really it's better to just add a new node
 
Node.appendChild(otherNode)
Node.addEventListener(type, handler)
etc.
 
@Raynos Oh.
That'd be a lot to do
To make a regex that gets all the entities
 
I'd be the right way to do it.
Steal the regex from the internets
 
Hmm
Well, I'd already posted that code at the time as an answer
 
11:32 AM
 
I'll edit it and let him know how slow innerHTML is
@Raynos Thanks
@rlemon Reddit.
 
hello
 
@aydinch Sup?
 
not much, continuing my JS learning session :D
 
Nice
 
12:01 PM
Amaan, where are you from?
 
@aydinch India
 
@Amaan nice, so you do programming in your job?
 
@aydinch Na, I don't have a job. I'm 15
 
@Amaan oh wow, but good to see someone doing programming at such a young age
 
I wish I was still 15.. 25 sucks ass..
 
12:09 PM
@aydinch Thanks
 
yeah, im 20
 
although i can remember being 15 and saying "I wish I was 25, 15 sucks ass"
 
:)
guys, do you think that one should know JavaScript perfectly before diving into node.js
I'm dying to use databases :)
 
@aydinch You should've signed up for Stanford's Database class then
(Assuming you haven't)
 
available via Stanford podcast?
i can't afford > 50000$ per year :P:P
have to check it out..
 
12:13 PM
@aydinch Oh, no, they had a free online class thing
Like MIT OCW
But for computer science stuff
 
@Amaan nice, I'll check it out
do they have any prerequisites?
i know how to do for loops :P
 
@aydinch I don't know. I haven't looked into it so I don't tempt myself into attending them during my exams (going on now)
 
alright, thank you!
 
You're welcome :)
 
@aydinch depends how much pain you like
When I talk about node, I assume people know ES5 pretty well :D
 
12:22 PM
@Raynos okay, then I guess I have to learn more :D
right now, I am goingh through the appendto.com courses as my book is in my room and I am locked out :( (can't find my keys)
 
@aydinch Referring to your question, I think you should read @Zirak's answer here
 
@Amaan heh, thanks for that :) one of my first questions when I started reading JS: The Definitive Guide
 
@aydinch It's a good question
 
indeed I found other passages early in the book but had to freeze my JS learning efforts because of my exams
*passages which were unclear for me
 
Hmm
 
12:28 PM
I hope to refresh my knowledge fast
 
@Thomas hey
 
@aydinch appendto :(
 
@Raynos anything bad with it?
 
Its a mediocre company. I mean the guys are a joke
I recommend you read the good parts
then follow nodetuts
 
12:32 PM
anyone that uses node.js/express, what do you think of this express route? gist.github.com/1336381
 
oh, I found the lessons to be quite good actually, but maybe that because I am at lesson 1
 
oh.. that might lose 'user'
im not sure if its even possible to build a whole app around that concept but I find it interesting
 
12:47 PM
@ThomasBlobaum epic fail
y u ignore error?
 
function prettyNum(count) {
    var k = 1000, m = 1000000;
    if (count >= k)
        count = ((count / (count < m ? k : m)).toFixed(count >= (k*10) && count < m ? 0 : 1) + (count < m ? "k" : "m")).replace(/\.0([mk])/, "$1");
}
^ anyone see any probs with that?
I wrote it quite quickly, I may have been naive and missed something.
It converts numbers like 12345 into something like "12k"
 
just testing the api @Raynos
 
@AndyE 80 characters
ALSO Y U NO WRITE READABLE CODE
 
@AndyE At least return count
 
nQuery(here).on('ready', function ($) { })
 
12:56 PM
@Amaan: it does in my larger function, I just missed it off when copying and pasting it here
 
@AndyE Ah
 
i could also pass req there, or more specifically, require an object with 'url' and 'sessionId'
nQuery({url:req.url, sessionId:req.ressionId}).on('ready', function ($) {
nQuery(req).on('ready', function ($) {
or res, rather
 
oy vey, learning JSON and AJAX is way harder than it should be
 
@AndyE What's the replace for? (I don't know regexp)
 

« first day (383 days earlier)      last day (4582 days later) »