« first day (3145 days earlier)      last day (1805 days later) » 

9:00 AM
@anand_v.singh I expect a lot of those operators' behavior to depend on the base collection they're applied on.
 
@AvnerShahar-Kashtan Size of BaseCollection? Or like lists can have streaming Deffered execution but a custom Generic collection might have a non streaming deffered execution
 
@AvnerShahar-Kashtan but what do you call a class module then?
it makes more sense to replace a static class with a "namespace"
 
@AvnerShahar-Kashtan NOOO DO NOT YIELD TO VB!
Quickly hold my hand!
Come back to the land of explicit instantiation
 
come back to the land of trying but not succeeding
come back to the land of MS
 
Wait a minute I'm there already
Better not hold my hand.
 
You know just in case you get a severe case of Variant.
 
I get to work in a mixed VB & C# environment
Thanks 3 years ago me for starting projects in VB
 
BTW I just wasted 3 hours trying to figure out why this crap wasn't compiling properly, turns out you have to save (click a light gray icon that's actually clickable), analyze (actually run an interpreter), and then compile (but since when does VB actually compile?) the event code window, then do the same for the actual dialog, in that specific order.
 
Wait what
 
@HéctorÁlvarez say what
 
9:18 AM
I thought it would automatically save before compiling, but it doesn't.
 
When would anyone not want to save prior to compilation?
like, "I need to compile, but first I need to make a change that I don't want included in the compilation, so the code is inconsistent for proper debugging.."
 
Its like when you press F5 with build errors and that dialog which nobody has intentionally pressed yes to ever appears
 
@Neil to be honest this ERP smells like a demo
 
@CaptainObvious thank you! finally someone says it
how about an automatic no, kthx
 
@HéctorÁlvarez what is "to save"?
I dont understand this expression
 
9:23 AM
Bill Clinton has entered the room, everybody!
 
@Wietlol It's when you take a little money every day away and put it into a jar so you can buy the next overexpensive console on day 1.
I had to toss 3€ in the floppy drive so I could compile it.
 
oh, jars, I know java
 
I've done something retarded but can't work out what
 
@CaptainObvious Did you ever try to win a discussion against @Wietlol?
 
@CaptainObvious Shame you're retarded otherwise maybe you could figure it out
 
9:26 AM
pop your umbrellas ladies, the shitstorm has just started x')
 
@HéctorÁlvarez the attempt would indeed be a retarded move
 
or at least... the believe of it happening
 
@Wietlol I agree. As Mark Twain once said, "Never argue with stupid people, they will drag you down to their level and then beat you with experience."
 
user image
9
Stupid people are spectacularly stubborn too
 
9:30 AM
@Neil I will remember this, and wont argue with you any more :P
 
@CaptainObvious lol
 
There is a way to know if a SQL service is installed or not (SSRS for example), but I don't remember, any help?
 
Check services?
 
haha, yes, straightforward enough
 
@CaptainObvious Captain Obvious to the rescue with his obviouseness
Man I love that username Captain Obvious waayy too much
 
9:47 AM
Wait no something has definitely gone retarded
 
9:57 AM
is it VS?
 
mr5
IdentityModel Client is the shittiest most-starred GitHub library I have ever knew
 
How do you calculate the precise shit:star ratio?
 
shitStarRatio(GitUrl);
 
10:14 AM
if (isShitty() && hasALotOfStars())
    markAsShittyGithubRepository();
but in essence, what you have is this
> X is the shittiest most-starred GitHub library I have ever knew
 
Why would you only mark is shitty if it has a lot of stars?
 
so...
 
if(maxShitStar < repository.starCount() && repository.isShitty()) {
    maxShitStar = repository.starCount();
}
 
GitHub.Repositories.GroupBy(it => it.Stars).OrderByDescending(it => it.Key).Take(1).SelectMany(it => it.Values).OrderByDescending(it => it.Shittyness).FirstOrNull()
that would take the shittiest, most starred github repo
 
> Take(1)
 
10:18 AM
yes
> most starred github repo
that is the group with the highest number of stars
 
are there varying levels of shittiness?
 
Why not use First()
 
because Take(1) returns an IEnumerable<Grouping<Repo>>
 
But you're enumerating a single object anyway, that's so stupid
 
