« first day (1707 days earlier)      last day (3231 days later) » 

12:00 AM
Or the Promisor will be succeeded in any case if the stream ended, regardless whether there was an error or not
 
First rule of programming: everything you think is impossible not only can happen, but will the day after you say it can't.
 
@ircmaxell yeah, we don't want to fail the whole Server on each exception ;-)
 
@bwoebi I kind of know what you mean. I have the HTTP library ignore certain socket errors.
 
@ircmaxell I'll wait until tomorrow. I'm very sure it won't happen over-night :-P // I see what you mean, but sometimes it makes sense…
 
Defensive programming: assuming everything can and will fail, including your failure handing code.
 
12:03 AM
Like @ircmaxell when a client sent a malformed request, we don't want to handle that, we just silently remove any evidence of that Client and be happy.
@ircmaxell totally makes sense, as long as you aren't in control of the Promisor itself ;-)
 
@bwoebi Shouldn't you be sending a 400 response?
 
@Trowski I am. … Actually it was a bad example…
@ircmaxell What about that:
            $promise->when(function () {
                foreach ($this->clients as $client) {
                    $this->unloadClient($client);
                }
            });
whether the promise failed or succeeded, we want to unload all the clients.
 
That appears to be exactly what my cleanup() function is for.
 
@Trowski yep.
but actually your cleanup should be nothing else than ->then($callable, $callable);?
 
Essentially. It ignores the return value of $calalble though.
 
12:09 AM
@Trowski doesn't then() do that too?
 
No, of course not. then() returns another promise, which is fulfilled by the return value of the callbacks.
 
"of course" ^^ … used to Amp's when().
@Trowski but what's the point of returning an other promise… oh. then() chaining okay.
question… when then() has no failure handler, does it then pipe the exception forward or not?
 
Yes.
 
@bwoebi well, why don't you want to handle that? I would want to at least log it for fail2ban reasons.
 
12:15 AM
10 mins ago, by bwoebi
@Trowski I am. … Actually it was a bad example…
 
;-)
 
Made up examples are always the worst ^^
 
@bwoebi Yes, very similar to that.
With Icicle, that would be $promise = Promise\resolve($value)->then($functor);
And only because $value can be a promise or value. If it was a promise, obviously skip the function call.
 
@Trowski huh…? why should it be anything else than a promise?!
 
@bwoebi I dunno, I was just comparing it to the function you showed me, which allows values or promises.
 
12:22 AM
@Trowski oh, seems so. Not sure whether that's necessary…
    return function (/* ...$args */) use ($worker) {
        return join(func_get_args())->splat($worker);
    };
@Trowski did you somehow add function overloading?!
or how does join() work?
oh…
it's defined in the namespace a bit down in the file…
sigh…
 
@bwoebi Hmm? Don't like join()?
 
I hate it that you can define names in your own namespace which are already used in global namespace…
@Trowski nah… join() is a PHP standard library function which confused me…
 
Yeah, though it does describe what the function does pretty well.
In that file it's odd, but most people will be calling it with Promise\join().
 
yeah ^^
 
The other choice would be all().
 
12:29 AM
@Trowski That's how it's named in Amp.
 
I was going to rename a couple other things in the next release, so it would be a good opportunity.
 
github.com/amphp/amp/blob/master/lib/functions.php#L507 … legitimate case where it's not cleanup, but using a single callable looks better than a separate exception and success callable.
(IMO)
 
Yeah, though that usage is a little unusual compared to what the rest of the library does.
 
But when you do nearly everything with generators anyway, it matters much less.
 
Yep, honestly if you use generators with Icicle you rarely have to worry about the fact that things are promises (which is kinda the whole point).
 
12:37 AM
yeah
 
1:01 AM
@bwoebi Do you have time right now to try and find that memory leak?
 
@Trowski yeah, show me, will look at it shortly then.
 
What'd you want to see, the output from php with --enable-debug?
 
@Trowski no, the code to reproduce
 
Umm... hmm... I'll have to see what I can narrow it down to, since I'm seeing it with Icicle running one of the examples.
 
@Trowski just tell me which example then ^^
 
1:13 AM
@bwoebi Originally noticed it when writing the HTTP server, but this simple example does it too: github.com/icicleio/Icicle/blob/master/examples/http.php
 
