« first day (2138 days earlier)      last day (2814 days later) » 

9:02 PM
and finally, I would look at comparing dates this way instead: php.net/manual/en/datetime.diff.php
Personally, when I write php code, I tend to make it all OOP if possible.
 
> AWS is a good idea, but you need profesonal help
This sounds more like "you should go see a doctor" then what I think was intended.
"AWS is good, but you're crazy. Seek professional help..."
 
@JonathanLafleur You're using preg_match?
 
@Sherif hey, just for future reference, when I ask questions in here, feel free to always append the, "but you need professional help" to the end of your answers bcz I can be certified crazy from time to time
 
@Trowski no I said I couldn't use php engine since it's take too much memory on a 32k line... I have to do it manually with a s&r from a text editor. The S&R accept regex
 
@JonathanLafleur Ah, I see.
 
9:05 PM
@Trowski sorry if that was not clear
 
@JonathanLafleur In a text editor, you can probably use \{\{(.*?)([_\.])(.*?)\}\} with a replacement of $1$3. Put what you want to replace _ and . with between $1 and $3.
@JonathanLafleur Beyond that, just read the tutorials on regex101.com and see what you can do.
 
@Trowski thank you for you time :) your regex give me some hint i'm sure I will get it :)
 
@rabbitguy heh
 
@JonathanLafleur Sorry, the replacement string should have been {{$1$3}}.
 
You're assuming it's even PCRE.
 
9:12 PM
@Jay did that help you any?
 
@Trowski almost that ! :O thank you
 
nvm
 
@rabbitguy Perl Compatible Regular Expression
 
Jay
@rabbitguy yea. I ended up doing this stackoverflow.com/questions/19070116/…
 
@Trowski what's the syntax for the replace to replace with a - ?
 
9:14 PM
@Sherif yeah, google helped me out there right before you said that
 
University of Google graduates FTW!
 
@JonathanLafleur {{$1-$3}} should work...
 
man... 15 minutes and I go home, yay!
 
You know what's almost sad is teachers are actually telling their students to Google stuff these days. I'm not sure if we should just accept this as the way of this age or seriously question our educational institutions.
 
@Sherif what are you even saying?
 
9:17 PM
@rdlowrey As long as you won't notice Friday that the week is over without having achieved much, I'm all happy
 
for the vast majority of questions that students have, google will give the correct result..
 
