« first day (3828 days earlier)      last day (1111 days later) » 

2:57 AM
Ask:
Is it call the
async Task MethodAsync(){}
Equals to
Task.Run(()=>Method());
?
 
3:54 AM
'Equal' only on invocation, they are same executes on another task puts them as asynchronized context. But they are not same how you utilise them, such as, how do you manage tasks status in case failed or cancellation, and bring completed asynchronized context back to synchronized context, etc
If you just want some context to run themself and forget, Task.Run(Method) is good
 
👌
 
5:05 AM
Good morning
Still no explanation for my coverage not showing in Gitlab lol
 
 
1 hour later…
6:25 AM
posted on April 06, 2021 by Scott Hanselman

I'm having a blast customizing my terminal and making my prompt awesome. How to make a pretty prompt in Windows Terminal with Powerline, Nerd Fonts, Cascadia Code, WSL, and oh-my-posh Taking your PowerShell prompt to the next level with Windows Terminal and Oh my Posh 3 How to use, open, resize, and split Panes in the Windows Terminal What's the difference between a console, a terminal, a

 
6:38 AM
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
'sup
Turns out my local machine uses periods for decimal separator while the runner uses commas, so that fucked with my regex
 
 
1 hour later…
7:48 AM
@Squirrelkiller classic
somebody somewhere decided that periods should be commas not only in display, but also in syntax, and the world was all the worse for it
Also the guy who decided excel functions should be translated into other languages.. fuck that guy.
 
Tbf excel functions are for endusers so it makes sense to have them in their language
 
8:31 AM
Hello,
 
Hey
Guy's can anyone help with me a linq query ?
 
Yes I can, Plese
Please share.
 
I have posted the question here stackoverflow.com/questions/67017110/…
Would be great if you could have a look at it, I'm stuck with it
 
I have seen your Code. but i didn't get it what are you trying to do , Please explain in simple way like which output you want.
Are you trying to do like in list A count the total no of dog?
 
Someone replied, looks like it work's, will be back in a moment
 
8:43 AM
Okay, Great
 
 
2 hours later…
10:17 AM
@Squirrelkiller Except you can't open an excel document saved in another version with a different language
maybe they've fixed that, but still.. it's way more hassle than anything else.
 
 
2 hours later…
12:33 PM
Mocking in MSTestV2: Moq? NSubstitute? Are there even other good alternatives?
 
12:46 PM
@Squirrelkiller C# functions are also for end users... should C# be translated as well?
 
@Squirrelkiller I have used Moq. It's good
 
on a side note, ohai @Niel, long time no C
 
@Wietlol C# function are most definitely not for end users, but for developers.
 
Developers are the end users for C#
 
@ntohl I usually go for Moq personally, our project at work uses NSubstitute so I know both. Just gotta make sure I keep up if there's something new^^
 
12:53 PM
does NSubstitute work for classes?
 
Absolutely
 
I use Moq atm, but it has silly behavior when you mock a class
 
Or what do you mean
Oh wait you mean opposed to an interface?
 
a simple example, consider a dto:
class Person {
    public String Name { get; set; }
    public String Email { get; set; }
    public Date DateOfBirth { get; set; }
}
can NSubstitute mock that?
 
No idea lol
 
12:56 PM
hmm
 
testedObject.Setup(x => x.GetPerson()).Returns(new Person { Name = "a", Email = "b", DateOfBirth = new DateTime() });
it can
 
> For starters, NSubstitute can only work with virtual members of the class
hmm... it appears it has the same behavior as Moq
@ntohl that is not a mock of the dto
that is a mock of the method returning the dto
there is a reason why the returned data should also be mockable
primarily for dummies
also for spies...
 
var personSpy = new PersonSpy() // inherited from Person
testedObject.Setup(x => x.GetPerson()).Returns(personSpy);
 
inherited is fine and all... still no overriding of properties
so you still cant verify the spy for actual usage
 
1:12 PM
I don't see, how would Spy object work without making the original virtual
you might get away with IL weaving, but overriding default behavior...
it's still virtual depending, or interfaces.
 
if the original is not virtual, then Moq and NSubstitute just dont work
a traditional approach to make it work regardless is to use a proxy object
but neither Moq nor NSub use that technique
 
mr5
1:38 PM
what hardware do I need so that I can forward the internet from my ethernet switch to my router?
 