and First() would return an InvalidOperationException because Github isnt linked to the actual website and has 0 repositories
@Neil well...
> the shittiest
I assume there are
 
10:21 AM
fair enough
though which is more relevant? star count or shittiness?
 
shittiness isn't a binary option
 
if it was incredibly shitty, maybe it doesn't have to have the highest star count
 
however, I think that the shittiest most starred repo isnt shitty
because you categorize by stars first
 
it is if you define it to be shitty
 
out of the repos that are most starred (which I assume is 1), you take the shittiest of them
I assume the most starred repo isnt shitty
 
10:23 AM
ah true, maybe shittiness of the highest starred repositories have 0 shittiness
 
and my definition of shitty is applicable to a LOT
 
so maybe that isn't a good query, as it gives you a repository no matter what, even if there are no shitty repositories
 
We'll have to define some sort of standarized metric. I mean, sure, start with the most starred, give it a shittiness score, and work your way down, multiplying stars with shittiness.
But you'll have to define a properly wide and possible nuanced numeric space that will, for instance, not count a really, really, really shitty project that two people starred, for instance.
 
international shittiness standard or ISS
 
Hi guys
 private async void button1_Click(object sender, EventArgs e)
        {
            // ONE
           // ONE: Entering startButton_Click.
           // Calling AccessTheWebAsync.
            Task<int> getLengthTask = AccessTheWebAsync();

           // FOUR: Back in startButton_Click.
           //Task getLengthTask is started.
           //About to await getLengthTask-- no caller to return to.
            int contentLength = await getLengthTask;

           // SIX: Back in startButton_Click.
           //Task getLengthTask is finished.
 
10:24 AM
@mr5 Perhaps the problem is using Claims auth in 2019 has made you take X steps back, where X is the exact star:shit ratio.
 
Why would you add a comment saying "entering startButton_Click", which is not only superfluous, but also wrong?
 
I am not getting when exactly this client.GetStringAsync("https://msdn.microsoft.com") starts executing
 
Call it ISO 7448
 
@AvnerShahar-Kashtan I am trying to understand flow of async process given here :
 
It is written in one of your comments:
// Task getStringTask is started.
 
10:26 AM
@AvnerShahar-Kashtan I can only guess for the same reason why step 4 comes after step 1: Heavy editing?
 
Why it is not started here :
 string urlContents = await getStringTask;
 
GetStringAsync() starts the moment you call it.
 
@ILoveStackoverflow because it's not
that means something entirely different
 
Bloody hell there's so much unnecessary commenting there
 
await getStringTask; means you don't want the current thread to continue until you get the response from the async task
 
10:27 AM
@ILoveStackoverflow It starts when you call it, and presumably (we don't know its inner workings, theoretically), it will return as soon as it has off-loaded its processing (to a thread, to the I/O layer, etc).
The Task it returns is already in progress.
 
@Neil it doesnt give you a repository when there are no repositories
 
When you await, you simply halt execution of your current method, and return to it when the task completes.
 
its a very good query
 
@Wietlol No, but I didn't say that
 
As soon as compiler encounter await,it returns from that method
Is it correct?
 
10:28 AM
> it gives you a repository no matter what
I disagree
 
await just makes an async call execute synced.
 
> One does not simply win an argument with Wietlol
 
@Wietlol fine, plus one for your pedantic observation
 
@ILoveStackoverflow Yes, pretty much. await tells the intricate little class that the compiler generates to return the Task the describes the current async method, still unfinished.
 
my observation is only pendantic when the object being observed is too
 
10:30 AM
When the await's awaiter completes, it will commence from that point again.
 
¯\_(ツ)_/¯
 
@ILoveStackoverflow It doesn't execute it in that moment, simply waits..
for a quick operation, it's virtually instantaneous
but I can see the confusion there
 
Lets say I have an api which just returns list of employee,so does it make sense to create such simple api as async although it is not doing any I/O bound operation?
 
You tell your friend, "See if there are any supermovie movies at the theaters tonight.."
 
@ILoveStackoverflow No
 
10:31 AM
Then you tell your friend, "I'll wait.."
So you won't do anything until you know the answer from your friend
 
For instance, an async method like this public async Task GetIntAsync() => 5;, which never awaits, will never actually spawn a new thread or relinquish control - it will create a task behind the scenes, immediately complete it, and return it, with hte value, to the calling method.
 
> public async Task**<Int32>** GetIntAsync()
 
@Wietlol Yes, that. I thought you were only pedantic when the object being observed is. :)
 
> public async Task GetIntAsync() => 5;
I think this is pretty pendantic
 
@AvnerShahar-Kashtan You also agree I should not create that api as async?
 
10:33 AM
@Wietlol Pedantic* :)
 
