How can I use multiple refs for an array of elements with hooks?
As far as I understood I can use refs for a single element like this: ``` const { useRef, useState, useEffect } = React; const App = () => { const elRef = useRef(); const [elWidth, setElWidth] =...
- Modified
- 11 Feb at 15:18
How to Install pip for python 3.7 on Ubuntu 18?
I've installed Python 3.7 on my Ubuntu 18.04 machine. Following this instructions in case it's relevant: > Download : Python 3.7 from Python Website [1] ,on Desktop and manually unzip it, on Desktop I...
Authentication fails with "Unprotect ticket failed" for Asp.Net Core WebApi
When I use Bearer token with an AspNetCore controller protected with `[Authorize]`, I get the log message: ``` info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[7] I...
- Modified
- 11 Feb at 15:37
PreFlight Request 404 not found .net web api ; response to preflight request doesn't pass access control check: it does not have http ok status
So I want to enable CORS on my .net web API but the client application keeps getting 404 for the options request and a second error: ``` Has been blocked by CORS policy: Response to preflight reque...
- Modified
- 11 Feb at 14:55
Fluent nHibernate: Use the same mapping files for tables with the same structure in different schemas
This is my mapping class: ``` class MyTableMap : ClassMap<MyTable> { public MyTableMap() { Schema("mySchema"); Id(x => x.id); Map(x => x.SomeString); } } ``` Thi...
- Modified
- 18 Feb at 15:36
WPF Path disappears at some size
I have encountered this problem while scaling graph, which is drawn over GIS control Greatmap. But a simple experiment persuades me that problems is somewhere deeper in WPF. Consider simple WPF appli...
Why is Stream.Copy faster than Stream.Write to FileStream?
I have a question and I can't find a reason for it. I'm creating a custom archive file. I'm using `MemoryStream` to store data and finally I use a `FileStream` to write the data to disk. My hard disk...
- Modified
- 11 Feb at 14:25
How to fix 'Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.'
I have the following error in the Chrome Dev Tools console on every page-load of my Node/Express/React application: > Unchecked runtime.lastError: Could not establish connection. Receiving end does no...
- Modified
- 21 Sep at 07:45
Looking up a deactivated widget's ancestor is unsafe
I am new in Flutter and I am trying receive data with a Dialog. When a click in textField the error of image2 appear... ![Layout's Image](https://i.stack.imgur.com/kWit6.png) ![Error's Image](https:/...
- Modified
- 27 Sep at 02:58
.NET Core 3.0: Razor views don't automatically recompile on change
According to [the documentation](https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.0), Razor views should, by default, recompile on change on local environment...
- Modified
- 6 Jun at 11:16
'ModuleNotFoundError' when trying to import module from imported package
This is my directory structure: ``` man/ Mans/ man1.py MansTest/ SoftLib/ Soft/ SoftWork/ ...
- Modified
- 7 May at 16:25
Example of how to use String.Create in .NET Core 2.1
Does anyone know how this method is intended to be used? The documentation is somewhat 'light'! ``` public static string Create<TState> (int length, TState state, System.Buffers.SpanAction<char,TStat...
Should I cache and reuse HttpClient created from HttpClientFactory?
We can read here [YOU'RE USING HTTPCLIENT WRONG AND IT IS DESTABILIZING YOUR SOFTWARE](https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/) that we should not create and dispose HttpClient ...
- Modified
- 8 Feb at 17:24
How are 'DefaultImports' used when trying to import DTOs into typescript using ServiceStack?
When trying to use the cli tools provided with ServiceStack for TypeScript, I keep running into the `DefaultImports` feature not working as expected, or in any particular useful way. What is the corre...
- Modified
- 8 Feb at 16:47
NetFramework app referencing NetFramework library in same solution referencing NetStandard library in another soln.: could not load file or assembly
There are many similar questions about problems referencing a .NET Standard class library from a .NET Framework project where a NuGet package dependency in the netstandard library doesn't flow to the ...
- Modified
- 8 Feb at 16:19
Nullable reference types with generic return type
I'm playing around a bit with the new C# 8 nullable reference types feature, and while refactoring my code I came upon this (simplified) method: ``` public T Get<T>(string key) { var wrapper = cac...
- Modified
- 2 Sep at 19:33
ServiceStack: Having several independent/different services on one AppHost with different base paths
I have read [one other post](https://stackoverflow.com/questions/17358885/can-i-host-different-servicestack-services-at-different-urls) that I think asks almost the same question, but I think I need t...
- Modified
- 24 May at 16:16
Creating a C# Amazon SQS Client in ServiceStack
There is [some documentation](https://docs.servicestack.net/amazon-sqs-mq) on using Amazon SQS as an MQ Server forServiceStack [Messaging API](https://docs.servicestack.net/messaging) But the message...
- Modified
- 8 Feb at 01:53
Is there a way to increase the stack size in c#?
I'm coming back to programming after having done none for several years, and created a Sudoku game to get my feet wet again. I've written a recursive function to brute-force a solution, and it will do...
- Modified
- 18 Feb at 16:4
How to fix 'The project you were looking for could not be found' when using git clone
I am trying to clone a project from gitlab to my local machine. I have been granted rights as a developer, and use the command 'git clone - The error message I am getting: ``` remote: The project yo...
Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger`1[WebApplication1.Startup]'
I created an ASP.NET Core 3.0 Web Application with the default template in Visual Studio 2019 Preview 2.2 and tried to inject an ILogger in Startup: ``` namespace WebApplication1 { public class S...
- Modified
- 14 Sep at 15:44
SignalR core - invalidate dead connections
# The problem I'm using .NET Core 2.2 with ASP.NET Core SignalR. Currently I'm saving all connection states in a SQL database (see [this document](https://learn.microsoft.com/en-us/aspnet/signalr/o...
- Modified
- 20 Jun at 09:12
Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
The dialog (Google form) for the credentials is opened successfully, but after I fill my credentials I'm getting this error. I followed the instructions from [here](https://pub.dartlang.org/packages/g...
- Modified
- 12 Oct at 11:24
ServiceStack caching users roles and permissions approach
With the AuthFeature / AuthUserSession plugin, we can populate the session with a users roles, permissions, etc in the PopulateSessionFilter on each request. ``` Plugins.Add(new AuthFeature(() => new...
- Modified
- 6 Feb at 13:40
What is the point of writing REST APIs but in Azure Functions?
I've just started following some Azure Function tutorials and digging into this more so I'm quite New to this and my question may seem very easy but I couldn't find any answer for it yet. What is the...
- Modified
- 6 Feb at 10:57