« first day (2159 days earlier)      last day (2804 days later) » 

7:01 PM
@Charles Yeah, that APL is driving humans insane, as said…
 
@Andrea god damn it.
:-P
 
You came in to repair @Jeeves? :P
 
@Charles well you could write an adapter for the existing one to bring it in line with whatever interface you'd prefer, then never touch the funk again
 
That might be what I do. Or I might just end up looking at whatever websocket PHP thingamabobber I end up using wants me to use and do that instead.
RabbitMQ can apparently be a direct websocket provider but I really don't trust opening that up to the internet.
 
Noite o/
 
7:11 PM
@DaveRandom Update on Postgres for Amp: I have ext/pgsql and pecl/pq adaptors working, with support for unbuffered statements under pecl/pq using a basic shared interface between both adaptors, so code can be written to not care about whether results are buffered/unbuffered.
I'm not happy with my pool implementation though… so I need to work on that some more.
I want to mark connections as busy… but that's hard to do when there's a statement object that can make queries to a specific connection in the pool.
I certainly don't want to mark the connection as busy as long as the statement object exits, and I can mark it as busy when the statement is executed, but the connection may be busy at the moment the statement is executed (which is fine, just delays the result)
In the end I think that's just how it will have to be. Not really a problem, just means that pools won't necessarily distribute load evenly when reusing statements.
 
@Trowski this is something I was wondering about a lot, in fact it's the main reason I didn't even start to write one. The way I see it there are 2 sane behaviours and there should probably be a cfg option to define which one is used.
1) each connection has it's own lock request queue. before it is checked back in to the pool for general use, it clears that queue. (i.e. executing a statement waits for the owner connection)
2) a statement is not associated with a specific connection. Every time a statement is executed against a new connection, it is implicitly prepared for that connection.
And I suppose 3) which is basically 2) except that prepare does not resolve until the statement is prepared on every existent connection, and all statements are prepared when a new connection is created
@bwoebi how do you handle this in amp/mysql?
if you were to only do one of those options @Trowski, I would vote for option 2 probably
I suspect it would be worth having implementations of at least 1 and 2 though, as I suspect different applications would make sense for either
 
amp/mysql has a ready queue from which elements get unshifted and pushed back when ready again
 
I'm essentially doing 1 with my pool impl., but 2 seems like a lot of overhead…
 
thus it will just iterate through the connections as they're available …
It should be on average relatively distributed
 
This works well for queries, but what about prepared statements?
 
7:21 PM
^
A statement is prepared per connection
from the DB server's PoV, anyway
 
@bwoebi This is what I'm thinking… it's not perfect, but will average out to be practical.
 
@DaveRandom yeah, that's true
The code could be improved to actually prepare statements on other connections too in case the connection where it's already prepared is busy
 
@Trowski sometimes yes, sometimes no. I can imagine situations where I'm doing massive amounts of inserts, one row at a time. In that case having an insert statement available on multiple connections could be a big win.
 
^ yep
 
@bwoebi What does that mean?
oh
 
7:25 PM
At the same time though, because pgsql supports proper parameterised queries, the case for prepared statements is much weaker there
There's no point in preparing something with a super-simple execution plan, it will just be cached server side anyway
 
@DaveRandom Right, this problem goes away if you just use parameterized queries right away and avoid the intermediate object.
 
@Trowski How about this: ship with an implementation of option 1, which will be good enough in the general case. Other pool implementations can be added at a later date if it seems necessary.
 
@DaveRandom I'll clean up and post what I have later and we can discuss some more.
 
OK great
 
7:29 PM
>removing 2200 unused rows from a table on website database. squee
 
Right, I'm gonna have a shower and eat dinner, ttyl
 
have fun
shaved about 16MB from database export file :)
 
ugh... why would git rebase -i HEAD~6 have problems with writing files (permission denied) when launched from an admin console?
and the answer issss!!!! obviously because I had a server running holding the files.
:sadpanda:
 
7:46 PM
stackoverflow.com/a/236736/2153758 … the best gems are always the deleted ones… (10k+)
 
@FélixGagnon-Grenier that's balls
 
evenin
 
@bwoebi Is that Flexo, our spam expert?
 
@bwoebi lol!
> Saying that Java is nice because it works on every OS is like saying that anal sex is nice because it works on every gender.
7
 
7:53 PM
@NikiC is he a spam expert?
 
