Posts by João Victor Sierra • 486 points
24 posts
-
0
votes1
answer120
viewsA: Divisors of a number which variable to print
From what you can understand, you want to print the divisors of a number x between x and another number y. The error happens because of the line: if (i %y == 0) Under this condition, the y only,…
javaanswered João Victor Sierra 486 -
0
votes2
answers46
viewsA: Unrecognised error
Taking into account that to calculate the standard deviation it is necessary to make a sum, you must, in the loop for scrolling through the list, add to the variable t the value that should be added…
-
0
votes1
answer23
viewsA: If it’s not working properly
To compare Strings in Java, it is necessary to use the function equals, and not the operator ==. To work, do: import java.util.Scanner; public class Main { public static void main(String[] args) {…
-
0
votes1
answer47
viewsA: PHP, Relationship Too Much for Many
If you’re using a relational database, you can’t use multivariate attributes, and the solution you thought really isn’t the most practical one. In relational databases, to deal with situations like…
-
3
votes1
answer85
viewsA: What code do I put with the while?
Taking into account that the reading will be done at least once, you can place the code snippet that you want to repeat within a repeat structure while, with the condition while(cont == 1). The…
-
2
votes1
answer184
viewsA: Error computing mean with vector C
The first error happens because you set the "media" function as receiving two parameters, an integer and a pointer to integer. However, the function call is made by passing only one parameter, which…
-
0
votes1
answer33
viewsA: How do I click a button if a specific target is there?
What you can do to solve this is: Get all links from page: links = driver.find_elements_by_xpath("//a[@href]") (Assuming the variable used to handle the page is called driver) Scroll through the…
-
4
votes1
answer48
viewsA: Function returning None, when if or Else runs
The way the function was written, it returns no value, so the None. For her to return to string that you want to show, do: def dif(x, z): if x != z: return '\nNúmeros diferentes'; else: return…
pythonanswered João Victor Sierra 486 -
1
votes1
answer586
viewsA: How to press the Instagram follow button? with python
Instead of using Xpath or any other selection method, use the following: seguir = driver.find_element_by_css_selector('button') seguir.click() I used this code and managed to click the button. And…
-
1
votes1
answer113
viewsA: Set a select html default field
To force the user to select at least one value in inputs HTML, you need to use the attribute required, as follows: <select name="endereco_estado" required="required"> <option…
htmlanswered João Victor Sierra 486 -
1
votes2
answers174
viewsA: How to create class correctly with pandas by applying methods?
The error happens because the class Dataframe is named after df, and in function pupil you defined one of the parameters with the same name. So, if the operator self is not used, a confusion will be…
-
1
votes1
answer136
viewsA: Go inside another For
I do not know if it was a mistake in the formulation of the question, but the code is undefined. In the Python language, what defines what is inside a code structure, such as for, is its internal…
-
0
votes1
answer22
viewsA: Inclusion of data/ object
The error of null Exception occurs when the instance of a null referenced object, i.e., does not reference any object position in memory. You got this because in the class builder Service, just…
-
1
votes2
answers67
viewsA: Sum of 3 matrices in a new matrix
The Java language allows you to declare multidimensional variables whose dimensions are variable. However, you are defining the dimensions of the matrices before reading them; The way you are…
-
2
votes2
answers95
viewsA: String inside Python list
The error happens for two reasons: As the variable 'quantity' was declared, it forms a tuple. Thus, the operator in will only return true if a tuple with elements equal to those of the variable…
pythonanswered João Victor Sierra 486 -
0
votes1
answer27
viewsA: Changing the value of an arraylist
Your error is because, when it comes to changing the price, you are using the 'filmeC' object, while the object that references the film class object whose ID is equal to that given by the user is…
-
1
votes1
answer86
viewsA: Error when calling a function, Cannot set Property 'src' of null
In function imgSlider, you used the class Pepsi to select the images that must be exchanged. However, there is no item in HTML that has this class, and this makes it impossible to find the elements,…
-
0
votes1
answer44
viewsA: How can I improve?
Some tips for better your code: 1 - the function main, responsible for executing a code, returns an integer and receives no parameter. If the function does not receive any parameter, the most…
canswered João Victor Sierra 486 -
0
votes1
answer81
viewsQ: How to use a collection as an element of a Python array?
I am developing a project using scikit-Learn (and pandas to handle the data) to predict the results of football matches based on previous results. As a project methodology, for each row of the…
-
0
votes2
answers332
viewsQ: Calculation of the smallest divisible number giving infinite loop in C
I did a C program to solve the following exercise: Code: #include "stdio.h" #include "stdlib.h" int main(int argc, char const *argv[]) { int num = 0; int count = 20; int contaDivisores = 0; for(int…
-
1
votes1
answer105
viewsQ: Character array does not save correctly
I’m making a program to encrypt according to Caesar’s Cipher in Java. I came across the following problem in code: package projects; import java.util.Scanner; public class Projects { public static…
-
4
votes1
answer395
viewsQ: How to avoid collision of upload file names
I’m making a website for upload of images, only, when I do the upload of two files with equal names, what there was before some of the file directory. This is the code I use for upload:…
-
0
votes1
answer61
viewsQ: Problem with Chronometer
In the code, there is a variable running, indicating whether the timer is running or not: boolean running = false; And there’s a method StartStopTimer, that stops or starts the timer according to…
androidasked João Victor Sierra 486 -
6
votes1
answer110
viewsQ: Toggle javascript functions
In my code there is a button, which, when clicked, plays a song <div class="botao" id="btn1"><audio id="audio1" controls loop="true" style=" visibility: hidden;"> <source…