« first day (624 days earlier)      last day (4329 days later) » 

3:08 AM
@copy have you checked out IslamOverflow yet? area51.stackexchange.com/proposals/14922/islam
stackexchange covers everything from here till tomorrow
I even have my own site JohnMerlinoOverflow
 
3:41 AM
There are an enormous amount of questions to discuss and debate within any given religion, so that seems fair
 
4:38 AM
young bull
 
4:52 AM
how do i get a list of all fan pages on facebook?
 
5:25 AM
2
A: HTML5 - Render simple electrical circuits

mndofteaSorry it's been a while, but I've finished the library I promised you. Using it, I can create circuits like these: I've created a simplified drawing system in javascript for you to use by building a short library.Copy and paste the code for it into your page, and then leave it be. If you want ...

 
5:51 AM
hey guys, quick question. I am getting syntax here in this snippet, can someone take a quick look please:
CommunityApp.Collections.Community = Backbone.Collection.extend({
model: CommunityApp.Models.Community;
url: '/communities';
});
nvm got it lol
 
6:42 AM
LOL
@0xSina That happens a lot
 
 
2 hours later…
8:23 AM
I have tried to install mangoose-auth on windows and linux and both give me error when I tried.
this time I on linux
gyp http GET http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
gyp ERR! UNCAUGHT EXCEPTION Error: ENOSPC, write
gyp ERR! This is a bug in `node-gyp`, please file an Issue:
gyp ERR! https://github.com/TooTallNate/node-gyp/issues
gyp ERR! not ok
npm ERR! bcrypt@0.6.0 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 7
npm ERR!
npm ERR! Failed at the bcrypt@0.6.0 install script.
npm ERR! This is most likely a problem with the bcrypt package,
 
8:51 AM
0
Q: why not using javascript but libraries instead

shareefi read this article Unobtrusive JavaScript with jQuery and i noticed these points in the slide some companies strip javascript at firewall some run the no script firefox extension to protect themselves from common XSS and CSRF many mobile devices ignore js entirely screen reader DO execute jav...

 
> i need your comment and responses on theses points is it worth no using javascript and switch to libraries like jquery
 
9:29 AM
@Zirak Hm, couldn't he use coffeescript?
I mean, it's not JavaScript so it's not going to be filtered... right?
 
 
3 hours later…
12:46 PM
-20
User was removed
Wow, FFFFUUUUU
 
1:13 PM
ugh, dafuq did i just read?
72
A: How to create multiline strings

JordãoYou can have multiline strings in pure javascript. It's an unreliable hack, though. So please NEVER use it. It doesn't work on firefox or opera; only on IE, chrome and safari. But it can also break with new browser versions. UPDATE: it doesn't work anymore on newer versions of Firefox. You know...

(tl;dr: anonymous function containing only a multiline comment => tostring => extracting said comment)
 
multiline strings > ASI
escaping newline is not close to multiline strings
:<
@ThiefMaster lol yeah toStringing function gets its source code :P
 
I know, still a horrible hack
 
but there is no good solution at all
I'm not entirely sure but I think multiline strings are impossible with the grammar for ASI
and if it's possible then why isn't it in the spec >.<
fuuu
 
I don't think ASI is the reason for it. it could easily continue in the next line instead of throwing an unterminated string literal syntax error when encountering something like foo = "bar
 
The spec says that the newline token is not valid inside any other token
including string token
 
1:23 PM
Multiline strings are rarely needed in my experience
 
You shouldn't store templates or long texts anyway
 
true but making a multiline string in console is a bitch
i can't just copypaste some text block
 
@copy Tell that all the PHP programmers.
 
php is server side :P
so is javascript but not at the time these decisions were made
 
1:25 PM
@Esailija Oh yeah, that. True
 
Of course, but the average PHP programmer thinks it's acceptable to show a wall of html into a PHP/JS file instead of keeping it in a separate file where he doesn't have to escape quotes etc.
 
but for database queries it's pretty nice
 
