« first day (2582 days earlier)      last day (2371 days later) » 

Wes
12:00 AM
you can get the property from world if it's public get
you can get the property from within the class hierarchy if it's protected get
you can get the property from within the class only itself if it's private get
 
Okay - so isn't that the same as the typed property RFC? Just with different syntax and inheritance rules thrown in?
 
Wes
how is type related to visibility?
that's another rfc and unrelated. although having them both makes everything much nicer
github.com/Netmosfera/prop-op-visibility-modifiers/blob/master/… @LeviMorrison have a read too. sorry for the engrish
 
@Wes I thought a lot of the benefit of your RFC was locking down the type of the property?
 
Wes
sorry @Danack i am sure the intro is very confusing. no that's the other rfc i was referring to
public get private set $foo; // can assign anything
but if we had the other rfc as well, we could enforce a specific type alongside custom visibility for each of get/set
i should probably remove the references to the other rfc entirely
this is not related to types at all
a property can have two visibilities assigned, one used when the property is read, the other when the property is set. you can have for example a property that is publicly readable, but only privately settable
types don't have a role in all this
 
12:17 AM
Then I don't get what new capabilties the RFC is proposing, particular when it says 'they have way less overhead than function based "property accessors" or methods that wrap for the sole purpose of changing a field's visibility.'
When I thought the RFC was just about making defining getters and setters easier, I wrote this btw: gist.github.com/Danack/d7ba034702bbeb51d6d82d14bdfe8a54
 
Wes
@Danack because again it's not function based, there is no call stack, there is no scope, no refcounting (i suppose)
private Title $title public get protected set  is function based
and also confusing... is get of $title private or public?
what you wrote is this:

private Title $_title;
public get $title{ return $this->_title; };
protected set $title($v){ $this->_title = $v; };
it's basically two entities involved, the field and the property
instead with what i'm proposing you only have $title that when accessed (access == union(set, get)) must pass one of two different visibility checks rather than just one
i am not sure why exactly i am not being clear :B or id try to explain better
 
@LeviMorrison I had written that patch long ago, but didn't feel motivated to move forward with it…
Also: I always have this chat open, no matter how much or little I'm writing in here.
 
12:35 AM
@bwoebi You seem to have disconnected from the Amp IRC chat.
 
@Wes If you're going to work on it, maybe try writing all of the details of the RFC as single sentence bullet points, so that each of the parts are separate and clear.
 
user895378
<--- officially unemployed
 
user895378
\o/
 
\o/
@rdlowrey More time to work on Amp! :-D
 
user895378
more any
 
user895378
12:38 AM
I'm afraid I've forgotten how to code. It's been more than a year since I've really written any
 
@rdlowrey wow, did you only do management?
 
Wes
at this point i'm asking @bwoebi too what he thinks about it github.com/Netmosfera/prop-op-visibility-modifiers/blob/master/… :B (i am a bit scared about his opinion)
 
user895378
yeah, was running a team of 50 so there wasn't really any time or room for hands-on work
 
user895378
it was pretty miserable
 
@rdlowrey That seems to happen as you progress up the management totem pole. I have a friend that essentially took a demotion because he wanted to code again.
 
12:39 AM
@rdlowrey so, you're actually happy to get some break from that?
 
user895378
oh man, so happy
 
user895378
sooooooooooooooooooooooo happy
 
@rdlowrey hey dude, gratz on the unemployment.
 
Wes
lol
 
user895378
funemployment
 
12:40 AM
@Wes don't be scared, I'm not fundamentally opposed to this. There are some details, which need polishing, but overall it's good.
 
user895378
bachelor party is tomorrow night \o/
 
Wes
:O
 
@Wes ^ that's Wes' totally suprised face.
 
Wes
yes.
i didn't think almost at all about traits and pass by ref. i bet that's where the shit is
 
For example @Wes: settable should really imply gettable.
There's absolutely no reason why I shouldn't be able to get what I've set before.
 
user895378
12:43 AM
anyway, I hopefully will be around more than the not-around-at-all status I've maintained over the last 12 months or so
 