@Trowski it add the - after the {{

{{test.prop_name}} is replaced by {{-test.prop_name}}
 
user895378
@bwoebi Oh no, that's not happening. I just slept in and did some stuff today. Coding now. Enjoying it :)
 
@FélixGagnon-Grenier I'm saying "Are we teaching kids to be stupid at a young age or are do we just have stupid teachers in the schools?"
 
but what teachers need to teach that they taught even in my day when there was no internet was that you need to check your sources...
 
9:17 PM
@rabbitguy I wished…
 
just because it's in print doesn't mean it's correct
 
@Sherif hmmmk... because according to english grammar, it really looks like your first sentence says "Teachers should not encourage students to google"
 
@JonathanLafleur That... is surprising...
 
@FélixGagnon-Grenier That's pretty much what I said, yes. Just in the form of a question rather than a statement.
 
@Sherif are do? ;o)
 
9:19 PM
@Sherif then I don't agree w/your statement
 
@Sherif then yes, teachers should encourage students to google things and get informed on what they study
 
@bwoebi Yes, it's the present past participle of the present form of the verb to be.
 
lol^
c'mon now, just admit you fucked up your sentence
 
teachers should teach students how to use google to find a good answer and understand what the source is for that answer...
 
@Sherif lol present past
 
9:20 PM
also... I'm crazy
 
totally unrelated, but fun all the same :p
 
@Sherif Latin is more fun.
 
@Trowski thank you for your help, i go supper, and look that when back thank you
 
@bwoebi Fun? Or just plain confusing?
 
9:22 PM
@bwoebi latin is more fun? dude, and I thought I was crazy
 
@Sherif fun.
 
well, you are a hamster with a pancake on
 
Because sometimes the two can be interchangeable.
 
@Sherif no. … well, some few forms are identical in different tenses but fewest
 
Latin is more (band name)
no... I am a rabbit w/a pancake
 
9:22 PM
Latin is more back street boys?
 
or a bunny tbh
I think @FélixGagnon-Grenier gets it now
 
@bwoebi ad hoc ergo propter hoc
 
!!english ad hoc ergo propter hoc
 
@Sherif doing something for the sake of it?
 
@Jeeves get lost
 
9:24 PM
@bwoebi Quis custodiet ipsos custodes
 
@Sherif Nemo.
 
That's the extent of my Latin.
 
dude, we had to study latin in HS ad nauseum
 
nice… a 250 rep bounty… stackoverflow.com/questions/38419471/… … I did not expect to have it awarded
 
@rabbitguy Unfortunately, my highschool didn't have Latin. We took French and Hebrew.
 
9:25 PM
I had to study it afterschool for academic team
I took Spanish
 
@bwoebi Wow, someone that actually understands how register_shutdown_function works
/me is amazed
Let alone pcntl
 
Ekn
!!en post hoc ergo propter hoc
 
@bwoebi looks like how a lambda expression would be done up in Java?
 
post hoc ergo propter hoc (translated from English)
 
why wound anyone in USA learn Hebrew as the third language?
 
9:27 PM
@Jeeves lol
 
@tereško You're assuming I was living in the US when I was in highschool.
 
@Sherif Perhaps I should have proposed pcntl_sigprocmask instead
 
@Ekn thing A happened before B, therefore A caused B
 
Ekn
yup
 
isn't that very stupid?
 
9:28 PM
@bwoebi People that actually want to use pcntl in PHP amaze and baffle me.
 
@Sherif Woking with PHP core tells you these things… When things break in tests you learn why and also much about semantics of PHP.
 
good morning
 
@FélixGagnon-Grenier it's a name of a logical fallacy
 
@Sherif … why?
 
home time... adios todos!
 
9:29 PM
:p
 
@bwoebi Because it's stupid. It hardly ever proves useful in practice.
 
@Sherif It's about as useful as signal() in C.
 
You get more problems than you solve.
 
@Sherif You've clearly not used the CLI sapi enough...
 
@bwoebi Now that's not true.
@Trowski You think?
 
9:30 PM
@Sherif true, signal() is sometimes a bit more useful.
 
inb4 @Sherif has done everything more than everyone else
3
 
@bwoebi I would agree.
 
@Sherif but then it's really just to catch exotic signals like SIGIO
 
Well, if you're going for systems level programming there's very little you can find that's not useful in a language like C.
 
@Sherif but pcntl_signal definitely is not useless
 
9:32 PM
Whether or not it's safe is a totally different matter.
 
@FélixGagnon-Grenier one can't at the same time have lied the most and told truth the most
hence, it most likely that he is just one, who is most full of shit
 
@bwoebi In PHP, it pretty much is. Find me the number of people willing to use it and compare that to the number of alternative solutions that could make it obsolete in PHP and you'll quickly see why.
 
@tereško point is, Sherif is actually microscopic and entangled, living his whole life in a superposition state
@Sherif I use it when there's a point in it…
 
that sounds like a description a strange illness .. maybe even an STD
 
right.
 
9:36 PM
@bwoebi You're conflating its utility with how likely people are to use it. The measure of something's usefulness is actually quantified by how many people are willing to use it in practice. Not necessarily how much utility it carries.
 
@Sherif I've seen enough people … struggle with it :'-D
 
@bwoebi That means what?
 
@Sherif Also, most people don't write CLI apps…
 
And you think that supports your claim for its quantifiable use?
There is no blanket statement here. It's a statement of pragmatism.
 
@tereško <3
 
9:39 PM
@Sherif doing it wrongly, not knowing what restart_syscall ought to mean, mistaking signals (pcntl_signal(SIGKILL) is pretty much pointless… )
 
actual loud lolz are had
 
@bwoebi Right. That's my point. It draws people away from wanting to use it. You think crypt was useless because password_hash came along?
Nobody wanted to touch crypt before password_hash.
 
@Sherif far too many people did.
Nobody sane wanted to touch it. nobody knowing enough to realize that it's easy to use it wrongly
 
@FélixGagnon-Grenier Not just me then is it. He refers to himself as a 'we' too... xD
 
@bwoebi Your measure for far too many may be very different than mine then. Given the number of people I saw complain about either not knowing how to use crypt properly or how confusing it was long before password_hash existed.
 
9:41 PM
@Sherif they complained, used their own hack and it was totally insecure.
 
\o/
 
@Jimbo pluralis majestati ;o) [this is a dative, not a genitive…]
 
