« first day (4022 days earlier)      last day (909 days later) » 

Ben
2:13 AM
 
 
4 hours later…
6:18 AM
[Squirrel in Training] old but gold
 
 
1 hour later…
7:37 AM
lol
 
 
1 hour later…
8:56 AM
[Captain Obvious] It's that time again lads
[Captain Obvious] DESK UPDATE
 
botler broked again?
oh
 
[Captain Obvious] Manchester Edition
 
ooh mike ashley mug
 
Needs a vertical screen in the middle
 
[Captain Obvious] Unfortunately the screen on the left is only mine until somebody else needs it
[Captain Obvious] And the mike sweatshop mug because bitch mugs are pointless. I have a different large mug at homr
[Captain Obvious] Also, VOICE PARTY IN DISCORD
 
9:08 AM
A fine addition to my collection.
 
CHENEERAL KEENOOOBIII
 
@Botler sexy
sports direct mug - noicee
 
9:23 AM
that is a TypeScript mug
 
9:36 AM
[Captain Obvious] what no
[Captain Obvious] Sports Direct, absolutely terrible company who exploit mostly eastern european workers terribly and sell crap sports clothing. But they make huge mugs
 
Everlast
Lonsdale
 
[Captain Obvious] Karrimoor, Firetrap
 
Firetrap lol
 
[Captain Obvious] Can't think of any more, let's wikipedia the list
 
The way they separate them brands in store - to all other brands
Under Armour, Nike..
I bought a Kappa jumper recently
Spilled a pint a of Guinness all over it
 
9:40 AM
[Captain Obvious] Donnay, Airwalk, British Knights, Gelert, Hot Tuna, Kangol, No Fear, Slazenger
 
No Fear - I had bright blue shoes when I we're 13-14
Slazenger - School bag
 
[Captain Obvious] You may notice that almost all of the "real" brands that sports direct owns are all names that that they bought on the cheap when the associated companies went bankrupt
 
They're a dodgy company
From all the comments I heard
But, I still buy some of my sport gear from there.
 
nothing wrong with slazenger
great tennis brand
 
[Captain Obvious] Evans cycles - Acquired by PE firms in 2008, Went bust in 2018, now owned by SD.
[Captain Obvious] Actually Slazenger (as part of Dunlop) was sold in 2017 to SRI, a japenese firm who owned the rest of the dunlop companies
 
9:47 AM
i get a load of slazenger stuff
 
[Captain Obvious] So now they're OK, but from almost 15 years they were owned by SD, who bought them from RBS in 2004 when they were desperate for cash
 
trackies, trainer socks, balls
 
[Captain Obvious] Donnay - Went bust in '88, brand rights sold around for a while before eventually landing at SD in '96
[Captain Obvious] No fear - Went bust (chapter 11) in 2011, acquired by SD
[Captain Obvious] Karrimoor - bust in 2003, name rights bought by SD
[Captain Obvious] In that case they actually bought the whole company, sold off all the outlets and manufacturing and basically just kept the brand rights
[Captain Obvious] "Following completion of the transaction, customer service activities such as lifetime warranties and repair services on previously sold goods were cancelled or outsourced. Manufacturing in the UK largely ended."
[Captain Obvious] My favourite thing about sports direct is they have a chain called sweatshop too
 
10:26 AM
@Botler thats hilariously meta
 
[Captain Obvious] Do you want something less meta though
[Captain Obvious] What they did with USC is awful
 
11:03 AM
i wna do a youtube channel but idk about what
ive been helping a mate of mine with his since last year and hes on 6k+ now
 
11:17 AM
so, code design question
I have a set of models with hundreds of properties for various purposes
the input of the functions is the root model, but different functions use different properties from the model
all properties are nullable, as they are not always mandatory, but I don't want to end up having to resolve null reference exceptions everywhere
how do I use the model in a nice way to avoid the NRE, yet not duplicate any information
so, no different models for the different functions, and no helper functions by passing in the name of the property that is being read
what I currently have is a helper function T Required(this T? value, String identifier)
so I can read stuff like party.BirthDate.Required("BirthDate")
but then I have to constantly double check that the property I am reading has the same name as the string in the required call in order to make the resulting exception (if the value is null) meaningful
 
