Thread.Sleep alternative in .NET Core

I'm porting a library to .NET core and to maximize portability I need to eliminate the dependency on System.Threading.Thread, and therefore Thread.Sleep. Whats an alternative to this?

26 Jun at 07:13

TLS 1.2 not negotiated in .NET 4.7 without explicit ServicePointManager.SecurityProtocol call

I need to upgrade a .NET application to support a call to an API on a website that only supports TLS 1.2. From what I read, if the application is targeting 4.6 or higher then it will use TLS 1.2 by de...

26 Jun at 15:43

Keras input explanation: input_shape, units, batch_size, dim, etc

For any Keras layer (`Layer` class), can someone explain how to understand the difference between `input_shape`, `units`, `dim`, etc.? For example the doc says `units` specify the output shape of a...

C# 7.0 case pattern matching on generic parameter

Is there a reason for not being able to handle a generic variable by the type pattern? Please consider the code: ``` public static int CompareValues<T>(T left, T right) { switch (left) { case...

25 Jun at 08:2

Performance-wise: Is a WPF application better than an Electron one coded wisely?

Recently, I have been reading about and I got curious about its potential when compared to something already established in the market of building `Windows 7` desktop applications (i.e., ). So far, ...

25 Jun at 09:1

Authenticating to ServiceStack with Angular

We are looking to build an Angular 2 SPA using ServiceStack. We are primarily looking for a getting started type of instructions/demos on handling authentication, uploading files, etc using Typescript...

Integrate Python based TensorFlow into a .NET application

It seems that in order to fully use TensorFlow and associated libraries I need to access it from Python. Utilizing TensorFlow requires building rather complicated graphs which Python helper libraries ...

27 Jun at 12:49

Replacing c# compiler with new Roslyn build

I'm playing around with some changes to Roslyn, but unfortunately, even the unmodified solution would crash when I run `VisualStudioSetup.Next`, with an error trying to load an MS assembly. So I made ...

3 Aug at 04:39

Why choose UnityEvent over native C# events?

I mean, UnityEvents are slower than the native C# events and they still store a strong reference to the receivers. So, the only valid reason I can find to use UnityEvents over native C# events is thei...

24 Jun at 08:43

Specifying ssh key in ansible playbook file

Ansible playbook can specify the key used for ssh connection using `--key-file` on the command line. ``` ansible-playbook -i hosts playbook.yml --key-file "~/.ssh/mykey.pem" ``` Is it possible to s...

24 Jun at 08:8

How to make Texture2D Readable via script

I want to make user able to decode the QR image loaded from the gallery, I have found a plugin to explore and load the image as a texture2D, but to decode that QR code, the Texture2D has to be readabl...

2 May at 13:0

Active Azure Sql Connections are over the connection pool limit

We fight the issue in production when once in a while our Azure SQL database performance significantly degrades. We know we have locks on one of the tables, but these locks are not deadlocks, they are...

Why does the Finalize/Destructor example not work in .NET Core?

I'm trying to learn how finalization and destructor works in C#, I tried to run the code in the [System.Object.Finalize](https://learn.microsoft.com/en-us/dotnet/api/system.object.finalize?view=netfra...

24 Jun at 04:54

ActionExecutingContext ActionDescriptor doesn't contain ActionName and MethodInfo

As you below can see, in my ActionFilter, I try to get the ActionName and the MethodInfo of the ActionExecutingContext.ActionDescriptor. But the compiler says that ActionDescriptor doesn't contain a d...

28 Jul at 23:31

How to convert emoticons to its UTF-32/escaped unicode?

I am working on a chatting application in WPF and I want to use emoticons in it. I am working on WPF app. I want to read emoticons which are coming from Android/iOS devices and show respective images....

15 Mar at 18:57

How to autosize the height of a list view in XAML

My list view object receives an image, an ID number and a synopsis. The synopsis varies in size because some have whitespace returns. I notice that ListView has a row height that I can set (which I ha...

5 May at 14:15

Enabling Microsoft's Code Analysis on .NET Core Projects

Our team uses the Code Analysis feature with a custom ruleset to cause our build to fail if we forget to do things like null checks on method arguments. However, now as we create a new .NET Core proj...

Set value to an entire column of a pandas dataframe

I'm trying to set the entire column of a dataframe to a specific value. ``` In [1]: df Out [1]: issueid industry 0 001 xxx 1 002 xxx 2 003 xxx 3 ...

16 Jan at 14:20

Pass data to startup.cs

How do you pass data into startup.cs ? This is for integration testing using `WebHostBuilder` and `TestServer` I need to pass different data depending on the Test Fixture. So dont want to pull it in...

23 Jun at 12:36

Boolean field rendered with different cases

Bit of a weird one for anyone with thoughts on it…I’m rendering a hidden Boolean field on a particular page. However, I get two slightly different markups for the same field depending on whether a par...

30 Jun at 09:15

How to prevent the click event using CSS?

How to prevent the click event using CSS ? I have created the form page , then i need to prevent the click event using only CSS? I have tried this css property, but not worked. ``` <div>Content<...

21 Aug at 11:54

Querying a MariaDB database with C#

I have XAMPP installed on Windows, and MySQL setup. I was wondering how I could query my database from C#. I can already connect using `MySql.Data.MySqlClient.MySqlConnection`. I am looking for a stri...

19 Jul at 07:47

How to install PHP GD in Ubuntu

I want to convert the image in low resolution with GD. I'm working on IBM Server under these speces Version: PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS ) and I have also comment out the extension from p...

23 Jun at 11:25

Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

I have updated my dependecies like you said in your comment and i have this now : ``` org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is ...

23 Jun at 12:46

Different behavior async/await in almost the same methods

Let's say I have two async methods ``` public async static Task RunAsync1() { await Task.Delay(2000); await Task.Delay(2000); } ``` and ``` public async static Task RunAsync2() { var t...

23 Jun at 09:44