Posts by Piovezan • 15,850 points
395 posts
-
0
votes1
answer157
viewsA: String Arrays
Initializing the array must be done with keys, not parentheses. State so: String[] lista1 = {"24/7", "Varias Camadas","B-to-B","Todos ganham","front-end","baseado na web","Difundido"}; String[]…
-
0
votes1
answer84
viewsA: ERROR 500 - But I don’t know where is wrong, someone help me!
The Setter country nome is not doing the assignment correctly. In class Categoria.java, in the method setNome(String name), change the parameter name for nome. This way the assignment will be…
-
11
votes3
answers3987
viewsA: What does it mean to run lint in the code?
A linter or lint is a tool for static code analysis. https://en.wikipedia.org/wiki/Lint_(software) A linter or lint refers to tools that analyze source code to accuse programming errors, bugs,…
-
1
votes2
answers104
viewsA: Priority running android thread
It seems the method start() is asynchronous, i.e., it delegates execution to a relatively time-consuming portion of code on another thread and when it finishes executing that thread calls onFinish()…
-
2
votes3
answers89
viewsA: OFFSET next to COUNT(*) returns nothing?
The Count function returns only one line, so there is no way to apply offset, you will lose this line on your return.
-
2
votes2
answers148
viewsA: How do you model a role in object orientation?
Copied from Maniero’s response, only in pseudo-Java, for better visualization (and take Boilerplate. Whoever has something to improve, just edit it). Very simply: public class Pessoa { private…
-
3
votes2
answers148
viewsQ: How do you model a role in object orientation?
How one normally models a role (role) object-oriented? It is by means of a composition, correct? For example, to model that a Pessoa executes the paper of a Cliente or Fornecedor, it is modeled that…
-
7
votes3
answers171
viewsQ: Is APOO useful today?
I went there on Engineering.SE software and asked what has APOO (Object-Oriented Analysis and Project) methodology prominent today (here in Brazil there is not much, but there in the USA, will…
-
1
votes1
answer57
viewsA: Client-Server between APP trackeia real-time location
I don’t think there’s a specific architecture for that, I’m just gonna make a few recommendations. It is interesting to save the positions within a table in the Sqlite within the app itself for…
-
3
votes1
answer110
viewsQ: How can Maven’s archetype webapp work without web.xml?
I tried creating an app Maven archetype webapp in Eclipse JEE Photon: File > New > Maven Project > Next > maven-archetype-webapp 1.0 It generates the following file structure: . |-- src…
-
2
votes1
answer949
viewsA: "The app stopped working," what could it be?
It is null yes. Look at your Edittext being declared: EditText txtTitulo; For instance variables (i.e., for object variables, as opposed to local variables) this is basically the same as declaring…
-
2
votes1
answer73
viewsQ: GRASP: Application of the Creator Pattern
Craig Larman (Using UML and Standards, p. 352) proposes the following design problem: Who is responsible for creating a Payment instance? By the GRASP Creator standard, candidates are the Registrar…
-
4
votes1
answer167
viewsQ: Can an employee be an individual?
Was recommended, in this question, maintain the relationship between Pessoa Física and Funcionário as generalization (Employee extends Physical Person). I do not understand why it is not in this…
-
2
votes1
answer314
viewsA: SQL - How to override ambiguous external junction?
Ambiguity may be because in the SQL query you are using only idLado instead of NomeDaTabela.idLado. For example, instead of... select (...) where idLado = 1 ...you should do... select (...) where…
-
12
votes1
answer231
viewsQ: When is it useful to separate state of behavior?
In object orientation there is the concept of encapsulation: meet in the same state class and the functions operating in that state. But there are situations where it is useful to separate state and…
-
2
votes1
answer145
viewsA: Initialize and change static variable in a thead safe way. Does this code make sense? Intellij IDEA doesn’t think
Do not Sincronize on the token. Sync on a final object. private static final Object lock = new Object(); synchronized (lock) { ... }
-
5
votes1
answer85
viewsQ: What is the Java equivalent of this Ruby lambda?
In his text on Inversion of Control, Fowler uses as an example an excerpt of code in Ruby that promotes the said principle to "invoke a bind method over the text input field that passes an event…
-
9
votes1
answer89
viewsQ: Can the & (bitwise and) Java operator be used for interfaces?
Snippet source code from interface Comparator. Somebody explain to me how this is treated Comparator<T> & Serializable? public static <T, U extends Comparable<? super U>>…
-
5
votes1
answer127
viewsQ: Code Review: Simple MVC
Hello world! I tried to make a very simple MVC in Javafx. My template is a class Pessoa who owns nome and idade (the field idade in case it is not used). Two text Fields represent two views. For…
-
3
votes1
answer182
views -
1
votes1
answer114
viewsA: General game in Java
Store in an array of 6 elements the number of occurrences of each given (example: if three numbers 1 came out, store in the first house of the array the value 3; if four numbers 6 came out, store in…
-
0
votes2
answers151
viewsQ: How is the Generics syntax in C# compared to Java?
I am a Java developer studying C# and came across the following difference between the two languages: https://nerdparadise.com/programming/csharpforjavadevs Generics Generics are Much Less fiddly in…
-
1
votes1
answer444
viewsA: Age accountant
You need a variable contadorMenosDe25Anos integer type starting zero and incremented one each time you read an age between 0 and 25 years. Likewise a variable contadorMaisDe50Anos for ages older…
-
11
votes1
answer35768
viewsQ: What is the difference between conceptual, logical and physical modeling?
In a relational database, what is the difference between conceptual, logical and physical modeling? Could you give an example?
-
5
votes2
answers337
viewsA: Real example of the use of encapsulation
It is not an obligation for an object to have getter and Setter for each attribute field (but exposing them directly as audiences usually is even worse). You have to create these methods only when…
-
1
votes1
answer138
viewsA: How to determine the level of access of the elements of a class?
Depending on the interpretation of the examiner’s bench may be alternative C or question reversed. In fact, the term package does not apply to the access modifier but to the access level…
-
2
votes1
answer38
viewsA: Logical operator out of commission?
Comparison of strings in Java is done with the method equals(). if (token.equals("(")) { ... } Or compare the individual character, which is of numeric type and can be compared with ==, as an…
-
20
votes1
answer10213
viewsQ: What is the Firebase?
I haven’t touched with Android in a while and I haven’t had a chance to mess with Firebase. However, it is often mentioned in SOPT questions. After all, what is Firebase? It is a set of…
-
2
votes2
answers4008
viewsA: Doubt about the structure of a use case
Theoretical response. You don’t have a use case, but several. There’s nothing wrong with the name Register. On the other hand, Login is not typically portrayed as a use case, according to the…
-
0
votes1
answer202
views -
0
votes2
answers47
viewsA: Socket does not receive or send message to the server
Call PrintWriter.flush() after each write() sending message to make the data effectively transmitted.
-
6
votes2
answers1076
viewsQ: What is Microsoft Access for?
It’s a stupid question, I know. I have almost no contact with MS Access. I know it is a database. Does it have anything special? Any Feature worthy of note? How does it work? What demands does it…
-
4
votes1
answer68
viewsA: Code review: Threaded server to handle multiple clients
The server logic should be like this: Enquanto verdadeiro: Accept (operação bloqueante) Criar uma nova Thread e passar para ela o socket_client. Ela deverá ficar em loop tratando a chegada de…
-
1
votes1
answer47
viewsA: Sqlitedatabase db error = this.getWritableDatabase();
Of course, you’re returning null. The part of the code that calls addMigracaoCadIndividual(s) must be waiting for something that isn’t null (one ArrayList of Strings, in the case). Try it like this:…
-
1
votes1
answer63
viewsA: Doubt with scanner
It uses a type of data that is not primitive, called String. Note that to compare two strings do not use the == and yes the equals(). Example: if (stringDigitada.equals("São Paulo")) { ... } You…
-
3
votes1
answer964
viewsA: How to find the lowest value of a python vector?
The logic of its function would be thus: You create a variable minimo which has the value of the first element of the list (if you do not want to use the same function name, call min or something…
python-3.xanswered Piovezan 15,850 -
8
votes1
answer452
viewsA: Is it possible to compile an app using Java and Kotlin together?
Yes, you can. It is a feature propagated by Google that the new Android language is interoperable with Java; you can create a class in Java and another in Kotlin, each one will be compiled to a file…
-
1
votes1
answer1139
viewsQ: How to distribute the items of a horizontal list independently of their quantity?
The snippet below is working correctly, dividing the navigation bar into four items equally distributed horizontally. Run it to observe. But it is not as I would like: the width field (width) of…
-
2
votes1
answer1723
viewsA: Send a POST request with java
I will quote three ways: Java native, using Httpurlconnection (very low level, do not recommend); Using the library Apache Httpclient. Here is an example POST request with JSON; Using the library…
-
1
votes1
answer62
viewsA: Create objects after external server response via API
You want to fill in your list and then make use of it. However, the completion and use should take place one after the other. I believe in your code this is not happening. First you are declaring…
-
0
votes1
answer624
viewsQ: Exercise in the ordering of tuples
I’m getting beat up in a Python exercise. He asks for the following: Create a function that: Receive a list of tuples (data), an integer (key, zero by default equal) and a boolean (reverse, false by…
-
6
votes4
answers320
viewsQ: Flatten lists. Is a more concise solution possible?
I solved the following Python exercise: Implement a function that receives a list of length lists any and return a list of a dimension. The solution I was able to make was this:: #!/usr/bin/env…
-
5
votes2
answers324
viewsA: When to call super.nameAll when override(override) a method?
Asynctask is an abstract class with some methods whose default implementation does nothing, including onPreExecute(). These methods should be superscripted (implemented) by the Asynctask subclasses.…
-
2
votes0
answers81
viewsQ: What is relationship and relational model outside of the database context?
What would be relationship and relational model in the contexts below (removed from here)? Context 1: Double-Dispatch Maniero: I agree and I think [the lack of double-Ispatch support or the view…
-
6
votes3
answers1710
viewsA: What are the limitations of the object-oriented paradigm?
This answer is not new but a summary of the other two answers. There is no need to upvote or anything. Serves to consolidate the arguments against OO and can serve to add/correct their understanding…
-
14
votes3
answers1710
viewsQ: What are the limitations of the object-oriented paradigm?
My experience is more with the object-oriented paradigm. Ok, "if all you have is a hammer, all the problems look like nails". And I say: it’s a complicated paradigm, full of good practices,…
-
15
votes2
answers5550
viewsQ: What is the difference between website and web application?
It is said that they are different. What is the difference between a website and a web application (web application, web application)? P.S.: It has no Soen…
web-applicationasked Piovezan 15,850 -
2
votes2
answers197
viewsA: Is there a way to collapse all the blocks of code into an eclipse?
There is a shortcut, mapped by default to Ctrl+Shift+NUM_KEYPAD_DIVIDE (split key on numeric keyboard). You can change it to something else via Window -> Preferences, search for "Keys", then…
-
1
votes1
answer533
viewsA: How to get communication response using MQTT
Is your command coming to Arduin and is it changing status? I ask this because by your code you are publishing on a topic called Stream while Arduin is subscribing to a topic called inTopic. The…
-
9
votes1
answer1978
viewsQ: How to program in a modular way?
I am studying some concepts here and I want to see if I have the right ideas and also launch a(s) question(s). In modular programming (either structured or OOP) instead of my application being…