Posts by utluiz • 72,075 points
957 posts
-
1
votes1
answer199
viewsA: Creating columns in tables through variables in java
Do not create columns. If you need the user to create variables and specify various values for each of them, create a new table that allows you to define the variables for each user. The fields are:…
-
2
votes1
answer103
viewsA: Delete file *.pdf
The class RandomAccessBufferedFileInputStream to which you pass the file is not being closed anywhere. Save it in a variable and call the method close() at some point. Better yet, use a block…
-
5
votes2
answers3404
viewsA: What systems approval techniques are available?
Homologation, in the common sense used in companies, it only means getting a confirmation from the user, an "acceptance", that the software meets what he needs. There is no standard rule or process…
-
3
votes2
answers455
viewsA: Nomenclature for radio, checkbox, select, inputs, etc
The current trend is not to use such prefixes. The reasons are several Using prefixes in field, variable and object names in general comes from an outdated technique to facilitate understanding of…
-
2
votes2
answers986
viewsA: What is the best practice for integrating external content into my website?
There is no best way. It all depends on how interconnected these sites are and how much you "trust" them. Using iframes The use of iframes, as I described in this other answer, is perfectly valid…
-
9
votes2
answers153
viewsA: How do I get a page on my site to appear on the same day in google search results?
There are some things you can do: Create a sitemap, where you can inform the structure of the site and how often each page is updated. This does not guarantee constant indexing, but gives a "hint"…
-
1
votes3
answers369
viewsA: Question about loading modules with requireJS and Angularjs
Module loading depends on how the application is configured. As the very initial documentation suggests: Developing the Loader first charges the main and then each module at the time required. After…
-
7
votes2
answers8777
viewsA: Delete Javascript and Render Lock CSS?
Resource loading optimization is something very, very complicated, depending on the state of the system and the goal you want to achieve. It’s not very clear to me your goal, that is, if you just…
-
2
votes1
answer120
viewsA: Connection to the PL/SQL database via a JAVA application. SECURITY ISO 27001
The standard way to solve this in Java EE architecture is for connections to the database or any external sources in production to be provided via application server settings such as Tomcat,…
-
4
votes1
answer505
viewsA: Definitely solve problems with strange characters in Java
Ideally you use a tool to compile your programs. It can be an IDE like Eclipse or Netbeans, where you then configure the project as UTF-8 and can still set additional compiler parameters, but that…
-
2
votes3
answers126
viewsA: Transition from Javascript Evolution to Cross Browser
You’re going the other way. Think first of the user (read: target audience) then define the technology. Want to deliver software to Ngos in remote places that have precarious equipment, slow…
-
8
votes4
answers1231
viewsA: Very interesting switch/case on Swift - What other languages support this?
Warning: this reply is a complement. Supporting certain specific types of syntax - such as this - are almost always considered low priority for several languages for some reasons, among them: Little…
-
3
votes3
answers404
viewsA: How to store static information without using a database?
For prototyping or home use (I made a tool for my own use and I don’t want to worry about quality), there is no problem in using a static file on the disk. A consistent implementation approach for…
-
0
votes1
answer89
viewsA: How to create a list with Months to change the Datatable result?
To select a month of a year, use the component Calendar. You’ll have to ignore the day, but it works. If you look at documentation will see that there is an attribute called update which can be used…
-
1
votes2
answers405
viewsA: NOT EXISTS in update?
What is not very clear in the question is that you want to prevent an update from generating a duplicate name in the table, it’s not even? The most correct way to do this is to create a unique index…
-
2
votes3
answers818
views -
1
votes1
answer96
viewsA: Difference between texts with multiple paragraphs in Mysql
With a simple query this is not possible. You could, however, implement a function or procedure to compare the texts, but do not know and did not find a text difference algorithm implemented for…
-
3
votes1
answer184
viewsA: How to modify a number of functions in Long for Biginteger?
Basically you need to divide the problem into two parts. 1. Determining whether a number is prime This is the part already solved by other issues. Based on your algorithm, a possible implementation…
-
3
votes1
answer940
viewsA: Find and open file . txt, add info and save to java
In Java 8, you can easily add content to a file using Files.write: Files.write(path, bytes, StandardOpenOption.APPEND); There is also another version where you can pass a collection of Strings, such…
-
6
votes2
answers294
viewsA: Do threads share the same memory address as an object method?
Threads by definition share the same memory space, that is, the memory of the current program. To have separate memory, you would have to create another process. This means that all objects of a…
-
1
votes1
answer123
viewsA: Log4j with multiple Jvms
On the solutions presented in the question 1) Read application file . properties... Setting up Log4j to monitor the configuration file would work and would be a good solution, provided in the…
-
1
votes2
answers119
viewsA: Access function object and use it anywhere
Its function callback should perform the necessary action with JSON and not return it. So, if you have any place on the page where you want to show an attribute, first identify the tag somehow and…
-
2
votes2
answers409
viewsA: How to avoid Noclassdeffounderror?
The mistake NoClassDefFoundError occurs when a class exists, but the ClassLoader Java cannot load or boot it properly. This can occur in several situations, for example: If you have a static boot…
-
4
votes5
answers1956
viewsA: Difference between JSON and String data
Sending Ajax to the site and returning a JSON, thus manipulating the array to use in the application. In that case, the required Javascript code will be much larger, since it contains the logic to…
-
2
votes1
answer3256
viewsA: Function . click being executed twice
This type of behavior usually occurs for two reasons: 1. Event applies to two elements in the same hierarchy Problem: You have added an event handler that applies to more than one element, one of…
-
2
votes1
answer108
viewsA: Convert tuples from different databases into a particular Java object
How to connect to the database and get its structure. Each database has at least one client software for you to access. If you have DB at your college, ask for access and tools for the service…
-
9
votes1
answer568
viewsA: Web Crawler (Spider) with ajax in JSF using Node.js or Jsoup api in java
Making Crawler of JSF applications is virtually impossible for a simple reason: JSF is stateful - in 99.9% of cases. This means that you cannot make an arbitrary request to the site, otherwise...…
-
3
votes1
answer456
viewsA: What better way to make a scattering table
A mirroring table uses some slots to store objects according to the hash, not the hash in itself. Collisions are expected, as several hashes may be stored in the same slot. One of the internal Java…
-
1
votes1
answer518
viewsA: jquery dynamic validate
Looking at the API of the plugin, there are some functions that can be used to validate fields or groups of fields individually. Among them, the one that caught my attention is the…
-
3
votes1
answer146
viewsA: Scripting language for JVM and DVM
There are many languages that can be emulated in Java, but when it comes to game portability the problem goes to another level. Some examples of difference: Not only will you run the same language,…
-
15
votes2
answers7772
viewsA: What characterizes imperative and functional programming?
Paradigm Imperative In imperative programming you take full control of what is running in the program and dictate through commands, step by step, what should be done. In this paradigm, you usually…
-
3
votes1
answer296
viewsA: Angular 2 with jQuery
Although it is the main function of Angular manipulate the page structure (DOM) according to the data (data-bindind), he does not possess in his API functionalities for calculating visual aspects.…
-
13
votes3
answers2738
viewsA: How does the browser handle infinite loop in Javascript?
There are several different scenarios that can crash your browser - not to mention the bugs. :P Lengthy execution To time consuming execution of a script can make it get blocked, but not necessarily…
-
0
votes1
answer144
viewsA: How to protect access tokens in a web application?
The "javascript" tag indicates that you must be making an AJAX request to your application. In this case, you cannot hide the data. What you can do is create an endpoint on your site to be the…
-
4
votes1
answer424
viewsA: Run Java class by passing parameters to Scanner
Writing in the child process The simplest way to solve the problem is by recovering the return of the method Runtime#exec(), who’s kind Process and then using the method Process#getOutputStream to…
-
4
votes1
answer3270
viewsA: Step by level in binary tree
Code The most straightforward and simple algorithm code I know to traverse the tree in levels is using a queue: public void walkLevels(No no) { if (no == null) throw new…
-
0
votes3
answers2915
viewsA: How to access a private attribute of a class in another class?
If the user type the port on the server, there is no way to pass it directly to the client, because it will be executed in another instance of the program, that is, another process with another JVM…
-
2
votes1
answer200
viewsA: Improvements to Entitymanegedfactory JPA
It’s an extensive and complex subject, so I’ll try some point suggestions, but it’s up to you to judge whether they would be good within the context of your project. Dependency injection An…
-
4
votes1
answer319
views -
0
votes2
answers75
viewsA: Unsatisfied dependencies - Springframewok
The original cause of the problem is in the last exception of the log: Caused by: org.hibernate.Hibernateexception: Could not obtain transaction-Synchronized Session for Current thread The injection…
-
3
votes1
answer1526
viewsA: Calculate delta value for assertEquals in Junit
The purpose of the parameter delta of that method is determine the maximum value of the difference between the numbers expected and actual so that they are considered the same value. For example,…
-
2
votes1
answer810
views -
12
votes3
answers2808
viewsA: How to block Adblock?
If your site lives on ads and does not want to allow access without them, you must first create a usage policy and inform the user. I’ve seen some sites that show a popup asking you to accept as a…
-
2
votes1
answer57
viewsA: Is there an interpreter that returns an enlarged AST?
Basically what you are wanting will hardly be supported natively since the very concept of tree is hierarchical by nature. What is your goal? Is it just to "look" and see what you want more easily?…
javascriptanswered utluiz 72,075 -
1
votes2
answers3878
views -
1
votes1
answer1076
viewsA: How to make a regular expression to validate JSF password
The first problem is that the . (point) in the sub-expressions requires that there is always a character before what one is trying to verify. It should be .* to say that there may or may not be any…
-
4
votes2
answers357
viewsA: Java Generics: Unknown wildcards and T
By convention, T is used to represent a type Parameter, or type parameter, used in declaring a generic class. As already mentioned in Jean’s reply, there is a convention for more common cases,…
-
4
votes2
answers896
viewsA: Software to create documentation without using source code
I am developing an API So what’s the problem in defining the API using classes and interfaces and documenting what each method should do? Example: /** * Esta classe deve implementar comportamentos…
-
2
votes3
answers141
viewsA: Organize object in Javascript
If I understand correctly, you don’t want elements that already appear as the parent of another element to be present as elements in the main vector, avoiding repeating elements. If that’s right,…
javascriptanswered utluiz 72,075 -
4
votes2
answers172
viewsA: What’s wrong with multi-thread implementation?
The problem nay was to wait for the threads to finish. The code does this perfectly, although not optimally, as follows: Test the first Thread and wait if it hasn’t run If it is not the last thread,…