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

12:00 AM
@Loclip Can you please do research? This is humiliating.
 
I did and found only this
 
@loclip by hashes you mean objects, right?
 
yes
 
@Loclip Object.keys( h ).length is pretty reliable
 
um,

function sizeOfHash(h) {
return h.length;
}

Will that work? Or are you looking for something else?
 
12:02 AM
@CheesyBacon its not working i tried before
 
@Loclip seems hard
 
@jAndy thank you that worked... In google all examples using the above (my) function but I though there must be other way
 
user1125394
if
    try{
        //..
        else
            for
                if
                    for
                        if
                            //..
 
user1125394
me doing some java
 
!!/spec Object.keys
grr bot respond already
 
user1125394
12:07 AM
!!/get juice
 
@cx I think someone killed the bot...
!!/live
o-o
 
@CheesyBacon She's not here.
 
!!/summon JavaScript
 
Oh, she is... hmm.. @rlemon?
 
!!/summon 17
 
m59
12:11 AM
I'm still looking for someone to discuss this javascript driven site output. Let me know if anyone is willing to help me think it out.
 
!!/summon 4052
!!/summon 1187769
 
m59
To summarize that ^ It is that the method I want to use is awesome in every way, but ruins SEO since crawlers don't see the js output (which is ALL of the content).
 
Well, she's gone.
Gone forever.
 
0
Q: Why does this javascript cause a blue screen of death?

nivekuil<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="newcss.css"> </head> <body> <canvas id="itemCanvas" width="400" height="400"></canvas>

 
seems interesting...
 
user1125394
12:17 AM
!!/crashlog
 
@cx Bot is dead, remember? IDK where she is o_o
 
Kit
12:31 AM
@Zirak Caprica's being naughty again. Is there anything I can do to help her get moving when she's like this?
 
!!/live
!!/refresh
 
!!/summon JavaScript
 
what is the reason people have to not use onclick="" in html over assigning an event listener in js ?
i'm told to use event listener rather than the onclick when possible
 
m59
because you should never be putting js in html code.
Separation of concerns.
 
@Dave I like onclick better
 
m59
12:36 AM
@CheesyBacon stop trolling.
 
@m59 how
Im just sharing my opinion
 
m59
You're sharing fail.
 
@m59 "never" makes it sound like its not compatible ... but it works fine so what is the reason for the "never"
is there some issue with doing it ?
 
8
Q: Why Should I Avoid Inline Scripting?

thesunneversetsA knowledgeable friend recently looked at a website I helped launch, and commented something like "very cool site, shame about the inline scripting in the source code". I'm definitely in a position to remove the inline scripting where it occurs; I'm vaguely aware that it's "a bad thing". My que...

 
@m59 whatever floats your boat.
 
12:39 AM
there are two major points which speak against DOM level 1 event listeners. First, you can only assign one function reference at a time and second, mixing code is in general horrible for maintenance code
 
m59
31
Q: Why is using onClick() in HTML a bad practice?

NiLLI have heard many times that using JavaScript events, such as onClick(), in HTML is a bad practice, because it's not good for semantics. I would like to know what the downsides are and how to fix the following code? <a href="#" onclick="popup('/map/', 300, 300, 'map'); return false;">link</a>

How many people and posts would it take to convince you, then?
 
@m59 I have good eyes, I can use inline. I only use separated files if it gets big
 
m59
Have fun! You're a joke.
 
@m59 I am.
 
hmm so it seems mainly for my own convenience when it comes to development to keep them seperate
 
12:40 AM
@CheesyBacon I can't believe your ignorance has led you into such a pitfall of stupidity.
 
@Nile Fine, I'll use separated files, don't be start wars.
 
sperate files is v.helpful because "error on line 12,405" is some what silly :P
 
13 upvotes for Raynos happy birthday ? Darn the guy is popular like a rockstar !
 
m59
I say it's mainly good practice because you're maintaining the good habit of keeping concerns separate. Why practice bad habits just because it isn't directly hurting anything? What it is definitely hurting is the integrity of the structure in your mind when you approach all of your projects.
@Dave
 
Bot is also down at the [sandbox]( chat.stackoverflow.com/rooms/1/sandbox ).
FAIL
 
12:44 AM
@CheesyBacon @Zirak probably just needs to refresh it.
 
well i didn't know it was bad practice until just now.. up to now i had found onclick slightly quicker than eventlistener :P
 
@Dave Yeah, me too @Nile Not sure if he's on...
 
joy lots of code to update now :(
i prefer good practice overall though
 
m59
@Dave I thought the same thing, but then I realized that lot's of what I was doing was horrid. Now that I have learned a lot, it makes WAY more sense.
 
yep
 
12:46 AM
i see, how come onclick="" is still supported
 
m59
I used to have html/js/php all mixed in all over the place.
because people still use it.
 
Zirak runs the bot now, and inline event listeners will get you hurt.
 
lol i used to have PHP mixed with HTML too xD
i found some old scripts and laughed at myself
looping php to output HTML stuff - what a fool i was
 
m59
unfortunately, I can't see any way around using server-side for templating for my cms :(
 
i send it all to JS to loop
 
m59
12:47 AM
@Dave Lots of things use php for html output. Sometimes you have to.
 
client side templating is all the rage if you want to be like twitter and g+
 
fair enough, for me i just use PHP to connect to database and server side validation
 
m59
@rlemon HALP!!!!
 
I know nothing of angular
 
m59
You don't need to!!
 
12:48 AM
which is why i didn't chime in earlier
 
m59
I'm desperate lol.
Just think, if all of your content is retrieved via ajax
 
hooker desperate?
 
m59
crawlers don't see it.
 
depends on how you do it
 
mine is all ajax but its a browser game
 
m59
12:49 AM
yes, very hooker desperate.
 
cache static pages
retrieve the content via ajax
 
m59
and there is the issue
 
but change the links with js to do so
 
i cache html files to window.varNAme;
 
let crawlers visit cached static pages
 
m59
12:49 AM
yeah, but I can't see a way to do that.
what will do the caching?
 
using jQuery?
the example is easier with jQuery ... less boilerplate shit
 
i also have only one html page with all my layouts i seperate them with a div id so i can loop the divs and assign each div contents to its own variable so i only do one call to the server for all html pages
 
m59
There's the obvious solution of waiting until all ajax is done, then save the html to the appropriate file....
 
tl;dr you have the server generate the static landing pages like they would if the ajax was not there. then you add the ajax in to spice up the site using hashbangs as a replaced href so the user can still bookmark shit
 
m59
but that would get hacked to Mordor and back.
 
12:51 AM
long story short: progressive enhancements when not fully realized at the beginning are a lot harder to do right when you figure it out half way... or 3/4
 
m59
@rlemon yeah, you lost me.
 
ok well what kind of content are we talking about here?
cms, so like user submitted shit
where is it stored?
 
m59
database
 
ok so let us assume it's a blog. for simplicity.
without the ajax how would you let crawlers index your content?
 
would this force a cache update on js in browsers:


<script type="text/JavaScript" src="eload.php?v=1"></script>
if i change the number
 
m59
12:54 AM
@rlemon they would just see this

<div class="container marketing"> <!-- Wrap the rest of the page in another container to center all the content. -->

  <div class="row">
  <div position="One" class="span4"></div>
  <div position="Two" class="span4"></div>
  <div position="Three" class="span4"></div>
</div>

<hr class="featurette-divider">

<div position="feature" ng-repeat="feature in featured">
  <div class="featurette">
    <img class="featurette-image pull-right" ng-src="{{feature.imgSrc}}">
lol
 
ok so do that. do exactly that still. Then we just add js to every page to change that to make it more responsive for the client.
see where i'm going?
the robots are not in browsers. they no nothing of these scripts (usually)
do you know about jQuery.load ?
 
m59
No, I don't follow. I'm trying to figure out how to get the content (which angular plugs in where I have attribute "position") to the crawlers.
 
did you know you can pass in an id value and only load the HTML content within that ID from said url?
 
m59
yeah, I'm familiar with that.
 
ok, so if the content was not being delivered via ajax you would (using angular) be able to deliver it to the robots with no issues, correct?
 
m59
12:58 AM
no, angular is the ajax.
What I had in mind was for angular to look at the page, ajax for that page's content and then plug it in to the appropriate positions.
 
what i'm saying is you have to deliver the content without ajax. you have to make that possible.
then you build the rest on top of it
using jQuery.load(url + ' #page') is an easy example
watch this
 
m59
So, make the crawler stuff kind of like my RESTFUL back end, then have angular grab it?
It might just make more sense to use a php templating system.
 
pretty much how (if you want it to be compatible and all that jazz for marketability) you have to do this is make it all without any fancy stuff. make it all raw and very little extra js magic. Then once that is there add it all in without breaking anything you just did.
think, would you just submit a form with ajax or would you simply over ride it with js and allow older crap browsers to still submit it old school.
watch that video tho, it's a really good talk.
 
@rlemon terrible audience
 
terrible jokes.
but he is a very smart man and we should (for the most part) listen to him
 
m59
1:13 AM
ok, checking it out
 
@rlemon Ahh. He keeps talking about how bad his jokes are and it makes everything more awkward.
 
lol yea he's not really good at being funny.
but again, he is smart.
 
m59
I just had an idea...
If I have php put out, say...the blog
then angular comes in, grabs like <div blog>
loads the template and puts it in <div position="blog"> where it belongs in the template.
@rlemon would that be ok?
Then again, might as well just use php templates haha
 
well you pretty much will have to. then on the server you can (if you are generating the pages) server just a trimmed version if the right headers are sent
anyways. game time.
 
1:28 AM
Just found something weird on JSFiddle.
 
1:55 AM
The Rdio app is amazing wow
It's like groove shark / spotify but legal in Canada
 
@Gacnt
@Gacnt Is Zirak on?
!!/online
!!/eval 1 + 1
D:<
 
@Cheesy how would I know lol
 
@Gacnt The bot is away or dead, commands don't work. Also, google.com/search?q=Is+Zirak+On?
 
!!/live
 
@phenomnomnominal We need Zirak, he's the one who can help, he programmed the bot.
!!/live already bot
 
2:06 AM
@CheesyBacon OH REALLYZ???
 
@phenomnomnominal uhm, yeah.
 
Holy shit, I never knew that, I thought it just appeared like some sort of Jesus
 
Why would you think that? @phenomnomnominal
 
Because I'm a complete moron, obviously.
 
@phenomnomnominal o-o
Is there a list of the owners of this room?
Never mind.
@phenomnomnominal You're 23 and your a complete moron?
 
2:10 AM
Owners names are in italics.
That might give you a hint.
 
Ok, thanks.
 
@CheesyBacon, how can you use both "you're" and "your" in the same sentence, and one be right and one be wrong? Do you just guess?
 
The list of owners is here on the lower left.
 
Typing without looking at the screen causes typos, not blatant grammatical errors.
 
Wow there are a lot of owners.
 
2:15 AM
@phenomnomnominal

[TypeError]: Incorrect use of 'your': Line 4 Column 19.

Mistakes happen...
@phenomnomnominal Gratmatical erors and speling eros for tha winn!
Also, I don't guess, I'm really good in English, mind the irony.
 
@CheesyBacon In what ways are you good in English?
 
@Nile I am good, just not all the time.
 
@CheesyBacon What do you mean by good, though?
Your profile says you're from California, so I'd hope you're fluent... specifically, what do you mean by good?
 
@CheesyBacon A little bit above average.
 
@CheesyBacon for...?
 
2:23 AM
@Nile What do you mean, for?
 
@CheesyBacon You're above average for someone who's fluent in English...?
 
@Nile Um, yes... Is that a problem? Or is it unnatural?
 
I don't know what my original intent of this argument was, anyways.
 
@Nile Me too.
 
But to say you're good in English is awkward... unless you're talking about something specifically like reading, writing, spelling, etc...
 
2:25 AM
@Nile Um yes, reading, writing, spelling, etc., and the literal language.
 
okay ;)
 
JSFiddle is in Alpha?
 
@CheesyBacon are you asking someone?
 
No, just wondering out loud, and it is.
 
What's wrong with it?
 
2:35 AM
@phenomnomnominal Never mind about that, may be confusing...
 
Yes, I'm sure it will confuse me, I'd better not try, it might hurt my brain.
 
@phenomnomnominal How could some small thinking hurt your brain?
 
I'm just that stupid
 
@phenomnomnominal What would 1 + 1 do to your brain?
 
probably return undefined.
 
2:39 AM
@phenomnomnominal What about

( ( (pi * 2) * 5 ) / 5 ) * (Infinity + Infinity) * 5

?
 
return "I'm a fucking moron"
 
:D
just kidding
 
Cool story bro.
 
In JavaScript, ( ( (pi * 2) * 5 ) / 5 ) * (Infinity + Infinity) * 5 does indeed return Infinity.
Can your brain handle infinity?
 
No shit.
Do they not teach sarcasm where you're from?
 
2:42 AM
Yes, I'm just teasing you >:D
 
You're not very good at it.
 
I was going to output a very complex math equation.
 
I have a degree in Engineering and I'm doing my Masters in Graphics, show me what you got.
 
FFFUUUUUUUUU
Just click on the link -_-
 
What makes that complex?
 
2:47 AM
@phenomnomnominal Is it?
 
Not particularly
 
@phenomnomn How is that even possible?
 
How is what possible?
 
( Infinity * Infinity ) + Infinity
 
Still just Infinity
 
2:49 AM
I guess * and + don't mean anything 2013
 
@CheesyBacon What are you even saying?
 
Your sentences mean nothing.
 
@phenomnomnominal Because you don't understand me.
 
Because you speak English poorly.
 
@phenomnomn Such irony.
 
2:53 AM
I'd feel comfortable betting that you probably don't understand irony either.
 
Anyways, which is smaller?

var array = ["A", "B", "C"];
var array = "A B C".split(" ");

Not sure, Google's compiler uses this.
@phenomnomnominal I'm not stupid -_-
 
The first is much clearer.
 
Why would you use the second? They're essentially equivalent
 
And the second requires the split operation
 
Hey anything wrong with this jsperf test?
because it seems regex is faster here :/
The test is for this post stackoverflow.com/q/17140783/1577396
 
3:04 AM
@Mr_Green For one you're using a find and a filter and for the other you're just using a find?
 
yup
 
@Mr_Green You're testing two variables instead of one, then, and it's hard to extrapolate the cause
 
I updated the jsperf test
check again
@Nile I am doing it correct. right?
 
nodeName vs. tagName, but I'm not sure how much of a difference that would have.
 
hmm
just tell me whether I am doing it correct or not
So, that I can ping OP
to select the correct answer
 
3:12 AM
@Mr_Green Your test still relies on multiple variables; so no, not 100% correct.
 
I updated again
I don't know where I am using variables
I removed the only variable which I was using now
@Nile
 
Not legit variables... test variables. Like independent variables that'll affect the outcome
 
Can you please update it
 
$(Array.prototype.slice.call(document.all))
 
3:18 AM
yup now I think it is working good
 
what you changed exactly?
 
I added a different test
 
@phenomnomnominal wow
never used it
 
Is the bot working yet?
 
3:26 AM
!!/go_fuck_yourself_bot
 
I updated my solution with yours
I think I explained it correct
 
k thanks for that :)
 
