« first day (4119 days earlier)      last day (812 days later) » 

2:44 AM
hi all
happy small year
 
 
1 hour later…
4:01 AM
Hi
 
 
2 hours later…
6:07 AM
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
6:50 AM
is there anyone play genshin?
 
7:15 AM
Good morning
 
 
2 hours later…
8:52 AM
I have the following project structure:
- Core (interfaces)
- Infrastructure (services implementing interfaces in Core)
- Webapi (Controllers etc)

Now, in which project is the best place to put all the dto's?
If i put them in Core, i can reference them directly in the interfaces as the return type
today i have all the dto's in Infrastructure, and all interfaces have T as type
 
separate?
 
Should that separate project the nbe references by Core?
Since right now all the interfaces in Core looks like this:
public interface IProductService<T>
instead i could have it like this:
public interface IProductService<ProductDTO>
 
what our structure used to be is
Client
Core
Core.Models
Interfaces
Models
Repository
Repository.Models
Services
 
I see, in which one do you have the DTO's?
 
Client - is a nuget library to easily call the remote service (uses the same interface as the actual service)
Core - is the core of the hosted service, contains the handlers/controllers/di-setup/etc
Core.Models - is the api models, used by core and client (basically input/output models and the service interfaces)
Interfaces - interfaces of the services within the hosted application
Models - domain models of the application, the interfaces would use these models
Repository - database logic and mapping from repo models to domain models
so, we use 2 dto models
the Models and Core.Models
Models is internal to the application, and represents the domain
Core.Models is the api of the application and represents the actions you want to perform
 
8:59 AM
Does your services return and accept the dto's?
 
Wouldn't Core.Dtos make more sense then?
 
would you call all models dtos because for the sake of using names?
if so, then yes
 
No, just those explicitly used by the API to transfer data
> Core.Models is the api of the application
 
true
but the internal models are dtos for the internal services
so they are also just dtos
but with an entirely different scope
we used to call the classes in Models "Dto" to avoid name clashes
 
The domain models?
 
9:02 AM
because they will be mapped from Repository.Models to Models to Core.Models
and it could very well be that all 3 have a common model with the same name
we could also have named them Domain instead
 
Anyhow, my biggest concern is if my service interfaces should contain reference to the DTO's, since my does return the DTO's in its implementation
 
Your what?
 
my service implememtation*
public interface IProductService<T>
where T will be ProductDTO
But now I'm getting DTO's for get, create, and put
which would mean i would ahve to have something like this:

public interface IProductService<T, K, V>, which is ugly as hell
 
What if T were Product
public GetDto<T> Get()
public void Create(CreateDto<T> data)
public GetDto<T> Update(UpdateDto<T> updatedData)
Now you only have T
Like, the get/create/put DTOs would still have things in common aside from the actual concrete product, right?
So since you have the product itself as a generic already, just use that
Unless you wanna always make sure you have to use the correct T,K,V with each other.
 
Yes, i do have a basedto with all the common properties, if that's what you mean
which they inherit from
 
9:12 AM
Could instead let it carry a T property
 
I see.
will try, ty
 
9:28 AM
And if i wanted to always make sure that you ahve to use the correct model, is the way with T,K,V the only way?
 
how about not using generics?
 
You mean referencing the dto's in the interfaces?
 
interface IProductService {
    GetProductResponse Get();
    void Create(CreateProductRequest request);
    UpdateProductResponse Update(UpdateProductRequest request);
}
and yes, your internal interfaces use the internal models
that is the domain
 
internal models != dto?
`public interface IProductService
{
Task<ProductGetDTO> Get(string number);
}`
this would be wrong?
 
9:44 AM
not necessarily
the naming could be improved, but it is the general gist
for example
this product service, is it a repository?
if so, maybe name it IProductRepository
and if the get function returns a product, how about ProductDto?
 
Then again, i need to be able to handle post and put too, that's why i named it with "get" in the name
 
and considering your get now uses a property specific to this model, perhaps the Get should be GetByNumber
would the post and put return a different response?
isnt the response always going to be a ProductDto?
or just an empty Task
 
