« first day (2728 days earlier)      last day (2444 days later) » 

00:09
0
Q: Is it okay to have more than one repository for an aggregate in DDD?

AllenphI've read this question about something similar but it didn't quite solve my problem. I have an application where I'm required to use data from an API. Problem is there are performance and technical limitations to doing this. The performance limitations are obvious. The technical limitations lie...

Wes
Wes
@Allenph ddd doesn't cover that stuff
but i'm curious to see what they answer
00:33
evening all
making a list of stuff I need to pack is hard
01:03
@DaveRandom Perhaps you know more about that: is there a way to avoid connections from being rejected? In particular the following code will block in the accept call and the attempted connection will be reset. Is there no way to tell the system "please stop giving me new sockets"? The concrete use case is that there seem to always be a few socket connections being rejected when first firing up a new server and then shutting down the old one.
I guess those rejected connections are those which came in between the final accept() call and close() call...
$ctx = stream_context_create(["socket" => ["so_reuseport" => true, "so_reuseaddr" => true]]);

$sock_old = stream_socket_server("tcp://127.0.0.1:9876", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $ctx);

$cli = stream_socket_client("tcp://127.0.0.1:9876");

$sock = stream_socket_server("tcp://127.0.0.1:9876", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $ctx);

fclose($sock_old);

$client = stream_socket_accept($sock);
var_dump($cli, $client);
He's minimizing the problem by closing the sockets a bit earlier manually, but it does still exist.
If there isn't in PHP - is there a way on the C (syscall) level?
basically I want an "unlisten()" syscall which I can accept the pending sockets from, but no new sockets are queued on this socket anymore then
01:18
@Wes So for once I have a good question? Not just a lack of knowledge?
CC @Patrick You wrote a book. Hopefully you know the answer.
 
1 hour later…
02:33
Good Morning
Anyone tried here creating a chat or messaging?
Just want to ask something
02:47
@VandolphReyes something like this?
@tin
@Tiffany, nope.
I made a chat in my web app, and I want to create a helper to get the RESPONSE RATE of a user.
For example
user1 send message to user2
then
user2 reply after 1 hour to user1
user3 send message to user2
then
user2 reply after 10 minutes to user3
I want to get the average response rate
Basically, I will put on user2's profile./
Response rate: Replying within 10 minutes (just example)
Wes
Wes
@LeviMorrison ping
i'm writing documentation. english is so broken i.imgur.com/7Bx2Apy.png
03:19
morning
 
1 hour later…
04:31
posted on April 04, 2018

New Cyanide and Happiness Comic

 
1 hour later…
05:48
Hello everyone, I am trying to implement an alternative way to use Mysqli get_result because my server does not have Mysqli installed. Even though I did implement a new function for get_result the error of "Call to undefined method mysqli_stmt::get_result() " is still popping up. I have no idea why that's happening. If anyone could give any clue I'd be really appreciated.
my code is as follows
I followed this post for implementing this
5
Q: What's wrong with mysqli::get_result?

einsteinI have the following code: $postId = $_GET['postId']; $mysqli = new mysqli('localhost', 'username', 'database', 'name_db'); mysqli_report(MYSQLI_REPORT_ALL); $stmt = $mysqli->stmt_init(); $stmt->prepare(" SELECT * FROM posts WHERE postId = ? "); $stmt->bind_param('i', $postId); $stmt->execute()...

Wes
Wes
06:24
god why is scala so odd
@Allenph hmm why do you want two repositories in that case? Couldn't you just query your own cache and refresh that with a separate script that runs once a day. Also if you only need to query, I would skip the repository and entities. Just use a query. Entities and repositories are used when you have domain logic in DDD. If you only read data, you don't need them.
Does that help/make sense?
06:54
mornin
Wes
Wes
kotlinlang.org/docs/reference/delegation.html when i suggested we should have this you were like no wes you suck, you always have the worst ideas, blah blah
07:10
morning
@Wes fwiw, I mentioned several times over the years that it would be nice to have some easy way to create type safe decorators without having to add all the non-decorated methods just to satisfy the interface
Wes
Wes
been saying that for several years too
iirc, anthony said so, too
07:28
> Note, however, that members overridden in this way do not get called from the members of the delegate object, which can only access its own implementations of the interface members:
doesn't that ... sorta ruin it ?
Wes
Wes
@joe was the only agreeing with me. but he probably doesn't recall :B he even tried to implement it
I remember nothing ...
Wes
Wes
syntax was
interface Bar{ function qux(); }
class Foo{
    public $property implements Bar;
}
$x = new Foo();
$x->property = new MyBar();
$x->qux(); // delegates to $x->property->qux();
<?php
use function \Componere\cast_by_ref as decorator;

