« first day (1471 days earlier)      last day (3471 days later) » 

12:05 AM
i need some help with a function i have. Im trying to keep a red square inside my circle. which works in 4 compass directions but not when you drag to the corners. i don't fully know how to implement the logic to check for it how ever. jsfiddle.net/eeq5warx function that deals with it - is on line number 57
 
 
2 hours later…
1:43 AM
ugh man
wife is having a halloween party
I'm a bit drunk and bored
dudes are all watching baseball.. bleh
why must the chats be so barren on saturday nights
why.. must you all have lives! :P
 
Games?
 
@copy you mean everyone's playing games?
 
No, you could play games
 
ooh yea
eh idk I might
then I just seem like a weirdo
like 25 people at my house
and I'm chillin in my room l ol
because I have like 0 in common with you're standard avg american dude
 
I'm not an expert on those situations :(
 
1:57 AM
haha me neither
I miss college days
go to a party, get drunk do stupid drunk shit
now old people just watch tv and talk about their kids
lol being a younger guy trapped in an old dude body sucks! :P
 
Definitely
But you're an adult, you can do whatever the fuck you want
3
 
true
> But you're an adult, you can do whatever the fuck you want
most motivating statement ever.
/me goes to get more to drink.
 
ahaha
you should just goto your pc room, boot up a pc game, get on TS and fuck em all
 
keywords: "at my house". Tell them to fuck off
 
buy civ beyond earth and play with me :P
 
2:15 AM
i sadly went back to previous civ
new one was okay but just didn't the mark for me
 
@rlemon is it good?
 
I like it
 
it's on my list for when i finish this stupid website for my gfs practice
 
I've been playing Xenonauts a lot recently. love that game.
 
mia
2:54 AM
hey ppls
 
who's Ppls?
 
I'm not an {} i'm an [] of personality.
 
Straight? Not gay?
 
o_0 what?
 
Now I'm confused...
"I'm not an braces i'm an square brackets of personality."?
 
3:04 AM
"I'm not an object, I'm an array of personalities"?
Whatever that means.
 
Whatever that means.
huh... the first hit for "define array of personalities" is stackoverflow.com/questions/12409915/…
 
!!urban ppl
 
@erikroyall ppl a shorter word for people or peeps
 
!!urban thx
 
@JanDvorak thx Bastardization of 'Thnx,' which is a bastardization of 'Thanx,' which is a bastardization of 'Thanks,' which is a bastardization of 'Thank You.'
 
3:11 AM
user image
5
 
mia
@erikroyall umm interesting yall lol
good night have a good one
 
Good Night.
 
 
3 hours later…
6:31 AM
morning ppl
 
 
2 hours later…
8:04 AM
hi
 
@erikroyall sum ppl don't get it
 
ur ryt. lulululul
 
ikr loloz
 
!!>String.prototype.abbr = function() {return this.replace(/[aeiou]+/g,'')}; 'people'.abbr()
 
@CSᵠ "ppl"
 
8:11 AM
of course @CapricaSix
 
!!> String.prototype.abbr = function() {return this.replace(/[aeiou]+/g,'')}; "Don't cry because it's over, smile because it happened.".abbr()
 
@erikroyall "Dn't cry bcs t's vr, sml bcs t hppnd."
 
Makes perfect sense.
 
!!learn abbr
 
@CSᵠ Illegal /learn object; see /help learn
 
8:18 AM
needs to be learned
the reverse would be useful when ppl spk lk ths
 
bastardize is a better name for that command.
 
kidspk ?
spksms
 
!!awsm Don't cry because it's over, smile because it happened
 
@SomeKittens That didn't make much sense. Use the !!/help command to learn more.
 
boo
we used to have that command
 
8:20 AM
forgetgate
 
nah, that was built in
 
how about 1337 5P34K
 
I think help, eval, listen, coffee, refresh, forget, info, tell are the built-in commands.
 
JS, Y U NO Array.sum() MOFO ?!?!?!
 
8:39 AM
@CSᵠ .reduce((a,b)=>a+b)
 
user652649
@CSᵠ i think you can polyfill it, because iirc it's in the 6 ish ecma spec (but i might be super wrong)
 
what th is Array.sum()?
 
user652649
Array.prototype.sum
 
@JanDvorak too many chars...
 
Is there such a thing, @WesleyCrushed?
 