user895378
say hi and I'll endeavor to do the same
 
Wes
it's not necessarily stuff that you've set. you might want to deny to read something that someone else has set
 
user895378
ah, that felt good.
 
lol
 
12:44 AM
 
user895378
hehehe
 
I'm slightly amused that you've immediately come back here once you're unemployed again :-D
 
user895378
yeah, my chat participation is highly correlated to employment status
 
@Wes In that case it shouldn't be settable but more like a constructor argument.
 
Wes
class Foo{
    private get public set $bar;
    function __construct($bar){ $this->bar = $bar; }
}

$x = new Foo($superPrivateObject);
give_it_to_third_party($x);
 
12:46 AM
I've made another "not that useful" ext: github.com/pmmaga/php-array_map_kv :D
 
@Wes well, create a new object instead.
 
Wes
why? i totally agree with you it's strange, but i wouldn't enforce it. especially because enforcing it will make the syntax and logic more complicated with "set" affecting "get"
 
@Wes It doesn't make the syntax more complicated. It just adds a small compiler level constraint on it.
 
Wes
just leave it like that. if one wants to do strange things then it's their problem
@bwoebi no i mean for the user
inheritance, etc.
 
I won't make a big fuss about it, but it's my preference. If others do agree with me, then I'd like you to change it. I can accept it nonetheless.
@Wes inheritance is a mess in any case.
 
12:50 AM
@bwoebi When you have a minute could you take a look at github.com/amphp/mysql/pull/49 again? I have it working using ClientSocket, except one test hangs.
 
@Trowski give me a few min
 
Wes
ok i don't mind changing it. but in general i dislike arbitrary restrictions. if you can argue about whether it's ok or not, then there should be no assumption on what should be restricted. in this case i'd say there is a small possibility of use cases
after all in other languages you can have setters without getters
i for instance have builders that only have setters. and while i could have also the getters without no particular problem, with the setters only the class' purpose is much clearer
 
@Wes sure. But perhaps you might, as an user, inject the object to a third party which wants to read the currently set value.
 
Wes
in that case i'm doing that on purpose i am denying the third party to do that
if i want to allow that then i'd have public get visibility, explicitly
 
1:08 AM
Optional arguments presented as required in gmp_export and gmp_import – #75508
 
