« first day (2110 days earlier)      last day (2821 days later) » 

12:39 AM
> $p->addFruit("strawberry");
shouldn't this be $cook->craftPie($dough, $fruit) or something?
I've rarely seen a pie with a addFruit button / method on it
 
Wes
you are right
 
Oh, yay, examples without real world context :-(
 
oh, I already did
 
Wes
12:55 AM
interface LazyCopiable or LazilyCopiable? :B
 
ForLazyProgrammers is what I read
@bwoebi yay :)
 
Wes
you are never useful felix :B
 
that's my trademark :)
 
Wes
:B
til it's not even copiable, it's copy-able with the hyphen
damn u english
 
heh
!!should I do my due work or play dawn of discovery
 
1:11 AM
You should play dawn of discovery.
 
damnit
if I get fired I blame it on you @Jeeves
 
@FélixGagnon-Grenier Why do you ask him then? ;o)
 
heh. it was supposed to answer that I should work :p
But I've had like three full hours of productive work already. that seems like a day
 
Wes
welp. afayk are there formal-ish names for the "dependent" and "dependee" objects in a copy on write mechanism?, like base/child?
 
1:26 AM
according to the number of highly starred messages on this board, I'd say @Fabor wants to sleep with @tereško's ban
 
@Wes you mean the original value and the copy?
 
Wes
yes, the object that is to be lazy-copied and object that holds a reference to that object
 
@Wes there is nothing like "object to be lazy-copied" there's only object with refcount 1 or greater than 1
 
Wes
why you assume i'm talking of php internals? :D programmers... :P
 
@Wes that's how CoW works in general
not just in php-src
 
Wes
1:40 AM
i did it differently. and probably there was a simpler way to do it...
 
@Wes show me it.
 
Wes
i need some time to tidy the code a bit, so tomorrow i will
or i can explain to you how it works now
 
@Wes just C&P into a gist, I'm not afraid of anyones crappy code.
I've seen enough crappy code in my life so that your untidied code in comparison probably looks like the godly salvation
 
Wes
lol
just gimme some mins
basically i have an implementation A (a single object or an aggregate of objects) that calls internally $this->performDependentsActualFork(); before it changes, so that "dependents" get a new copy with the old state
and each of these dependents will actually copy itself (calling emancipate() internally) when it is about to be modified
the $key is just a random string that is used for validating the communication between the original and the "lazy copies", ie so that one can't break a lazy copy by sending it a wrong new base
it works, tho :B it's not very complicated but probably more complicated than it could be..
hey paul \o
 
1:57 AM
heyo!
 
@Wes woops, busy replying on meta
 
Wes
no probs :D
 
@PaulCrovella oh hai
 
@FélixGagnon-Grenier sup sucka
 
fresh indeed
long time no see. where'you been
 
2:13 AM
busy
 
Hello guys, I have this array and I want it to be sorted by
Highest Score and then time.

