ServiceFilter and TypeFilter - what is the difference in injection those filters?

ServiceFilter we must register in Startup.cs. TypeFilter is injected by Microsoft.Extensions.DependencyInjection.ObjectFactory, we don't need to register that filter. So when we should use ServiceFilt...

21 Apr at 23:55

Checking if JValue is null

Why this code doesn't run, I want to check if JSON contains integer for key `PurchasedValue` or not? () : the error is : Error CS0019: Operator `??' cannot be applied to operands of type `method gro...

6 May at 06:12

Dockerfile if else condition with external arguments

I have dockerfile ``` FROM centos:7 ENV foo=42 ``` then I build it ``` docker build -t my_docker . ``` and run it. ``` docker run -it -d my_docker ``` Is it possible to pass arguments from ...

27 Apr at 10:5

General error: 1364 Field 'user_id' doesn't have a default value

I am trying to assign the user_id with the current user but it give me this error ``` SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value (SQL: insert into `posts` (`up...

26 Jul at 12:24

c# how to implement type converter

I am struggling to implement a simple Type converter in C#. I followed this guide [https://msdn.microsoft.com/en-us/library/ayybcxe5.aspx](https://msdn.microsoft.com/en-us/library/ayybcxe5.aspx) Her...

27 Apr at 05:37

Getting custom rss feed item element with syndicationitem?

I have an RSS feed like so: ``` <item> <title> Ellen celebrates the 20th anniversary of coming out episode </title> <link> http://www.dailymail.co.uk/video/tvshowbiz/video-1454179/Ellen-celebrates-20...

27 Apr at 00:19

Selenium C# Open New Tab CTRL+T Not working with CHROME

``` static void Main() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://google.com"); IWebElement body = driver.FindElement(By.TagName("body")); body.SendKe...

Skip Executing other Validation Rules in the Fluent validation Ruleset, if one of them fails

Is there any way to skips executing the validation rules in the Ruleset if one of them fails. I have this following rules for my API endpoint param1, param2, param3 ``` RuleSet => RuleFor(r...

Entity Framework 6 DbSet AddRange vs IDbSet Add - How Can AddRange be so much faster?

I was playing around with Entity Framework 6 on my home computer and decided to try out inserting a fairly large amount of rows, around 430k. My first try looked like this, yes I know it can be bett...

How to switch kubectl clusters between gcloud and minikube

I have Kubernetes working well in two different environments, namely in my local environment (MacBook running minikube) and as well as on Google's Container Engine (GCE, Kubernetes on Google Cloud). ...

Windows selfhosted service - Setting custom service properties like description etc

A windows service has several properties like servicename, servicedisplayname, description etc. Some of these props can be set with `sc.exe` but not all of them. I have several ServiceStack services ...

26 Apr at 19:37

.NET Core Global exception handler in console application

I'm porting an console application to `.NET Core`, and I'm trying to replace this line: ``` AppDomain.CurrentDomain.UnhandledException += UnhandledException; ``` After reading [this](https://deepum...

Updating an object with setState in React

Is it at all possible to update object's properties with `setState`? Something like: ``` this.state = { jasper: { name: 'jasper', age: 28 }, } ``` I have tried: ``` this.setState({jasper.name...

22 Mar at 11:37

C# string interpolation-escaping double quotes and curly braces

guys, I'm building a JSON object from an interpolated string, and not getting how escaping works. I have to use double quotes for the API. This does not interpolate the expressions between the cur...

26 Apr at 13:42

Recognize Disposable Objects in Visual Studio?

It is suggested that `IDisposable` objects should be disposed in either `using` statement or by calling `Dispose()` method. I find it is not intuitive to find out if an object is disposable in Visual ...

Get enum values via reflection from nested enum in generic class

I need to print out enum values and their corresponding underyling values from certain types i accquire through reflection. This works fine most of the time. However if the enum is declared within a g...

19 Jun at 02:48

How to check if a string contains a char?

I have a text file that I want to read. I want to know if one of the lines contains `[` so I tried : ``` if(array[i] == "[") ``` But this isn't working. How can I check if a string contains a cert...

3 Aug at 17:23

Using import fs from 'fs'

I want to use `import fs from 'fs'` in JavaScript. Here is a sample: ``` import fs from 'fs' var output = fs.readFileSync('someData.txt') console.log(output) ``` The error I get when I run my file ...

3 Oct at 19:23

Why can't I install python3.6-dev on Ubuntu16.04

I am trying to install `Python 3.6-dev` with this command: ``` sudo apt-get install python3.6-dev ``` but I'm getting this error: ``` E: Unable to locate package python3.6-dev E: Couldn't find any...

12 Mar at 22:1

Python Pandas iterate over rows and access column names

I am trying to iterate over the rows of a Python Pandas dataframe. Within each row of the dataframe, I am trying to to refer to each value along a row by its column name. Here is what I have: ``` i...

23 May at 12:2

OrmLite throws unknown error Insufficient parameters supplied to the command

I'm using ServiceStack.OrmLite v4.0.62 (the last one for .NET Framework 4.0). And I work with SQLite database. So, on my UI I have a form which contains search fields. And depending on the conditions ...

26 Apr at 09:40

I am getting an "Invalid Host header" message when connecting to webpack-dev-server remotely

I am using as an environment, a Cloud9.io ubuntu VM Online IDE and I have reduced by troubleshooting this error to just running the app with Webpack dev server. I launch it with: ``` webpack-dev-se...

Bandwidth Shaping in my C# application

I have a C# application that uses a native library that sends video to other IP over the internet using UDP. I have no traffic control over that library. My application also calls web services of ano...

How to disable a ts rule for a specific line?

Summernote is a jQuery plugin, and I don't need type definitions for it. I just want to modify the object, but TS keeps throwing errors. The line bellow still gives me: error. ``` (function ($) { ...

How to setup Mock of IConfigurationRoot to return value

I have used IConfigurationRoute to access a directory like this. ``` if (type == "error") directory = _config.GetValue<string>("Directories:SomeDirectory"); ``` _config is IConfigurationRoot inject...