« first day (4312 days earlier)      last day (621 days later) » 

3:56 AM
I need to figure out a way to remember what "marshall" means in a programming context, because my brain associates "marshall" as a gatekeeper.... and then thinks "something that has guard statements"
 
 
1 hour later…
5:03 AM
Oh, my, goodness. So I was about to write that I had literally never heard (or remembered) of the term marshall in a programming context when I had some nagging memory flying back out, in disbelief I searched my older answers and, sure enough, I've heard of the term marshal in programming exactly once in my life stackoverflow.com/q/29012513/576767
I distinctly remember not having a clue what a beforeMarshal function could even do.
 
 
7 hours later…
12:07 PM
str_starts_with vs strncmp which is faster?
 
Does it actually matter to you? (Is this a bottleneck in your code?) This is highly likely to be a micro-optimization and not worth your time considering - use whichever makes your code easiest to read.
If you need to know, benchmark it with realistic test cases for what your code is doing / the values your code is working with.
 
12:49 PM
Yeah you're right, This is the benchmark result (10000 iteration):
star_starts_with: 0.00026106834411621
strncmp 0.00069499015808105
 
 
1 hour later…
2:09 PM
@Tiffany How about looking at lots of pictures of marshalling yards? cc @FélixAdriyelGagnon-Grenier
Or marshal the troops.....
 
2:27 PM
Or maybe this one youtube.com/watch?v=D4hAVemuQXY (because Mathers)
 
M&M is a naming problem.
 
2:51 PM
Hey guys .. is there any specific term/word for pointing to languages that are not buildable (for execution)? For example, PHP is not buildable, but GOLANG is. Is there any English term for that?
 
interpreted
 
oh, the rest that are buildable will be called as "compiled"? (like, golang, react, python etc ..)
 
When something is compiled it usually means the source code is converted directly into machine code. A build step isn't necessarily a compile step.
 
ah .. I see
 
3:33 PM
Does anybody know how to broadcast a message in amphp/socket?
send() requires a socketaddress. Is there some broadcast method?
I feel like every time I am working with socket I have the exact same issue :D
 
/cc @Trowski ^
 
Also probably @bwoebi?
Are you guys still on swoole or moved to amp @MarkR
 
@PeeHaa amp, we took it to batshit insane levels
 
Does trowski still work on amp besides what you guys are working on internally?
 
Yes he does
 
3:42 PM
@MarkR I would love to see some of that. I like both batshit insane and async php :D
 
@MarkR I'd like to hear more
@PeeHaa what do you even mean with broadcasting? sending something to 255.255.255.255?
 
@bwoebi Yep
 
We (mostly Trowski) built out a auto-scaling multi-process setup based on the socket transfer code. One process acts as a font end that inspects the first part of socket request, then automatically spawns additional processes and then transfers the socket to them, kinda like a websocket based FPM
 
I am trying to run a discovery on my network
 
@PeeHaa why are you even using amphp/socket for that instead of just using socket_sendto()?
 
3:45 PM
We also wrote our own little C extension that clones the PHP JSON ext but allows the encoded output of an object to be cached that gave us a 6x performance boost when re-encoding the same object over and over to send out
 
@bwoebi Everything else in the app would be based on amp
@MarkR hash based cache?
Or actually the same (identity wise) object
 
@PeeHaa Tied to the object.
 
