Posts by utluiz • 72,075 points
957 posts
-
0
votes2
answers536
viewsA: hide the batch input through this file
There is a issue at Soen with several possibilities. What seems to me simpler and interesting is the one you use powershell. Example: @echo off set "psCommand=powershell -Command "$pword = read-host…
-
7
votes2
answers197
viewsA: How to detect attempted intrusion?
The recommended way to access databases is by using mysqli or PDO, in accordance with documentation. In the case of mysqli, the function prepare allows the use of Prepared statements, where the…
-
1
votes1
answer622
views -
3
votes1
answer1352
viewsA: position of a tr (html <tr></tr>) in the sequence of tr’s
To add a numbering in each row using jQuery, you can do something like this: $('#t1 tbody tr').each(function(index) { $(this).find('td:first').text(index + 1); }); The first row will select all rows…
-
6
votes1
answer267
viewsA: JSF page displaying Object reference value
Such value appears because you are having print the object from the list here: <h:outputText value="#{gerarSimuladoBean.questoes}"> If the value passed to the tag <h:outputText> is not a…
-
3
votes1
answer205
viewsA: Path between nodes of a binary search tree
It’s probably an exercise, right? It’s complicated to say if something is valid without the context and the rules that can be applied in this case. The first question you should ask is whether this…
-
2
votes1
answer130
viewsA: Would Bigpipe be applicable in this case?
TL;DR Possibly the gain will be small, if there is any, because Bigpipe does not seem a suitable technique for the scenario proposed in the question. Performance is a box of surprises Not it is…
-
1
votes1
answer72
viewsA: Is it possible to reuse this complex function for multiple registrations at the same time?
The way it is, nay it seems possible to reuse the function for multiple simultaneous registrations. Some problems I can identify: Interface dependency for logic: the most serious problem from my…
-
4
votes1
answer1985
viewsA: How to insert a water mark in png
Just upload and print another image over the first. Simplified example: //após desenhar a primeira... var marcaDagua = new Image(); marcaDagua.onload = function() { ctx.drawImage(marcaDagua, 0, 0,…
-
2
votes1
answer434
viewsA: Can I save and upload text file to an iframe or openWYSIWYG?
Sorry if my answer does not go directly to the requirement of the question, but I believe that the approach is not correct. openWYSIWYG I did some research on the openWYSIWYG and it seems that the…
-
5
votes2
answers4741
viewsA: How to read a JSON file without a server?
Depending on the browser you are using, access to local resources via AJAX will be blocked even if your page is also stored in the same location. If the page was accessed through a URL, however…
-
2
votes5
answers5072
viewsA: jQuery, duplicate click event
If I understand correctly, your program loads HTML and scripts dynamically for each page you open. It should be something like a Single Page Application. Well, the first step is to understand the…
-
17
votes1
answer2610
viewsA: What is the Adapter standard?
In summary, the design pattern Adapter consists of adapting the interface of a class or object to be used otherwise, but without changing the interface or implementation. Example: persistence in…
-
6
votes1
answer1778
viewsA: How do I create a webhook in Gitlab to update a mirror repository in Github?
Understanding Web Hooks Web Hook is a method of receiving notifications of events occurring in web applications. When something happens in an application that supports Web Hooks, it requests the…
-
1
votes1
answer108
viewsA: How do you turn off all the sounds of a Webbrowser?
I do not think it is feasible to directly control the Youtube player by its language, because Flash technology runs in an isolated environment within the page. You could even do some sort of reverse…
-
4
votes2
answers718
viewsA: What is the most threads supported by Java EE?
I don’t know a problem where a large number of threads can help. You may have thousands of threads on most modern computers and even tens of thousands on more powerful servers, but that won’t help…
-
8
votes1
answer4629
viewsA: Option "keep connected" / "remember me" on login screens
How this option works (in general) Behavior may vary, but is usually associated with the client nay need to log in to the site every time the session expires or it closes the browser. This is common…
-
2
votes1
answer371
viewsA: I can run any query on SQL Server without passing credentials, is that normal?
Being a local server that is using your local user credentials, the answer is yes, this is normal. Note, however, that it is normal for a development environment used by a programmer or, at most, a…
-
5
votes1
answer401
viewsA: What is the best repository for Maven?
TD;DR There is no "best repository". Discover the official repository Each project is hosted in a repository. At most it can be mirrored in other repositories. For example, Jboss projects have their…
-
2
votes1
answer191
viewsA: Javascript - How to improve this code?
An interesting challenge, but unfortunately I’m running out of time to analyze all the code in detail and propose improvements. Beware of the competition In general, when random problems occur, such…
-
10
votes2
answers3004
viewsA: What’s the difference between using Fileinputstream and Fileoutputstream or Scanner and Printstream?
Java Input and Output To better understand how these classes work you should understand a little about the package’s Java I/O API java.io. Streams The basics of the API include abstract classes…
-
2
votes1
answer793
viewsA: Access to Database using Java
This is a common question for those who start with Java. JDBC First, understand that there is an API called JDBC which encompasses everything needed to connect to a database in Java. With rare…
-
1
votes3
answers3889
viewsA: Template and Themes for JSF/Primefaces
With JSF in newer versions the answer is yes, but with a few points. With Primefaces, which is a JSF specialization with specific themes, it gets even more complicated. Only with JSF you can take…
-
7
votes3
answers420
viewsA: java.util.Map, best implementation considering just get(Object key)
It depends on how you will popular and who will access the data the data. If the data is preloaded before use or at least there is only one thread accessing the map, then the HashMap solves the…
-
0
votes1
answer81
viewsA: Java - Testing if VLC is installed
If I understand correctly, it is possible to use a routine from the Vlcj library itself for this. The method discover class NativeDiscovery searches the native libraries libvlc and returns true if…
-
3
votes1
answer350
viewsA: Thread in Java and Nodejs
TL;DR Yes, in a highly concurrent resource-sharing environment, an asynchronous model (event-based) can have advantages over a parallel (thread-based). Yes, java can work asynchronously. Competitor…
-
1
votes1
answer727
viewsA: Show PDF on the page via Servlet
To display a PDF on the page using <object> you nay should generate the PDF when rendering the page. Just create a URL for the page that generates the PDF. Example: <object…
-
1
votes2
answers737
viewsA: Add Image in Datatables as per status
Since you have a data set in the attribute data on startup of your datatable columns, you can use the attribute render to modify the way the plugin will render each column. In this attribute, you…
-
2
votes3
answers483
viewsA: redirecting to within site
Authenticating a user directly from an email, although it is a very interesting feature from a user experience point of view, needs to be implemented with care and balance from a system security…
-
3
votes2
answers602
viewsA: Update Jlabel with regressive count
This is probably because the code runs so fast that you can only see the last value. The ideal would be to set a Timer to run every 1 second and then update the label. You can see how to use the…
-
2
votes2
answers1478
views -
1
votes1
answer948
viewsA: Where to start a system that performs an hourly task
There are several ways to solve this problem by considering a system 100% back end. Use the system scheduler Windows has a very flexible and powerful Task Scheduler. It may be simpler to configure…
-
4
votes2
answers103
viewsA: Doubt in inheritance
In fact your code returns B. But its object B has two attributes of the same name x. See below, I pasted your code here and debugging I could inspect the returned object: Unlike the methods, you nay…
-
1
votes2
answers352
viewsA: Doubt with datatable and/or JSF/JPA modeling
The problem with your approach is that you don’t have a proper data structure for the JSF component. I explain. In your system there can be 2 items on Monday, 1 on Tuesday and 3 on Wednesday, right?…
-
1
votes1
answer4217
viewsA: Calling Subreport in Main Report
You need to specify the path to the subreport from within the main report. This should be done in the subreport component, in its attribute Subreport Expression, as shown below: There you can…
jasper-reportsanswered utluiz 72,075 -
14
votes1
answer8418
viewsA: What does this anti-roboe code in Javascript do?
The original code is: function challenge() { document.cookie = 'Anti-Robot=ee2c23967cffbc6dff69153929fd8155017def99; max-age=86400; path=/'; window.location.reload() } It basically defines the…
-
2
votes1
answer1512
viewsA: Selenium/Webdriver code to run after reading spreadsheet with Apache Poi
Based on my understanding of what you want to do and some assumptions, this would be the code that meets the goal: //referência ao campo de busca WebElement searchbox =…
-
21
votes2
answers4822
viewsA: What would be the best practices for commits in Git?
Granularity of commits As I said before here, The main good practice is to try to commit one feature at a time, regardless of whether you changed one or 10 files. In this way it would be possible to…
-
3
votes1
answer524
viewsA: Call function without needing to instantiate the plugin again
The problem The problem is because you are trying to add the new functions to the objects returned by jQuery, which will soon be discarded. It is important to remember that jQuery plugins return…
-
8
votes3
answers2379
viewsA: When is the controller needed?
All web frameworks I know have Controllers, one way or another. The role of the Controller Think about the Controller as responsible for the browsing logic between pages. For example, it is he who…
-
4
votes3
answers11380
viewsA: How to copy objects in java
The most correct to create copies, duplicate or clone objects is by implementing the method clone() and the interface Clonable. This allows you to define exactly the values that will be copied and…
-
2
votes1
answer1339
viewsA: Difference between Merge() and getInstace() in JPA/Hibernate
TL;DR The merge() receives a "common" object, which is not in the persistence context, and copies the properties of this object to the true instance of the entity. Use it when you do not want to…
-
7
votes2
answers686
viewsA: Full Join N-N without repeating records
To get the expected result, what is missing is to add the condition Item Orçado = Item Comprado to the clause ON: SELECT b.OP ,Item Orçado ,NF ,Item Comprado FROM (SELECT OP ,Item Orçado FROM…
-
5
votes1
answer402
viewsA: select like over 3 million lines
Cause of poor performance Use % at the beginning of the like causes a full table scan. It prevents the DBMS from using the table index, needing to read the field completely at all times. This then…
-
3
votes2
answers130
viewsA: What is the equivalent of a functional specification for games?
I don’t have much experience in games, certainly other users can provide more valuable perspectives, but in the few that made the most important diagram was the State diagram. In a game with many…
-
1
votes1
answer655
viewsA: Grab attributes from a Thread object?
It is possible to recover information from objects normally, but you need to wait for the threads finalize the execution before attempting to do so. If you want to do it by hand, use the basic Java…
-
2
votes2
answers123
viewsA: How to separate libraries in an app suite?
I have worked in an environment similar to this, that is, each suite system needs to include other N systems to use its classes and entities. Today I see this as a problem, an architectural error, a…
-
8
votes2
answers1260
viewsA: Java future in Chrome - possible complications
Change your browser To oracle recommendation is to consider alternatives like Firefox, Internet Explorer and Safari. [...] we strongly recommend Java users consider alternatives to Chrome as soon as…
-
17
votes2
answers268
viewsA: Null attributes on an object is Bad?
In object modeling there is no right answer for all cases, but there are principles that can be applied in any situation. The scenario outlined in the question implies that the object is carrying…
-
32
votes2
answers45293
viewsA: What is a deploy?
Broadly speaking, deploy means get into position. In practice, we usually talk about providing a system for use, whether in a development environment, for testing or in production. Term overload A…