« first day (4232 days earlier)      last day (699 days later) » 

 
3 hours later…
6:51 AM
@KiynL why would they use C# and not Python?
 
Isn't the overhead of deploying a C# application much bigger than Python?
If you want to run your super haxxor script on many different machines, running a .py file seems easier (IIRC, you can even compile it to an .exe). You just need a Python interpreter installed. While with C# you need the correct .NET runtime and depending on how it was developed, you might need to deploy it in a web server or something.
If you have a botnet or at least access to a bunch of machines (maybe AWS ones or whatever), seems like Python would save you a ton of time.
That's for deployment alone.
 
 
2 hours later…
8:47 AM
\[**[SoFastLikeTurtle](https://discord.gg/PNMq3pBSUe)**] Hello guys
I m curious how one would keep multiple socket connections to multiple servers (hundreds) open all time to receive data ? is Background service the best approach for it ? 🤔
 
Oh, botler broken
 
always has been :)
 
Brokeler
 
@SoFastLikeTurtle the number of open sockets does not determine the type of application
**iirc**
formatting is börk in SO chat if message is multiline
 
[SoFastLikeTurtle] <@211519661420838912> That's the only thing the app has to do, start connect to the socket servers, read data from them and write it to a database. I'm still not sure how to implement this :/
[SoFastLikeTurtle] until doom's day
[Captain Obvious] morning nerds
 
9:02 AM
the question is, how do you want to manage those connections?
usually, what I do is I start an application and provide a tray icon to allow you to open a user interface for management, logging, etc
but that is for a desktop application
it wouldnt make much sense to have a ui application on a server
on a server, I just run console applications
 
[Captain Obvious] botler not broken
[SoFastLikeTurtle] <@211519661420838912> a bunch of console applications each connected to a server ?
 
probably better to just have one
it would be easier to write code to monitor all connections together
 
9:25 AM
[SoFastLikeTurtle] Thank you <@211519661420838912>
[SoFastLikeTurtle] I m going to bang my head against the wall 🙂
[SoFastLikeTurtle] Maybe i ll figure it out this way 😄
 
9:39 AM
@CaptainObvious am I 211519661420838912?
2
 
9:53 AM
I thought you were not a number, you were a free man!
 
10:17 AM
at least there are enough numbers for every person on earth
and their pets
and their fleas
and... probably everything else
 
for every photons?
 
there are quite a few photons though
probably more like cubed of the above number
but it all depends on measurement
photons come and go
so you'd have to measure by a certain period of time
atoms are easier to estimate
 
10:32 AM
hmm, you make me think about where did photons go after their energy depleted, would stay or 'fly' away... photons had mass they said, did object getting their mass slowly increased after it absorb some photon energy?
 
11:01 AM
[Captain Obvious] Why is HttpClient so dumb
[Captain Obvious] You can SendAsync with a HttpCompletionOption
[Captain Obvious] Which the non-default option is ResponseHeadersRead, which will return the HttpResponseMessage when "the response headers are fully read"
[Captain Obvious] Except that it doesn't
[Captain Obvious] Because (for example) Content-Length is not set when that returns, but with the default option it does return with Content-Length
 
11:30 AM
> Why is HttpClient so dumb
welcome to the club
 
 
1 hour later…
12:34 PM
> int? maybe = 12;

if (maybe is string number)
{
Console.WriteLine($"The nullable int 'maybe' has the value {number}");
}
Why can't I use string there to check whether maybe is of the type string?
 
because "string number" is not valid code?
Also, maybe cannot be a string. I've not tried your code, but I won't be surprised if the compiler rejects maybe is string for never being true
 
It says "an expression of the int? type cannot be processed by a template of the string type"
 
That's...a different problem entirely
 
I don't get it. I thought that pattern matching allowed one to check for such things.
 
Or not? Seems it accepts the is with three parameters. But doesn't like the second one.
 
12:45 PM
I'm just reading the introduction to pattern matching on the MS website, and trying to change to code this way and that.
> object greeting = "Hello, World!";
if (greeting is string message)
{
Console.WriteLine(message.ToLower()); // output: hello, world!
}
 
OK, maybe is int number works. Had to check what that actually does but it tracks - maybe is never going to be a string. The error seems right.
 
In this case, replacing "string message" with "int message" works.
> You use declaration and type patterns to check if the run-time type of an expression is compatible with a given type. docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
Why then wouldn't it let me check whether "maybe" is a string..
 
And it's never going to be compatible, so - compilation error
@CopperKettle It's always going to be false. But a check that is never true isn't necessarily a problem.
if (DEBUG) with DEBUG = false is never going into the if but it's still valid code.
 
But replacing "string message" with "int message" works, although it's also incompatible.
> object greeting = "Hello, World!";
//Changing "string message" to "int message" works.
if (greeting is string message)
{
Console.WriteLine(message.ToLower()); // output: hello, world!
}
I'll try to read up more, maybe there's an explanation somewhere.
 
it works since object can be int or string. An integer cannot be a string. Nor can a string be an integer.
 
1:05 PM
Hi all,
did anyone work with IdentityServer4?

I want to limit client access to a resource, he can access specific endpoints within an API (say, he can use "/api/countries/getall", but not "/api/countries/getById?id="
I can specify scopes in the identity server but I can't find a way to define a scope in the API itself (that is, map a scope to an endpoint), which make it useless for me
 
1:17 PM
@VLAZ Ah! I see! Thank you!
 
1:39 PM
@mshwf if you [Role(GetAll)] etc on all endpoints, why id serv is not enough for deciding which roles to give to specific user? Why you want to API add to it?
services.AddLocalApiAuthentication(principal =>
{
    principal.Identities.First().AddClaim(new Claim("additional_claim", "additional_value"));

    return Task.FromResult(principal);
});
 
@ntohl What is [Role], do you mean [Authorize]?
 
[Authorize(Roles = ReadRole)]
yes
2
A: How to get custom claims for IdentityServer4 Itself

Mehrdad As IdentityServer's documentation said: You can provide a callback to transform the claims of the incoming token after validation. Either use the helper method, e.g.: services.AddLocalApiAuthentication(principal => { principal.Identities.First().AddClaim(new Claim("additional_...

 
@CopperKettle because it doesnt make sense
int i = 0;
if (i is string)
every compiler would be like: "uhm, dude, you drunk?"
4
 
I get a warning in Rider that the condition is a constant.
 
@CopperKettle int might not be a subtype of object, by itself, but the wrapped int (which is what is used in this code,) is a subtype of object
 
1:51 PM
@ntohl OK, thanks for your help, I will look into how to tie roles between IdS and the web API, now all I see is scopes not roles
 
I think the scope part is the one where user accepts to use your email (1 scope) name (other scope), etc.. If user doesn't want the app to allow checking on your email, that's a scope choice
 
 
7 hours later…
8:43 PM
[SoFastLikeTurtle] <@211519661420838912> For the socket I used sockets with async callback, huge performance/code improvement
 

« first day (4232 days earlier)      last day (699 days later) »