Posts by Avelino • 4,474 points
55 posts
-
5
votes1
answer850
viewsQ: How to encode and decode Base64 strings in C?
I need to encode (and decode) a JSON to be transmitted from the Web to a microcontroller. The JSON that I am sending is encrypted with the AES 128, but the cyphertext It contains non-printable…
-
1
votes1
answer66
viewsA: Information Duplicating in SDCARD
The function loop() is performed infinitely and in function gravar() you create a variable i and assigns a value 0 every time the function gravar() is called (infinitely). Try doing so: #include…
-
1
votes1
answer124
viewsA: Doubt in working with multiple
If I understand your question correctly, you need to show messages in a set of blocks of bytes. Therefore, as follows, 71 exact messages will be printed: for (int i = 1; i < 72; i++) { if (i % 21…
-
5
votes2
answers5730
viewsA: Problem with Latex Figures Skipping Paragraphs
Try using the option [H] After the \begin{figure}. Still try the code below: \begin{figure}[H] \IBGEtab{ \caption{Exemplo de Histograma de uma imagem em escala de cinza.} \label{GrayScale} }…
-
0
votes1
answer309
viewsQ: How to save Cookies permanently and retrieve them later? [Android]
I have an app Android that makes a request to a Web server and later saves three Cookies in one CookieStore. In the meantime, I’d like to store these Cookies so that when the application is…
-
2
votes2
answers2499
views -
6
votes3
answers3711
viewsQ: How to shuffle characters from a Java string randomly?
I’m developing a password generator program. In it the user can set the percentage of numbers, letters and special characters that he wants to have in his password, as well as the size of his…
-
3
votes1
answer493
viewsQ: How to convert HTML code to a PDF file in java?
I am developing an application where I need to convert an HTML code, which is saved in the database, into a .PDF. file.No need to save this file to the server. I’ve never done anything like this.…
-
10
votes2
answers16161
viewsQ: What types of data exist in Mysql for text?
What kind of data exists in Mysql? What’s best for storing long texts? (HTML-shaped document for example) Why?
-
14
votes3
answers51454
viewsA: How does the AES encryption algorithm work?
First of all, my reply merely seeks to add content to the reply from mgibsonbr, which is already quite complete. I had to make a theoretical foundation for my Course Completion Work. I think it…
-
1
votes1
answer1133
viewsA: Error in connection with the database. Java + Workbench
Try it like this: package conexaoprojeto; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class Conecta { private String…
-
12
votes1
answer5423
viewsA: How do I program for Avrs in C/C++? And using Arduino?
1. How to start programming of AVR ATMEL microcontrollers in C/C++? You will need to: A microcontroller (intended to be engraved); A recording circuit; A set of software to compile and upload code;…
-
4
votes4
answers1394
viewsA: How to concatenate two byte arrays in Java?
This worked for me: byte msg[]; byte nonce[]; byte[] mensagem = new byte[msg.length + nonce.length]; System.arraycopy(msg, 0, mensagem, 0, msg.length); System.arraycopy(nonce, 0, mensagem,…
-
4
votes2
answers1591
viewsQ: What happens when I convert String to an array of bytes?
I have: String msg = "Texto a ser encriptado"; byte array[] = msg.getBytes(); What happens when I convert the string to an array of bytes? I’m concerned about an application I’m developing. I need…
-
4
votes4
answers1394
viewsQ: How to concatenate two byte arrays in Java?
I have: byte mensagem[]; byte nonce[]; How do I concatenate the array nonce at the end of the array mensagem and store in a third array?…
-
8
votes2
answers571
viewsQ: How to transmit data securely?
I’m developing two embedded systems, a supervisor and an agent. The supervisor is a card capable of making connections to the Internet through GPRS. It receives requests from a user, through a web…
-
4
votes1
answer2956
viewsA: How to check if a file already exists and overwrite it in Java?
You can do this through function .exists();, for example: boolean exists = (new File("pasta/cadastros.txt")).exists(); if (exists) { //Faz alguma coisa } else {//Se não existe, cria o arquivo...…
-
1
votes1
answer106
viewsA: How to implement a "one to zero" mapping?
Try adding the annotation @NotFound with the attribute (action=NotFoundAction.IGNORE), getting: @Entity @Table(name = "comments") public class Comment implements Serializable { @Id @GeneratedValue…
-
4
votes2
answers92
viewsA: Why the result of this code in C of the 55?
I suggest adding the following line within the: printf("i vale %d Soma vale%d\n",i, soma); Staying: #include <stdio.h> #include <stdlib.h> int main(){ int i, soma = 0;…
-
12
votes1
answer2493
viewsA: What are logical operators and how do bit-to-bit operations work in the C language?
Bit-to-bit operations, bit-to-bit operations, or binary logic, usually refer to logical operations done with binary numbers. These operations range from operations AND, OR, NOT, XOR, NOR, NAND,…
-
12
votes1
answer20870
viewsQ: What does compiling mean?
I have some questions about the process of compiling a code: What is the compilation process? How it works? What are the steps in the compilation process? What is the difference between build x…
-
2
votes1
answer1192
viewsA: How to encrypt and decrypt data to be transmitted via sockets?
You can encrypt the data to be sent and decrypt the data to be received via sockets, using the algorithm AES. import java.util.Formatter; import javax.crypto.Cipher; import…
-
2
votes1
answer2298
viewsA: How to display variable char on the Arduino LCD?
One thing that is important to know about Lcds displays is that they have an internal memory. The Arduino simply activates the read or write mode and sends a memory address with the character you…
-
11
votes3
answers5893
viewsQ: What is operator overload?
In some programming languages such as C++ it is possible to overload operators. What is and what serves?
-
10
votes2
answers1019
viewsQ: How to avoid HTML Injection and XSS on . JSP pages?
In the PHP have seen uses of htmlspecialchars and mysqli. But in Java there is some way to avoid XSS and HTML Injection? I would also like to know what would be the best way (the safest): Escaping…
-
15
votes3
answers5066
viewsQ: What is parallel programming?
I have some doubts about parallel programming: What is parallel programming? It is a technique or a programming paradigm? Is there a specific language for parallel programming? Where parallel…
-
2
votes1
answer387
viewsA: How can I get the time to load and run a program?
The following code does what you need: /* Compilacao: gcc tempo.c -o tempo Execucao: tempo <comando> onde <comando> pode ser ls por exemplo Sugestao de Modificacoes: 1. Retire a chamada…
-
-1
votes1
answer387
viewsQ: How can I get the time to load and run a program?
How can I get time to load and run a program? I want to know the time of loading and execution of a program, since the momentum where the user gives order to run it and the operating system makes…
-
3
votes2
answers1296
viewsQ: How to get operating system time in nanoseconds or milliseconds using Qt Creator?
How can I get system time in nanoseconds or milliseconds in C++ using the Qt Creator? For example, in Java use: long tempoInicial = System.nanoTime(); treinaRNAEpocas(10000); long tempoFinal =…
-
2
votes1
answer370
viewsA: Is it possible to do spatial orientation only with magnetic sensor?
First, the values x, y and z that you refer to, are not magnetic sensor, but rather a component called accelerometer. The magnetic sensor you referred to is a Hall Effect Sensor, which measures the…
-
12
votes1
answer13778
viewsQ: How does the MD5 hash algorithm work?
I would like to understand how the hash algorithm works MD5 (Message-Digest Algorithm 5). He is considered safe? I seek didactic answers, which make me understand the processes used by this…
-
13
votes2
answers16707
viewsQ: How do the SHA family hash algorithms work?
I would like to understand how the hash algorithms of the SHA family work (Secure Hash Algorithm), such as the SHA-1, SHA-2, SHA-3, and understand the differences between them. I seek didactic…
-
55
votes3
answers51454
viewsQ: How does the AES encryption algorithm work?
I’d like to understand how the encryption algorithm works AES (Advanced Encryption Standard). I seek didactic answers, which make me understand the processes used by the algorithm step-by-step,…
-
5
votes1
answer1469
viewsQ: How to make a site multilingual and identify the country of origin?
I am developing a site in Javaee and would like it to be multilingual (at least English, Portuguese and Spanish). But I would like to know how large websites, such as Facebook, for example, do to…
-
4
votes1
answer151
viewsA: Qt String Encoding Problem
Change your setTitle of: void LineChart::setTitle(QString Title){ this->Title = Title; } for: void LineChart::setTitle(const char * Title){ this->Title = QString::fromUtf8(Title); } and add a…
-
4
votes1
answer151
viewsQ: Qt String Encoding Problem
I’m having a problem encoding strings on Qt. By showing something in a QMessageBox or give a drawText in a paintEvent, my strings come out badly formatted, as if they were not in the correct…
-
3
votes1
answer857
viewsQ: How to make a window transparent using Qt?
I’m developing a college job in Qt. I would like to make the background of my application transparent. I did some research and the function I found was: this->setWindowOpacity(0); Meanwhile, the…
-
20
votes4
answers6387
views -
6
votes4
answers11111
viewsQ: Converting float to char array in C/C++
I recently took a test and there was a question that asked for a number like 123.456 was shown as 321.456. I thought the best solution would be to convert this to an array of char and then create an…
-
10
votes2
answers6412
viewsQ: What is the C++ copy builder for? How do I implement it?
I am a programmer Java and I am currently studying C++. In addition to the "normal" constructors (the standard constructor and the parameterized), C++ has a copy builder. I would like to know what…
-
13
votes2
answers7627
viewsQ: What is the C/C++ volatile modifier for?
I’ve seen in some codes on C/C++ statements like this: volatile int i = 0; I would like to know what the modifier is for volatile and in which cases should I use it.…
-
14
votes2
answers23232
views -
8
votes3
answers9428
viewsQ: How does serial communication work and how do I use C/C++?
I use the Debian 7.1 and need to make serial communication between a computer and a microcontroller using C/C++. I’ve done a lot of research on the subject, but the articles and examples I found are…
-
13
votes3
answers949
viewsQ: How does the Xor Swap algorithm work?
I was studying bit-by-bit operations and came across the Xor Swap algorithm. I understand what it does (exchange the value of two variables), but I don’t understand how it does it, at the level of…
-
13
votes6
answers35893
views -
3
votes1
answer1421
viewsA: Simulation of TV Remote Control
Well, what you need is a timer! The Timer class can be useful to you. You will also need to get the date and time of the system, I think it is easier so. You can do this through: long tempoInicio =…
-
3
votes2
answers536
viewsA: Why invert the array index in a for, to popular the array, makes the process faster?
As stated above, the processor has a small amount of cache memory, the TLB, that stores recently accessed memory positions, and this memory contained in the processor, has faster read/write speed…
-
2
votes2
answers2344
viewsQ: How to create a robot using Java requests?
I have been interested in making robots to perform small repetitive and boring tasks. I use a class of Java called Robot. However, I think that the way I am doing it is not the most appropriate,…
-
2
votes2
answers2185
viewsA: Transparent java background
I do so: package teste; import java.awt.Color; import java.awt.Container; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton;…
-
11
votes3
answers2246
viewsA: What is the percentage difference between the number of possible addresses with Ipv4 and Ipv6?
As already mentioned, the IPV6 uses 128bit addresses and therefore has 2128 numbers of IP possible, ie: 340282366920938463463374607431768211456 possible combinations. (340 undecilhões 282 decilhões…