@PeeHaa yes, but … broadcasting is stateless and non-blocking (unless you fill the OS buffer, … I assume you don't need to send that much data)
 
@MarkR cool
 
like … it's just unnecessary to involve amp here and just do a classical "blocking" call
 
3:47 PM
@bwoebi No, it's just a 8 byte message
 
yeah then just send it directly with the low-level php functions
 
We extend the cachable objects from a class we defined within the extension, it contains a property for storing the last string. It turns out that when you're sending a million messages per second, ext json re-encoding every key, every string etc every time was a huge performance drain
 
@bwoebi kk
 
I think we also bumped the amount of initial memory to reduce buffer re-allocations
 
It's been so long I worked with raw sockets that I only now get to use \Socket :O
Thanks @Girgias?
 
3:51 PM
So in semi exciting news, I just ordered a herman miller embody >.> like, dayum
 
I have no idea what that means, but I am happy for you :D
 
Wait. Is it a chair?
I feel like at some point I will also need a chair that is not a ikea stool :D
 
I've used a couple of Ikea Markus's .. markusus..? but anyway, they're comfortable enough but they both broke and the support isn't as good as it could be
 
I pretty much reached the age that I have to go to a personal trainer multiple times a week just to fix my back so I better chair is not the worst I could get :P
 
4:03 PM
At 36 i'm just hoping my body doesn't completely fail me before the 12 year warranty on this thing is done
 
For the record, I regret not buying a powered height adjustable desk ten years ago....being able to switch to standing for just 10 minutes at a time, is a very nice way of breaking up having my back held in a single position.
/also, I hum the james bond sting music as it's going up or down.
 
We have been looking at standing desks too
I don't see myself use it though
Being stubborn and all :P
FWIW that ^ attitude is exactly the reason I need to hire a person to fix my situation :D
 
4:25 PM
I've had a sit stand desk for about 8 years at this point, I stopped using it for standing many years back, partly because ive got so much mounted over it that doesn't move with it, but also because ... well, sitting is more comfortable
 
@PeeHaa needs exactly 7 upvotes to get the absolute nicest amount of reputation in that order of magnitude
 
@FélixAdriyelGagnon-Grenier needs some downvotes now....
can you set a bounty for 206 points?
 
i think the maximum is 500 but i've never ever seen non-increment-of-50 bounties i think
maybe 25 also
 
@MarkR I was looking at that one too. I need to get a new chair. The one I have is 14 years old and is about done.
 
4:41 PM
unsollicited advice for chair buyers: the option you need for it to be comfortable will be the only one you won't choose (I am not coping badly for my own mistakes)
 
@PeeHaa Get that sorted? You should be able to use 255.255.255.255 as the address to send()
 
I don't use the stand feature of my desk as much as I should, but it is nice to have it available. I still use it from time to time when my legs decide they don't want to sit anymore.
I'd recommend it, but the prices went insane… at this point one might be better off buying one of the manual crank ones from Home Depot.
I have this in my basement. Could certainly be a computer desk. Comes with feet as well if wheels are an issue.
 
so i put github.audio on and it's unironically calming
not sure how long I'll find it nice but it's passed the first few minutes challenge
 
@Trowski I can't access that....but the prices seem reasonable now. And 3 stage legs have a much higher range of movement than other desks, many of which have a minimum height too high for about 50% of the population.
 
4:56 PM
Hi, guys. On a site that uses SSL, I set up a proxy for a custom URI, and the target for the URI is an IP. For example

https://site.com/u
ProxyPass /u http://11.222.33.44/

I managed to make this work, but I'm having an issue with the SSL. All the (asset) requests to the IP (in the browser) are made with https and return ERR_CERT_AUTHORITY_INVALID. How do I fix this? Copy the domain certificate to the IP server? Get a new certificate for the IP server? Unfortunately, I have no prior experience with setting a proxy, so I'm a little lost
 
@Danack That's very cheap. I bought one of the real wood topped lander desks from imovr.com. It's beautiful, but was $1800 when I bought it, now they're asking nearly $4000.
 
@akinuri You quite likely want to have your SSL termination done at the 'edge' of where you are hosting your stuff, and then pass non-SSL requests internally. Exactly how you would do that is dependent on your hosting + what servers you have.
@Trowski prevarication ftw. Well.......winning the lottery ftw. I now remember why I didn't buy one ten years ago.
 
@Danack I think you took that the wrong way. I meant it as nice find for a good price.
 
55 mins ago, by Danack
For the record, I regret not buying a powered height adjustable desk ten years ago....being able to switch to standing for just 10 minutes at a time, is a very nice way of breaking up having my back held in a single position.
I meant I remembered what prevented me from buying one before.
Also....not sure they were actually a thing that existed ten years ago.
 
@Danack Ah, I missed that from before. I think they were, but not nearly as popular. My assumption is the work from home movement has increased demand.
Thus prices went up considerably. Not to mention inflation and all that.
 
5:08 PM
@Danack Silly me. On second examination, I realized that I forgot to change the base URI (from IP to domain) in the custom app. It seems to be working now :)
 
@PeeHaa That's not me :p
 
 
1 hour later…
6:26 PM
> Linked images in svg files using xlink:href both http and local are not shown after ....
TIL people are allowing ImageMagick to download files from the internet and then do its stuff.
 
that sounds safe
 
Doesn't it just?
I mean, it's not like ImageMagick has a history of horrible security holes for that type of thing.
 
Maybe you should add a required php ini option imagick.i_too_like_to_live_dangerously=1 and disable all its functions if not
 
@MarkR that option already exists.
I possibly should go for a walk, away from computers.
 
6:41 PM
I was considering likewise, my mission for this weekend is to not do any work-work
 