googles "pendantic meaning"
 
all async achieves is better performance when your computer has several execution threads. On a monocore processor you usually don't want to run tasks async, when you have more cores you run async if you can afford it, which 99% of the time isn't when you have to work with the result of the operation inmediately.
 
@Wietlol No, it's a rough code used to illustrate a point, not something to be compiled.
 
If you're pendantic, then you're swaying a lot
 
googles "pedantic meaning"
 
10:35 AM
@ILoveStackoverflow I think you should, actually. As @Wietlol observed (correctly, this time :)), C#'s async keywords have a serious drawback - they make the sync/async behavior part of the contract. You can't make a sync method async without breaking compatibility.
 
ok... maybe I am pedantic when the object observed isnt pedantic, but... something else
 
So for a public method that is synchronous today but could be async tomorrow, go async all the way from the beginning.
 
@Wietlol quantum?
 
Returning synchronously in an async method is easy. The other way around? Not so much.
 
Is Wietlol a wave or a particle?
 
10:36 AM
I am a lion
silly cat
 
@AvnerShahar-Kashtan What are the factors to determine when to use async and when not to
How to decide ?
 
when it has to be async, make it async
 
@ILoveStackoverflow Are you ever going to need to do something in parallel?
 
when it doesnt have to be async, but you expect it to be in the future, you could make it async
 
if so, make it async
 
10:36 AM
Ideally? I'd have everything async except if I had a reason not to. Unfortunately, with C# today, that makes the syntax quite cumbersome.
 
@AvnerShahar-Kashtan you mean... properties?
 
if it is a quick operation and this won't likely change, then it's probably unnecessary
 
@AvnerShahar-Kashtan And whats that reason not to?
 
@ILoveStackoverflow Think of it as having 5 people working in an office, one of them is reading a document and the rest of them wait. Having 4 people idle is a waste of the for the office, but there's nothing these 4 people can do. At once point the person reading needs to write a note so he can do 1) Get up from his chair, retrieve a paper and pen, get back and write down his note, or 2) tell one of the 4 idle ones to go fetch it for him.
 
Thats what I am trying to understand
 
10:37 AM
Anything involving fetching data - from a web service, a database, files on disk, anything - make it async, for future proofing.
 
public Task<String> Name { async get {
    // ...
} }
 
@ILoveStackoverflow Make it asynch whenever it is an operation that potentially takes up a lot of time
I say potentially, because in the normal case, it may not wait at all
 
@ILoveStackoverflow There's an overhead to async method. They're wrapped in Task instances which have to be managed. For instances where I know I need high performance, methods which are called many thousands/hundreds of thousand of times, perhaps doing in-memory calculates and things like that - I wouldn't make them async just because.
 
But the reader can't tell an idle person to retrieve an authorization to open a secret document and keep reading the document before the authorization arrives, he has to await the person who fetched it for him.
 
@HéctorÁlvarez still might be worthwhile making it async, even if you're only going to await the response anyway
 
10:39 AM
another reason is that you need to handle the async wrapper, you need to explicitly call await everywhere
and, it messes with the types
 
What I mean to imply with that example is the use of away on an async task.
 
so, generics are weird
 
@Wietlol That's exactly what Imeant.
 
you meant performance, right?
i mean readability
 
the sync way to do it would be for the reader to get up his chair and retrieve the authorization himself
 
10:40 AM
The code is littered with await blah(await getPAram(), await blah2()), etc.
 
well obviously you wouldn't use it everywhere just because you can
 
@Wietlol No, I meant readability as well. If every method returns a Task<T>, it clutters the signature.
 
I did not understand this point :
which are called many thousands/hundreds of thousand of times, perhaps doing in-memory calculates
 
(await (await (await (await GetName()).Replace("a", "b")).Replace("b", "c")).Replace("c", "d"))
 
*calculations
 