@bwoebi shrug not sure what you're basing that on exactly. Since 2009, I've seen countless people asking for help with crypt and avoiding it because they felt it was too confusing or complicated.
That in no way suggests it didn't have utility. Just that people didn't see it as useful. But it becomes clearly useful when the abstraction like password_hash makes the utility easier to reach.
 
9:44 PM
@Sherif not everyone. but perhaps your mileage varies … I've seen enough code abusing crypt in ways undermining its point.
 
Off to bed, nite all.
 
@Sherif I agree with you there.
 
@bwoebi And that's really the point I'm trying to make. It's the same with pcntl. The utility obviously exists. But when you find alternative abstractions that make the utility easier to reach people are more likely to turn to it.
 
would superuser be a good place to ask a question about why my supposedly ok pc can't run old games with a decent fps? without even mentionning not so old games
 
9:46 PM
@Sherif What are the alternative abstractions for signal handling in PHP?
 
@bwoebi The same alternatives there are for persistence storage in PHP. Don't do it in PHP. Find a tool that does it better and make or use a php binding for it.
There are no shortage of job managers out there. Think of the real use cases for signal handling in PHP that aren't just hello world examples.
Most of the time you're just trying to do fork process management, right?
 
@Sherif n...no?
most of the time I'm catching SIGINT
 
@bwoebi But why?
 
I catch SIGUSR1 too
 
The demagogy is strong in this one
 
9:49 PM
@Sherif to do cleanup instead of shutting down hard, when someone issues ctrl+c
but yeah, as Levi says, SIGUSR isn't uncommon either
@Sherif How often do you write/see long-running CLI processes?
Consider just these and pcntl suddenly isn't really that uncommon…
@Sherif If there's one thing I'm really scared to touch, it's openssl.
 
user895378
^ that's for damn sure (re: scared of openssl)
 
@bwoebi Quite often, but I don't try to go against the grain. Most of PHP's architecture was designed with primitive concurrency in mind. I find ways to avoid solving PHP's architectural problems and instead focus on making my application code work well within the programming system. It's a trade off that is easier for me attain and sustain.
@bwoebi Banging your head against a wall isn't uncommon, no. I just choose not to do it.
 
@Sherif pcntl isn't really that a nightmare…
 
That's not to say it might not pay off for some people.
 
So my company utilises it's own, albeit legacy, in-house workers that do their stuff in while loops. I remember using pcntl and writing an autoscaling AWS instance controller for them and I used pcntl to catch SIGTERM, and send API calls to terminate any outstanding ec2 instances so devops could upgrade, move about etc.
 
9:55 PM
@bwoebi There are worse things in PHP, sure. I'm just saying I've found better ways to achieve the same goals without using it.
 
@Sherif in that case fine
 
@bwoebi One of the reasons I came to hate debugging PHP code that relies on pcntl is when I was working at Yahoo there was PHP code that relied on forking and doing long running jobs, some of these jobs took over 18 hours to complete, and some of them failed mid-way through due to very odd segfaults. Granted this was a while back, but they were very hard to debug, because you actually had to profile PHP's memory to figure out where the segfault happens in a job that takes hours.
That's painful man.
 
@Sherif This is one thing I avoid, using pcntl_fork() directly.
 
@bwoebi How do you mean?
 
@Trowski Ah, nice rename :-)
@Sherif I avoid pcntl_fork() as in my experience it often leads to problems if not everything considered and appropriately handled… just like you described.
 
10:01 PM
@bwoebi Parallel does make a lot more sense. I never actually chose the name Concurrent.
I probably should have suggested changing it long ago.
 
@bwoebi well, hence my overall experience in working with pcntl in PHP... I just avoid it altogether.
 
@bwoebi Along those lines, I questioned the forking context in parallel. It might be better to just use Process.
 
@Sherif just because fork() is dangerous, the other funcs aren't necessarily questionable.
 
@bwoebi That obviously isn't my sentiment. If I find doing something one way proves less problematic over doing it another way I'm more inclined to take the path of least resistance.
 
@bwoebi Interesting that 7.1 segfaults, but nightly is fine: travis-ci.org/amphp/parallel/builds/154588937
 
10:04 PM
@Trowski lol?
 
hello
 
@Trowski the 7.1 build is three days older
 
@bwoebi It's using beta3... something must have been fixed.
 
@Trowski I see nothing in commit log
well, let's ignore for now
 
At this stage we've removed the ability to "overload" static and non-static methods, right?
 
