« first day (1012 days earlier)      last day (4162 days later) » 

21:00
@tereško you know, "colossal" style science fiction
@PeeHaa whatever, just remember that humor and offensiveness is subjective. If someone finds your comment offensive (obviously, without you meaning it to), the best course of action would be to make sure everyone saw it, and just delete it, to avoid the potential headache.
did someone just say "science" next to "biblical"?
user895378
@NikiC creation science.
Though you did mention "fiction" so it makes some sense
user895378
Did your head just explode when I said that? Because my head just exploded when I said that.
21:01
how about " .. of fictional proportions" ?
I think "life of brian" sums it up
@Orangepill what is this? products_page in the code
@MadaraUchiha I can't be bothered to watch, redact and censor every single thing I say throughout the day
Sorry
@PeeHaa In that case, suspended you shall be :P
Or, potentially shall be.
21:02
If you can't be bothered with considering what you say, you should be prepared for a hit if it comes.
@MadaraUchiha I do consider what I say.
For the record, I think what @PeeHaa said was completely harmless
@Chris can we discuss my issure here :)
?
I'm sure most people do. And that't exactly the problem of it
@eliteGamer refresh me ... what code?
21:04
Solution to all problem: Remove flags, introduce bans
oh, $CacheData = phpFastCache::get("products_page");
but i figured it out. That is the name of the cached data
@PeeHaa Aight, whatever.
Don't take it to heart.
@AsafNevo You can put it out there, yeah. If anyone is interested they'll chime in, just go for it
Ok i'll just ask it here. hey guys :) i'm building a log class.. want to use plain text file with XML or JSON objects as messages inside.. i don't know what to choose between one big text file with all logs or a folder with file for each meaage. would love to hear some pros and cons
Like I was saying in the comments, the question you're asking there is primarily seeking opinions. These guys have all sorts of opinions.
21:07
@Chris sounds great, for some reason i almost never used the chat
@rdlowrey maybe you have a better idea of what is going on
This is a good place to ask general or messy questions, no guarantee you'll get an answer, but meh
:)
@AsafNevo I suggest you create a new file each day, or establish some kind of max_log_size variable and start a) throwing warnings/errors, or b) automatically start in on a new log file
The folders thing seems like it would be a pain in the neck. Usually, when you're looking at a log it is because you're trying to solve a problem. Dealing with tons of folder clutter doesn't seem like something I'd want to contend with when I'm trying to solve a problem. I'd like to go to one place, see what debugging information there is to see, and move on.
user895378
@Ocramius Shouldn't line 72 read this:
user895378
$this->assertContains('some-expected-test', $body2);
user895378
And not this:
user895378
21:11
$this->assertContains('some-expected-test', $body);
user895378
?
yes, correct
leftovers of my gisting
user895378
I haven't run it yet. It still doesn't work with that change, though?
@Chris acutely i've thought about it too... what should be a reasonable max_log_file ?
but basically, the CURL test passes, the one with Artax (and Zend_Http and Zend\Http) fails
21:11
@Chris plus too many files in a directory can cause some major file system performance issues.
@rdlowrey no, it now correctly gets a response
@Chris can't really explain why, but maybe because i want to email those file when needed - the folder thing sounds more right.
what I'm wondering (and maybe that's it): is CURL eventually following redirects?
and if it is doing that, can I see what it did?
@Orangepill The limit in Windows is something like 65,000 IIRC
user895378
@Ocramius the http spec says you aren't supposed to follow redirects on unsafe methods (POST)
user895378
21:13
unless approval can be obtained from the user
@chris I'm sure the performance would tank well before that... I know ext3 at about 20K in a single directory and things get unbearably slow
@rdlowrey here's a funny fact then. The first request actually produces a 302 response too
so CURL is not following it there I suppose
Oh yeah, the practical limit is probably much lower than the technical limit
@Chris and how can i prevent the file lock performance issues on lots of logging lines ?
user895378
@Ocramius The 302 in response to the POST request is the one that shouldn't be followed ...
21:15
yep, and so far looks good
user895378
I'm still not exactly sure what it is that you're trying to test though.
ok so if to sum it up, folder is out of the question..
@peehaa that comment is only offensive if you are primed to be offended ... kinda like the statement "help your uncle jack off that horse"
user895378
I used to have an option to allow the client to follow redirects on unsafe methods but I didn't think anyone really needed it. I could add it back if you think it's useful to have @Ocramius
is there a technique to avoid php halting on file lock ?
21:16
in the first test, the second curl_exec gives me a body with the content
in the second test, the second request gives me the body of an empty document that says basically you are being redirected... (standard from that web server) with the 302
and ofc the string is not in the body
and here's a funny thing: if I serialize the cookies to a string (correct format) and use the ModifyHeaders firefox extension and put that string as Cookie:, I get infinite redirects in my browser...
@AsafNevo I don't think it is "out of the question" per se... I just don't like it. There's lot of other guys in here (looks like they're focused on something else ATM); don't take MY word for it, you're looking for a debate/discussion.
user895378
@Ocramius Artax auto-detects neverending redirects and stops following them ...
@AsafNevo As for locking, IIRC the stream filter stuff has a buffer and deals with concurrency and all that: php.net/manual/en/function.stream-filter-append.php
@rdlowrey any way to see the redirects then?
lemme check the examples
user895378
@Ocramius Try turning on $client->setOption('verboseSend', TRUE); and $client->setOption('verboseRead', TRUE);
21:20
yep, just saw... lemme try
user895378
That will show you the raw HTTP messages in your console going in both directions.
@Chris i am looking for discussion but your answer and comment came after this made me thought about folder with 20K+ files... all my dreams about organized folder has gone :)
@Chris the only reason i've thought about the folder is the locking issue..
@rdlowrey that seems interesting... comparing results atm
ok, looks like there's some page with a different URL in the middle of the process
trying some stuff
user895378
I feel like I should introduce different verbosity levels so you can see only the raw headers coming and going because the entity body usually only gets in the way of what you really want to see in the headers.
user895378
Alternatively you could do something like this if you only care about headers:
user895378
21:26
print_r($response->getAllHeaders());
@rdlowrey I'm seeing req/response here
I'll now make a diff with the browser's to see wtf is going on
the intermediate page is not the problem
user895378
Are you sure? Try adding the following at line 645 in your src/Artax/AsyncClient.php file:
user895378
echo "Will this infinitely redirect: " . (in_array($newUri->__toString(), $rs->redirectHistory) ? 'YES' : 'NO') . PHP_EOL;
user895378
(just in case)
@rdlowrey hmm. I can reproduce this here :-/ first failure at socket 263...
user895378
21:37
@bwoebi Yeah that's been my experience. My earliest implementations used PHP's native select() tools before I realized that those weren't feasible for high numbers of concurrent sockets.
user895378
With libevent I've had no problems even up to 20,000 simultaneous connections. I suspect it could easily go higher but I haven't tested more than that.
oh. shit. my ulimit was blocking now.
user895378
lol, yep.
@rdlowrey yeah, it's not about redirects
I'm seeing something else...
server is re-sending me the Set-Cookie header for all cookies
@rdlowrey changed my ulimit, retry now…
user895378
21:40
@Ocramius Like, all of them on a single line separated by ; or , ?
btw. it wil only fail a lot if you write also at lot constantly to all the sockets
@rdlowrey in the first request, the site replies with 3 cookies
in the second request, the site replies with 1 cookie to the browser, with the 3 cookies to Artax
user895378
Was artax sending the Cookie: headers as expected in the second request when you looked at the raw message?
hmm, it was sending 4 Cookie: headers
what the...
$text = preg_replace("/".$re1.$re2.$re3.$re4."/is", "\$args[\\3]", $text); // i want to substitute for the value of $args['yadayada'] and not the literal text $args.. what am i doing wrong?
21:45
huh… I don't understand this. It always fails after 251 sockets are accepted (the other open filepointers are stdin, stdout, stderr, the master socket and one other fopen() here.)… always 251 sockets. I don't understand
@rdlowrey I think putting all Cookie headers in a single one could solve this
I had set ulimit -n 10000
user895378
@Ocramius You mean have artax put all Cookie: headers it sends onto one line instead of doing:
instead of sending:
user895378
Cookie: ...
Cookie: ...
21:46
Cookie:
Cookie:
yeah
user895378
Cookie Monster!
trying to find out if that's it
user895378
I'll paste what to change in a second and you can try it.
gotcha
thx =D
I'd love to show some logs for this weird stuff, darn
err… wait… is the ulimit per tty?!
user895378
21:51
@Ocramius If you replace lines 44-49 in src/Artax/Ext/Cookies/CookieExtension.php with this code it should send them in a single Cookie: line:
user895378
        foreach ($applicableCookies as $cookie) {
            $cookieArr = [];
            if (!$cookie->getSecure() || !strcasecmp($scheme, 'https')) {
                $cookieArr[] = $cookie->getName() . '=' . $cookie->getValue();
            }
            $cookies = implode('; ', $cookieArr);
            $request->setHeader('Cookie', $cookieStr);
        }