8:44 AM
not the same as arr.sum()
 
user652649
[1,2,3,4].sum() // 15
 
@WesleyCrushed what di you do?
 
!!>typeof Array.prototype.sum
 
@erikroyall That didn't make much sense. Use the !!/help command to learn more.
@erikroyall "undefined"
 
user652649
@erikroyall idk, maybe in future ecma versions?
 
8:45 AM
Unlikely that it will be included in future es versions. It isn't there in ES6.
 
@WesleyCrushed What about average? Some people like average
And oh, standard deviation.. and what's standard deviation without the variation?
Oh man, so many things to add!
 
user652649
lol
 
iff you don't mind write-only languages, meet J: +/%# = plus-over divided by count = average
 
user652649
well clearly it's not absolutely required. i was just saying that i saw once a code using the polyfill, therefore i assumed that it was going to be new in ecma
 
var webpage = new WebPage.generate(new Mind('erikroyall').read().toLocaleString());
webpage.update(new Mind('client-xyz').read().toLocaleString());
 
8:55 AM
@WesleyCrushed We're all a bit pedantic here, did you happen to notice?
 
user652649
@Neil a programmer that is not pedantic is not a good programmer
 
@erikroyall oi
don't steal my name !!!
 
Give me a min.
 
though my thing is named mastermind
 
Steal, wha?
 
8:59 AM
but still :o
 
oh..
 
@darkyen00 mastermind existed long before you thought of it
 
@darkyen00 true
 
@Neil have a look at the pastie
would u like to structure your code like that
 
9:02 AM
5 spaces :O
 
No tabs? No way
 
@Neil no the way worker / main thread flip-flop
 
@darkyen00 Is that what mastermind does here? Performs work in work thread?
Isn't that a bit overkill?
 
@Neil nope.
it allows your ui-thread to be running at 60fps always, even on an iPhone 4s
MasterMind is a micro-framework which performs all the logic tasks in worker
and ui-tasks and user input tasks in ui thread, thus the app always feels fast and responsive
ps states can be created / updated / destroyed as per developers requirements.
this allows some states that are constantly being rendered like the conversation list
to be updated in background always :D without making the ui lag
also this is quite inspired by flux so everthing communicates with events.... makes programming easier
last but not the least -- the worker thread can be a shared worker.
 
I really didn't think it was that much of a problem quite frankly
Then I don't usually write web applications to work on smart phones
 
9:11 AM
it isnt as much if you are targetting the decent powered phones
but old phones meh :-/
ps : if we have threads why not use em ?
 
I thought the whole advantage of nodejs was that it was single threaded
That it could scale easily that way
 
I don't think web workers are supported by browsers that are supported by old phones.
 
@Neil and then we found clusters
Old Phones > Android 3
 
> Android 4.4
 
9:30 AM
@erikroyall cocoonjs webview +
 
9:46 AM
> Uniform webview on any Android 4.x device.
 
Morning
 
hi
 
Hi!
Is there a way to know *in advance*, what would be the bounding box rectangle of a DOM element before it is resized to another font-size ?
 
10:17 AM
What?
 
@Basj cloneNode(deep)
 
And set fontSize
 
And getBoundingBoxClientRect
 
* .getBoundingClientRect()
 
..meh whatever...
 
10:26 AM
2 hours ago, by Neil
@WesleyCrushed We're all a bit pedantic here, did you happen to notice?
 
lol true
 
What @WesleyCrushed said to that is striking.
 
@erikroyall ...so would you apply to that theelship now?
 
I don't want to.
 
The form is too long and it bores me... :P
 
10:36 AM
What? Too long?
 
Let's see if I can procrastinate till the last date :D
 
That's too short for what they're offering, though.
 
...It's too long for a people like me who are very very very very very very very very lazy
 
Lazy? Physically or mentally?
 
physically. mentally? never...
 
10:40 AM
3 mins ago, by Awal Garg
The form is too long and it bores me... :P
 
yeah... I would have to type so much shit... I would rather let it go considering the acceptance rate is negligible and I am no big guy :D
 
"100,000 dollars for staying away from your loved *one."
 
Thanks @AwalGarg and @erikroyall
 
@erikroyall ...staying away from family? this is AWESOME!!!!!!
 
Whoever said family..
 
10:45 AM
hey gents
 
@RobertMallow hey lady!
 
hi !
how are you all of you?
 