7:27 PM
How do you guys feel about the public private(set) syntax? For people who want more of an accessor syntax: The alternative is public $foo { get; private raw; }. The reason it needs to be raw and not set is because set disallows references completely which is not something you'd expect from just asymmetric visibility.
The reason references are disallowed is because it circumvents the set implementation. C# also disallows ref but that keyword is seldomly used there. raw would essentially be a way to say "just don't use accessors at all in this scope".
And yes, it was so obvious there's syntax bike-shedding the second the RFC is proposed. There's not been a single other interesting comment.
 
@IluTov Can you explain a bit more please. I don't follow the significance of "raw" vs "set" as neither currently have any context in a feature that doesn't yet exist
ah you already did
 
@MarkR Sure. We want the syntax to be compatible with accessors. People propose using the public $foo { get; private set; } syntax like C# does. However, C# disallows the ref keyword for properties, which means the property can't be passed to functions by reference. Analogous example in PHP would be sort($this->foos);.
The reason is that modifying the value by-reference doesn't trigger the setter of the accessor. However, that's the exact purpose of accessors, to observe all changes made to the property. Disallowing references also means something as simple as $this->foos[] = 'foo'; will not work. This is almost certainly not what people expect. Nikitas RFC allowed doing &get; which makes the generated accessor return by-ref.
However, this also means that you can obtain the reference from outside the class and just circumvent the call to set there. E.g. sort($this->foos); would not trigger the setter. So, instead what I'm thinking of doing is having a get accessor that is publicly accessible and returns by-val, and completely circumventing accessors all together from inside the class, so you can do all those things like $this->foos[] = 'foo'; and sort($this->foos);.
 
Ah, those examples are most helpful.
 
7:42 PM
But yeah the reason we opted against this at first is that it took a while to explain how it works to Larry, and so it's probably not intuitive for other people either.
 
The sort one is interesting, for direct access I would expect this->foos[] = 'foo' to be the same as a read of the whole array, followed by setting a copy of the whole array + the new element. I'd also expect it to be a big performance hit
So would an error occur if you did $foo->bar[] = 'fum' if bar had a getter?
 
@MarkR Yeah, I proposed that before but Nikita shot it down immediately due to unexpected performance implications. I then thought about different kind of accessors that would be invoked when an array is modified but came to the conclusion that it doesn't make sense as there are too many ways to modify an array and no good generic way for that to be handled in a setter by a user.
@MarkR Yes, an error would occur from outside the class (Something along the lines of "Indirect modification is not allowed").
The single inconvenience here I can think of is that if you were to upgrade this to an explicit accessor private $_foo; public $foo { get { return $foo; } set { $this->_foo = $value; } } you will have to update all internal usages of the property that modify the property indirectly. So a sort call would have to go through the backing property $_foo instead of the accessor property $foo (as once again indirect modification would be disallowed even inside the class).
(But that is not exclusive to this syntax, the same goes for public private(set) $foo;)
 
7:57 PM
I take it these will be able to use arrows too e.g. public $foo { get => $this->_foo; set $x => $this->_foo = $x; }
 
We planned on it yes, but that part is not implemented yet. Neither is the raw actually. The rest is more or less feature complete but we decided to try just asymmetric visibility first.
 
I get the quandary, if this were an internal project, i'd make the mechanism for accessing the backing property as simple as possible e.g. private int $_foo as $foo { public get; private set; } and then say screw it to dealing with references at all through accessors.
 
New word of the day: Quandary :)
 
 
1 hour later…
9:13 PM
With regards to the reflection, I am a bit unsure about the design. Depending on the power of these functions it may be more futureproof to to expose them more like ReflectionMethods.
 
@Danack marshalling yards may be the way for my brain to re-associate it. "marshalling the troops" still makes me think guard statements.
 
 
1 hour later…
10:21 PM
@Tiffany actually, maybe "marshalling his forces" is possibly a bit more common than "marshalling his troops". But, yeah, there is possibly a chance I've read more W40k/European history than is 'normal'.
@IluTov fyi the second 'a' is mostly silent, except if you're a lawyer. Mostly because people are lazy.
 
10:59 PM
@MarkR Accessors? Note that the current asymmetric visibility RFC doesn't actually involve any accessors. The get/raw syntax would though.
 
ah right, i re-read your message and see you mentioned if it was upgraded
 
@Danack Good to know. Although that word looks too complicated and rare to actually have a chance of sticking around in my brain :)
@MarkR It was a wall of text so it's unsurprising stuff is missed when reading it ^^
 

« first day (4312 days earlier)      last day (621 days later) »