Most voted questions
150,413 questions
Sort by count of
-
11
votes1
answer19067
viewsHow can we not close the twitter-bootstrap modal by clicking outside the area?
I do not know if there is a way, but I need to block the closing of the twitter-bootstrap modal when the user clicks outside the element area, only allowing to close it by clicking the closing…
twitter-bootstrapasked 10 years, 11 months ago Marcelo Diniz 3,356 -
11
votes4
answers1866
viewsHow do Stringbuffer() and Stringbuilder() behave?
Problem and Mystery: StringBuffer y = new StringBuffer("Eduardo"); I’m wearing a StringBuffer, because I need to add some values later to it. I was debugging and noticed that there is a blank at the…
-
11
votes2
answers14796
viewsTurn Byte into String
Problem: I’m getting byte and when I try to turn into String is making a mistake. ... byte[] msgBytes = ch.decode(hex, ch.key()); // retorna byte String msgDecode = msgBytes.toString(); // tentando…
-
11
votes5
answers61683
viewsUsing line break " n" in Java
What problem can a Java programmer have when using "\n" to jump line? Observing: I’ve used it for N reasons, record a file TXT and others.
-
11
votes2
answers2940
viewsDraw path on the map
How do I draw a particular path using the Google Maps V2 API? What I want is something more or less like this: I inform the street A and the street B and get the drawing of the path between these…
java android google-maps google-maps-android-api-2asked 10 years, 11 months ago Geison Santos 4,428 -
11
votes6
answers11946
viewsConverting a string to int?
How best to convert a variable string for another variable of the type int?, namely, a nullable of int? Performance is very important in this case because I will be converting several values within…
-
11
votes3
answers5660
viewsHow to keep the element scroll always at the bottom
Consider the following example I’ve done here: $("#add").click(function() { $("#wrap ul").append('<li class="new">Teste</li>'); $("li.new").slideDown('slow', 'easeOutBounce'); });…
-
11
votes2
answers665
viewsHow to determine the smallest number of small areas to render?
I have two images (pixel arrays), one of which is rendered on the screen. The goal is to render the second. However performance is critical and, in the environment where I am, render each pixel is…
-
11
votes2
answers355
viewsNegative variance in R? Floating point error propagation
Suppose the following formula to calculate the variance: variancia <- function(x) { n <- length(x) (1/(n^2-n))*(n*(sum(x^2))-(sum(x)^2)) } Note that it is equivalent to the function var in…
-
11
votes1
answer1299
viewsNo return of geolocation using Phonegap
I’m using the code to pick up the geolocation of the Phonegap, but even so, when I emulo the app, it returns me nothing. There is something wrong in the code? index.html <html> <head>…
-
11
votes5
answers708
viewsAt what point in a project should the platform be chosen?
When a project is designed (i.e. a need is identified, and it is decided to develop a computerized solution for it) one of the first things the customer asks: on which platform should the software…
-
11
votes4
answers152
viewsIs a compiler allowed to omit a reference member in a class?
Consider the following class: struct Type { int a, b, c; int& ref; Type(int m) : a(m), b(m), c(m), ref(a) { } Type(const Type& ot) : a(ot.a), b(ot.b), c(ot.c), ref(a) { } } obj; Here we have…
-
11
votes5
answers10769
viewsHow to mark and unmark a row from a table by clicking on it?
When clicking on a row of a table, how to mark it by changing the color of the row background, and if you click again uncheck the background, and if you click on another row uncheck the old checked…
-
11
votes1
answer1778
viewsHow do I create a webhook in Gitlab to update a mirror repository in Github?
I’d like to create a webhook in Gitlab to update a mirror repository in Github whenever there is one push. I consulted this one demo page, but I didn’t quite understand how to do. My version of…
-
11
votes3
answers8084
viewsCORS on Nodejs without the use of Frameworks
I am creating an app in Phonegap and consumes an API provided through Nodejs. For that to happen, I need Nodejs to accept the CORS. How do I enable the CORS for Nodejs to accept the request?…
-
11
votes7
answers3042
viewsHide input value
I need to hide/remove the value from my input, but I’m not getting it at all, where am I missing? Thank you very much HTML: <div class="caixa-pesquisa"> <div…
-
11
votes2
answers1395
viewsProblem using 'Google Fonts'
I would like to use a Google source without needing Connection (internet). I saw that the @font-face has this power. Just download the source in one of the formats (I preferred the .EOT also…
-
11
votes8
answers2292
viewsWhy create an object using the superclass?
Given the following code: public class Musico { public void tocaInstrumento() { // faz algo } } . public class Baterista extends Musico { public void giraBaqueta() { // faz algo } } . public class…
-
11
votes2
answers2189
viewsHow to calculate the determinant of a javascript matrix?
Ex.: det([-1, -2, 3], [3, 3, 1], [-1, 2, -3]) // retorna 22 Ex.: det([1, 2], [2, 5]) // retorna 1 Ex.: det([8]) // retorna 8
-
11
votes5
answers10236
viewsecho or print, what really is the best option?
I know the differences of echo or print, but in a real PHP project which one is best suited to use? Or simply whatever?
phpasked 10 years, 11 months ago phpricardo 765 -
11
votes5
answers2480
viewsCheck if day exists in month
I need to verify/validate if a (numerical) day exists in a given month. For example, I have the day 31, and as it does not exist in the month of February the condition will fail. I think a simple if…
-
11
votes3
answers17410
viewsHow to create a Javascript function that accepts an arbitrary number of arguments?
Functions of the type console.log take any number of arguments. How to specify this for a Javascript function?
-
11
votes2
answers324
viewsHow to make an object jump only once. in the LÖVE framework?
I’m trying to make a game using the framework LÖVE for Lua, where the player is a ball and has to overcome obstacles and enemies but I’m having a problem making the jumps. function love.keypressed(…
-
11
votes1
answer5272
viewsWhat is a wrapper class?
What is a wrapper class? How they can be useful? Cite examples of use in php or c#, as well as when to use or not to.…
-
11
votes4
answers2731
viewsIs it possible to change the mouse cursor color via CSS?
I know it is possible to change the style (type) of the mouse cursor via property cursor in CSS. But, does anyone know if it is possible to change the cursor color? In an application I would like to…
-
11
votes3
answers1814
viewsSort a multidimensional array with numerical values
Suppose the following situation in which I have a array composed of several array numerically valued: $array = array( array(22, 25, 28), array(22), array(22, 23) ) I’d like to leave this array…
-
11
votes5
answers12033
viewsHow to change the value of a "date" attribute in Jquery?
I have an attribute data-order on a button and I want it to be incremented as I go adding new ones days to my list by clicking the button, so will have: day-1 day-2 day-3 day-4 ... and so on. Does…
-
11
votes1
answer1892
viewsCheck whether a path is relative or absolute
I wonder if there is a Java function that checks whether the string is a relative path or not: Ex: String caminho = funcao("\\pasta\\arquivo.xml") // retorna true que é um caminho relativo String…
-
11
votes2
answers4325
viewsPermission denied when moving file with move_upload_file on Linux server
I’m trying to use the move_upload_file to move a file sent by the user to its final destination: $pasta = '../../public_html/admin/helpdesk/ticket/uploads/'; if (!empty($_FILES['img']['name'])) {…
-
11
votes3
answers12452
viewsHow to perform a function after two or more asynchronous events?
I have a jQuery script that starts two or more asynchronous operations at the same time, and would like to run a callback when all they have been completed. An example would be to start an animation…
-
11
votes3
answers4295
viewsHow to count amount of Likes from a page?
I have a www.exemplo.com.br page, there I have soaked several Facebook posts. And each post has a certain amount of Likes. I would like to know, if there is a way I can create a div, that shows the…
facebookasked 11 years ago Felipe Viero Goulart 3,693 -
11
votes2
answers3208
viewsDifferences and use of Strings vs. Charsequence
Many methods in Java expect parameters CharSequence, but the code runs normally when I pass a String without conversion, for example: String mensagem = intent.getStringExtra(MainActivity.MENSAGEM);…
-
11
votes5
answers1562
viewsOptimize function to include classes also looking in sub-directories
I have the following function to include classes when we are trying to use a class that has not yet been defined: /** * Attempt to load undefined class * @param object $class_name object class name…
-
11
votes2
answers4531
viewsGroup and add array with PHP
I need to know how to group and add one array, but I’m not finding out how to do. $array = array("vermelho", "vermelho", "vermelho", "verde", "azul", "azul"); wanted a comeback like this 3 1 2 That…
-
11
votes2
answers1010
viewsHow can I simulate a placeholder using a label?
I’m trying to get the label simulate a fixed placeholder. The biggest difficulty is changing the properties of label when the input receives the focus, and the input fill in the rest of the space…
-
11
votes1
answer286
viewsWPF form is going behind all windows when a Combobox is selected
My form WPF works perfectly, but in a ComboBox specific, after the action of selecting, the form is going behind all the windows, without further explanation, and this does not happen in any other…
-
11
votes2
answers2459
viewsCriteria API - Hibernate vs JPA 2
I will try to phrase this question in the least opinionated way possible in the spirit of stackoverflow in English. For a new project I need to make the decision between using the JPA 2 or Hibernate…
-
11
votes7
answers4242
viewsHow to reset CSS formatting?
It was not uncommon to go through situations where the browser itself interferes with the stylesheet by adding defaults parameters such as margin size and headers fonts, default line height. Is…
-
11
votes3
answers1559
viewsHow to condition the insertion of a record in SQL Server?
How can I condition the insertion of a record in a table in SQL Server using the T-SQL language considering the following rules: If the record to be inserted already exists in the table, only update…
-
10
votes2
answers224
viewsWhat is the underscore ( _ ) "inside" of a Javascript number?
I realized I can use underscores (_) between numeric literals in Javascript. For example: const testA = 1_000_000_000; console.log(testA); // => 1000000000 const testB = 1000000_0 + '_0_' + 1_0;…
-
10
votes1
answer451
viewsWhat is Std in C++?
I’m learning C++ and I see std being using everywhere. What is this std? He’s like a library or something different than that?
-
10
votes3
answers537
viewsWhat is Hermes for?
I saw that the Hermes is a javascript engine and that was developed by Facebook for React Native, being recently added to Android on version 0.60.1 and later for iOS on version 0.64.0. But if we had…
-
10
votes2
answers97
viewsIs it correct to program returning exceptions to the expected event?
When we are developing a software we can go through situations where something happens that we are not expecting and usually when it happens in many programming languages we can treat it within…
-
10
votes2
answers289
viewsWhen to use record or class on C#?
One of the novelties of C# 9 are the record types, I saw that one of the biggest differences between them and the classes are the methods .ToString() and .Equals() who has a different behavior. But…
-
10
votes2
answers230
viewsWhat does the / +/g parameter mean in the . split() method?
Can anyone explain to me what the parameter means / +/g within a method .split()? var message = "-lucas o p i "; var args = message.slice(1).trim().split(/ +/g); var comando =…
-
10
votes3
answers300
viewsHow to perform a condition in the array to verify that multiple elements exist at the same time?
I have the following array as an example: var a = ['view', 'edit', 'insert'] And I need the following condition: a.includes('view') // esperado: true, resultado: true a.includes('view', 'teste') //…
javascriptasked 4 years, 3 months ago Lennon S. Bueno 2,182 -
10
votes2
answers262
viewsCRUD is an architecture standard?
CRUD is a design architecture standard, which can be explained in different views?
-
10
votes2
answers573
viewsGlobal variable returns Undefined when using this in Node.js
I’m studying about the special variable this and I came across the following situation: When executing the function below in Node.js (version 12.18.3) the result is undefined and only returns 2 if I…
-
10
votes3
answers195
viewsWhy do I need to spend two then on AJAX requests made with the fetch API?
In the example of the following request: fetch("https://viacep.com.br/ws/01001000/json/") .then(resposta => resposta.json()) .then(json => console.log(json)); In the first then should not…
-
10
votes1
answer237
viewsWhat is Prototype Pollution?
I use a tool that performs security checks on the packages of my project, it indicated me that one of the packages is susceptible to Prototype Pollution, would like to know: What exactly is…