« first day (2783 days earlier)      last day (2391 days later) » 

mr5
mr5
02:43
\.
 
4 hours later…
06:23
Goood moorniiiing EeeeemptyCSharpChatroomThatSeemsToBeStillSleepingAndIsProbablyWaitingForItsFIrst‌​CoffeeToooooooooo
07:09
I want to convert 1.1 to 2
is there a maths operator for this?
.Ceiling(1.1) == 2
or just .Round(1.1)
ah Ceiling
thanks Squirrel :)
.round always rounds to the next even number (easiest for a pc cuz it just does what binary does), and ceiling rounds up :)
07:22
@Squirrelkiller tips fedora Good morning.
Good morning everyone
Morning Hector o/
I read that with a high-pitched voice. I then laughed in a silent room like an idiot and everyone looked at me like "he lost it with those reports".
mr5
mr5
Hector sounds like a guy from a Spanish Telenovela drama
In Greek mythology and Roman mythology, Hector (; Ἕκτωρ Hektōr, pronounced [héktɔːr]) was a Trojan prince and the greatest fighter for Troy in the Trojan War. As the first-born son of King Priam and Queen Hecuba, who was a descendant of Dardanus and Tros, the founder of Troy, he was a prince of the royal house and the heir apparent to his father's throne. He was married to Andromache, with whom he had an infant son, Scamandrius (whom the people of Troy called Astyanax). He acted as leader of the Trojans and their allies in the defence of Troy, "killing 31,000 Greek fighters", offers Hyginus. During...
FYI
As far as I know, most telenovela dudes have 2 first names. Diego Armando, Jose Antonio, Pedro Miguel...
07:45
good morning
Morning ntohl o/
TIL: messages replying to users (with \@ntohl e.g.) don't one-box, but messages replying to a message (\:123456) do.
Damn, hoped I could escape the pings
What do you mean with one-box?
@HéctorÁlvarez Is this a one-box?
The only difference is that it points to the replied comment AFAIK.
2 mins ago, by Héctor Álvarez
What do you mean with one-box?
07:53
Aside from that, can someone explain in layman terms what the hell is this Aspect-Oriented Programming paradigm?
^That doesn't show a link, but your comment. That is a one.box
Ooooh I see what you did there
4 mins ago, by Héctor Álvarez
Sup
I can achieve this with a full link
42
A: Which links and sites are handled specially in chat?

Juha SyrjäläThe current list of integrated (we call this onebox, or oneboxing, ala search engines) sites is: Stack Exchange sites: Questions / Answers / Users / Comments Stack Exchange Chat: Messages / Rooms / Bookmarked conversations Area 51 proposals Posts from the Stack Overflow blog and the Server Faul...

