Some Of The Best Answers From Latest Asked Questions

49

answers

Unable to load script from assets index.android.bundle on windows

I'm trying to run my first React Native project for first time on my device (Android 4.2.2). And I get: unable to load script from assets index.android.bundle Commands that I used: cd (proje..

10

answers

React JS Error: is not defined react/jsx-no-undef

I'm developing a map functionality using ReactJS, My app.js file is: import React, { Component } from 'react'; import './Map'; class App extends Component { render() { return ( <d..

13

answers

Python: How to pip install opencv2 with specific version 2.4.9?

I know that I could pip install opencv-python which installs opencv3, but is there a separate command or name for opencv specific version such as 2.4.9? If not, how can I specify which version to in..

17

answers

Can't resolve module (not found) in React.js

I can't believe that I'm asking an obvious question, but I still get the error in console log. Console says that it can't find the module in the directory, but I've checked at least 10 times for typo..

4

answers

VSCode Change Default Terminal

I am using Visual Studio Code on my Windows 10 PC. I want to change my default terminal from Windows PowerShell to Bash on Ubuntu (on Windows). How can I do that?..

3

answers

CMD command to check connected USB devices

I would like to obtain by a command prompt a list of all USB devices connected to my computer (O.S. Windows 10). I've googled to find such a command, but all results seems useless to me or worse workl..

6

answers

Cannot find control with name: formControlName in angular reactive form

