Some Of The Best Answers From Latest Asked Questions

11

answers

Check if value exists in enum in TypeScript

I recieve a number type = 3 and have to check if it exists in this enum: export const MESSAGE_TYPE = { INFO: 1, SUCCESS: 2, WARNING: 3, ERROR: 4, }; The best way I found is by getti..

13

answers

How to extract svg as file from web page

I want to save SVG as file from this page https://www.lightningdesignsystem.com/icons/ Is there any Chrome extension or other way to do this?..

4

answers

Open Url in default web browser

I am new in react-native and i want to open url in default browser like Chrome in Android and iPhone both. We open url via intent in Android same like functionality i want to achieve. I have search ..

2

answers

How to set combobox default value?

In windows form, It has a ComboBox, Which have data binded by the DataSource. When going to set the text property for a ComboBox. Selected ComboBox -> Property -> Text : "--Select--". Design ..

3

answers

angular 4: *ngIf with multiple conditions

I'm confused a bit. I need to hide block if result have one of several cases. But seems it not working correctly... <div *ngIf="currentStatus !== 'open' || currentStatus !== 'reopen' "> &l..

26

answers

Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3

I can't get rid of this error! I have tried all sorts of things like clearing Derived Data(Preferences->Locations->click gray arrow to open Derived Data folder in Finder->right-click, move to trash..

4

answers

How to include css files in Vue 2

I'm new to vue js and trying to learn this. I installed a fresh new version of vue webpack in my system. I'm having a css, js and images of this a theme template which I want to include into the HTML ..

4

answers

Angular 4 default radio button checked by default

I'm trying to mark as a default a radiobutton depending on the value I get from my object, it can be True or False. What could I do to mark as a default radiobutton depending on the option? <label..

5

answers

How to print a specific row of a pandas DataFrame?

I have a massive dataframe, and I'm getting the error: TypeError: ("Empty 'DataFrame': no numeric data to plot", 'occurred at index 159220') I've already dropped nulls, and checked dtypes for the Da..

31

answers

Android Studio - Failed to notify project evaluation listener error

Following is the build.gradle code in Android Studio apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicatio..

7

answers

Jersey stopped working with InjectionManagerFactory not found

I am receiving below error while running my Jersey API in Tomcat 8.5.11 which is causing my API to stop: HTTP Status 500 - Servlet.init() for servlet Jersey REST Service threw exception typ..

15

answers

Cannot connect to the Docker daemon on macOS

I normally prefer to manage my apps on my OSX with brew I am able to install docker, docker-compose and docker-machine docker --version Docker version 17.05.0-ce, build 89658be docker-compose --vers..

5

answers

Build .NET Core console application to output an EXE

For a console application project targeting .NET Core 1.0, I cannot figure out how to get an .exe to output during build. The project runs fine in debug. I've tried publishing the project, but that d..

8

answers

How to send Basic Auth with axios

I'm trying to implement the following code, but something is not working. Here is the code: var session_url = 'http://api_address/api/session_endpoint'; var username = 'user'; var password = 'p..

14

answers

Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci

I update the gradle plugin to the latest : com.android.tools.build:gradle:3.0.0-alpha1 and this error occured : export TERM="dumb" if [ -e ./gradlew ]; then ./gradlew test;else gradle test;fi FAILU..

5

answers

How to emit an event from parent to child?

I am currently using Angular 2. Usually we use @Output() addTab = new EventEmitter<any>(); and then addTab.emit() to emit an event to parent component. Is there any way we can do it vice cersa,..

3

answers

Abort a Git Merge

I am working on a project using Git as the VCS. I got a branch xyz cut from the mainline branch of master. After working for a while, I committed my code and took a pull of the branch mainline. The p..

14

answers

if-else statement inside jsx: ReactJS