@Trowski do I need to do an actual request or is running it enough?
 
Then run ab -n 1000 -c 10 http://127.0.0.1:8080/.
 
I mean… how does it come to an end?
 
@Trowski could not reproduce too, made around 10 requests.
 
Oh, if you want the script to exit on it's own, add Loop\timer($timeout, 'Icicle\Loop\stop');
 
1:16 AM
@Trowski Yeah, you only ever see mem leaks on the end of a script^^
 
Right, sorry, forgot that I had modified the file.
 
@Trowski do I need any requests or is a timer of 1 second enough?
 
You need to do some requests.
[Thu Jun 18 20:20:11 2015]  Script:  '/Users/aaron/Developer/Icicle/examples/test.php'
/Users/aaron/Developer/php-src/Zend/zend_objects.c(149) :  Freeing 0x10A34E960 (120 bytes), script=/Users/aaron/Developer/Icicle/examples/test.php
Last leak repeated 1 time
[Thu Jun 18 20:20:11 2015]  Script:  '/Users/aaron/Developer/Icicle/examples/test.php'
Zend/zend_vm_execute.h(35171) :  Freeing 0x10A351480 (56 bytes), script=/Users/aaron/Developer/Icicle/examples/test.php
[Thu Jun 18 20:20:11 2015]  Script:  '/Users/aaron/Developer/Icicle/examples/test.php'
I get basically the same output every time.
 
Yeah, could reproduce
 
--- sory to interrupt debug session but is the current build broken?
> Fatal error: Only variables can be passed by reference in .../php/ext/phar/phar.php on line 17
 
1:22 AM
@marcio I just did a pull before I built, so I don't think so.
 
you ./configure with --disable-all, right?
 
@marcio sure that's current build?
 
git pull --rebase upstream master && ./configure --enable-debug --enable-maintainer-zts --with-readline && make -j8
 
that one is not going to be fun, lol
 
> Fatal error: Only variables can be passed by reference in .../php/ext/phar/phar.php on line 17
 
1:25 AM
@marcio Trying your way right now.
 
> make: ** [ext/phar/phar.phar] Erro 255
you probably have --disable-all, but I need phar extension >.<
huu, there is a slay of errors a few lines up:
Generating phar.phar
PHP Fatal error: Declaration of CachingIterator::offsetSet() must be compatible with ArrayAccess::offsetSet(unknown &$param0, $param1) in Unknown on line 0
...
 
I've been building it with --enable-debug --enable-pcntl --with-openssl=/path/to/brew/installed/ssl
 
there were some updates to that today
 
ok \o/ I'll give up today and go read or watch something, please resume your debug session, gn
 
@marcio It built for me using that configure.
 
1:31 AM
maybe it just needs a clean up here, ty.
 
Yeah, I added make clean
I've been burned by that after a pull.
@bwoebi Shot in the dark, but maybe something to do with stream_select()?
 
@Trowski no idea, really, have to debug it.
 
Anything I can do to help?
 
@Trowski btw. do you know what leaks?
your very timer you've added, lol.
 
It leaks without the timer though.
 
1:37 AM
so, maybe an issue with SplPriorityQueue
found the leak
 
@bwoebi Do tell. I'd like to try the fix.
 
Hello everybody
Anybody here use Codeigniter?
 
not without substantial financial incentives
 
@Trowski fixed
oh^^
you wanted to try^^
 
Well, I'd be interested :P
 
1:43 AM
and I was so quick that I hadn't even noticed your ping^^
already pushed^^
it was just one addref too much
RETVAL_ZVAL() already had copy flag set
and then there was an addref just before much
 
Oh, ok, I'll pull and try it.
 
@Trowski can you confirm if it disappeared now?
It actually was much easier to debug than I feared^^
 
@bwoebi Better, but I'm still getting (much slower now) increasing memory with 7 that I don't see with 5.
 
@Trowski do you still have a memory leak?
 
Would appear so.
 
1:49 AM
or is it just some error in your application?
 
