Questions

Why is StringValues used for Request.Query values?

Let's say I have some url that looks like this: www.myhost.com/mypage?color=blue In Asp.Net Core, I'd expect to get the color query parameter value by doing the following: `string color = Request.Qu...

3 Oct at 12:52

How to use LINQ Where for generic type?

I have the following generic method that I need to be able to perform a LINQ Where query in: ``` public static List<T> GetItems<T>(Guid parentId = new Guid()) where T : new() { var db = new SQLit...

10 Jan at 13:35

How to iterate using ngFor loop Map containing key as string and values as map iteration

I am new to angular 5 and trying to iterate the map containing another map in typescript. How to iterate below this kind of map in angular below is code for component: ``` import { Component, OnIni...

When it can be usefull to use the `IWebHost.Start()` method?

ASP.NET Core 2 MVC. `Microsift.AspNet.Hosting.IWebHost` interface [contains](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.iwebhost.start?view=aspnetcore-2.0) the `Start()...

AspNetCore.SignalR 2.1 and CORS

I'm migrating our SignalR-Service to the new AspNetCore.SignalR (2.1 preview) and now I get problems with CORS. I will never access the service from the same origin, so I need to disable CORS in gener...

When to use TryAddSingleton or AddSingleton?

I've noticed in some .NET Core examples there are calls to `TryAddSingleton`, and in some `AddSingleton` when registering services. Decompiler shows that TryAdd (called by TryAddSingleton) adds the s...

how to format date in Component of angular 5

I am new to angular and looking to format date in component ngOnInit method. I have seen some example where pipe operator are used to format the data but i dont know how to format date in component fi...

10 Jan at 09:2

Covariance and Contravariance with Func in generics

I need more information about variance in generics and delegates. The following code snippet does not compile: > Error CS1961 Invalid variance: The type parameter 'TIn' must be covariantly valid ...

10 Jan at 01:24

Conda: Creating a virtual environment

I'm trying to create a virtual environment. I've followed steps from both [Conda](https://conda.io/docs/user-guide/tasks/manage-environments.html#) and [Medium](https://medium.com/@tk2bit/how-to-set-u...

23 Apr at 10:57

Validation nullreferenceexception trying to implement new custom syntax

Attempting to rewrite my custom rules to suggested new 7.2 FluentValidation syntax and am getting the following error: NullReferenceException at ServiceStack.FluentValidation.Internal.PropertyRule, ...

9 Jan at 18:41

Oracle.ManagedDataAccess OracleInternal.NotificationServices.ONSException

We use the 'Oracle.ManagedDataAccess' ODP.NET driver for database access to Oracle. When connecting to the database with the connection string: ``` Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=...

23 Sep at 04:4

Add JObject to JObject

I have a json structure like this: ``` var json = { "report": {}, "expense": {}, "invoices": {}, "projects": {}, "clients": {}, "settings": { "users": {}, "companies": {}, "te...

16 Jun at 09:1

can't override appsettings.json settings with environment variables

I can't override the settings of my `appsettings.json` file with environment variables. `appsettings.json`: ``` { "AppSettings": { "LocalUpdatesDir": "<some path>", "BinaryDeltaCount": 5, ...

9 Jan at 15:53

PHP 7.2 Function create_function() is deprecated

I have used `create_function()` in my application below. ``` $callbacks[$delimiter] = create_function('$matches', "return '$delimiter' . strtolower(\$matches[1]);"); ``` But for PHP 7.2.0, `create_fu...

6 Jul at 02:16

Swapping Property GetMethod implementation runtime

I'm currently trying to swap a property get implementation by replacing it with a bit of IL. I was using this question as reference: [How to replace a pointer to a pointer to a method in a class of my...

22 Apr at 19:28

Spring boot could not resolve placeholder in string

I am running spring-boot on an embedded tomcat server through maven with `mvn clean install spring-boot:run`. But every time I run it I get this error: ``` Caused by: java.lang.IllegalArgumentExceptio...

21 Dec at 22:25

Change default timeout

I have the following implementation. And the default timeout is 100 seconds. I wonder how can I able to change the default timeout? ``` public class HttpService : IHttpService { private stati...

8 Jan at 21:5

ORMLite join with multiple tables and multiselect

I'm having some issues with selecting the same `model` twice and more times with `ORMLite`. My query does various `LeftJoin<Model1,Model2>`, and then it does something like this: ``` .LeftJoin<Model...

9 Jan at 22:9

Retrieve value from DropDownList in nested GridView on RowCommand

I have a nested GridView(`GvMP_Summary_Items`). Each row contains a DropDownList. The DropDownList is bounded on the RowDataBound event of the nested GridView. Each row also contains 1 Button. Upon ...

How do I check if PyTorch is using the GPU?

How do I check if PyTorch is using the GPU? The `nvidia-smi` command can detect GPU activity, but I want to check it directly from inside a Python script.

Redis performance compared to sql server 2012

We are using Redis cache (Nservicekit-Redis client) to store master data related to store info, error codes, brand info..etc, each module contains 1k-5k records and all records of each module data (`L...

ERROR in Cannot find module 'node-sass'

Config: macOS High Sierra, version 10.13.2, node:v8.1.2 npm:5.0.3 When I run npm start in my angularjs project I get this error: ``` ERROR in Cannot find module 'node-sass' ``` After this I run: `...

Install Qt on Ubuntu

Need to build simple GUI application. For this reason I decided to install Qt on my Ubuntu 16. I have downloaded open source Qt edition [from theirs site](https://www.qt.io/download-qt-installer?hsCta...

8 Jan at 09:25

javascript includes() case insensitive

I have an array of strings that I need to loop and check against with another passed in string. ``` var filterstrings = ['firststring','secondstring','thridstring']; var passedinstring = localStorage....

18 May at 23:43

C# 7.2 In Keyword Performance

I am trying to test how much performant (Or not) the "in" keyword added to C# is. The in keyword should be able to pass a readonly reference to a value type into a method, instead of first copying the...

8 Jan at 00:30