Yes, but i have ProductDTo as a baseclass, which ProductGetDTO, ProductPostDTO inherit from
since they share properties
 
ooh, I wouldnt do that
your responses probably should be identical
 
@Never.More yes, but anyone else?
 
9:49 AM
and inheritance as composition of properties is a very bad idea
 
Well they are, ProducTGetDTO is always returned as a response
why is that?
I could ofcouse change the name of the base class to ProductBaseDTO, and use ProductDTO as response
 
inheritance as composition of properties is contradictory to inheritance design
shared properties probably belong in the same class or be duplicated
it might be duplication of code, but it is not duplication of meaning
 
I'm not sure I'm following.. It seems a bit weird to not inherit since they both share the same properties, and instead i should write the same code in multiple classes
 
Will it be serialized?
 
to json yes
and i'm not sure i understand "inheritance as composition"
this is literally inheritance, not composition?
 
9:57 AM
Suffice it to say: write the same property in different classes is not a taboo.
 
@Zacharias you inherit behavior, not structure
that is the idea
when you inherit structure, you get into a whole mess of classification hell
as for composition, there are a lot of ways to compose things, inheritance is one of them
but you generally should only use it to compose behavior
 
Do you have any link or something about the mess of classification it can bring, so i can read and understand it some more?
 
I have a name, you have a name, we are human being, all the people have a name. "Name" is a property of human.
I have a pet, my pet have a name, but my pet not human, but pet can also have a "Name" property.
But if you want to found a parent class on human and pet, it's animal, but not all animal have a "name"(not means scientific name).
While you can indeed define a "name" property for animal, but is it necessary?
 
Well, the animal could have a "weight" property, since all animals have a weight
so why shouldn't it be shared then?
 
wow
 
10:08 AM
Inheritance applies to "parent and child", not "we have both".
 
Maybe they should both inherit from Thing, because every Thing has a weight.
 
Maybe they should both inherit from Object, because Every Thing is an Object
 
Object doesn't have a weight though. It's a completely technical type. If oyu want to bring domain knowledge in ("real world rules"), you have to make your own.
 
Opps, Object have no property
LOL
 
object have ToString() tho
 
10:13 AM
Which is not a property
 
Not Property
 
still. It can be "name"
anyway. You are diverting the issue composition over inheritance
 
That's a technical name, not "Name". you called "ntohl", not "human"
 
Composition over inheritance (or composite reuse principle) in object-oriented programming (OOP) is the principle that classes should achieve polymorphic behavior and code reuse by their composition (by containing instances of other classes that implement the desired functionality) rather than inheritance from a base or parent class. This is an often-stated principle of OOP, such as in the influential book Design Patterns (1994). == Basics == An implementation of composition over inheritance typically begins with the creation of various interfaces representing the behaviors that the system must...
ehh...

> This drawback can be avoided by using traits, mixins, (type) embedding, or protocol extensions.

Some languages provide specific means to mitigate this:

C# provides default interface methods since 8.0 version which allows to define body to interface member
 
you implement more data dimension if you want it to be more specific, like meta
 
10:17 AM
oHhHh, MetA!
In fact, I don't recommend thinking about such things as meta in the dimension of data.
meta is more fit for framework
 
by NameGeneral Name instead of string FullName; string SurName
you created a new dimension
 
dimension of meta!
 
meta of meta of meta
and its queryable
 
I'm reminded of Facebook's new name
puff
off work
CU
 
10:58 AM
woow
what happen with stack overflow
 
11:10 AM
123
Q: I hate these new yellow 'watch' labels

dwjohnstonThese new yellow 'Watched' labels - I assume that they mean 'These items contain tags that are a part of your watch list'. It's less jarring in light-theme, but still unpleasant: They're way too intrusive, they look like 'this is important' or 'action required' - and almost every item on my fee...

 
mr5
oh no
it's ugly now
they even removed the question details
 
There is a movement to make everything look awful. I try to stay away from the user profile page now, if I can help it.
 
