« first day (2323 days earlier)      last day (2624 days later) » 

10:00 PM
@MadaraUchiha for the send()
 
PHP is synchronous, unless you're using a framework like AMP, in which case, it gives you the tools to "wait" (usually with the use of generators as coroutines)
@FélixGagnon-Grenier The yield statement will wait for your send().
 
output from 3v4l in my link suggests it doesn't?
 
@FélixGagnon-Grenier next() (which foreach calls) effectively does send(null)
 
Ah, I see what you mean
No, there's no way to force a value
Although you can always do something like
 
@PaulCrovella oh, right. makes sense
 
10:02 PM
while (true) {
  $value = yield;
  if (!$value) { yield "You suck."; }
}
// use $value here
 
... actually, no, but I guess it will
 
But that's generaly not what you want.
 
Normally, you wrap the generator in some sort of framework, which gets values out and sends values back in
For example, AMP will take something like this:
$value = yield someAsync(); // returns Promise instance
It will take the Promise someAsync() returned, wait for it, then send() the value back to the generator
So $value isn't the Promise, but the actual value that was gotten from the Promise.
 
10:06 PM
"normally" depends a lot on what you're doing, I use generators plenty without a framework (not doing async stuff)
 
@FélixGagnon-Grenier If you look at Amp's Coroutine class, you see how that magic works, particularly here: github.com/amphp/amp/blob/master/lib/Coroutine.php#L52-L58
 
oh thanks!
 
The closure defined there is provided as a callback to promises yielded from the generator. When the promise resolves, it calls that function, throwing or sending the value to the generator.
 
Playing with the same from @PaulCrovella I've got another question: why does my first value essentially get swallowed? 3v4l.org/QmtBU
 
Most of that class is code duplication for performance (as it's a very hot code path in Amp) and cleanup in case the generator has weird things with finally blocks.
@Dereleased To get the result of the first yield, you must use Generator::current().
 
Generator::send() on a fresh generator will execute to the first yield, then send the value as the result of the yield statement, then execute to the next yield statement.
What @PaulCrovella linked explains it nicely :-)
 
Weird, bugs.php.net is telling me my email address is invalid
 
Ah. So a send() without reading the first current() is probably not what I want?
 
@PaulCrovella @FélixGagnon-Grenier 3v4l.org/k91RV
 
Logging in before submitting sidesteps it. Anyone know who manages that?
 
10:15 PM
Here's a very naive implementation of this concept.
I'm not handling errors and I'm using a fake, synchronous implementation of Promise.
But the intent should be clear.
 
Yep, that's the basic concept.
 
@adsr When does it tell you that? nvm
 
@Dereleased 99% of the time, yes, you should call current() first.
 
@adsr If you're putting in the information from the developer tab you have to have an @php.net email, otherwise it doesn't accept it see: git.php.net/?p=web/bugs.git;a=blob;f=include/…
Default second argument for is_valid_emailis set to true there git.php.net/?p=web/bugs.git;a=blob;f=include/…
errr wait that's the opposite
 
@Trowski I'm relatively happy that I can implement a basic example of that in under 5 minutes.
It really means I understand it better than I thought I had.
 
10:21 PM
not exactly sure what it does yet, tbh
 
@FélixGagnon-Grenier It runs the generator
 
You need the password for when you're not logged in.
 
It stops at every yield, checks if it's a Promise, and calls getValue if it is, then sends the value back.
 
a kind of... loop, of promises?
 
@FélixGagnon-Grenier Yes
Exactly that.
 
10:22 PM
kewl
 
I run the generator in a loop while ($gen->valid()), get the current value, do whatever, then send.
Send resumes the generator until the next yield, throw or return.
Finally, gen->valid() returns false, which means that the generator was closed, then I just return the returnValue of the generator.
 
@MadaraUchiha You have the sending in a while loop, where that should be a callback function given to the promise.
 
(Again, this is without dealing with errors, and stuff)
 
My day today can be summed up in two commits
 
Anyone here used DynamoDB?
 
10:23 PM
 