An ethernet cable
A switch will forward anything, including internet
But why? Router(/modem) should be the first thing in the chain.
Everything between the internet and the router will just slow down the connection as a whole.
 
mr5
2:02 PM
My router doesn't have an internet
Main source is from an ethernet cable connected somewhere I don't know :')
So I bought an ethernet switch to distribute it my main computers
But I need my phone to be connected as well, so what I did was open a mobile hotspot from my laptop
I am developing a web api, auth server, and a client app. For debugging purpose, I want them in the same network so that localhost is visible.
Problem is I am ignorant about networking so the only solution I could think right now is connect my host machine (api & auth) and my client device in the same network via WiFi
I think I manage to connect them using some port forwarding but it's awkward to setup.
When I put [Authorize] in the MVC controllers, it stops working. At this point, I don't want to go in fixing that rabbit hole cuz it took me a month to configure this shitty IS4
 
2:25 PM
...where's the modem in that setup?
The first thing connecting to an ISP is the modem. The modem basically has login data to authenticate you with the ISP.
 
Hello
 
After that usually comes the router (which nowadays usually includes a modem): The router knows IP, DNS, DHCP. The router will give your devices IP addresses, make sure data for "outside" IPs is indeed sent the the outside and data for local IPs is indeed routed only locally.
Switches are basically marginally smarter hubs: You use them to connect several devices, so those devices can speak to each other. switches usually don't know IP or anything like that, they just get a package from port A and forward it to all other ports (plus TSP dont @ me I'm keeping it simple).
So switches can be anywhere, you can't really destroy stuff with that.
But there can be only exactly one modem and one router in a network if you don't want the network to stop working correctly.
Hello Bassem
 
mr5
Not sure where the internet is coming from. All I know is that it's connected somewhere outside my room.
 
List<List<NewProperty>> chunks = SplitList(results, 5000);

foreach (var chunk in chunks)
{
allTasks.Add(Task.Run(() => ProcessResponse(chunk , indexName)));
}

await Task.WhenAll(allTasks);

any idea why this takes too long and consume cpu
the total records are 1 millions
each chunk is 5000 records
total tasks 200
any idea plz ?
 
@mr5 But does it work without a router? Can you connect a PC to that ethernet and it works?
 
mr5
2:39 PM
yep
and since I have 2 computers, I bought a switch
 
@mr5 So there already is a router there - you don't need another router, or it will fuck up your network.
What you need is an access point - you connect it to the switch, and you get wifi.
 
mr5
If there exist a router somewhere else, I have no access to it.
 
Unless you have a router you can setup as access point so it doesn't do router things of yourse
 
mr5
also, the "default" WiFi in my area is shitty not even an option to consider
 
Like I said, you don't need a router
 
2:41 PM
SSD is corrupted, can confirm lol
what, do I send it to the manufacturer to pay them to uncorrupt it, and can I trust they don't look at my sketches?
 
@mr5 Just need one of these amazon.com/…
 
mr5
@Bassem try to change ProcessResponse return type to Task and remove that Task.Run
 
@Freerey Should work that way. Should
 
@mr5
 
mr5
@Squirrelkiller ohh so is that like a "sub router"?
 
2:43 PM
@mr5 Not a router!
 
how this change will affect the performance @mr5
 
mr5
for me, router == WiFi provider =P
 
Router does stuff with IP and DHCP
You don't want DHCP
 
@Squirrelkiller Samsung does have repair services, but I can't find my damn box
 
You want to access wifi
access wifi == access point
 
2:44 PM
I'll just put it in an adequate box (for another SSD), give them the receipt, and hope for the best
 
mr5
I guess the input WiFi Accesss Point needs is ethernet with internet then it outputs WiFi right? @Squirrelkiller
 
@mr5 Router == network provider. One router will make one LAN. Tweo connected routers will make two LANs fighting each other.
@mr5 Correct. Modem makes internet -> Router makes local network -> access point makes Wifi. A modern router has all three of these devices in one package.
 
mr5
@Freerey have you tried the commands I sent you yesterday?
 
yes
except I couldn't, because every time I opened diskpart, it stalled forever
and it sounds like you're in an apartment complex with shared wifi across the buliding
or worse: the neighborhood
 
mr5
@Bassem if you issue the Task.Run yourself, you are forcing it to spawn "threads". By changing its return type to Task, you are letting the task pool to manage it for you.
 
