« first day (2784 days earlier)      last day (2166 days later) » 

12:09 PM
Avni, I give up
I get why it doesn't work asynchronously and i give up trying to bruteforce it working asynchronously.
 
12:22 PM
c# friends I am trying to understand interfaces.
I mean I know how to make them and stuff
but I'm trying to understand why and when to use them
 
@Lemonade1947 use them when you're only interested in a contract
 
Ohh, interfaces don't work, just ask Wietlol.
 
it seems like what it does is encourage you to write very general classes, then write interfaces to impliment just some of the methods and properties as per a context.
is this right?
 
e.g. "I expect to be able to call method Foo() on this object, but I care naught about what it is"
 
@Default I understand that fine, just I don't understand what the point of it is.
 
12:24 PM
to follow SOLID better?
 
how does it help me do that?
 
law of demeter?
 
this is going over my head
 
In object-oriented design, the dependency inversion principle refers to a specific form of decoupling software modules. When following this principle, the conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are reversed, thus rendering high-level modules independent of the low-level module implementation details. The principle states: A. High-level modules should not depend on low-level modules. Both should depend on abstractions. B. Abstractions should not depend on details. Details should depend on abstractions. By dictating...
 
@Lemonade1947 Testability and maintainability
 
12:26 PM
the D in SOLID
 
And flexibility
 
law of demeter <> Dependency inversion principle
Dependency inversion principle is the real reason behind interfaces
 
Law of demeter is basically: Don't pass things just to pass them further ahead
 
for example dinamically typed languages don't need interfaces really
 
I stand corrected
 
12:28 PM
what I'm saying is that I just don't know when I'd use one. I understand what they do technically.
 
For example: Don't do this
 
do that
@Lemonade1947 So I guess you never mocked dependencies in your code?
 
class DocumentPrinter() {
  constructor(httpClient: HttpClient, url: string) {
    this.document = httpClient.getDocument(url);
  }
}
Do
class DocumentPrinter() {
  constructor(doc: Document) {
    this.document = doc;
  }
}
And make the caller worry about where it gets the document from.
 
Oh nice you're talking about IoC?
 
@HéctorÁlvarez you bet!
 
12:30 PM
Law of Demeter in my case
 
take us through it Hector, if you please!
 
(In this instance, you only passed url to pass it further down to the httpClient)
 
I recently had a debate here about it related to unit testing.
 
going for break, bb in 30 or something
 
Oh, don't expect anything from me, I was a pupil not so long ago.
 
12:31 PM
@HéctorÁlvarez I know, I took you through it
 
@Lemonade1947 As for interface
Consider the following:
function doSomething(logger: ILogger) {
  logger.log('did something');
}
ILogger is an interface, and the idea is that doSomething doesn't know and doesn't care what kind of logger it has
It could be a logger that writes to a Database, it could be a logger that writes to stdout, and it could be a logger that does nothing and ignores the message completely
The idea is that doSomething cares about doing something, and it cares about being able to log, it doesn't care about the how, that's the job of whatever logger you pass into it
And it doesn't care either way.
If I had asked for logger: FileLogger, you're stuck with a concrete FileLogger
And if tomorrow you run in the cloud where you have no file storage on the same machine, you're screwed
Not to mention that now you must supply an actual FileLogger in test, and remember to clean up the log files afterwards because you don't need them and they might interfere with the next tests, etc.
(or mock it, which is just added complexity for no good reason)
 
I'm still confused.
 
I am having 1 list interfacce where i am showing list of records
 
@MadaraUchiha Thanks for explaining this DI stuff, it's really interesting and useful.
 
12:36 PM
:P
 
@Lemonade1947 I was there, let me put a single example
Are you familiar with MVC?
 
ROs don't panic, @Linkgoron is here to troll me
 
@HéctorÁlvarez yes
 
Just assume your "standard" way of thinking, you need to process a new user action.
Click the button on the view, that asks the controller to save, that asks the service to save.
 
