Posts by GGirotto • 1,144 points
51 posts
-
2
votes1
answer55
viewsQ: Concatenate values in the Jfreechart chart
How to concatenate values in jfreechart? I’m trying this way: public static DefaultCategoryDataset dataset = new DefaultCategoryDataset();; public void atualizaDataset(int humano, int zumbi, int…
-
4
votes1
answer149
viewsQ: Write list in binary file
The idea of this method is to write all the words of a list of nodes in a binary file. I have a linked list of nodes, where each node has two information, its information, and a reference to the…
-
3
votes1
answer83
viewsQ: Java input problem
The inputs of my program are overwriting itself. It ignores the first and already Lanca the second straight. System.out.println("Digite o nome do passageiro"); String nome = in.nextLine();…
-
4
votes2
answers102
viewsQ: Doubts related to recursion
Good afternoon. I am developing recursion methods that work on a binary tree of research, but I am having great difficulties in recursion. For example, the method below should return the tree…
-
2
votes1
answer184
viewsQ: Clone an object (deep copy)
Good evening. I’m working on a program that writes a text. Basically it consists of a Text object which is a list of Paragrafo objects, which is a list of Sentences objects which is a list of Words…
-
2
votes1
answer117
viewsQ: Couldn’t match expected type `Double' with actual type `Integer'
Code Haskell: bin2dec::[Integer]->Integer bin2dec (h:[]) = h bin2dec (h:t) = h*(2^length(t))+bin2dec(t) bin2frac :: ([Integer], [Integer]) -> Double bin2frac(x,y) = fromDouble(bin2dec(x)) * 10…
-
5
votes1
answer152
viewsQ: Check whether it is palindrome (No instance for (Eq a) arising from a use of `==')
I got the second error in the code: No instance for (Eq a) arising from a use of `==' Code: --Verifica se a lista é um palíndromo palin :: MList a -> Bool palin(x) |x==reverter(x) = True…
-
2
votes2
answers2119
viewsQ: Resume a list without repeats
Define a primitive recursive function capable of compressing the list by removing all elements repeated in sequence. Ex : aaabbbcddd abcd Any idea how to do that? I honestly don’t know where to…
-
1
votes1
answer90
viewsQ: Create new matrix with content from another matrix
Main matrix: public static String [][] matrizPrincipal(){ String [] [] matriz = new String [2] [6]; matriz[0][0] = "Robin Arryn"; matriz[0][1] = "Lino Facioli"; matriz[0][2] = "145"; matriz[0][3] =…
-
0
votes1
answer80
viewsQ: Filter content below the main diagonal of a matrix
To take the content that is below the main diagonal of a matrix would be the elements at positions where the line is larger than the column?
-
2
votes3
answers1805
viewsQ: Return the inverse of a vector
How do I reverse the values of a vector? Example: 1 2 3 turn 3 2 1 I am currently trying to make a method of the type.. public static int [] vetorInvertido(int [] vet){ int [] vetInvert = new…
-
1
votes1
answer80
viewsQ: Doubt regarding the function is
for(int i=0; i<mat.length; i++){ for(int j=0; j<matrizFemininaArryn.length; j++){ if(mat[i][5].equals("Feminino") && mat[i][4].equals("Arryn")) matrizFemininaArryn[j] = mat[i][0]; } }…
-
1
votes1
answer39
viewsA: Problems with array printing
Solved. Just move the println out of the for
-
0
votes1
answer39
viewsQ: Problems with array printing
Matriz Principal: public static String [][] matrizPrincipal(){ String [] [] matriz = new String [2] [6]; matriz[0][0] = "Robin Arryn"; matriz[0][1] = "Lino Facioli"; matriz[0][2] = "145";…
-
1
votes1
answer270
viewsQ: Content of one matrix receiving from another
Main matrix: public static String [][] matrizPrincipal(){ String [] [] matriz = new String [2] [6]; matriz[0][0] = "Robin Arryn"; matriz[0][1] = "Lino Facioli"; matriz[0][2] = "145"; matriz[0][3] =…
-
3
votes1
answer184
viewsQ: Print more than 1 java value
I’m studying matrices. The matrix is in characters information of the game of Thrones. My matrix: public static String [][] matrizPrincipal() { String [] [] matriz = new String [6] [114];…
-
4
votes2
answers10851
viewsQ: How to return the difference in hours between two dates?
I have two dates stored in the variables $date1 and $date2 respectively. They are in format: YYYY/MM/DD HH:MM I wonder how I get the difference in hours between these two dates?…
-
0
votes1
answer234
viewsQ: Create SQL timer column
Is it possible to do a timer column, which calculates 24 hours? For example, PHP starts this timer in this column, and until it resets the user is prevented from performing such an action. However,…
-
3
votes1
answer1085
viewsQ: Calling PHP method with ajax
I have a code that does a validation in javascript, and I would like it to be validated as true, change a table of the database. I thought to use ajax, so as soon as validate as true, call a method…
-
4
votes2
answers837
viewsQ: Check closed tab
I found on the Internet the following code: <script type="text/javascript"> var popup = null; function Abrir() { if (popup!=null && popup.closed) alert("A Janela foi fechada.n Abrindo…
javascriptasked GGirotto 1,144 -
4
votes2
answers1347
viewsQ: Find out how many days passed from one date to another
In a java program, where the person first inserts the day, then the month, then the year, how do I know how many days passed from that date inserted until another later date that will also be…
-
1
votes1
answer7212
viewsQ: Return two values using Return
About splitting a program into methods, in a case of a method that runs two functions at the same time (value and total size) how do I use Return at both values? Both must be executed together, I…
-
0
votes1
answer163
viewsQ: Division into different methods
I’m learning in college to divide the system into different methods, each performing a function. However I had a problem with the following code: import java.util.Scanner; public class…
-
9
votes3
answers14735
viewsQ: How to break a line of a Mysql field into an HTML page
I need to save a value with a line break in the table For example, instead of keeping: 0 anos, 3 dias Keep: 0 Anos 3 Dias I tried the following process: INSERT INTO tabela (tempo) VALUES ('0 Anos\n3…
-
0
votes3
answers864
viewsQ: Make primary key uplinkable
When entering the data in my SQL table everything happens normal. However, when trying to insert for the second time, with the same value in id which is the main field of the table, it returns the…
-
3
votes1
answer1575
viewsQ: Recursive algorithm
I have a job at college that I just have no idea where to start. Display the recursive mathematical function that defines mdc (maximum common divisor) between two natural. Based on it, do: 1. Define…
-
1
votes1
answer275
viewsQ: Function for Java
I have the following code: public class Programa{ public static void main(String args[]){ int a = 10; for (int i = 1; i<=2; i++){ for(int j=0; j<=2; j++){ if((i%2 == 0) && (j % 2 ==…
-
0
votes1
answer850
views -
2
votes2
answers123
viewsQ: Have a loop run again
Code: while (digita != 4){ System.out.println("Digite o o número referente ao tamanho da(s) pulseira(s)\n1.Pequena (17cm) - R$180,00\n2.Média (18cm) - R$200,00\n3.Grande (20cm) -…
-
0
votes1
answer75
viewsQ: Why is this code on an infinite loop?
When I run it starts to calculate infinitely the value of the bracelet.. import java.util.Scanner; public class Sistema_Bichara{ public static void main(String args[]){ Scanner in = new…
-
0
votes2
answers171
viewsQ: Change menu class
Good morning. I have the following menu: <ul> <li class="active"><a href="?type=0">Ranking PvP</a></li> <li><a href="?type=2">Ranking…
-
2
votes2
answers281
viewsA: Return to start if size is not reached
Final code with while: import java.util.Scanner; public class Sistema_Bichara{ public static void main(String args[]){ Scanner in = new Scanner(System.in); //Primeiro Menu System.out.println("Digite…
-
1
votes2
answers281
viewsQ: Return to start if size is not reached
Guys, I got this week a really fucked-up college job and I’m having a problem with a part of it... The thing is, I have to set up a system for a bracelet store, which gives the choice of size and…
-
0
votes1
answer109
viewsQ: Add MYSQL constraint
I am using the following query: $sql = "SELECT * FROM `login` order by `account_id` ASC"; How do I add a constraint when account_id is 1 he "skip" and do not take the values of the line with…
-
1
votes3
answers403
viewsQ: Only first row of table being displayed!
I’m requesting the table data this way: $sql = "SELECT * FROM `login` order by `userid` DESC"; $limite = mysqli_query($db, $sql); while ($sql = mysqli_fetch_array($limite)) { $account_id =…
-
1
votes1
answer214
viewsQ: Cannot find Symbol - variable calories
Why this mistake if I’m setting the calories on ifs? import java.util.Scanner; public class Alimentos { public static void main(String args[]){ Scanner in = new Scanner(System.in);…
-
3
votes2
answers331
viewsQ: Check string value
I wanted you to check if the entered value is vegetarian, and if it is, print on the user’s screen is vegetarian as follows the code, but when I type vegetarians or anything else it warns that it is…
-
2
votes2
answers91
views -
0
votes2
answers47
viewsQ: Always equal table check
I have the following code: <?PHP $status = mysqli_query($connecta, "SELECT `online` FROM `char` WHERE `name`='[ADM] koda'"); $resultado = mysqli_num_rows($status); echo ' <tr align="center"…
-
1
votes0
answers55
viewsQ: Retrieve all values from an SQL table and add to a session
I am using the following code to get all data from my table: $sql4 = mysqli_query($db, "SELECT * FROM login"); $exibe4 = mysqli_fetch_assoc($sql4); It’s working perfectly and it’s picking up all the…
-
-1
votes1
answer554
viewsQ: Accent and port problem on localhost
Does anyone know how to set up the charset? The problem is that it’s appearing like this: Informa es Imagery: And another, my localhost is on: http://localhost:8888, where I set to leave only…
-
1
votes2
answers122
views -
0
votes1
answer50
viewsA: Problem when checking data in SQL table
I used the code of the comment of @Rafaelwithoeft. It was going wrong because I used the query SELECT 'user_pass' instead of SELECT user_pass. Thank you very much to everyone who helped!…
-
0
votes1
answer98
viewsQ: List table data and assign value to each of them (SQL)
Good morning! I would like to know how I do to list the data of a table and assign value to each of them! Example: Table: character Columns: ID and name I would like to take all the names that have…
-
3
votes1
answer169
viewsQ: Add value to SQL table instead of replacing
Using the following code: UPDATE `login` SET diasvip = '".+$_POST["qntvip"]."' WHERE userid = '".$_POST["userid"]."' When I execute, it replaces the diasvip by the value posted instead of adding the…
-
6
votes2
answers19743
viewsQ: Warning: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result, Boolean Given in
I’m having a simple problem when it comes time to take a dice from a table.. The mistake is Warning: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result, Boolean Given in Code: $sql =…
-
4
votes3
answers425
viewsQ: Javascript : Give . Hide on everything that is open
Good afternoon. I would like to know how to do instead of writing: $("#removemirror3").click(function(){ $("#mirror31").hide("slow"); $("#mirror32").hide("slow"); $("#mirror33").hide("slow");…
-
1
votes1
answer50
viewsQ: Problem when checking data in SQL table
I have the Ragnarok database with the login table that has the userid (user) and user_pass (password) of the person. I am trying to get the system to enter this table and check if the field entered…
-
1
votes1
answer173
viewsQ: Switching from mysql to mysqli
Speaks beauty person? So I’m about three days into this code. All mysql obsolence errors disappear, and I can navigate normally through the administrator area. However, when leaving the area and…
-
1
votes3
answers11171
viewsQ: Add jquery "loading" effect
I would like to add a loading effect when the person submits the form, and after about 2 seconds, the upload ends and the form displays the result (error or not) I would like to know how to deploy…