Posts by pss1suporte • 1,629 points
28 posts
-
13
votes2
answers2114
viewsA: What is an asymptote?
I will be as brief and simple as possible and concentrate on responding: What this means for the programmer who does not have a good mathematical basis? This is my case, I do not consider to have a…
-
14
votes2
answers1053
viewsQ: Problem of the Byzantine Generals. How to implement a solution?
Initial considerations I’m conducting a survey on Bitcoin and bumped into the concept of Problem of the Byzantine Generals, where the creator of Bitcoin - Satoshi Nakamoto - wrote "Bitcoin: A…
-
1
votes1
answer2589
viewsA: Creating the JPA/Hibernate "persistence.xml" file
From what I understand your question is that this is about automation. We can automate the project creation process in many ways, but I will focus and use the resources of the Maven tool. I will…
-
0
votes1
answer712
viewsA: Jasper + JSF-java.lang.Nullpointerexception
I made the same mistake in my environment by passing a string wrong file .jasper. And when I didn’t compile the file .jrxml, then the file .jasper did not exist. And the reason a page is generated…
-
2
votes2
answers287
viewsA: Mysql query - Cross Tables count
Being quite direct: at the moment an implicit JOIN is made between tVisitor with tPageViews in the query Both. We can improve and optimize with Semi-join [ WHERE Stores.id IN (Subqueries)], because…
-
0
votes1
answer186
viewsA: Update an attribute according to two other tables
First of all, follow the schema with the tables with the SQL in the "dialect" of Postgresql: CREATE SCHEMA stackoverflow AUTHORIZATION postgres; Table Company + INSERT CREATE TABLE…
-
-1
votes2
answers127
viewsA: Use of the "Instance of"
Assuming that this is a legacy project to which you can’t change the class hierarchy without a major impact, I suggest you apply the Pattern: VISITOR design. The intention of VISITOR is to allow you…
-
0
votes2
answers465
viewsA: How not to show jQuery UI autocomplete input the HTML of the variable?
Well, one of the approaches may be the following: $("form#busca #campo-busca").autocomplete({ minLength: 3, source: 'autocomplete.php', /** * Sugestão de uma das possíveis soluções. */ select:…
-
2
votes1
answer394
viewsA: Error in query INSERT INTO
First it is necessary to check if the SEQUENCE of the PERSON table already exists. It is interesting to use a SEQUENCE to generate the values for primary key. Use the CREATE SEQUENCE statement to…
-
0
votes2
answers460
viewsA: No result when sending data from a JSP form
From the statement of your question your purpose is to implement security. So keep in mind that in Java EE, containers are responsible for providing application security. A container basically…
-
2
votes1
answer44
viewsA: Error converting a data from one class to another
This can be solved in many ways, but I’m inclined to think about the design and reuse of the Log class. interface Log { /* * Coloque aqui os campos (final static) que tenha em comum * com as classes…
-
2
votes1
answer134
viewsA: eclipse - java - errors
As far as I’m concerned, you have to get the method out: merge(int[], int[], int, int) from within method main(String[] args). As below: package trab; import java.util.Arrays; import…
-
1
votes1
answer483
viewsA: Login with JAAS + Tomcat
Now, in practice keep in mind that in Java EE, containers are responsible for providing application security. A container basically provides two types of security: declarative and programmatic.…
-
0
votes1
answer526
viewsA: JAAS with Wildfly does not work
When we have to implement JAAS, it’s important to understand the mechanism of how authentication works using Java EE technology specifications: Security services: The Java Authentication and…
javaanswered pss1suporte 1,629 -
4
votes1
answer762
viewsA: What is a Shim?
Seeking to contribute proactively, and also respecting the answers in English: [What is a Shim? - En, 2010]. I intend to answer in a simple and objective way. So we have the following concept of…
-
1
votes2
answers191
viewsA: Displaying filter from another view
I can collaborate with the following idea: In his View replace the element <button>Nfes</button> by the Helper FormHelper::postLink. Which has the following format: Formhelper::postLink(…
-
7
votes2
answers6310
viewsA: Searching for an object inside an Arraylist
Good to start: All Java API classes, user-defined classes, or classes of any other API - extend the java.lang.Object class, implicitly or explicitly. [MALA GUPTA, 2015, p. 51] With that in mind,…
-
1
votes1
answer181
viewsA: MYSQL: Find subsequences in a sequence and group by ID
Follows below the work SQL DDL: CREATE DATABASE stackoverflow; CREATE TABLE `manifa6_import_manif` ( `seq` int(11) NOT NULL AUTO_INCREMENT, `ID` int(11) DEFAULT NULL, `PART_NUMBER` varchar(45)…
-
6
votes3
answers13710
viewsA: What is a Polyfill?
Being quite simplistic, Polyfill would be a technical jargon restricted to the web universe, javascript, webToolKit and browsers. And as far as the day-to-day programming is concerned, that is, when…
-
3
votes1
answer78
viewsA: Group mysql data
Assuming the following working DDL: CREATE DATABASE `stackoverflow`; CREATE TABLE `Grupo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `Nome` varchar(85) DEFAULT NULL, `bol_ativo` char(1) DEFAULT 'S',…
mysqlanswered pss1suporte 1,629 -
6
votes3
answers1428
viewsQ: How to define the comparison of equality between two objects present in an Arraylist?
How can I define the equality comparison behavior between two objects whose class is defined by me that are stored in an Arraylist object? Java nomecor. public class NomeCor { private String nome;…
-
0
votes0
answers57
viewsQ: objects sharing the same copy of a variable
The goal is to put into practice the contained concepts that I am learning in MALA GUPTA, 2015. So the way I’ve found to contribute is to ask the community to actually implement the concepts. So who…
-
2
votes4
answers5515
viewsA: Dockerize Java Web App: Maven + Tomcat + Docker
I did something similar to demonstrate, modestly, technical compositions [Github Pssilva: 2017] (work in progress). But I adapted to contribute to the community and thus try to answer the questions…
-
4
votes3
answers881
viewsA: Is there a difference between reporting the size in the loop condition or outside it?
Considering the following image: public class DemostrateFor { public static void main(String[] args){ int ctr = 12; for( int j=10, k=14; j <= k; ++j, k=k-1, ctr++ ) {…
-
4
votes3
answers1598
viewsA: Hibernate vs Eclipselink
Both persistence frameworks implement JPA. 1 - There is a difference between the two? Yes, there are differences. However, common sense understands that the purpose is the same: both implement the…
-
2
votes1
answer536
viewsQ: Overloaded Constructors: Instance Initializer
From the perspective of compiler behavior and java class design what would be the justification for using the Instance Initializer block? Considering the following class: class Caneta { public…
-
1
votes2
answers137
viewsQ: Prevent classes from changing the state of objects
How to prevent classes from modifying the object state of a class, both Within equal and separate packages? Assuming there is a Pattern to design a java class design that can or even affects the…
-
8
votes2
answers592
viewsQ: Best practices regarding the use of access modifiers
How to restrict other classes from accessing certain members (methods, variables/fields, nested classes/interfaces) one-class? I would like to know the best practices for using the access modifiers…