11:48 AM
I don't completely understand at which point you are.
The birthdate is optional in the model, but when it isn't there you throw? Why is it optional in the model then?
You can add [Required] to the property to automatically invalidate the ModelState of the controller so then, you can go if(!ModelState.Valid) throw new ArgumentException(ModelState); or something to get a nice exception with all invalid properies and meaningful messages for each.
ModelState serialises to a dictionary with its invalid properties as keys and their respective error messages as value using SerializableError
 
mr5
@Wietlol hmm, can you do: identify a case in which some properties are mandatory? if there exist a case like that, categorize it as such and form another model/function maybe out of it?
 
12:48 PM
but then I would duplicate a portion of the model
which I cant do
@Squirrelkiller the model is used for 10 functions, only in 5, the BirthDate is mandatory
@Squirrelkiller not using any framework
 
mr5
how about a factory of the same model that requires birthday, and optional same model parameter?
 
[Required] is part of System.ComponentModel, from the standard library
Bet there's some kind of method somewhere in ComponentModel that validates a model for you.
Ah but I see that wouldn't work for the other 5 functions
Sounds like those 5 functions need some kind of Guard with an appropriate name fitting a shared context of those 5 functions.
 
1:07 PM
@mr5 the factory wouldnt be used though
and even then, then I am still making specific classes for the specific use cases
 
mr5
yeah, much better
 
@Squirrelkiller still, I would have to put these attributes on the properties, but the properties are not required, not in all cases
 
mr5
did you initially design that?
 
I would want all properties to be optional except when I use them... except when they are optional still regardless of wether I use them or not...
@mr5 nope
I havent designed any of it
 
mr5
eh, why not just dictionary
 
1:11 PM
I suppose I could just re-generate the models but alter the getter to assert non-null
 
mr5
and maybe wrap the dictionary and expose the known properties
 
but then the return type (nullable) from the getter is wrong
@mr5 are you actually recommending me to use a dynamic type?
 
mr5
like the dynamic keyword?
if so, nope
 
@mr5 the question is how I would expose those properties
dictionary is a dynamic object just as much as dynamic is
dynamic just has weird syntax
 
mr5
I'm referring to something like
{
	private dictionary;
	public SomeThing => (type)dictionary["haha"]
}
 
1:15 PM
and then the Something would have to be present in the dictionary
I cant change the model though
 
mr5
you can
just press shift + delete on the file
 
I am looking for something like model.Something.Required() where the implementation of Required() can throw an exception with a message like "Property 'Something' is required but not present."
 
mr5
and obliterate the repo
but then you would do it for each properties
which is not iterable
unless you use reflection
 
currently, the implementation of Required is this
public static T Required<T>(this T? self, String identifier)
    where T : struct =>
    self ?? Throw<T>(identifier);

public static T Required<T>(this T? self, String identifier)
    where T : class =>
    self ?? Throw<T>(identifier);

private static T Throw<T>(String identifier) =>
    throw new NullReferenceException($"Value for {identifier} is not allowed to be null.");
the problem is I have to pass it the identifier
which I do not want to pass manually every time
 
mr5
oh, I think you can use [CallerMemberName] with that?
 
1:21 PM
but it is not the caller that does it... is it?
 
mr5
[CallerMemberName]string? identifier = null
idk
 
