Posts by find83 • 459 points
27 posts
-
1
votes1
answer101
viewsQ: Print meshing when csv file uploaded is larger or smaller than 9 columns
My application reads a csv file and convert to pdf. For this I have the frontend in html to load the file. I would like to know how to show the user a message stating that the file is invalid. The…
-
0
votes1
answer119
viewsQ: Help with foreach on jsp
I’m trying to make an if in a jsp file, but I can’t print out all the values that are in the products table. For some reason my code only prints the first product and in the table I have 3 products.…
-
-1
votes1
answer99
viewsQ: SQL query inside java
I have the following query inside a file jsp in Java. String sql = "SELECT * FROM products WHERE productName = ? "; I would like my consultation to ignore Camel case and return all the words that…
-
0
votes2
answers476
viewsQ: Read csv file that has header and column with commas
I’m trying to read a document **csv and save to an array**, but the problem is that the fourth column of the file csv that I am reading, has a comma separated text, and this causes when I read the…
-
0
votes1
answer584
viewsQ: Access row and column of an array
I’m a beginner in php. My code reads a csv file and stores it in an array. The problem is that I can’t access the columns. I’m using php 5.3.3. Does anyone know how to pick up the row and column?…
-
0
votes0
answers34
viewsQ: Sort 3 arrays according to the first array
I have 3 separate arrays in $Students, $sites, $considerations. I’m trying to sort my data output by $Students array. When I sort the $Students array, the other two arrays that have line-to-line…
-
0
votes1
answer1211
viewsQ: Page break with fpdf php
I am generating a report with fpdf using php. I read a csv file and print 3 columns. For each column, I created a loop that prints the data. That way I have a loop for each column. When I use…
-
6
votes1
answer219
viewsQ: Error when adding value in array, repeated values
I have two arrays, A and B. I created 3 functions in which I take a value from the beginning of array A and array B, remove the values, compare the values and if the value of A is greater than that…
-
0
votes2
answers300
viewsQ: Multiply value in array
How do I multiply the elements of an array? what am I doing wrong? For example, if I have: int numbers[]={1,2,2,4,5,6}; and my card_block is 2, the restutado would 1x4x5x6=120; int countCards(int []…
-
0
votes0
answers36
viewsQ: Print array on screen as text
How do I print the contents of an array on the screen using text() in the Processing language? I have the array pieces: final int MAX_SIZE=56; char[] pecas= new char[MAX_SIZE]; I added 6 in the…
-
0
votes1
answer24
viewsQ: Function to search character
I’m trying to write a function that returns the index of the character. For example, I want to fetch the index of 'a' the fifth time it appears in the text. This is my code: int buscaChar (String…
-
0
votes0
answers66
viewsQ: Make the mouse act with a joystick
My code should make the mouse act with a joystick to drive a ball on the screen. It should work as follows: if the mouse is in the crosshairs, the ball does not move. If the mouse is to the right or…
-
7
votes1
answer535
viewsQ: How does atan2 function?
I have the following scenario: The angle should be chosen so that it always points directly to the mouse. Find the angle relative to the X axis (then 0 is straight to the right and PI/2 is straight…
-
1
votes2
answers151
viewsQ: Help in code printing of repeated characters
I want to print only the characters that are repeated in string and the amount of repetitions. If it appears only once, I don’t want to print it. I need help with boolena expression. How do I check…
-
0
votes0
answers32
viewsQ: Doubt about Fibonacci series
Why didn’t my code print the first 300 numbers in the Fibonacci series and start finding negative numbers? What’s the problem with this code? Because he only goes up to 92? final int ARRAY_SIZE =…
-
0
votes1
answer34
viewsQ: Arrays not initialized
After the statement int[ ] a; what is stored in the variable a? null or an undefined value, where a cannot be used until something is assigned to it?…
-
2
votes1
answer155
viewsQ: How to check the size of a PFA-type array?
How do I check whether the array PFA (Partially-full array) is full and new elements cannot be added? If it is full, it should return true. boolean estaCheio(int[] data, int size){ ??? } I have 5…
-
7
votes1
answer149
viewsQ: What happens if a binary search does not find the element?
What happens if a binary search does not find the element? It goes into loop? What is the best way to finish the execution?
-
7
votes2
answers70
viewsQ: Why does the return of the linear search for the element not found have to be -1?
Why should I return -1 at the end of a linear search if the element was not found? int linearSearch(int[] list, int size, int key){ for(int index=0; index<size; index++) if(list[index]==key)…
-
0
votes2
answers66
viewsQ: Size of arrays
If the theory says that the size of an array cannot be changed, only the elements. Because when I print the size of a the value is 10 and not 5 or 15? int[] a; a = new int[5]; a = new int[10];…
-
0
votes1
answer41
viewsQ: Sequence of execution of tasks
I have a question about the execution sequence. For example, in the code below, because it prints y=2.0 and not y=4.0 and because it prints w=0.5 and not w=2.2. y=2.0 understands that it looks for…
-
1
votes1
answer60
viewsQ: Parameter name does not match with the variable passed
void countdown(int max, boolean output) { for (int i=max; i>=0; i--) if (output) println(i); } void setup(){ int top = 20; countdown(top, true); } There is something wrong with the syntax/writing…
-
2
votes1
answer1282
viewsQ: Loops based on a flowchart
How do I write the code for a loop based on this flowchart? It has a do...while. Peeciso of a simple and direct response with nested loops.…
-
-2
votes2
answers39
viewsQ: Scalate a value in a given range
My programming teacher asked this question and I couldn’t understand why I have to use one of these formulas to scale the temperature. And I couldn’t identify the right answer either. You have the…
-
2
votes2
answers81
viewsQ: Doubt between block and statement
In that question, what would be the right answer? How Many statements are there in the code Below? Warning: This is a Tricky one. The code is Valid. { println("Step 2"); { println("Step 2a"); {…
-
0
votes1
answer78
viewsQ: Change scenarios with loop
How do I create a loop in Processing that switches between three or more scenarios (summer, winter and autumn) when my object (car) reaches the window edge?
-
0
votes0
answers75
viewsQ: Start reading the beginning of the string list
How do I after adding a string to a list (can be on list A or B), my code goes back and starts reading the beginning of the string list, or the first string? I have a list with 20 strings. But it’s…