Questions

Creating a proxy to another web api with Asp.net core

I'm developing an ASP.Net Core web application where I need to create a kind of "authentication proxy" to another (external) web service. What I mean by authentication proxy is that I will receive re...

How do document service responses in ServiceStack with Servicestack swagger-api (1.2)

I am using [swagger ui](http://docs.servicestack.net/swagger-api%22swagger-api%22) for the documentation of my ServiceStack web-services which works quite nice. However I did not find a way to add any...

20 Jun at 09:12

How to execute a SQL script in DBeaver?

I have a number of `.sql` files that I wish to execute through DBeaver. Traditional database development programmes allow the user to edit and run SQL scripts (totally or partially) in the same window...

2 Feb at 07:30

Why does this EF insert with IDENTITY_INSERT not work?

This is the query: ``` using (var db = new AppDbContext()) { var item = new IdentityItem {Id = 418, Name = "Abrahadabra" }; db.IdentityItems.Add(item); db.Database.ExecuteSqlCommand("SET ...

How to fix "could not find or load the Qt platform plugin windows" while using Matplotlib in PyCharm

I am getting the error "could not find or load the Qt platform plugin windows" while using matplotlib in PyCharm. How can I solve this? ![enter image description here](https://i.stack.imgur.com/XXw0...

11 Jun at 16:55

Loading ASP.Net Core authorization policy from database

In ASP.Net Core we defined authorization policy in ConfigureServices method as below. ``` public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddAuthorizat...

ASP.NET Core WebApi HttpResponseMessage create custom message?

How can I create custom message in ASP.NET Core WebApi ? For example I want to return ``` new HttpResponseMessage() { StatusCode=HttpStatusCode.OK, Message="Congratulations !!" }; new HttpRe...

1 Feb at 23:54

numpy array concatenate: "ValueError: all the input arrays must have same number of dimensions"

How to concatenate these `numpy` arrays? first `np.array` with a shape `(5,4)` ``` [[ 6487 400 489580 0] [ 6488 401 492994 0] [ 6491 408 489247 0] [ 6491 408 489247 ...

15 Jul at 09:29

denied: requested access to the resource is denied: docker

I am following [this link](https://docs.docker.com/engine/getstarted/step_four/) to create my first docker Image and it went successfully and now I am trying to push this Image into my docker reposito...

22 Jun at 23:40

Vue template or render function not defined yet I am using neither?

This is my main javascript file: ``` import Vue from 'vue' new Vue({ el: '#app' }); ``` My HTML file: ``` <body> <div id="app"></div> <script src="{{ mix('/js/app.js') }}"></script> </...

Why are some properties (e.g. IsSome and IsNone) for FSharpOption not visible from C#?

It seems to me that some properties of the F# option type are not visible from C# projects. By inspecting the types, I can see more or less the reason, but I don't really understand what exactly is go...

1 Feb at 15:49

Transform Request to Autoquery friendly

We are working with a 3rd party grid (telerik kendo) that has paging/sorting/filtering built in. It will send the requests in a certain way when making the GET call and I'm trying to determine if the...

Including referenced project DLLs in nuget package [.Net Core RC3 *.csproj file]

I have a solution with two projects in it. First project is called Library1, which references project two called Referencelibrary. I am trying to embed the DLLs for ReferenceLibrary inside Library1's ...

What is correct media query for IPad Pro?

I have these two but they are not working. I'm simulating in Chrome ``` /* Landscape*/ @media only screen and (min-device-width: 1024px) and (max-device-width: 1366px) and (-webkit-min-device-pi...

26 Feb at 07:15

Identityserver 4 and Azure AD

I'm looking into using Identity Server 4 for authentication within a C# based MVC application. I'd like to use accounts stored in Azure AD as a source of valid users but the documentation only seems t...

Refreshing claimsPrincipal after changing roles

I'm having some issues with changing role in dotnetcore identity. I have the following code. ``` private async Task SetRoleToX(ClaimsPrincipal claimsPrincipal, string X) { var currentUser = awai...

How to get resource strings in strongly typed way in asp.net core?

In the following program, in order to get resource strings i am using _localizer["About Title"] where "About Title" is a magic string. How to avoid using strings like this? Is there any strongly typed...

TextFieldParser ignoring header row C#

Reading in CSV files and the TextFieldParser skips the header row. Any idea how to make certain the first row is skipped. ``` String[] Col3Value = new string[40]; TextFieldParser textFieldParser = n...

9 Aug at 09:9

C# 7 Expression Bodied Constructors

In C# 7, how do I write an Expression Bodied Constructor like this using 2 parameters. ``` public Person(string name, int age) { Name = name; Age = age; } ```

1 Feb at 07:26

TypeError: 'DataFrame' object is not callable

I've programmed these for calculating Variance ``` credit_card = pd.read_csv("default_of_credit_card_clients_Data.csv", skiprows=1) for col in credit_card: var[col]=np.var(credit_card(col)) `...

5 Sep at 01:12

How to add global `AuthorizeFilter` or `AuthorizeAttribute` in ASP.NET Core?

In and below we just add the following in Global.asax: ``` GlobalFilters.Filters.Add(new AuthorizeAttribute() { Roles = "Admin, SuperUser" }); ``` Any idea how to do this in ?

22 Nov at 07:55

base 64 encode and decode a string in angular (2+)

My front-end tool is Angular 2. I had a password string, before passing it to API I need to base64 encode. Since in service base64 encoded string will be decoded. So I am looking for some base64 enc...

30 May at 05:36

"Object does not match target type" when calling methods using string in C#

I'm trying to call a method using a string, but there a problem: ``` void make_moviment(string mov,Vector3 new_mov){ GameObject past_panel = GameObject.Find(actual_level.ToString()); Type t =...

1 Feb at 01:14

Set order of columns in pandas dataframe

Is there a way to reorder columns in pandas dataframe based on my personal preference (i.e. not alphabetically or numerically sorted, but more like following certain conventions)? Simple example: ``...

31 Jan at 23:4

Overloading methods in inherited classes

I have started to understand that I do not understand what is going on. There is the following behavior in C#: ``` public class Base { public void Method(D a) { Console.WriteLine("pub...

9 Feb at 01:1