« first day (678 days earlier)      last day (4286 days later) » 

8:04 PM
Hmm the mobile char is horrible
 
@Abhishek yes it is
you cannot even edit or star
or reply
 
Yea i see that
Wow chrome for iphone handles jsfiddle in a neat way
Aiight farewell for tonight guys gn sd
 
@RoyiNamir there are 2 iframes when you include a jsfiddle
 
doesn't work
not even in ie7
 
8:15 PM
@Esailija ive made a simple code without jsbin/jsfiddle ( in my Vs2010)
@Esailija the inside iframe has $(window).resize();;
the page itself has `$(window).on('resize', function ()
{
alert('');
});`
 
well they are different windows
 
anyone knows some algorithm to compare two 2-dimensional objects and know if they don't overlap themselves? assuming that you have an array of their positions (x and y)
 
how could it work
 
@Esailija I was told here ( 2 days ago) that one way to communicate is via hash url.
 
8:17 PM
@RoyiNamir ok
@FlorianMargaine what have you tried :D
 
and one event which is global to both iframe and the page is window.resize
 
what do you mean overlap? 2-dimensional object?
object as in a rectangle?
or object as in {}
 
yes for example
objects as in a rectangle
and I'm sure there must be some existing algorithm for this kind of thing
 
yeah it's very simple
I could write it for you or you could google rectangle overlap algorithm
 
but "rectangles" can be "any shape"
rectangle is very simple, yes
 
8:20 PM
@Esailija do you know any global event which both iframe and page will know ?
 
You want a general hit-test?
 
@RoyiNamir no I don't know
 
isn't there postMessage?
@Zirak somehow
but I guess I'm just going to rely on my google-fu
and I guess I have to go back to maths ;(
 
A pixel-perfect hit test is quite expensive. I recommend that you specialize the common, easier cases (rectangle-rectangle, rectangle-circle, etc), because otherwise if you're dealing with more amorphic cases, things get ugly fast.
 
I'm just going to deal with circles yep
oooh
69
A: Combined area of overlapping circles

Ants AasmaFind all circle intersections on the outer perimeter (e.g. B,D,F,H on the following diagram). Connect them together with the centres of the corresponding circles to form a polygon. The area of the union of the circles is the area of the polygon + the area of the circle slices defined by consecuti...

that's a good idea to just deal with the center of the circles
this way I just have to add the radius
 
8:33 PM
hahahahahaha one of the girls at work got stung by a bee when taking out the trash... so she called me to take care of the bees nest in the garbage bin. Lighter and can of WD-40 === 15 minutes of fun and hundreds of dead bees :D
boss approved it
 
rofl
wow that's perfect
arc(x, y, radius, startAngle, endAngle, anticlockwise)
x and y is the center of the circle
 
I'm so glad that we don't have this kind of people in France
 
I think we do.
 
We do ? Read the wall article.
 
christine boutin isn't very proud to be of, for example.
 
8:39 PM
> “The earth will end only when God declares it to be over,”
Someone should end this idiot with two to the head.
 
" “You can’t regulate God!” Barton barked at the House speaker, Nancy Pelosi, in the midst of discussion on measures to curb global warming. "

" The Catholic Church long ago made its peace with evolution, but the same cannot be said of House Republicans. Jack Kingston of Georgia, a 20-year veteran of the House, is an evolution denier, apparently because he can’t see the indent where his ancestors’ monkey tail used to be. “Where’s the missing link?” he said in 2011. “I just want to know what it is.” He serves on a committee that oversees education. "
" At a 2009 hearing, Shimkus said not to worry about a fatally dyspeptic planet: the biblical signs have yet to properly align. “The earth will end only when God declares it to be over,” he said, and then he went on to quote Genesis at some length. "
They are all "high" politician
 
-1
Q: realloc expansion AFTER memory usage

olivecoderCLARIYFING: You can expand using realloc but you need do that BEFORE write to memory. At first: I know that is not correct but I received a negative point in a question and I cant found any reference to help me. The question where I was contested: Failing to reallocate memory when in if stateme...

> Please dont post anything if you are one that c newbies answering everything.
lol :D
 
Christine Boutin is maybe one exception though.
But nobody listen to her.
 
^^
did you see her website with an xss flaw btw?
it lasted one morning or such
but it was all over on twitter
porn pictures all over her website when you used a specific url
 
Yes
I clearly saw it.
 
8:44 PM
hahaha
but well, France is more layman (?) than US
 
hey ya'll
 
how goes it?
 
well i cam in here looking for adventure
 
8:49 PM
I have one for you
I have an array
and I want to compare each item against all the other items of the array
is there a better way than this one?
arr.forEach( function( i ) {
    arr.forEach( function( j ) {
        if ( i === j ) return;

        // do your stuff
    });
});
 
are you actually doing this or just keeping me busy?
 
I'm actually doing this :)
 
if(someArray.join('') === someOtherArray.join(''));
 
why are you using arr for both arrays?
 
I'm doing a collision detection engine, and need to compare all the items of an array between each others
I have an array with some items
 
8:51 PM
you should be iterating the first one, then iterating the second one with the var j and checking them
 
I want to compare each item with all the other items in the very same array
 
Oh, each item.
 
how about this:
 
arr.forEach(function(item) {
     if( arr2.indexOf(item) !== -1 ) {
          //  do your stuffs?
     }
});
ohhh the SAME array
 
lol
 
8:52 PM
x)
 
@FlorianMargaine That's O(n^2) worst case
 
what are you expecting to result from this though?
 
If you presort, you can do it in O(n log n)
 
@Purmou something more elegant that what I wrote
 
no, i mean
what are you trying to get out of it?
regardless of the code
are you trying to return the differences?
 
8:53 PM
@Purmou nope, return the objects that collide
 
@FlorianMargaine so you want to know if the array contains any of the values twice
 
and by object, I mean item of the array
@rlemon no
 
@ErikReppen ?
 
give me example then
what would the array look like and what are you trying to capture
 
oh, that's what I'm writing
I don't want the solution, I just wanted to know if there was a more elegant way to compare each item of an array against the other items of the array
 
8:55 PM
Yeah, presorting
 
@SomeKittens example?
I still have to check the index
 
My assumption is that collisions are numerical
therefore you can sort
so, in pseudocode:
 
lol are you really looping through an array with Object.keys().forEach
 
@Esailija the array if generated from object.keys() yes :p
 
no, I mean you are passing an array to object keys
 
8:57 PM
I just wanted to keep it simple to concentrate on my question
 
sort the array
forEach
    if(i === i+1)
        return;
 
oh, right, didn't change that
 
O(n log n), because the sort takes n log n time, but the actual search is linear.
 
items.contains(item); ??
 
@ErikReppen ?
 
8:58 PM
arr.forEach(function(i){
    var temp = arr.slice( arr.indexOf(i) , 1);
    temp.forEach(function(j){
        if(i===j) return;
    });
});
 
@Purmou your code adds one line compared to mine...
and basically does the same
 
but doesn't your code cause it to collide with itself?
you're not removing the option you're checking
so if it iterates the second time over the same object, it'll return
 

« first day (678 days earlier)      last day (4286 days later) »