now i have functionality where i want to export list of records to either pdf or excel
So shall i do it on server side or client side?/
 
12:38 PM
ABUSE!
ABUSE I TELL YOU!
 
@MadaraUchiha No, it was quite interesting actually. I've never seen that explanation before.
 
@Lemonade1947 Whenever You want modularity use interfaces. Whichever class implements an interface, is one version of a module.
 
The controller would be something like userService = new UserService(); userService.Save(theUser);
That's the logical approach at first glance, instance a service and tell it to save.
 
yes
yes it is
 
@Linkgoron Glad you enjoyed it. Maybe your code would have been better had I explained it to you earlier.
 
12:38 PM
you're talking my language now
 
But how about that service may or may not work?
You don't know
It works for your use case, sure
But maybe tomorrow you don't call it that way, or you need a different service.
 
So what would you do instead?
that's the part I'm not fully understanding.
 
With IoC you don't tell the service explicitly "hey you, go in memory, you'll have to save", you shout out loud "I need to save a user, who's the current service!?"
 
how do you do that syntactically, though?
because you don't do userService = new IUserService()
 
@HéctorÁlvarez (that can still be solved by just rewriting UserService() whenever there is a new change request)
 
12:41 PM
^
which is, like, the only way I'd currently know how to do it.
 
@ntohl I know, it's just an example.
 
@Lemonade1947 Have you ever done a switch on typeof?
 
Oh god no it's painful
 
It doens't have to be the optimal answer, he just needs to understand to how inject dependencies and stuff.
 
12:43 PM
I think really I just need to see a real world implimentation of it and then it'll fall into palce.
place*
 
Factory goes "Yo model you're new Model(new UserService())" and model later goes "Yo IUserService that I got on construction save this user for me"
M'kay
 
Yeah, but there's no real value to DI when you have a large service with only one implementation, and one interface that mirrors it perfectly
 
@Lemonade1947 You put IUserService userService = new UserService(); away. Not right next the usage of userService. You can pass userService to methods and stuff, but the building of the moduls going to a separate responsibility
 
And there's 0.000...% chance of having another service that implements that same interface.
That's just a Java-ish way to protect yourself.
The real value comes from the fact that you can now add more implementations of the same interface in the future, without altering (or in some cases, even recompiling) existing code.
 
^
 
12:44 PM
Right
Rightttt
Righttt now I'm seeing what you mean
 
// Because this is my function
function doSomething(logger: ILogger) {
  logger.log('did something');
}
I can even add a new logger in a DLL file, that implements the ILogger interface from my package
Without recompiling the original package
Note that this is a "cool" usecase that almost never happens in real life
 
Can't I chain method overloads with a ':' like constructors?
 
But the idea is that doSomething has no idea what kind of loggers are even available, it just doesn't care.
 
Yes, that's it. So the idea is you never have to worry about whether the other components will break when you update the rest, because the contract is still valid.
 
12:47 PM
I -think- I'm closer to understanding now.
 
@Squirrelkiller nope, just call them manually
 
@Squirrelkiller I believe : in ctors means you call the base ctor, not that you... uhm chain stuff.
 
for example taking "single responsibility" to the extremes, You can add a dependency injection framework, and have 0 new in Your code. The framework is responsible for creating the new instances of classes. In Your test You map Your interfaces to the mocked version.
 
@HéctorÁlvarez you forget :this()
 
fMl
@HéctorÁlvarez not really, you chain ctors. Not only base ctors but only your own ctors.
 
12:48 PM
Yeah I jsut realized I'm dumb
gotta return something...
 
Ideally you could just call constructors like methods
 
@Squirrelkiller amazing how you notice that from scratch every day ♥

you where a good student of mine ;3
 
but You can only set readonlys in constructors
 
#nosquirlomo
 
12:50 PM
@ntohl What?
 
@MadaraUchiha Will try to implement this ILogger thing.
 
private readonly int _foo = 3; can be set <- this way, or only from constructor
 
How about auto-implemented properties?
 
