Using null-conditional bool? in if statement

Why this code works: ``` if (list?.Any() == true) ``` but this code doesn't: ``` if (list?.Any()) ``` saying So why is it not a language feature making such an implicit conversion in the stat...

13 Jan at 15:31

Cookie Authentication expiring too soon in ASP.NET Core

I have a ASP.NET Core 1.1.2 project in which I am using cookie authentication. I am having a problem where users are being prompted to log back in after being idle for an hour or less, and losing wor...

19 Jan at 18:44

Async function without await in JavaScript

I have two functions, `a` and `b`, that are asynchronous, the former without `await` and the latter with `await`. They both log something to the console and return `undefined`. After calling either of...

4 Sep at 05:35

Get duration of Video after upload

What is best way to get? I have a field where user will upload video. When you click the upload button, Video get uploaded. This work perfectly. I needed the duration of the video from physical pat...

7 Sep at 07:38

ComosDB - MongoAPI - Document does not contain shard key

I am investigating using CosmosDB (previously DocumentDB), we currently use MongoDB so I am trying to use the MongoAPI for CosmosDB. I have created a CosmosDB deployment in azure, created a collectio...

9 Aug at 10:10

Dbcontext IDbset properties are null when injected in ServiceStack IoC

I have registered my DbContext with the standard container in ServiceStack, the DbContext is injected into the service but strangely the `IDbSet` property is `null`, all the other properties are as ex...

Detecting when user scrolls to bottom of div with React js

I have a website with different sections. I am using segment.io to track different actions on the page. How can I detect if a user has scrolled to the bottom of a div? I have tried the following but i...

9 Aug at 08:41

#include errors detected in vscode

I am using Visual Studio Code in my C++ project. I installed . I got the following error: > #include errors detected. Please update your includePath. IntelliSense features for this translation unit (...

9 Aug at 06:50

Electron GUI with C# backend

I've got an existing project developed in C# using WinForms with custom controls for the GUI. We are amazed by the approach to write GUIs using HTML/CSS/JS and we are looking for the best way to wri...

9 May at 01:49

How to set header and options in axios?

I use Axios to perform an HTTP post like this: ``` import axios from 'axios' params = {'HTTP_CONTENT_LANGUAGE': self.language} headers = {'header1': value} axios.post(url, params, headers) ``` Is t...

4 Dec at 15:17

Timeout connecting to MSSQL Server 2017 when application running on Linux

I recently started up an ASP.NET Core Web-Application (WebAPI) using Entity Framework Core for database communications and everything was running really smooth as long as I was running the application...

ServiceStack - Adding CORS module twice?

I'm getting an exception when loading my ServiceStack Api project. Here's the ServiceStack output: ``` "startUpErrors": [{ "errorCode": "ArgumentException", "message": "An item with the same ...

8 Aug at 19:4

Fine grained authorization in ServiceStack API

I am developing a large API surface using ServiceStack and I'm addressing the question of authorization. End-users need the ability to customize the rights given to various roles at the API request l...

9 Aug at 09:22

React: Expected an assignment or function call and instead saw an expression

I am trying to fix this lint error at line `const def = (props) => {` in following sample code. ``` const propTypes = { prop1: PropTypes.string, prop2: PropTypes.string, prop3: PropTypes.string, prop...

8 Aug at 16:13

What is the ASP.NET Core equivalent to HttpRequestMessage?

I found a [blog post](http://bizcoder.com/posting-raw-json-to-web-api) that shows how POSTed JSON can be received as a string. I want to know what's the new native way to do the same thing as the f...

Convert encrypt and decrypt C# function to PHP function

I would like to convert C# function to PHP function. Here is link to Function in C# : [https://stackoverflow.com/a/19441805/3581428](https://stackoverflow.com/a/19441805/3581428) ``` public static st...

12 Aug at 05:11

JetBrains Rider - configure appsettings overrides

I am trying JetBrains Rider for my existing .NET Core project. In the project I have several `appsettings.json` overrides: - `appsettings.Development.json`- `appsettings.Test.json`- `appsettings.Stag...

8 Aug at 11:59

Why does casting a struct to a similar class sort-of work?

I was exploring the limits of what I could accomplish in C# and I wrote a `ForceCast()` function to perform a brute-force cast without any type checks. I wrote a class called `Original` and a stru...

8 Aug at 11:45

How to access external json file objects in vue.js app

How to access objects in the app I am new in this ``` import json from './json/data.json' ``` the JSON file is loaded and now I have to access the objects within it

1 Jun at 13:10

Microsoft.SqlServer.Types in ASP NET Core

I'm trying to get the nuget package Microsoft.SqlServer.Types to work in ASP Core targeting full framework 461. I need to use the types SqlGeography and SqlHierarchyId. But when I run my test I get fo...

8 Aug at 09:10

How can I use String substring in Swift 4? 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range from' operator

I have the following simple code written in Swift 3: ``` let str = "Hello, playground" let index = str.index(of: ",")! let newStr = str.substring(to: index) ``` From Xcode 9 beta 5, I get the follo...

23 Jun at 00:56

ServiceStack ORMLite LeftJoin confusion

I have a simple Vendor -> Product relation with the following setup (non-relevant properties elided): ``` public class Vendor { public Guid Id { get; set; } public bool IsDeleted { get; set; ...

Why am I getting "Permission denied" when activating a venv?

I just started a new python project and created a venv inside the project folder by running `virtualenv venv` in the terminal. However, when I run `venv/bin/activate` I get a permission denied error. ...

30 Dec at 16:51

curl: (7) Failed to connect to port 80, and 443 - on one domain

This question shows research effort; it is useful and clear I have checked the cURL not working properly When I run the command `curl -I https://www.example.com/sitemap.xml` ``` curl: (7) Failed t...

24 Aug at 10:7

EPplus To Insert X Number of Blank Rows

I have an instance where if a cell value is between 15 and 25 then I need to insert 10 blank rows, if the cell value is > 30 I need to insert 25 blank rows Rather than simply typing the same syntax ...

7 Aug at 14:48