Posts by res • 851 points
50 posts
-
1
votes1
answer35
viewsA: Sprite exchange
Are you having problems with the keys and the disposition of if..else In this first code snippet: if(!isDamaged) { else if(dir==left_dir){ g.drawImage(leftPlayer[index],…
-
0
votes1
answer50
viewsA: database connection
In the test that worked, you are not opening the connection, just loading the driver. In the main script where the error is occurring, we can say that the driver is being loaded correctly in…
-
0
votes1
answer1219
viewsA: String readline() in Java
In your class Main you have the code below, which always returns null String readLine() { return null; } This way the loop will never be accessed while(pr.readLine() != null) will always be null. To…
-
0
votes2
answers63
viewsA: Why don’t my labels show up in the swing?
When you work with null layout, you have to set the positioning of all objects. Your code is ok, you just forgot to position the label: c.setBounds(50, 50, 100, 50);
-
3
votes3
answers104
viewsA: Javascript functions sharing information?
Declare your variable outside the function, making it a global variable that can be accessed and modified from anywhere in the code. var nome = ""; function a(){ nome = prompt("digite seu nome") }…
javascriptanswered res 851 -
5
votes4
answers25119
viewsA: How to discard all commited changes?
If you didn’t git add / git commit, can simply: git checkout . or delete and clone the project again
-
2
votes1
answer131
viewsA: Find substring in recent commits messages
You can use the/shell/linux terminal grep instead. git log | grep --context=4 "TEXTO" A simple git log in conjunction with the linux grep, asking to "group" the results in 4 lines back. In my local…
-
0
votes1
answer151
viewsA: java Import video file (.mp4)
You can use the Marvin Framework to do this, it has already been made to work with media frame by frame. While running you will get images/frames in type MarvinImage, but you can convert to bytes or…
-
1
votes1
answer99
viewsA: Is it possible to change a String of a method at runtime?
You don’t necessarily need to use Reflection for this, you can create your own API. I have had to do this, with several old and unsupported jars whose source code nobody possessed, usually internal,…
-
2
votes1
answer171
viewsA: Error compiling robocode
This error even happens with 100% functional code. To resolve, go on Source Editor > Compiler > Options > Preferences The middle option, "Compiler Options" has several attributes, can…
-
3
votes2
answers1270
viewsA: Is the dot and comma character (;) allowed in filenames?
In both cases, linux and mac, only the characters / and \0 (null) are fully locked, all others can be used, although not recommended. If you create a semicolon file, or another unconventional…
-
4
votes1
answer247
viewsQ: Sonarlint, complexity of the "equals() method"
Sonarlint for Eclipse, accuses error: Refactor this method to reduce its Cognitive Complexity from 64 to the 15 allowed. Rewrite this method to reduce your cognitive complexity of 64 for 15 allowed…
-
1
votes2
answers1221
viewsA: Javascript: How to insert multiple whitespaces into a paragraph <p> element?
You can use innerHTML to be able to recognize the but will also have to increase the size in the for, because has no character, has 6... Only recognizing spaces with innerHTML,…
-
1
votes1
answer925
viewsA: How do I stop the video when I close Modal?
As the method stopVideo suggested in the comments is no longer working (it didn’t work for me, the browser accuses method not found), because probably the youtube API must have changed or something…
-
1
votes1
answer154
viewsA: HTML snippets for JSX
You first need to download the plugin that makes available the snippets HTML, Examples to download here. Then you need to set up the VS Code and/or the snippet so that it works also in other…
-
0
votes2
answers51
viewsA: Save information if user leaves page
You can use localStorage, to store some objetos/variáveis in the customer’s browser, this localStorage does not expire when the browser closes. localStorage documentation Examples to record:…
-
1
votes2
answers907
viewsA: How to save and export an object in the browser console?
In answer to the question of "Using only commands (no mouse) to save a console variable or object to a file", you can import (or paste) the code below into the console itself and can use the command…
-
0
votes3
answers1866
viewsA: Formatting date in Java web with Primefaces
Using a date of type java.util.Date, to solve only in the JSF, using <f:convertDateTime pattern="dd/MM/yyyy"/>. Example: <h:outputText value="#{lista.dtEmissao}"> <f:convertDateTime…
-
1
votes1
answer77
viewsA: Android Studio locked
I went through it too, quite recently. Every time I dragged a new component to the activity the android studio I realized that this was happening because that element was not "offline" and the…
-
1
votes1
answer64
viewsA: Make the code wait for a user input to run an action, and then ask for input again
You can use the command confirm, that works well like the alert, but the confirm will return if user clicked on OK or not, and you can put this command inside a IF..ELSE to continue only after a…
javascriptanswered res 851 -
1
votes3
answers354
viewsA: Close() method in Try and catch blocks is necessary?
You don’t need to use the close() to close a connection when it is managed by another system. It is common in large projects for connections to be managed by servidor de aplicação, or by a framework…
-
0
votes2
answers304
viewsA: Start viewing the div at the end of the Scroll
I’ll put an example here using Jquery and animação, that shows the content "rolling" as if someone is actually running the mouse scroll. The magic is on the part of jquery, and the call is :…
-
1
votes2
answers1058
viewsA: How to take the content of a Javascript variable, which is an HTML tag?
You can use the function jquery .text(), that will return the content of the element you want. Example: <html> <head> <script…
-
3
votes1
answer75
viewsQ: Sonarlint x Java GC, cancel or not object at the end of the execution?
I am passing Sonarlint in a somewhat old application and fixing several "problems", but I came across a code snippet similar to: public void fazerAlgo(final String param) { MeuObjeto m = new…
-
1
votes1
answer1536
viewsA: Generate page break report in print
To repeat information on all printed pages, it is possible to use the tag THEAD. Documentation and examples of the THEAD tag Works normal in firefox/Chrome, but to do the THEAD repeat the data also…
-
2
votes2
answers99
viewsA: How does the mini-code finder work?
Your initial code is already more or less minimized, so the Minify did not change much (formatting and names). Now for the validation: The && discontinues the validation as soon as they find…
-
0
votes1
answer30
viewsA: validation error in Protorpc
I’ve had a similar mistake, you’ll need to make a subclass of JsonModel(EndpointsModel)
-
0
votes1
answer666
viewsQ: java.lang.Classnotfoundexception sun.misc.GC
I switched to Java 10 and I am using Tomcat 8 and every time I turn on Tomcat the error happens below: SEVERE: Failed to trigger creation of the GC Daemon thread during Tomcat start to prevent…
-
-1
votes1
answer35
viewsQ: insert server_id in the creation of each registry, mysql
I have a table on mysql whose records can be created from different servers, these servers are configured as master and slave, and the id of each server has been defined as 1, 2, 3 etç. I wonder if…
-
0
votes1
answer26
viewsQ: Compiling zookeeper client on a Solaris machine, libtool error
I’m trying to compile the client zookeeper 3.4.12c on a machine solaris, below are the steps I followed. unpack source code, enter zookeeper-x.x.x/src/c folder. make a ". /configure [OPTIONS]" to…
-
4
votes1
answer50
viewsA: lock R when resizing the window
To prevent redesign during resizing, you can use dev.control("inhibit"), although while you are in inhibit status you will not be able to redraw or flush.
-
0
votes1
answer32
viewsA: Can I convert an xcodeworkspace to xcodeworkspace?
Usually this is not possible because the final file does not have the source code of your application, but you can look inside the xcarchive simply by holding the control and clicking on it, in the…
-
0
votes1
answer246
viewsA: Error while running main report - Jasper Studio
This appears to be a classpath error. The problem does not happen after the first run of the report because before running the report Jasper IDE compiles the files and puts the dependencies next to…
-
1
votes2
answers47
viewsA: How to remove a textarea element
document.getElementById("g-recaptcha-response").style.display = "block" ;
javascriptanswered res 851 -
0
votes1
answer607
viewsA: How to make a Login and password screen using JSF
You will need to identify the profile users in some way, once you are with the defined profiles, just change the targeting page. if (usuario != null) { if (usuario.getPerfil() == 1) { return…
-
1
votes1
answer265
viewsA: Shows wrong date
With the code var dName = now.getDay() +3 and var dayNr = now.getDate() +2; you nay is adding days to the date, you are first taking the current date number and then adding a value to this number,…
javascriptanswered res 851 -
2
votes1
answer368
viewsA: Character change at - sql position
Firebird has the overlay function. overlay ('00029' placing '1' from 3) Site with documentation and more examples: overlay Another example would be to oracle, where it is possible to use a expressão…
-
1
votes1
answer78
viewsA: Compress everything by SSH except a folder in Centos7
To a "one-line command" you will need to know the complete path of all directories you do not want to include in zip. Sample structure: pasta1 a.txt b.txt pasta2 c.txt d.txt pasta3 e.txt f.txt…
-
1
votes2
answers3609
viewsA: "The process cannot access the file because it is being used by another process"
Their StreamWriters are opening, uses them as variable/object and after use invokes the closing method sw.Close()
-
0
votes1
answer47
viewsA: Why don’t my elements just go 3% sideways?
I could not validate your code because part of it is not supported in my browser, so I made the code below, which is moving the objects to the left and right, 3% of the window size at a time. var sx…
-
1
votes2
answers408
viewsA: How to make 9 potentials quickly
10 to the ninth power does not seem to be the problem, the calculation is very fast. I believe that the pow is reversed, to raise a number to 9 would be the opposite, pow(9, numero), the way you are…
-
1
votes4
answers1474
viewsA: Remove text within column in MYSQL
I believe that values should change from record to record, but if it is only to delete the contents of the column, a update sem where serves. update PRODUTOS set OBS=' ' This will erase all values…
-
2
votes1
answer72
viewsA: Use the same script for multiple forms
You can invoke the form for tag, rather than rely on id, example: $("form").submit(function() { ... In this case, the same script can be copied (or imported) to multiple pages with different id…
-
0
votes1
answer373
viewsA: Remove yellow form background after autocomplete
You can use css: background-color: transparent; Or background-color: inherit; You can also try to put !important after the value, to force this property if another is running after the assignment.…
google-chromeanswered res 851 -
0
votes2
answers1023
viewsA: Open local file from browser
The "most correct" form is relative, it depends on the language you are using. For example, if you want to use Html5, you can use the code below as part of upload functionality: <input…
-
2
votes1
answer229
viewsA: Problem with iframe
There is nothing wrong with your code, the problem is the security of the server you are calling. The site "google.com" defined that it cannot be opened in iframes of other domains other than…
javascriptanswered res 851 -
0
votes1
answer81
viewsA: Reference all cells with a given string
I believe that whatever you want can be obtained with & Celula A1-> Hello Celula A2-> World Celula A3-> !!! Celula A4-> =A1&" "&A2&A3…
-
0
votes2
answers54
viewsA: Unexpected exit
You can use the command: cat arquivo.csv | sort | uniq > novoArquivo.csv
-
0
votes2
answers269
viewsA: What is the __defineSetter__ and __defineGetter__property for?
They serve to define a method that will be called when something is trying to assign a new value to the current object, or when something tries to read the value of the current object. Example. var…
-
2
votes1
answer73
viewsA: Save a Textview value and add another
Assuming that your object txtNum be a TextView, you can use the method append. txtNum.append("1"); If txtNum is an object that does not have a function append, you can always do something like x = x…