question: I have a function, check_required_checkbox($checkbox_name, $error, $is_multiple_checkboxes). I am trying to write it so that if I have an array of checkbox names, and I check to see if all of the checkboxes are checked. However, there's a change in PHP 5.1 that does not allow syntax such as $_POST[$checkbox_name][]. How can I write it properly?
 
@bwoebi I was going to add 7.1 to the Amp build. Should 7.1 and nightly be an allowed failure?
 
@LeviMorrison what do you mean with overload?
 
Generally I put future versions in allowed failures.
 
@Trowski It never should be a failure, Amp should always work with the current master of PHP…
but well… when the php-src side is broken… then there's not much I can do about it…
 
10:12 PM
@bwoebi Exactly.
It's not so much an issue for Amp now that it doesn't have loop extensions to deal with.
 
Actually we perhaps haven't.
 
@LeviMorrison ?
 
@Tiffany Change in PHP 5.1? /me checks what year it is
 
apparently something like 2016. I think.
 
And PHP 5.1 should have been causing problems around... 2005 I think.
 
user895378
10:17 PM
@Trowski @bwoebi is amphp/dns ready for amp_v2?
 
@Tiffany I guess you won at "let's say check as much as we can" contest
 
@rdlowrey The amp_v2 branch is.
 
@rdlowrey yes, it has an amp_v2 branch
 
user895378
thumbs_up.jpg
 
@rdlowrey I'm busy updating amphp/file. The amp_v2 branch works, but it needs some cleanup.
 
user895378
10:18 PM
No worries, not a blocker for artax work. I'm just going to work as if everyone wants to fully buffer all http responses in memory for now
 
user895378
Can introduce async file offloading later
 
Actually amphp/dns needs some updating too, but nothing there is going to really change... probably just tossing some types on functions.
 
class Seq {
    static function filter() {
        var_dump(func_get_args());
        var_dump(isset($this));
    }
}

var_dump(Seq::filter());
var_dump((new Seq)->filter());
Seems we have.
 
user895378
I <3 generators and subgenerators so much. I vividly remember how terrible it was writing all this async http client code like 4 years ago without any of these tools.
 
I understand that this is usually an error.
Hmm. When do we trigger __callStatic?
Time to find out.
 
10:28 PM
@LeviMorrison MyClass::notDefinedStaticMethod()
 
We don't call it when you call a non-static method statically :/
Instead we get a deprecated with NULL returned.
(actually the null may be my fault, investigating)
(nope, not my fault)
Seems we've made it impossible to have a static and nonstatic method of the same name (logically I mean, obviously not possible by defining twice).
Unless we use non-public methods with __call and __callStatic.
It's the non-public methods part that bothers me :/
 
user895378
@bwoebi @Trowski all of this crazy dependency madness ... should we consider a monorepo approach for the most core amp libs?
 
user895378
dependency hell is a real thing ...
 
@rdlowrey I'm not sure. e.g. dns has had separate API changes from Amp
 
Basically it's really hard to have both Seq::filter($seq, $fn) and $seq->filter($fn). On occasion I need one or the other form and it'd be nice to make it easy to get it in the other form.
 
user895378
10:38 PM
Sure, but when you do it that way you basically make a conscious decision to not break BC. You only make additive changes. Deprecate old approaches as you go, add new ones and then periodically do a major release in which you remove deprecated things. It requires a bit more discipline but it makes consumers' lives far easier.
 
user895378
I don't think we're ready for it right now, but it seems like a logical medium-term step to take.
 
@rdlowrey perhaps.
 
10:50 PM
@rdlowrey Considering your (somewhat) recent usage of Go, do you ever consider writing services for that over stuff you currently maintain in PHP?
@Sherif Seems Mr. Fairbanks is pretty quick. He already sent through the kindle version to me.
 
@rdlowrey It does get crazy... but it's so much easier to have breaking changes in one lib without having to do another release for the entire set of packages.
 
Ekn
11:37 PM
g'night
 
Nightkn
 
user895378
@Trowski people underestimate how incredibly easy it is to not break BC, though
 
user895378
it's really easy when you make a point to not do it
 
user895378
you can always create new APIs
 
user895378
you don't have to change existing things.
 
user895378
11:47 PM
When everything is additive it's trivial
 
user895378
And it eliminates dependency hell
 
11:59 PM
Is there really much point in putting job info on your CV from > 5 years ago
 

« first day (2138 days earlier)      last day (2814 days later) »