Python Selenium Chrome Webdriver

I'm beginning the automate the boring stuff book and I'm trying to open a chrome web browser through python. I have already installed selenium and I have tried to run this file: ``` from selenium im...

Visual Studio : can't find "resource file" in list of items to add to project

I'm on VS Community 2017 RC. I'd like to add a resource file (.resx) to my project but this item type is not listed in the items[](https://i.stack.imgur.com/HeDFc.jpg) Have I missed something ? Do I ...

How to create roles in ASP.NET Core and assign them to users?

I am using the ASP.NET Core default website template and have the authentication selected as "Individual User Accounts". How can I create roles and assign it to users so that I can use the roles in a ...

convert image into blob using javascript

I use promise to download an image and get the image data like: ``` promise.downloadFile().then(function(image){ //do something }); ``` I have got the image, which is like: ```...

3 Oct at 09:41

xUnit and multiple data records for a test

I'm fairly new to Unit Testing and have the following code: ``` public class PowerOf { public int CalcPowerOf(int @base, int exponent) { if (@base == 0) { return 0; } if (exponent ...

9 Jul at 12:51

How do I change the background color of the body?

I'm using React.js and want to change the background color of the entire page. I can't figure out how to do this. Please help, thank you. Edit (Sep 2 '18): I have a project on GitHub that I'm linking...

2 Sep at 14:31

Wrapping a react-router Link in an html button

Using suggested method: [This is the result: A link in the button](https://i.stack.imgur.com/lN4AP.png), [Code in between comment lines](https://i.stack.imgur.com/aykeJ.png) I was wondering if there ...

27 Dec at 22:10

How to deploy a React App on Apache web server

I have created a basic React App from [https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm](https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm) here , I want to run this test code on Apache bas...

21 Dec at 21:33

Return file in ASP.Net Core Web API

## Problem I want to return a file in my ASP.Net Web API Controller, but all my approaches return the `HttpResponseMessage` as JSON. ## Code so far ``` public async Task<HttpResponseMessage> ...

How to remove text between multiple pairs of brackets?

I would like to remove text contained between each of multiple pairs of brackets. The code below works fine if there is only ONE pair of brackets within the string: ``` var text = "This (remove me) w...

25 Feb at 19:5

How to set build .env variables when running create-react-app build script?

I'm using the following environment variable in my create-react-app: ``` console.log(process.env.REACT_APP_API_URL) // http://localhost:5555 ``` It works when I run `npm start` by reading a `.env` ...

How to get Column name and corresponding Database Type from DbContext in Entity Framework Core

Suppose I have this table: [](https://i.stack.imgur.com/I7r0V.png) How can I get the column name and database datatype from `DbContext` in Entity Framework Core? Tips 1. The column with name clg...

How to reject in async/await syntax?

How can I reject a promise that returned by an `async`/`await` function? e.g. Originally: ``` foo(id: string): Promise<A> { return new Promise((resolve, reject) => { someAsyncPromise().then((val...

binding a Guid parameter in asp.net mvc core

I want to bind a Guid parameter to my ASP.NET MVC Core API: ``` [FromHeader] Guid id ``` but it's always null. If I change the parameter to a string and parse the Guid from the string manually it ...

26 Feb at 08:21

ServiceStack API service RequiresAnyRole always returns 403 error

I've looked at several examples of ServiceStack's Authentication/Authorization code but I can't seem to get past this issue. I have created a custom `AuthFeature` which derives from `BasicAuthProvid...

ServiceStack register error form CustomUserAuth in CredentialsAuthProvider

searching the Internet I found many examples how to make your users table, everything works, check in on social networks, etc. But I get problem when register's representative missions of Registratio...

24 Feb at 21:36

How do I pass a list as a parameter in a stored procedure?

Looking to pass a list of User IDs to return a list names. I have a plan to handle the outputed names (with a COALESCE something or other) but trying to find the best way to pass in the list of user I...

24 Feb at 23:32

Objects in Scene dark after calling LoadScene/LoadLevel

I completed Unity's roll-a-ball tutorial and it works fine. I changed a couple of materials to make it look better. I also added a C# script that should restart the level when the player falls off of ...

30 Apr at 17:52

MongoDB: exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating

I created `/data/db` in root directory and ran `./mongod`: ``` [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating [initandl...

23 Jun at 16:38

netcoreapp2.0 with netstandard2.0

I have a project(x) that targets the NetStandard.Library 2.0 and a console app that targets netcoreapp2.0. ``` <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp2...

10 Jan at 13:45

Looping through a JSON array in Python

I have the following data taken from an API. I am trying to access the restaurant name using a Python script and have the script display it. Here are my files: test.py ``` with open('data.json') as ...

8 Jun at 14:3

ShowBalloonTip Not Working

On Windows 10, the `ShowBalloonTip` method of `NotifyIcon` NEVER shows the balloon tip. This would appear to have something to do with Windows itself. If I go to `Settings > System > Notifications & ...

24 Feb at 17:14

OnActionExecuted get status code

Is there a way to get the HTTP status code from MVC action from `OnActionExecuted`, without using the session variables?

24 Feb at 16:54

Keras split train test set when using ImageDataGenerator

I have a single directory which contains sub-folders (according to labels) of images. I want to split this data into train and test set while using ImageDataGenerator in Keras. Although model.fit() in...

C# Linq aggregate intermediate values

Given an array of positive and negative numbers is there a Linq expression that can get intermediate values? for example ``` var heights = new List<int>(); var numbers = new [] { 5, 15, -5, -15 ...

3 Oct at 13:31