Posts by utluiz • 72,075 points
957 posts
-
3
votes2
answers691
viewsA: What is the best way to query SQL Server database using a list as input?
Let’s look at some possibilities, including the ones you mentioned. Block Reading Split items into blocks of equal size and execute queries using the IN until you read all the items. Upside: read…
-
3
votes4
answers964
viewsA: How to do advanced data filtering across multiple fields?
The query below does exactly what is proposed in the statement: SELECT * FROM USER WHERE (USER_ID = 29 OR USER_ID IS NULL) AND (USER_GROUP = 'ADMIN' OR IFNULL(USER_GROUP, '') = '') AND…
-
3
votes2
answers89
viewsA: How to find a value in several fields
If it’s an inaccurate search, that is, for numbers that contain a chunk of the phone, you can do so: WHERE telefone1 like '%123%' OR telefone2 like '%123%' OR telefone3 like '%123%' Being 123 the…
-
1
votes2
answers1501
viewsA: Error - HTTP Status 404
You are trying to access the application root lifeway. For log, the liferay.war is successfully loaded. However, there seems to be something wrong with this WAR, because the boot time of 156…
-
2
votes1
answer961
viewsA: I need to change only half the records of a Mysql table
An alternative is to mount the query to a text variable and run it dynamically with the command EXECUTE. Example: EXECUTE 'UPDATE tabelaemailsimportados ' || ' SET IDLista=CodigoNovaLista WHERE…
-
1
votes2
answers6415
viewsA: How to pass object to another view in JSF?
The scope of View (View Scope) is discarded whenever a navigation occurs from one screen to another. An alternative is to store the object in the Session scope (Session Scope). It is also possible…
-
12
votes2
answers189
viewsA: Are libraries downloaded multiple times?
In general, browsers do cache. Eventually they check for changes and download the file again, but most of the time you don’t have to worry so much about the performance. If you want to change the…
-
2
votes1
answer392
viewsA: Vagrant with PHP + Mysql + Linux + Puphpet + ZF2 very slow
Vagrant admittedly has some performance issues, the most common being related to file synchronization. To documentation of Vagrant provides alternatives to remedy the problem using NFS. isiso only…
-
0
votes2
answers1106
viewsA: org.openqa.Selenium.Elementnotvisibleexception: Element is not Currently Visible and so may not be interacted with Command Duration or timeout
In my experiments with Selenium I also got random errors, including with the exception ElementNotVisibleException. In general this was due to the way the Web Driver interacts with the browser,…
-
3
votes1
answer518
viewsA: Design structure
As to the first doubt, the default Java EE architecture is for the application to declare in web.xml what Datasources it depends on and the configuration is performed on the application server at…
-
4
votes2
answers1415
viewsA: How to authenticate a user via HTTP request?
The "right" way to do this would be to use a web service that returns only the necessary data. However, in a brief search on the site and in the documentation of Vbulletin I did not find a reference…
-
6
votes2
answers1012
viewsA: Does using a virtual keyboard help security?
A virtual keyboard could be considered one of the elements that make up an arsenal necessary to increase the level of security of a solution. It can at least rid the user of a category of…
-
2
votes1
answer1279
viewsA: Problems with Tomcat 7
The Tomcat server can function normally, including several applications installed on it, but your application is not initialized. When Tomcat boots, it deploys all the configured applications one by…
-
4
votes2
answers458
viewsA: How do I move the A context session to B context within Tomcat 05
This is a bit of a long topic, but basically you need to set up session replication as described in tomcat documentation. The most basic step, according to the documentation, is to add the…
-
3
votes1
answer1207
viewsA: How to check if a link still exists and if it can be opened in an iframe
The simplest and straightforward way to test if a URL is "working" is to make a request and check the returned HTTP status. Anything other than 200, as an error 400 (not found) or 500 (server…
-
8
votes2
answers12630
viewsA: How does Java Builder Heritage work?
Don’t mix things up You should not pass anything to the parent-class constructor. This is not so much to do with object orientation. If the parent class gets a nome and a dataNasc then the daughter…
-
1
votes1
answer2885
viewsA: Java 8 - Collecting elements from a list
Because the list doesn’t change The method peek returns the same original list which in this case remains unchanged because its lambda function does not alter the elements. The excerpt (Object[] e)…
-
1
votes2
answers1063
viewsA: Left John returning more records
There may be no records in the table info for all table records principal, but still this 5,000 records will show up, because the left join is actually a left outer join. There is no left inner join…
-
3
votes1
answer181
viewsA: Java class for Builder and dependency management
It is perfectly possible to do this with Java, examples are Ant and Maven. Ant Ant is a library for builds configured generally from Xmls, but nothing prevents us from running Tasks directly via…
-
3
votes4
answers274
viewsA: Problem checking prime numbers
The reason the code doesn’t work is explained very well in the answer from @Maniero. However, there are some additional details that can be improved: It is not necessary to divide the number being…
-
2
votes2
answers3756
viewsA: How to save the path of an image in the Database?
Saving the whole way To save in a database you must save the way as a String. Obviously your code that reads and writes the records can encapsulate this String into a File for example, recovering…
-
8
votes3
answers736
viewsA: What kind of treatment can be performed in this case?
I would like to see an example of an appropriate treatment for this exception in this case. It depends a lot on the type of system. If it is desktop, you can show a dialog box with the error…
-
11
votes1
answer159
viewsA: What can be done to improve the performance of a very large CSS (384KB)
A number of styles like this should fit into one or more of the following categories... Attribute redundancy There may be many repeated attributes in several classes. For example, imagine that you…
-
6
votes2
answers841
viewsA: What is the practical applicability of the super word in Ruby?
There are many situations where it is necessary to extend certain functionality of an existing class. There may be several specializations of a certain behavior. Of course, this can be done simply…
-
2
votes1
answer1670
viewsA: Passing parameters to the postgresSQL
A very simple function that copies data from one table to another in Postgresql can be implemented as follows: CREATE OR REPLACE FUNCTION copiartabela(IN source VARCHAR, IN target VARCHAR) RETURNS…
-
3
votes1
answer287
viewsA: Working with Canvas - No Edge
The edge is drawn by the function rect, then you just use the function fillRect in the first part of the code. In addition, I adjusted his example a little to generate a Cartesian plan centered in…
-
3
votes1
answer702
viewsA: How to properly reuse business rules using Ejbs?
Basically, the two questions linked by @bfavaretto would already answer your question regarding class modeling. They are: It is right to give greater preference to composition than inheritance? It…
-
0
votes2
answers1101
viewsA: Remove association in relation to Many to Many
It is possible to execute a delete or even update by means of the JPQL method createQuery of EntityManager. Example (source): Query query = em.createQuery( "DELETE FROM EntidadeAssociacao t WHERE…
-
2
votes1
answer2128
viewsA: Error: "Lock Wait timeout exceeded; Try restarting transaction"
As @Victor mentioned, there may be "stuck" transactions (ghosts) that lock the entire table. A possible cause of this is a critical code problem: missing treat errors. In the event of any failure in…
-
14
votes3
answers17342
viewsA: How to use more than one separation character in the split() method?
Solution with \W In regular expressions implemented in Java, as per class documentation Pattern, there is a character class \w (minuscule), which represents the characters that form the word. It…
-
1
votes1
answer568
viewsA: Problem creating custom Components in JSF
Custom components I made an implementation some time ago and managed to do it as follows: I put my components in the directory src/main/webapp/resources/component-base/. Note that the project…
-
4
votes1
answer413
viewsA: Move graphic SVG objects
With some positioning adjustments in the graph, I made a simple implementation using pure Javascript, allowing drag and drop the vertices and making the line follow this movement. See the…
-
3
votes1
answer728
viewsA: Error inserting Apostrophe in component using Auto Complete
The problem is because you are trying to generate Json from String concatenations, and the moment you concatenate a String containing simple quotes the Json breaks. For example: { 'prefixText':…
-
2
votes1
answer1026
viewsA: Input Date causes error 400 - The request sent by the client was syntactically incorrect
Source of the problem This type of error is characteristic of Spring MVC and occurs when it fails to do the Binding any request data for some parameter or model. In this case, it is because Spring…
-
1
votes1
answer819
viewsA: Error importing project in eclipse
I don’t usually develop for Android, but I’ll try to help. I first noticed the attribute parent of your code does not have the prefix @style. See how it’s in documentation: <style…
-
2
votes1
answer109
viewsA: What is the reason for the delay of the first consultation with Amazon RDS?
A possible cause for this is you have an expired connection pool (timeout) after the long period. Then, when a request arrives, your application, framework or server takes 20 seconds to detect the…
-
-1
votes1
answer106
viewsA: Problems in JSP implementation using Struts2
In Struts tags, expressions are delimited by a percentage: %{...}. Different from JSTL tags that use the dollar sign: ${...}. Try to do this in your example: <s:param name="myFriend"…
-
2
votes2
answers407
viewsA: How to use Mysql view’s with Spring Data and eclipselink
It is possible to map a view as a common table using @Entity and @Table no difficulties. I’ve done this a few times using Hibernate. Just be careful not to use DDL generation, otherwise Eclipselink…
-
8
votes2
answers160
viewsA: How do these sites load your HTML?
Dynamically built interface What you’re seeing are sites whose interfaces are built entirely or partially via Javascript, i.e., code that runs in your browser. Usually you get a very basic HTML when…
-
1
votes2
answers624
viewsA: Initializing instance variables in Activerecord
As far as I know there is no other recommendable way, except by using the after_initialize. The initialize original class may not be invoked in some cases by Activerecord, then. o after_initialize…
-
2
votes2
answers847
viewsA: Changing index.jsp dynamically without reloading the page
There are at least three main ways to change the content of a frame or iframe. Change the attribute src javascript Imagine you have a frame like this: <iframe id="frame"…
-
1
votes1
answer1177
viewsA: How to get a value from a list
First, don’t use the attribute id in repeating elements. In this case, it is best to use a specific value in the attribute class as you have done in the other elements. Then, you should pass to your…
-
3
votes1
answer564
viewsA: How does a Dependency Injection Framework work? Are they useful in Ruby?
TL;DR No language accurate of a framework for Dependency Injection (DI - Dependency Injection). A framework is only interesting when it saves your work. No one accurate of a framework According to…
-
2
votes2
answers106
viewsA: Object Variable type and Expressions
If you are able to generate the sequence of comma values at the beginning of the end, you can use the function CHARINDEX to locate the number. Example: SELECT * FROM table WHERE CHARINDEX( ',54,' ,…
-
5
votes1
answer334
viewsA: How to create code to license monthly my customers?
Regardless of the language or platform, locally installed programs with a license for use can never have complete security against misuse. This even applies to extremely complex software written in…
-
2
votes1
answer1825
viewsA: Allow a user to view stored procedures created by other users
You need to give permission (or privilege) EXECUTE for both users, about the procedures each other’s. The command GRANT can be executed in a way to give permissions to execute any routines of a…
-
2
votes1
answer37
viewsA: How to apply a setNull(index,Types.Blob)?
From what I understand, imagemCabecalho is the path to a file. Therefore, the code may not work because you have a path, but the file does not exist. It would be interesting to check this, perhaps…
-
2
votes2
answers649
views -
1
votes1
answer478
viewsA: Error org.hibernate.Lazyinitializationexception how to resolve?
First of all, if you always use accesses all object attributes, you should use the mode ager and not Lazy. However, the problem may have its cause in the fact that, in certain circumstances,…
-
4
votes3
answers10114
viewsA: Which JSON structure to use for large data volume without loss of performance?
For high-performance systems that need data exchange through a recognized yet flexible protocol, JSON is not the best solution. Note that I am not talking about a web system that accesses server…