« first day (2020 days earlier)      last day (2944 days later) » 

1:01 PM
You'd have to ask johannes, but in general setting socket flags like that is trivial with stream contexts so I see no reason for it not to work (as long as the target platform supports it)
However, there may be a workaround, one sec
 
why can I never get in irc when I actually need too ... it will idle for months, and then when I really need to talk to someone, it's gone ...
 
Yeh, ext/sockets can set that flag (read: defines a constant for it, it can set any flag by number), and I don't see any problems it would cause with the stream sockets wrapper, so if you can get access to the raw stream resource you can use php.net/manual/en/function.socket-import-stream.php and php.net/manual/en/function.socket-set-option.php to set it
 
suddenly efnet doesn't exist, because I need it ...
yeah I saw that sockets has it, but it's ifdef'd ... I'm not sure why it's ifdef'd, but I guess if I do same, it's okay right ?
TIL
Nagle's algorithm is a means of improving the efficiency of TCP/IP networks by reducing the number of packets that need to be sent over the network. It was defined by John Nagle while working for Ford Aerospace and Communications Corporation. Nagle's document, Congestion Control in IP/TCP Internetworks (RFC 896) describes what he called the "small packet problem", where an application repeatedly emits data in small chunks, frequently only 1 byte in size. Since TCP packets have a 40 byte header (20 bytes for TCP, 20 bytes for IPv4), this results in a 41 byte packet for 1 byte of useful information...
 
@JoeWatkins I guess some platforms don't support/define it (probably Win)
Winsock API is "berkley sockets compatible except we couldn't really be bothered"
 
I hate those guys ...
 
1:09 PM
@PeeHaa I am don't understanding. Halp?
 
streams are messy
 
@JoeWatkins this is an understatement and a half
 
it's really all over the place
usually we keep mess in one folder ...
I know why that patch wasn't merged
 
legacy + laziness I think
 
it leaks implementation details
 
1:16 PM
All the f*() functions were adapted at the end of PHP4 and crowbarred in the new streams framework, but the a lot of the public API code was left in situ in what is now (but was not orignally) the wrong place
That set a bad precedent and now it's just chaos
(is my interpretation of the history)
 
@DaveRandom ?
 
Warning: socket_import_stream(): unable to obtain socket family [9]: Bad file descriptor in /usr/src/php-src/st.php on line 6
wut ?
 
Anonymous
eh
 
I have installed CentOS release 6.4 (Final) in server.

I had installed SOAP library successfully but could't enable it on server.

I had done following steps on server.

Run this command in root folder

find -name soap.so
it will return following

./usr/lib64/php/modules/soap
so i set this line extension='./usr/lib64/php/modules/soap.so' in /etc/php.ini file and restart httpd services in cent os 6. but still it couldn't enable soap service i checked in php_info(), any idea?
 
@JoeWatkins You are, I presume, certain that you gave it the right stream resource?
 
Anonymous
1:22 PM
Anyone use Google's PHP API Client library? I'm fairly certain their documentation is out of date.. And it's confusing the shit out of me
 
yeah, flag must be wrong I think :s
 
@PeeHaa The generator async stuff is melting my head. Am I right in thinking that in order to put yield from ...->request($url); in one of the parsing functions I would need to make the whole call stack into generators?
 
Correct
 
@PeeHaa then can I make things into "fake" generators with yield null; or something? (for dynamic calls where some targets need to be gens and some don't)
 
AFAIK just yield; also works
 
1:24 PM
That's pretty horrid and I will avoid probably, but just exploring options
 
brb going to try to get food in the madness that is called kingsday
Only 10 edits needed fo dat
 
also the patch is wrong ...
@Maulikpatel don't send random invites to randomers randomly ...
 
@JoeWatkins randomers ^^
 
@JoeWatkins actually, it looks like the patch doesn't do anything useful; also lxr.php.net/xref/PHP_MASTER/main/streams/xp_socket.c#901 :L
 
@JoeWatkins Also I don't know nothing about about streams or sockets
 
1:28 PM
@m6w6 yeah I'm just realizing this, the flag isn't set :)
@NikiC k cool ... me neither ... :D
 