I wanted to greet you and ask you a simple question hoping that it doesn't waste your time. if a web page takes 2 seconds to load for 100.000 people.. does it mean that it will take 2 seconds for everyone or is it distributed like 2s/100.000?
 
neither
 
10:48 AM
now the latter would be awesome
 
mmm
@AwalGarg how come if I may ask?
 
that would be, like, 1000 times the usual screen refresh rate
 
@JanDvorak hehe. that's what I'm aiming for :)
 
@RobertMallow learn how computers work
 
@AwalGarg I know lol :) I have a server side function that takes 2 seconds to load in a simulated environment of 100.000 people
that's why I asked
I mean, 2 seconds to execute, from the beginning to the end
 
10:53 AM
@RobertMallow ...in which case, you are just one step left to get the answer by yourself. Simulate the environment for a single person :)
 
Those 2 seconds include time taken:
1. to lookup dns
2. by the client to send the request
3. for processing the request, routing, and all that backend blah-blah by the server
4. for receiving the response from the server
5. for rendering the page by the browser
 
@AwalGarg for a person it's just "uncalculable" xD I get 0.000s haha. so I expect this to work the same once it's live
@erikroyall Nope. it just includes the function. so only point 3 and 4 is covered :)
 
@RobertMallow simulate for 50000 people, write the result. now for 10000, and keep repeating. You will get the idea.
The answer to your original question is simply: "it depends"
 
@AwalGarg Thank you I will :)
I know that of course like erikroyall said there are other constants to take care of
 
@AwalGarg But how?
 
10:56 AM
@erikroyall how what?
 
which is what I'm going to do when I'm done with this function
 
@AwalGarg Loadrunning..
 
@erikroyall python -m profile -s cumtime serverfile.py
 
@RobertMallow Point 3,5 are the only things you can and should take care of.
 
in the file I do something like this:
for i in xrange(5000):
    function()
 
10:58 AM
@erikroyall he would know what to do for that :D
@erikroyall actually, he can take care of 1. also
 
But I don't.
 
         100007 function calls in 2.056 seconds

   Ordered by: cumulative time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.356    0.356    2.056    2.056 serverfile.py:1(<module>)
        1    0.000    0.000    2.056    2.056 profile:0(<code object <module> at 0xb70ff3c8, file "test.py", line 1>)
   100000    1.700    0.000    1.700    0.000 serverfile.py:5(tag_sanitizer)
        1    0.000    0.000    0.000    0.000 :0(setprofile)
        4    0.000    0.000    0.000    0.000 :0(replace)
an example of the result ^^
 
I dunno what backend he is using, so neither do I know lol
 
@AwalGarg custom Python wsgi server
@erikroyall yep. one could also scourge the web for hosting providers who give better DNS response etc.
 
@RobertMallow then explain @erikroyall how you are recording those logs, since he wants to know :D
 
11:01 AM
I'm talking about loadrunning, not profiling.
 
I have only done such a thing in apache
 
Simulating tens of thousands of simultaneous users..
 
@AwalGarg Still not recording logs, but doing a "run and try" stuff :)
@erikroyall oh.. I thought you were talking about the function
for "loadrunning" you can use apache benchmark
 
@erikroyall I don't know the "how it happens in the inside of the computer" but I know that it can be done, and I have done that... in apache.
 
Checking out ApacheBench..
 
11:03 AM
@erikroyall apache comes pre-packaged with benchmarking tool... something called abs bla bla
 
There's also siege which is good, but I found myself better with apache benchmark
 
I use nginx.
 
@erikroyall I switched to nginx after a while
but for php heavy sites, apache is the way to go.
 
you use apache benchmark like this
ab -n [put number of simulated connections] -c [number of concurrent connections] http://[url][?port]
"-k" if you want to test keepalive
 
or you know... just use both. nginx as a reverse proxy for static content, and apache for mod_php
 
11:07 AM
I used apache but for something with a load of 100> it begins going apeshit
eats a lot of memory
even with Python
Apache -> process based
Nginx -> thread based
threads and greenlets are lighter than full blown processes
 
dude.................
 
PHP is only used for the frontend in my application, so..
 
CLI?
 
@erikroyall You have a very different definition of "frontend" than ours
 
@SecondRikudo Yeah
 
11:11 AM
(Or I have no context, also possible)
 
hold on.....
@SecondRikudo what happened to you?
 