I found this problem in many questions in stackoverflow but no luck. Please help me for figuring out what I am doing wrong. In component : ngOnInit() { this.companyCreatForm = this._formBuilder..

16

answers

Angular 2 'component' is not a known element

I'm trying to use a component I created inside the AppModule in other modules. I get the following error though: "Uncaught (in promise): Error: Template parse errors: 'contacts-box' is not a ..

29

answers

Context.startForegroundService() did not then call Service.startForeground()

I am using Service Class on the Android O OS. I plan to use the Service in the background. The Android documentation states that If your app targets API level 26 or higher, the system imposes..

4

answers

How to specify legend position in matplotlib in graph coordinates

I am aware of the bbox_to_anchor keyword and this thread, which very helpfully suggests how to manually place the legend: How to put the legend out of the plot However, I'd like to use the coordinat..

15

answers

List all kafka topics

I'm using kafka 0.10 without zookeeper. I want to get kafka topics list. This command is not working since we're not using zookeeper: bin/kafka-topics.sh --list --zookeeper localhost:2181. How can I ..

12

answers

Read file from resources folder in Spring Boot

I'm using Spring Boot and json-schema-validator. I'm trying to read a file called jsonschema.json from the resources folder. I've tried a few different ways but I can't get it to work. This is my code..

18

answers

Is there a way to list all resources in AWS

Is there a way to list all resources in AWS? For all regions, all resources.. Such as list all EC2 instances, all VPCs, all APIs in API Gateway, etc... I would like to list all resources for my accou..

4

answers

Download & Install Xcode version without Premium Developer Account

I do not have Apple Developer Premium Account and I need Xcode Beta (recent major release of Application Development tool by Apple). How can I download Xcode (beta) version without Premium Apple Deve..

3

answers

Align the form to the center in Bootstrap 4

I am trying to align the form to the center and keep it responsive. I have tried several ways but no success. I am trying to center all the text and the form. I am using Bootstrap v4. I am not sure if..

20

answers

How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?

Wireless debugging was recently added as a feature in Xcode 9, iOS 11, and tvOS 11. Apple TV 4K doesn't have a USB port, so it requires wireless debugging. How do you perform this wireless debugging i..

34

answers

How to enable CORS in ASP.net Core WebAPI

What I am trying to do I have a backend ASP.Net Core Web API hosted on an Azure Free Plan (Source Code: https://github.com/killerrin/Portfolio-Backend). I also have a Client Website which I want to..

12

answers

The use of Swift 3 @objc inference in Swift 4 mode is deprecated?

Briefly, while using Xcode 9 Beta, I have run into the following warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test..

6

answers

What are my options for storing data when using React Native? (iOS and Android)

I am still new in the React Native world, and generally in the mobile/native world as well, and I am finding the documentation a bit lacking when it comes to data persistence. What are my options for..

16

answers

Flutter - Wrap text on overflow, like insert ellipsis or fade

I'm trying to create a line in which center text has a maximum size, and if the text content is too large, it fits in size. I insert the TextOverflow.ellipsis property to shorten the text and inserti..

5

answers

Angular 2 http post params and body

I'm trying to do an api call from my angular app. What I want to do is send a post request to the api with a command param. I have done a lot of server side testing as well as going through the outgoi..

9

answers

Unsupported method: BaseConfig.getApplicationIdSuffix()

So I'm reading Android 6 for Programmers: An App-Driven Approach and the first two app examples I had no issues with the examples, this time the FlagQuiz example when loaded in Android Studio 3.0 Cana..

15

answers

How to hide the Google Invisible reCAPTCHA badge

When implementing the new Google Invisible reCATPTCHA, by default you get a little "protected by reCAPTCHA" badge in the bottom right of the screen that pops out when you roll over it. I'd like to ..

11

answers

ASP.NET Core form POST results in a HTTP 415 Unsupported Media Type response

Sending a form POST HTTP request (Content-Type: application/x-www-form-urlencoded) to the below controller results into a HTTP 415 Unsupported Media Type response. public class MyController : Control..

8

answers

Angular ngClass and click event for toggling class

In Angular, I would like to use ngClass and click event to toggle class. I looked through online but some are angular1 and there isn't any clear instruction or example. Any help will be much appreciat..

3

answers

How to assign more memory to docker container

As the title reads, I'm trying to assign more memory to my container. I'm using an image from docker hub called "aallam/tomcat-mysql" in case that's relevant. When I start it normally without any spe..

19

answers

Global Angular CLI version greater than local version

When running ng serve I get this warning about my global CLI version being greater than my local version. I don't notice any issues from this warning, but I was wondering if the two versions should be..

12

answers

'router-outlet' is not a known element

I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial https://angular.io/guide/router. So in my _Layout.cshtml I added a <base href="/"> and ..

13

answers

'Conda' is not recognized as internal or external command

I installed Anaconda3 4.4.0 (32 bit) on my Windows 7 Professional machine and imported NumPy and Pandas on Jupyter notebook so I assume Python was installed correctly. But when I type conda list and c..

14

answers

HTTP Basic: Access denied fatal: Authentication failed

I use GitLab Community Edition 9.1.3 2e4e522 on Windows 10 Pro x64. With Git client. Error Cloning into 'project_name'... remote: HTTP Basic: Access denied fatal: Authentication failed for 'http://m..

4

answers

Pandas create empty DataFrame with only column names

I have a dynamic DataFrame which works fine, but when there are no data to be added into the DataFrame I get an error. And therefore I need a solution to create an empty DataFrame with only the column..

1

answers

Getter and Setter of Model object in Angular 4

How can I make getter and setter work in my model class? My goal is to calculate integer value of the selected day when input, containing the date, updated. I was going to do it in setter, but Angula..

8

answers

ReactJS lifecycle method inside a function Component

Instead of writing my components inside a class, I'd like to use the function syntax. How do I override componentDidMount, componentWillMount inside function components? Is it even possible? const gri..

10

answers

how to find my angular version in my project?

I have setup the angular code on my local machine. I need to know the version of the angular that I am using in the project. how can I easily find it in cmd prompt?..

4

answers

Angular ForEach in Angular4/Typescript?

I see many answers about using ngFor when I search for this, but I understand ngFor. I'm asking about the angular.forEach() constructor used in my Angular 1 controllers. These are flagged as errors ..

6

answers

Setting up Gradle for api 26 (Android)

Since I have upgraded my Nexus 5x to Android O DP3 I am not able to test my applications. I get the error for not having configured my Gradle-file to work with the new API-level (26). So I changed thi..

10

answers

What's the difference between implementation and compile in Gradle?

After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of tes..

5

answers

Safe Area of Xcode 9

While exploring Xcode9 Beta Found Safe Area on Interface builders View hierarchy viewer. Got curious and tried to know about Safe Area on Apples documentation, in gist the doc says "The the view area ..

13

answers

Show/hide widgets in Flutter programmatically

In Android, every single View subclass has a setVisibility() method that allows you modify the visibility of a View object There are 3 options of setting the visibility: Visible: Renders the View v..

2

answers

Equal height rows in CSS Grid Layout

I gather that this is impossible to achieve using Flexbox, as each row can only be the minimal height required to fit its elements, but can this be achieved using the newer CSS Grid? To be clear, I w..

6

answers

Bootstrap 4: Multilevel Dropdown Inside Navigation

What's the easiest way to make a multilevel dropdown in Bootstrap 4? All the examples I managed to find on SO were either too messy or not included in nav. I've tried just placing a dropdown inside a..

7

answers

Get Path from another app (WhatsApp)

I'm not getting Path from image or video from uri that I receive from whatsApp. Uri comes like this: content://com.whatsapp.provider.media/item/16695 Media coming from Gallery, Downloads ands others..

15

answers

Failed to load AppCompat ActionBar with unknown error in android studio

Below is my xml file. In preview there is two error'Failed to load AppCompat ActionBar with unknown error' & 'Failed to instaniate more than one class'. How ever am able to run the app.But the app..

15

answers

Enums in Javascript with ES6

I'm rebuilding an old Java project in Javascript, and realized that there's no good way to do enums in JS. The best I can come up with is: const Colors = { RED: Symbol("red"), BLUE: Symbol(..

12

answers

AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

I am facing some attribute error while running face recognizing the code. My face detects code run perfectly.But while I try to run the face recognizing code it shows some attribute error. I googled a..

16

answers

What is a 'workspace' in Visual Studio Code?

I can't quite believe I am asking this question, but I have not been able to find a definition in the documentation. In case it isn't painfully obvious, I am (very) new to Visual Studio Code. For exa..

6

answers

How to find count of Null and Nan values for each column in a PySpark dataframe efficiently?

import numpy as np df = spark.createDataFrame( [(1, 1, None), (1, 2, float(5)), (1, 3, np.nan), (1, 4, None), (1, 5, float(10)), (1, 6, float('nan')), (1, 6, float('nan'))], ('session', "time..

10

answers

Passing headers with axios POST request

I have written an axios POST request as recommended from the npm package documentation like: var data = { 'key1': 'val1', 'key2': 'val2' } axios.post(Helper.getUserAPI(), data) .then((..

6

answers

Vue Js - Loop via v-for X times (in a range)

How can I repeat a loop via v-for X (e.g. 10) times? // want to repeat this (e.g.) 10 times <ul> <li v-for="item in shoppingItems"> {{ item.name }} - {{ item.price }} </li>..

11

answers

How to fix Cannot find module 'typescript' in Angular 4?

I generated Angular 4 app 3 weeks ago using the @angular/cli. After 2 weeks, I tried to run it with the command line ng serve but I am prompted an error below: Cannot find module 'typescript' Error: C..

7

answers

How to completely uninstall python 2.7.13 on Ubuntu 16.04

I installed Python 2.7.13 on Ubuntu 16.04 according to this guide, and it became the default version as an alternative to the version 2.7.12. But, I wanted to completely remove Python 2.7.13 and retur..

11

answers

Conda command is not recognized on Windows 10

I installed Anaconda 4.4.0 (Python 3.6 version) on Windows 10 by following the instructions here: https://www.continuum.io/downloads. However, when I open the Command prompt window and try to write ..

10

answers

Smart cast to 'Type' is impossible, because 'variable' is a mutable property that could have been changed by this time

And the Kotlin newbie asks, "why won't the following code compile?": var left: Node? = null fun show() { if (left != null) { queue.add(left) // ERROR HERE } } Smart ca..

9

answers

How to convert JSON string into List of Java object?

This is my JSON Array :- [ { "firstName" : "abc", "lastName" : "xyz" }, { "firstName" : "pqr", "lastName" : "str" } ] I have this in my String o..

12

answers

com.apple.WebKit.WebContent drops 113 error: Could not find specified service

I am using WKWebView for viewing custom HTML. Regardless of HTML content, when testing on real device, I receive the following error Could not signal service com.apple.WebKit.WebContent: 113: Could..

13

answers

How to listen for 'props' changes

In the VueJs 2.0 docs I can't find any hooks that would listen on props changes. Does VueJs have such hooks like onPropsUpdated() or similar? Update As @wostex suggested, I tried to watch my prope..

5

answers

How to remove docker completely from ubuntu 14.04

I installed Docker on Ubuntu a while back but when I tried to remove, the Docker still exists in the system. I followed this https://stackoverflow.com/a/31313851/2340159 but didn't work...

2

answers

Keras input explanation: input_shape, units, batch_size, dim, etc

For any Keras layer (Layer class), can someone explain how to understand the difference between input_shape, units, dim, etc.? For example the doc says units specify the output shape of a layer. ..

3

answers

Specifying ssh key in ansible playbook file

Ansible playbook can specify the key used for ssh connection using --key-file on the command line. ansible-playbook -i hosts playbook.yml --key-file "~/.ssh/mykey.pem" Is it possible to specify the..

8

answers

Set value to an entire column of a pandas dataframe

I'm trying to set the entire column of a dataframe to a specific value. In [1]: df Out [1]: issueid industry 0 001 xxx 1 002 xxx 2 003 xxx 3 ..

6

answers

Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

I have updated my dependecies like you said in your comment and i have this now : org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org...

5

answers

Kubernetes Pod fails with CrashLoopBackOff

I 'm Following this guide in order to set up a pod using minikube and pull an image from a private repository hosted at: hub.docker.com When trying to set up a pod to pull the image i see CrashLoopBa..

28

answers

Hide header in stack navigator React navigation

I'm trying to switch screen using both stack and tab navigator. const MainNavigation = StackNavigator({ otp: { screen: OTPlogin }, otpverify: { screen: OTPverification}, userVerifie..

5

answers

How to completely uninstall kubernetes

I installed kubernetes cluster using kubeadm following this guide. After some period of time, I decided to reinstall K8s but run into troubles with removing all related files and not finding any docs ..

3

answers

TypeError: Object of type 'bytes' is not JSON serializable

I just started programming Python. I want to use scrapy to create a bot,and it showed TypeError: Object of type 'bytes' is not JSON serializable when I run the project. import json import codecs c..

19

answers

How do I fix maven error The JAVA_HOME environment variable is not defined correctly?

Issue: I am getting the Maven error "The JAVA_HOME environment variable is not defined correctly" when I run through Inno setup batch execution. However, I am able to run successfully outside Inno S..

32

answers

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is history of commands I ran. docker run -p 8050:8050 scrapinghub/s..

3

answers

How to send json data in POST request using C#

I want to send json data in POST request using C#. I have tried few ways but facing lot of issues . I need to request using request body as raw json from string and json data from json file. How can..

19

answers

'ng' is not recognized as an internal or external command, operable program or batch file

I tried running npm install -g angular-cli I also tried adding it to the Enviorment Variables under PATH: (C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng) , with no succ..

10

answers

How to truncate text in Angular2?

Is there a way that I could limit the length of the string to a number characters? for e.g: I have to limit a title length to 20 {{ data.title }}. Is there any pipe or filter to limit the length?..

2

answers

Vue component event after render

Is there an event in Vue that gets fired after an element re-renders? I have an object that updates, which causes my template to update. After it updates I want to trigger an event which runs a jQuery..

17

answers

Android dependency has different version for the compile and runtime

After updating Android Studio from Canary 3 to Canary 4, the following error is thrown at the build time. Android dependency 'com.android.support:support-support-v4' has different version for the ..

4

answers

How to run shell script file using nodejs?

I need to run a shell script file using nodeJS that executes a set of Cassandra DB commands. Can anybody please help me on this. inside db.sh file: create keyspace dummy with replication = {'clas..

10

answers

How to know Laravel version and where is it defined?

How to know Laravel version and where is it defined? Is Laravel version is defined inside my application directory or somewhere in global server side directory? UPDATE Sorry, the main question is w..

4

answers

Python error message io.UnsupportedOperation: not readable

I made a simple program but It shows the following error when I run it: line1 = [] line1.append("xyz ") line1.append("abc") line1.append("mno") file = open("File.txt","w") for i in range(3): fil..

5

answers

Selection with .loc in python

I saw this code in someone's iPython notebook, and I'm very confused as to how this code works. As far as I understood, pd.loc[] is used as a location based indexer where the format is: df.loc[index,..

5

answers

Angular 4: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

i need your help, i'm trying to display some datas from my firebase but it trhows me an error like InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'. There is my service: import { Injec..

6

answers

Send data through routing paths in Angular

Is there anyway to send data as parameter with router.navigate? I mean, something like this example, as you can see the route has a data parameter, but doing this it's not working: this.router.navig..

7

answers

Select row on click react-table

I am trying to find the best table to use with my react apps, and for now, the react-table offers everything I need (pagination, server-side control, filtering, sorting, footer row). This being said,..

24

answers

Anaconda Installed but Cannot Launch Navigator

Anaconda (listed as "Python 3.6.0 (Anaconda 4.3.1 64 bit)" ) is in my programs and features list, but there is seeming no Anaconda Navigator desktop app, as their seems to be no icon on my desktop and..

4

answers

(change) vs (ngModelChange) in angular

Angular 1 does not accept onchange() event, it's only accepts ng-change() event. Angular 2, on the other hand, accepts both (change) and (ngModelChange) events, which both seems to be doing the same..

8

answers

Returning JSON object as response in Spring Boot

I have a sample RestController in Spring Boot: @RestController @RequestMapping("/api") class MyRestController { @GetMapping(path = "/hello") public JSONObject sayHello() { return ..

21

answers

No Application Encryption Key Has Been Specified

I'm new to Laravel and I'm trying to use the Artisan command... php artisan serve It displays... Laravel development server started: http://127.0.0.1:8000 However, it won't automatically laun..

22

answers

Component is not part of any NgModule or the module has not been imported into your module

I am building an angular 4 application. I am getting error Error:Component HomeComponent is not part of any NgModule or the module has not been imported into your module. I have created HomeModule ..

7

answers

Multiple conditions in ngClass - Angular 4

How to use multiple conditions for ngClass? Example: <section [ngClass]="[menu1 ? 'class1' : '' || menu2 ? 'class1' : '' || (something && (menu1 || menu2)) ? 'class2' : '']"> somethi..

4

answers

How do I include a JavaScript script file in Angular and call a function from that script?

I have a JavaScript file called abc.js that has a 'public' function called xyz(). I want to call that function in my Angular project. How do I do that?..

1

answers

How to set x axis values in matplotlib python?

I want to draw this graph using matplotlib. I wrote the code but it's not changing the x axis values. import matplotlib.pyplot as plt x = [0.00001,0.001,0.01,0.1,0.5,1,5] y = [0.945,0.885,0.893,0..

7

answers

How to add empty spaces into MD markdown readme on GitHub?

I'm struggling to add empty spaces before the string starts to make my GitHub README.md looks something like this: Right now it looks like this: I tried adding <br /> tag to fix the new st..

14

answers

Cloning an array in Javascript/Typescript

I have array of two objects: genericItems: Item[] = []; backupData: Item[] = []; I am populating my HTML table with genericItemsdata. The table is modifiable. There is a reset button to undo all ch..

6

answers

Warning: Use the 'defaultValue' or 'value' props on <select> instead of setting 'selected' on <option>

SCENARIO A user has a dropdown and he selects an option. I want to display that dropdown and make that option a default value which was selected by that user last time. I am using selected attribute ..

16

answers

Docker: How to delete all local Docker images

I recently started using Docker and never realized that I should use docker-compose down instead of ctrl-c or docker-compose stop to get rid of my experiments. I now have a large number of unneeded do..

34

answers

EF Core add-migration Build Failed

I have a developer that is getting "Build failed." when running add-migration in a .NET Core EF project, with no explanation of why the build failed. How do you troubleshoot this error? This is what ..

2

answers

Angular CLI - Please add a @NgModule annotation when using latest

note: I'm new to Angular, so please excuse any new comer stupidity here. Details I've installed the latest version of Angular CLI The default app loads and runs perfectly fine after 'ng serve' Is..

4

answers

Angular 4 Pipe Filter

I am trying to use a custom pipe to filter my *ngFor loop using an input field with ngModel. With my other custom pipe (sortBy), it works perfectly fine. However, the filter pipe seems to make it that..

3

answers

Jest spyOn function called

I'm trying to write a simple test for a simple React component, and I want to use Jest to confirm that a function has been called when I simulate a click with enzyme. According to the Jest docs, I sho..

9

answers

How to see docker image contents

I did a docker pull and can list the image that's downloaded. I want to see the contents of this image. Did a search on the net but no straight answer...

8

answers

No signing certificate "iOS Distribution" found

I am trying to sign an app with my client's certificates. I have received the following file from the client I tried installing the ios_distribution certificate and the key (.p12). Also I have inst..

14

answers

How to add external JS scripts to VueJS Components

I've to use two external scripts for the payment gateways. Right now both are put in the index.html file. However, I don't want to load these files at the beginning itself. The payment gateway is need..

5

answers

Maintaining href "open in new tab" with an onClick handler in React

I have an onClick (React) handler on a table cell that fires properly, however I want to maintain the "Open in a new Tab" feature that having an href on a tag gives you. Trying to combine both on a s..

16

answers

Angular 4 img src is not found

I'm having a problem with sourcing an image with angular 4. It keeps telling me that the image is not found. Folder structure: app_folder/ app_component/ - my_componenet - image_folder/ - ..