Posts by Piovezan • 15,850 points
395 posts
-
8
votes1
answer110
viewsQ: Why, in C, is a statically declared array name not an lvalue?
Why, in C, the name of a statically declared array is not a lvalue? A lvalue is an expression that can appear on the left side of an assignment statement. It is an expression that represents a…
-
4
votes1
answer124
viewsQ: How abstract are pointers in C?
I have a vision, which from time to time seems wrong, that C pointers are simply and literally memory addresses. In this case it starts from a misconception that memory was a linear thing and…
-
3
votes2
answers88
viewsA: A Setter method can receive a getter + value as a parameter?
I wanted to supplement Maniero’s answer with something I think I had to say. I created the advisory methods Setter and getter for the balance attribute. Did you really need to create it? It’s…
-
2
votes1
answer42
viewsA: What are covering, Composite and compound compared to Dexes?
First understand how to build an index. You create a binary search tree (search the basic concept to know what it is), which is usually a B-tree (which is a more complicated type to understand so…
-
6
votes2
answers114
viewsA: What are "fancy words" (fancy words) in programming languages?
The term itself has no direct relation to programming or to a particular language, as it is a term of general use in the English language to describe certain types of words, but I believe it is…
language-independentanswered Piovezan 15,850 -
2
votes2
answers38
viewsA: Difficulty in calling Xmlhttprequest with pure Javascript
Understand that this function() below is a "callback" (you do not send call directly, only passes the reference of the function to someone who will send to call her when it is the appropriate time…
-
3
votes1
answer77
viewsA: Adding a string in Ruby
I believe the trick is to give one String.split in the string separating by the line break character \n (if it is Windows and came from a file might be coming "\r\n"). You must return a list (in…
-
-4
votes0
answers45
viewsQ: What is currently the resource-rich language (or languages) considered simpler to install on Windows?
(Another off-topic face question for the collection) Installing development environments for programming languages is not always easy. Java and Ruby, for example, are languages that in my experience…
-
0
votes1
answer49
viewsA: I cannot find the error in this simple issue of javascript programming in which I need to check how many times the letter "o" appears in the sentence
"length" is spelled wrong. And also not using the function elsewhere to display the result.
-
1
votes1
answer31
viewsA: Is it bad practice not to specify NOT NULL in a SERIAL field? Postgresql
The theory is that a field (or combination of fields of the same table) is a primary key so NOT NULL and UNIQUE are implicit, and so I think NOT NULL would not even need to be explained in the…
postgresqlanswered Piovezan 15,850 -
5
votes0
answers51
viewsQ: How to gain insight into new programming technologies and techniques?
You look like you’re subject to opinion/debate, but I wanted to try to fit a question into that line. It is important for a good programmer to know how to evaluate trade-offs (pros and cons of…
-
0
votes1
answer26
viewsA: Void method returns items to the list, but when I try to use this list, it is empty!
I get it now. Well, understand that itensCarrinhos2 is a reference to a list object, not the object itself. You passed this reference to Adapter and it does not expect it to be changed, just to…
-
0
votes1
answer42
viewsA: How do I test the API gateway of a project in microservices
If the data is exactly what you posted, what’s wrong is the host, which has to be the domain address. Instead of billingapi, must be some kind of address amazon.com.br, finally, the endpoint of this…
-
0
votes2
answers68
viewsA: How to use XML inside a String variable
To answer the question, there are some ways, one that I find sensible and robust would be to look for a good library to do Parsing from XML to Java, possibly some that is already available in the…
-
7
votes2
answers141
viewsA: What is the difference between the functions Rand, mt_rand, random_int?
I do not understand in depth, but what I am going to say is not wrong, so it may yield a few points. : D Summary: use the random_int for anything involving information security (such as protected…
-
8
votes2
answers146
viewsA: In what context is the state machine pattern indicated?
Introducing Programming is about finding an automated solution to a problem. Certain types of problems in programming, involving entities transiting at each moment to a different state within a…
-
2
votes1
answer141
viewsA: Packaging in Kotlin
If you try to access these attributes of your object dadosJoao (actually the right is to call them fields) from outside the class as you did, in that function main() who does not belong to the class…
-
1
votes1
answer29
viewsA: When I define a constant B = constant A and change one of the properties of constant B the property of constant A is also modified?
This is because a is pointing to an object, but it is not the object itself, it is only a reference to it, as a residential address is in relation to a residence. When you do it for example b = a…
-
2
votes2
answers67
viewsA: Is there a better way to deal with relational and non-relational databases in the same project?
(Another in the hype of the Mongodb that no one needs in 99% of cases... should be just to practice the concept ). What will be recorded in both cases are distinct structures, in the case of the…
-
3
votes1
answer48
viewsA: Does anyone know how to convert int variable to bool?
It seems your error is using attribution syntax L1 = L2 ("L1 receives the value of L2") instead of equality L1 == L2 ("L1 equals L2?"). Note that in the second case are two equal signs together not…
-
2
votes2
answers36
viewsA: Relationship between Similar Tables
From what I understand, both a client and a company can insert images in the table of images, but only one of them each time and not both at the same time, right? This is a problem for the foreign…
-
0
votes2
answers106
viewsA: Hangman game in C
It’s a strong suspicion, so I’ll put it right back. C character arrays must always be terminated in \0 (for your knowledge this represents the value character 0 in the ASCII table, note that this is…
-
0
votes2
answers42
viewsA: How to authenticate via headers and access API
Give a googlada to find which method of the class XMLHttpRequest adds headers (headers) to the HTTP request that will be made. Headers are pairs of strings: one is the header key or name, the other…
-
1
votes2
answers292
viewsA: java.util.Illegalformatconversionexception: d != java.lang.Integer
I changed the way I did it, actually that’s basically what I wanted: private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss"); LocalDateTime…
-
1
votes2
answers292
viewsQ: java.util.Illegalformatconversionexception: d != java.lang.Integer
What’s going on here? I don’t think I can read the documentation from String format.(). For me this date/time conversion %td When receiving an integer within the interval of the day of the month it…
-
1
votes1
answer55
viewsA: Jakartaee vs Spring vs Java SE with JPA
Jee covers a lot of things. One of them is the specification (not implementation) JPA, which was made inspired by the Hibernate ORM framework, and later Hibernate adapted to it and implemented this…
-
1
votes1
answer24
viewsA: Java function does not return the correct value
From what I understand the function is being called recursively and the return of the last call is being ignored in the previous call (note that you are calling the function within itself as if it…
-
1
votes2
answers69
viewsA: How to apply a condition if all values in a list are equal Java
I don’t know if the interface List Java has a way of knowing if all objects are the same, if there will be some method in the interface documentation, but I don’t think there is. And in fact it…
-
1
votes1
answer32
viewsA: How can I resolve this NPE error when fetching data in an API?
I don’t know Kotlin, and I don’t understand all the code. And I’m not sure about the concept of co-routines, I have with me that are code that pass control of the execution from one thread to…
-
1
votes1
answer29
viewsA: Web Application Eclipse Javaee
Learn this, everything that gets inside the WEB-INF directory is not accessible by the browser, this includes the Javaserver Pages that you put there. I don’t remember if it can be fooled, but at…
-
0
votes1
answer9
viewsA: Background Service being killed on android
I’m totally out of Android these days, but services have always been volatile things, which should not run in a prolonged way because they have always been subject to being killed by the OS. In this…
-
0
votes3
answers105
viewsA: How to access item in Arraylist
Your approach is putting an object of the domain model (i.e., an object that represents something of the problem that your application deals with, in the case of product sales) a behavior of reading…
-
1
votes1
answer31
viewsA: Problems with the Bufferstrategy
From what I’ve researched the problem, you should only mess with BufferStrategy after the JFrame ready and displayed. So in case I believe you missed the call janela.setVisible(true) after the line…
-
10
votes1
answer900
viewsA: Why is the operator "?:" called Elvis Operator?
The operator ?: has that name because it resembles the singer’s topknot Elvis Presley. Behold: https://en.wikipedia.org/wiki/Elvis_operator…
-
0
votes1
answer95
viewsA: How to request parameters within Java
The body (body) of the HTTP response is usually treated by the library as a string, not necessarily of a JSON, could be of an XML for example, suddenly it could even be a binary (non-textual) data.…
-
0
votes2
answers28
viewsA: Access Different Jframes objects (JAVA)
Look. If I remember correctly, a Swing application can only have a Jframe, but more than one Jdialog, which can be instantiated to appear in front of Jframe but only after Jframe has already been…
-
1
votes3
answers1117
viewsA: TCP/IP connection failure when trying to connect to an SQL Server database
It is a really simple mistake to understand if you have notions of computer networks and apply a little deduction, even more that it is almost all in Portuguese. Switching in kids, the application…
-
0
votes0
answers19
viewsQ: What is the relationship between EER and objects?
The EER (Enhanced Entity-Relationship) model has some concepts such as class, subclass, generalization, specialization. What is the relationship between these EER concepts and object orientation?…
-
0
votes4
answers1580
viewsA: Is this a common practice in object orientation?
An object-oriented application is a network of objects that collaborate with each other for objectives. The responsibilities that each object must fulfill are distributed more or less equally…
-
8
votes3
answers149
viewsQ: What is data modeling (data Modeling)?
What is data modeling (data Modeling)? In what context is it used? At what time of development it should begin to be done? Does it relate to object orientation? One opposes or complements the other?…
-
0
votes1
answer38
viewsA: I’m a beginner in java and I’m looking to learn more about it, so I’d like to know how to know if the threads are running?
The class Thread is an abstraction of Java for operating system threads. The class typically used to create a thread pool is wrong. It wouldn’t be ThreadPool of the CORBA package, for example a…
-
1
votes1
answer75
viewsA: Show item of an Arraylist in a Jtextfield
The error is that you are declaring two variables with the same name Palavras (that by the way is outside the Java standard, the right is in lowercase) and making confusion between them. One is…
-
0
votes1
answer69
viewsA: Exception error when running my code in Java
Are you using printf() wrong. Change: System.out.printf("Seu saldo atual é de R$ %2.f", saldoTotal + "\n"); for: System.out.printf("Seu saldo atual é de R$ %2.f\n", saldoTotal);…
-
2
votes1
answer47
viewsQ: If B is a subtype of A, why is a collection of B not a subtype of a collection of A?
Dice: public interface A { ... } public interface B extends A { ... } private Set<B> bs = new HashSet<>(); RecebeA qualquerCoisa = new RecebeA(bs); Why does the last line compile if the…
-
1
votes1
answer695
viewsA: How to work as a team with Git?
I’ll try to summarize. The first thing is for everyone to take the time to study Git and understand how it works not to screw up during versioning, especially synchronization between local and…
-
0
votes1
answer192
viewsA: java.lang.Numberformatexception: null
request.getParameter("testJava") is returning null. With that the method parseInt() tries to convert null for an integer number, fails and throws the exception. One way to deduce this is through the…
-
0
votes1
answer52
viewsA: What is the advantage of using Javascript?
Labels are not unique to Javascript, they are common to languages with procedural features such as C, Java, etc. When applied to a single loop (a for or a while for example) it is not advantageous,…
javascriptanswered Piovezan 15,850 -
2
votes2
answers611
viewsA: What is the purpose of using UUID (version 4) as "Primary key"?
I’m gonna make assumptions. Theoretically, using a random UUID you fail to expose what is the approximate range of valid id’s, from 0 to a maximum N found. No one knows which and how many are these…
-
0
votes1
answer44
viewsA: Tips for making a cleaner code
Your method takes Jtextfields, which are GUI components, and makes a query in the bank. Ah, and do login and password authentication. Ah! And it warns with graphic component if it is wrong. It has…
-
1
votes2
answers93
viewsA: What are pre-specified classes?
The question of the pre-specified classes is as follows:. Plain Old Java Objects means more or less "The good old Java objects". It means a purely Java object created by you, using at most libraries…