@m6w6 classic
 
@NikiC As it turns out I actually have a page open that I've been meaning to try out. It's really old, but I want to give it a go. devzone.zend.com/209/writing-socket-servers-in-php/…
 
omg, it's such a mess
 
@NikiC That is concerning stream and sockets. Sorry.
 
I just want to set a single option on a socket, why is that difficult ...
 
1:32 PM
@JoeWatkins Because streams.
 
@m6w6 do you know how any of this is supposed to work ?
 
Does that answer your question?
 
@JoeWatkins any of what?
 
@JoeWatkins PHP sockets are a mess. Functionality really should be in a single extension (not sockets and streams)
 
@NikiC it does ... sadly ...
@m6w6 streams
 
1:33 PM
!!meme one does not simply set a single option on a socket
 
it really looks like it wants me to create a function like php_tcp_sockop_connect to set a socket option, tell me it isn't so ?
 
@JoeWatkins maybe anatol knows something about this...
 
I'd be happy if functionality from ext/sockets could be merged into streams
Streams is a bit half-baked and things patched upon the rest
 
@JoeWatkins IIRC streams export some set_option callback
 
yeah
static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
	php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
	php_stream_xport_param *xparam;

	switch(option) {
		case PHP_STREAM_OPTION_XPORT_API:
			xparam = (php_stream_xport_param *)ptrparam;

			switch(xparam->op) {
				case STREAM_XPORT_OP_CONNECT:
				case STREAM_XPORT_OP_CONNECT_ASYNC:
					xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam);
					return PHP_STREAM_OPTION_RETURN_OK;
that's it ...
so it wants me to create a whole function and a bunch of boilerplate I think ...
oh no the fallthrough
 
This function is available through the stream_ops, isn't it?
 
O/
 
I'm ... not sure ...
 
@DaveRandom That's an issue with not having it in core, yes.
 
1:39 PM
oh yeah, same function
I'm so confused
oh no I get it ...
 
Hi Guys, In Json response i am getting extra white spaces with this error
"non space white characters found without seeing a doctype first"
 
You can use something like the following ...
 
i tried ob_flush(); and ob_clean();
 
@DaveRandom that's TBH the thing which is annoying me most about it; but we'd have the same issue with async/ await
 
still i am getting white spaces
 
1:41 PM
!!google "non space white characters found without seeing a doctype first"
 
$result = $obj->method();
$promise = $result instanceof \Generator ? resolve($result) : $result;
 
yes i did, but unable to find exact answer
 
So.. add some PHP_STREAM_OPTION_SOCKET_API to lxr.php.net/xref/PHP_MASTER/main/php_streams.h#418 and implement support for all the funny things in a rage ;-)
 
@Jeeves do the google goddammit
 
http://stackoverflow.com/questions/36888422/how-to-learn-online-user‌​-number-in-php
 
1:42 PM
tried with this ob_blush(); and ob_clean();
 
@kelunik But you still have to pass Promises all the way down.
 
@bwoebi No, we don't. Not if you can await a normal function / any value.
 
@kelunik Amp could allow yielding of any value...
 
@bwoebi Yes indeed it does have this issue, but I just find it so much easier to reason about (probably simply because it reads more explicitly)
 
streams don't seem to want to support any socket options ...
they don't set any
 
1:43 PM
Right
 
what they call options are php stream options ...
 
@user3454479 what does the response say? what is the content of the response?
 
http://stackoverflow.com/questions/36882393/any-library-codeigniter-‌​for-seo-or-meta-tag
 
@JoeWatkins there are a few, I'll find it
 
@m6w6 yeah basically this ...
 
1:44 PM
!!google non space white characters found without seeing a doctype first
 
HTML validation error: Non-space characters found before DOCTYPE The first error is: Line 1, Column 1: Non-space charact… | php - Non-space characters found without seeing a doctype first ... Your pages literally contain the string Cannot detect l… | HTML-Validation: How to remove an inexisted whitespace ... - Doctype as well as: Line 1, Column 3: XML Parsing Error: Start … |
 
@bwoebi Yielding just turns the next function into a generator and we have the same issue with recursive generators again, which we explicitly removed.
 
@Gordon the response will be like this
 
@DaveRandom no calls to setsockopt in streams at all
 
before that response i am getting extra space
 {"response":"200","result":1,"countries":[{"countryname":"Austria","countryid":"122","countrycode":"43"}]}
 
1:46 PM
@user3454479 how do you create the response?
 
@bwoebi That's the great thing in Tcl, you can just add a yield anywhere, in any subroutine.
 
Directly echo json_encode($result);
 
@JoeWatkins you've got to look at main/network.c, too
 
I saw them in there, but that's not streams related is it ?
 
@user3454479 then you output the space somewhere else. Make sure all of your php scripts do not contain any closing ?> as that is a common source for extra whitespace.
 
@Saitama yes, seen it. apparently Jeeves doesnt like quotes around the query
 
OK. will check it
 
thanks for all the help peepz :)
 