true, that's just plain horrible e.g. in C when you have to \-escape every linebreak
 
hmm why would C not interpret the newline just as a literal newline in the string like PHP?
 
the compiler throws a warning an error
but don't ask me why..
 
1:35 PM
yea I'm just curious about if there is a grammatic limitation :P
It would be cool to really understand limits of context-free language but I don't :<
all I understand is that it's like regular language except you need a stack :D
 
@Esailija There's a lot about that topic in CS262 of udacity.com
(with python though)
 
2:30 PM
0
Q: Should I refer to browser-based games as HTML5 games or Javascript games?

BaneFirst of all, I know that there are alternatives to both HTML5 and Javascript, but I worded the question so generally ("browser-based") because if I had said "HTML5" or "Javascript" games that would already imply an answer to the question. When writing wiki posts or discussing, I usually call th...

 
wow
[].slice.call( document.getElementsByTagName("div"))
"Array.prototype.slice: 'this' is not a JavaScript object"
yet shimmed .forEeach would work.. funny
 
on which browser?
 
3:14 PM
IE8
 
@Esailija
function is( elem, selector ) {
    return elem === document.querySelectorAll( selector );
}
isn't this enough?
 
wut
you are comparing an element to a static nodelist?
 
hm, yeah
so it works for querySelector
 
no it doesn't
querySelector returns the first element
that matches
the elem must be equal to that
 
@Esailija for single elements selectors, I mean
@copy it works for the same objects tho :p
 
3:16 PM
is( thirdLiElement, "li") would return false
 
It might work for single elements
 
only is( firstliElement, "li" ) would return true
 
@Esailija for the every thingy, it's actually some I meant :p
function anyIs( elems, selector ) {
    [].some.call( elems, function( el ) {
        return is( elem, selector );
    } );
}
 
trust me that the querySelector is no good
;o
 
I know what you mean, I just think it's good for a quick solution :)
 
3:20 PM
you even have document as the context
and you can't use .parentNode because it might not be available even
now what
 
and about the some? :p
and as I said,
6 mins ago, by Florian Margaine
@Esailija for single elements selectors, I mean
 
"#id" is the only single element selector ;o
you could easily improve it with return !!~[].indexOf.call( document.querySelectorAll(), elem)
man that will perform horribly
jQuery actually has optimizations for class, element and id selectors so it doesn't do that in < IE9
now the op removed my accept \o
nvm I was hallucinating
IDs are not the only single element selectors. — Florian Margaine 29 secs ago
ok, wtf now :D
 
3:35 PM
if there is a single element with class "a", it's a single element selector
or a single element like .first .a
 
eh, it would select a single element in that case but it doesn't make it a single element selector
weird logic imo
 
what's a single element selector if it's not a selector that selects a single element?
 
Something that selects single elements
regardless of what you are querying of course
 
3:55 PM
function is( elems, selector ) {
    var sel = document.querySelectorAll( selector );
    return [].every.call( elems, function( el, i ) {
        return el === sel[ i ];
    } );
}
good enough?
 
it's not every
 
is it some?
 
how can every element in a QSA match one element?
 
i never remember
 
yes, it's some :P
think about the word every and it should be easy to remember :P
 
3:58 PM
no, it's every there
it should return true if every element matches
 
what
ok I really have no idea what you're doing there
the only thing that would return true is passing ( document.querySelectorAll("div"), "div")
 
He wants to see if elems and sel are basically the same thing
 
if you want the jQuery functionality, you return true if ANY element matches
 
oh
my bad then
I thought every element had to match :p
 
if( $("input").is(":checked") )
returns true if any input is checked
not all
if you wanted all you could just do $("input").length === $("input:checked").length or something
 
4:01 PM
function is( elem, selector ) {
    var sel = elem.ownerDocument.querySelectorAll( selector );
    return [].some.call( elems, function( el, i ) {
        return el === sel[ i ];
    } );
}
 
I think you need O(n²) there
now you are matching the exact index as well
 
