Posts by Cold • 3,842 points
49 posts
-
20
votes4
answers1048
viewsQ: Should every algorithm be finite?
Every algorithm must always finish after a finite number of steps? It seems trivial but I ask because it generated another doubt that can be exposed in the following example: enquanto (VERDADE){…
-
1
votes1
answer30
viewsQ: Prolog-related error on a. xhtml page using Netbeans
Is there any relationship between . xhtml and Prolog pages? Or compiling pages and Prolog in Netbeans? Using Netbeans I get a build error: I can’t understand the connection between a thing (.xhtml,…
-
11
votes3
answers681
viewsQ: Learning in neural networks
How does learning occur in neural networks? What’s the concept behind it? What is your relationship with "Deep Learning"?
artificial-intelligenceasked Cold 3,842 -
17
votes2
answers10623
viewsQ: Imperative and Declarative Paradigm
What are the differences between mandatory and declarative programming paradigms? Advantages and disadvantages?
-
4
votes8
answers2113
viewsA: Is using customer validation enough?
Validation is not sufficient on only one side (server or client), there must be a certain combination between the two. In some respects it is best to validate on the client side, saving bandwidth…
-
4
votes1
answer180
viewsQ: Define style in the :Hover event of an inline HTML form element?
It is possible to define style(CSS) of a single element HTML so inline at the event :hover? How to define style(CSS) of a single element HTML so inline at the event :hover?…
-
14
votes4
answers3512
viewsA: What do reticence in the parameters of a method mean?
Named for varargs, is a feature/capability allows a method to receive multiple or no argument of the same type. The ... doInBackground(String... params) means that this method can receive no…
-
2
votes2
answers452
viewsQ: How to display a upload image while the iframe content is loaded?
How to display a loading image while the contents of iframe is loaded?
-
1
votes1
answer358
viewsA: Going to a particular tab
To work you would need to update the p:tabView, for such: 1 - Define a id par to the p:tabView(Example: tabTeste); 2 - For menu items, you can update p:tabview after it finishes the asynchronous…
-
1
votes1
answer113
viewsQ: How to fill the data of a tree-shaped element?
I have an element p:tree of Primefaces, and I would like to fill it with existing data in a ArrayList. Actually I’d just like to get an idea about what the algorithm might be that does this.…
-
1
votes2
answers1867
viewsA: How to pass an array to a Jtexfield?
You can solve it like this: Create a class, example: TrabalhoArray.java; In the class created in point 1 create an attribute, which will be a array the kind of objects you intend to handle, in this…
-
1
votes1
answer134
viewsA: Get the revision history in Google Drive with Java by Netbeans
This (build) error occurs because none of the libraries you imported from the sent link have the classes you want to use, from the package: import com.google.api.services.drive. For this you have…
-
4
votes3
answers388
viewsA: Refactoring of a java class
For the responsibilities you mentioned I suggested the following (class names are just suggestions, you can put to your liking): 1 - Create classes with the implementation of specific methods…
-
1
votes2
answers195
viewsA: JDK Java EE 7 without Glassfish
Notwithstanding the installation of Glassfish occur at the time you install the Javaee JDK you can use any other Application Server (or Container) without interference between them, as long as you…
-
2
votes4
answers2562
viewsQ: Definition of "margin-top" in percentage of a "div" works strangely
I own a page .xhtml and the first element to be placed is a div(content) and I set for her a higher margin(margin-top) of 30%. Supposedly, from what I understand, this percentage should be taken…
-
7
votes1
answer402
viewsQ: Percentage of Equality of Texts?
Is there any method to know the percentage of equality of two texts (Strings) in Java? An abstract algorithm would also serve.
-
1
votes1
answer64
viewsA: Decision problem within an array loop
This is because in all interactions in the cycle in question position 11 in the vector is different from null. You can solve it like this: ... for(int i; i<array.lenght; i++){//percorre todo o…
-
1
votes1
answer1278
viewsA: How to read multiple lines from a text file (.txt) and store them in the same variable?
I suggest the following: ... StringBuilder sb = new StringBuilder(); linha = arquivoEntrada.readLine(); do { if (linha.startsWith("Palavra1"))//verifica se começa pela Palavra e não { String…
-
6
votes1
answer178
viewsQ: Why does the group_concat of primary keys (integers) generate a BLOB as a result?
Trying to answer this issue (as the AP even presented, without resorting to normalization) I tried to use the group_concat it returns me the object of type BLOB. Table: CREATE TABLE `teste` ( `id`…
-
9
votes1
answer9074
viewsA: How to select only one radio button?
The solution to this is the use of javax.swing.ButtonGroup which makes it possible to group the components into groups javax.swing.JRadioButton. Example: ... buttonGroup1 = new…
-
5
votes4
answers1357
viewsA: Margin in percentage is relative to what?
The percentage value is relative to the upper block (in this case the block containing the element in question). In your case the image margins within a class element .mainheader will distance into…
-
124
votes4
answers35777
viewsQ: Is HTML a programming language?
It is not my intention to bring the confusion of others to the site, but it was my doubt (internal, of those things that one is sure and then someone comes and asks a question that messes with the…
-
41
votes2
answers33649
viewsQ: What are SQL views? What are the advantages and disadvantages of using?
From my research I learned that views in SQL, are like virtual tables results of stored searches of frequent access. To W3S defines essentially as: virtual table. It has to be said that views are…
-
1
votes1
answer173
viewsA: Making width: Webkit-min-content responsive
You can solve this problem by setting the size of the div where the other elements are located. Example: div {max-width: 100%;} img {max-width: 100%} In this way, as in the example, he had occupied…
-
6
votes4
answers28233
viewsA: How to know the highest value of an Array?
If there is already a cycle that occurs for the reception of the entered numbers, I believe that you could also solve the problem of determining the largest number by creating a variable that always…
-
2
votes1
answer161
viewsQ: Framework (Java) for Opening remote sessions for executing Unix-based Server commands
I needed a framework to be able to open remote sessions on (Unix-based) servers and run commands remotely (if possible as root even). Does anyone know any mature who can serve this purpose? Main…
-
0
votes10
answers360
viewsA: Organization of CSS
The second option is the "most readable", but both work the same way. It is only identation (the second option is identada and the first is not).
-
2
votes1
answer1859
viewsQ: Read each existing Line in Stringbuffer or String
I have a text with the following format: Data Valor 20140901 278 20140902 248 20140903 458 20141004 545 20141005 125 20141106 1020 20141207 249 It is stored in an object of the type StringBuffer and…
-
4
votes2
answers5399
viewsQ: Maximum number of characters in a String and Stringbuffer in Java
What is the maximum limit of characters that the types String and StringBuffer support in Java?
-
5
votes2
answers202
viewsA: Change class vector size
You can solve this by instantiating the vector in the class constructor and taking the size as argument: public class Teste { public static String vetor[]; ... public Teste(int tamanhoVetor) { vetor…
-
1
votes1
answer108
viewsQ: What is the standard method of positioning elements on a page?
What is the standard method of positioning elements on a page? I ask because I had seen in some material that by default the elements on a page (HTML) have the property position defined as relative,…
-
7
votes2
answers290
viewsQ: Center a Div between two others, one at each end
Despite the tag discontinuation <center>, she still solved this my problem d eforma simple, but would like to know how to solve it just using css. The idea is to put two buttons (or div's) at…
-
1
votes1
answer757
viewsA: Change the active tab on a p:tabview
I’ve found the solution: Use the function select(index) of the component to define the next p:tab active. This function is executed on the client side (javascript) and is invoked by the reference…
-
0
votes1
answer757
viewsQ: Change the active tab on a p:tabview
How to change the tab active in a component p:tabview from a p:commandButton? Any idea?
-
3
votes4
answers1788
viewsA: Are Getters and Setters mandatory or facilitators?
It is used only in object-oriented languages following the principle of encapsulation. I recommend reading of : http://en.wikipedia.org/wiki/Mutator_method Some interesting answers can also be seen…
-
2
votes1
answer299
viewsA: Object counter
Knowing the specific terms you want to count in a given text, you can solve it as follows: Create a method that takes the intended text as arguments analyze and list of elements that should be…
-
2
votes1
answer86
viewsA: Array Out of Bounds reading File
If the goal is not to read the last blank line, the following statement can generate this exception: listaPacientes.add(new Paciente(result[0], Double.parseDouble(result[1]),…
-
5
votes3
answers1627
viewsQ: How do you set zero or null in an SQL query of a date range, for those whose value does not exist?
Formulating the question was a little difficult, but I will try to be as explicit as possible using an example to put the question. There are the following data in my table: The aim is to carry out…
-
3
votes4
answers1502
viewsA: How to make a layout ready for all resolutions
If you want to do this all the way through, I recommend the combination of media queries combined with relative page element dimensions (instead of using % or . pixels for fonts). Media Queries:…
-
3
votes3
answers1011
viewsA: @Override is required in Java?
Both in classes that implement the methods of an interface and in subclasses that subscribe to methods in superclasses, this annotation is not mandatory, but it informs the compiler that the…
-
6
votes2
answers157
viewsQ: Using a security framework or fingernail?
I have had this doubt for some time and to this day I am not so firm in a position, despite having taken a. Whenever I develop, or participate in the development of an application (WEB), we usually…
-
5
votes6
answers1117
viewsA: Algorithm against Brute-force
Verification using only the session is, in my opinion, insufficient! I recommend blocking the account after a certain number of attempts, and proceed with sending an email with a temporary password…
-
4
votes2
answers5005
viewsA: Run a method in Managedbean when initializing the Page
Personal greetings. The best solution I found (without wanting to dispense with the help already presented here) is the use of the type of event preRenderView for the tag f:event. Allows the…
-
0
votes2
answers5005
viewsQ: Run a method in Managedbean when initializing the Page
Greetings Pessoal. I wonder if there is any formal way to execute a method in Managedbean when invoking/initializing a page? I have already done this, usually by putting EL directly on the page,…
-
6
votes2
answers1472
viewsQ: Discontinuation of the <center> tag
I know it seems like a lot, maybe it’s really a lot of lack of knowledge, but I’ve done some research and I haven’t found anything that would actually convince me. Does anyone have any, or knows why…
-
0
votes4
answers2527
viewsA: How to take the edge of a primefaces datagrid?
Amazing that I never had to do this, but 2 hours after seeing this question came the need, :). I solved the problem as follows: <p:dataGrid ... styleClass="teste"> ... </p:dataGrid> In…
-
0
votes1
answer104
viewsQ: More efficient way to use "Expression" in enhanced "for" cycles
Among the following forms, which the most efficient? ... //assumindo que o método pegaListaPessoas() pesquisa na base de dados todos as pessoas for (Pessoa pAux : pegaListaPessoas()) { //executo…
-
3
votes4
answers6235
viewsA: Inserting image with Jasperreport via parameters
I’ve done it and it always works in a good way. Broad lines for this: The field that will display the image in the report should be of the type : java.awt.Image Then you only need to send the…
-
-1
votes1
answer1709
viewsA: How to determine the size of a Jtextfield?
Try to use the setBounds, see here. Example: public void teste() { //posição da caixa de texto no eixo horizontal em pixeis int posX = 10; //posição da caixa de texto no eixo vertical em pixeis int…