@Linkgoron Please do, our logging sucks.
 
Or right.
@Lemonade1947 when you read this you have to change your mindset. Your idea isn't to translate 1:1 what you'd tell a person and write the code, your goal here is saving yourself the problem that tomorrow you'll have to change how you implemented your classes and methods just because there was a change in the class.
 
12:53 PM
I'm getting squirreling mad!
When I run each unit test individually, no error.
Bunch 'em up and run them together - wham failing and i don't get why.

I've eradicated all of the possible erros I can think of :grrr:
 
the I from SOLID expects You to use hollywood principle. "Don't call us. We will call You". Meaning constructors/methods/whatever of Your code only states what interface You want to talk with. It doesn't matter what is the real instance behind it. For example the previous logger thing.
 
In order to do that, you have to find a way to ask for a generic item that does what you want to do, and have someone hand you the tool you need.
 
@Squirrelintraining welcome to my world
 
@KendallFrey Quite nice here kendall, i must say admit.
 
@Squirrelintraining Don't forget to puff up your tail.
 
12:54 PM
@HéctorÁlvarez Dude, even my ears are puffed at this point
 
Whoops, I just ran out of mobile data.
 
I just want a logger. Doesn't matter which. So how can be done technically? Use an interface parameter. That states just that. I want something, but I don't care what.
 
@Squirrel Do you have proper Setup and Teardown methods? Because virtually, every unit test should run independently from the others.
 
@Squirrelkiller shoulda wuda coulda
depends on the testing framework
I have this kind of tests too...
 
You have tests interfering with each other too?
 
12:57 PM
@ntohl If you need any kind of logger, you can register your valid types to a Logger container and at runtime ask for Logger. The container will return the type you need.
 
Rx testing tools are fluffed up
@Squirrelkiller yeah. It's more like scheduler late sometimes. Or not. Sometimes green, sometimes red. But those testschedulers are advanced manually...
so for example in introtorx.com/uat/content/v1.0.10621.0/16_TestingRx.html You can say in a test 1 minute just passed
 
You know what, that will fix my issue

TO THE DRAWING BOARD
 
DRAWING
 
@everyone thanks for helping. I will soldier on until I am an interfaces expert
 
!!echo DRAWING
 
1:00 PM
DRAWING
 
(I know @everyone doesn't work but I couldn't think of a good way of articulating that concept)
 
Ping everyone that's been active within the last 15 minutes?
 
!!ping everyone
 
@Lemonade1947 I would suggest first create a small project which have a dependency, and an interchangable interface implementation in it Yourself
 
1:03 PM
Wat now
!!help ping
 
@Squirrelkiller ping: User-taught command: <>https://www.youtube.com/watch?v=Q7kTRWW1jxw
 
C4u
Hi everyone. I did a post-request to a website with webClient.UplaodValues(...). After converting the response (byte-array) to a string with Encoding.UTF8.GetString(response) I got such a content:
I expected the source of the next page.
 
Oh look, Visual Studio logged in the chat!
@Squirrelkiller Hahahahahah.
 
C4u
Well that cant be represented as a string so I cant copy&paste.
Or at least I cant copy it out of the preview window.
 
1:18 PM
We can't do much if you just tell us it doesn't work, really.
 
Try reading it as Unicode instead of UTF8 maybe?
 
!!tell C4u welcome-c#
 
@C4u 0 Welcome to the C# chat! Please review the room guidelines and tips. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
The welcome-c# appends a 0 at the beginning, who made it!
 
C4u
@WilliamMariager Gives me chinese characters.
 
1:19 PM
Oh wait this wasn't the command.
!!tell C4u mcve
 
@C4u If you would like assistance, please create a Minimal, Complete, and Verifiable Example
 
C4u
@HéctorÁlvarez Funny guy. Thanks but no, I can't provide the address of the form I'm trying to submit.
 
@HéctorÁlvarez That's because it's supposed be used like
!!welcome-c# Hector
 
