Questions

C# dotnet pass data from middleware/filter to controller method

We are developing a multi-hosting platform where we can register new clients based on the url passed to our application. However currently we wanted to create a middleware/filter to validate our clien...

6 May at 00:58

C# ValueTuple properties naming

I'm trying ValueTuple Class in C#, and i have a doubt about properties naming, let's see: If instantiate a ValueTuple declaring the object like this: `var tuple1 = (Name: "Name1", Age: 25);` We can na...

5 May at 15:0

how to remove json object key and value.?

I have a json object as shown below. where i want to delete the "otherIndustry" entry and its value by using below code which doesn't worked. ``` var updatedjsonobj = delete myjsonobj['otherIndustry'...

6 Oct at 07:8

Invalid Switch syntax builds successfully?

Could someone please help enlighten me? I went to check-in some changes to TFS and my check-in was rejected. It prompted me to take a look at a switch statement I had edited. What I've found is ...

How to use switch statement inside a React component?

I have a React component, and inside the `render` method of the component I have something like this: ``` render() { return ( <div> <div> // removed for brevit...

5 Oct at 19:1

Pandas error in Python: columns must be same length as key

I am webscraping some data from a few websites, and using pandas to modify it. On the first few chunks of data it worked well, but later I get this error message: ``` Traceback(most recent call last...

24 Jul at 18:47

RestSharp Timeout not working

I have a restsharp client and request set up like this: ``` var request = new RestRequest(); request.Method = Method.POST; request.AddParameter("application/json", jsonBody, ParameterType.RequestBody...

Serilog is logging type rather than object content

I'm new to Serilog - trying it out to see if it will help. I'm using Serilog v2 and Serilog.Sinks.MsSqlServer v5 I have the following console app code: I would have expected the details of Person to b...

5 May at 15:51

An existing connection was forcibly closed by the remote host in production environment

When calling my servicestack api from one of our production servers, using our web application, I get this exception: IOException: Unable to read data from the transport connection: An existing conne...

5 Oct at 08:32

Convert Word doc and docx format to PDF in .NET Core without Microsoft.Office.Interop

I need to display Word `.doc` and `.docx` files in a browser. There's no real client-side way to do this and these documents can't be shared with Google docs or Microsoft Office 365 for legal reasons....

10 Oct at 12:54

Swashbuckle: Make non-nullable properties required

Using Swashbuckle.AspNetCore in an ASP.NET Core webapp, we have response types like: ``` public class DateRange { [JsonConverter(typeof(IsoDateConverter))] public DateTime StartDate {get; set...

Is services.AddSingleton<IConfiguration> really needed in .net core 2 API

I accessed appsettings.json In .NET Core 2 Web API Controller simply by adding below: ``` public class MyController : Controller { private readonly IConfiguration appConfig; publ...

Is there a foreach construct in TypeScript similar to the C# implementation?

I really like using the `foreach` construct for "for loops" in C#. I think it's very clean, efficient and readable. Is there a similar construct in TypeScript? For example, instead of this: ``` ...

Tensorflow import error: No module named 'tensorflow'

I installed TensorFlow on my Windows Python 3.5 Anaconda environment The validation was successful (with a warning) ``` (tensorflow) C:\>python ``` Python 3.5.3 |Intel Corporation| (default, Apr 27...

What is Firebase Firestore 'Reference' data type good for?

I'm just exploring the new Firebase Firestore and it contains a data type called [reference](https://firebase.google.com/docs/firestore/manage-data/data-types). It is not clear to me what this does. ...

Google Firestore: Query on substring of a property value (text search)

I am looking to add a simple search field, would like to use something like `collectionRef.where('name', 'contains', 'searchTerm')` I tried using `where('name', '==', '%searchTerm%')`, but it didn't...

19 Dec at 20:7

.Net Core 2.0 Windows Service

I'm trying to build a Windows Service in .Net Core 2.0 but I've been banging my head on the wall for a full day and no progress at all. Everything seems to be using Core 1.0/1.1 even the Microsoft doc...

4 Oct at 09:48

asp.net core 2.0 Unable to Post to database

I have a web application that is being developed on a windows env and runs on ubuntu 16.04. I have no issues Posting info to my sqlite database file `blog.db`(located in the /. directory of the proje...

18 Apr at 19:45

What is the simplest way to run a timer-triggered Azure Function locally once?

I have a few C# Azure Functions that run on a schedule using [timer triggers](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer). I've set them up like so, where `%Timer...

4 Oct at 03:59

Do i need to use RedisLocks ( ServiceStack.Redis )

- - `builder.register<IRedisClientsManager>(c => new PooledRedisClientManager(conection));`- `redis.GetCacheClient();`- to set a cache entry I am doing: `cache_client.Set<T>(generate_key<T>(key), val...

PixelSearch in certain area of monitor

So I'm trying to find a certain pattern in the middle of the screen in a given area. I'm using the `AutoItX` library and the `PixelSearch` method. - - - - It's not returning that the pattern has be...

6 Mar at 17:36

List running Jupyter notebooks and tokens

How do you check the login tokens for all running jupyter notebook instances? Example: you have a notebook running in `tmux` or `screen` permanently, and login in remotely through `ssh`. Sometimes, p...

16 Jul at 11:38

When the keyboard appears, the Flutter widgets resize. How to prevent this?

I have a Column of Expanded widgets like this: ``` return new Container( child: new Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ new Exp...

Please add a @Pipe/@Directive/@Component annotation. Error

I am stuck in a situation here. I am getting an error like this. ``` compiler.es5.js:1694 Uncaught Error: Unexpected value 'LoginComponent' declared by the module 'AppModule'. Please add a @Pipe/@Di...

3 Oct at 17:6

What's the difference between Cloud Firestore and the Firebase Realtime Database?

Google just released Cloud Firestore, their new Document Database for apps. I have been reading the documentation but I don't see a lot of differences between Firestore and Firebase DB. The main poi...