10:42 AM
I mean, async is really easy to understand with that example, when you do stuff synced you are a single person working, when you execute stuff async you no longer handle the task, but the person. You don't request an authorization really, you tell Billy the chief security officer to retrieve it and handle Billy<auth> instead.
 
If it takes you 1 ms to perform a loop and you have 1000 items in your loop, then running it synchronously takes 1000ms.. if you create an async task to do each loop, with overhead 1 ms each, then it's likely going to take you a bit more than 1000ms
you just kind of have to weigh each case individually
 
Right that's the loop plus the orchestration cycles (or am I talking shit)
 
and usually it's not so straightforward to know this.. you kind of have to do some trial and errors if performance is important
 
But if you do 10 loops of 100 operations it will surely run much faster!
async it could take 100-110ms
 
All right.Thank you so much guys.Got to understand about async better now :)
 
10:44 AM
\o/
 
ಠ_ರೃ
 
i thought I understood how to use async
and then there was IEnumerable<E>.WhereAsync()
 
Guys can you tell me something about "How to pick classes from business requirement "
What are the ways that you guys use to identify classes from business requirements
 
businessRequirement.PickClasses()
 
@Wietlol will the majestic green cat save us some overhead time and actually explain?
 
10:47 AM
@Wietlol You mean businessRequirement.PickClassesAsync(), right?
 
@HéctorÁlvarez try to do a Where where your function needs async
then you cannot return boolean, because it is now a Task<Boolean>
 
@AvnerShahar-Kashtan you mean await businessRequirement.PickClassesAsync() right? (unless we can wait for it).
 
@Wietlol Doesn't that simply parallelize the Where() clauses (each of which is an async lambda), then merges the results?
 
@Wietlol And what's weird about that?
 
you could only do Task.WhenAll(it)
 
10:48 AM
@Wietlol We have an extension method that makes that a bit less ugly.
 
(after the select, which would result in IEnumerable<Boolean>)
 
Lets say I have a requirement like this :
 
however, this is an infinite enumerable
 
I love Stackoverflow and developers who give answer here
 
so, I cannot await all of them
 
10:49 AM
Now How do i represent this requirement in Object oreitned programming?
 
@ILoveStackoverflow Subliminal message detected.
 
is that a requirement?
 
whats the thought process behind picking class out of requirement
@Wietlol Just an example
 
it sounds like 2nd year database at school
 
You had a 2nd year?
I went from left join straight into pivot
 
10:52 AM
I went from select * to nested recursive CTEs, looping triggers and advanced indices
 
I pity that poor company that you work for, @Wietlol
 
But requirements are like this only right
 
in my experience, people misuse triggers, and if you didn't have any prior experience, well :P
@ILoveStackoverflow what do you mean by requirements?
For me requirements are like, "It must work on Internet Explorer 10 and greater"
 
@Neil why so?
 
Triggers are just obscure pieces of code that look literally stop looking good the moment you click "Save"
 
10:54 AM
you make one mistake
you assume I agree with sql
 
Ok lets say this is the requirement :
It must work on Internet Explorer 10 and greater
Now how to identify classes from the above requirement
Whats the thought process
 
I think you're confusing a lot of stuff
 
@ILoveStackoverflow no classes.. requirements are limitations in technologies if anything, but they're certainly not classes
 
If your boss tells you "We are going to make a virtual zoo" you'll need Animal, Worker, Visitor, etc. but you can't make classes out of a requirement.
 
But in objectc oriented programming,everything is represented in the form of classes right
 
10:56 AM
What you intend to do is more of a specification.
 
If your boss tells you which classes you can or can't write, then that isn't a requirement.. that's your boss trying to do your job for you
 
That requirement only tells you "Don't pick this obsolete library that stopped being maintained with IE7".
 
you should still be free to do it however you want, in the confines of what is allowed
 
So from what we write code and create classes than?
 
A requirement could also be that it can't take longer than 1 second in the response times
that's about performance, not technology, but still has nothing to do with how you write your code, so long as it is performant
@ILoveStackoverflow You write code to fulfill the specifications for what the program does
 
10:58 AM
I have been reading that first we pick objects from requirements and than we analyze how they will interact with each other etc..
 
