Detect if the device is iPhone X

My iOS app uses a custom height for the `UINavigationBar` which leads to some problems on the new iPhone X. Does someone already know how to detect programmatically (in Objective-C) if an app is ru...

21 Mar at 06:9

.Net Core ValidateAntiForgeryToken throwing web api 400 error

Visual Studio 2017 with Web Api using .net Core 1.1 I'm using, but I am getting a 400 Bad Request Error. Error Occurs in every way: 1. Angular http 2. Fiddler 3. Postman 4. SoapUI 5. Swagger A...

How to return Unathorized from .Net Core Web API

I do have simple API controller, and I do need to return 401. Method's return type is not `IActionResult` so I can't just `return Unauthorized()` How can I return Unauthorized in this case? ``` [Pro...

4 Feb at 08:27

Embedding Youtube Videos in webbrowser. Object doesn't support property or method

Youtube has recently stopped supporting videos embedded in the format www.youtube.com/v/{key}. So I was trying to convert the video from "/v/" to "/embed/". However when I try to navigate to the video...

12 Sep at 21:29

Fluent API, many-to-many in Entity Framework Core

I've searched stackoverflow for a proper solution on generating a relationship, using EF Core, Code first and Fluent API. A simple scenario would be: ``` public class Person { public Person() {...

Extract a page from a pdf as a jpeg

In python code, how can I efficiently save a certain page of a PDF as a JPEG file? Use case: I have a Python flask web server where PDFs will be uploaded and JPEGs corresponding to each page are store...

3 Jan at 07:59

How to add custom header to ASP.NET Core Web API response

I am porting my API from Web API 2 to ASP.NET Core Web API. I used to be able to add a custom header in the following manner: ``` HttpResponseMessage response = new HttpResponseMessage(HttpStatusCod...

12 Sep at 18:25

HTTP Request in Android with Kotlin

I want to do a login validation using POST method and to get some information using GET method. I've URL, server Username and Password already of my previous project.

27 Jul at 14:46

Docker - Bind for 0.0.0.0:4000 failed: port is already allocated

I am using docker for the first time and I was trying to implement this - [https://docs.docker.com/get-started/part2/#tag-the-image](https://docs.docker.com/get-started/part2/#tag-the-image) At one st...

4 Jan at 08:12

Error: More than one module matches. Use skip-import option to skip importing the component into the closest module

When I try to create a component in the angular cli, it's showing me this error. How do I get rid of it ? > Error: More than one module matches. Use skip-import option to skip importing the component...

23 Nov at 09:36

Disambiguate between two constructors, when two type parameters are the same

Given ``` class Either<A, B> { public Either(A x) {} public Either(B x) {} } ``` How to disambiguate between the two constructors when the two type parameters are the same? For example,...

12 Sep at 08:33

.NET - c# - Cross partition query is required but disabled trouble on DocumentDB data access

I have written the following code to fetch a record from the DocumentDB ``` private static void QueryDocuments1(DocumentClient client) { IQueryable<SearchInput> queryable = client.CreateDocument...

25 Sep at 18:17

How to use log4net in Asp.net core 2.0

I configure `log4net` in my asp.net core 2.0 application as mentioned in this article [LINK](https://stackify.com/making-log4net-net-core-work/) program.cs ``` public static void Main(string[] args...

ReactJS - .JS vs .JSX

There is something I find very confusing when working in `React.js`. There are plenty of examples available on internet which use `.js` files with `React` but many others use `.jsx` files. I have read...

12 Oct at 05:11

.net core 2.0 ConfigureLogging xunit test

In my xUnit integration test in my .NET Core 2.0 project I cannot see log messages in the terminal that also prints the test results. When the code is run in WebHost environment, the logs are printed ...

12 Sep at 11:1

Authorization based on assigned Permission function

I have three `dbo.PermissionFunc`, `dbo.Roles`, `dbo.Permissions` for my `asp.net MVC web application`. `dbo.PermissionFunc` contains all the function name in my project. `dbo.Roles` contains the ...

How to use protobuff in the serviceStack framework

Do you have a corresponding example? I want to convert the transport format to protolbuff now. Thank you.

12 Sep at 05:34

How to access TempData in my own utility class? Or TempData is null in constructor

I use TempData in some of my Views/Actions but I'd like to extract that into some class. The problem is if I try to create my class in Controller's constructor, the TempDate there is null. Better yet,...

11 Sep at 22:16

Getting "The connection does not support MultipleActiveResultSets" in a ForEach with async-await

I have the following code using Dapper.SimpleCRUD : ``` var test = new FallEnvironmentalCondition[] { new FallEnvironmentalCondition {Id=40,FallId=3,EnvironmentalConditionId=1}, new FallEnvir...

How to get scalar value from a SQL statement in a .Net core application?

The following code in a .Net core console application (EF core 2.0/Sql server). ``` var sql = _context.Set<string>() .FromSql("select dbo.FunctionReturnVarchar({0});", id); ``` got the fo...

5 Nov at 23:11

SignalR - Works when deployed to Server, but stops after a few hours (MVC)

EDIT: Look at the bottom of this post for updates. My SignalR implementation works perfectly on my local system. But when I deployed it out to my server it doesnt seem to work. Its an MVC project. M...

14 Sep at 11:50

Asp.Net Core 2.0-2.2 Kestrel not serving static content

When running a Asp.Net Core 2.0 (or 2.2) app using IIS express, static files (css, js) are served as expected. However when using command line/Kestrel via "dotnet publish -o [targetDirectory]" and do...

17 Jul at 08:56

Map category parent id self referencing table structure to EF Core entity

Database Table: [](https://i.stack.imgur.com/MX0Qc.png) I tried this approach to map the category table to EF core: ``` protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBu...

Attach to running process inside docker from VS2017

Is there an easy way to debug a process running inside a Linux container on a remote host from Visual Studio? Imagine a scenario where we have multiple services deployed on some remote machine, runni...

13 Sep at 03:15

kafka broker not available at starting

I set on a ubuntu node of a cluster a kafka 0.11.0.0 instance. Until some weeks ago everything worked fine, today I'm trying to starting it and I obtain this error after the boot: ``` [2017-09-11 16:...

11 Sep at 14:36