« first day (2706 days earlier)      last day (2256 days later) » 

12:00 AM
@DMop put them in a directory that is outside of the directory that is the root public folder for your site.
@DMop depends on the business case, and if you'd ever have people that could login as both.
@bwoebi it is possible to compare the Fibres RFC to goroutines in go?
 
12:15 AM
anyone here familiar with PHP-fpm/nginx
 
> Don't ask to ask, just ask.
 
@Danack yes. Basically single threaded goroutines
 
@Danack I have all my html in the root folder and my scripts with secrets in /scripts/file.php. Would that structure make sense
 
@bwoebi So, by implication, there would be some things that fibres couldn't do that multi-threaded goroutines could do?
 
And thank you for answering my question about the separate sites
 
12:22 AM
@Danack rather the opposite: with the single-thread guarantee we do not have to care about low-level synchronization primitives
And obviously, it can't run in parallel, by defintion of being single-threaded
 
@DMop if you really mean in the root folder (like /) then no, that sounds bad. A typical layout would be more like:
/var/www/site_name/public - public files go in here including one php file of index.php
/var/www/site_name/lib  - rest of code goes in here
/var/www/site_name/config.php - secrets go in here.
@bwoebi thanks.
 
@Danack thanks! Then I'd just have the public files or scripts read the variables from the config.php?
 
@DMop typically, only the index.php file in the public folder, and then it's contents are just:
require_once __DIR__ . "/../lib/index.php";
and all the code is hidden away.
 
Wes
1:11 AM
morn
 
1:35 AM
@Danack that makes sense. Thank you
 
2:24 AM
is there a built-in floating-point-safe number-formatting function?
something like number_format but that accepts strings
 
Wes
hm?
 
After making calculations with bc math, it would be handy to have a number formatting function that works with strings.
 
Can anyone think of an PHP behaviour that is pretty stupid but has been kept around because it's not that harmful either.
 
Wes
unfortunately, it's poorly documented
@Danack language or functions?
php's got tons of functions that should never be used
 
2:37 AM
@Wes I want to give a string value to the function. Not a float. I don't want to have to convert to float because floating point numbers.
 
@Wes something that is 'lol' worthy
It's to go on a slide making comparisons between english and PHP.
Specifically to go alongside that we still spell the word "won't" as it it's an abbreviation, but have forgotten what it's an abbreviation for.
 
Wes
@FélixGagnon-Grenier 3v4l.org/Kl0QD
 
@Wes > The value to format. Can be integer or float, other values will be converted to a numeric value.
I think you might still lose accuracy.
 
^
@Wes try that with strict_types on
 
Wes
wat
format (StringPiece number, UnicodeString &appendTo, FieldPositionIterator *posIter, UErrorCode &status) const
it's supported in icu
if it doesn't it's just php being stupid
holy shit you are right
!!lxr NumberFormatter
 
2:54 AM
@Wes Nothing went wrong but I couldn't find a suitable definition
 
@Danack is T_PAAMAYIM_NEKUDOTAYIM still around?
 
@FélixGagnon-Grenier I was hoping for something more benign than that.
 
Wes
@rtheunissen can you fix this perhaps?
 