Anonymous
@Oldskool You ever used Google API client-library in Cake?
 
afk ~hour, school run ...
 
1:49 PM
@Gordon :D
 
@JoeWatkins there are but it's a huge pita to follow the bajillion mile long call stack and they're in a weird place
 
@JoeWatkins There are quite a few calls into main/network.c from streams/xp_socket.c
 
Ciai
Hello
 
I guess it will take more than 10 minutes ...
will mass ping for review later when I have something ...
 
IIRC I dug through this shit once with a caterpillar to implement listen(3) backlog
 
1:51 PM
If I want view my ip with php what function Can I use
 
@JoeWatkins +1 :)
 
there's layers and layers of leaky abstractions to wade through
 
@MattewDeveloper define "my ip". the ip on the machine running the php script?
 
I would know if there's a function like it
 
@m6w6 I did some looking into it when @rdlowrey was implementing the so_broadcast ctx option (which is supported by not documented) and it is one of those things that really needs a huge group effort to clean it up
 
1:54 PM
Like whatismyip
 
@MattewDeveloper There is unlikely to be a single answer to that question
 
@MattewDeveloper your question is unclear.
 
The more general question "what is my IP address" is (frustratingly) unclear in the context of IPv4
 
the IP of the machine is not necessarily the IP it will use to access the internet, so the answer is "no, there is not a built-in function to do that"
 
Good thing IPv6 is great and fixes all the thin... oh no wait, the other thing
 
1:57 PM
still doesn't guarantee a 1:1 mapping
 
if you are running a web SAPI, you can check $_SERVER['SERVER_ADDR'] to get the host's IP address and $_SERVER['REMOTE_ADDR'] to get the requesting client's IP address.
 
@Leigh ...and the IP it uses to access one internet peer is not necessarily the same as another peer, and there's no guarantee that a breakout IP is not shared, and... <more broken things here>
 
@Gordon not reliable at all
 
Thanks @Gordon
 
@MattewDeveloper TL;DR the best solution is to configure the IP address in your application on a per-machine basis with a value that makes sense for whatever you are using it for
 
2:00 PM
shh don't let Dan hear you..
 
@DaveRandom fwiw, I am not even sure that's what he's asking /cc @Leigh
 
We are moving to a new architecture at my new job with complete separation of presentation layer, use cases, business logic and persistence which will run on php 7. is this real life or just a fantasy?
 
@Patrick welcome to n-tier, I wish I was there
 
@Patrick Caught in a landslide, No escape from reality
 
@Gordon, i have checked php start and end tags. In Some pages ob_start() is there.
 
2:06 PM
@kelunik @bwoebi please can you sanity check the highlighted code in terms of the yield/return logic for the call on L59?
 
Is that problem with ob_start();
 
@user3454479 did you remove all the closing ?> at the end of scripts? your scripts should not end in ?>
 
Also check for byte-order markers
especially if you are using notepad++, it loves those BOMs
 
@Gordon No, i didn't remove it
i need to remove?
 
@user3454479 yes, remove them. they are unneeded. and if there is whitespace after them, it will get send to the client
 
2:09 PM
ok
 
@DaveRandom LGTM
 
winner, ty
 
@Gordon, Still getting same. I uploaded screenshot. Could you please check
 