No class should be created which doesn't have a direct practical application in your program
Take @HéctorÁlvarez's example with the virtual zoo
If you know you'll need to handle animals, workers, visitors.. you need to properly represent these concepts in your program
 
Ok and whats the first step before writing a code?
 
While you don't have to create a class called Animal, assuming you need to differentiate behaviors amongst the various animals, then you'll most likely need to have a class which does the same thing, named Animal or otherwise
 
Will it be ok to create a class called Animal or Animals?
 
And then you understand the relationship Animal has with Visitor, and so you begin to imagine a simple interface between the two
Animal, unless Animals represents a collection of Animal
generally class names should be singular unless they're composite classes
 
11:02 AM
@ILoveStackoverflow Animals would be incorrect, a type name is meant to represent one thing. Even with collections the collection is single, e.g. List<Animal> would represent several animals.
 
Composite classes means?
 
@ILoveStackoverflow Class which represents a collection of other class instances
 
So when to have plural class?
 
When it's a composite class
 
@Neil Can you show me a sample class which can be plural
 
11:03 AM
and generally you wouldn't ever really need to create a composite class.. List<Animal> is sufficient 99% of the time
 
He means for example Cats<Cat, Cat, Cat> but that's a really bad practice
 
hmm, ok.. Permissions where a private member has List<Permission>, and you can have a method like, "contains(Permission)"
 
But List<Animal> would be property inside a class
 
use generics instead and don't limit yourself.
 
I am asking when a class name will be plural
 
11:04 AM
next day you'll ahve 5 cats instead of 3 and need a new class that has nothing to do with the other one
 
I wouldn't use it unless the collective grouping of several instances could have specific methods which can't be generalized
 
@Neil Just make a wrapper in that case like Group<Cat,3> or whatever
 
@HéctorÁlvarez true, well he's asking when I'd use plural class names
and that's really about the only time I'd do that
 
Oh right.
 
Ok so I have identified the objects , Animal,Visitors,Workers
Now whats the next step after this?
What do we do now
 
11:07 AM
Animal, Visitor, Worker *
Depends on your requirements.. what does this virtual zoo simulate?
Do you have workers go around to feed all the animals?
then for any given instance of Worker you have it interact with all animals one at a time
And your food reserves diminish each time (if that's important)
 
@ILoveStackoverflow anyway, what you need is usually the bottom line, and have to create layers of abstraction and polymorphism. For example you'll know you want to hold a tiger, a cougar, a lion, etc. so you'll want a class for each of them, but all inherit Animal, so they all share several core functions. e.g. the animal can Breathe() but the Feline class will breathe differently than the Fish() class. However you can tell both a herring and a tiger can Breathe()
 
Again, depends entirely on what you want it to do.. you won't have to imagine this.. you should be told exactly what the program should do
If you're not told exactly what the program should do, ask questions and don't leave until you're given answers.. this isn't really your job
the only freedom you should have is on how to accomplish the required behavior of the program
 
Is it necessary or good to have a little abstraction when we are designing classes?
I think its bit difficult to design class with abstraction?
Is it?
 
On the contrary
It takes a bit of training to understand what you're doing but that's something you have to do yourself.
Do the test yourself, make 3 different animals, all of them independent, and test them
Then do the same with an abstract parent class.
Same stuff, isn't it?
Now teach them to Jump()
 
but how to know when to create abstraction ?
 
11:13 AM
All 3 separate animals now have to learn that for themselves, but the ones with a parent?
 
@ILoveStackoverflow Take the virtual zoo example. Do you need to distinguish behavior from a Crocodile from a Lion?
 
BOOM red squiggly lines, press a key and all animals automatically know the concept of jumping.
 
If so, you make them both derive from Animal
If not (and you should always ask yourself if this the case!), then DON'T use abstraction!
Needless abstraction is bad code design
You may still have a lion and a crocodile in your virtual zoo.. but if all they do is walk around in the pit repeatedly, then behavior is identical
If they accept different types of food, then if anything, you can pass a parameter indicating the type of food the Animal gets.. in other words it is still generalizable
generally speaking, you should avoid abstraction unless there is no other way of doing it
and in those cases, the abstract class/interface (Animal in this case) should be used in exactly the same way throughout your program
you should not ever need to know when it is a Lion instance or a Crocodile instance in other words
 
Or when I know Tiger will always eat Meat for eg then No need to pass Food,I can pass Meat(Concrete type) right?
 
291 Messages since ~11
Is it monday already?
@HéctorÁlvarez lel
 
11:20 AM
@ILoveStackoverflow If the behavior when an animal is given food is to consume it, then Animal isn't what needs to be abstracted but rather Food
It's important to make the distinction between data and program behavior
Data can be passed into the class, but program behavior cannot (with some minor exceptions)
 
From where I can learn all this things?
Any book or something?
 
I learned all this from experience
you kind of have to reason through it
it gets easier as you go along
 
All right sir.thank you so much for your time and insights
Its really helpful :)
 
