Posts by Renan Gomes • 19,011 points
435 posts
-
65
votes4
answers62720
viewsA: How to style a "file" input?
Many of the tutorials found on the Internet suggest the technique of fake div, in which the file selector is hidden with a display:none and then a div with the look you’d like. The downside is that…
-
1
votes1
answer216
viewsA: Problems with api restfull
Keep in mind that the classes in this package make no requests. They do the parse from some source (String, Map, ...) and allow you to manipulate the object as a JSON. Your code launches a…
-
3
votes1
answer75
viewsA: The program skips a line of code ahead
To call the getline after a cin >> ... you need to clean the buffer to remove the character of the new line that stood at the moment you pressed enter. You can use a cin.ignore() for that…
c++answered Renan Gomes 19,011 -
1
votes2
answers296
viewsA: How to run "setInterval" without initial delay?
You can create a function with the code of that request and call it before you put it on setInterval. $(function () { function getContadorMapa() { $.get("includes/principal/contador_mapa.php",…
-
2
votes2
answers1293
viewsA: Button for cell phone call
You can use the URL schema whatsapp:// in the attribute href of a hyperlink followed by the message that will be shared. For example: <a href='whatsapp://send?text=testando 1 2 3'>Compartilhar…
-
1
votes3
answers2663
viewsA: How to copy to clipboard without using flash?
You can use the clipboardJS, this has no dependencies and does not require Flash technology. The only problem is the support, according to README Apis are used selection and document#execCommand and…
-
0
votes2
answers82
viewsA: Add additional column in row
This kind of question falls almost as opinionated. I would do with flexbox. Depending on which browsers you want to give support, you can choose to use this property as well. .wrapper { position:…
-
2
votes2
answers235
viewsA: How to Leave Element LI 100%
height: 100% needs a reference to be calculated. Consider the example: .x { height: 100%; background: red } <body> <div class='x'>StackOverflow</div> </body> Does it work?…
-
1
votes1
answer380
viewsA: How to turn off the webcam using the Saycheese plugin?
The function is to .stop(): $('#closeWebcam, #modal-voltar').on('click', function(){ sayCheese.stop(); });…
-
1
votes4
answers5288
viewsA: Problem with Javascript Image Exchange for User Interaction
I believe the problem is caused by mousemove after clicking on the image, as pointed out by Fabricio. An alternative is to use CSS to toggle the images of the lamp on/off with the basic event of…
-
5
votes2
answers709
viewsA: Jsonarray in Jsonobject: Json.typeMistach error
You get a JSONArray, just need to travel it accessing each index (which is a JSONObject): private static void parseJson(String data){ try { JSONArray array = new JSONArray(data); // Percorrendo cada…
-
2
votes2
answers186
viewsA: Is it possible to switch between Jdks in Netbeans working on a Maven web project?
You are unable to switch between platforms because there is probably only one set in the IDE settings. The @Diegofelipe suggested a way to resolve, but in addition it is possible to include and/or…
-
1
votes1
answer496
viewsA: How to use "drawRect" to draw on a component?
The problem is that if you need to change the way a component is being designed, you need to reset the method paintComponent. getGraphics will return you an object Graphics where, any change made…
-
2
votes1
answer562
viewsA: Facebook login on desktop applications
There is the Scribe which serves to treat such authentication. In the README project supports Facebook and other networks using the same type of authentication protocol: Oauth. Perhaps you will…
-
0
votes2
answers462
viewsA: How to remove the text border in a component?
Define Component#setFocusable() with false causes this border around the text to be removed. In fact this is indicative that the component is in focus. JButton foo = new JButton();…
-
0
votes4
answers1318
viewsA: Disappear Button From Side
As you want to change a single element, you can make use of the function querySelector(). It returns the first element that matches the specified group of selectors. /** * Obtendo os botões: *…
javascriptanswered Renan Gomes 19,011 -
1
votes2
answers1680
viewsA: Bookmark
Probably because you’re not including the jQuery before calling this code. The excerpt $(function(){ ... }); is equivalent to a function call ready(). Apparently that’s the only problem: <a…
javascriptanswered Renan Gomes 19,011 -
4
votes1
answer566
viewsA: How to create a circle of progress?
There is the class AnimatedIcon - non-standard on the Java platform - which apparently serves what you’re trying to do, I don’t know if you’ll visually look like you expect but the idea of showing a…
-
3
votes4
answers822
viewsA: When is a string considered a primitive type in web development?
This is the first time I’ve read this, so maybe your teacher can explain for sure what he meant. But by kicking, it may be connected to the parameters of a request come as String in Java, regardless…
-
3
votes2
answers168
viewsA: Display a label while the page is loading
If you only need to "hide" the content of the site before the load be fired, can use a class with this property that is inserting directly into the DOM, it is easier to manipulate: .hide { display:…
javascriptanswered Renan Gomes 19,011 -
4
votes2
answers1321
viewsA: What are the differences between "type=button" and "type=Submit" in an input?
The type='submit' has a special behavior, when pressed the form will be sent - unless you prevent this with Javascript. Already the type='button', as type suggests is only a button that by default…
-
2
votes4
answers264
viewsA: CSS - Bootstrap min
In download options, you can choose to download the source code and modify them according to your needs. If you need to modify a single class, it may be simpler to make use of !important in the…
-
1
votes1
answer194
viewsA: Show badge at the edge of a button
There are 'n' ways to do what you want, the one I consider more "clean" and simple handling/maintenance is to have these rules defined: .badge-button { position: relative } .badge-button:after { /*…
-
1
votes2
answers756
viewsA: Site home screen - structure
You can use the property background-size: body { background: url(http://i.stack.imgur.com/HWdW6.jpg); background-size: cover }…
-
2
votes2
answers132
viewsA: Circle with text in the center Asp.net
If you want to put only one letter inside the circle, you can do so: p { border-radius: 50%; background: #4CB5AB; color: #fff; display: inline; padding: 5px 10px } <p>M</p> In the case…
-
0
votes2
answers915
viewsA: How to set the startup file in an HTML project?
When you create any web project in Netbeans automatically set a file to be the initializer in HTML5 projects index.html will be that file. You can define how the project will run by changing the…
netbeansanswered Renan Gomes 19,011 -
6
votes1
answer29561
viewsA: Insert Whatsapp Share Button into HTML pages
You can use the URL schema whatsapp://send?text= in the attribute href of a hyperlink followed by the message that will be shared. For example: <a…
htmlanswered Renan Gomes 19,011 -
1
votes2
answers444
viewsA: How to create a function to clear the group of a radiobutton?
You can retrieve the elements of this group by the attribute name using document#getElementsByName(): function limparPeloNome(nome) { var radios = document.getElementsByName(nome); for (var i = 0; i…
-
4
votes1
answer2487
viewsA: How does Htmlunit work?
In summary, the Htmlunit has an API that allows Java applications to perform the same actions that a user would perform in the browser, some examples include invoking a web page, clicking buttons…
-
6
votes3
answers311
viewsA: How to use a different logo if the pattern does not exist?
It is possible to do with Multiple backgrounds. The estate background accepts multiple background planes stacked as if they were layers, staying on top of each other. You can take advantage of this…
-
3
votes1
answer122
viewsA: Which method can I use for the edges of Jbutton do not appear?
seuJButton.setBorder(null); seuJButton.setContentAreaFilled(false); Upshot: Info: AbstractButton#setContentAreaFilled() Jcomponent#setBorder()…
-
2
votes2
answers2269
viewsA: How do I login to a system via an HTTP request?
You can use the Jsoup. To get html code from a page is enough: Document document = Jsoup.connect("http://answall.com").get(); System.out.println(document.html()); // html da página In your case, it…
-
2
votes3
answers187
viewsA: Return to condition start when prompted
You can place the code inside a loop and check whether the variable’s value jog is different from 0. If it is, you interrupt the loop: int jog; while(1){ // código... printf("Pressione 0 para…
canswered Renan Gomes 19,011 -
11
votes3
answers16809
viewsA: How to generate an executable . jar using Maven?
To reply from Afonso worked as I expected and generated a .jar that runs my application. Until then I didn’t know they existed plugins for Maven and, researching a little more found the Maven…
-
15
votes3
answers16809
viewsQ: How to generate an executable . jar using Maven?
Is it necessary to make some extra configuration to generate a Maven executable . jar? How have I never used this technology under development desktop I’m a little lost. When I build the project…
-
2
votes2
answers480
viewsA: How to keep the element in the final position of the animation?
Using animation-fill-mode with forwards. @-webkit-keyframes right { from { left: 0px } to { left: 200px } } @keyframes right { from { left: 0px } to { left: 200px } } div { position: absolute;…
-
1
votes2
answers2473
viewsA: How to pass arguments when running a program through Netbeans?
Just right click on the project and then choose Estates. In the next window, in the tab Execute you can enter the initialization arguments: public class Main { public static void main(String...…
-
6
votes4
answers3955
viewsA: Different style sheet for each page or only one?
There is no correct answer and it is very difficult to answer a question of this kind without an opinion. First, speaking of the organization of files: Developing In development I use several CSS…
cssanswered Renan Gomes 19,011 -
1
votes2
answers1676
viewsA: Catch last div of a div
Can use document#querySelector(). Getting the last element by class .filho : var last = document.querySelector(".filho:last-child"); last.style.color = 'red'; <div id="PAI"> <div uniqid="1"…
javascriptanswered Renan Gomes 19,011 -
1
votes1
answer367
viewsA: How to use Jquery in the Cordova project?
You need to call the code inside a $(document).ready() or equivalent: <script> $(function(){ var curso = controller.getNomeCurso(); $("#curso").text(curso); }); </script>…
-
1
votes1
answer939
viewsA: Maintain spacing between elements but no spacing between tags
Utilize inline-block and apply a margin between them: img { border: 2px solid #ccc; display: inline-block; margin: 4px } <img src='http://i.stack.imgur.com/8ybwB.jpg' alt=''/><img…
htmlanswered Renan Gomes 19,011 -
0
votes2
answers140
viewsA: Public method where a date is passed as a parameter, a parameter only
You can use String#format() to include zeros on the left. String foo = String.format("%08d", 1234); // 00001234 In this example, a formatted String of size will be returned 8 where, to complete the…
-
4
votes3
answers867
viewsA: Reset the Alert function
You can just replace it: /** * Ao invés de exibir uma janela de alerta, * a mensagem será exibida no console - CTRL + SHIFT + K. */ window.alert = function(msg){ // faz algo console.log(msg); }…
javascriptanswered Renan Gomes 19,011 -
1
votes1
answer208
viewsA: Hover effect does not work
The idea is very simple: Just keep the element hidden until there is the action of :hover and/or :focus input. An example: .input-group p { display:none } .input-group input:focus + p, .input-group…
-
4
votes2
answers367
viewsA: Pass jquery variable in filename - as if it were get
var el = document.getElementById('lang'), param = el.getAttribute('src').match(/lang=([^]*)/)[1]; alert(param); <script id='lang' src='app.translator.js?lang=pt_BR'></script>…
-
1
votes2
answers1435
viewsQ: How to count the number of lines within a div that does not have a "line limiter"?
How can I count the number of lines in a div who does not own a \n or a <br> at the end of each line? Exemplifying: var el = document.getElementById('theDiv'); lines = el.innerHTML.replace(/…
-
4
votes2
answers207
viewsA: Program to show and hide in Javascript
How about using CSS only? div { display: none } a:hover + div { display: block } <a href='#!'>Mostrar conteúdo do div 1</a> <div> conteúdo do div 1</div> <a…
javascriptanswered Renan Gomes 19,011 -
1
votes2
answers64
viewsA: Float does not work properly
Apply a clearfix solves the problem (caused by standard behavior of the float property): .coluna-esquerda:before, .coluna-direita:before { content:''; display: table } .coluna-esquerda::after,…
-
2
votes2
answers372
viewsA: Calculate value according to selected dates
You can use the library Momentjs to do the parse and see how many days have passed. var inicial = moment('1/02/2015', 'DD/MM/YYYY'), final = moment('14/02/2015', 'DD/MM/YYYY'), diasPassados =…
-
3
votes1
answer118
viewsA: Class creation that returns a String
The solution is quite simple, your method GenerateRegCod must belong to a class. For example: // Imports... public class MinhaClasseIncrivel { public String GenerateRegCod(String[] Code, String…