core

Why does my IdentityServer4 based server timeout in 30 minutes and only support SSO in the first 30 minutes?

旧时模样 提交于 2020-06-27 04:58:31
问题 I have an application system that developed based on IdentityServer4 and .NET Core 2.0. Just recently I noticed that log into the server will timeout in 30 minutes regardless of user activity. Client applications cannot launch other SSO enabled applications after the 30 minutes boundary. After 30 minutes, launching any new app will force user login. I looked at the cookies that might affect the SSO functionality, there are three: AspNetCore.Identity.Application, Identity.External and idsrv

How many CUDA cores is used to process a CUDA warp?

霸气de小男生 提交于 2020-06-17 15:49:47
问题 I'm reading for the answers and there are conflict ideas: In this link https://www.3dgep.com/cuda-thread-execution-model/, two warps (64 threads) can run concurrently on an SM (32 CUDA cores). So, I understand that the threads on a warp are splited and be processed on 16 CUDA cores. This idea makes sense for me because each CUDA core has 1 32bitALU. However, in other links, they claimed that 1 CUDA core is able to handle 32 concurrent threads (same as a warp size) (https://cvw.cac.cornell.edu

Configure Swagger Authentication with Firebase (google) in .Net core

久未见 提交于 2020-06-08 15:12:05
问题 Integrating swagger and firebase is really hard because google token request and response is not standard. so I used password flow and add a middleware in .net core 3.1 Web API to authenticate swagger 5.x I hope it helps. The first step is configuring your API to use Firebase for token validation. so we need to add this code to the startup. services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme =

memory leak cant find where the allocations originate from or why they being held

回眸只為那壹抹淺笑 提交于 2020-06-01 07:38:26
问题 .net memory profiler https://memprofiler.com/ to try and see if i have any memory leaks... See screenshot From the screenshot it very much looks like i do have one. But its extremely hard to tell. Is anyone else Familiar enough with this profiler to try guide me. I have spent white a bit of time i have also tried jetbrains dotmemory Problem is, i cant tell if this is actually leak Or Entity Framework core bug or feature? and to me it make no sense. obviously i know you wont know my code base

Bitwise operation in C language (0x80, 0xFF, << )

一个人想着一个人 提交于 2020-05-15 10:45:33
问题 I have a problem understanding this code. What I know is that we have passed a code into a assembler that has converted code into "byte code". Now I have a Virtual machine that is supposed to read this code. This function is supposed to read the first byte code instruction. I don't understand what is happening in this code. I guess we are trying to read this byte code but don't understand how it is done. static int32_t bytecode_to_int32(const uint8_t *bytecode, size_t size) { int32_t result;

Bitwise operation in C language (0x80, 0xFF, << )

╄→尐↘猪︶ㄣ 提交于 2020-05-15 10:45:12
问题 I have a problem understanding this code. What I know is that we have passed a code into a assembler that has converted code into "byte code". Now I have a Virtual machine that is supposed to read this code. This function is supposed to read the first byte code instruction. I don't understand what is happening in this code. I guess we are trying to read this byte code but don't understand how it is done. static int32_t bytecode_to_int32(const uint8_t *bytecode, size_t size) { int32_t result;

Support for File Security in .Net core

非 Y 不嫁゛ 提交于 2020-05-10 14:25:46
问题 We were porting a .Net 4.0 class Library to .Net Core 1.1 and struck with an issue of very limit support for file Security and permissions in .Net core CLR. We were trying to set the access control permissions to a file as below, and it seems that FileInfo doesn't have any SetAccessControl or GetAccessControl anymore. // Get a FileSecurity object that represents the // current security settings. FileSecurity fSecurity = File.GetAccessControl(fileName); // Add the FileSystemAccessRule to the

How to unit test whether a Core MVC controller action calls ControllerBase.Problem()

こ雲淡風輕ζ 提交于 2020-05-09 07:39:26
问题 We have a controller that derives from ControllerBase with an action like this: public async Task<ActionResult> Get(int id) { try { // Logic return Ok(someReturnValue); } catch { return Problem(); } } We also have a unit test like this: [TestMethod] public async Task GetCallsProblemOnInvalidId() { var result = sut.Get(someInvalidId); } But ControllerBase.Problem() throws a Null Reference Exception. This is a method from the Core MVC framework, so I don't realy know why it is throwing the

ASP.NET Core Disable response decompression

我的未来我决定 提交于 2020-04-18 09:43:48
问题 I need make response compression disabled. I have .NET 4.5 version of web.config but I need in .NET CORE 2.x now. <customBinding> <binding name="BasicHttpBinding_Service"> <textMessageEncoding messageVersion="Soap11" /> <httpsTransport decompressionEnabled="false" /> </binding> </customBinding> I have web service which is not support compressed response and I am still get error: System.ServiceModel.ProtocolException: 'The content type application/x-gzip of the response message does not match

.NET Core 1.0学习(2)

心已入冬 提交于 2020-04-10 09:38:44
随便照着[ Getting Started — ASP.NET documentation 做了一下练习,实在无趣。就是改个project.json再写个hello world。 什么Code Behind(aspx, aspx.cs),事件代码的, 都没看到。(就看 Visual Studio Code 的本事了,不然就没有微软特色了) 贴个代码结束 (用的不是和IIS或者IIS Express配套的那个ASP.NET,想用也没有。而是Kestrel,名字是一种鸟,鸟Server?)。 using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; namespace aspnetcoreapp { public class Startup { public void Configure(IApplicationBuilder app) { app.Run(context => { return context.Response.WriteAsync("Hello from ASP.NET Core!"); }); } } } 再回想起上次练习 .NET Core 1.0学习(1) ,发现了几点不同寻常的地方