« first day (4727 days earlier)      last day (479 days later) » 

10:08
Morning
@bwoebi How would an observer help to detect whether the generator has been freed?
10:51
@Derick The generator will never be freed within its observer end. To trivially distinguish whether the generator has ended - check the retval pointer (the return_value arg of the observer) to being not equal to &generator->value.
11:22
cheers, will give that a go
observers don't work for internal methods yet, do they?
12:02
@Derick they do
since 8.2
 
1 hour later…
13:09
apparent, I didn't have enough annoying heath problems and created a new one for myselt: dehydration.
my BP yesterday (just the top number) 170 lying, 145 sitting and 117 standing. not enough liquids in the body to maintain proper BP
@bwoebi Ah :-) I should really switch it all over instead of overriding execute_ex / execute_internal_ex
 
2 hours later…
15:14
should I put try/catch block around reading in a file? The file is a template that is static
15:41
@Jimbus It's usually a good idea, in case something funky happened when the file was written
15:52
I've never done it before, but it occurred to me, today, that maybe I should.
16:25
I found it particularly helpful for computer generated directories/filenames, like the results from a webscraper. We had some tools fail because there wasn't appropriate handling for filenames over the 256 character limit, try-catches were handy for the file_get_contents calls
Also, is there any good way to "compress" a relatively short string to reduce its character count, in a way that's reversible? Metaphone and Soundex allow you to somewhat do this, and you can sort of tell what the original text is, but it's not a good solution.
17:05
@SlamJammington huffman encoding
Or well, it reduces the bit count so you cant recognise it by hand
 
2 hours later…
19:16
I've run an amphp websocket server to manage an online fantasy hockey team draft this weekend, and I ran into er... Interesting Problems™ that I believe are related to sessions. I hacked some rather naive and dumb static property on the server itself and while it appeared to function locally with various tabs, it was rather broken when multiple people from the same wifi tried to connect. Interestingly, anyone outside of said lan had correct session info.

I think I see a way of improving that through manually passing a session cookie to websocket handshake, storing that to a db and pass it
I don't think I can rely on the client ids themselves, as I was not able to clearly understand what happened but I think when connections would drop and be remade, the same connection id would be given to another computer (which kinda makes sense), or some sort of similar shenanigan
19:58
gist.github.com/olleharstedt/228f6e4a5ccf3ee97b7ab3f83362873c - SplDoublyLinkedList compiles in both C and PHP
Need to write a proper blog post :d
I think I'm equal parts impressed and disgusted
What kind of exception does file_get_contents() throw?
It's also using two different types of memory strategies - one Boehm GC and one arena.
@Jimbus I believe only warnings, unless you have a NUL byte in the filename then you get a value error
20:08
The docs say its an E-WARNING, but that errors out
It's not uncommon to use an error handler that turns any E_* into an Exception.
Can you catch warning for logging purposes?
@nielsdos You can probably have fun with a userland stream wrapper.
@TimWolla :'( probably yeah
@Jimbus You want to read up about this: php.net/manual/en/function.set-error-handler.php
20:10
@Jimbus See set_error_handler
20:33
I'm not looking to create a custom error handler, I just want to throw an error and catch it:
try{
Some criteria
if fail throw exception
}catch ($e){
report error
exit
}
nm, I got it, I had a working example right below the on I copied and butchered
21:30
> A memory-polymorphic, polyglot implementation of SplDoublyLinkedList (as transpiled by Pholyglot 0.2-betachicken)

« first day (4727 days earlier)      last day (479 days later) »