class Foo {

	public function qux() {
		return 24;
	}
}

class Bar extends /* decorates */ Foo {

	public function qux() {
		return 42;
	}
}

$foo = new Foo();

$bar = decorator(Bar::class, $foo);

var_dump($bar->qux());
?>
07:58
o/
@Wes ow my head
Shangri-la a faraway haven or hideaway of idyllic beauty and tranquility.
!!dad
What do you call somebody with no body and no nose? Nobody knows
OK, I have to admit we need some new dad jokes. )))
@Ocramius ping
08:34
@FlorianMargaine no
sup
@Ocramius cmon :(
@Ocramius was just wondering if you knew about lazy migrations (e.g. blocking: renaming a field table; async: remove a column), and if doctrine supported that. Some googling didn't yield much.
the idea being to be able to deploy in several steps while getting the site up asap.
@FlorianMargaine I've seen something about it, lemme ask my friendly ops folks
@Ocramius I was more thinking of doctrine facilities to help with that (like detecting which migration is such or such type)
@FlorianMargaine percona's schema changer possibly
doctrine migrations is dumb and is designed to be dumb
Large Hadron Migrator
@FlorianMargaine github.com/masom/lhm_php
08:52
hm... I guess I'll have to dig through the source
Wes
Wes
@Sean it's just automatic delegation..
@Ocramius thanks.
@Ocramius I never understood why people want to write migrations in a language other than sql. DbDeploy served me well. The only other tool I ever wanted to check out was liquibase, but dbdeploy prevented that so far.
09:09
@Shafizadeh you shouldn't put vendor/ and .idea/ in the repsoitory
also, top mixing tabs and spaces for indentation
@tereško diversity ftw
fuck you too :P
09:21
How do i send a custom env param to getenv() from apache on centOS?
@Sean thanks the 2nd link worked
@Gordon this makes sense for large migrations, where you need to add an index to a huge table with gazillion rows without blocking the entire thing.
10:19
@Gordon it's possible to do automatically in userland framework, Go! AOP generates such decorators for you, so you can wrap only few methods in your original class
@lisachenko I'm considering adding GoAOP for logging in a distributed system, intercepting and pushing up to graylog
@Jimbo it could be reasonable, yes
10:39
!!urban reasonable
@J.Ende don't you know what reasonable means?
ye ofc haha, just checking if urban still works
!!uptime
3 messages moved to Trash
@lisachenko adding an AOP framework just to have decorators like that sounds even worse tbh. I mean, it doesn't cost me much to add the delegating methods. it's just inconvenient.
10:52
@Gordon it depends on project size, if it's small project, then AOP will be overkill and much easier to do this manually. But if it's enterprise project with Symfony, then automatic decorators provided by framework is ok
so, yes, concrete cases require suitable tools
One nice scenario where I'm using AOP right now is to decorate a shitload of classes that are very stringy-typed to generate warnings to log in a QA environment
@lisachenko let me put it this way: if the project had any need for an AOP framework, then I'd be fine with also using that specific capability. But if it's only for that specific capability, then I see it as too much added cost.
11:10
@Wes Pong.
Wes
Wes
i remember i wanted to ask you something but i forgot what :B
sorry :B
hm......
no clue... bha
we are looking for someone who can help us with a small php mysql project that won't take more than a day or two. we have things set up and we are stuck in some places.
Any one interested as a freelance.
11:29
@Beekeeper how do you know it won't take more than a day or two?
It will not, if you know mysql well. Because we are working on it, and we could not find the solution which we might think simple.
@Gordon it's obvious when the budget decides
Can anyone remind me what the sane datetime format is that everyone should be using for apis?
@Gordon We really need some help.
rfc3339 ?
11:34
What video was the admin.php starred link? Seems to have been removed
@Danack that's fine
ta.
@PaulCrovella Any help? please.
11:40
@Beekeeper don't ping random people like that
Noted.
Not the chat link, the video (but thanks guys :p)
The video is random, on every click it is a different video. So, keep clicking you might see it again.
:p
Ahh!
@mega6382 lol TIL
@Ekin Yeah, and every endpoint ends in php xD
12:09
Someone here that used QuaggaJS in his php project?
13:08
wait that aint right :D
> The number of connections permitted is controlled by the max_connections system variable. The default value is 151 to improve performance when MySQL is used with the Apache Web server. (Previously, the default was 100.) If you need to support more connections, you should set a larger value for this variable.
Is that per apache process, or max connections in total, system wide?
@tereško I switched to Vivaldi at work. Is there anything you've noticed that's awkward compared to how Chrome does something? particularly with web dev.
So far it seems like it'll suit my needs.
it uses Chrome's dev tools, so I'm glad for that.
good thing most of it is commented out
@Tiffany only annoying thing, that I have experience so far has been opened-tabs getting forgotten after updates ... but that's only on linux and probably because I am using the preview version
and some months ago it had a rendering problem for UI, but that was fixed at some point
@Daniel max for the database instance.
I'm a little annoyed that changing what Chrome restores on session is locked by our GPO :| I can't change it to restore last session.
13:17
lol
Chrome has reached proprietary status...
I need to buy a cheap pair of earbuds before Saturday
or find my Shure earbuds very soon
can't spend that kind of money right now, leaving on a trip Saturday, need to save money
but they actually do have a cheaper stuff too
wat... my tabs just turned into previews of the webpages I have open in the tabs
no obvious way to turn it back
13:23
emm there is
it is drag-able
so you can collapse it
I'm dragging, they're not going back to just titles of web pages
vivaldi://settings/all/
search for "thumbnail"
imgur.com/a/KoyYc this is what it's doing
oh
it's a double click on the bar between address bar and tabs
that's simple enough
there is a checkbox for disabling that, @Tiffany
I might keep it, cause I can see it being useful on an as-needed basis, it was just a matter of figuring out how to switch between the two.
this are the earbuds I bought a while back except they're an older model. I really like Shure's earbuds cause they're comfy.
and they feel like ear plugs by themselves
14:05
ArrayIterator is always Json encoded as an Object – #76186
an object encoded as an object?! madness!
14:30
@pmmaga meh. json "objects" and php objects are related in name only (and in json the name is poor). it's certainly not a bug, but it'd be understandable as a feature request (though I wouldn't support it)... you're fine encoding anything you want to treat as a map as a json object and anything you think of as a list as a json array
it's something people should think about and do themselves though. if they want to run around and slap random objects with json_encode then I don't pity them for whatever crap they end up with
Jay
Jay
I have an issue I am hoping someone can help me with
I have two dates: 2018-04-01 00:00:00 AND 2018-04-01 23:59:59. How can I loop through every 5 minutes and output the date and time?
I've looked at a few posts but nothing is helping
@PaulCrovella true, the relationship is not super clear. but what he's getting shouldn't really be a surprise IMHO
totally agree
Jay
Jay
@paul
14:41
still, as you say, as a feature request I guess it may make some sense
Jay
Jay
I can't seem to modify it for 5 minutes
P5M?
When i run composer install does it look for .json file or lock file or both?
Jay
Jay
$begin = new DateTime('2018-04-02 00:00:00');
$end = new DateTime('2018-04-08 23:59:59');

$interval = new DateInterval('P5M');
$daterange = new DatePeriod($begin, $interval ,$end);

foreach($daterange as $date){
    echo $date->format("Y-m-d H:i:s") . "<br>";
}
@Jay that'd be 5 months. you gotta start the time part with T so PT5M
@Linus json file, IIRC. Composer will create the lock file
14:44
install uses the lock file if it exists
Jay
Jay
thx alot
you're welcome
@PaulCrovella don't you add new packages into the json file first?
@PaulCrovella if i am undestanding correctly it will look for both file right? But my TL argument is it can't look for both in single threaded enviroment.
Hello, I use Google Cloud to host my API which uses twitter real-time API.In order to trigger the Twitter API, I need to establish a connection with it via command line.I have used symphony console for that.
When I connect to the API on other routes the database connection works, but when I run the ./console command it can't establish the connection to the database.I get 'SQLSTATE[HY000] [2002] Connection refused' which doesn't explain much.I'm wondering if the reason for this is because the file from which the request goes is not from the public folder.I have really no ideas how to make it work since I don't know where to start.Everything that I had in mind I tried it out and it didn't work.
Note:It's working on local
14:47
@Tiffany thanks.
@Tiffany yes, and update creates the lock file (install will update if the lock file doesn't exist)
@Linus wat
if i run composer install it will look for .json file and lock file both ,is that right?
Jay
Jay
I am so stuck on this timing issue
Could someone point me in the right direction for this:
@Linus "install" will start by looking for a lock file, warn if the lock is incoherent with composer.json, then install what was locked.
Jay
Jay
I have a array of times: Array
(
[0] => Array
(
[start_date] => 2018-04-02 12:00:00
[end_date] => 2018-04-02 12:55:00
)

[1] => Array
(
[start_date] => 2018-04-03 12:00:00
[end_date] => 0000-00-00 00:00:00
)

)
I am looping through the date but need to remove the date from the loop
2018-04-02 09:00:00
2018-04-02 09:30:00
2018-04-02 10:00:00
2018-04-02 10:30:00
2018-04-02 11:00:00
2018-04-02 11:30:00
2018-04-02 12:00:00
2018-04-02 12:30:00
2018-04-02 13:00:00
2018-04-02 13:30:00
2018-04-02 14:00:00
2018-04-02 14:30:00
2018-04-02 15:00:00
2018-04-02 15:30:00
2018-04-02 16:00:00
2018-04-02 16:30:00
2018-04-02 17:00:00
2018-04-02 17:30:00
so arrray0 should remove from 12 to 12:55. Is this even possible?
sorry the loop going in 5 minutes not 30
be to long to post here
14:56
!!docs unset
[ unset() ] Unset a given variable
@Sean u so smart ^^
Although this might be better for your use case
!!docs array_filter
[ array_filter() ] Filters elements of an array using a callback function
@FélixGagnon-Grenier yeah but my team lead says composer can't look for .json and lock file both beacuse php is single threaded environment.
:P he made me also confused
14:58
your team lead doesn't understand that time exists and one thing can follow another?
@Linus wat
@PaulCrovella Sort of :P
Jay
Jay
but how would you unset all the inbetweens?
Assigning new object in ref-parameter: fn($obj = new stdClass()) raises notice – #76187
@Jay Please stop this.
Paste your code in gist.github.com
Jay
Jay
15:00
so have a start and end date: 2018-04-02 12:00:00 and 2018-04-02 12:55:00
k sorry
how would you remove the ones inbetween, I can get it to remove the matching ones
@Sean :p i am also bit surprised there, he always force me that he is right even things doesn't make sense.
@Jay Already linked it further up. array_filter is your tool.
1 message moved to Trash
@Jay you can compare the dates, or just use two periods instead and leave the middle bit out from the beginning
Jay
Jay
I'll create a pastbin to show you what I am doing
15:05
@Linus tell him he's being replaced by a snarky chat room
:)
Jay
Jay
sandbox.onlinephpfunctions.com/code/… here is the code. Could someone help me with this please I am stuck and on a deadline
I'm always really interested in what exposed exploits are, the discovery and the fix for them. The drupal link doesn't really disclose any of that except to just update drupal.
@PaulCrovella Ooo! Thanks!
15:20
Change in treating unescaped - in character classes – #76188
0
Q: Symphony Console Google Cloud SQL Connecting

DaAmidzaI use Google Cloud to host my API which uses twitter real-time API. In order to trigger the Twitter API, I need to establish a connection with it via command line. I have used symphony console for that. When I connect to the API on other routes the database connection works, but when I run the ....

@Jeeves looks more like a bug fixed than a bug
Jay
Jay
@Sean thats awesome mate thanks alot. Is there a way to keep the 5 minutes each side?
Yes
15:33
@Sean or create two periods and you don't need to bother filtering things out after
in all honesty I've never seen DatePeriod before, wasn't sure if there was a good way for it :D
Jay
Jay
this seems awesome. Would you know how to keep the 5 minutes each way?
@Patrick Somewhat. I'm using CQRS in another spot in my application, but for a very different reason. One drawback you didn't mention in your code is that unless you go full CQRS just having a query which produces a read object and a repository which caches write objects you could have read objects in a state they're no longer in.
The fact that you can separate the queries at all though tells me it shouldn't be a problem to have two repos. That seems more straightforward.
@Wes Where would you put that search struct? With the aggregate or the mapper?
15:48
@tereško Agreed, .idea/ is a IDE thing and I will put it into .gitignore file. But I disagree about .vendor/, It contains some libraries I've downloaded, the project won't work without them.
that's why you have composer.lock file, which contains the list of packages
when you deploy the project, you also run composer install -a --no-dev
Everytime should they be downloaded again ?
also what's -a and --no-dev ?
what do you mean by "every time" ?!
@tereško when I pull a new version of the repository
it seems you do not know how composer works
15:52
Oh wait .. they will be downloaded once
ok got it
@tereško I know :-)
@Shafizadeh yes, you pull the latest version, you run composer install: it will update your vendor, if the lock-file has been changed
@tereško we really stuck on a SQL problem .. the sad part is, we cannot convey it in English, so everyone read it on SO, says it is unclear
can you please take a look at it and just edit it, and making the problem understandable for people?!
and the lock-file will only change, if you add new package or have executed composer update
@tereško yeah got it all
@tereško ok, just what are -a --no-dev flags?
--no-dev will not install "development dependencies"
for example in packagist.org/packages/twig/twig, there are development-dependencies listed
15:56
OHH I see, now I understand what "requires (dev)" means ..
as for -a, it generates a classmap for faster load times (do not use on development system, ever)
!!doc classmap
Also, "development system", like what?
@Shafizadeh "the thing with screen and keyboard on which you press buttons on a keyboard and the code appears on the screen"
@Shafizadeh as for that SQL thing, there are two things that I do not understand: 1. what problem you are actually trying to solve (I suspect that you want to show the user a list of notification, which by default contains less than 15 items OR all of unseen notifications + optional padding of older notifications)
2: why are you using that result to compute points ?!
... oh, and how is the "seen" attribute applied to a notification?
16:11
@tereško isn't it a laptop?
maybe
Oh, sorry, I didn't read "on" word .. ok
so I use -a on the server? right?
you should never use the -a tag on a development system, because it uses a pre-generated classmap, which means that each time, when you add a new class, you would need to re-run that command
and it takes time to generate that classmap
ah I see ..
@tereško also, how do you know our problem is about notifications?
recognizable "thought pattern" , also some column names gave it away
16:17
what columns? I never talk to you about notifications-problem yet ..
image not found - anyway, really interesting how you knew about the problem-topic
do you have some free time I explain the problem for you now?
can it wait an hour
I am still at work, banging my head against a bug
@tereško I have the mug :D
Ah ok .. work on your own bug :-) also lemme know if your bug is related to regex :P
16:22
it's related to a JS template being added with a dataset parameter indicating to use PUT method instead of POST
@Patrick I also had a question about CQRS if you don't mind. Right now I have a repository for my read model. That one pretty much only exists as a central place that registers an observer to a mediator and refreshes when it hears a write event.
Is that the appropriate place to do that?
em, I guess I cannot help, I always use either POST or GET methods, never used PUT
@Shafizadeh still not using a proxy?
@mega6382 I'm using my brother laptop now :P it doesn't have proxy
@Shafizadeh OK, and did you look into the options, I told you about?
16:27
@mega6382 yes, but none of them worked .. they were themselves blocked here
@tereško not finding much help with google on this request. Is it possible to make the tabs' height reach the top of the browser window? More often than not, I go to the top of a tab to close it with middle-mouse click, but they're just a little too short...
without using zoom
or what's the feature called and I'll google it
"tab spacing"
just search it in settings
also, how is it related to zoom? that's an unrelated feature on the footer-bar
16:36
I was looking at their user interface scale and it looked like it would increase the height of the tabs
thanks
OK, ppl, your opinion is required.
So, I got a job offer(passed the interviews and everything, only signing the contract remains) from this company that is quite nice, very compact team, in-house product.