@KendallFrey How about this version, wanna replace the link in welcome-c# now? github.com/StackOverflowCSharpChat/CSharpChatWiki
if You check 1st starred message without context, You can read it as "Roughly 98% of the time I see someone refer to Lord of Destruction it's because they want to sound smart..."
Morning c#ers
mr5
mr5
08:13
so *is
why are wednesdays the worst.
truly I never question my worth more than I do on a wednesday.
@ntohl My thoughts exactly!
08:40
good morning.
Any has an idea what Aspect-Oriented programming is about?
In simple terms, because Wikipedia is (as usual) overly technical.
Why `obj + "a"` is compile-able while `obj + 3` is not?
sometimes I lose the basics :(
Whats obj?
object
Hm
it looks like it implicitely converts to string
Yup it does. obj goes tostring to be able to work with +"a".
08:48
a + b where either is an instance of System.String will make the other call the ToString() method
except if the other is also an instance of System.String
@HéctorÁlvarez Generally speaking, it's about having your methods only contain your business logic, while extracting non-functional aspects of it (logging, validation, etc) out of the main method logic.
So, for instance, a C# implementation of AOP (such as PostSharp) will use attributes to specify aspects, let's say for logging:
So, for example I would encapsulate logging and attach it to a method using an attribute tag. Do you mean that?
can someone clarify why "Functional Programming" is "the death" of "Object Oriented Programming"?
[Log(logEntrance:true, logExit:true, logExceptions:true)]
public void DoWhatever()
{
    JustTheFactsMaam();
}
@HéctorÁlvarez Exactly.
I know Functional Programming doesnt like Mutable Object Oriented Programming, but Immutable Objects go hand in hand with Functional Programming imho
08:54
Cool, then I wasn't straying too far from the idea.
I've been doing this lately without knowing there was a paradigm around it.
Common uses are for authorization (commonly used in WebAPI, using attributes such as [Anonymous] or [Authorize]), for raising INPC events (instead of manually calling RaisePropertyChanged on each setter)
We used Postsharp quite extensively in a project a while ago for things like that.
@Wietlol many say functional programming and OO are ortagonal. And You should do both
public bool HasData {get;private set;}

[NotifyPropertyChanged(linkedProperties:nameof(HasData)]
public Whatever Data {get;set}
@ntohl I made a statement yesterday evening saying "everything is OO these days"
This will not only raise a PropertyChanged event when a value is set to the Data property, it will also raise an event for HasData, without having to specify the boilerplate code in the setter itself.
08:56
but then someone said "no, everything is going to functional programming so no OO"
Guys
Guys guys guys
Github wiki page works :D
https://stackoverflowcsharpchat.github.io/
@KendallFrey Time to update the link!
@Wietlol Not everything that has a data structure is OO.
not every OO is class based OO
This looks like a great idea. Why haven't I used it before?
but any self designable data structure can be considered OO afaik
08:57
@HéctorÁlvarez There are drawbacks. It can be a pain to set up (it relies on a framework to either generate code behind the scenes, modify the IL directly, or (rarely) add runtime hooks to your code).
Ooooh, shady code can be really painful to debug.
Also, there are the criticisms that it makes it harder to understand what is really happening when you call a method. I think that it's not a relevant criticism - when you're using frameworks like WPF or WebAPI, you're already inside a relatively complicated system that does a lot of magic - something hooks up your Bindings, or dispatches HTTP calls to your Controllers. Web service middleware is already a form of AOP, allowing you to handle enter/exit events.
Right, I'm thinking of routing.
@Wietlol just keep up the sandwich, and use pure functions in between. No out parameters. Etc..
I believe complexity is the only way to make stuff simpler. Every time I want to make stuff perform better, I always end up adding a new layer of complexity so every goes smoother in the end.
09:02
@ntohl out parameters? i think we have generally accepted that that was a horrible idea
tuples have similar behavior and have no real drawback (except for how some languages use them in the syntax)
at least if you use value types
> "We can solve any problem by introducing an extra level of indirection."
> "... except the problem of too many levels of indirection"
> We can solve any problem by introducing an extra level of indirection.
where did I hear that before?
need sauce
mr5
mr5
I believe I just read an article yesterday telling me that
@AvnerShahar-Kashtan You just need an extra level of indirection that leads away from indirection itself.
09:07
at around 30 min there is the "sandwich" I'm talking about
i find haskell one of the most obfuscated languages
... maybe after cobol
mr5
mr5
Incidentally yesterday, to my frustration as I am fixing a God Object code, I searched for "Why most developers avoid making abstractions..." and that's why I recall that phrase
Morning aAll
Fuck I can't even get that right
...hungarian? Here?
ye?
what hungarian? Hungarian nationality person, or hungarian notation user?
09:18
Not Hungarian, hungarian!
notation
mr5
mr5
lszSquirrel.mType = kSquirrelType.cKiller
@ntohl if you are talking about ~35:00, then I can tell you that is not proper object oriented code :D
User::sendEmail is not properly object oriented
sendEmail is supposed to be in a class that takes the responsibility of sending emails, not the user who the email is supposed to be sent to or from
especially to since you can send to many people
crud operations arent supposed to be inside the user either since they should be in the user repository class
For kinda being microsoft, blogs.msmvps.com is a really old looking website.
addStuff and removeStuff (which would be create and delete operations) could be if they were added for a collection property of the user
@Squirrelkiller It's not MS operated, from what I can tell, and it's running on Wordpress with a very ugly theme.
09:29
ok... he actually moves to that
> then someone comes by and totally ruins everything
can confirm
😃 yeah. First watch it through
Hey guys, very sorry for leeching here!! Does anyone know a way to list all methods (in a project/solution) which do not contain documentation strings, using Visual Studio 2017?
Define "documentation strings"
A summary, that thing built with /// ?
Just comments anywhere in the method?
09:45
@Squirrelkiller exactly that!
gplay music is recommending me mcap steve
and idk why.
I'm scared
Spotify this week has been recommending all sorts of dumb shit
@indexoutofbounds Which one? The first, or the second, or both?
m'cap steve
m'cap steve is pretty great but I don't think I want to listen to it anywhere other than a crowded discord voice chat.
why do C# method references suck?
and why cant I use property accessors as method references?
09:52
Have you tried get_PropName() ?
Also, why not just use the property? I see
.Select(myObject => myObject.MyProperty)
vs
.Select(MyObject.MyProperty)
or
.Select(myObject => myObject.MyMethod())
vs
.Select(MyObject.MyMethod)
myObject => is just noise
.Select(MyObject.get_MyProperty) ?
and since the compiler messes up the scope reservation of the variables, you cant have that name somewhere else
After all, that's what the prop gets compiled to
neither get_Property nor Get_Property find a match
09:55
damn
`private string GetMyProperty(MyObject myObject){ return myObject.MyProperty; }`
and then
`.Select(GetMyProperty);`
@Default then we just agree that C# properties suck
which is something I have been tempted to do for quite a while
1. Ugly because extra method
2. private?
you pass a Func to Select - if you need another type of selector you can probably fiddle with it yourself
since interfaces cant deal with it properly, method references dont work, setters arent overloadable, etc
09:57
it doesn't suck because of it. It's you that think it's verbose - I don't think so
@Squirrelkiller why not private?
implicit operator to the props type returning the property?
not verbose, simply lacking functionality and giving errors when certain things are perfectly fine
it's not fine - you're not matching the argument
@Default I assumed he's calling .Select from outside the class.
private is perfectly fine anyway
09:58
@Squirrelkiller nice try, but im not trying to obfuscate my code
Why not? It's industry standard!
@Squirrelkiller if not now, then i will tomorrow
Hello,
Anybody has any idea how to resolve 403 forbidden error while calling web api by passing token in request header as bearer token.
Token generated successfully but when trying to call authorize controller it returns 403
Pass the right token? Use a working certificate?
Yes passed right token
10:01
Or debug hte damn controller
It is working on development server but not working on production
Put logs everywhere. Log request, log token, log validation, log whatever you can. Read log, see what goes wrong.
Or remote debug hte failing controller
Where does it validate access token?
No idea, ask your controller?
I mean where does it saves token on the server and how it validate against generated token?
10:05
My controller's first line is var player = GetPlayer(Request.Headers["token"]);
How do you send the token? Query param? request body? header?
I am passing that in header as
Authorization: Bearer <access_token>
And what does the controller do?
@Squirrelkiller A summary, that thing built with /// is what I meant.
Controller has only [Authorize] attribute on it
To allow only valid request
@Kaishu Did you ask google and msdn and the dude who wrote it what that attribute actually does? Because I don't know.
10:10
@Squirrelkiller, It specifies that access to a controller or action method is restricted to users who meet the authorization requirement
@indexoutofbounds I don't have an elegant way right now, but Sandcastle is a library that generates a help file fo your program, by taking all summaries and putting them in a file with their respective method & class names. I heard it only works if you have everything documented, so maybe see if that tells you what methods lack a summary
I'm going to ask a rather stupid question, but for the sake of actually being able to debug some broken queries using a broken custom framework that takes a List<string> to return a string along the lines of "SELECT foo, bar, gee..." I would love to be able to debug while in a transaction, or at least see what values are being saved sequentially. Do you know if there's any way to do this without removing the transaction itself from code?
@Kaishu And who defines the authorization requirement?
@HéctorÁlvarez What kinda transaction?
@Squirrelkiller I will look into it, thanks!
@Squirrelkiller A MSSQL transaction running from code.
10:17
Not sure why you wouldn't be able to debug it. The sql transactions we have in our code, c# doesnt much care about.
I would love to assert it's a SqlConnection object instance, or that I inherit from it in some way, but then again it's custom and has no inheritance at all.
Well, it locks the tables while in the transaction so I can't do jack shit.
Why would a sql transaction block anything from c#? Why should c# care about some transaction? The transaction happens on the db right?
Wait you mean you wanna see what happens on the db?
:42732330 	class Foo
	{

		public Foo()
		{
			Func<int> getter = (() => this.MyProp);
		}

	    private int MyProp {get;set;}
	}
that doesnt solve my issue
And then go .Select(Foo.getter) ?
10:23
yeah. But it's a property reference. Your problem is something different...
ah, you missed the Getter method
it's inference
why is inference a problem?
obj => obj.MyProp
vs
Foo.MyProp
@Squirrelkiller Exactly.
that's explicit vs infered lambda
10:24
ow yea
the syntax is ambiguous
@HéctorÁlvarez If the sql profiler doesnt help, no idea. Either debug the c# code, or ask the sql room I guess.
at least with member methods, it should be able to do so though
Select(Object.ToString) doesnt work either
@HéctorÁlvarez Or somehow mock the db connection and debug that :D
why should it? Select wants a lambda, not a delegate
@ntohl im used to a different notation, which doesnt have this ambiguity
Select(SomeHelperClass.SomeHelperMethod) works
this is how method references work
the signature of member methods and helper methods is the same though
so, it should be able to understand the method reference and compile properly
yet it doesnt do this
10:27
that's because of the awesomeness of implicit conversion from a method taking an argument with the same type of the lambda to a lambda.
i dont really understand that
private FooBar SomeMethod(Bar foo) {...} implicitly converted to (foo: Bar) => {... return new FooBar();}
if the signature is same, it takes SameMethod as lambda
but it doesnt do that awesome implicit conversion
it should, but it doesnt
but it does sometimes. Not for Property getter, but it does
not for member method either
only for static methods
10:32
@Squirrelkiller I got rid of the transaction and it does exactly what I need. I cna debug step by step and see results coming directly, I don't have a problem deleting what I insert or whatever I need, but it would be convenient if I didn't have to manually comment out some code which, eventually, will be forgotten to un-comment more than likely.
The SQL wouldn't help much either, they know about SQL, not how Visual Studio can handle transactions using this or that method.
#if RELEASE
return new ClassThatIsNotTheReturnType();
// yourCommentedOutLine();
#endif
How about #IF DEBUG and do the opposite, just so the release code is as optimized as possible?
IDK if the compiler will get rid of that preprocessor directive when optimizing code, but debug surely won't
Or that.
Was aiming at "When building release, this wont compile so you get back and remove all debug adaptions".
        List<Bar> bars = new List<Bar>();
		public Foo()
		{
			foreach (FooBar fooBar in bars.Select(MySelect))
			{
				string aaa = fooBar.ToString();
			}
		}

		private FooBar MySelect(Bar bar)
		{
			return new FooBar();
		}
MySelect is non static
hmm... it seems I have multiple candidates
the other issue was because of type arguments boundaries
I created an Optional<T> or Maybe<T> or whatever so we can have explicit nullability
but the select method in that one has an issue with variance
but right now, im not sure why it has multiple candidates on the method reference of ToString on a Select of a list of Guids
i mean, with the arguments, the latter 2 cannot be used at all
10:47
()?
no, not missing parens
I initially read that as parents
Also I don't see what the issue is. GUIDs have a bunch of ToString overloads.
@LeeButler Yeah, but none of those overloads take a Guid argument.
I would expect ambiguity if you had ToString(), ToString(Guid) and ToString(Guid, int) which are the overloads of Select.
but only one of them has the signature ToString(Guid)
the others have the signature ToString(Guid, String) and ToString(Guid, String, IFormatProvide)
so, the method reference should be able to find the appropriate solution
@AvnerShahar-Kashtan only the second exists out of those 3
the first doesnt since the signature of member methods has the enclosing class type as first parameter under the hood (supposedly)
the only issue I could think of is that it is a method group rather than a function
but since other non-static methods do work, that is nonsense
Interestingly, I get a different error. Is this a compiler error or just intellisense?
11:00
Oh shit I misread sorry
intellisense
I do have Rider so the mssages could be slightly different
note that Guid.ToString and Object.ToString give different messages
Wait, Guid doesn't have a static ToString method.
Java does it differently here than C#. In C# you can't pass a method group this way.
You'll have to do it as Select(g => g.ToString());
Because Guid.ToString is a method group describing a static method on Guid.
64b g7ptg]'h]h
]hh
Sorry. 18 month-old got a hold of the keyboard.
11:18
Nice.
@AvnerShahar-Kashtan 😃 welcome-C#
tell him/her to write MVCE :)
Minimum, verifiable, complete poop.
:42734243 Yeah, I considered going there, decided vulgarity was the right tone here. :)
Oh damn I missed that
11:30
@AvnerShahar-Kashtan can ur kid write fizzbuzz?
@Lemonade1947 If by "write" you mean "poop", and by "fizzbuzz" you mean "poop", then yes, yes he can, and well.
I don't understand why anyone would have kids.
Because it's fun and rewarding.
Doesn't sound it.
I mean I'm not saying you shouldn't, but I can't understand why someone would and it's definitely not for me
11:32
That's because people usually like to talk about the poopy bits, not the good bits, which usually come off as cloying.
Allegedly it's fun and rewarding when they're not being little shits
Plenty of good bits. Plenty of bad bits too, same as everything else.
I wonder how Squirrel In Training is managing
The good bits are really good, though.
It has the potential to go so wrong, though.
What if I have a problem child
I have to deal with it for at least 30 years, probably.
Can't be dealing with that.
11:34
Not long ago my girl just got enough long hair for pony tails. It was most rewarding.
*shrug*. I'm not out to convince anyone. I'm all for not having kids unless you really want to.
Best for the (non-)parents, best for the kids.
Oh yeah, I'm not trying to say anyone shouldn't have kids. But I do seek to understand why they do.
@LeeButler Squirrel in training is now training two little squirrelinos to not poop their pants all the time, while sometimes building a little teambuilder applicatino for our dota clan :)
Plenty of reasons. The feeling of watching a person shaping up from nothing is amazing.
Oh shit you actually know eachother
I just thought it was some weird squirrel naming circlejerk
11:37
^ me too thanks
His wife thinks we're secretly gay. Don't tell her she's right, she'll believe you.
Maybe it's true
Absolutely
@AvnerShahar-Kashtan I can, to an extent, see the appeal of the good bits, the bad bits just don't seem like they make it worth it, though.
Which are the good ones, the 1's or the 0's ?
11:39
A kid is a responsibility, not a whim.
I'm pretty fed up with people running around "Oh man I want to have a kid to stroll it to the park", 5 minutes afterwards they're like "oh wow, cleaning a baby's ass is so gross, I leave that to my husband/wife, I'll feed it".
I mean I don't want people to stop having kids, that'd be problematic.
"I have to have kids for the future of humanity" isn't a very good reason either.
I would want people to not feel obligated to have kids.
11:42
I don't understand this
If the whole world stopped having kids, it'd be bad. If countries with over 10% of the earth population stopped having kids it would be great.
it's like saying "if you don't want to get murdered, just kill yourself"
@HéctorÁlvarez yes, this.
I don't think their point is to save themselves
Become less dense, by being totally dense!
@KendallFrey I know
But why do they... care... if they won't be there...
Like, maybe this sounds selfish
11:44
It's because of this emotion called empathy
Some people have a lot of it.
yes. -people- do
Oh hey @Kendall. How about changing that dead link to this one stackoverflowcsharpchat.github.io ?
Why do you keep pinging me about this
Animals are not aware of their own mortality (with some gray areas like, idk dolphins and that kinda thing)
Because the link is dead, and links aren't supposed to be dead
11:45
Are you sure?
Seriously.
@Squirrelkiller If you're so worried, fix it
Can't, only the creator can make Cap forget a command.
Really?
How do we make you forget it?
11:46
The creator of a command?
I know that's not accurate
what is this sarcasm font
I know hector wanted to do that, but he couldnt because I forgot to have Cap forget a test command.
Dunno but FrendallKey made it
that doesn't look very sarcastic
There used to be a userstyle for that floating around
You could use the Irony mark.
Irony punctuation is any proposed form of notation used to denote irony or sarcasm in text. Written English lacks a standard way to mark irony, and several forms of punctuation have been proposed. Among the oldest and most frequently attested is the percontation point proposed by English printer Henry Denham in the 1580s, and the irony mark, used by Marcellin Jobard and French poet Alcanter de Brahm during the 19th century. Both marks take the form of a reversed question mark, "⸮". Irony punctuation is primarily used to indicate that a sentence should be understood at a second level. A bracketed...
11:49
!!commands
@ABuckau That didn't make much sense. Use the !!/help command to learn more.
Honestly I feel like if you don't structure your sentence in such a way that irony/ sarcasm is obvious, you should get better at articulating your ideas.
!!/help
@ABuckau Information on interacting with me can be found at this page
11:50
!!listcommands
@Squirrelkiller help, afk, backup, ban, clap, convert, define, die, doge, eval, forget, google, hang, imdb, info, jquery, learn, listcommands, listen, live, mdn, meme, moustache, msdn, mustache, nudge, quote, refresh, spec, stat, stats, summon, tell, unban, undo, unonebox, unsummon, urban, weather, welcome, wiki, xkcd, youtube, zalgo, !, !!, $.baby, (4337654<<1)+1, (y), /somecommand, 007, 2+2-1, 2020/07/23, 3, 666, :p, </pissing>, ?, ???, ^, ^5, abesnacking, abhi, abhishekpornfreak, acronym
afsari, agario, ah, ahah, algosmarts, aliens, alot, am, andy2, angry, angryticks, annoy, apocalypse,
I still think that the interrobang should have caught on.
@Lemonade1947 If sarcasm is obvious, you're not doing it well
It hasn't‽
@Squirrelkiller not nearly enough.
11:51
@KendallFrey Sure, but people shouldn't write like they speak.
Oh, why's that?
!!/tell Caprica Six !!/tell Caprica Six test
@ABuckau Command six does not exist. (note that /tell works on commands, it's not an echo.)
because you can't convey tone in text. I think that tone is more nuanced than can be achieved by adding a punctuation to the end saying "this is irony".
F*ck. Will it infinite loop if you tell it to tell itself the tell command?
11:52
!!tell abuckau sandbox
Good day fellow code slaves :)
@abuckau Please go and play in the Sandbox
I'm a liberto, please.
@Lemonade1947 Are you assuming that sarcasm is always spoken in a different tone?
@KendallFrey No, but there's a particular font for it.
11:53
@ABuckau Of course not.
Did it before? :p :(
No, but my point is that it's subtle. If there was just a character that said "this is irony" I don't think that'd help. It might stop people from taking what you wrote 100% litterally, but it doesn't tell them much about how you wanted them to interpret it otherwise.
@ABuckau It will loop for a while, blow its stack, delete its local files and shutdown the C# room.
I was hoping.
This is normal stuff.
*This is emphasized stuff.*
*`This is sarcastic/ironic stuff.`*
`This is code stuff.`
---Nobody cares about this---
**_You'd better read this!_**
Lil' cheatsheet for you
11:55
!!forget welcome-c#
@Squirrelkiller You are not authorized to delete the command welcome-c#
@AvnerShahar-Kashtan but in ntohl's example, a method group is passed right?
@Squirrelkiller Did you try to override? :thinking:
11:56
Yes, because it's a member method in the current scope, and can be resolved.
It always works in the movies
!!brb lunch
There's override?
11:57
!!listcommands
@HéctorÁlvarez help, afk, backup, ban, clap, convert, define, die, doge, eval, forget, google, hang, imdb, info, jquery, learn, listcommands, listen, live, mdn, meme, moustache, msdn, mustache, nudge, quote, refresh, spec, stat, stats, summon, tell, unban, undo, unonebox, unsummon, urban, weather, welcome, wiki, xkcd, youtube, zalgo, !, !!, $.baby, (4337654<<1)+1, (y), /somecommand, 007, 2+2-1, 2020/07/23, 3, 666, :p, </pissing>, ?, ???, ^, ^5, abesnacking, abhi, abhishekpornfreak, acronym
afsari, agario, ah, ahah, algosmarts, aliens, alot, am, andy2, angry, angryticks, annoy, apocalypse, a
I know when you try to teach the same command, it goes nope
@Squirrelkiller No, I was only joking ^^
!!brbthatworksbecausetheydontwanttofixtheotherone lunch
11:58
@HéctorÁlvarez You're looking for afk
@AvnerShahar-Kashtan but if it was marked virtual, it would be a method group, so your statement "In C# you can't pass a method group this way" is incorrect
!!weather
@Lemonade1947 See /help weather for usage info
No, I'm looking for Arnold
11:59
I know Java and other JVM langauges have a different notation, which removes the ambiguity when using properties

« first day (2783 days earlier)      last day (2391 days later) »