mr5
there's a lot of unused space on the profile
 
there is also a lot of unused space on google search
 
mr5
11:27 AM
well, considering most humans tends to read from left to right, the case for stackoverflow site is very noticeable, unlike on google, where most empty spaces are on the right side.
 
11:47 AM
It's your right to consider SO profile to be left when right becomes left. And it's not right
 
mr5
e wat
whatchchjssay
 
you are legally permissible to leaving SO profile because of the right side became the left side. And you think that's unwanted.
with rights and lefts
 
mr5
why are you being aggressive sir
 
mr5
12:03 PM
I don't understand. You put NSCameraChuChu on a .lproj file expecting it would be automatically detected by .plist file?
 
[Captain Obvious] Yes because that's how it is meant to work as I understand
[Captain Obvious] It uses the value from the lproj version regardless
 
mr5
Also, wrong meme usage. It should be: repeat after me esque.
-1 social credits 4 u
 
mr5
eh no. .plist acts like the manifest file (Android) where it cointains app metadata whereas .lproj sounds like a text repository
although admittedly, I haven't work on native iOS for the past 3 years so I have forgotten about it already.
 
[Captain Obvious] Welcome to apple
[Captain Obvious] It's both
[Captain Obvious] The descriptions for the prompts that come up when you request access to (for example) camera must exist in the plist
[Captain Obvious] Although the actual content will be loaded from the lproj (language "project" I think) when the proimpt is given to the iser
 
mr5
12:09 PM
oic
.lproj would act as a localizer on this case right?
so what you're saying is you are expecting base.lproj to be a fallback for the NSCameraDescription?
 
[Captain Obvious] Because that's exactly what the documentation says is the case
[Captain Obvious] And it does use the value from the base.lproj strings file
[Captain Obvious] But it just kicks off if there isn't a value in the info.plist
[Captain Obvious] I wouldn't be bothered if it used it
 
mr5
welp, it seems base.lproj is a fallback of info.plist
 
[Captain Obvious] BUT IT DOESN@T EVEN USE THE VALUE IT REQUIRES TO EXIST
 
mr5
'*
 
[Captain Obvious] base.lproj is entirely optional
[Captain Obvious] Basically
[Captain Obvious] asian wtf guy.jpg
 
mr5
12:15 PM
this guy?
 
[Captain Obvious] Yeah that
[Captain Obvious] Although I wasn't thinking of the outline version but either works
 
mr5
his name is Jackie Chan. The more you know
I prefer this:
@Wietlol I will not collapse the images I'm posting
 
[Captain Obvious] Collapsing is for plebs who don'ty have the good shit extensions
 
mr5
collapsing in 3...
oh no. wietlol is borked now.
somebody made an extension to collapse image here? really?
 
12:19 PM
as for "wtf" I prefer
 
mr5
I forgot the name of the guy who has that as its profile picture
 
and for chat...
there we go, no more images on screen :D
 
mr5
 
dang it
@mr5 you want me to clear the screen again?
@mr5 maybe I should just post those images as reply to your messages
 
mr5
no. you misinterpret the meme.
- 10 social credits
 
12:25 PM
@mr5 then, when I have to collapse it, you also get *pings*
@mr5 also, yes, I don't entirely understand this meme with your text
 
mr5
and whenever I post an image, I'll ping you as well, like I did
it's followed by text "I double dare you mf"
it's saying: "don't do it"
 
then you use the wrong image
 
mr5
that's the correct usage of it.
believe me. I've been on 9gag long enough
 
https://i.ytimg.com/vi/uo_QPgeM4B8/maxresdefault.jpg
"I dare you, I double dare you"
"collapse an image one more time"
 
mr5
on the response headers I posted, there is no content-type but the browser was still able to decode its response body. how come?
 
12:35 PM
 
mr5
it's an image/webp
 
most images are self aware
if you had an img tag with the url to this request, it probably just looked at the data to find out what kind of image it is
 