```
array:7 [▼
  0 => array:8 [▼
    "id" => "33"
    "user_id" => "1"
    "body" => "123"
    "weight" => "1503"
    "time" => "1000"
    "created_at" => "2016-07-29 23:22:30"
    "updated_at" => "2016-07-23 23:22:30"
    "score" => 1503000000
  ]
  1 => array:8 [▼
    "id" => "34"
    "user_id" => "1"
    "body" => "123"
    "weight" => "1500"
    "time" => "1000"
    "created_at" => "2018-07-28 23:22:30"
 
172
Q: How can I sort arrays and data in PHP?

deceze Due to the enormous and ever repeating amount of "How do I sort my unique snowflake of an array?" questions, this is a reference collection of basic sorting methods in PHP. Please close any question which does not markedly differ as a duplicate of this one. How do I sort an array in PHP? How...

 
@Wes $this->dependents->count(), well that's your refcount… But you do some weird sort of CoW where you explicitly track the referencers...
normally you don't track referencers, but referencers check the refcount themselves and then create themselves a copy before executing a state-changing action.
(referencers === dependents)
 
Wes
2:42 AM
but how you do that... type safely?
and without breaking the encapsulation...? i mean there must be an observer, somewhere
 
3:03 AM
@Wes encapsulation is a tool. Use it where appropriate. Trying to perfectly encapsulate everything is hindering. Perhaps have a two-tiered approach. One level of objects which in turn reference the other refcounted object. and separate when refcount > 1 on state-changing ops.
 
Wes
i thought of that... but ended up doing this instead. is my approach that bad? i was also thinking to weakref the "dependents" so that the map doesn't hold the references forever
 
3:59 AM
@eXtreme ping me when you're available
@Wes well, your encapsulation is bad in a way, yes (please ping with reply, I don't have the chat open all the time…) You leak a ->set() method on the referencers which is for internal use.
Also, cyclic dependencies...
 
Wes
well, the dependents can't break the original instance, if they are badly programmed it's not my fault. what do you meanwith cyclic dependencies?
and i don't ping people during night, maybe they are sleeping :D
@bwoebi
 
Gon
You did ^
 
You can ping people whenever you want, if it's something specific (not just randomly). It's up to them to handle their notifications.
 
@Wes I'm only awake for about 6 hours… Also I never have sound on.
 
@bwoebi: I have something I can use finally :D github.com/markzz/php-alpm/releases/tag/0.1
Thanks for dealing with my crap for the last month or so.
 
4:09 AM
@Wes referenced objects hold a reference to referencers which hold a reference to the referenced object
 
is there any way to return the html of DOMDocument->doctype? Having a look through the docs and I can't find anything helpful.
 
Wes
@Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon @Gon
 
@MarkWeiman Nice :-)
 
Wes
@joshhunt $domdocument->saveHTML($domdocument->doctype) ?
 
Gon
@Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @Wes @@Wes
burn.gif
 
4:12 AM
when is night anyway?
 
Night is when work gets done.
 
Gon
Typing in a phone is such a pita
 
@FélixGagnon-Grenier In about an hour, I think. I don't see the sun, but who needs it?
 
@Wes doesn't seem to work. Though now I'm wondering if DOMDocument doesn't automatically set ->doctype from the html.
 
Wes
what are trying to do?
 
4:14 AM
get the original doctype from my html
 
Wes
normally you don't care of the doctype
but why?
 
we sure don't need the sun to work \o/
 
so that it doesn't change the doctype that the user sets
 
Wes
hum?
 
essentially:
1. User inputs html
2. We modify html
3. We output html
Ideally I want the html to change as little as possible
 
4:18 AM
why?
 
oh and I'm using $document->saveHTML($document->getElementsByTagName('html')->item(0)); instead of $document->saveHTML() to preserve utf-8
 
Wes
again if you load html into libxml you will have bad times. only use xml. in fact if you load html5 into libxml you almost for sure will end up with broken markup
 
why do I want it to change the html as little as possible? I guess so that the user has all the control.
 
Wes
i often wonder what was so wrong with xml that they had to make that crap that is html5
really, forget to use libxml with html these days, only use it with xml
 
Ideally yes, unfortunately I don't have much choice at the moment. Its a pull request for a third party plugin and I would have to rewrite the whole thing.
I also haven't noticed any issues so far, do you know of any common problems?
 
Wes
4:23 AM
@joshhunt check this github.com/Masterminds/html5-php ?
basically all new tags have problems
 
Looks nice, I'll suggest it to the maintainers
oh its for email html so sadly that isn't a problem
 
html email is the goddamn devil
 
I agree. Most frustrating thing ever.
And doesn't seem to be improving.
anyways any idea if there is any way to convert DOMDocument->doctype back to html or do I have to do it manually? Looking at the docs there doesn't seem to be a way but I was hoping that I was missing something. Tested and it does seem to generate it from the original html
maybe I remove the html element, use saveHtml(), and then prepend that to $document->saveHTML($document->getElementsByTagName('html')->item(0))? I'll test and see if it works. Seems silly that you can't just save the doctype directly but oh well
 
4:51 AM
need a clue for what this log says.
```
==> app-root/logs/haproxy.log <==
[WARNING] 206/233226 (372694) : Server express/local-gear is UP, reason: Layer7 check passed, code: 302, info: "HTTP status check returned code <3C>302<3E>", check duration: 49ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
```
 
Wes
@joshhunt echo
    "<!DOCTYPE " .
    $dom->doctype->name .
    ' PUBLIC "' . $dom->doctype->publicId . '"' .
    ' "' . $dom->doctype->systemId . '">';
 
@mCorr I'd start by googling something like http status code 302
 
@FélixGagnon-Grenier thanks. :)
 
posted on July 26, 2016

New Cyanide and Happiness Comic

3
 
5:10 AM
this seems a bit quick to the topic stackoverflow.com/documentation/php/1053/…
I'd add some kind of better introduction of dependency managing, not sure if really needed.
 
5:31 AM
@FélixGagnon-Grenier I can't tell… need to compare before and after to see whether it will improve it
 
New Topic Requests in PHP: ES5 and htaccess rules… wtf
 
5:49 AM
Need another clue:
Nginx
When I started the nginx, it triggers a request to "/".
what executes the check? is it haproxy?

[WARNING] 206/233226 (372694) : Server express/local-gear is UP, reason: Layer7 check passed, code: 302, info: "HTTP status check returned code <3C>302<3E>", check duration: 49ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.

thanks :)
 
Software Engineer, Front End at Google (@lifeatgoogle) [New York, NY] http://stackoverflow.com/jobs/121608/software-engineer-front-end-google #javascript
I am always confused when I see job ads from Google. I'd assume they don't need any because they got way more applicants than they can hire anyway
 
I mostly reordered stuff, removed fluff, corrected the composer commands, and totally forgot to put this in the edit summary
 
@FélixGagnon-Grenier retracted?
 
@FélixGagnon-Grenier nobody calls his functions file simpleFunctions.php. It's always src/functions.php :-D
 
6:02 AM
yeah... just so nobody gets tempted to throw a class in there
but yeah, it should be functions
 
but my class is called Functions!!!
:-D
@FélixGagnon-Grenier It's a great edit… but I absolutely needed to find something to complain about, hehe
 
hehe, just a sec, the ui is getting full retard on me, I'll soon have functions
 
@FélixGagnon-Grenier yeh, done and thanks :-)
 
was a pleasure \o/
I don't understand how creating topics works. I mean, there are 27 upvotes for asynchronous programming, does it really takes a badge to click on create topic?
 
6:18 AM
@FélixGagnon-Grenier How do you mean takes a badge?
 
I mean, why didn't one of the 28 voters click on create topic?
 
@FélixGagnon-Grenier perhaps because they either have not enough knowledge (i.e. they'd like to learn from it) or not finding time or the pleasure to write it?
 
right. so actually clicking the button would ask me to propose sontent, not only create a new empty topic
 
yes
what'd be the point of an empty topic after all?
 
I hear you ;)
 
6:23 AM
morning
 
@FélixGagnon-Grenier I'm myself a bit too reluctant to create the topic, but I'm happy to improve once something substantial is there…
 
6:39 AM
!!is today Tuesday
 
God, yes!
 
@AnmolRaghuvanshiVersion2.0 I love you too :-)
 
!!rebecca
 
@Epodax Only 2 days, 17 hours and 18 minutes left until Rebeccaday, OMG!
 
6:43 AM
Good morning you lovely people
 
Friday is gonna be a good day, it can only come too slow :D
 
@Wes nope, in WeakReference we call notifiers after original dtor. I'm working on SoftReference where we will be able to have notifiers called befor original dtor and if refcount in notifiers changed, we do not call original dtor and same soft notifiers may be called again.
 
7:07 AM
o/
 
@pinepain is there any reason why you call them only after dtor?
i.e. is there any reason why you'd want to use WeakRef if there's SoftRef?
 
@bwoebi for me WeakRef is useful when I have key=>value map of objects and don't want to tie value object to key object.
basically, in my case it doesn't matter whether it will be called before original dtor of after, though, when we invoke notifiers mechanism before original dtor, we can check whether object refcount was incremented and prevent original dtor to be called
so we kinda prevent object from being false-destructed and later same dtor mechanism can be invoked again
it stay a bit on the edge of elegance and suicidal bloody mess, but it works and sometimes useful
 
Hmm, are there any specification pattern based DSLs for implementing password policies in php?
I only found one not so good (because eval) library so far
 
moin
 
ohai
 
7:19 AM
/me waves
 
o/
 
7:34 AM
@JoeWatkins /me waves back
 
moin bob
 
not worse than usual, yourself ?
 
@JoeWatkins I should learn, wasting time instead :-(
 
Morning @JoeWatkins :)
 
7:46 AM
you shouldn't feel bad ... if there is a purpose to life, it is wasting time ...
moin rudi
 
Anonymous
And your wasting of time has massivley improved the state of SO php docs, so not so bad
 
do we like the new documentation feature then ?
 
Anonymous
I personally don't
 
I've only come across a few bits so far, guess content quality will improve, but the worry is that it won't because nobody cares about the content enough to improve it, because nobody asked the question in the first place ...
but I guess it was tested before we saw it, and was judged to have a positive impact, somehow
 
Anonymous
I think in some languages, it can definitely have a positive impact. But I don't think PHP needs it
 
7:50 AM
you can't very well document how to program with php in the php manual, I can see a corner for it ...
 
@JoeWatkins no, we hate it and want it to die
 
Please help me in laravel fw
http://stackoverflow.com/questions/38581645/laravel-5-sqlstate42s02-base-table-or-view-not-found
 
hate is a strong word
if you'd come on SO in the first month it was running, it would have been worse than useless, I think we can't judge it for a year or so ...
doctors appointment, catch you lata peepz
 
Anonymous
Once rep whores stop trying to submit/edit unnecessary stuff and it becomes more regulated, it has a chance of being helpful. But I still don't think it should repeat anything that's already on php manual.
 
Anonymous
laters
 
7:56 AM
o/
 
@JoeWatkins the SO docs system isn't about "how to program with PHP" either; it's just a collection of examples, by design.
P.S. Good monrigngigns
 
hmm, maybe stupid question, but do you only run make itself with -j or also make test?
because they take an eternity to run
like ten minutes
 
\o/
@Gordon pretty sure tests cannot run concurrently
 
@salathe it's somewhat a bit trying to achieve this goal via the collect of examples.
 
Morning
 
8:03 AM
@Sjon a pity :/
 
@bwoebi Haha, sure trying. You can't teach someone to program by throwing code in their face. :P
 
@salathe it is not a tutorial. It's for someone who already achieved a tutorial in some language.
tutorials are another beast.
 
I know, I'm only referring to Joe's original comment.
 
@Gordon yeah, I noticed the integrated Jenkins @ github is also terribly slow. Takes ~ 15 minutes to complete
 
@Gordon fyi you can run a subset of the tests by invoking run-tests.php manually and passing a path to a phpt file (for a single test) or a directory (which it will walk and run every phpt it finds in the tree)
So if you are only working on an ext, you only need to run the tests for that ext - in theory, anyway
 
Wes
8:16 AM
@bwoebi i can't do it :( can you show me few lines?
also mornings all
 
@Wes what? CoW?
 
Wes
yep
anything i'm thinking sucks... i'm probably missing something
 
@DaveRandom thanks
 
8:34 AM
Tuesday meh
 
@Gordon Also I've looked into the concurrency thing before and some tests depend on others (e.g. github.com/php/php-src/tree/master/ext/pgsql/tests the first one creates the db that the rest of the tests use). There's currently no way to express that dependent relationship other than 000_test_1.phpt -> 001_test_2.php, hence there's no way to run them concurrently and guarantee that the concurrency itself won't cause a failure.
 
@DaveRandom ok, I'll just dont run the tests then while I am still hacking around. thanks again
 
@Gordon Remember we were talking about sharing credentials on scaling services? Not a long talk.
 
It's possible that a limitation could be introduced that dependent tests must be in the same directory at the same level, then you could spawn multiple processes and run them concurrently - whatever happens you'd need to rewrite run-tests.php itself to do it (make test just invokes this)
 
Anyoo. Service vaultproject.io
 
8:38 AM
@Gordon generally what I have done is create some tests for the behaviour I'm trying to work with, then when all those are passing you run the whole test suite and you see that you didn't break anything because you are super-awesome and then you git commit -am "I RULE!!!!" && git push -f and then turn off your computer an phone and disappear for a week.
seriously though: be prepared to alter existing tests, a lot of existing tests are just testing that broken behaviour is still broken
 
@Fabor yes
@Fabor that's ansible vault. I suggested that ;)
 
Oh sorry. My eyes failed me :(
 
@bwoebi ping @ telegram
 
@DaveRandom my current issue is not really breaking tests, but rather that it takes so damn long to debug my CI pipeline due to make test taking so long. the tests will never break because I am not touching the php. I am changing some shell scripts only, but then I run them and they have make test in them
 
Add a --no-tests option to the scripts then, and pass that in your CI script
no point in testing the tests, ever really
yo dawg...
 
8:46 AM
@kelunik This system was automatically rebooted after panic … laptop crashed … minute…
 
*"You can make it idiot proof, but you can't make it c**t proof."*
 
I object to that tweet
 
@Gordon why?
And yes, we need an !!untweet or sth
 
8:49 AM
I can't make it cuut proof?
 
cart
 
cost?
 
cost.
 
because cunt is as much a valid cussword as gay. the former is misogynistic, the latter homophobic imo
 
8:50 AM
@Gordon I'm not sure about that tbh (see also: dick)
 
@DaveRandom fair, I might be too pc in that regard
 
but I'm not going to argue about what offends you because this is not <everywhere else on the internet>
@PeeHaa is the only one with the power to delete atm because it needs someone to actually log in
 
I didn't even know twitter lets you delete tweets.
 
@Gordon It's definitely considered a strong obscenity
Like, you will pretty much never hear it on TV
Probably very few in the transcript as well
 
8:55 AM
@DaveRandom 847 messages found
 
@Gordon compare that to the number of any other cuss, though
I have >60K fucks and >80K shits
 
You give a lot of shits then.
 
@DaveRandom 462 of these in the Lounge… surprise…NOT
 
@Fabor you mean he's given.
 
we have only 35
and one of those was @Jeeves
 
8:57 AM
heh, yes @bwoebi :P
 
Good mornings!
 
Made a really nice coffee, that's made Tuesday a little better.
 
They should rename the Lounge to Lounge<profanity>: fuck 35643, shit 32047. My guess is they own 50% of all profanity
 
I'm sure this is me just being a noob, but how do I convert the array the regex returns to a string?
SELECT
  uid,
  regexp_matches(body, '.*someregex.*', 'ig') AS regex,
  body
FROM article
 
oh, danack is using prism
 
#Prisma #PokemonGo
 
Prism has so much better quality than neural-style. I wonder how they do it
 
@DaveRandom Just a little tiny bit arrogant.
Not more.
 
In optics, a prism is a transparent optical element with flat, polished surfaces that refract light. At least two of the flat surfaces must have an angle between them. The exact angles between the surfaces depend on the application. The traditional geometrical shape is that of a triangular prism with a triangular base and rectangular sides, and in colloquial use "prism" usually refers to this type. Some types of optical prism are not in fact in the shape of geometric prisms. Prisms can be made from any material that is transparent to the wavelengths for which they are designed. Typical materials...
 
@Danack what so you mean by "convert to a string"?
Don't you just want one element or... what do you want?
 
Anonymous
9:03 AM
@DaveRandom I don't even think he was banned
 
I imagine it was
 
@SagarNaliyapara ah sorry.it's called Prisma, not Prism: play.google.com/store/apps/details?id=com.neuralprisma
 
@Gordon i know it but you wrote prism two times so i get confused :D
 
@DaveRandom it appears to only be returning one element, and I want to use that element as part of a sub-query.
 
9:08 AM
@Danack well you can just array_to_string(regexp_matches(body, '.*someregex.*', 'ig'), '') but that looks like a truly awful thing to be doing...
 
Is using Auryn to inject service objects into my controller a good idea?
 
@Sean yes.
Or rather, get Auryn to invoke your controller directly...
 
Yeah, that'll be the plan
Cool, cheers.
 
@DaveRandom I get an error message saying function array_to_string(text[]) does not exist
 
9:11 AM
wat
 
Gon
o/
 
@Danack You're missing the second argument
 
ahh
 
@Danack you can also do (regexp_matches(....))[1] if you just want the first match (and know there's a match)
 
I was literally just firing up pgadmin to see if that was legal :-P
However I assume that in this context it's not guaranteed there's a match
 
9:14 AM
Yeah you need the wrapping parentheses, but it's legal... IIRC
 
@salathe ta.
 
Gon
ohai o/
 
Is it not a bit wasteful for Auryn to inject services which might not be used in a controller route? I can't imagine it happening often though
 
9:25 AM
@Gon Why !?
 
Gon
elaborate?
 
The tone's a little too excited.
 
@Sean why do you have services that might not be used in a controller route?
(i know the answer - which is why I wrote github.com/danack/tier and need to spend more time promoting it.)
 
A water bottle that glows and syncs how much you drink with an app. I am losing faith in humanity… but I want one because it glows
 
@Gordon I've actually wanted something like this, but then I think - I just need to drink more water with willpower
 
9:34 AM
> $55
 
Gon
o/
 
@Danack Well, it's a controller setup which has multiple methods, one per route. I can quite easily say that not all of those methods will use all services provided on instantiation of the controller, though maybe that might have more to do with refactoring
 
2l a day minimum. More when you arrive in Spain @Jimbo
 
@SergeyTelshevsky how's the new office space ?
 
9:35 AM
@tereško I don't know how it can be any worse
 
@Jimbo do we really, like really really really, need that? On my list of superfluous gadgets this one must be in the top 5
 
honestly.
glad it's only temporarily
 
that bad?
 
@Fabor I have... 2 glasses max a day
 
@Jimbo wtf?
 
9:36 AM
I have a few cups of tea as well
 
I would not put buzzfeed as a main endorser, LOL.
 
:-)
 
Just always keep some water near by. Sip generally, once you routinely drink more than 2l it feels like a necessity.
 
@Fabor I feel like I drink about a 1.7l per day…
 
9:38 AM
is it possible to get the ip of the user using php even if the user have a vpn software?
 
@bwoebi That's quite specific.
 
@tereško yes, it's just a big room with a freaking amount of people, I don't like anything here, actually
 
@Fabor I can't tell whether it's more 1.77 or 1.67 :-P
but about 1.7
 
heh. Well that;s a good amount I suppose. Not like we lead active lifestyles.
 
Anonymous
4l a day and I do fuck all
 
9:40 AM
...
 
I drink at least 2l a day at work
 
10l beat me
 
@SergeyTelshevsky I suspect it might be even more disheartening for our team, since we have lived past month+ with a domed ceiling and balcony
 
@littlepootis i am not joking ^^
 
9:43 AM
I am not joking either
 
@tereško yeah.. now we don't have any balcony at all :/ smokers gotta go on the street
 
I weigh 377lbs, I don't really have a choice.
 
@SergeyTelshevsky what with that "temporary" thing?
 
Gon
@littlepootis really?
 
9:45 AM
@Gon yes
 
Gon
...
 
@tereško this is an office for rent while they're preparing their building, to which we will move around february
 
@littlepootis you used to be underweight?
 
@SergeyTelshevsky that's 6 months
 
@SergeyTelshevsky just like a tramp might ...
 
9:47 AM
@tereško yep..
@JoeWatkins well, it wouldn't be that bad if the street would be at least a bit further from the city center
 
how on earth do you people know how much water you are drinking ?
 
@SergeyTelshevsky right .. the "10m from doorway" laws
 
@JoeWatkins Do you happen to have access to sec bugs on bugs.php.net?
 
@JoeWatkins … by not drinking tap water. But when you drink about one bottle of 1.5l and 1-2 additional glasses a day, then you know.
 
@NikiC I don't actually, I'm on the list, but I've gone to check on bugs again and can't read private ones ... who fixes that ?
 
9:50 AM
@SergeyTelshevsky at least there are more local dining options .. or should be
 
@JoeWatkins not even sure
probably someone who has svnroot karma
 
I don't have karma for bugs either
 
I thought you had svnroot, but seems you don't
well, then ask someone with bugs karma to add you there
 
karma is a mess
 
9:54 AM
it's fine. It's just a mess when someone in need doesn't have certain karma…
 
I have bugs karma, but I'm not sure I'm supposed to add people there
 
it took davey several weeks to get the right karma to do releases, which wouldn't be so bad, but, he still can't upload tarballs because he doesn't have permission ...
it seems like, it doesn't really work that well ...
 

« first day (2110 days earlier)      last day (2821 days later) »