Posts by utluiz • 72,075 points
957 posts
-
15
votes2
answers4750
viewsA: What are functional interfaces?
The interfaces in Java 8 have gained many new and powerful features, such as abstract methods and default. Specifically talking about the Interfaces Funcionais, the concept is of an Interface that…
-
3
votes3
answers122
viewsA: Jquery does not return the minimum value when using Math.min( )
In addition to incorrect use of function Math.min(), there is a problem of scope. The function Math.min() takes several parameters and returns the smallest. It has no way to verify the variable that…
-
0
votes2
answers3143
viewsA: How to load a jQuery function when loading a page that uses JSF and Primefaces
Add a script to the file using the tag <h:outputScript> and normally add a Listener of the kind load jQuery: $(function() { selectAllCheckbox(); }) Alternatively, just enter the Javascript…
-
2
votes2
answers342
viewsA: Function to generate INI from Array
There is no native and stable function (at least as far as I know). When I needed to do this, I did it manually. There is a PEAR extension called Config_lite, but it’s still beta. However, one can…
-
5
votes2
answers1830
viewsA: Performance in Java repeat loops
First of all we must consider that many performance tests are wrong. Make a micribenchmark is not so simple when executing the three codes by several internal and external factors: Other programs…
-
1
votes2
answers5943
viewsA: Convert row to column
After reading your comment in Tiago’s reply, I believe the solution is very similar to yours another question. Instead of turning an "array" of values into a table to scroll through with a cursor,…
-
4
votes4
answers1172
viewsA: How to get values separated by "<BR>" in Mysql?
Replace line breaks with <br/> You can use the function REPLACE for this. Example: select REPLACE(campo,'\n','<br />') from tabela Note that I used \n as line separator, however this may…
-
13
votes6
answers11304
viewsA: How to get distance given the coordinates using SQL?
First this function in PHP is incorrect (maybe it has been adapted from a C++ version?). A fixed version is: function calcDistancia($lat1, $long1, $lat2, $long2) { $d2r = 0.017453292519943295769236;…
-
6
votes1
answer416
views -
1
votes1
answer352
viewsA: How to associate a Checkbox to a List of Objects in Spring MVC
Your code seems correct, so the problem must be elsewhere. Probably the problem is that the methods still need to be implemented equals() and hashCode in class Curso. Note that when HTML is rendered…
-
4
votes1
answer307
viewsA: PHP code refactoring to provide image with specific size
Although there may be some specific optimization that can be done in the image resizing algorithm, I believe that the correct output for your problem is to cache images of different sizes at the…
-
2
votes2
answers182
viewsA: Animation namespaces in jQuery
It is possible to make independent animations both by attributes and by plugins using the queues jQuery effects functions, such as animate() and stop(). Specifying a queue in the animation options,…
-
2
votes2
answers210
viewsA: I’m having trouble using the clearInterval function
Another option is not to try to create variables with dynamic names, but to use a map type for this. Example: var intervalos = []; intervalos['a_103'] = setInterval(function(){ console.log('oi'); },…
javascriptanswered utluiz 72,075 -
2
votes5
answers6608
viewsA: Capture dates of a text using regular expression in javascript
A regular expression to retrieve dates in the formed dd/mm/aaaa is \d{2}\/\d{2}\/\d{4}. In javascript, you can create the regular expression and then use the function exec to iterate on the items…
-
3
votes1
answer2098
viewsA: Insert SQL Server records via ftp file.txt
Initial recommendation First of all, I would recommend creating a separate process to do this. Could be a script in Shellscript, Python, PHP or a similar language executed in a scheduled manner by…
-
3
votes1
answer1180
viewsA: Syntaxerror: can’t assign to Operator
I don’t understand exactly what you want to do with this chunk of code, but the error occurs because of a Augmented assignment statement (increased assignment statement?) in an expression. If I have…
-
3
votes6
answers5531
viewsA: Why use Javascript if there are so many other technologies to generate dynamic content?
I understand that the question does not specifically concern the Javascript language but rather the concept of running a language in the client, specifically in a web browser. In this sense, it…
-
3
votes3
answers640
viewsA: What is the use of nested blocks in Java?
Java blocks have multiple applications Body of classes and methods Class: class C { ... } Method: void m() { ... } Implementations inline: Runnable r = new Runnable() { public void run() { ... } };…
-
3
votes2
answers462
viewsA: How to make "new" notification equal to Gmail?
Interesting question. I made an example using jQuery and Javascript. The first step is a function that traverses items that are potentially new and adds the marker when needed: //marca itens novos…
-
2
votes1
answer3836
viewsA: PLS-00103 error when trying to compile a Package
Packages in Oracle are divided into specification (Specification) and implementation (body). The implementation of procedures and functions, in addition to variable statements, must be done using…
-
7
votes1
answer934
viewsA: Events jQuery runs automatically
When declaring a function, a reference to it with its name is created. See the following example, slightly modified to "distrust" the names: function teste(param){ console.log(param); }…
-
5
votes2
answers8798
viewsA: How to install Java EE perspective in Eclipse?
There is not only one IDE First, there are other good IDE options for Java development, the best known being Netbeans and Intellij. But don’t be afraid of the Eclipse. Suitable version of Eclipse…
-
12
votes2
answers20732
viewsA: Static search list using Javascript instead of PHP
It is not necessary to have any technology on the server. It is perfectly possible to do a simple search with Javascript. Search only with jQuery I made an example using jQuery. The first thing is…
-
3
votes1
answer2169
viewsA: How to know the execution order of the JSF component methods
If I understand correctly, you want to better understand the sequence of events between the presentation layer (Javascript) and the controllers (Managed Beans). This post Prime Faces' blog explains…
-
1
votes2
answers1451
viewsA: Virtual machine created on X computer does not work with Y computer
I noticed the guest system (guest) is 64 bits. I’ve been through two similar situations because of this question. First, make sure the two host systems (hosts) are 64 bits. There are some…
-
9
votes2
answers3276
viewsA: How to make a Stored Procedure dynamic by taking data from other tables in the database?
Cursors are really a powerful resource (see Tiago César Oliveira’s response). On the other hand, they are also too slow for certain types of operations. I have worked a lot with optimization of…
-
90
votes3
answers25811
viewsA: What are the differences between Git, SVN and CVS?
First we can classify the three tools into two major categories: Centralized Versioning Systems CVS and SVN have a central repository where users do the checkout and commit of versioned artifacts.…
-
4
votes4
answers1082
viewsA: How to verify that the properties of the window object are native?
To restore a native function, we can use the delete. Example: delete window.alert; So, by applying this to a function that deletes and restores the initial value, we can verify that the function is…
-
3
votes4
answers1193
viewsA: Color loop in text
Without changing the vector, it is possible to create an auxiliary variable to inform the initial color of the vector where each loop will start. This variable is incremented once each execution of…
-
2
votes1
answer274
viewsA: How to make it load the full Welcome-file url
The configuration welcome-file does not serve to make redirects. The idea is: when a user accesses an unmapped directory of your application, the web container will search that directory for files…
-
3
votes2
answers787
viewsA: How to build a complete XML in T-SQL?
Based on the question example, I made a code that turns a result into a similar XML: SELECT ( SELECT nome, ( SELECT tipo AS 'item/@tipo', descricao as 'item' FROM item WHERE item.pessoa = pessoa.id…
-
5
votes2
answers6704
views -
11
votes2
answers29759
viewsA: Change the "collation" and "Character set" of the database, tables and corresponding columns
I believe there is not a native command that does everything, it is possible to create a query that does the work in its place. Tables Generating the necessary queries for each table: SELECT CONCAT(…
-
2
votes1
answer77
viewsA: What is the difference between the Requirejs PATHS and MAP properties
According to the documentation: The estate paths allows you to map modules that are to other locations than the URL basis of the script. One of the uses indicated in documentation is for fallback,…
-
5
votes3
answers1689
viewsA: How to read file passing part of the name in Java
Using the Java API Create an object File pointing to the directory and itere over the files checks if they have the desired pattern. Iteration implementation can be done with the method…
-
2
votes3
answers740
viewsA: Is sending data to the same form a good method?
I believe this is a good method. From the point of view functional, there is no problem in leaving the key F5 resend login data in case authentication fails. The operation is idempotent. However,…
-
2
votes1
answer703
viewsA: Picking up Timeinmillis and using Timestamp
You must be importing the Timestamp incorrect, as this constructor has always existed. Check the import, the correct is java.sql.Timestamp. About getting time in milliseconds,…
-
4
votes3
answers380
viewsA: What is the importance of certification?
Certificate value: On the market: can help in a selection of curriculum by an HR, but virtually nothing in the technical sieve. For whoever took it memorizing the responses from those websites that…
-
23
votes7
answers14277
viewsA: What can C++ do that C# can’t?
C++ allows for: multiple inheritance against interfaces in C#. manual memory management against GC in C#. templates against Generics in C#. inline Assembly. Ability to explicitly displace an object…
-
11
votes3
answers2226
viewsA: Performance: string "concatenated" or all in the same line?
The best is always to keep in a String that is unique at compile time than at runtime. And, believe it or not, in C# it is possible to use line breaks in a single String using the character @…
-
11
votes2
answers14796
viewsA: Turn Byte into String
Returned [@549498794 because the method toString of a array just use the toString class standard Object. To convert an array of bytes to String it is possible to use the class constructor String…
-
1
votes1
answer577
views -
7
votes2
answers33949
views -
3
votes5
answers2014
viewsA: Disable a Ubmit and Enable only when radio minimum Buttons is selected
It is possible to traverse the radios marked and count how many have. Take the example: $('input').change(function() { //habilita/desabilita botão $('button').prop('disabled',…
-
5
votes1
answer435
viewsA: Using BASE64 in Java
Since Java 6, you can use static methods printBase64Binary and parseBase64Binary class DatatypeConverter. Take an example: String base64 = DatatypeConverter.printBase64Binary("Blá =…
-
1
votes1
answer822
viewsA: Error while trying to consume an Axis Web Service
Groping in the dark, I see the following possibilities: A "hidden" error in the exception. There are no other exception stacks before they can give clues about the true cause of the error? Incorrect…
-
4
votes3
answers8147
viewsA: How to fix javascript encoding problem?
When this occurs: Open the file in Notepad++ and convert to UTF-8 I make sure the page has the header <meta charset="utf-8">. Solves in 90% of cases.…
javascriptanswered utluiz 72,075 -
1
votes3
answers1702
viewsA: Is encapsulating the properties file in a class a good practice?
In general it seems to me a good practice to settings, excluding other types of values such as internationalisation texts or lists of values. The main reason for this statement is because more…
-
1
votes1
answer785
viewsA: jQuery Masked Input - Is it possible to recover the mask attached to the field?
Looking at the source code it seems that the value passed by parameter to the function mask is not stored anywhere. What you can do by inspecting the code is to see if the field has a mask by…
-
4
votes5
answers61683
viewsA: Using line break " n" in Java
This question already has some very interesting answers, but I understand that the question is not about how to use the line break but about the possible problems. Well, I’ll name two I’ve been…