Posts by Renan Gomes • 19,011 points
435 posts
-
3
votes3
answers4380
viewsA: Html + Css FAQ creation
You can use the same technique of that answer and create an effect of "toggle" only with HTML and CSS: .question { border-bottom: 1px solid #ccc; padding: 10px 0 } .question input, .question .answer…
-
7
votes3
answers368
viewsA: How to align the text in front of another element?
The alignment issue, can have a single element (a paragraph, for example) and use pseudo elements to create those dots with the number in front: .steps p { counter-increment: items /* contador de…
cssanswered Renan Gomes 19,011 -
2
votes2
answers996
viewsA: Display the contents of Object Nodelist
Can make a simple loop to get the content: var titulos = document.querySelectorAll(".p2.p2-resultado-busca"); var content = ''; for(var i = 0; i < titulos.length; i++) content +=…
javascriptanswered Renan Gomes 19,011 -
2
votes1
answer946
viewsA: How to change the value of an object in python . json
Changing the value by key. Example: import json j = json.loads('{"Nome": "Fulano", "Idade": "23"}') j['Idade'] = '12' IDEONE…
-
1
votes1
answer70
viewsA: Mixin in LESS for the CSS "Calc()" function, how to use two variables?
Use variable interpolation. Example: .calcW(@valor1: 100%, @valor2: 100px){ width: calc(~'@{valor1} - ' @valor2) } or directly: .calcW(@valor1: 100%, @valor2: 100px){ width: ~'calc(@{valor1} -…
lessanswered Renan Gomes 19,011 -
1
votes1
answer151
viewsA: xml error Annotation
There’s an extra quotation mark: <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"" />
-
2
votes3
answers1870
viewsA: Assign value to variable in method declaration
How you are using an object as parameter, the class Optional can be useful to check if the value is null (and if so, use a "default value"): public void teste(Boolean b){ b =…
javaanswered Renan Gomes 19,011 -
6
votes2
answers421
viewsA: Group css selectors to reuse code
An alternative is to use the :not(): .tipoPokemon span { color: red; text-transform: uppercase; font-weight: bold; font-style: italic; } .tipoPokemon span:not(#fire) { color: blue } <div…
-
4
votes4
answers2059
viewsA: How to Verify the existence of an Id in a document via Jquery?
Use $(seletor).length to verify the amount of elements that give match according to the selector. A id is unique per document, so the value obtained by calling length may only be: 1 in case the…
-
2
votes2
answers636
viewsA: How to create a folder named after the current date
Can use LocalDate#now().toString() which returns the current date in format yyyy-mm-dd: final String directory = LocalDate.now().toString(); Files.createDirectory(Paths.get("C:", directory)); //…
-
4
votes1
answer55
viewsA: Apply size to a textarea, unless it has the attribute "Rows"
use the not to make a selection by the textarea that does not have the attribute rows: .wm-form textarea { resize: vertical; border-radius:4px; border:1px solid #ccc; width:100% } .wm-form…
-
1
votes1
answer71
viewsA: JSP Two boxes after the comma
Can use minFractionDigits and maxFractionDigits - reference. <fmt:formatNumber minFractionDigits="2" maxFractionDigits="2" value="${media / total}"/>…
-
8
votes2
answers21331
viewsA: How to make a "back to top" button on a page?
The best way will depend on your needs. In addition to the form presented by Mauro, you can use only html pointed to the href link to the page snippet at the top: <span id='topo'></span>…
-
4
votes2
answers1961
viewsA: Practical example List and Arraylist
Probably the problem is import incorrect. You must be importing the class List graphical user interface package. Just switch: import java.awt.List; For: import java.util.List; Your code will work…
-
3
votes4
answers4799
viewsA: How to turn a rectangular image into a circle (without distorting it)
There are several ways to do it, like virtually everything that involves html and css. The problem in your case is that your image does not have the same height and width value, but you force it to…
-
1
votes2
answers578
viewsA: Working with two txt files
To get all lines from a file, use Files#readAllLines: List<String> linhas = Files.readAllLines(Paths.get("C:/foo.txt")); To get an array containing string items separated by whitespace, use…
javaanswered Renan Gomes 19,011 -
3
votes1
answer951
viewsA: How to trigger a function when clicking a radio type input?
If you want something to happen when you click on input, use the event onclick in place of onkeyup: function mudaDePagina(){ location.href = 'http://answall.com'; } <input type='radio'…
-
2
votes2
answers1368
viewsA: Change color of input color
Waiting for the event input in the text field. Just take the value of the text input and apply as color field value: (function(){ var text = document.querySelector('input[type=text]'), color =…
-
1
votes2
answers117
viewsA: httpget + URI + Httpclient libraries discontinued. How to update code?
You can use the class Scanner together with a stupid technique to use the delimiter \A to obtain all the contents of a data entry. From the words of the author of the above article: Remember that…
-
2
votes1
answer1370
viewsA: Limit the number of characters in a select HTML/CSS/JS field
You can use Javascript for this: (function(){ var selects = document.querySelectorAll('[data-limit]'); // percorre a lista de selects [].forEach.call(selects, function(select){ var limit =…
-
3
votes4
answers354
viewsA: How to put Nextel mask in an <input> with Javascript?
You can put three numeric type fields side by side, it may not be the best solution but it is still an alternative. Through the attributes min and max you can control how many digits the field can…
-
4
votes2
answers6328
viewsA: How to view HTML code?
As an alternative the solution to escape/replace the characters can be used <textarea> to display the code. Just use the property readonly and remove the edges of the element: textarea {…
-
4
votes1
answer620
viewsA: How to use foreach to print information from an object array? (Java)
Probably, when you run this code, the output is something like this: Funcionario@28d93b30 This has nothing to do with loop, and, it occurs because you are printing an object, not primitive types as…
javaanswered Renan Gomes 19,011 -
5
votes3
answers4210
viewsA: Send form without using PHP or similar
You can use the formspree. No registration, no programming required back/front end. Just set some parameters in the form: <form action="https://formspree.io/[email protected]" method="POST">…
-
11
votes3
answers10028
viewsA: How to display input type range value
The event you need to use is the input. Just wait for it to occur and then recover the value of the attribute value of your crease: var $range = document.querySelector('input'), $value =…
htmlanswered Renan Gomes 19,011 -
21
votes2
answers4131
viewsQ: How can Whatsapp insert Emojis into the URL?
If you search for "Whatsapp" in Google, the result is this: Apparently this "" in the url is a feature that makes the internationalization of the web application. After accessing this page, the…
urlasked Renan Gomes 19,011 -
8
votes1
answer106
viewsA: How to Detect DOM and API Resources
Use the operator in to check if a certain property exists in the object, for example: if('querySelector' in document){ alert("Suporta 'querySelector()'."); } if('classList' in…
-
4
votes3
answers441
viewsA: How to concatenate string with null without explicitly checking?
It is ensured that a has a value and only b can come null, can follow what was answered by Maniero. If you are unsure and/or need to test a larger number of strings, it may be more interesting to…
-
2
votes1
answer159
viewsA: How to capture the text of nested Ivs in an elegant way?
I can’t test Zeroclipboard because I don’t have Flash on my computer, but I will risk an answer since the doubt is more related to text capture and manipulation than the library itself. How this…
-
2
votes1
answer66
viewsA: Netbeans, customisable default code
Yes, you can modify the template standard that Netbeans makes available to any file. In the top bar, click "Tools" and then "Templates". Select the template package you’d like to modify (in your…
-
1
votes2
answers971
viewsA: Read files in reverse way
Files#readAllLines returns a list of all the lines in the file. Then you can use Collections.reverse to reverse the order of that list: List<String> linhas =…
javaanswered Renan Gomes 19,011 -
3
votes2
answers78
viewsA: How to Style a Video Duration in Screenshot
The secret is to leave Dad with position: relative and the child with absolute position, so the child element will be positioned relative to the parent (if the parent has the set positioning). There…
-
2
votes1
answer1541
viewsA: How to check if there is a data in Storage
store#get() returns the value of the respective key, if it exists, otherwise this value will be Undefined. Then you can use it to check if there is something set to a certain key:…
html5answered Renan Gomes 19,011 -
0
votes1
answer87
viewsA: Webapp Doubt - Netbeans Javafx
Just remove the lines that add the elements to the WebViewPane. Since you will no longer use these controls, it makes no sense to keep the snippets where the instances are created and the events are…
-
3
votes1
answer248
viewsA: Change HREF of a link if the url does not meet some requirements
You can take the element with .page.smaller:not([href*=page]). This will bring all the elements that have the classes page and smaller where the href attribute does not contain the sequence "page":…
-
5
votes1
answer2732
viewsA: How to hide a modal window after a while?
In the bootstrap documentation, to hide the modal manually just call the function modal passing as argument the value hide, for example: $('.minha-modal').modal('hide');. To perform something after…
-
4
votes1
answer452
viewsA: How to change Google Maps theme?
Remove the property disableDefaultUI: true because she is responsible for disabling the functions she mentioned: the street view with zoom control on the side of the map. And as for the theme, it is…
-
6
votes6
answers201
viewsA: How to remove 2 digits from each item in the list?
I’m guessing you own one array of String and that is seeking to get the first two characters. You didn’t mention whether they should have whole type on the second list, so I’m considering that the…
-
1
votes1
answer172
viewsA: Validate blank fields
Check the values before persisting the information: boolean isInserted = false; String nome = editNome.getText(); String veiculo = editVeiculo.getText(); if(nome != null && veiculo != null…
-
7
votes2
answers534
viewsQ: Is it possible to change the value of an annotation at runtime?
Considering the following annotation: @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface MinhaAnotacao { String valor(); } Defined in a class: @MinhaAnotacao(valor =…
-
3
votes3
answers950
viewsA: system.out.println(""); syntax error
You’re calling the method in the body of class, so the alert. Call System.out.println(""); within some method or constructor of its class Cadastro.
javaanswered Renan Gomes 19,011 -
2
votes1
answer830
viewsQ: How do I stop tracking changes to a file after the commit?
I have a file .properties already committed and would like to stop tracking the changes made to it. Each user who clone the project will configure it in their own way. I tried that command: git rm…
gitasked Renan Gomes 19,011 -
4
votes3
answers1182
viewsA: How do you hide a div when it’s empty?
If I understand your question, you can only use css to solve this issue. It is possible to define specific rules for an element when it is empty through the pseudo-class :empty: div { border : 2px…
-
3
votes1
answer605
viewsA: error Uncaught Syntaxerror: Missing) after argument list
It is on account of this stretch in the function resizeFix where you have <= in the code: if ($(window).width() <= mediasize) { cssmenu.find('ul').hide().removeClass('open'); } The…
-
5
votes2
answers989
viewsA: Problems comparing dates with Calendar
I think this is what you’re looking for: private boolean verificaData(Calendar dataReserva, Calendar dataEntrada, Calendar dataSaida){ return (dataEntrada.equals(dataReserva) ||…
-
4
votes1
answer1339
viewsQ: How to get attribute of a generic type object?
I’m having difficulties p/ retrieve an object to get a specific attribute. I want to overwrite the method Equals in my class, to compare whether the title of objects are identical. In this case, it…
-
8
votes2
answers2113
viewsQ: How to create methods on an Enum?
I have an application in Java and am porting it to C#. I have a question regarding enum that seems to work differently from Java. After asking a question here on the site (Enumerations may contain…
-
1
votes2
answers81
viewsA: How to use the LESS "when" operator?
The name of this resource is guarded mixins, and serves to test expressions, similar to the existing conditional structures in various languages. However, instead of if/else, Less does this with the…
-
3
votes3
answers1738
viewsA: Is it possible to test only specific classes?
The method or class of test to be ignored with @Ignore: // Ignorando todos os testes na classe 'A': @Ignore class A { @Test public void testaAlgo(){ // ... } } Optionally, you can specify why you…
-
2
votes2
answers3920
viewsA: Website is not getting responsive with Bootstrap
You need to specify the metatag viewport: <meta name="viewport" content="width=device-width, initial-scale=1"> template…