2:48 PM
ok i will try
thanks
but in general how many tasks can i have
and how this affect cpu
in case i will just update a record
 
mr5
In my experience, awaiting all task at once is much CPU intensive than awaiting every single one of them.
@Squirrelkiller alright. What am I gonna do with my router now.
I haz to buy another hardware Y_Y
@Freerey correct!
here, it is called condotel
 
@mr5 Connect it directly to your laptop, find out if it can do "access point mode" or something like that.
 
ewwww
 
waiting all tasks is the correct way, you want to wait for all of them anyway. It doesn't change when a thread is spawned.
Task.Run will spawn a new Task - not necessarily a new thread. The point of tasks is to let the threadpool figure out how many threads you need.
 
mr5
@Squirrelkiller how do I connect the router directly? You mean connect the router's output with my laptop?
 
2:53 PM
PLINQ can do that for you: Execute a list of units of work in many tasks and wait for all of them to be finished.
@mr5 Yes, just put an ethernet cable from the router's output to the laptop.
 
mr5
@Squirrelkiller theoretically, this is the ideal solution but it actually burns CPU more that way.
I tried it on Xamarin.Android. Not really good so I resorted back to awaiting each task
in Xamarin.iOS, it's a different story. I guess OS plays a factor on how it behaves.
@Squirrelkiller but router cannot recognize the internet from the ethernet cable.
I think it needs an input from modem
oof
that's 3 ping in a row. sorry
 
ye, 3 is totally not acceptable
@Squirrelkiller 4 on the other hand
 
@mr5 It will take input from the cable, but only after you set it to access point mode
Don't connect it to the incoming internet as an actual router
It will scramble the whole network
Connect it to the PC without internet
 
mr5
So you mean I can actually fuck up the network of this whole building?
 
Sometimes it's called bridge mode
Yes, whole building
By chaos logic though. Some PCs will work, some wont, some will decide to stop working at some point, some will suddenly work again
 
mr5
3:09 PM
I think that's what happened a month ago. Somebody setup their router and everyone loses their mind.
 
Yup. Don't put a second router in your LAN.
 
yo yo yo
 
piraka
 
3:36 PM
@mr5
with nested async , tasks become not parallel ?
 
Tasks are generally async, not necessarily parallel
 
I have a performance issue
it consume the CPU
 
If you use TPL, you can tell it how many units of work can be executed in parallel. Use Parallel.ForEach and look at the options.
 
ok , question here is : if i inside nested function and i mentioned await
does it reflect the current task only or other items in the iteration
 
You mean if an async method await another async method?
It's suspended then until the inner await returns
 
3:49 PM
aha
so in order to fix this , i should return the Task , then waitAll ?
 
If your CPU is running too hot, you should use TPL to not use that many threads at once.
The point of this kind of setup is usually to use as much CPU as possible at once
 
TPL , i don't know about it , googling..
 
TPL is basically Parallel.ForEach
 
but i can do the same with async
right ?
 
Yes, but then you can't restrict it to a certain number of parallel threads.
You said you want it to not consume so much CPU
 
3:57 PM
yea
in order to understand i have to test and see difference
Thank you for your guidance :)
 
my company is still using SourceSafe :(
 
What's SourceSafe
 
[Not Li] we actually use teams, imagine
 
the ancient source control by microsoft - en.wikipedia.org/wiki/….
 
4:03 PM
Oh. And there I thought TFS was that, lol
So why not migrate? Sure you'd lose the source history, but is it really that important to you?
 
dunno, they are weird - they only use it for some stuff, most of our code is in TFS
 
mr5
TFS is now Azure DevOps right?
 
yeah
 
DevOps can actually do both TFVC and git
 
on a plus note our TFS 2012 is being upgraded to Azure DevOps 2019
 
4:07 PM
Nice
 
mr5
But Azure DevOps is going to be deprecated in favor of GitHub :)
 
what?!!
 
Or they slowly integrate Github into DevOps, until it's finally all Azureâ„¢
 
mr5
Eh I've just heard the Source Control part of DevOps is going to be deprecated (can't remember if it's an official one)
 
maybe they will just convert everything to Git instead
no more TFVC
also Microsoft should just buy GitHub
 
what?!!!!!
when was that?
 
mr5
wdym what
 
mr5
r u sleeping this past years
 
my mind is blown, and yeah I've been living under a rock
 

« first day (3828 days earlier)      last day (1111 days later) »