@phenis
 
@Gaycunt
 
user1743637
3:42 AM
Hi all.
 
m59
@rlemon you still here?
 
4:24 AM
He's not
 
m59
cool.
Noms, your input would be cool. I was kind of going for REST backend with js using ajax for all my site's content, but it looks like that isn't going to work...
I still want an api for my articles and users..
So, if my site's template/main content is output from the server, should (or can) I still pull up the content from my own api?
like...curl or something?
or is that fail in comparison to just having a separate method to pull the info right from the db? @phenomnomnominal
 
I'm addicted to Pinterest does this make me a bad person
 
m59
It makes you a good cook / interior designer lol
 
Hey guys, what could be going on in this question? Admittedly just dropped my answer in there without giving it too much thought, but would like to get another opinion.
 
Is there any good editors that allow you to navigate the html file buy navigate using the arrow keys via the elements ?
eg... you have <div><p></p></div>

using the arrow key it selects, div, then p, then the close bracket </p>
 
4:36 AM
@m59, why wont the api work?
 
m59
I'm just often unsure of what makes sense with all of this.
It's all new.
Isn't it, like, extra work for the server to visit the api url rather than access directly?
 
Not really
 
4:51 AM
dang oh well
guess i will use the emmet ctrl +< then
 
m59
@phenomnomnominal alright, so then should I access everything from the api, since it can already connect to the db and all? rather than have that + my site's php file connecting to the db?
err
bad logic...
 