2:18 PM
@JayIsTooCommon I built an app with Cake once that made extensive use the AdWords and Analytics API's, so yeah I think that's the same one.
 
@user3454479 Remove the BOM
 
@user3454479 what @PeeHaa says
 
i am not using any BOM
byte order mark @Gordon
 
Dump the exact response in here hexdump.pieterhordijk.com
 
In few pages i am included ob_start(); because of headers
 
2:25 PM
That's no bom. What content type are you sending?
 
header('Content-type: application/json'); and header('HTTP/1.1 298 own status code', true,298);
 
eeew own status codes
 
Anonymous
@Oldskool I think I'm being a complete noob but i'm stuck. So i've downloaded the API library via composer, it's in vendor dir. Now apparently I need to create a plugin in order to use that library, is that right?
 
i mean i am sending other than standard status code and its description
 
Well no idea what your issue is. It's either an actual space character in one of your files or a BOM
 
2:29 PM
Ok. Thanks
 
@user3454479 Yeah sorry about not being more useful. But I'm almost sure it's one of those. Or your browser is lying
 
I have installed CentOS release 6.4 (Final) in server.

I had installed SOAP library successfully but could't enable it on server.

I had done following steps on server.

Run this command in root folder

find -name soap.so
it will return following

./usr/lib64/php/modules/soap
so i set this line extension='./usr/lib64/php/modules/soap.so' in /etc/php.ini file and restart httpd services in cent os 6. but still it couldn't enable soap service i checked in php_info(), any idea?
 
2:46 PM
@Maulikpatel I thought find needed the path in which to actually search. find / -name soap.so
 
!!docs session
 
[ Session Handling ] Session Handling book
 
oh, actually the sensible page, did the pointless page get removed?
 
3:10 PM
@PeeHaa No Problem.
 
We don't really have good precedents for handling simultaneous competing RFCs.
Any suggestions what to do about the 3 or 4 nullable types propositions?
 
@LeviMorrison scalar types last year
but this is much more extreme ^^
 
@bwoebi Disqualified; I said good precedents
 
@bwoebi Is it? This feels very tame compared to scalar types...
 
@NikiC I think he means because there are 4 RFCs and not 2...
 
3:13 PM
@NikiC It's more extreme because more RFCs, not more heated
 
Oh, there's 4 rfcs?
 
yea
 
@bwoebi Vote on Levi's nullable RFC -- AS IS. In the union types RFC include an option to, if the RFC passes, allow only the |null syntax
Ask back with Dmitry beforehand -- those two RFCs are practically the same, we should vote only on one
And the one by the Tom or Tim or whatevs is just stupid, ignore it.
 
@NikiC That's not an option for the people who prefer no nullables to ?Foo nullables
 
@bwoebi they can vote no on it and vote on union types instead
Also, you do not need to cover all nuances of opinion
 
3:16 PM
@NikiC Can I quote you on that when I get confronted about ignoring it?
 
@LeviMorrison Yes
Well I didn't read it, but I assume it is :D
 
Alright, I'll talk with Dmitry to make sure he feels like it is fair what I'm doing.
 
@PeeHaa can you pull Jeeves from master again?
 
Moment
!!version
 
3:21 PM
!!docs pdo
 
[ PDO ] Represents a connection between PHP and a database server.
 
OK awesome
 
\o/
 
!!docs const
 
const can be used to define constants and class constants
 
3:21 PM
sexy
 
Holy sexyness
 
!!docs javascript
 
I think you're in the wrong room.
 
Ha.
 
:-P
 
3:22 PM
:P
 
is jeeves a bot?
 
Yup.
 
seriously though, I added a crapload of special cases
etc
 
Nice
I lick it
 
4 messages moved to bin
 
3:23 PM
how to interact with it?
 
!!command arg1 arg..n
 
I think you can do basically any keyword and it will give you a sane response
 
@DaveRandom Famous last words...
 
!!docs $_GET
 
3:24 PM
holy moly that is cool
 
!!docs constructor
 
[ constant() ] Returns the value of a constant
 
!!docs ::
 
:: is the scope resolution operator
 
Hot damn.
 
!!docs ternary
 
Aw.
 