I need to change render function and run some sub render function when a specific state given, For example: render() { return ( <View style={styles.container}> if (..

7

answers

Load json from local file with http.get() in angular 2

I'm trying to load a local json with http.get() in angular 2. I tried something, that I found here on stack. It looks like this: this is my app.module.ts where I import the HttpModule and the JsonMod..

13

answers

Constants in Kotlin -- what's a recommended way to create them?

How is it recommended to create constants in Kotlin? And what's the naming convention? I've not found that in the documentation. companion object { //1 val MY_CONST = "something" //2 ..

1

answers

Check key exist in python dict

Below is the file output: apples:20 orange:100 Below is the code: d = {} with open('test1.txt') as f: for line in f: if ":" not in line: continue key, value = l..

10

answers

Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries

I have two classes in my sqlite database, a parent table named Categorie and the child table called Article. I created first the child table class and addes entries. So first I had this: class Articl..

13

answers

Access denied; you need (at least one of) the SUPER privilege(s) for this operation

So I try to import sql file into rds (1G MEM, 1 CPU). The sql file is like 1.4G mysql -h xxxx.rds.amazonaws.com -u user -ppass --max-allowed-packet=33554432 db < db.sql It got stuck at: ERROR 12..

3

answers

How does createOrReplaceTempView work in Spark?

I am new to Spark and Spark SQL. How does createOrReplaceTempView work in Spark? If we register an RDD of objects as a table will spark keep all the data in memory? ..

10

answers

Even though JRE 8 is installed on my MAC -" No Java Runtime present,requesting to install " gets displayed in terminal

Even though JRE 8 is installed on my MAC OS Yosemite 10.10.3,while running the Android present in tools in sdk - the error - " No Java Runtime present,requesting to install " gets displayed in term..

5

answers

Try-catch block in Jenkins pipeline script

I'm trying to use the following code to execute builds, and in the end, execute post build actions when builds were successful. Still, I get a MultipleCompilationErrorsException, saying that my try bl..

4

answers

Angular: 'Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays'

I've created an angular app which gets data from a json file. But I'm having issues with showing the data in html. A lot of variables are in dutch, I'm sorry for that. I'm also a bit new to all of thi..

11

answers

Gradle - Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'

I am trying to import Gradle project in Intellij Idea with local Gradle distrib and getting stacktrace with the following message: Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)..

4

answers

Angular 4/5/6 Global Variables

I really struggle with creating global variables in my Angular 2 application. I already googled and read many posts on StackOverflow on this for the last 3 hours, however it seems like I just can't ..

1

answers

How to reload page the page with pagination in Angular 2?

How can I reload the current page on Angular 2? if iam in page 2 (pagination) and refresh the page it will show page 1(URL pageload) but i want i refresh the page 2 and it will appear in page 2..

4

answers

Remove Unnamed columns in pandas dataframe

I have a data file from columns A-G like below but when I am reading it with pd.read_csv('data.csv') it prints an extra unnamed column at the end for no reason. colA ColB colC colD colE ..

2

answers

display: flex not working on Internet Explorer

My flex container: .back_pattern { display: flex; display: -ms-flexbox; -ms-flex-pack: center; flex-direction: column; align-content: center; justify-content: center; min-..

2

answers

Disable Button in Angular 2

I want if the input 'Contract type' is empty, the button 'Save' is not clickable Save button: <div class="col-md-4"> <cic-textbox [control]="formGroup.get('contractType')"></..

6

answers

ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)

I have a list say, temp_list with following properties : len(temp_list) = 9260 temp_list[0].shape = (224,224,3) Now, when I am converting into numpy array, x = np.array(temp_list) I am..

4

answers

Convert float64 column to int64 in Pandas

I tried to convert a column from data type float64 to int64 using: df['column name'].astype(int64) but got an error: NameError: name 'int64' is not defined The column has number of people but..

12

answers

Scroll to element on click in Angular 4

I want to be able to scroll to a target when a button is pressed. I was thinking something like this. <button (click)="scroll(#target)">Button</button> And in my component.ts a ..

16

answers

If '<selector>' is an Angular component, then verify that it is part of this module

I am new in Angular2. I have tried to create a component but showing an error. This is the app.component.ts file. import { Component } from '@angular/core'; import { MyComponentComponent } from './m..

12

answers

How to use jQuery Plugin with Angular 4?

I want to use a range slider in an angular project and I tried using one available module for angular 4. It works fine during compilation but when I try to build it for deployment, it throws the belo..

3

answers

How to test a variable is null in python

val = "" del val if val is None: print("null") I ran above code, but got NameError: name 'val' is not defined. How to decide whether a variable is null, and avoid NameError?..

10

answers

How to upgrade Angular CLI to the latest version

Using ng --version I got: @angular/cli: 1.0.0 which is not the latest release available. Since I have Angular CLI globally installed on my system, in order to upgrade it I tried: npm update an..

13

answers

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http:/..

3

answers

How to find MySQL process list and to kill those processes?

The MySQL database hangs, due to some queries. How can I find the processes and kill them?..

8

answers

Kotlin - How to correctly concatenate a String

A very basic question, what is the right way to concatenate a String in Kotlin? In Java you would use the concat() method, e.g. String a = "Hello "; String b = a.concat("World"); // b = Hello World ..

5

answers

Flutter - Layout a Grid

I am trying to layout a 4x4 grid of tiles in flutter. I managed to do it with columns and rows. But now I found the GridView component. Could anyone provide an example on how to do it using it? I can..

13

answers

How do I Set Background image in Flutter?

I am trying to set a background image for the home page. I am getting the image place from start of the screen and filling the width but not the height. Am I missing something in my code? Are there i..

12

answers

RestClientException: Could not extract response. no suitable HttpMessageConverter found

Using the curl command: curl -u 591bf65f50057469f10b5fd9:0cf17f9b03d056ds0e11e48497e506a2 https://backend.tdk.com/api/devicetypes/59147fd79e93s12e61499ffe/messages I am getting a JSON response: {"..

6

answers

Spark dataframe: collect () vs select ()

Calling collect() on an RDD will return the entire dataset to the driver which can cause out of memory and we should avoid that. Will collect() behave the same way if called on a dataframe? What abou..

8

answers

Home does not contain an export named Home

I was working with create-react-app and came across this issue where I get Home does not contain an export named Home. Here's how I set up my App.js file: import React, { Component } from 'react'; imp..

19

answers

Android Room - simple select query - Cannot access database on the main thread

I am trying a sample with Room Persistence Library. I created an Entity: @Entity public class Agent { @PrimaryKey public String guid; public String name; public String email; publ..

14

answers

Xcode Error: "The app ID cannot be registered to your development team."

We are porting an Android app to iOS for a client. They have added our account to their iTunes Connect account and created an app entry. We developed the app using the bundle ID they specified. But n..

10

answers

Load local images in React.js

I have installed React using create-react-app. It installed fine, but I am trying to load an image in one of my components (Header.js, file path: src/components/common/Header.js) but it's not loading...

2

answers

How can I get the height of an element using css only

We have a lot of options to get the height of an element using jQuery and JavaScript. But how can we get the height using CSS only? Suppose, I have a div with dynamic content - so it does not have a..

23

answers

How to create a new component in Angular 4 using CLI

In angular 2 I use ng g c componentname But It is not supported in Angular 4, so I created it manually, but it shows error that it is not a module...

7

answers

'Property does not exist on type 'never'

This is similar to #40796374 but that is around types, while I am using interfaces. Given the code below: _x000D_ _x000D_ interface Foo {_x000D_ name: string;_x000D_ }_x000D_ _x000D_ function go()..

3

answers

TypeError: can't pickle _thread.lock objects

Trying to run two different functions at the same time with shared queue and get an error...how can I run two functions at the same time with a shared queue? This is Python version 3.6 on Windows 7. ..

1

answers

TypeError: expected str, bytes or os.PathLike object, not _io.BufferedReader

I'm trying to iterate through a group of files in a folder on my local machine and upload only ones where the file names contain "Service_Areas" to my FTP site using using this code (Python 3.6.1 32 b..

8

answers

Is it safe to store a JWT in localStorage with ReactJS?

I'm currently building a single page application using ReactJS. I read that one of the reasons for not using localStorage is because of XSS vulnerabilities. Since React escapes all user input, would i..

2

answers

'DataFrame' object has no attribute 'sort'

I face some problem here, in my python package I have install numpy, but I still have this error 'DataFrame' object has no attribute 'sort' Anyone can give me some idea.. This is my code : final.lo..

11

answers

How to pass params with history.push/Link/Redirect in react-router v4?

How can we pass parameter with this.props.history.push('/page') in React-Router v4? .then(response => { var r = this; if (response.status >= 200 && response.status < 3..

8

answers

Angular update object in object array

Say i have the following object array, lets name it itemArray; { "totalItems": 2, "items": [ { "id": 1, "name": "foo" }, { "id": 2, "name": "bar" }, ..

11

answers

How do you fix the "element not interactable" exception?

I know this has been asked lots of times before but how do you get around the "element not interactable" exception? I'm new to Selenium so excuse me if I get something wrong. Here is my code: butto..

10

answers

VirtualBox Cannot register the hard disk already exists

I created a virtual disk file VM_1_Ubuntu.vdi. Then I moved it into another folder. I tried to update VM settings (right click on virtual machine -> settings -> Storage -> Controller SATA tab, VM_1_Ub..

18

answers

The create-react-app imports restriction outside of src directory

I am using create-react-app. I am trying to call an image from my public folder from a file inside my src/components. I am receiving this error message. ./src/components/website_index.js Module no..

20

answers

Kubernetes service external ip pending

I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2, I have deployed nginx with 3 replica, YAML file is below, apiVersion: extensions/v1beta1 kind: Deployment metadata: name: dep..

8

answers

How to make primary key as autoincrement for Room Persistence lib

I am creating an Entity (Room Persistence Library) class Food, where I want to make foodId as autoincrement. @Entity class Food(var foodName: String, var foodDesc: String, var protein: Double, var car..

7

answers

Android Studio 3.0 Flavor Dimension Issue

Upgraded to Studio Canary build. My previous project of Telegram Messenger is giving following error. Error:All flavors must now belong to a named flavor dimension. The flavor 'armv7' is not assig..

6

answers

How to enable Google Play App Signing

I think a lot of developers are trying to learn more about the new Google Play App Signing feature presented at Google I/O 2017. The ability to store the keystore to sign the apps inside Google Play ..

10

answers

Kotlin: How to get and set a text to TextView in Android using Kotlin?

I'm newbie. I want to change text of TextView While click on it. My code: val text: TextView = findViewById(R.id.android_text) as TextView text.setOnClickListener { text.setText(g..

18

answers

Error: Cannot find module '../lib/utils/unsupported.js' while using Ionic

I always get this error message when I run "Ionic start project name": Error message Running command - failed![ERROR] An error occurred while running npm install (exit code 1): module.js:471 ..

9

answers

npm notice created a lockfile as package-lock.json. You should commit this file

I have been trying to load the skeleton of express with npm install express. It outputs the following line: npm notice created a lockfile as package-lock.json. You should commit this file. Wha..

30

answers

More than one file was found with OS independent path 'META-INF/LICENSE'

When I build my app, I get the following error: Error: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. More than one file was found with OS independent path 'META-IN..

8

answers

Npm Error - No matching version found for

i clone a project with git, the project was create with ionic 2 but when i execute the command for re-create the node_modules folder i get this error. npm install npm WARN deprecated [email protected]

5

answers

Run bash command on jenkins pipeline

Inside a groovy script (for a jenkins pipeline): How can I run a bash command instead of a sh command? I have tried the following: Call "#!/bin/bash" inside the sh call: stage('Setting the variable..

9

answers

Python: pandas merge multiple dataframes

I have diferent dataframes and need to merge them together based on the date column. If I only had two dataframes, I could use df1.merge(df2, on='date'), to do it with three dataframes, I use df1.merg..

8

answers

Room - Schema export directory is not provided to the annotation processor so we cannot export the schema

I am using Android Database Component Room I've configured everything, but when I compile, Android Studio gives me this warning: Schema export directory is not provided to the annotation processo..

9

answers

Property 'value' does not exist on type EventTarget in TypeScript

So the following code is in Angular 4 and I can't figure out why it doesn't work the way as expected. Here is a snippet of my handler: onUpdatingServerName(event: Event) { console.log(event); th..

10

answers

ssl.SSLError: tlsv1 alert protocol version

I'm using the REST API for a Cisco CMX device, and trying to write Python code which makes a GET request to the API for information. The code is as follows and is the same as that in the file except w..

5

answers

When to use 'raise NotImplementedError'?

Is it to remind yourself and your team to implement the class correctly? I don't fully get the use of an abstract class like this: class RectangularRoom(object): def __init__(self, width, height)..

12

answers

React-router v4 this.props.history.push(...) not working

I'm trying to route programatically using this.props.history.push(..) but it doesn't seem to work. Here's the router: import { BrowserRouter as Router, Route } from 'react-router-dom'; <Route..

29

answers

Android - How to achieve setOnClickListener in Kotlin?

I wanted to know that how we set basic onClickListener in Kotlin for Android Development...

7

answers

What is the role of the package-lock.json?

[email protected] has been published, it has a new feature package-lock.json file (after npm install) which confuses me. I want to know, what is the effect of this file?..

2

answers

How to download Visual Studio Community Edition 2015 (not 2017)

I have a Resharper 9x license and it is only compatible up to MS VS Community 2015 edition. I tried to download the 2015 version from Microsoft but their website stubbornly wants me to have 2017, only..

3

answers

Angular 2 ngfor first, last, index loop

I'm trying to set as default the first occurrence in this example: plunkr getting the following error: Unhandled Promise rejection: Template parse errors: TypeError: Cannot read property 'toUp..

2

answers

Create Setup/MSI installer in Visual Studio 2017

I have written an outlook add-in VSTO in Visual Studio Pro 2017 (VB.NET). I have published it which creates a setup.exe which is OK but I would like to create a proper installer that copies the files..

4

answers

Angular, Http GET with parameter?

I dont know how to make an API call to such a method: [HttpGet] [ActionName("GetSupport")] public HttpResponseMessage GetSupport(int projectid) Because it is GET but still got a parameter to pass, ..

5

answers

Customize Bootstrap checkboxes

I'm using Bootstrap in my Angular application and all other styles are working like they should, but checkbox style doesn't. It just look like plain old checkbox. _x000D_ _x000D_ <link rel="styles..

5

answers

How to style a clicked button in CSS

I looked at W3 schools website W3Schools which explained styling buttons with CSS. I need to specify a button style when it is clicked. What is the pseudo-class selector for this? e.g. the hover butto..

29

answers

VS 2017 Metadata file '.dll could not be found

I know there is another question with exact the same problem, but I went trough all those answers, and none helped me. :( (This was the question.) I just created a new ASP.NET MVC project and joined ..

17

answers

How to solve "sign_and_send_pubkey: signing failed: agent refused operation"?

Configuring a new Digital Ocean droplet with SSH keys. When I run ssh-copy-id this is what I get: ssh-copy-id [email protected] /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), ..

5

answers

How do I change the font color in an html table?

How do I change the font color in an html table? <table> <tbody> <tr> <td> <select name="test"> <option value="Basic">Basic : $30.00 USD - yearly</option> &l..

9

answers

How to send authorization header with axios

How can I send an authentication header with a token via axios.js? I have tried a few things without success, for example: const header = `Authorization: Bearer ${token}`; return axios.get(URLConsta..

9

answers

Room persistance library. Delete all

How can I delete all entries on specific table using Room Persistence Library? I need to drop table, but I cannot to find any information how to do this. Only when database is migrating or to load al..

8

answers

What's the Kotlin equivalent of Java's String[]?

I see that Kotlin has ByteArray, ShortArray, IntArray, CharArray, DoubleArray, FloatArray, which are equivalent to byte[], short[], int[],char[], double[], float[] in Java. Now I'm wondering, is ther..

8

answers

How to view kafka message

Is there any way I can view the message content sent to kafka for a given topic? Say some thing like view last 5 messages for this topic, if that it possible...

10

answers

React navigation goBack() and update parent state

I've a page that will render the user's name if s/he is logged in or "Create an account" or "Sign in" option if s/he not. Screen as below They can navigate to "Sign in" or "Create an account" page...

3

answers

Redirecting to a page after submitting form in HTML

I'm fairly new to coding in HTML. After hours of searching the internet for a way to do this, I failed and so I'm here. I was setting up a CSRF Proof of concept page here, I want it to redirect to ano..

12

answers

Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error

I am trying to Build a Solution on Visual Studio Community 2017, but I keep getting the error "Cannot open include file: 'stdio.h' ". I've read through several similar questions, but still can't fix t..

1

answers

How to change a single value in a NumPy array?

I want to change a single element of an array. For example, I have: A = np.array([1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16]) I want to relace A[2][1] = 1..

12

answers

Do I commit the package-lock.json file created by npm 5?

npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json file. Is this file supposed to be kept in source control? I'm assuming it..

37

answers

Val and Var in Kotlin

What is the difference between var and val in Kotlin? I have gone through this link: KotlinLang: Properties and Fields As stated on this link: The full syntax of a read-only property declaration diff..