Still getting:
[Thu Jun 18 20:45:31 2015]  Script:  '/Users/aaron/Developer/Icicle/examples/http.php'
/Users/aaron/Developer/php-src/Zend/zend_closures.c(313) :  Freeing 0x10E35A440 (288 bytes), script=/Users/aaron/Developer/Icicle/examples/http.php
[Thu Jun 18 20:45:31 2015]  Script:  '/Users/aaron/Developer/Icicle/examples/http.php'
/Users/aaron/Developer/php-src/Zend/zend_objects.c(149) :  Freeing 0x10E9ED100 (232 bytes), script=/Users/aaron/Developer/Icicle/examples/http.php
=== Total 2 memory leaks detected ===
 
okay, then that's an other memleak
 
Yeah, I don't have the issue in 5, it maxes out at about 8 MB of memory no matter how many requests I do.
On 7 it just keeps marching up.
 
I now notice that I didn't even try if my fix worked… just committed straight away without even a make before xD
 
Now that's confidence.
 
1:52 AM
in myself? yeah^^
 
anyone know of a good js caching library (that supports multiple backends like memcache/redis/files) kind of like php's stash library?
 
@Trowski inner coroutine object leaks… (in the example) :o
 
Any idea why?
 
not yet
 
Having a closure in a generator maybe?
 
2:05 AM
need to compare with what should happen normally…
looks like that's some other bug ^^
I see what's going on, but not yet why
 
What's it doing? Not free the closure?
 
@Trowski not freeing the Coroutine->This in constructor
 
user895378
2:22 AM
FWI amp uses when() because (1) then() chaining is terrible for performance and (2) you should never be calling those promise methods directly anyway because generators.
 
user895378
The javascript promises A spec is no longer applicable IMO because it was created for a world without generators.
 
user895378
Incurring the pipeline chaining performance degradation of a thenable when you have generators is stupid.
 
user895378
So amp doesn't do it.
 
user895378
And it ignores it because there's a BETTER API in the form of generators yielding promises.
 
user895378
It combines the best of both worlds: the improved performance of the standard error-first callback (used everywhere in node.js) with the ease of use of generator coroutines.
 
user895378
2:24 AM
So you have the option to avoid callback hell with a far more natural API while still being able to take advantage of the performance of callback hell when you want to do so.
 
user895378
People can use thenables if they want -- but IMHO it's stupid to incur that overhead if generators are a thing.
 
user895378
/cc @ircmaxell @Trowski @bwoebi ^
 
@rdlowrey We talked about this the other day. The way I implemented promises, they only incur the overhead if using a method returning a promise. So I give people the option: use as a thenable or use in a generator.
 
user895378
Right ... I was just responding to some of the comments to the effect of "only Amp does it this way"
 
user895378
That doesn't change the fact that thenables are a bad abstraction in a world with generators.
 
user895378
2:29 AM
That's why I specifically don't offer a then() -- because I think it's something to be avoided and not something that should be parroted from javascript like all the userland php implementations that ripped off javascript's original approach.
 
@rdlowrey Only Amp doesn't separate the success and failure callbacks (from what I've seen) on promises.
 
user895378
Right. It uses the very standard error-first callback mechanism (the standard method in node.js BTW).
 
user895378
It's not a new or different concept.
 
I wouldn't go so far as to call them a bad abstraction even with generators, since there's still some interesting things you can do with combining them.
 
user895378
@Trowski Nothing about combinator functions requires a thenable
 
2:31 AM
Right, I noticed you have very similar combinator functions with Amp's promises.
But that's because Amp's promise are fundamentally thenables, just with a different way of registering callbacks.
 
user895378
I don't think that's a correct statement, but it's really just semantics. Thenables != promises
 
user895378
A promise is nothing more than a placeholder value. It doesn't have to observe the usual then() functional style where you're forced to specify multiple callables if you want to handle both success and error conditions.
 
user895378
That's my main objection really ... it's not about thenables ... it's about enforcing strict functional style for the sake of enforcing strict functional style that I take issue with.
 
user895378
There are definitely benefits to the functional style, but the tradeoff is a lot of performance.
 
@rdlowrey We're arguing semantics, but this function github.com/amphp/amp/blob/master/lib/functions.php#L398 is kind of your then().
 
user895378
2:39 AM
@Trowski it totally is :)
 
user895378
But I mainly just want to touch on the functional issue from a couple of messages up
 
Ok, well then that's where my comment about them being thenables came from :)
@rdlowrey Yeah, ok, and I see where you're coming from.
 
user895378
If we're writing server applications in userland php and want them to be really performant we have to cut corners.
 
