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...
- Modified
- 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...
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...
- Modified
- 24 May at 13:46
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()...
- Modified
- 10 Jan at 11:8
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...
- Modified
- 31 Jan at 14:29
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...
- Modified
- 3 May at 04:51
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...
- Modified
- 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 ...
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...
- Modified
- 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, ...
- Modified
- 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=...
Add JObject to JObject
I have a json structure like this: ``` var json = { "report": {}, "expense": {}, "invoices": {}, "projects": {}, "clients": {}, "settings": { "users": {}, "companies": {}, "te...
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, ...
- Modified
- 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...
- Modified
- 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...
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...
- Modified
- 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...
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...
- Modified
- 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 ...
- Modified
- 26 Jan at 10:28
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.
- Modified
- 24 Jul at 02:38
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...
- Modified
- 8 Jan at 18:6
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: `...
- Modified
- 8 Jan at 09:59
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...
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....
- Modified
- 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...
- Modified
- 8 Jan at 00:30