> Offensive! Please refrain from using J* word and other profanity. – lispmachine Jun 1 '09 at 23:54
hahahah
 
@PeeHaa yeah, that was the golden part about it^^
 
@PeeHaa topkek
 
Ekn
topkek.. is the best muffin in Turkey.
oh.. well
!!urban topkek
 
[ topkek ] A Turkish brand of small packaged muffins, it became widely popular on [4chan]'s [/s4s/] board for its similarity to Toplel. Many worship it as a God and will stop at no lengths to get one.
 
7:59 PM
:P
 
bur
kek = lol in WoW, when playing Alliance, and reading Horde language (I may have the factions incorrect)
bur = lol also, but vice versa
 
hmmm. these wowers
 
!!urban kek
 
[ kek ] Kek literally translates to lol on World of Warcraft. When someone from the Horde side types lol in /say, members of the alliance side see kek instead. Not specific to Orcs.
 
they literally stole that on 4chan
as memes once were
 
8:05 PM
when did 4chan originate?
 
2003 or 2004
 
"kek" on 4chan occurred after both WoW and topkek
(the muffins)
 
WoW came out in 2004, but was in beta since like '02?
 
kek itself also predates WoW, "kekeke" is a Korean online gaming laugh
 
8:07 PM
so WoW > 4chan in terms of originality.
 
(in the same way that jejeje is spanish)
 
which is why I said it was stolen from Korean :P
 
ㅋㅋㅋ
my e-penis is the biggest
 
Honestly though I don't really put too much faith in the 4chan origin of kek being tied to historical use. 4chan is special.
 
8:11 PM
^^
 
8:52 PM
@Tiffany Your e-penis is weird.
 
@kelunik figures
 
I see @rdlowrey all day in here, but never saying anything
@rdlowrey must have notifications off…
 
Anonymous
Probably fed up with all the flirting
 
@NikiC thanks for the hint on parent hints
just added the code for it
 
Top tip kids. If someone says they are putting their 17 year old cat to sleep tomorrow, don't try to one-up them with your own "I had to put a pet down once, and I got over it really quickly" story. Just say that that's very sad.
 
lol?
:P
I mean: that's very sad
 
:facepalm: more than anything else......one of the guys at work.....just says the stupidest shit. Oh and also gets offended very easily if you say anything even remotely negative.
.. !!giphy facepalm
ow wait. I can't unbox that....
 
giphy works for once. I ain't going to bin that
If US people are annoyed ping me :)
 
1 message moved to Trash can
 
9:21 PM
damn you
 
@PeeHaa Sorry, it was such a shitty facepalm
Just couldn't let that stand
 
