« first day (3166 days earlier)      last day (2005 days later) » 

09:00
INNER JOIN - the Fancy where (msdn)
@CaptainSquirrel Frigg that shit arghghghgh
Meaning FooLookup, BarLookup would also require FromJson methods
So every class I create would need to have that FromJson implemented, which leads me to idea of why not just derive it and override if needed
@Squirrelintraining I treat join as fancy select in selects
you cant override a static method
and you cant make those methods generic
I want to kick you for rick rolling me
WHERE in (SELECT)
but i know i shouldn't
also what @Raimonds said
09:02
I love Visual Studios rebase GUI
@Wietlol hey wiet, ever tried doing public static string ToString(this MyObject myObject, int placeholder = 0) { /* logic */ }
What is that @Squirrelkiller
evil laughter commence
Sp convenient
@CaptainSquirrel ♥
@Raimonds Visual Studio is the standard IDE to work in the .NET ecosystem, by Microsoft.
Sorry couldn't resist not to do it kieran
I mean "rebase GUI"
@Squirrelintraining that is overloading, not overriding
A GUI guiding you through the rebase
09:04
Never knew they had one
Including a great merge tool
I am leaning toward console wich each SYNC press
I don't understand hwo people still use sourcetree or a text editor for merging
@Wietlol I know, but now use (new MyObject()).ToString() which one gets called? The standard .ToString() or the .ToString(0) not very clear, you'll need to "think" about that to answer it.
U can have any editor for merges as far as I know
09:05
do I?
it calls the extension method
if you imported it
Are you sure?
@Raimonds You can, but the VS merge tool is superior
if you didnt, it calls the inherited or overridden toString
09:05
I like winmerge more :D
@Squirrelkiller i dunno, you say that but i've been stung by it a fair few times
Well I used to
Also piece of advice kids
That's why you always go over the merge before accepting it, Captain
Don't trap ALL your fingers in a door
it fucking hurts
09:06
By all you mean on single hand
not including legs
and extra finger
FINGERS, not toes
09:07
In my english everything is a finger :D
@CaptainSquirrel That didn't make much sense. Use the !!/help command to learn more.
Hi finger, my finger is finger
Do you think it would hurt more or less if I had 6 fingers on my hand?
09:08
why should it hurt more or less?
hmm...
@Squirrelintraining it appears it uses the inherited method
I think that is hard to measure to give proper response
which means that you cannot overload methods using the same argument list by extension methods at all
If you managed to slam 6 fingers in a car door, you'd probably feel more pain than if you had 5 fingers
09:09
@Wietlol Even if you include using of overload?
I assume you know I am not a fan of C#, but it keeps getting worse
@Raimonds even if you included it
mr5
mr5
Someday I want to get into Wiet's level of abstracting things
@Wietlol It makes more sense because .ToString() fits better than .ToString([randomNumber]) which is why it uses the default one, but it's not clear from the start.
keep dreaming :)
09:11
You will become object
@Squirrelintraining randomNumber?
mr5
mr5
But I think some suggestion is overengineered this time
But isn't overload supposed to have number so no wonder it will use default
@Wietlol I wasn't created enough to write a number
I think .NET is a mess under the hood ;D
It would be more confusing if you would make int optional
09:12
oh wait, I didnt even try with the optional argument
I tried just public static String ToString(this MyObject self)
but even that should work
in the case of the optional argument, it should be the inherited one
Oh i see there is default value of 0
because optional arguments are later on the priority of overloads than no-argument
That should make it confusing
@Wietlol aye
All is confusing
but an extension method should be higher up the priority of overloads than inherited methods
09:13
I am pretty sure it should hit default one, unless explicitly told to use extension
which isnt in C#
It reminds me of css selectors
@Raimonds Always default
whatever is more specifically targeted takes presence
I think if you try to give it int? x which is only known at runtime like from some sort of random 0-1 where 0 would give you null and 1 would give you number it would show that it uses extension method
WHERE BE HECTOR
is ded?
09:18
WHERE hactor.active = 1
who tf is hactor
Also, my fingers are definately bruised
the tips of my fingers
hexadecimal god of thunder
@Squirrelintraining @Raimonds in this case, the priority order is very clear
the calls which use two arguments go to the second function
the call with one argument goes to the first function
if you wanted to make that first call use the second function, you should specify the second argument, which can be equal to the default
(since default values in C# are really poor, you can just specify the value without problems)
Yeah I know that much
09:28
using named arguments, you could also distinguish between the two
Def values are more like fail save feature
mr5
mr5
> Stakroge is a city in central Jutland with 245 inhabitants (2019)
Or awful way to tweak existing function to make ir do more than it should
mr5
mr5
A city in Denmark with 245 inhabitants?
09:29
uh
wot
...context?
"new MyObject().ToString(a: 2); // calls second" wow, I did not expect that
mr5
mr5
I'm not sure if those inhabitants are all people
however, overloads on extension methods has a slightly different priority tree
Anyone remember Satibel?
is he ded
i rmemeber 007
09:31
Hello, anyone knows how to get what number of Monday and Sunday based from the current date?
yeah me too
mr5
mr5
I remember nerdintraining and kamil solekeki
Jun 14 '17 at 18:58, by user7480455
I was kicked in the face by a horse
mr5
mr5
@AppleCiderYummy yes
Let's say, today is 6/17/2019
09:31
i remember nerd in training
and breathing#
so it means, 17 and 23
Monday and Sunday
Nerd in training is @Squirrelintraining
how to get it on C#
Kamil just disappeared
Apr 28 '17 at 18:23, by user7480455
what is RTFM??
man
i miss 007
that geezer
he always brightened up my day
i had a nightmare this morning boys
was it that you were 007?
there was a ryan here as well IIRC
i went out on saturday night and took my car, got a taxi home
didnt go back to get it yesterday
so walked out the house this morning to drive to work
obviously it wasnt there
i had to get a taxi in
09:33
i was raging
@Raimonds @Squirrelintraining
Nov 2 '17 at 19:18, by user7480455
If it requires that much coding we dont need it..
this priority order is mostly considered wrong
most language prioritize extensions over inherited methods
because the extension in almsot every case is written for that type and knows that that method is already a member method
words to live by there guize
back in 85
wow
09:36
I anybody here doing CodeWars?
I will apply for a job. Would you recommend to write about my Codewars training?
*Is
I have this.
public static class DateExtensions
    {
        public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startOfWeek)
        {
            var diff = (7 + (dt.DayOfWeek - startOfWeek)) % 7;
            return dt.AddDays(-1 * diff).Date;
        }
    }