user895378
That's my main thing ... we have to take advantage of mutability in certain places and cut corners.
 
user895378
I went a little overboard with the "it's a bad abstraction" diatribe :)
 
user895378
2:42 AM
That said, what I should probably do is implement a standard then() just for the sake of compatibility with everyone else.
 
Not entirely necessary, since it appears you want people to not even notice things are promises.
 
user895378
Well, I fudged that a little bit ... I think library code needs to be aware of the callback mechanisms when performance matters (this is the tradeoff I was speaking of ... being able to take advantage of callback hell when it's important to maximize perf).
 
In fact, didn't you call them Futures before?
 
user895378
I did, but mainly because I never liked the word "Deferred" ... always thought it was an awkward name. That's another concession I've made in the interest of compatibility and lowering cognitive barriers for folks.
 
user895378
What I'd really like to see is a flexible "standard" where everyone does what you've done in icicle ... namely provide a classic then() method in addition to done() (or whatever) so code that needs to avoid the functional aspects in perf-sensitive contexts can do so.
 
2:46 AM
Not sure if you've seen this: github.com/thenable/Thenable
I was considering adding done() to that before proposing it.
 
user895378
That's basically what I want to see.
 
user895378
My reasoning is ...
 
user895378
In any serious application you have to specify an error callback for every async operation because theoretically every async operation can fail.
 
user895378
Usually this means the instantiation of two closures instead of one.
 
user895378
And while it seems like a micro-optimization, it's just the sort of micro-optimization you really have to employ all over the place to create a userland php server with performance comparable to node.js
 
2:50 AM
I avoided some of the overhead by only declaring the two callbacks once for each coroutine.
Which will even be better using yield from, since then it's all one big coroutine.
 
user895378
yeah, yield from is a big help ...
 
user895378
Anyway, I don't think anyone has a monopoly on good ideas (definitely not me) and I don't think we as humans have "solved" the async programming problem yet. I'm for collaboration on this front :)
 
@rdlowrey Along with return, so I can stop writing yield ...; return;
Have anything in mind along the lines of collaboration, or just stating in general?
@bwoebi Any luck with the debugging?
 
@Trowski
 
I'll take that as a no, lol
@rdlowrey I definitely am going to add done() to that interface before proposing it to the FIG, as I think it's an important method.
 
3:08 AM
wtf is going on there…
I need to check if there's some weird optimization from Dmitry…
like tail calls…
 
user895378
@Trowski nothing specific in mind right now (sorry on the garbage mobile version of chat now)
 
I need to revisit that tomorrow…
 
user895378
for the first time in my life i successfully got this girl's phone number and still felt like a failure after the fact. I was not smoothe at all
 
user895378
failing up lol
 
user895378
Need to spend more time on my game and less time on my code ...
 
3:24 AM
@bwoebi Sounds good, since it's about 4 am where you are, correct?
 
@Trowski 5:20
 
@rdlowrey So hard to not give away that you're excited to get the number.
 
user895378
Bob mostly operates on Eastern Daylight Time ;)
 
@bwoebi Don't you have classes to attend?
 
@Trowski I can sleep until noon...
 
3:29 AM
I always seemed to have morning classes when I was in college.
 
^^
 
user895378
I made sure to load up all my classes on tuesday/thursday so i had 5 days of not school and two days of awful
 
4:41 AM
@rdlowrey o.O does she like me? I CAN'T TELL!
IS THIS REALLY HER NUMBER?
 
@SammyK yes, you didn't mention kittens ...
moin
 
5:02 AM
Finally 1000 reputation and here comes the chat box
 
welcome @habibulhaq
 
thanks @JoeWatkins
 
 
1 hour later…
6:23 AM
@PeeHaa In that case, no, I can just fail other requests for now.
 
6:49 AM
guys my question is down there...pls giv ur suggestions it will b lot more helpfull....... i have a select box with onchange event it will invoke an ajax file,i want to store the values from the onchange event in session array how can i do that...
 
please use full length words
4
 
i tried but my values are repeatedly posting in index 0 of the session array
 
@user12688 how exactly are you storing the values ?
what's your code on the PHP side?
 