@Neil Even if that was the case, better to define once and implement several times than telling them how to walk in circles individually. Even then, next day they need to start eating and you are suddenly in hell with your 1800+ classes of animals.
 
@ILoveStackoverflow Smash your head against a wall hundreds of times (SO works as a wall substitute)
 
11:24 AM
@HéctorÁlvarez well in fact, that's essentially what you'd be doing by leaving all that behavior in Animal
implementing it exactly once
 
Don't be that person who sends a poor soul to copy-paste Eat(){ while thereIsFood { NomNom() } across species, maybe the poor soul forgets to feed the Dodo and it goes extinct again.
 
> NomNom()
Oh hecti
you make me laugh
 
try it in the way that you think works best, and if you ever find yourself having to cast Animal to Lion or something like that, you should think RED FLAG
If you find yourself making a thousand classes which do the same thing, you should think RED FLAG
 
these are signs that you're probably doing it incorrectly
 
11:26 AM
Neil here advocating against shapeshifting.
 
@HéctorÁlvarez begone, Satan!
 
He's right by the way
Yeah remember all lions are animals, but not are animals are like Wietlol lions.
 
and slightly more subtle is this: if you find yourself creating an abstract class without a reason, RED FLAG
Wietlol will disagree with me on this one
 
Yeah, only use abstraction when you know what you're doing. Hence why I suggested you try to do a few small examples
it will all click together soon enough.
 
if you want to learn the trade, best way to do it is to write programs
So create a calculator program and go from there
 
11:32 AM
@HéctorÁlvarez object Wietlol : Lion : Animal
 
Gotta love this custom Spanglish IDE: IsTabStop: Verdadero
 
funny though, you shouldnt categorize by type
class Lion : IAnimal is a mistake
@HéctorÁlvarez isnt that the spell to transform animals into drinking glasses/cups?
 
depends on how much the behavior differs and how much behavior is matched among other animals
if all the behavior is generalizable, then an Animal class is sufficient
 
@Wietlol Or a new Bleach technique, who knows.
 
class Animal {
    public IBreed Breed { get; }
}
 
11:34 AM
otherwise, an abstract class Animal and a derived class Lion
 
class Lion : Breed
 
@Wietlol So what if in my game, I want Lions to consume other animals, but no other animals do this?
do I necessarily need a CarnivoreAnimal class?
or is Lion sufficient?
 
Animal is sufficient
Animal.Consume(IEdible something)
 
not if I have 100 animals in my zoo, and the only animal with a different behavior is Lion
 
@Wietlol I'd add a backing field on that, maybe you want to let IBreed extend Kamasutra for new innovative ways.
 
11:36 AM
why does a backing field make any difference?
 
Besides, animal should be abstract. You can't really instance an animal without knowing what animal you want.
 
the constructor knows the breed :)
 
@Wietlol so you can set a new Breed whenever you want of course.
 
but what if a Lion and a Sheep do something that needs the protected keyword?
you would need a class SomethingFromALionAndASheep : Lion, Sheep
now you have a problem
 
public static censored Breed;
 
11:38 AM
@HéctorÁlvarez you cant change the breed
because I refuse :)
you could make a MutableAnimal :D
 
My man, what kind of zoo you think this is.
 
you came up with modifying an animal's breed
 
Let them have fun doing the shape they prefer.
But a dog and a sheep will never return anything.
 
protected fun by(dog: Dog, sheep: Sheep): Nothing
oh, how much I love lack the hate of kotlin
 
Well this is obviously derailing.
I digress.
 
11:59 AM
how to consume wcf service in node application ?
 

« first day (3145 days earlier)      last day (1805 days later) »