but what about the end of the week?
@AppleCiderYummy return StartOfWeek(dt, startOfWeek).AddDays(6)?
...i have two methods that do literally the exact same thing
yet
one returns true
and one returns false
i just
wot
that's scary
there must be a difference somewhere
09:41
sec
the only difference is how they are returned
Figure that shit out
@Harry scary
I would say some imigrants stole it but since this is not in germany
@CaptainSquirrel Put it into a copypastable format and I'll try it on my machine :D
public static bool TryParseDateTime(this Field dateTimeField, out DateTime dateTime)
{
	// 20190325T114912Z
	var result = DateTime.TryParseExact(dateTimeField?.Value, "yyyyMMdd'T'hhmmss'Z'", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal, out dateTime);
	return result;
}

public static bool ParseDateTime(this Field dateTimeField, out DateTime datetime)
{
	return DateTime.TryParseExact(dateTimeField?.Value, "yyyyMMdd'T'HHmmss'Z'", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal, out
@CaptainSquirrel LIES!
Just replace dateTimeField with a string that equals "20190325T114912Z"
@Squirrelintraining DID I JUST BLOW YOUR COVER
I'M SORRY
... this fire alarm test has been going on for a good 10 minutes at least
09:47
@Wietlol why you pinigng meh
they have tested the alarm about 7 times
why
we can hear that it rings
@CaptainSquirrel What cover? cough
I don't know what you are referring to @Squirrelintraining cough
haha they just try to drive you insane
and make you riot
@CaptainSquirrel here, take this blue pill hand a box with EDMA written on it
09:49
@Wietlol YAML is just a different notation for JSON. All the JSON types can be represented. Objects, arrays, numbers, strings, booleans, etc.
@Neil it works with add6
@Squirrelintraining because that link was related to overload priority order
10:06
@CaptainSquirrel Wait what's Field?
Is it like...a nullable string?
Optional<string> ?
@Squirrelkiller its a data type that comes from the CMS that we build ontop of
.value is a string
so just pass it as a string :D
10:33
yeye
!!meow
Hi guys, Please how would you model the following relationship in entityframeworkcore using fluent api?gist.github.com/FrankDupree/382fce6bba40b87e5be95256569f10dd
right in the kisser
@CapricaSix and @Hans1984 please guys help me!
10:34
@FrankDupree CapricaSix is a bot
And if someone can help you, they will
@CaptainSquirrel oh my gosh! thanks for the heads up
Don't mention it :D
let me have a look..
well i asked ages ago, and no answer
10:34
People are busy my dude
this is the original question on stackoverflow stackoverflow.com/questions/56584027/…
unfortunatly I can't help you
I looked at it
I can't either :/
:(
please any ideas where i can get help
i also tried gitter
Maybe try the sql room
You may gain some insight about the foreign key issue
10:36
ah yes, didnt think of that. gracias
smart Squirrel
You don't get to be a captain by being stupid :D
true that
Hi
I have an inputString = "0:00:00"
I want to fetch Hour
10:51
refactoring old spaghetti code
> // todo cry
// todo cry even harder
but I should then get "00" instead of "0"
two methods are a big pain
I tried TimeSpan
TimeSpan.ParseExact(item.LocalEventTime, "H:m:s", null).ToString("HH:mm:ss");
but get input string in incorrect format
Do you want the hour as string?
yes
10:53
yourString[0].ToString().PadLeft(2, "0")
Wait no
pseudoCode:
Get characters from myString up until and excluding the ':'.
PadLeft with 0 so it's 2 characters long.
... Why don't you just .ToString("HH");
?
yes simple! "_"
Why don't you simply append n 0s to the front, then do slice(-n) on the resulting string?
because I have the original in String @CaptainSquirrel
Why don't you just use DateTimes properly
10:57
^
What type is item.LocalEventTime
string
myString.SubString(myString.Find(";")).PadLeft(2, "0");
There you go
@CaptainSquirrel Object
Convert.ToDateTime(item.LocalEventTime).ToString("HH"); ?
10:58
@CaptainSquirrel Because we don't do that anymore in germany (HH = Heil Hitler)
@CaptainObvious I am getting the input in the file in that format only
@Squirrelintraining We aren't?!
@Squirrelkiller Bavaria doesn't belong to germany
We're in HH though

« first day (3166 days earlier)      last day (2005 days later) »