just do everything through the API
An API is a very nice abstraction
 
m59
Do I need to make the api give me everything in one call then?
Otherwise it has to reload the classes it needs and stuff each time.
 
Yeah, it should just return JSON of whatever you want
 
m59
man that's going to be tough =D
if I want article 14, site.com/api/article/14
I get that and can probably work out how to wire it up.
 
5:07 AM
0
Q: Getting InvalidOperationException Exception from c# mongodb driver for queries that return large dataset

jaminatorI have a restful service in c#.net that talks to mongodb. When I return about 20,000 records to client the service works fine. But increasing the returned data set causes below exception on server side: System.InvalidOperationException: Server instance xxx.xxx.xxx is no longer connected. ...

 
im using mongodb as a side project
 
m59
well, I was typing out what I was thinking and my brain got a bsod.
ah well.
 
reboot man reboot
 
is there an event listener which waits for focus to end
so basically the opposite of "onfocus"
 
m59
@phenomnomnominal ya know, I'm way so close to going with angular for the site output after all.
I think I can easily make a little sub site for the crawlers.
I'm just wondering if the crawlers care about certain things.
I'm thinking of outputting some meta tags and the main content in a p tag..
and the nav menu? if it cares about the links?
 
5:24 AM
google crawler will typically use your link's n your nav menu for the number of external or internal links
 