@AwalGarg Halloween.
 
Benchmarks say more than everything
 
@SecondRikudo ... pls pls revert it pls pls pls
 
11:12 AM
@AwalGarg No. >:)
 
@RobertMallow benchmarks lie more than everything
 
Did you read what it says on the picture?
 
@SecondRikudo ts;dr
 
then make a benchmark yourself
 
11:13 AM
@RobertMallow Benchmarks are very hard to get right, and they're often mislead.
 
with wordpress for example
and see what you get
 
What works like this on my hardware might work differently on yours.
Also, these differences are miniscule unless you have an app that serves millions of users per day.
 
> The most evil ninja ...
eh?
 
@SecondRikudo That's right, but for Nginx it isn't the case
 
@RobertMallow Have you tried it on every possible hardware and OS?
Because I know I haven't.
I use nginx because it's simpler, it's more intuitive and it's more powerful.
Not because it's more performant.
@AwalGarg And as the most evil ninja I say: "MUAHAHAHAHA"
 
11:15 AM
@SecondRikudo Apache starts eating a lot of memory when a few hundred processes are spawned whereas Nginx spawn threads which on 10.000> load eats like a few MBs of memory
 
I have used both nginx and apache, and I know apache gives better performance with mod_php for php processing than nginx/fastcgi
 
Take a look at "top"
if you have Linux
while either is running I mean
 
And I know that nginx is superb for css,js,images serving
 
@AwalGarg But nginx is likely able to serve more people concurrently.
 
@SecondRikudo true
 
11:16 AM
@SecondRikudo Perfect, that's what I meant
 
So if your apache can serve a PHP page in 1 second, and Nginx in 3, but Nginx can serve 100 times more users, you'd still go with nginx for anything that has more than a few users.
@RobertMallow That doesn't change the fact that showing benchmarks in meaningless.
That's the point I'm trying to get across
I'm not arguing that nginx is more or less performant
I'm arguing that arguing about it is moot, because developer time is more expensive than server time.
Whichever makes you more productive, and that is usually nginx.
As an addendum, since we more or less understand how both nginx and apache work, we can say that nginx is likely to be more performant as well.
 
@SecondRikudo Sure. the benchmark in this case shows what is already known about Nginx and that it "can also handle on average 40% higher traffic than apache in 300% less time. (Basically, it’s 4.2 times times as fast as Apache on these tests by average, and a lot more reliable!)." as wrote at the end of that benchmark
 
I also use nginx, it is better for my case.
 
@SecondRikudo Yep
@AwalGarg anyway you use PHP and I Python so our experience might be different :)
 
@RobertMallow nginx ftw if you use python... don't look at apache then.
 
11:20 AM
yeah :) I just look at apache ...... benchmark :P
 
@SecondRikudo btw, you would revert it after Halloween anyway, right?
 
back in the times I used PHP+Apache but I had a crappy blog with little to no load haha
 
@AwalGarg Maybe
 
:D
 
is zigi back?
 
11:22 AM
@RobertMallow Not seeing him here...
Why?
 
@SecondRikudo Fine fine. the chat rooms seems more relaxed :)
 
user image
2
@AwalGarg ^
 
yea saw that... it is so... ahem!
 
Why?
 
going back to work.
>afcr
(away from chat room)
 
11:24 AM
it annoys me... rainbows and evilness??? WTF!
 
@BenjaminGruenbaum Are you around by chance? I'm playing with Bluebird again, and want to have yield'ed functions made co-routine in a yield handler. I'm looking through your answer at SO, but cant seem to make it work. (stackoverflow.com/questions/26111738/…). Can you give me some pointers please? :-)
 
how do I manage getting a callback from a promise .then after an .all when some of those promises have returned with 403 etc.?
 
11:55 AM
@RoelvanUden sure
@Mosho are 403 rejections? Also, is this $q or Bluebird?
 
@BenjaminGruenbaum it's jQuery
not sure what you mean by the first question
it's an external API
forbidden url
I made a loop for now but.. it's a loop
 
jQuery promises offer nothing in their API to help you with that, you'd have to implement .settle, I'm pretty sure I do that in an answer or two in SO.
 
righto
thanks
 
Today I'd just create a reflect function that takes a promise and returns a promise that resolves when the original promise rejects or resolves with the value and what happened.
So:
 
yeah, I thought about doing that
 