Not even gifbin worthy? :(
 
@PeeHaa I nearly moved it to /bin/bash
 
hehehe
 
Because that's the first one that comes up on "bin" ^^
 
9:23 PM
Sooo not sure if genius or wtf
in JavaScript, 26 mins ago, by PeeHaa
> It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned.
const in js
 
I seem to remember reading about 'const' arrays.....
// The same applies to arrays
const MY_ARRAY = [];
// It's possible to push items into the array
MY_ARRAY.push("A"); // ["A"]
 
yes correct
 
Aaaaaaaaaaaaaaaaaaaaaaaaaand I need a stronger drink.
 
:D
 
@Danack wat
 
9:25 PM
@Danack I recommend you try PHP…
 
// However, assigning a new array to the variable throws an error in Firefox and Chrome but does not fail in Safari
MY_ARRAY = ["B"]
 
I have been doing some js the last two days and it's all like that
 
@NikiC yeah, arrays being objects in JS… … mutable ones.
 
So basically const is useless?
 
9:26 PM
@NikiC not for scalars.
 
// const also works on objects
const MY_OBJECT = {"key": "value"};
// However, object keys are not protected,
// so the following statement is executed without problem
MY_OBJECT.key = "otherValue"; // Use Object.freeze() to make object immutable
 
Finally solved my problem...
Turns out the problem wasn't in the capacity conversion, I just did the EXIT analysis incorrectly. Turns out you need a slightly different approach prographs than for regular LDPC codes
 
Ekn
9:44 PM
uh... I'm lost in between parentheses while I try to fail the last 4 cases here
 
@Ekn What are you trying to achieve?
 
Ekn
something like !!in 2 seconds remind this - so, match the 'seconds ', grab before/after parts and disallow anything else before but digits
 
@PeeHaa So final in Java?
 
Ekn
but also the first parameter can be 2sec, 5mins
 
@LeviMorrison yes I guess it is
 
Ekn
9:58 PM
s/2sec/2seconds
 
Ekn
^^ kind of yes, I need to grab the digits too
 
@Ekn yeah, then you need preg_match_all
 
Ekn
yep, thank you @bwoebi, it's been an hour I'm looking at this..
 
@Ekn I mean… I had no fucking clue what you even tried with that monstrosity of a regex initially
 
Ekn
10:07 PM
yea, it's horrible
 
@NikiC wait, iterable passed?
:O
 
@Ekn I just mean, regex is not an initialism for repeat endlessly goosy expressions
@Ocramius yes, is that a surprise?
 
Just totally missed it
 
It's good to have as much domain logic as possible in the entities but I have come to a situation where it's possible to keep the logic in the entities but it would be more efficient to put it into a domain service. What do you think I should do?
 
@tibanez I usually call domain services from entities: $user->notifyOfSubscription($subscriptionNotifier)
or User::register($existingUsersRepository)
 
10:18 PM
@Ocramius Hmmm I'm unsure of passing a repository in, even if it just depends on an interface. I guess the repository it not really supposed to directly mean you are communicating with a data store and is suppose to speak the language of the domain. Therefore I might actually be okay with passing a repository in in this instance
What about passing a Specification in which encapsulates this business rule and can itself have the repository so the entity is even less aware of the repository
 
Used specifications before, but they are usually a big waste of time
since it's basically a DSL that needs to be translated to the repository internal matchers
 
@Ocramius I'm still unsure of them myself. What about using them in relation to non database stuff though? They can certainly make it easy to change a specific rule and also to test them they are pretty simple since they are usually pretty tiny with one method and one or two dependencies
 
Ekn
@bwoebi indeed, honestly I had no proper clue on how to form it before I wrote down what I needed to achieve
next time I'll do that first
 
@FélixGagnon-Grenier wtf, that deleted answer from OP…
> _How I pray, that a time will come, I can free myself, from their expectations On that day, I'll discover someway to be myself, and to make my family proud._

Hehhehh jk bros. I'm a guy like everyone else. I was just playing around. Resume ordinary life.
 
10:26 PM
just reading through all of it as of now. wow
 
@tibanez yes, but having specific repositories is simpler anyway. In any scenario, it's User::create() that fails, not some logic that is called before that method
since it's User::create()'s responsibility to check for the requirements of user creation
 
@Ocramius That is a good point
 
so simply pass the "context" to the method
it generally leads to very expressive code too
I also have $shoppingCart->checkOut($paymentDetails, $paymentGateway)
 
@Ocramius Yeah I will do that now. Do you practice CQRS in any of your PHP applications?
 
@FélixGagnon-Grenier This looks btw. like a textbook entry: how to trigger shitstorms for dummies
 
10:30 PM
@FélixGagnon-Grenier nice
 
@tibanez yep, CQRS+ORM and CQRS+ES (separate projects)
 
yeah, they seriously hit the fan with a critical hit
 
most command handlers become simple translations from command to call to aggregate (with context)
both in ORM and ES world, btw
 
@Ocramius I'm still trying to figure out the best way to implement ES. I'm not brave enough to use it on a real project yet.
 
@tibanez it actually works much more reliably than all the stuff we did before
@tibanez try out github.com/ShittySoft/…
 
10:34 PM
@Ocramius Yeah I love the benefits of it. Thanks, I 'll take a look
 
I put everything in an index.php for the sake of simplicity. Teaching that very one on Thursday in London
 
@Ocramius ShittySoft, lol
 
@bwoebi my dream was to build an enterprisey CQRS+ES framework that corporates would use
that would have been awesome: "why does our frontend report Fatal error: uncaught ShittySoft\TransactionFailed?!"
 
@Ocramius Cross Query Resource Server + Enterprise Solutions … no… what does CQRS+ES mean?
 
Command Query Responsibility Segregation
 
10:37 PM
@Ocramius you should totally drop that and try redux
 
@FélixGagnon-Grenier tried redux, which is basically a mixup that got all the terminology backwards :P
would rather use RxJs instead (Stalz's work)
 
@Ocramius ugh. thanks.
 
@bwoebi ah, ES stands for Event Sourcing, which basically means "everything in one big append-only transaction log"
 
RxJs
build:failling
yeah totally trying that now :D
 
@FélixGagnon-Grenier it's not the lib that is interesting, but rather the pattern: gist.github.com/staltz/868e7e9bc2a7b8c1f754
takes the concept of a reducer and makes it basically Promises on steroids
 
10:40 PM
hmmm... sounds... nice, I guess
will take a look, ta
 
I would consider it bad to add methods to a class just for testing purposes. In my case I want to assert the value of some private properties but I don't want to add getters just so I can access them. PHPUnit allows you to assert the value of private properties. Do you think it's okay? It does leak some of the internals out to the test but the other option is add getters which would only ever be used in the test so that seems counter intuitive
Basically I feel guilty about doing it either way
 
@tibanez if you do ES, you just get the recorded events from the aggregate :P
 
@Ocramius so, just another nbio lib
 
but yeah, test behavior
@bwoebi no, it's not about I/O, it's about aggregating collections as "iterators"
 
10:41 PM
> Reactive Programming is getting a lot of attention these days, and it promises to reduce frustration, bugs, and greenhouse gas emissions.
nice...
 
@Ocramius Yeah I know but I am just talking about in general. If I access private properties in my test it makes them that little bit more brittle which no body ever wants obviously
 
@Ocramius uh, I mean the lib you need around your nbio to usefully use it
 
@bwoebi basically traversable1.merge(traversable2) -> gives you a traversable that puts all events in a sequence. I'm finding you a better example, because I/O is just one of the things you do with it
 
@Ocramius yeah, just merging observable results
i.e. like we have amphp/amp and amphp/loop … amphp/amp is everything, but not the I/O.
 
The observable is just modeled as a collection in RX, where the then() in a promise is just a tick
 
10:46 PM
@Ocramius yeah, but an async collection…?
 
@bwoebi more like a generator
 
yeah
 
for instance, modeling a triple-click with promises is a mess, while with reactive it's basically (meta-programming) pick at least 3 from (filter within range of 3 seconds) and aggregate into triple-click-meta-event
reactivex.io homepage has a visualization of this
 
@bwoebi @Ocramius This is something that can be done with Amp's observables as well.
They differ greatly in a few significant ways from ReactiveX, but for the most part they can be used in the same ways.
 
Yes, most probably, you'd just take an observable and convert it into a reactive stream via something like github.com/ReactiveX/RxPHP
@Trowski fyi, that uses an event loop too :D
 
10:51 PM
@Ocramius Hopefully with the async-interop event loop people can mix and match depending on their purposes/preferences.
 
@Trowski yesh, that's what I was thinking :)
 
Amp's observables are designed to play nice with coroutines, I'm not sure if the same is true for ReactiveX.
 
Not sure about that, I suggest looking at the examples to get an idea of what the aim is
It's mostly operators around observables. You never go back to the source of your data, just keep reducing and producing new streams
so you really just need your Iterator#next() to make this work
 
@Ocramius Eventually a callback must be consuming the data at the end of the stream, right?
So there's still a reliance on callbacks to actually act on data from the observable.
Amp's observables can be used in that way, but Amp also provides an Observer class that behaves like an async iterator when used in a coroutine.
$observer = new Observer($observable);
while (yield $observer->next()) { // Awaitable (promise) resolving to a boolean.
    $emitted = $observer->getCurrent();
}
$result = $observer->getResult();
 
@Trowski yes, at the end somewhere. Again, pseudo-code: Observable::fromArray([10, 100, 100])->map($fetchUsers)->subscribe($stdOut)
 
11:03 PM
Observables in Amp are essentially async Generators, also including a result, or return value.
 
I'm very far from implementation details, I am really interested in the operations. The one above, for example, may fetch those 3 entries at different times, and all responses may be scrambled
Still interesting though, and there are operators to put them one after the other again
 
I wish to get some time in the next few months for an async/await PoC in PHP… thinking of using PHPPHP for that … doing it in C for a PoC is far too time-consuming
 
@Ocramius Sure. Same basic thing can be done with Amp.
 
Yeah, I just like the fact that it's functional composition, while Amp is much more "the actual inner cogs"
RxPHP can probably be built on Amp, that's what I mean. From my PoV, Rx is interesting even just for synchronous stuff
 
Ah, ok, I see what you mean.
 
11:10 PM
Like $a = getAllUsersFromSiteA($db1); $b = getAllUsersFromSiteB($db2); $lastUsers = $a->merge($b)->pickLast();
This is a mess even with arrays :-P
 

« first day (2159 days earlier)      last day (2804 days later) »