Posts by Dan Lucio Prada • 772 points
22 posts
-
0
votes1
answer151
viewsQ: Rotate an image that is in an array
Good afternoon, I have a color image in an array 1D, for example: int[] image = {255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 255, 0, 255, 0, 255, 0, 0}; This array has 6 pixels, red, green, blue, blue,…
-
1
votes1
answer12679
viewsA: Github - Download project (Beginner)
If you want to copy an existing Git repository - for example, a project you want to contribute - the required command is git clone, for example: $ git clone git://github.com/schacon/grit.git This…
-
4
votes2
answers138
viewsA: doubt with select sum() Mysql
Try using the following code: SELECT SUM(d1 + d2 + d3 + ... + d12) as soma FROM janeiro
-
2
votes1
answer230
viewsQ: Create a Bufferedimage from an int Array
I have a one-dimensional array that contains the colors of an image, where at each 3-position interval the color of a pixel is represented (R,G,B): int[] cores = {255, 0, 0, 0, 255, 0, 0, 0, 255};…
-
0
votes1
answer143
viewsQ: Problems acquiring data from a Javafx Label
Good afternoon, I’m starting a simple example for data acquisition of a Label in Javafx, but I’m having difficulties, most of the sources told me to perform as follows: public class MainApp extends…
-
2
votes4
answers2455
viewsA: Serial Communication With PHP and Arduino
then I solved the problem, I could not in any way read and write the data of the serial port through PHP, but after many searches, I was able to read and write the data through the command prompt (I…
-
1
votes4
answers2455
viewsQ: Serial Communication With PHP and Arduino
I already have a code in the Arduino IDE, in which when passed the letter 'l', an led will be access, however, I can not in any way access this serial port with PHP, I am using Fedora 22, Arduino…
-
8
votes2
answers1714
viewsQ: Invoking an object’s method - reflect
It is possible to invoke a method from the contents of a variable of type String? for (Object vlr : dados) { String metodo = "getCodigo()"; contato.setAttribute("codigo", vlr.metodo); }…
-
6
votes4
answers2280
viewsQ: String Manipulation - split()
Is there any way to give a split() in a string and on the same line take the position I want? For example: String nome = "Dan Lucio Prada"; String sobrenome = nome.split(" "); //aqui quero pegar só…
-
1
votes0
answers66
viewsQ: XML Manipulation with JDOM Java
Guys, does anyone know why when I write an xml I simply have to use the path of the directory, and to perform the reading I have to put file: before? "F:/Programming…
-
1
votes1
answer57
viewsQ: Validation of java fields
People as I do a check in java SE for some data, to return a message and ask again this information if it is incorrect, in an elegant way following the good practices of object orientation?
-
0
votes1
answer1267
viewsQ: Floating point format in java
Personal how do I read a floating point with a specific limit of decimal places after the comma? For example, read 3.14? Note: I know you can format the value of a variable with decimal format, but…
javaasked Dan Lucio Prada 772 -
4
votes1
answer7264
viewsQ: Take values separated by spaces in Java
Could someone explain to me how I can take values separated by spaces in Java? For example, the user informs all at once the following values: 1 2 3 and I have to put each value into a variable.…
-
2
votes1
answer1674
viewsQ: Chained lists in Java
Assuming that I have a list chained Students, where one must register name and note, however this same student may contain more than one note. In my logic, he only registers a student with a single…
javaasked Dan Lucio Prada 772 -
2
votes1
answer2618
viewsQ: Chained JAVA Lists
How to invert a simple chained list in Java? For example, I have the following values: 3 - 2 - 1 and the end result will have to be 1 - 2 - 3. Note: no use of native Java functions such as…
javaasked Dan Lucio Prada 772 -
0
votes4
answers784
viewsQ: Break an integer into small parts in Java
I need to place each digit of an integer in a vector position. int a = 123; List<Integer> numerosGerados = new ArrayList<>(); And now I need to put the number 1 at the 0 position of the…
javaasked Dan Lucio Prada 772 -
-1
votes2
answers3910
viewsQ: Get first digits of a number in Java
How do I take part of an integer number in Java? For example, I have a variable int a = 12345678, and the user wants to receive only 4 digits.
-
2
votes2
answers588
viewsQ: Doubt about the MOD operator in PHP
I have a code PHP that performs a certain calculation, however it is resulting something different than I expect, I performed the calculations in hand and did not generate the same result, anyone…
-
8
votes2
answers1064
viewsQ: What does << in PHP mean?
I came across the following calculation being assigned to a variable (1103515245 * $num + 12345) % (1 << 31) What do these mean <<?
phpasked Dan Lucio Prada 772 -
4
votes2
answers2516
viewsQ: What are the differences between Inputstreamreader and Java Scanner
I was aware of the data reading by Scanner, know superficially its functioning, however I came across some examples using a class called InputStreamReader for data reading. What are the differences…
-
5
votes1
answer2070
viewsQ: Java Arraylist - Overriding values
Guys need to perform the following activity: "Consider an application to store the following data of a person in an address book: name, address, and phone. Specify a TAD to store the data of persons…
-
5
votes2
answers114
viewsQ: How to get a Date String?
My question is how to get a string and manipulate it. The user will inform dd/mm/yyyy in the form of String. How do I make this catch? And then I need to make this date whole so that I can do the…