mr5
if you pasted an image url on Chrome, it will create an html content with img src pointing to that url.
but if you're doing this on non-browser, how would you interpret it? by looking on the actual content?
 
perhaps
 
mr5
Elon posted about DOGE again. Expect moon.
 
12:43 PM
moOoOoOoOon
 
mr5
so what I think Chrome does is, as soon as you pasted the url with no content-type, it will actually try to interpret the response body, so that <img> tag will not make another request.
 
 
2 hours later…
2:22 PM
@mr5 ~ actually I am looking for a way to be able to use two nested classes with different datatypes as pipeline model.
 
3:08 PM
ew, nested classes
 
4:04 PM
[Captain Obvious] I've made somthing truly terrible today boys
[Captain Obvious] Because Xamarin still doesn't use the new project format
[Captain Obvious] Files (ie image assets etc) all have to be registered individually with the csporj
[Captain Obvious] That's a pain in the arse with iOS imageassets
[Captain Obvious] So I made a powershell script which (amongst other thigns like converting to the required format) will auto generate the xcassets folder structure, manifest files and shit, and then LOADS A COM INSTANCE OF VISUAL STUDIO
[Captain Obvious] Which then opens the solution, then the project, and adds a bunch of ProjectItems with the required BuildActions
[Captain Obvious] It works
 
why even do that?
why not just let the script edit the csproj file?
 
[Captain Obvious] Because it can't
[Captain Obvious] Because how does it know where yo put shit
 
we did the same with nuget nuspecs
 
[Captain Obvious] old style csproj files are terrible
[Captain Obvious] Because there's no real structure
 
where dependencies had to be defined in both the csproj as well as the nuspec
the structurelessness of the csproj files is a thing
but you can just search for any item group that already does add files as "copy always" and just append to that group
or make a group if it wasnt found
 
4:10 PM
[Captain Obvious] That's the problem
[Captain Obvious] There aren't any
 
> or make a group if it wasnt found
 
[Captain Obvious] But it will also kick off if the file is duplicated
 
no one can duplicate files
only Unreal Engine has had the power so far to create two different files with the same path/name
 
[Captain Obvious] No but the the csproj will not work if an entry for a file already exists
 
which, to this day, I still wonder how it did it
you can just read which files were already listed
but you shouldnt try to do all of this while treating the file as a string
 
4:13 PM
[Captain Obvious] Yeah but
 
just parse the xml document and append nodes where they dont yet exist
this should be a 5 line function
 
[Captain Obvious] >parsing the xml doc
[Captain Obvious] Yeah nah I'm good thanks
[Captain Obvious] okay good luck
 
XDocument.Parse(projectFile)
isnt powershell where you can also just write VB code?
 
[Captain Obvious] You can use .net shit
 
as horrible as VB is, it is still a scripting thing
 
4:14 PM
[Captain Obvious] It's more like php than vb or c#
 
obviously, the script that I used to process the nuspec was written in Kotlin, so it was definitely easier
but you should be able to do xml parsing in your script as well
 
[Captain Obvious] This just in
[Captain Obvious] Programming languages are good for writing something useful to do something specific
[Captain Obvious] If it was as simple as "just add a node to the xml" then it'd be fine
 
some programming languages are generic programming languages, and they can be used to do anything except for really specific things
 
[Captain Obvious] But it can't just be randomly added into the project file
 
parse project file into xml document
find correct node to append to (or create new empty node)
append all nodes
remove duplicates
 
4:18 PM
[Captain Obvious] "remove duplicates"
[Captain Obvious] I'll jsut call RemoveDuplicates()
 
XDocument.Parse(file)
    .SelectOrCreateNode("//ItemGroup[condition]")
    .Also(node => files.ForAll(it => node.Append(it)))
    .Also(node => node.Children = node.Children.Distinct().ToList())
not sure what the exact condition would have been
 
[Captain Obvious] They don't have conditions
 
the Also function is just a wrapper of an Action<T> and then returning this so you can chain it better
everything else should either be obvious or in the base sdk
 
[Captain Obvious] How do you choose between <ItemGroup> and <ItemGroup> and <ItemGroup>
 