12:01 PM
@BenjaminGruenbaum Please take a look at this: pastebin.com/RSuRfzhx. I do realize that you make a good case to wrap every generator function in a co-routine, but I'm lazy and don't want to do this at all. A performance impact is acceptable, too. I copied this code from your SO answer, and tried a variety myself, none of which turns the generator func into something that bluebird wants to continue with. Got any pointers for me? :-)
 
function reflect(jqP){
    var d = $.Deferred();
     jqP.then(function(v){ d.resolve({value:v, success:true});, function(err){ d.resolve({value:v, success:false }); });
     return d.promise();
}
Or something like that.
 
@RoelvanUden " I copied this code" -- WROOOONG
 
@RoelvanUden You mean you want to convert a generator magically to a function returning a promise, not a promise - right?
 
@BenjaminGruenbaum Err, yes, that. That's how Bluebird is supposed to work.
 
I implemented async here, it's 10 lines and it should give you the idea lemme find it
Jul 6 at 19:40, by Benjamin Gruenbaum
function async(gen){ "use strict"; // asynchronous generator
    gen = gen(); // invoke the generator to get the iterator
    // make the following code throw safe
    return Promise.resolve().then(function cont(a){
        var n = gen.next(a); // yield the next value
        if(n.done) return Promise.resolve(n.value); // a `return`
        if(!n.value.then) return cont(n.value); // yield plain value
        return n.value.catch(gen.throw.bind(gen)).then(cont); // yield the promise
    });
};
 
12:04 PM
@JanDvorak Well, I kinda agree. But I don't fully understand this yet, and when the example doesn't either, I'm just shooting in the dark :D
 
afk meeting
 
My expectation is to feed the generator function into that, and a promise comes. That expectation doesn't seem to hold either.
 
12:26 PM
 
12:40 PM
> hi there im amanda, i was just looking the skype directory and your profile looked cool
Spambots never learn
 
@Cerbrus They learn more than you think.
There's a reason they still exist, they're effective :)
 
Not efficient, though
 
Well, this specific kind of spambot doesn't learn
 
> message: "Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'.
da hell?
 
da code?
 
12:42 PM
@AwalGarg there can only be one...
(#highlander)
 
@JanDvorak ...one what?
 
one HTML element
 
Node of type html
 
the document node is empty
 
or rather, one document element, represented by the html tag
 
12:43 PM
@JanDvorak eh?... no
 
<html> => window.document.documentElement
 
iframe.contentDocument //is a document
 
@AwalGarg code..
Or execute .nodeType and tell what integer it returns
 
var html = document.createElement("html"); iframe.contentDocument.appendChild(html);
^this is the code
 
there is already one...
 
12:45 PM
it gives the same error for appending divs too
@JanDvorak what to append then?
(the src of the iframe is blank)
@erikroyall 1
 
body? The content to the body?
 
> message: "Failed to execute 'appendChild' on 'Node': Nodes of type 'BODY' may not be inserted inside nodes of type '#document'."
 
Then there is already one...
 
You can't just appendChild like that..
Try with a div and you'll get the same error
 
here is the entire stack:
 
12:48 PM
I hate people who dump stack traces in a chat unless asked to
 
@AwalGarg You shouldn't execute .appendChild() on a document object.
 
@erikroyall then?
 
@AwalGarg insert into the body
 
@JanDvorak :(
@JanDvorak but there is no body :( the src of the iframe is blank
 
You have to do what Jan Dvorak said.
 
12:50 PM
ahh nvm got it
 
Even if there's no body, there's a body.
 
@AwalGarg blank src != no body element
 
@JanDvorak true
TIL
 
g2g, bye
 
thanks :)
@erikroyall thanks dude :D
 
12:51 PM
Welcome, and..
Type about:blank into your address bar.
 
and then hit enter
ahh I see
 
Yeah, then view source and you'll see nothing. Press F12 and you'll see some elements created for you.
 
1:21 PM
Ah well, back to co again. Silly Bluebird stuff.
 
1:56 PM
@RoelvanUden what's wrong with bluebird?
 
@FlorianMargaine Probably nothing, but something is wrong with me. I can't get Bluebird to accept generator functions, and I've spend a few hours tinkering to attempt to get it right. I still don't get it, so I abandoned the idea, yet again (third time or so now)
 

« first day (1471 days earlier)      last day (3471 days later) »