@Trowski the issue lies within closeSocket, which makes the read() succeed which causes these to call the ConnectionConfig->restore … which in turn creates a new mysql connection (thus the loop has open watchers then and doesn't halt).
 
@bwoebi Thought this check before calling goneAway() would prevent calling restore in the case where closeSocket() was called.
 
@Trowski so, exactly that, just that it wasn't marked closed yet when encountering that check.
 
Oh… /facepalm
@bwoebi Any objection to changing result sets to be instances of Iterator?
Amp\Iterator that is.
 
@Trowski As long as the code to use it doesn't get uglier, it's fine. (i.e. you don't typically want to iterate explicitly to get the first resultset, you only want to iterate if there is more than one resultset)
From a purist perspective, definitely, not so sure about user friendliness though.
 
1:23 AM
@bwoebi So you mean for single row results… generally those still have to be iterated over.
 
@Trowski wait
are you talking about resultsets or rows?
 
Iterating over rows.
 
for rows it's fine to use iterators
 
ResultSet would implement Iterator.
 
@Trowski yeah, that's fine.
not objecting
I thought you wanted to use Iterator for interating over the list of resultsets
 
1:25 AM
@bwoebi In postgres I limited the way results were returned to only associative arrays, think this is a problem?
That is, $result->getCurrent() returns an associative array only. No options for objects or vector arrays.
 
I'm not sure. For me personally assoc arrays are enough. I have seen numeric access in the wild, though I don't remember their legitimacy.
 
Which could be done with array_values($result->getCurrent()).
 
@Trowski uh, not if they map to the same fieldname.
e.g. if you SELECT table1.field, table2.field (both fields named the same)
 
Right, that's a good point, though usually one gets aliased then.
Now that I think about it, getCurrent() could have a parameter that defaults to associative.
That would require emitting both and then only returning the desired version.
 
@Trowski I'm not sure whether that's a valid assumption. Assume you're going to build a database explorer (like pma). Users will issue quick queries joining to tables and outputting all fields (*) .
@Trowski not sure what you mean with emitting both? Resultset will only emit when getCurrent() is called
(i.e. Resultset implements Iterator, there's no Emitter in between)
 
1:35 AM
@bwoebi No, a row would be immediately fetched, waiting to fetch the next row until that one is consumed.
 
@Trowski actually, you could have just getCurrent and set it to associative. And allow custom getRow() etc. functions which are just not part of the interface
@Trowski actually, we currently do not have backpressure there
 
@bwoebi Here's how tuple results are emitted in the postgres package: github.com/amphp/postgres/blob/master/lib/… A row is immediately emitted while the next row is being fetched.
@bwoebi Results are buffered from the server without waiting to be consumed?
 
currently yes.
 
Something we can add in time.
The iterator needs to know what type of data to emit when the object is created, not when getCurrent() is called.
 
@Trowski no it doesn't
it only does if you use a Producer in between
but not if we use our own logic there
 
1:42 AM
Hmm… yes, actually I think I see an even simpler way there.
There being in postgres. Looks like mysql will be very easy.
 
@Trowski if you add backpressure to resultsets, just make sure that they're properly destructed and won't actually remain the loop if left unconsumed, but will be quickly discarded without much processing then.
 
@bwoebi Yes, I had to do that in postgres.
 
I consider it a good thing if the APIs happen to be very similar in the end (without differences being subtle).
 
what does this mean in bash
read -a LOG <<< "$line
 
@bwoebi Same. The general usage will be similar.
 
1:49 AM
it is inside while loop
 
@Trowski nice :-) Bedtime for me. Have a nice night.
 
@bwoebi \o
 
2:09 AM
@rdlowrey Sounds miserable, that's for sure. Hope you are happier!
Looking for a new job or going to chill for a while?
 
user895378
@LeviMorrison I'm going to take a couple of months off and get married :)
12
 
o.O a couple of months off for getting married? Lucky you!
@rdlowrey Going to Mexico for honeymoon?
 
 
2 hours later…
4:19 AM
@NikiC In my free time lately I've been thinking about short closures, type inference, and generics.
If we think we will someday have generics then we probably ought to wait until they exist so we can make sure short closures work well with generic type inference.
$result = Collection::range(0,10)
  ->filter($x => $x % 2 === 0)
  ->map($x => $x * 2)
  ->reduce1(($x, $y) => $x * $y);
It would be a shame to have to put type declarations on those closures just to type-check.
/cc @bwoebi @wes
 
5:20 AM
Morning room
Happy friday all
Happy birthday @Leigh
 
@kelunik thanks for updates, apcu fixed
 
5:46 AM
@rdlowrey hi
 
6:01 AM
Morning Joe
 
6:20 AM
ey friday
 
@rtheunissen it looks like you didn't commit your changes to manual.xml.in, so the doc build is broken ... I'll fix it on the next commit ...
\o
 
6:41 AM
@Gordon oh a new single barrel, nice
o/
 
7:09 AM
-Good morning o/
 
7:23 AM
Good news everyone, I cleaned out my closet and found @JayIsTooCommon
Morning o/
omg @rdlowrey <3
It's as if my wish came true
MARRIED, Damn you Genie! I should be more careful next wish.
 
@Fabor how can this be like your wish came true when all of us wanted him to marry us?
but congrats @rdlowrey
 
Yeah, it was one of those evil cursed Genies that grants your wish but there's an evil twist.
I'm glad he's taking, and has been taking, a break. A lot less scary than the time he went skydiving.
 
7:53 AM
@rdlowrey Awesome. \o/
 
Anonymous
morhga
 
Anonymous
@Fabor <3
 
Call "new static()" on __destruct will say segmentation fault – #75509
 
8:09 AM
I am very new to multidimensional arrays and it bothering me out
i get this error trying to get my array in a variable
php array to string conversion
I can read english and know what it says but i dont know how to tackle this problem differently
 
you got $array = ["foo" => ["bar" => "baz"]]; and you are trying to do echo $array["foo"];
 
Anonymous
You're probably trying to echo an array. Google the error message and you'll see a lot of answers explaining. If not, gist.github.com - Share your code and the line number that's giving you the issue.
 
atm i am putting my codes in pastebin wait a sec
 
Anonymous
@Tomm Google first
 
pastebin is fine as well
 
8:11 AM
This is pretty nasty for me since it is all done with a loop and it confuses me
Jay i have been trying to resolve this problem since yesterday
 
Anonymous
Ok, that's fair :)
 
I am probably overlooking something
 
It's ironic how much help code ends up in the bin
@Tomm Most certainly, as a newbie every question you ask won't be unique.
 
I know @Fabor
I think i am well aware on that
But i think the problem with me and other newbies is the way of formatting/asking the question
 
I learned programming with a book. No chat-rooms or internet. I think that works better to force you to understand the problem
 
8:18 AM
More often than not it's not reading properly :P
 
now you're just skipping the learning part because we already know and fix your problems
 
that is not true sjon
yesterday @DaveRandom helped me. By giving me a already working code. And i asked him to explain the code and how it worked before even using it cause i would not have learned by just taking it
I agree alot of people just take code and leave
but id like to understand the code so i wont have to ask the code in the future
 
@Tomm I hope you succeed :)
 
Welp i do to
 
Anonymous
eh, I thought $code in exceptions sets the header too
 
8:21 AM
@Tomm What did you find when you googled the error?
 
Mostly codes that were saying i should take my array with 2 [] like this
$array = $_POST['data'][0][1] for example
but those were all according to premade arrays
and my array is a little different compared to those premade arrays nested in a variable
Also alot of answers are directly focussed to printing an array
Few minutes ago i also found this on so which seemed promising but it wasnt sadly
$qty = $_POST['qty'];

Your code would then be:

$qty = $_POST['qty'];

foreach($qty as $value) {

   $qtyOut = $value . "<br>";

}
 
@Tomm You can't echo an array. Example.
> php array to string conversion
 
That is nice to know and does help me with testing
since i got the error whilst i tried testing my $array = $_POST['data'] with echo $array;
 
It does help you because it is the exact problem you're having
21 mins ago, by Tomm
php array to string conversion
 
It solves my question
but it does not solve my problem
 
Anonymous
8:30 AM
O.o
 
Fix your own code
 
Are you looking at my pastebin
i am not echoing anything
 
Help in this room is finite. If you keep asking for it you will get it less and less because we are much more interested in people who want to help themselves.
 
Anonymous
yesterday, by JayIsTooCommon
@Tomm Please stop vamping. Google your issues, or go to the js room https://chat.stackoverflow.com/rooms/17/javascript
 
Anonymous
@Tomm I've said this before Tomm, do more research before asking
 
8:32 AM
Line 4 sure looks like an echo
 
Are you guys taking it at me?
that line also works fabor
if you read it
I even included an output
you guys asked me to put it in pastebin and i did
 
The output is the print from var_dump() not echo
 
And your answer surely was not related to what i asked in the pastebin ( after you guys telling me to put it in pastebin)
 
Remove line 4 and see if it still errors
 
for the 5th time that line does not give errors
it was what i said 2 mins ago
 
8:33 AM
PHP gives you a notice while it also outputs your HTML
 
Tomm
That is nice to know and does help me with testing
since i got the error whilst i tried testing my $array = $_POST['data'] with echo $array;
that is what i said like 3 mins ago
this line what you are refering to
//echo '<pre>'; var_dump($_POST); echo '</pre>';
 
Cool, you're on your own.
 
<pre> makes it so my array is nicely formatted
 
I gotta go look at this wall for a few hours.
 
when i read it
 
Anonymous
8:35 AM
If you want help, stop being rude. As you've already been asked, do some research yourself first. If still stuck, provide the problem line number.
 
My question is in the pastebin like you guys asked
line 117
And you guys are taking it at me for thinking i am retarted
//echo '<pre>'; var_dump($_POST); echo '</pre>'; this is not the error
 
Anonymous
> @DaveRandom gave me this yesterday -- (this requires data to be in a variable and I am not sure how to tackle this array since my way of asking data and saving this in a variable is not correct.
 
Anonymous
that's line 117.
 
this was the error
//echo $array;
and i admitted to it
 
Anonymous
so what's your problem?
 
8:36 AM
but i said this was not the problem since i was just trying to see if my variable was working
you guys said you cant echo a array
and i know that now i even thanked you guys
this line //echo '<pre>'; var_dump($_POST); echo '</pre>'; which fabor keeps mocking me about
is always noted //
since i only use this to read my array
So my problem is like asked on line 117 is
 
Anonymous
Oh get a grip. "Mocking". Go and do some research, learn how to word your question better and then come back. Also, use the return key less.
 
pretty sure he said Line 4, not 12.
 
!!urban mocking
 
[ Mocking ] To [Cuss] someone down or to take the piss out of somebody or demoralise them.
 
Fabor
Cool, you're on your own.
Fabor
I gotta go look at this wall for a few hours.
 
Anonymous
8:39 AM
You're on the internet. Stop being sensitive. Please stop spamming the room.
 
well, can we all calm down?
 
You are saying i cant say mocking but you want me to stop being sensitive
 
guys, this is so very pointless
 
I am just trying to defend my own respect here sorry
 
you should be trying to solve your problem at hand instead
 
8:43 AM
I am trying to
 
user image
7
Stand back everyone
 
I just do not know how to tackle a multidimensional array that is in a loop
 
Anonymous
that is beautiful.
 
Anonymous
I want one
 
Anonymous
I also want one of those hoodies
 
8:44 AM
there can't be two of us
 
the shirt looks great. the guy could be improved.
 
want me to photoshop it into distracted boyfriend instead?
 
and when I say me I mean @Wes
 
For keeping a bunch of rabbitmq consumers written in PHP up, and restarting when we intentionally kill one after a set period of time, the ops lead reckons a simple php script is a good idea. What advantage do we get from using something more complex and another layer like supervisord?
I mean he's right, a simple loop with some execs and & would work
 
8:48 AM
so what is it, like a bunch of workers? do you always want a set number of them running?
 
@Jimbo well - look at supervisord.org/configuration.html - determine if you need those features and consider you'd need to implement them in PHP yourself ?
 
@DaveRandom You just wake up in that photo? -_-
 
it's 8:49am...
I don't really wake up until 12 at least
 
@Sjon An obvious but good point
@DaveRandom Yep bunch of workers. Not always, we'll likely autoscale them
depending on the number of messages in some queues, for example
 
@Jimbo tbh detached exec() is unlikely to be a good solution anyway, because the children are detached so you can't know when they end without polling ps (or similar)
if you did decide to implement it yourself you should use a forking control process
which is already increasing the complexity
tl;dr this is one case where you probably shouldn't re-invent the wheel
 
8:52 AM
Process itself kicks off the next one?
before dying?
I didn't think about the polling, this is true
Surely supervisor polls under-the-hood
 
@Jimbo what if it fatals?
you need something that is not susceptible to your own programming errors
well, not necessarily need but there are advantages to using something that is maintained by a large group of people that is not you
 
Morning!
 
is there any one who can configure solr and PHP with hive database?
 
@Jimbo well it forks, so it uses wait/waitpid, which is left to the kernel's implementation
 
they can join here:
https://chat.stackoverflow.com/rooms/158669/hadoop-hive-and-solr
 
8:56 AM
@DaveRandom expecially people that are not him
 
@rdlowrey Two things - thanks for the warning :) and congratulations dude!!
 
fread not free unused buffer. – #75511
 
@DaveRandom I gotchu fam
 
@Jeeves wat
 
8:59 AM
@DaveRandom I say that he didn't.
 

« first day (2582 days earlier)      last day (2371 days later) »