if(isset($_POST['data']))
{
$strtpnt1 = isset($_SESSION['strtpnt1']) ? $_SESSION['strtpnt1'] : array();
$valid_data[]=$_POST['data'];
$_SESSION['strtpnt1'] = $valid_data;
}
function ajaxcall(type)
{
var parameters = 'data='+type;
var argUrl = 'ajax_data.php';//alert(parameters);
$.ajax({
url: argUrl,
type: 'POST',
data: parameters,
success: function (str) {
$(".hc").html(str);
alert(parameters);
}
});
}
 
@user12688 you can edit previously posted content and choosed "fixed font"
.. so that it doesnt look like shit
 
6:55 AM
@teresko k
 
if(isset($_POST['data'])) {
    $strtpnt1 = isset($_SESSION['strtpnt1']) ? $_SESSION['strtpnt1'] : array();
    $valid_data[]=$_POST['data'];
    $_SESSION['strtpnt1'] = $valid_data;
}
this overwrites the session value
try something like this instead
if(isset($_POST['data'])) {
    $list = isset($_SESSION['strtpnt1']) ? $_SESSION['strtpnt1'] : [];
    $list[] = $_POST['data'];
    $_SESSION['strtpnt1'] = $list;
}
 
@teresko its overwriting again in index 0 and 1...
let me explain the process...
 
how did you try to debug ?
 
in a form i hve 3 select boxes ....in the 1st select box the starting point of the places are fetched from the db...
@teresko for 2nd select box other than the starting point all other values should be displayed..so i'm using onchange event in the 1st select box...
@teresko i hope u get upto this
@teresko hello u there...
 
7:11 AM
I an trying to understand what you wrote
also, I tend to take it as an insult, when someone writes "u" instead of "you"
 
shortcuts...
 
@teresko nw in the 3rd select box there is an onchange event asking the user with a confirm box to continue the process or to cancel it...
 
23 mins ago, by tereško
please use full length words
 
oh yay, friday
 
7:14 AM
@teresko ok..
 
is it okay that I been awake for 3 hours and only just noticed what day it is ...
 
@teresko oops iam sorry...Iam trying my level best ...
@teresko i hope you are following to the process which i written...
 
I actually have no idea what you are talking about
at first i thought, that you were trying to exclude previously chosen options from other selectboxes
but now I am just confused and slightly irritated by constant pinging
 
hi. can anyone can help with WordPress ?
 
@teresko any code editors there to post the code...I cant post it in stack overflow..
 
Gooooooooooooooooooooooooooood friiiiiiiidaaaaaaay!
 
I work up today before 9AM
.. for some reason it feels like an accomplishment. Maybe because for past month I woke up after 14:00
 
Wut? Are you unemployed again?
 
@PeeHaa again? I worked in that place for 18+ months
@user12688 there is so much wrong with it that I dont even know where to begin
 
7:33 AM
@tereško peehaa has known you for more than 18+ months :)
 
@tereško heheh. When I wrote that I thought it might be taken the wrong way ;)
@tereško When did you quit?
 
@PeeHaa a month-ish ago
> 07:34 < Red_M> because why does everyone else need to know what I've tested?
 
Actively looking for a job now or taking a vacation for a while?
 
^2 talking about why that guy doesnt use unit tests
 
help me with this code guys i'm really struck ....gist.github.com/ramlila/30fe396db2f1108a5786
 
7:35 AM
@tereško lol
 
@PeeHaa vacation. I restarted writing code only 3 days ago and am now attempting to leanr ES6
 
It almost starts to look like a sane language now yeah
 
well, I had a time to stop and think about near future
 
lisp is a sane language
:P
 
lol!
 
7:37 AM
and my conclusions was: employment will be a strange concept soon
give it 10 years and most of the stuff will be automated
 
Also the automation setup will be automated?
 
but who will maintain the automation?
hehe
 
Also @tereško haven't you heard? PHP is coming to a browser near you soon!
 
morning!
 
7:43 AM
@FlorianMargaine well .. there is that :D
 
nope already done that
 
@user12688 first of all, learn how to indent: gist.github.com/teresko/e9334006ec3c7419bb87 , second: stop using the deprecated mysql_* function and instead learn to use PDO with prepared statements
 
7:56 AM
Morning
Nope Jimbo
 
Happy Friday, everyone!
 

« first day (1707 days earlier)      last day (3231 days later) »