I want to use a "simple function" to get this value
Can I do the following?
$('#product-image').each(function(){
    var self = this;
    var height = self.attributes.height.value;
});
or is there any better way?
 
@Mr_Green use the second argument to each
It's a little known fact, but jQuery#each actually does take arguments
why not do this.attributes.height.value?
 
yes we can
I was just testing
 
@Kit Sorry, that usually happens if my connection goes down for a bit, at which point it's deaf, even after the connection goes back
 
$('#product-image').each(function(i, self){
    var height = self.attributes.height.value;
});
I did this
 
5:36 AM
by the way, what are the arguments given to an event handler?
 
Will I be classified as a professional, if I buy a Rolodex?
best show on tv
 
@O0oO0oOO0ooO mostly just a graphic designer
 
Or, "This is really basic stuff engineer"
 
@Mr_Green I had a similar issue with jquery each binding the iterator of a collection to this, instead of passing it as a parameter.
 
5:51 AM
hmm
 
The other issue is that this, is not a jquery object but simply a DOM element
 
18 mins ago, by Mr_Green
$('#product-image').each(function(i, self){
    var height = self.attributes.height.value;
});
 
@Chad I saw a person before he calls him self "Graphic design engineer"
 
So, you are saying the above is wrong or correct?
 
It looked cool
 
5:53 AM
@phenomnomnominal I was gonna do something, then I forgot, what was I gonna do
 
because he's an engineer
 
@Rlemon @Octavien ignore what happened alst night i just walked out and was just venting myself out
 
@Gacnt, bro, what?
 
I just wanted your attention, I have it now, I can be happy for the next 12 hours.
 
WTF is an SO engineer?
 
5:56 AM
@Gacnt, bro.
 
@O0oO0oOO0ooO It is correct. JQuery support the usage of binding the iterated over element to this, or passing it in as a parameter. I stand corrected.
 
@phenomnomnominal 24 hours now, keep it goin
 
@O0oO0oOO0ooO Normally convention I have seen is that a the iterator is not bound to the function object 'this' only in situation where it is a event handler
 
><((((º>
 
What's everybody doing
 

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