Wes
3:11 AM
@Danack can't thing of anything particularly lolworthy
all the fun stuff was removed :(
!!uptime
 
╔═══════════════════════════════════════════════════════════════════╗
║ [7 days, 15 hours, 15 minutes and 30 seconds] without an accident ║
║                    since [2018-03-06 12:00:48]                    ║
╚═══════════════════════════════════════════════════════════════════╝
 
@Wes looks like it operates on a double. Like it's a fundamental design flaw, more so than a bug that can be fixed.
 
Wes
> Subclasses must implement this method. The syntax of the unformatted number is a "numeric string" as defined in the Decimal Arithmetic Specification, available at speleotrove.com/decimal
just ftr, it is supported in icu
it's just php converting for no reason
 
How old is this number formatter ext?
5.3.0 it seems
 
Wes
/me has used that function for years thinking it was safe doing so -__-
php depression kicks in again
so @FélixGagnon-Grenier you are screwed
s/you/we
bugs.php.net/bug.php?id=76093 bug is here, jeeves is not posting it
 
3:29 AM
@Wes The more I read about CQRS the more that I think you misunderstood it's purpose. At least from the impression you gave me.
 
Wes
...
:shrug:
 
What? I just want to talk about it. I'm not necessarily saying you were wrong.
Am I not allowed to have opinions too?
 
Wes
cqrs is just (read) models specific to views, and models for "write only" that are used (indirectly) in the controllers
 
Yes, but what I'm saying is WHY you would do that.
Before the vibe I got was that you thought it was a total conversion.
 
Wes
for the same reason you wouldn't mix mayonnaise with marmalade
 
3:32 AM
It is only for those specific aggregates which warrant it, like that situation with cart I asked you a question about yesterday.
No, I think it is a good idea to mix. The God of DDD himself said so.
It is unessecarily complex for most situations.
 
Wes
yes it is
 
And therefore warrants mixing.
I'm about to implement this @Wes, so if I'm wrong...
 
Wes
it's ok
 
?
 
Wes
you can do both...
 
3:50 AM
morning
 
@Wes It sounds like you SHOULD do both.
 
Wes
you can do cqrs or not
it's domain is simple then you can have a unified model
 
There's no use in establishing a complex observer scheme for a bunch of aggregates and at least double your classes for no reason.
That's not what Martin Fowler said.
There are only certain aggregates that are complicated enough to warrant CQRS.
For example my Catalog aggregate is simple and does not warrant seperate models.
 
Wes
then follow his advice
 
Consider an aggregate where a change in one entity changes the nature of several other entities in the aggregate
.
 
Wes
3:53 AM
i'm not going to argue on what martin fowler said lol
 
Dude, Im just trying to run what I understand by someone I trust.
Anyways, in such an aggregate the write model should change the ultimate result of a read, and s houkd therefore be refreshed upon a write.
This (seems) like it would not be the case where your read models were based on a SQL DB you wrote. But seems to fit super well in my case, where the REST API does this exact thing behind the scenes.
 
Wes
forget cqrs
you already made it more complicated than it is
 
4:15 AM
I don't think so.
I have a REST API which allows me only to get the complete aggregate. But also only allows me to edit one entity in that aggregate at a time.
And editing one aggregate affects the composition of the others.
That seems like a perfect case for CQRS.
But the rest of the aggregates do not have such complications, and therefore do not warrant CQRS.
(In fact it would both add complexity and inefficiency.)
 
Wes
you say that like cqrs is only about aggregates
it's not
how about the repositories that are fundamentally different, the services?
it is a logic division more than practical
you can do it but also not do it
it's up to you..
RIP Stephen Hawking :(
 
I don't see a sane way to do it other than CQRS in my situation.
@Wes He died?
 
Wes
yes
 
Oh man. That sucks...
He had a good life for one with such a disease...
Also @Wes yes it does fundamentally change the nature of such objects when you're on "your own" DB. That part I don't understand how you would do. In this case it seems like the only good way to do it, no?
 
Wes
4:31 AM
you have to understand that 1- you never provide me enough info to understand your problems
2- if you did i probably wouldn't have time to read it, if it's a lot
cqrs doesn't affect how the program functions
it's matter of hygiene
write services and models are completely different from the one used in the views
for example you don't have to have mutator methods
for example you don't have to lock rows for update
for example you do need to convert data depending on the user's setting, like
the write model wants a date in utc
but a date in the view should probably printed out with the user's locale
also the new entities in the write model must be validated, as they are new
 
That example seems like something that should be done in the view logic. Not in the domain.
 
Wes
but entities in the read model are already validated, since they come from a trusted source (the db)
so, they are completely different
 
They should be validated in UTC.
 
Wes
in fact they are so different that even the aggregates don't match
for example i have fewer read aggregates than write aggregates
because write aggregates are actually inseparable (as per domain)
 
Either Im not understanding your example or such things don't make sense. Seems all timestamps should be converted to some known format, then the user aggregate should pass data to the view that tells the view how to convert.
 
Wes
4:36 AM
while read aggregates can be anything, small, big
 
I don't get your last point.
 
Wes
you can finely tune what to fetch with an ad-hoc read model
while with the write model you can only fetch entire composites
because fetching only part of them would break their encapsulation
but, you can do that with read models
since they have no mutator methods
 
In my situation I have a cart. The only source of persistence of this cart is the REST API. This API doesn't allow me to retrieve entities of an aggregate. Only the whole aggregate with all of its entities. Persisting an entity through the API changes other entities in the cart aggregate. This means that I must write, then upon a write reload the entire cart aggregate. A perfect case for CQRS.
 
Wes
yeah
i am surprised that you got all nouns right :P
yes that's exactly what you can do with cqrs, although incidentally
i wouldn't say that's the major advantage i mean
 
I don't get what you mean. Is this not a good case to use it?
I understand it's coincidental. And I admit I do not understand how are why one would do that when they have control of persistence, but...seems like a good strategy in this case.
 
4:47 AM
good mornging
 
o/
 
moin
 
o/
 
Morning
@JoeWatkins what are your thoughts on making array_sum attempt to cast an object to a float? Rather than skipping...
 
4:54 AM
well in general it would be useful if objects could be cast to scalars
 
Wes
@Allenph i am saying that it is
 
Cool. Thanks. Illbtry and figure out how to implement it.
 
I read libtry, and hear libdoordonot, there is no libtry ....
I've got to start another phpdoc marathon, I'm dreading it ... I so wish someone would drag the tools into this century ...
 
5:16 AM
One function at a time @JoeWatkins :(
Also.. looking at this on the surface, how would you check if an object can be cast to a number? The default handler returns SUCCESS :/
https://php-lxr.adamharvey.name/source/xref/master/Zend/zend_object_handlers.c#zend_std_cast_object_tostring
 
yeah, it would be quite a violet drag, possibly best describe as kidnapping, or other related violent crime ...
oh no you can't do that
 
Why can't we have nice things?
 
we can, but only sneakily, and only without being noticed ... creep up on internals ... what you need to do is RFC the justification and implementation of casting objects to scalars, and upon that build your kingdom ...
you might be able to reuse that handler, but if you stick this on the back of some other RFC, both will fail ...
 
Wes
@JoeWatkins for the markdown thing?
 
@Wes yeah, unless you're going to do it ?
have you actually looked at the API in detail, got any suggested changes before it's too late ?
 
Wes
5:20 AM
i can try. i will need some guidance
ok
 
got a docbook setup ready ?
 
Wes
nope
 
this is the best walk through I know of ...
 
Wes
namespace CommonMark should probably be
namespace CommonMark\CommonMark
 
oh really ?
 
Wes
5:22 AM
for php-fig reasons
 
oh, we can ignore that ...
I've never seen an ext use that namespacing
 
Wes
vendor\lib
 
yeah, we don't do that ... vendors do one thing, then run away from php forever :D
also, you'll want to read through cmark.h, there is much useful info that should be in docs, or enforced by API if it's not too much trouble ... I think I got it about right ...
 
Wes
still reading the api hold on
 
sure sure, there's no particular rush ... just spit balling ...
 
Wes
5:25 AM
public function getNext() : Node;
public function getPrevious() : Node;

public function getNextSibling() : ?Node;
public function getPreviousSibling() : ?Node;
 
that's wrong
should all be ?Node
 
Wes
it is?
Node::getChildren(): Array<, Node>
 
oh I see, you wanna change the name ... sorry, bit distracted, tooth ache ...
 
Wes
Ndoe::setChildren(Iterable $nodes)
 
@Wes you don't want to do that ...
or that ...
 
Wes
5:27 AM
not by ref, returns a copy
 
ok so the only reason to use this over a php implementation is speed and efficiency, so we don't want to do anything that by virtue of it's purpose is going to be extremely slow ...
 
Wes
means that modifying that array requires a setChildren() to apply
 
the document is not a tree of php objects
 
Wes
i'm just saying those are the functions i'd probably look for
but they are not strictly required
what does appendChild return?
 
$this
 
Wes
5:30 AM
dislike it :B
 
yeah I'm open to changing that
replace returns $node
 
Violation of UNIQUE KEY constraint 'UQ__acc_monitor_log__1FE396DB'. Cannot insert duplicate key in object 'dbo.acc_monitor_log'., SQL state 23000 in SQLExecDirect in C:\xampp\htdocs\sqlinsertbulk.php on line 11
Transfer not Success to backup data.23000
hi how can i fix this error from sql
inserting query
 
so you think all the edit functions should return their argument rather than $this ?
 
Wes
@JoeWatkins what happens if i do $a->insertBefore($b) and $a is already in a document?
 
exception
 
Wes
5:32 AM
it gets removed from the old document and added to the new one?
do you have a remove() method?
 
we can do one, I think ...
 
Wes
it should probably remove from old node and add to new node
 
@Wes libcmark can't reuse nodes
 
Wes
ok
 
Might take a look at what it'll take to revive wiki.php.net/rfc/object_cast_to_types
 
5:35 AM
they're not refcounted by libcmark, we refcount the php object that gives you access to the libcmark node, by storing it in the node itself, which seemed reasonable because libcmark won't let a node have more than one parent ...
 
Wes
@JoeWatkins also i prefer $node->removeChild($foo) rather than $foo->remove()
similarly $node->replaceChild($search, $substitute)
rather than $search->replace($substitute)
 
$node->replaceChild($search, $substitute)
think about how that would work ...
the answer is very slowly ...
@rtheunissen noise ... start making noise and see if any of the noise you hear as a result is happy noise, or sad noise ...
 
Wes
yes but $search->replace($substitute) is very weird
the replacement happens in the children list of the parent node, not the node itself
that's all i know. if it's slow well maybe you shouldn't what i suggest :P
i'd avoid returning anything for any mutator method
append, prepend, insert, replace
should all be void
 
you don't think chaining is reasonable ?
 
Wes
not a fan. should be a language feature not a "return $this;" hack
 
5:41 AM
I don't like chaining in general, but it seems pretty reasonable when the thing you are doing is building complex structures, avoiding $thing-> 10's or 100's of times seems like a win ...
 
Wes
CQS ftw
@JoeWatkins i am trying to think what i probably would need
and cloneDeep a node is probably one
also $node->childrenCount()
 
I think a clone is possible
 
Wes
final class Text {}
final class Code extends Text {}
uh? make it an interface if you really want to deny extending text in userland :D
setLiteral getLiteral imho should be just set and get
 
all node classes are final, it keeps the objects slim and fast, and simple internally ...
the names mostly try to match the terms used in spec, and in libcmark api
I agree it's odd, but that's what they are calling it ...
 
Wes
you decide, just throwing out my concerns as they come to mind
 
5:47 AM
sure it's all good
 
Wes
also
$node->appendChild(new Text("x"));
$node->appendChild(new Text("y"));
assert($node->getFirstChild() == new Text("xy"));
do adjacent text nodes get merged in one?
 
Wes
ok
@JoeWatkins regarding
$search->replace($replacement);
can it just be:
$node::replaceChild($search, $replacement){
    if($search->getParent() !== $node){ throw new xxx("child not found"); }
    $search->replaceSelf($replacement);
}
it can be done without linear search, if that was your concern
you can keep them both actually
$node->replaceSelf($replacement) === $node->getParent()->replaceChild($node, $replacement)
and on that note, we could loosely match DOM LS api
 
can I try to explain why I haven't done anything to make it more friendly ?
 
Wes
lol you can, i'm not criticizing you though, i don't want you to think that :D
just throwing ideas out there, maybe you agree on them
for me it's ok already
 
6:00 AM
you have to have a focus when you're designing an extension that wraps some third party, you can either try to stick to the 3rd parties api, make it friendly a little (oo) and avoid nasty resources, but don't do more than the 3rd party wants you to do ... alternatively you can try to write a friendly API ... the former comes with obvious benefits like speed and whatever, but less obvious advantages are maintaining that code long term (I have 60 repos and most of them are extensions)
 
Wes
so just make a 1:1 match, and let people wrap them in userland, if they really dislike the api
i'm totally fine with that
 
diverges from upstream tend to be less painful or pain free ... the latter is obviously better for the end user, but in loosing parity you cause yourself all kinds of problems, long and short term ...
 
Wes
it's ok for me
 
so it's not that I disagree that you're describing a nicer API, it's just not necessarily what you do in an extension, and having the nicer API in userland is better for everyone because more people can work on that
 
Wes
yes yes, totally agree on that
 
6:06 AM
@JoeWatkins where to make noise? Everywhere? cracks knuckles
 
internals mailing list
 
The tangent is real. Start with solution A, have to fix B and implement C first.
The mailing list is an enigma to me.
Why we can't just have a private subreddit is beyond me. (potentially naive)
 
will it make it easier if we all start calling it group chat ?
because the 1990's
got gmail ?
it makes it just like email conversations really ... except there are some idiots in the conversation that you would never normally give your email too ...
 
I do
I think it's the mystery of how to interface with it all that keeps me at step 1.
I should read more.
 
well it comes as email if you are subscribed
goto php.net/mailing-lists.php, see bottom, use that to subscribe and you'll start getting emails, which you can reply too ...
 
Wes
6:11 AM
@JoeWatkins are you willing to spend some time explaining me docbook? :B
 
also, externals.io is a better interface ...
 
@JoeWatkins how do you start a new thread? Send to the group somehow?
 
email internals at lists dot php dot net
 
I don't know what I was afraid of..
 
@Wes well sure, but I might not be very good at it ... if you follow sammy's tut for getting the env together, and then look at the docs for an api that you know, and try to make some changes you've always thought were necessary, and when it fails, you have the dtd and error messages from the build ...
of course you can ask me anything, but I'll mostly just be looking at the dtd
 
Wes
6:15 AM
link for sammy's tut?
 
oh you could just try out docgen on cmark and dive straight in, it's not that complicated once you have the skeleton ... just need to fix namespaces and a few things ..
 
Wes
> Before we begin, I'm assuming: You're running an OS X/Linux environment
i'm screwed already :P
lemme read hold on
 
use a vm
probably you could configure your svn client to be friendly
but I haven't known how for like 10 years ...
you don't need nix whatever, just nix line endings on commits ...
 
Wes
god almighty svn
 
it's the only major project left on svn
something to do with translations and blah blah blah ...
"it's too hard" ...
we can't drop translations because mirrors and blah blah blah ... again "it's too hard" ...
 
Wes
6:23 AM
php.net should probably be replaced altogether with something better
markdown based, possibly
that is actually something i might do. it is a massive job though
 
as much as I hate it, it makes some sense to use docbook ...
 
Wes
need to convert all the things, import comments and votes
 
so massive, it needs a team of people ...
there's been talk of a markdown converter/support in docs ... but it never happened ...
 
Wes
i wish i had infinite free time
how do i get paid for doing open source?
 
that's where I'd start, you don't want to start trying to convert all of docs, because even a team would fail ... you start by adding support for markdown, and wait for the manual to become some decent percentage markdown organically, which it would ... then you start talking about removing docbook and doing all that other stuff ...
 
Wes
6:27 AM
i might do that myself
but gotta do some actual work sometimes lol
 
@Wes find somewhere cool to work that lets you do open source ...
 
Wes
the worst thing is when you have to stop for days. the long period of not working on something makes me forget all the things
maybe universities
 
lots of places will ...
when you take code into the open, you get the potential work of millions of github users for free, any manager not cashing in on that at the opportunity is stupid, most of what any company does are solve general problems, whatever needs to be proprietary is only a small percentage of what we're doing ...
you'll find the odd manager who isn't stupid, but hasn't really thought about it ... and you can be the one to explain they are doing it wrong ...
 
Wes
i never heard of people doing open source work here
and redoing php.net is hardly a priority
maybe if i was good at php like you i would have some chance to find something... but i am not
 
often the fattest most disgusting football fans couldn't play a game for fear of massive heart attack, but they can quote you the rule books and lecture you on the strategies involved ... knowing a lot about something is very different to being good at it ...
 
Wes
6:39 AM
i am not sure if that's an advice or an insult ahaha
anyway, i'm neither of that
 
morning ppppl
\o
 
Wes
unfortunately i'm only slightly decent at everything i do
 
moin
 
Wes
mornes
 
its a rebuff to the claim that I'm good at, or good for php ...
I know a lot about it ... that's all ... most of the stuff I've designed for internals has been shot down ... tbh I've stopped trying with internals
 
Wes
6:43 AM
you are letting the trolls win :P
 
@JoeWatkins Who manage the internals anyway?
 
Wes
nobody can
 
meaning?
 
@Wes no there were mostly good reasons, if nikita or dmitry isn't on side, then you're doing something wrong, and most of the time they weren't on my side ... it's very difficult to get stuff through internals and it should be difficult ...
 
Wes
was a poor joke
look at yasuo, he's not backing up despite everybody is telling him to
 
6:46 AM
oh, then you should have put a smiley face at the end
 
Wes
how can you deal with that? you just don't. what can you do
 
ignorance, I'm totally ignorant of his behaviour because I never read anything with his name on it ...
who knew that ignorance is actually a tool we can use to get through the day ...
 
I have my first in-person PHP developer interview tomorrow and I'm low-key super nervous
 
oh so would I be, I hate interviews ...
 
:| I don't like interviews in general and I've never been to any interview for a tech related job so I have no idea what to expect
 
Wes
6:49 AM
@JoeWatkins lol
 
Anyone have any tips on apparel? My buddy is telling me to go in full suit but I'm sure it's a bit much
 
I turn into a total mess ... for example, I was once asked for a description of big O notation, an easy question I could write an article on (I wont, it would be boring), and I couldn't answer the question, I fumbled around with things like "I use this all the time", but I left without answering the question ...
if you do anything less stupid than that, you'll be okay ...
 
Ha, well he was interviewing me on the phone and I had woke up recently before he called
He asked me what payment gateway I used in a previous project and I froze for like 20 seconds saying "Uhhh I forget the name", somehow couldn't remember the name Stripe
I eventually said "Something like Sprite" and he said "Oh you mean Stripe?". He still wanted me to come in so I guess it wasn't that bad
 
it's not so bad ... you answered ...
 
Good point ^^
Did you end up getting the job?
 
6:54 AM
mornings
 
I stutter sometimes, under pressure, and if I become conscious of it, and try to suppress it, it's replaced with a lot of "urm" and "aaahm" ... the words I actually said when marrying my darling wife were "urm, I do" ...
8
 
\o
 
\o
 
this doesn't do well in interviews either ...
I got an offer yeah ...
 
"Urm, I do"
Was there still a honeymoon? :P
 
Wes
6:56 AM
lol :D
 
Well that makes me feel better, then
 
ha, there was ... she was already used to having to wait much longer than is reasonable for sentences to finish ...
 
I am sooo tired this morning, got to bed way too late
 
I woke up too early, half four in the morning ... no reason, just wide awake ...
 
I'm currently awake way too late :/
 
Wes
7:00 AM
@FélixGagnon-Grenier i'm going through my number formatter usages and it seems i never used it in a catastrophic manner
except that it might display the wrong result sometimes...
it is strange that casts to float
public string formatCurrency ( float $value , string $currency )
i mean, really?
 
Alright I am now going to get some sleep
Night PHP
 
Wes
\o gn
 
gn
 
7:30 AM
@JoeWatkins you and I are both the kind of people who would do much better at technical interviews if they were conducted in chat rooms. And tbf if you are looking for remote work where your main communication method is email and slack, that's probably a better test from the employer's perspective as well
I have been told that I have two modes irl, "this guy has no idea what he's doing" and "this guy is so condescending I want to punch him in the face"
 
Wes
apple is such a shit company
 
It's March, 14th. Don't forget to buy your steaks.
 
Oh :( Stephen Hawking died
3
 
yes
 
Wes
:(
 

« first day (2706 days earlier)      last day (2256 days later) »