user895378
@bwoebi uh, I think so.
@rdlowrey yes, it is…
aaah… this looks better
user895378
@Ocramius Woops, sorry: had a typo!
hehe
user895378
21:54
$cookieStr should be $cookies in that setHeaderLine
also probably the concat should happen outside the iteration
user895378
@Ocramius doh.
user895378
Sorry, not thinking.
:D no worries, I'm still trying to understand why this thing doesn't work
FYI, I'm at 12 pomodoros on this problem
Warning: socket_select(): You MUST recompile PHP with a larger value of FD_SETSIZE.
It is set to 1024, but you have descriptors numbered at least as high as 1035.
 --enable-fd-setsize=2048 is recommended, but you may want to set it
to equal the maximum number of open files supported by your system,
in order to avoid seeing this error again at a later date. in /private/var/root/http-websocket/includes/socket/Socket.php on line 25
okay … :-(
21:55
@rdlowrey aaaaaaaaaaaaaaaaaaaaaaaaaaand success!
I could kiss you!
will recompile php...
user895378
@Ocramius Don't blame you -- I'm pretty adorable.
lol
ok, so this does it
user895378
@Ocramius Do you think it's worth adding that as an option? To have it collapse cookies onto a single line?
I'll extend the cookie extension and write some CrapSiteCookieSupportExtension
no, this is something broken about this particular web server IMO
the fact is that it sends 3 cookies
of which 2 are single-valued, and one contains 2 cookies
then artax replies (on subsequent requests, and CORRECTLY) with 4 cookies
the web server probably mis-interprets this (or does unsafe string comparison) and therefore doesn't validate my session
user895378
21:58
@Ocramius Well, regarding "extending" it ... the relevant functionality is private but for something like the cookie extension it may make more sense to make them protected. So if you want to change the relevant methods to protected so you can extend it and do a PR I don't mind.
@rdlowrey for now I'll put a fixed version lock and write a huge comment on the class I'm copy-pasting from the cookie extension
user895378
cool.
@rdlowrey how many connections can you handle with libevent? (and the connections are constantly pushing data…). With PHP I can handle ten thousands of connections simultaneously, but maximum 250 connections can stream data (per 50 milliseconds).
@rdlowrey if I find out what http server they use exactly, I'll let ya know :)
@rdlowrey I don't believe you that with libevent you can manage 10000 connections pushing data at the same moment.
user895378
22:02
@bwoebi au contraire :)
user895378
@bwoebi Scroll down to the 100k Requests -- 10,000 concurrent clients section on that gist.
user895378
I'll do one with 20,000 connections and poste.
@rdlowrey I just brought your server down with 700 connections…
or was it memory limit again?
user895378
@bwoebi I don't have any servers running.
user895378
22:05
And when I did it was always with a 128MB memory limit.
@rdlowrey 174.107.156.0 was up just 1 min ago
until I run my script?
user895378
lol, no servers running -- haven't been any running.
@ircmaxell very cool. we almost implemented something like that for phpBB once, to generate human-readable patch files.
@rdlowrey they had. bring it back…
22:07
@rdlowrey start your server, want to test…
user895378
@bwoebi I can start it for the first time, but if you're going to try to bring it down I'm going to turn on things like rate limiting and whatnot so it's a real world situation and you fail. Not to mention, you can't benchmark over the network to my garbage laptop that's running 500 processes and uses crap residential grade routers.
@rdlowrey and in fact, no redirects needed, all works smoothly, I am happy, customer is happy, I get paid, you get a new lib user
:D
@rdlowrey I don't send a lot of data, just a lot of connections with a bit data each
user895378
@bwoebi I know -- give me a second and I'll start up a server that you can hammer.
user895378
@Ocramius cool, glad it worked out for you.
22:12
/me is writing shitload of tests for this thing now
Read through that reddit on php... interesting stuff.
I would favor cleaning up the global namespace and fixing the parameter order for consistency, as well as fixing function naming convention consistency. I'm lukewarm on a lot of the other ideas... I like PHP, though.
@Chris I'd make PHP faster. I've been reading up on JavaScript VM optimizations and PHP would benefit from them. I don't really have the technical expertise to do it, at least not yet.
user895378
@bwoebi Sorry it's taking me some time ... I've created a bug where some keep-alive connections are being closed when they shouldn't be. Working on it.
< is not liking regressions
I'd also like to investigate using LLVM bytecode instead of a custom PHP-one.
user895378
@bwoebi Aha! problem solved. Using -1 for "no limit" doesn't play nicely with boolean logic :)
user895378
@bwoebi Feel free to hammer 174.107.156.0
HAMMER TIME!
< hammering
user895378
1500 connections and counting ...
user895378
22:29
2000
first error at connection 1601
user895378
2500
already 10 timed out
user895378
3500
a lot time out
user895378
22:30
3725
user895378
Seems to be holding fairly steady there.
about 50% are timing out
user895378
Network latency. You can believe me or not but running ab with 20,000 clients on the same machine works just fine. You get a few failures but that's not surprising.
what is the correct syntax for pdo's last insert id? I have: $test = $stmt->lastInsertId(); but i get Call to undefined method PDOStatement::lastInsertId()
user895378
And besides, unlike a threaded version you could easily put an aerys instance on each cpu core and load balance to multiple processes.
22:32
You get the last id on the connection not the statement
@rdlowrey do you call 50% a few?
ok i understand :) works now
thanks
in JavaScript, 2 hours ago, by Danack
Is there some config needed to get NodeJS to accept requests from anything other than localhost? I have nodejs running on centos in vagrant VM, and it works from inside the VM, but not from the host. And the port is forwarded in the vagrant config.
80% are timing out
22:35
@bwoebi It's "by design" until it reaches 100% ;)
user895378
@bwoebi If it were perfect it would be released. It's not. Just keep making your threaded server and I'll happily do comparisons against whatever you write.
OMFG
DREAMWEAVER DOES WAT?!
0
Q: Need help improving my search code