!!docs <=>
 
[ yaml_emit() ] Returns the YAML representation of a value
 
3:24 PM
mmm was actually looking for class constructor
 
!!docs yeild
 
well done @Jeeves
 
I like how you added a special case for that typo :D
 
/me pats @Jeeves on his back
 
3:25 PM
!!docs spaceship
 
[ acosh() ] Inverse hyperbolic cosine
 
@PaulCrovella Yeh I didn't do the operators, could easily add them though
 
now for the true test
@Jeeves tell me a joke
 
Still, really nifty! Nice work
 
....
shittyrobot
 
!!docs fatal error
 
[ trader_rocr() ] Rate of change ratio: (price/prevPrice)
 
@PeeHaa Adding new ones is this simple, and it does a best guess (so if you add "constructors" then "constructor" will match it)
Although that does mean that there are weird possibilites like:
 
!!docs clas
 
3:29 PM
All those special cases fit right in with the language :)
 
lol message limit probably
 
I am currently learning webdesign
trying to do that by designing a hotel/room booking website
i need some help with email verification before booking the room
 
@grasshopper I'm still looking for a decent "AI" backend which isn't a pain to set up
 
!!docs magic
 
PHP was designed by wizards and so uses magic extensively. Magic constants and magic methods are both available.
 
3:31 PM
haha jeeve ^_^
 
i want the users mail to be verified before the reservation is saved in the database
how can i do tht
 
create a verification link, randomize it insert into db, send with email, check if matches on lookup
 
@Zombievirus Generate a token using random_bytes and mail it as an url with the token. On click of url verify using hash_equals
 
the problem is in every case i lose the $_POST data
 
3:34 PM
Use get or make it part of the url path
 
@JayIsTooCommon You don't necessarily need a plugin. If you just need it for one controller or something, you can easily use it there.
 
Anonymous
@Oldskool Well, if you've got any time, would really appreciate your help stackoverflow.com/questions/36894344/…
 
Anonymous
@DaveRandom github.com/Room-11/Jeeves/commit/… I used to do this all the time but my senior told me to stop as it was bad practice.. Is it?
 
@JayIsTooCommon Aligning properties?
 
3:48 PM
(that's not my commit, btw)
 
Anonymous
@PeeHaa Yeah, my senior said the indention should always be 4 spaces and that's it, there was no need for properties to align?
 
But I don't think it's good or bad practice, it's just a stylistic preference
whatever you find more readable
 
Anonymous
I definitely prefer them aligned
 
@JayIsTooCommon I get annoyed when they are not aligned
 
4 hours ago, by Saitama
can we add a duck duck go thing too?
 
3:50 PM
I have issues like that
@Saitama And do what?
 
Search... Search things with duck duck go?
 
Why do we need two search engines?
 
Try telling that to Yahoo, or Microsoft..
 
^that. Everybody has been doing that for ages :)
 
3:59 PM
@JayIsTooCommon Since you're in a namespaced controller, it will start looking for classes in that same namespace unless you go back to the root with a \ prefix.
So $client = new \Google_Client();.
Since the API doesn't seem to use any namespacing whatsoever.
 
Then your use becomes useless.
Hey Ronni o/
 
\o
atleast the use ceclares dependencies
in the top of the doc
=)
 
Anonymous
@Oldskool How embarrassing... I have literally spent hours trying to sort this, tearing my hair out. Thanks man
 
@Levi If I got that right, we shall now vote on nullable_types RFC first and then union types, which will include an option to disallow "?" nullables in favor of |null with 50%+1 vote, if the former passes, else it will be accompanied by a 2/3 majority vote on |null.
 
4:10 PM
Hello, i want your opinions about this ==> I need to import 6 csv files that contains information about my employees, but every csv file has different columns arrangement, for example:
fname, lname, phone, address, zipcode
phone, address, zipcode, fname, lname
lname, fname, address, zipcode, phone
The problem is that csv files don't have header, So any suggestion please?
 
@Devilion Uhm, yeah that's a problem. Since CSV files only have 1 header row, the colum arrangement has to be static.
 
@Oldskool that's means i need to define for every file a specefic form?
 