That'll only be true if the same items are on the same indices as well
 
var sel = elem.ownerDocument.querySelectorAll( selector );
return [].some.call( elems, function( el, i ) {
    return !!~[].indexOf.call( sel, el );
} );
 
@Zirak no, that was even more wrong
function is( elem, selector ) {
    var sel = elem.ownerDocument.querySelectorAll( selector );
    return [].some.call( sel, function( el ) {
        return elem === el;
    } );
}
 
wow
hmm
could that be right?
ah it's only for a single element yes
 
4:03 PM
the first argument of is is a single element
 
you can replace that with return !!~[].indexOf.call( sel, elem )
 
but with 2 lists situation you need O(N2) loop
 
I'll just use this and stop thinking about it
 
think about it when you are doing is "div": D
with 1000 divs in the document
see why I'm going with matchesSelector? :P
 
4:06 PM
I didn't even know this function
 
hm, say you have an sql SELECT ... WHERE, how can you fetch a random result from the matching set?
I remember there was some trick to match random rows
 
order by rand() and get the first one ? :P
SELECT column FROM table
ORDER BY RAND()
LIMIT 1
 
That's it? ...I was sure there was more to it
ah well, thanks
 
order by rand() can bite you though
if you do it on a big table
 
4:22 PM
It's not over the whole table, only a matching set. Don't really know yet what magnitude that'll be, but about 10 is a good estimate of the max size :P
 
0
A: How to randomly select multiple rows satisfying certain conditions from a MySQL table?

tereškoIs strongly urge you to read this article. The last segment will be covering the selection of multiple random row. And you should be able to notice the SELECT statement in the PROCEDURE that will be described there. That would be the spot where you add your specific WHERE conditions. The problem...

 
Not even sure if I'm going for SQL...considering nosql as well
 
4:48 PM
it doesn't sort it on the whole table but on the matching set of course
dunno if its just faster to get all those rows and get one by a random index in application
 
5:33 PM
0
Q: how include multiple divs in one javascript toggle?

PVAI am trying to implement a javascript toggle effect for my "small" or mobile sized version of a responsive site. I am using my own custom WordPress theme. I'm trying to use the script from this article: http://webdesignerwall.com/tutorials/mobile-navigation-design-tutorial/comment-page-1 The tr...

 
6:13 PM
howdy folks
just to make sure, if I want to do a for loop from 1 to 8 I should do for(i = 1; i <= 8, i++), right?
 
yep, pretty much
after the i <= 8, put a semicolon instead of ,
then you should be good. and you should probably put var before your i
 
6:28 PM
Just googled my way across jslint.com - pretty sweet
 
6:38 PM
@jamesson jshint is even better
I mean, it's the same, but not so much opinionated as jslint
jslint = from douglas crockford
a great guy concerning javascript, author of "javascript: the good parts", the book you must read if you're doing any javascript
but he's also quite opinionated. Really.
 
@FlorianMargaine,yea, I gathered
@FlorianMargaine, interesting to compare results
@FlorianMargaine, funny that he comes from lucasarts
 
7:04 PM
0
Q: javascript horizontal slider problem

George GrigoritaI'm using an old version of the Slidedeck Plugin (v.1.4.5) and I have a javascript problem with one of the skins I'm using. More precisely, the horizontal slides are stitched together and I can't figure out how to fix this. I want each slide to be independent, without any content from the next or...

 
@rlemon happy Canada day!
 
 
2 hours later…
9:09 PM
can someone check a thing for me
Do someone help me if they are able to see the line in tab on bottom from chrome. in one computer I can see but from another i can't
 
line tab? I dont see anything out of the ordinary
 
@SimonSarris something like this postimage.org/image/6040qcrwj/14a211e6
 
hmm, looks fine here then, using developer chrome on windows
 
@SimonSarris thanks for confirm this issue for me. I am happy now. bye
 
 
2 hours later…
11:48 PM
Someone broke the internet.
 

« first day (624 days earlier)      last day (4329 days later) »