@Trowski Yes, because I was lazy and my "promise" implementation is sync
So instead of a callback, I have a while loop with a sync getValue()
But the topic was about running a generator with support for sending values back
 
@adsr you can't submit from a php.net address unless you're logged in
 
@MadaraUchiha Ok, I figured you understood that, but wanted to be sure.
 
So that example is plenty to get it started :)
!!xkcd git commits
 
10:25 PM
@Sean ^
 
@NikiC Ah I see
 
So the first commit was referencing something I did the day prior before deploying, unchecked
 
@NikiC How does the elusive karma system work? :)
 
@adsr i.imgur.com/iZcUNxH.gif this is getting really annoying really fast.
 
10:26 PM
@adsr that's a bit vague
 
@Sean I sometimes type commands into SO chat.
Does that count?
 
Feb 21 at 14:30, by Félix Gagnon-Grenier
git status
 
i still think clear should work here
 
Hahah, that makes me feel better, yes
 
at least it wasn't a git push origin master -f
 
10:27 PM
rm -rf /*
 
Oops accidentally added --no-preserve-root
Silly me
 
@Sean I try to force myself to use git add -i and patch the commit, when it's manageable
there is a lot of stuff that I end up removing because it was a false lead or something
 
@FélixGagnon-Grenier What does -i do?
I know about -p
 
interactive switch
prompts a menu that let's you patch (amongst many other things) your commit
that is, chose, bit by bit, what gets staged
 
@Jeeves lies
 
10:30 PM
@tereško So you want a body.
 
on mondays, when I'm full of energy, I do that to have clean commits, of separate bits of changes
 
Sorry for vagueness. Just curious if karma is awarded or if you need to request it somewhere.
 
whynotboth.jpg?
 
@FélixGagnon-Grenier WHoa, that's nice
 
@FélixGagnon-Grenier How is it different from -p?
 
10:30 PM
Been looking for something like that
 
@MadaraUchiha dunno, I never tried -p
lemme see
 
@FélixGagnon-Grenier only shitty commit messages I have usually contain "file dump"
 
What's -p? Preview?
 
git commit -am "removing stuff"
 
-p lets you stage chunks of your diff
Very handy
 
10:32 PM
of, the -p is actually a shortcut to the -i patch menu choice
git add -i, then option 5, is the equivalent of -p. thanks for that
 
Huh
I'll have a look at -i next time I commit sometihng.
 
so that sha-1 collision apparently breaks svn arstechnica.com/security/2017/02/…
 
Great, now all we have to do is break git. What does that use sha-256 or something?
 
sha-1
 
Oh great, so git is broken?
 
10:38 PM
not like svn is, afaik
 
/me throws all version control out the window
@PaulCrovella If they both rely on sha-1, why is one necessarily less broken than the other?
I haven't actually read the full details of this report you're alluding to.
 
@Sherif i think if git gets a collision it just shouldn't use the new file.. like it isn't there. i've no idea why svn breaks the way it does
 
hmm.. this has interesting implications. I wonder what Linus has to say about it.
 
Just bumped into a thread where he commented marc.info/?l=git&m=148787047422954
 
@Ekin Ah
This makes more sense.
Wow, it took me all of 30 seconds to realize that starred link was to stackoverfiow.com and not stackoverflow.com
I was almost confused there for a second
good one
 
10:49 PM
:D:D
one would thought you'd have seen it at least once since it's running in the wild
 
No, that's the first I've seen it.
It's almost as tricky as php.net/sunglasses
It "looks" legit, but ...
 
> The uploader has not made this video available in your country.
 
@DejanMarjanovic That's probably a good thing.
 
I'm just going to float this... If I committed a change to the PHP license banning america from using it until they got a new president... what kind of fallout could I expect?
 
@Leigh None from me.
 
10:54 PM
I mean fuck commit rights, all it takes is a persona and an email address
it's literally zero fallout right?
I can get commit access back in <0days
so there's nothing really stopping me making a statement
(sorry, at pub, making a point)
 
@Sherif DAMMIT
 
@Leigh Worst case scenario someone will probably just revert it. I somehow doubt anyone is going to be angry with you.
 
"america can handle only one yuge turd at a time, so for the duration of this administration we're pulling php off their plate"
4
 
@Leigh No, please, don't.
America first.
Bavaria second.
 
Dejan last
you have a funny sounding surname, total terrorist
 
10:57 PM
How about we all just agree to leave the politics to the politicians?
 
yES
 
first person I ban is Sal Orozco
 
@Leigh Деян Марянович :-D
 
ah, privet
your grandma makes excellent dumplings
 
please, it's babushka
 
10:59 PM
she's not that old...
 
So... why do you hate Tvump from England?
 
I have literally one russian friend... I have no idea what's offensive and what isn't
s/trump/nazis
dude, I'm being told off, I gotta go buy some beers or something
 
@Leigh My nation fought those other guys and paid a hefty price for it, and here I am, slaving for their ancestors, and I'm sort of happy.
 
I live in Southern California, it's getting crazy. People being rounded up. People are scared to go out.
Not long before they have detention camps.
 
@SalOrozco dude, I was going to ban you for incorrect use of capital letters
that's the kind of leader I am
 
11:05 PM
Ha
 
@SalOrozco there's a lot of people spreading misinformation about checkpoints and shit to scare people
 
It's not, is actually true.
 
en.wikipedia.org/wiki/Yugoslav_passport ... "It was also described as 'one of the most convenient in the world" ... and on Monday I've gotta wait in line with Syrians, Afghans, Somalians, etc. waiting for my temporary permit. @Leigh so f* you.
 
That is actually happening.
They just want to call it fake news.
 
@SalOrozco no, a lot of it isn't. local police departments have had to put out statements about it.
 
11:06 PM
YOU have nothing to complain about. Drink beer.
Not that fake beer, like Heineken, real beer, German. @Leigh
 
It's not local police
 
@DejanMarjanovic I think you forget we talked in the past - you were here a lot, and then you went away for a while, and now you're back talking again .... but we talked a fair bit before you disappeared.
 
It's federal agents.
They have another division called ICE.
Those guys just go anywhere. Stores, factories and round up people.
 
@SalOrozco dude, I'm talking about fud like "there's a checkpoint on euclid in upland" - no there fucking isn't
 
@Leigh I am sorry, rough-ish period in life. Germany is not easy.
 
11:08 PM
Not check points.
Who said checkpoints.
 
I missed this, for sure.
 
s'ok mate - don't take me seriously
 
They are showing up at stores.
 
3 mins ago, by Paul Crovella
@SalOrozco there's a lot of people spreading misinformation about checkpoints and shit to scare people
mostly jackasses on facebook, twitter, etc
 
@DejanMarjanovic my ex-girlfriend was german, least easy thing ever
 
11:10 PM
I know many people that live in dominant Hispanic communities. Those are my sources.
Not facebook or twitter or the news.
 
@SalOrozco I'm not saying that didn't happen, I'm saying misinformation to scare people is also happening.
 
@Leigh Yeah, except that :-D
 
@DejanMarjanovic you know what the r11 community is like dude... if life is tough reach out. Probably a PHP conf going on somewhere with some guys going :)
 
@Paul, I think what it is. That people see an immigration vehicle and think is a checkpoint.
You live in California too?
 
@SalOrozco yeah, in ontario at the moment
 
11:13 PM
@Leigh :D :*
 
Fullerton
 
Slavs kiss each other a lot when they get drunk, no homo.
 
@DejanMarjanovic Since you're in Germany - we'll see you in October right? :)
 
@Leigh Oktoberfest is in September? :-D Some conf. going on at that time?
 
yea PHPNW
it's the usual R11 yearly meet
although we're adopting PHP South Coast a little as well
Which is June I think
 
11:18 PM
Ah, awesome, maybe @JoeWatkins can help me with visa, I need invitation letter or something :-)
 
who are the speakers?
anyone in here?
 
That's the side thing :-P
 

« first day (2323 days earlier)      last day (2624 days later) »