Those properties you need in 50% of cases, can you extract them to another class and put that there? Then make that new property optional and the properties inside required, so now you only check the one property (like maybe CalculationInput.Person is optional, but Person's properties are required).
 
CallerMemberName is the name of the function where this function was called
not the name of the property that was passed to the first argument
@Squirrelkiller no can do
the structure of the models has to remain as is
what I could do is something like person.Get(it => it.BirthDate)
that way, I think I should be able to read which property is being used in the lambda
 
Can you just remove them from the model and make a new model, extending the original, that has those needed properties. Then use the more specific model for those 50% of calls that need the properties?
 
the same way how EF generates the sql queries
@Squirrelkiller then the class hierarchy would become a matrix
C# cant do that
 
1:27 PM
Like Customer : Person where Person is used everywhere now but only Customer has "CreditCardNr"
 
mr5
1:38 PM
holyfakk
Visual Studio 2019 is still using IE internally to sign in on accounts
 
I mean, windows explorer is IE in disguise too basically
 
mr5
1:56 PM
ehh
I just opened an 8 month old project
and I can't fucking compile it now
 
ew
 
mr5
for some reason, this stupid nuget decided to be broke all of a sudden
 
2:15 PM
Ryan Donovan on October 20, 2021
Originally, React mainly used class components, which can be strenuous at times as you always had to switch between classes, higher-order components, and render props. With React hooks, you can now do all these without switching, using functional components.
 
mr5
I need a missing package which is considered as system level
nuget won't let me install it because there's a missing package
shite
great
the solution to fix my issue is to reinstall my VS
cuz there is a specific setting that VS sets during installation and it can only be set once
such great developers
the value of this setting is a path to a non-existent drive which I recently replaced from D:\ to F:\ cuz for some reason, Windows cannot reallocate on the old drive letter
 
2:37 PM
:/
 
What setting is that
 
mr5
where the shared something something side-by-side nuget path installation
 
Isn't that nuget config though
 
@Squirrelkiller windows explorer?
 
Somewhere like %USERPROFILE%/.nuget or so
 
@Harry Yes, windows explorer
 
the file explorer?
 
Yes the file explorer
@mr5 Can't you just change those registry entries and reboot or something?
 
mr5
haven't tried
on the link, it was referring to an SDK
but on my case, it's a nuget of something System.Memory which is looking under D:\ (non-existent)
I am not sure where I can change that
new all time high
 
ada and shib are what im keeping my eye on
 
mr5
2:57 PM
ada is more like a stable coin now
 
nah not really
its just a slow dev cycle
xlm is p much a stablecoin
 
mr5
xlm, xrp, those coins sounds like older than btc
I would expect a major dip anytime soon now or maybe if btc reaches 70k
 
a lot of whales will pump and dump i think
 
mr5
are you a whale
 
nah
i aint got that kind of money
im in this for the long run
 
mr5
3:04 PM
ha
long run, like a decade?
 
maybe
 
mr5
get prepared to get whooped
 
we'll see how it goes
i havent put that much in anyway
 
mr5
cuz this btc is about to get shorted
 
to be honest i started investing cause i was losing too much money on skybet
so i stopped and went for something i know a little bit about
 
mr5
3:05 PM
investing on crpyto? I thought it's used for losing money
 
so far im massively up on what ive put in
which like i say really isnt much at this stage
 
@mr5 Have you checked the default package source?
 
mr5
where I can change that?
@Harry like $5k?
 
fucking hell no
im literally on about peanuts at this stage
 
mr5
you sound like it's not true but it is
 
3:18 PM
[Captain Obvious] haha btc
[Captain Obvious] 😦
 
nah honestly ive not put in much at all
 
What is this element called in HTML?
 
mr5
attribute
 
thank you
 
mr5
wc
 
3:30 PM
In VS I just put "package" in the search bar at the top and it finds package sources
Options > NuGet Package Manager > Package Sources
 
how can i check if a comboboxvalue is changed from from index a to index b
as in if the index is already set to 6 and is saved but the user changes it to 0 and saves that change
 
mr5
@Squirrelkiller the remote repo where the package should be find?
 
!~shiba
what a day.....
:'(
 
4:25 PM
@mr5 Check in the csproj or package.config (if it exists) if there's a path pointing to D: somewhere
Then check if that NuGet.targets has something pointing to D:
Then check %AppData%\NuGet\NuGet.config
 
mr5
4:41 PM
it's nowhere to found in any of those locations
running the VS installer, that particular thing is fixed
I'm not sure why/how I set it previously on D:\ instead of C:\ where my OS is located
 
mr5
5:36 PM
that registry path doesn't exist in my machine
uninstalling VS and installing a different version doesn't fix it
fuck
 
5:56 PM
I mean, could always net use F as D
 
Hello everyone!
 
Hi Dan
@mr5 check your nuget config in the IDE?
 
6:49 PM
So the entity has Id, Name and ParentId, which reference the same table.
In EF I select those three properties into a model.
Why does EF generate a SQL query that, as expected, selects Id and Name from the entity, but also totally unexpectedly 1) joins the entity on its parentId to 2) select the parent's Id? What the fuck?
 
 
3 hours later…
9:58 PM
 

« first day (4022 days earlier)      last day (909 days later) »