Just take ItemGroup
 
4:21 PM
one note, SelectOrCreateNode() should not use a // path... that one should be an exact path otherwise it wouldnt know where to create
the xpath would just take the first group that matches the condition
and create one if none do
 
[Captain Obvious] Which one tho
 
"first"
 
[Captain Obvious] But the other assets aren't in the first itemgroup
 
Well if you look at it in an editor, which one would you choose?
 
[Captain Obvious] Whichever one has the most <ImageAsset> nodes
 
4:23 PM
the condition would be something like [@ImageAsset] or something
 
@Botler Then that is your answer
 
[Captain Obvious] There is no include
[Captain Obvious] Condition*
 
there is a condition on an xpath search
the condition is "which one should I append to"
 
Wait you pronounce that as "expath"?
 
[Captain Obvious] They're all just plain ass ItemGrou[
 
4:25 PM
//ItemGroup[ImageAsset] would only match groups that contain at least one image asset
not sure how you would do the max though
4
Q: XPath 3.0: select nodes by condition (find max child nodes by date)

lospejosGiven XML: <?xml version="1.0" encoding="UTF-8"?> <root> <c cid="c0" v="100"> <d did="c00" v="0" dt="2016-01-01" /> <d did="c01" v="0" dt="2016-02-03" /> <d did="c02" v="0" dt="2016-01-15" /> </c> <c cid="c1" v="100"> <d did="c10" v="1" dt="2016-01-01" />

considering that this question is even more difficult, just getting the max should be doable
something like //ItemGroup[max(count(ImageAsset))]
^ quite literally that
just need a hard path
root/ItemGroup[max(count(ImageAsset))]
otherwise the SelectOrCreate couldnt know where to create
@Squirrelkiller I dont pronounce, I write
 
Writing an before it means you'd pronounce it "expath" though.
 
:)
 
While "crosspath" would be preceded by "a"
 
how else do you want to pronounce it?
hmm...
I pronounce things more like abbreviations
"x" "path"
 
Doesn't have a particular reason though other than "dose 'mericans like to write their cross as x"
So no idea really
 
4:33 PM
more like "I had no idea people considered X a cross"
 
x-mas?
 
one thing I do refuse to pronounce "correctly" is "w"
I just say "wee" instead of "double-you"
@Squirrelkiller cross-mas?
 
lol yeah what did those guys smoke, aint nobody got time for that in english
 
and it aint even double "u", it is a double "v" at least
and if you want to do it like that, then I want to spell "www." as "sextuple v dot"
 
Hi all
 
4:38 PM
[Captain Obvious] Hmm. I'll see if maybe that is less hellish
 
I pronounce "www" as "dub dub dub"
 
[Captain Obvious] dubbul yoo dubble yoo dubble yoo
2
 
:D
 
mr5
world wide web has less syllables than www. fite me.
 
nope, they are the same
"world wide web" === "wee wee wee"
also ^ === "oui oui oui" if you are french
 
4:43 PM
[Captain Obvious] wuh wuh wuh <-- Best way to pronounce it
 
mr5
searching "ouie"
what is this easter egg from google search
@Botler that's funny way to say www kek
I always pronounce it "dobolyu dobolyu dobolyu" because we got influenced by USAnians
 
[Sippy] don't they say dubya
[Sippy] GEORGE DUBYA BUSH
 
5:16 PM
[Captain Obvious] In U S A maybe
[Captain Obvious] Sounds like mr5 is more influenced by brits
 
5:27 PM
[Sippy] > ecause we got influenced by USAnians
 
6:18 PM
[Captain Obvious] Been faffing about for over an hour
[Captain Obvious] xpath and powershell's built in xml shit can't deal with it
 
6:30 PM
Hello
Anyone worked with realtime firebase here?
 
6:41 PM
[Captain Obvious] Yes but I'm going home in a minutes
[KidKai25] Squirrelkiller, wietlol how are you guys!
 

« first day (4119 days earlier)      last day (812 days later) »