user1319909I have a functional search page but it currently cannot return results where keywords are not in the same order as the search terms, or separated by other words. For exmaple, if I search for "fried tomato" but the db field contains "fried green tomato" it won't return any results. From research...

what's the CPU of your server?
user895378
12% ...
only :o
22:39
@PeeHaa Holy crap. Kill it with a fire!
user895378
I do need to make some design changes though. Currently the activity of the already connected clients gets in the way of accepting new clients.
Committed without a comment. YOU CAN'T STOP ME
(working alone is teh awesome)
@rdlowrey but why are so many connections timing out?
user895378
@bwoebi What's the actual error message you're getting on the sockets?
@rdlowrey Warning: fsockopen(): unable to connect to 174.107.156.0:80 (Operation timed out) in /private/var/root/pth/hm.php on line 15
22:41
@Chris NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
user895378
What's the timeout setting?
@rdlowrey 3 seconds
174.107.156.0 <- you sure the 0 is right?
@Devon yes, it is
user895378
22:42
Yes.
user895378
@bwoebi I still think that there's some weird router or ISP thing happening that stops letting your connections through.
user895378
I'm betting that if other people pull up 174.107.156.0 in their browser right now it'll show up immediately.
Yes, you're right. I usually don't see hosts on .0
4700 connections now?
user895378
@bwoebi yep, go to a free proxy server and dump in that IP address .. works fine.
user895378
22:44
@bwoebi I'm showing 4195
@rdlowrey I'll bet you'd be right
user895378
1 min ago, by rdlowrey
@bwoebi I still think that there's some weird router or ISP thing happening that stops letting your connections through.
@rdlowrey It's what lsof +p 50873 | wc -l returns to me…
@rdlowrey I see "Hello, World."
user895378
Yeah -- same. No problems.
22:46
@rdlowrey don't know…
user895378
cpu usage is only 10-13%
@rdlowrey am getting more and more Notice: fwrite(): send of 94 bytes failed with errno=32 Broken pipe in /private/var/root/pth/hm.php on line 27
@rdlowrey I'm generally getting in this lan ±80% connection timed out's, not only your server. Must be the isp
user895378
I really think since I have the "residential" service tier from my ISP they have things in place that prevent crazy socket access. Might be different if I had a "business" account.
(my ping to google.com is horrible now :-))
user895378
22:49
lol
user895378
Anyway, I'm out for dinner. @bwoebi I will look at your db files after that :)
@bwoebi I've definitely seen those before.
22 packets transmitted, 17 packets received, 22.7% packet loss
round-trip min/avg/max/stddev = 22.394/122.558/851.056/188.094 ms
sounds good, no?
22:54
how can i include non-greedy filters on preg_match results?
@igorw quick question: is it really necessary to import single constants? there should be an use constants /from/namespace/ which imports all the constants from there... If we begin to import single constants we will end up having a list of 30 use constant and use function at the top of the file…
~I committed my revision into a branch, I don't care! I love it! I don't care, I love it!~
@bwoebi I really wish there were a good way to do that. but that breaks autoloading and/or consistency between use const and use function.
I want the symbols to be resolvable at compile time, so they can be autoloaded. I don't see a way around enumerating the functions/constants.
that said, a nicer syntax for enumerating them would be nice. something like from foo use function bar, baz, qux;
and if you do come up with a way to do this that plays nicely with autoloading, let me know.
@igorw Is it not good enough to alias use \very\long\namespace\from\some\library\constants\collection as lib; and use in code lib\constant?
@igorw autoloading at compile-time?! or what?
and what when no autoloader is yet registered?
@bwoebi Same thing that happens when you try to instantiate a class with no autoloader registered?
23:07
@cspray classes aren't instantiated at compile time?
@bwoebi resolving at compile-time, so that the global fallback can be avoided and function autoloading can become a reality.
autoloading obviously happens at runtime, as late as possible.
@igorw I don't know if this would work this way because there might be some dynamic function inclusion at runtime what you cannot determine at compile time yet?
like some eval("function $func () { ... }"); very bad practice, but must be considered.
@bwoebi again, resolving happens at compile-time, autoloading happens at runtime.
oh, you mean you want to resolve the use function…
that's precisely what a use statement is for. resolving [class] names.
23:16
yes, okay… confused something…
resolving is not directly related to autoloading at all. one happens at compile time, the other at runtime.
the reason function autoloading is not possible right now is because there is a fallback to global functions if the local one does not exist. which means unqualified function names potentially need to be looked up in more than one namespace. which kills performance.
use function makes those names qualified, which in turn means that it might be possible to autoload functions, since the global fallback can be ignored in those cases.
@igorw okay
but if you have any good ideas to make that shit less verbose, I'd love to hear them.
I'd like use function namespace => funcA, funcB, ...
or just use namespace => funcA, funcB, constA, constB, ...;
separating const and func just makes no sense
because if you use a same identifier for a const as for a func you are making something very, very wrong
Hey guys, im looking for a php dev to work with I have a dev working with me (I am all frontend) on a new and exciting website. If you are interested give me a shout. (This is a legit btw)
23:30
and at runtime you see if it was intended as func or as const (dependent on the opcode)
@bwoebi same could be said about using the same for a class and a function
agreed
I kind of do like the shorter syntax you proposed.
but it's also more implicit, and probably harder to get past internals. :-/
what do you prefer: mixing class, const and func or not?
what do you mean by "mixing"?
23:35
use namespace => funcA, classA, funcB, constA, classB, constB, ...;
instead of use function namespace => funcA, funcB, ...; use const namespace => constA, constB, ...;
@bwoebi not possible as per wiki.php.net/rfc/…
@igorw then all the const, func and classes of name /ns/uniformName are translated to the identifier in the as.
namespace foo {
    function bar() {}
    class bar {}
}

namespace {
    use \foo => bar;
    bar(); // calls \foo\bar()
    new bar(); // instantiates \foo\bar
}
@bwoebi read the FAQ entry again...
it's a BC break
unless you only make it work with the new import syntax
@igorw that was my intention
ah, that would probably be quite confusing then.
23:42
so that one can choose between verbose and implicit method
like we can with array() and []
making new syntax work differently than old syntax of the same feature is asking for trouble imo.
it's not really differently, it just concerns the edge cases
use \ns => name; should be exactly the same as use \ns\name; use function \ns\name; use const \ns\name;
there's no big difference: new syntax is just an alias for the three explicit calls
nite!
@rdlowrey where are you located? You deserve beer :D
@Ocramius he's located at his table eating his dinner.

« first day (1012 days earlier)      last day (4162 days later) »