Memory usage of concatenating strings using interpolated vs "+" operator

I see the benefit of using interpolated strings, in terms of readability: ``` string myString = $"Hello { person.FirstName } { person.LastName }!" ``` over a concatenation done this way: ``` strin...

28 Aug at 22:47

If setting a DataContext within a constructor, does it matter if I set it before or after the call to InitializeComponent()?

I have a WPF window that takes a few parameters in it's constructor. I then use these constructors to setup the state of the window. Part of that constructor process is instantiating my view model c...

15 Oct at 20:53

Cannot read property 'style' of undefined -- Uncaught Type Error

I would like to change the color, fontsize and font weight of the text in a span element of the html page. I am using the following code: ``` if(window.location.href.indexOf("test") > -1){ var s...

Selenium - 'ITimeouts.ImplicitlyWait(TimeSpan)' is obsolete

I use the C # project settings implicity: ``` driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20)); ``` Everything worked. When I installed the new version of selenium-dotnet-3.1.0 m...

Installing a new middleware at runtime in ASP.Net Core

When my application starts, I have a bunch of modules (module1, module2 …). For each of this module I have a bunch of controller actions : ``` /myModuleController/module1/action1 /myModuleController/...

CefSharp - Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies

I've been working on a CefSharp WinForms app for a few weeks and I've had no issues with it. This morning, while adding a few things to the application, I tried to run it to test something and got the...

21 Feb at 11:55

How to stop docker under Linux

My version of OS `Ubuntu 16.04`. I want to stop docker, so I run in the terminal: ``` sudo systemctl stop docker ``` But this commands doesn't help me: ``` gridsim1103 ~: ps ax | grep docker 1134...

24 Apr at 01:41

How to implement a "pure" ASP.NET Core Web API by using AddMvcCore()

I've seen a lot of ASP.NET Core Web API projects that use the default `AddMvc()` service without the realizing that using `AddMvcCore()` is a superior option due to the control over services. How exa...

Call another rest api from my server in Spring-Boot

I want to call another web-api from my backend on a specific request of user. For example, I want to call send message api to send a message to a specific user on an event. Does have any method to...

19 Mar at 16:37

C#, multiple == operator overloads without ambiguous null check

: I have a few classes which do the same work, but with different value types (e.g. Vectors of floats or integers). Now I want to be able to check for equality, this equality should also work in betwe...

21 Feb at 10:55

How can I implement unit tests in big and complex classes?

I'm implementing unit tests in a finance system that involves several calculations. One of the methods, receives an object by parameter with more than 100 properties, and based on this object's proper...

22 Feb at 00:24

How to find the size of the file in Node.js?

I am using multer for uploading my images and documents but this time I want to restrict uploading if the size of the image is >2mb. How can I find the size of the file of the document? So far I tried...

25 Jan at 22:27

Web Pushnotification 'UnauthorizedRegistration' or 'Gone' or 'Unauthorized'- subscription expires

I have developed a push notification service for my web site. the service worker is: ``` 'use strict'; self.addEventListener('push', function (event) { var msg = {}; if (event.data) {...

Unable to get request header in asp net core web API

I am trying to create a custom filter in asp net core web api which is as below but unable to get header info. ``` internal class BasicAuthFilterAttribute : ActionFilterAttribute { private StringVa...

21 Feb at 08:28

ASP.NET Core return JSON with status code

I'm looking for the correct way to return JSON with a HTTP status code in my .NET Core Web API controller. I use to use it like this: ``` public IHttpActionResult GetResourceData() { return this....

In ASP.net core Identity (UserManager & SignInManager) is it possible to ban a user immediately?

I'm trying to find a way to provide an administrator of the application I'm developing with an effective way to quickly lockout a user who has either left the company or has been identified as behavin...

21 Feb at 09:1

How to design a Repository Pattern with Dependency Injection in ASP.NET Core MVC?

Being fairly new to ASP.NET Core 1.0 MVC, I have decided to use a Repository Pattern for an MVC Core app; I'm using a SQL DB for the Data Layer `SampleDbContext`, and I want to have a Repository class...

How to auto create database on first run?

My application being ported to .NET Core will use EF Core with SQLite. I want to automatically create the database and tables when the app is first run. According to documentation this is done using m...

How I add Headers to http.get or http.post in Typescript and angular 2?

``` getHeroes (): Observable<Heros[]> { return this.http.get(this.heroesUrl) .map(this.extractData) .catch(this.handleError); } ``` Where I add the headers and how? looking for a s...

20 Feb at 19:32

How to update an existing Conda environment with a .yml file

How can a pre-existing conda environment be updated with another .yml file. This is extremely helpful when working on projects that have multiple requirement files, i.e. `base.yml, local.yml, producti...

10 Jul at 18:36

How To Set Startup Route In ASP.NET Core

My ASP.NET core app startup route is set as: /api/values I want to change this startup route to be: / Looking through the documentation there is lots of specification on route constraints but I'm ...

7 May at 03:58

Reference .NET 4.5 dll in .NET Core 1.1 csproj?

I'm running VS 2017 RC4. I add a reference in my .NET Core app to my .NET 4.5 dll and it compiles. When a line that references the dll is called at runtime, I get: ``` System.IO.FileNotFoundExceptio...

20 Feb at 16:49

Use ObjectId.GenerateNewId() or leave MongoDB to create one?

In C# I can use the ObjectId.GenerateNewId() to generate ObjectId values. Most of the time when I insert a document in a collection I do not set the value of _id fields. MongoDB creates the ObjectId ...

20 Feb at 15:58

How can Decimal.Round() throw OverflowException

I'm using ``` Decimal.Round(decimal d) ``` MSDN says it can throw `OverflowException` [https://msdn.microsoft.com/en-us/library/k4e2bye2(v=vs.110).aspx](https://msdn.microsoft.com/en-us/library/k4...

20 Feb at 16:12

How to host multiple .NET Core apps under the same URL?

I am building a few web sites in ASP.NET Core (multiple user interface applications and a WebAPI app). They all work together, utilising the WebAPI. For the purpose of my question we'll call them App1...

31 May at 14:54