@Hector Welcome to the C# chat! Please review the room guidelines and tips. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
1:22 PM
Also that link is still dead, @Kendall!!
 
!!forget welcome-c#
 
@KendallFrey Command welcome-c# forgotten.
 
noooooooo
 
1:24 PM
Thx
 
!!remember
 
@ntohl That didn't make much sense. Use the !!/help command to learn more.
 
C4u
Well.. glad you found a topic to discuss.
 
!!learn welcome-c# "<>$0 Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help." .+
 
@KendallFrey Command welcome-c# learned
 
1:25 PM
!!welcome-c# Squirrelkiller
 
@KendallFrey Input not matching /Welcome/. Help: User-taught command: to <>"$0
 
@KendallFrey Command welcome-c# learned
@KendallFrey Input not matching /<>"$0/. Help: User-taught command: Welcome .+
 
!!help learn
 
@KendallFrey learn: Teaches me a command. /learn cmdName outputPattern [inputRegex [description]]
 
1:26 PM
Does the sarcasm font actually work
 
!!sandbox Kendall
 
@ntohl Please go and play in the Sandbox
 
@KendallFrey Command welcome-c# learned
 
1:26 PM
RIP
 
!!tell kendall sandbox
 
@kendall Please go and play in the Sandbox
Squirrelkiller Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
!!learn welcome-c# "<>@$0 Welcome to the C# chat! Please review the [room guidelines and tips](stackoverflowcsharpchat.github.io). If you have a question, just post it, and if anyone's free and interested they'll help." .+
 
@KendallFrey Command welcome-c# learned
 
!!welcome-c# Squirrelkiller
 
1:27 PM
@Squirrelkiller Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
oops
 
You forgot the link, dingus
 
1276th one is the charm.
 
1:28 PM
@KendallFrey Command welcome-c# learned
@Squirrelkiller Welcome to the C# chat! Please review the [room guidelines and tips](https://stackoverflowcsharpchat.github.io/). If you have a question, just post it, and if anyone's free and interested they'll help.
 
what the fuck
 
An attempt was made
 
@KendallFrey Command welcome-c# learned
@Squirrelkiller Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
ARE YOU HAPPY NOW
 
Ding ding ding ding
 
1:29 PM
YESSSS THANX MR FRENDALL
 
!!tell kendall welcome-c#
 
@kendall 0 Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
It's exactly the same as before.
 
bruh
!!welcome-c# Hector
 
@Hector Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
1:30 PM
!!tel Hector stop using the command wrong
 
@Hector stop using the command wrong
 
I mean, not that the correct syntax doesn't work, it's just I'm allowed to use the wrong syntax correctly.
What the fuck, it can actually tell people stuff
 
!!welcome-c# hector
 
@hector Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
It's easy
 
1:30 PM
@HéctorÁlvarez I blame Zirak
 
!!tel hector this is fun"; /forget welcome-c#
 
@hector this is fun"; /forget welcome-c#
 
Oh well, I didn't expect less.
 
user7422837
can anybody tell me if you can bind a dropdown value with a label control aspx? they both use different SP's but corralate with each other with the id
 
I think you wanted to go !!echo !!forget welcome-c#
 
1:32 PM
!!telll 42752652 i am your master
 
@HéctorÁlvarez i am your master
 
!!tellllllllllllllll NotImplementedException();
 
@HéctorÁlvarez That didn't make much sense. Use the !!/help command to learn more.
 
IDK who decided to make tell with 1-2-3 Ls do different stuff and considers themselves savvy.
 
!!tell zirak myown chat bot
 
1:33 PM
!!info tel
 
@zirak I'll make my own chat bot with blackjack. And hookers. In fact, forget the chat bot.
@HéctorÁlvarez Command tel, created by rlemon on Fri, 31 Oct 2014 18:12:56 GMT
 
!!info telll
 
@HéctorÁlvarez Command telll, created by Madara Uchiha on Mon, 23 Apr 2018 11:39:13 GMT
 
God and a mod. Figures.
!!tel
 
1:33 PM
!!help telll
 