@Devilion If they don't follow the same order, then yes.
 
@Devilion if its only 6 you could just edit the dang csv files
make a order
rearrange the columns to it in each file and add a header to each
then you have 6 files in the same format with identical headers
 
@Oldskool can you show me an example please?
@RonniSkansing in the future will be between 15 and 30
 
4:17 PM
@Devilion then write a generic function to take a csv files and rearrange it to the format you like
so instead of supporting a billion different imports, you have a single import format.
 
@RonniSkansing yes but how i could know the place of fname and lname?
 
you would have to tell it that, its the mapping
 
i can locate phone and email and zip code but fname and lname?
 
and you didnt have headers?
 
yes i don't have header
 
4:21 PM
so you dont know what is their firstname and which is the last?
 
yes in every csv file, the fname and lname could be in row[0] - [6]
 
lol.. I misunderstood the problem
 
hhh lol
 
well unless you have a list of their names it would be a educated guess at most
is it the same names in each report?
 
am taking email by searching '@' and phone by searching '+' buy fname and lname making a problem to me
no different
 
4:24 PM
Yea how would you know a Joe John from a John Joe?
 
hhhhhhhhh only the god know
 
but you could def do some educated guesses.. but I do not think its a viable solution
wait what kind of data is handled like this?
 
it's a job request data
 
you need headers or etc to identify some names fnames and lnames
sometimes
and you need to look into column remapping
OR
get whoever sends this to fix the headers
 
Some people here which have already use the wordpress API ?
 
4:38 PM
"wordpress"
 
"api"
"people"
 
hey i have a object
$mcqpaper

and when i print vardump it prints

object(mcqst)[5]
private 'mcqlist' =>
array (size=2)
0 =>
object(mcq)[7]
private 'id' => string '0' (length=1)
private 'question' => string 'Complete the series:
B, C, D, Y, X, W, F, G, H, U, T, S,.......? ' (length=65)
private 'answer' =>
array (size=4)
...
1 =>
object(mcq)[13]
private 'id' => string '1' (length=1)
but when i use jsonencode it returns {}
 
I don't realy understand ?
 
@Saitama @KevinMGranger
 
4:41 PM
People here criticize wordpress a lot, so many joke about it. Pay us no attention :P
 
once the bounty's over I may even tell him it's not completely comprehensive :p
 
Owh ok ^^
 
err.... sorry, just checking the message was short enough :-P
 
cough, cough
 
@bwoebi I dunno... seems weird.
 
4:46 PM
@LeviMorrison What would you then do?
At least regarding the fact that Dmitry wants to vote now on nullability
 
He's not been in IRC today either.
 
@Levi another thing you could please do: update the union types RFC
 
enin
 
nin'
 
Lets's abbreviate it even more:
'
 
4:52 PM
.
 
ok i simplified ,json_encode() returns {} .why empty

class answer {

private $id;
private $answer;

public function __construct($id, $answer) {
$this->id = $id;
$this->answer = $answer;
}

}

$answer1 = new answer(1, "this is a answer");
echo json_encode($answer1);
 
'
 
.
 
4:53 PM
There's been no actual feedback on the patch with regards to weak types.
 
@RonniSkansing a friend tell me to create a DB and save on it every file format so i will compare all my files with the forms in DB
 
@LeviMorrison yeah, text form in the RFC and having it on 3v4l would help
 
yeah there hasn't, even though the patch is/will be testable on 3v4l, you should assume that nobody will run or read it ... you should explain all the stuff that is in comments in the RFC, I think ..
 
yeah, fewest people look at the actual code (sadly)
most of these are in this room… and Dmitry.
 
@FastSnail no public properties
 
4:56 PM
yeah, and dmitry doesn't always read straight away ... he'll browse it a few times, and sometimes comment, before he gets chance to read properly because busy ...
 
I don't expect them to read it - I want them to build it and play with it...
 
yeah ... they won't ...
 
ohh @PaulCrovella i see ..
 
@LeviMorrison I rarely play with patches… I typically read them, look at examples and RFC
and most don't read the patches either.
 
I play with all the type system patches.
 

« first day (2020 days earlier)      last day (2944 days later) »