But it provides almost the same benefits as my current job, which is a very big team and is an outsourcing company.

What should I do? Should I take the new job or stay?
@mega6382 pros and cons with new job and current job?
pay raise? you said the benefits are the same, but are there any specific perks that your current job has that the other one may not have?
is the commute longer to the new job versus your old job?
They are almost the same, quite nice management. And the CEOs of both companies are apparently good friends.

Commute to the new job will be shorter, the new job provides 2 hours of break on company time along with lunch by company. The new job has a bit better health insurance.
Why not? You'll learn either way
@Jimbo https://gist.github.com/Allenph1/531a45e6b469cfb621472a91ae80ddc8

Is this more what you were saying dirs should be like?
I still have some stuff grouped by type, but.
16:41
And I hate outsourcing companies. Because, you have to deal with all kinds of clients and various PMs and all that stupid legacy code.
it seems like you have your answer there :)
@mega6382 if there are very clear improvements over your current job than with the new job, then I'd say go for it. If there are parts of the new place that you're unsure of, or it's ambiguous, I'd be careful. They can make it look like sunshine and flowers at the beginning, then after you start, the job can turn into a shithole, and you were blindsided by it.
Do you have the option to talk to current employees, and ask them questions?
@Tiffany Yes, actually the HR that contacted me for the new job used to work at my current job. And I know her to be quite an honest person. And she has said many good things about that company.
I mean more along the lines of team members you'd work with
like future coworkers
@Jimbo So, you are saying, I should take it?
@Tiffany Yeah, I had 4 interviews, 1 of them was kind of a meeting with their R&D team, and they all seemed to be quite experienced and polite people.
16:47
so you were able to ask them about the work culture and stuff like that? those kinds of questions I'm not sure are possible in a formal interview though because you're asking for their honest opinion of the work they do and if they enjoy it
@Allenph Close, but we don't even use "Aggregate"
@mega6382 How much is the pay rise in percentage? This should be one of your questions
Reason why I'm being so thorough is I've read horror stories about how jobs look really good on paper, and the interview process goes well, and everything seems great. Then after they accept the job, they realize they made a terrible mistake and are in a "stuck" position because it may not be possible for them to ask for their old job back, and they're back to looking for another job.
@Jimbo About 10%
The real problem I am facing is that I will be leaving for Germany in about 6-8 months. So, I'll be only working for that amount of time at most, either at my current job or the new one. So, I am just thinking if it is feasible to change jobs or not.
No point then if it's 6-8 months and it's guaranteed. And for 10%
10% isn't much even for 100k salary
@Tiffany Yes, you are right. And I really like my colleagues(some) and this is not too bad an environment.
@Jimbo Yeah, that is a good point.
16:53
@Allenph I wouldn't have aggregate. I would have, for example, Cart at the top. So you immediately know everything in there is related to Cart. Then within Cart, you have Application, Domain, Infrastructure. Domain will contain all those objects you already have in Card. Infrastructure contains your CART REST stuff
Jay
Jay
How would you do this with php? pastebin.com/hwfaph5T
@Jimbo And Application would be services?
@Allenph Application is a cloudy one for me. I put controllers in there and framework stuff because they're part of the application layer, but there are better ways to do it. Let me give you a good link I saved one sec
And you'd stick repositories in Infrastructure as well, right?
@Allenph If you really read this, you might find it useful / interesting
16:56
Putting controllers in the scope of an aggregate does not make much sense to me.
Actually associating the Application layer with a domain model doesn't make much sense to me in general. Even services are likely to encompass multiple aggregates.
abr
abr
@mega6382 I think the real questions lies on, why are you thinking on going? If that question is on mind, than something is bothering you at yours currently, whether or not if it's something bad, but you see something good on the other side. Being hesitant shows you're actually thinking on both perks, meaning both have good perks.
Is it knowledge you're after? Is it experience? Is it a better envoiroment? Is it just for the money?

« first day (2728 days earlier)      last day (2444 days later) »