@Squirrelkiller telll: User-taught command: <>:$0
 
!!cowsay moo
 
 ____
< moo >
 ----
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
user7422837
!!cowsay moo
 
1:34 PM
Denied
 
!!cowsay what does the fox say
 
user7422837
can anybody tell me if you can bind a dropdown value with a label control aspx? they both use different SP's but corralate with each other with the id
 
 ______________________
< what does the fox say >
 ----------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
!!cowsay help I only have two udders
 
 ____________________________
< help I only have two udders >
 ----------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
1:35 PM
"only"
 
Don't cows have four?
idk I've never milked a cow other than your mother
 
They have one with four teats
 
!!doge commands, cows, bot, mods, chat bot, welcome
 
    wow
                very commands
                          so  cows
such  bot
               much  mods
                             many  chat bot
very  welcome
 
@KendallFrey then why are the called udders then, HUH
DID YOU THINK ABOUT THAT KENDALL NO YOU DIDN'T
 
1:36 PM
I do not understand your non sequitur
 
Udders
Not udder
 
Actually, according to a cybersecurity engineer at microsoft
 
yes that's the plural
 
> Cattle don't have four udders. They have one udder. They do have four quarters in their udder. Most cattle have one or two calves. The cow has four quarters in their udder. Each quarter has a teat.
 
Utter madness
Udder madness
Utter udder madness
 
1:38 PM
I have a 100% offtopic question for native english speakers:
I need to know what english users use in the brackets:

Acme Corp
[for] Finance
rest of the address

Google suggest "for the attention of"
 
Do you have a particular person? or just the department
 
in care of is something ive used before
 
@Martijn c/o ?
 
Razer deathudder.
 
Like...which topic are we actually on?
 
1:39 PM
either could be. It's a free field for the user to fill in
 
Can't get any more off topic
 
Well it depends really
 
I would just write "Finance dept."
 
f.a.o would be appropriate for a person
{dept} Department would be better for a department
Either way, they'd both be above the company line from my experience
 
Hm, ok thanks :)
 
1:41 PM
!!cowthink e=@@ T=/ "duuuude, what if... what if humans had udders"
 
 _________________________________________
( "duuuude, what if... what if humans had  )
( udders"                                  )
 -----------------------------------------
        O   ^__^
         O  (@@)\_______
            (__)\       )\/\
             /  ||----w |
                ||     ||
 
The higher the adress part, the more it's allowed to open the letter.
Department under company? Company may open letter, or send it to the department.
Person under department? Department people can open the letter, or send it to the person.

Department over company? Company has to send it to the department, only department may open letter.
 
!!cowsay beep beep I'm a NEET
 
 _____________________
< beep beep I'm a NEET >
 ---------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
1:52 PM
@CapricaSix When you've spent too much time developing commands for a chat bot and can entirely modify the script with inputs.
 
!!tell hector wiki cowsay
 
@CapricaSix fun fact, they do, they are just called breasts
 
!!fortune | cowsay
 
@HéctorÁlvarez That didn't make much sense. Use the !!/help command to learn more.
 
1:54 PM
I can't use the shell version
Unfortunately.
!!help cowsay
 
@HéctorÁlvarez Command cowsay does not exist.
 
OK, so turns out I'm just seeing ascii cows and it's all in my mind.
 
Why are you talking about cows? Are you feeling alright?
 
Where is @squiggle?!
 
!!cowsay You ok Hector?
 
1:57 PM
 _______________
< You ok Hector? >
 ---------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
!!help cowsay
 
@Squirrelintraining Command cowsay does not exist.
 
same result :o
 
!!cowsay annie you okay, annie you okay, you okay annie?
 
 __________________________________________
/ annie you okay, annie you okay, you okay  \
\ annie?                                    /
 ------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
1:58 PM
!!cowsay you've been struck by a smooth cowminal
 
 ________________________________________
< you've been struck by a smooth cowminal >
 ----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 

« first day (2784 days earlier)      last day (2166 days later) »