Most voted questions
150,413 questions
Sort by count of
-
7
votes1
answer1030
viewsBest practices with Java exception handling
How best to work with more than one exception in Java? In the code below, I see the possibility of giving two errors NullPointer or SQLException. If I put one catch for every exception is the best…
-
7
votes2
answers2142
viewsDifference between /dev/urandom and /dev/Random
I recently read a post on the oracle jdbc driver, talking about making the following configuration on jvm running on Linux: -Djava.security.egd=file:/dev/../dev/urandom According to the reference,…
-
7
votes1
answer130
viewsMake a " or " inside the key of an attribute in JS
I have the following code: scope.cm = 1; scope.mm = 2; scope.km = 3; tipoDeMedida[scope.cm || scope.mm || scope.km] = function(arrayQualquer){ //executo meu bloco de código X. }…
-
7
votes1
answer3851
viewsHow to generate secure tokens dynamically
Various applications use token authentication to maintain secure network communication. However, using dynamically generated tokens, the probability of breakage decreases greatly. So there is the…
-
7
votes2
answers1882
viewsHow to convert a text to number?
How should I convert a text that I know is an entire number coming externally? It would be something like a ToInt() or something like that.
-
7
votes2
answers586
views -
7
votes3
answers1037
viewsHow to dynamize a numerical sequence of 3 in 3 numbers following the order?
Type: 1 2 3 ... 4 5 6 ... 7 8 9 And so on and so forth. Example var clic = 0; function mais() { if (clic == 1) { document.getElementById('txt').textContent += "1 2 3 " } else if (clic == 2) {…
javascriptasked 7 years, 8 months ago Diego Henrique 2,916 -
7
votes1
answer2762
viewsWhy in file and folder names, are some characters still not accepted?
Why files and folders still do not accept some different characters? I believe you must have some programmatic influence in order to make that decision. The Operating Systems had and/or still have…
-
7
votes2
answers366
viewsDoes using "Document.open" and "Document.close" make a difference?
I saw in a certain answer from SOEN a question about printing iframe content. I ended up encountering an excerpt of code where I had the following: var newWin = window.frames["printf"];…
-
7
votes4
answers1920
viewsCreate column with sum and percentage of the maximum of other columns
i am a beginner in the R language and wanted to know how I create a function mutate that creates a new column in my table and at the same time store in this new column the sum of the values…
-
7
votes1
answer3023
viewsHow to set up a development environment manually
I’m trying to set up my own development environment on a machine with Windows 10. The idea would be to install Apache + PHP + MySQL. The problem is that the software documentation is quite…
-
7
votes4
answers3293
viewsSeparate String Number Letters
I need to separate the characters of a string into numbers and letters. Ex.: Entree: "A1B2C3D2Z9" Exit: List<Character> numeros = { '1','2', '3' } List<Character> letras = { 'A', 'B',…
-
7
votes1
answer1804
viewsThe Entity or Complex type '*' cannot be constructed in a LINQ to Entities query
I can’t do this? public List<Filial> GetAll() { //Mostra todos os registros incluindo os desativados para os Administradores var ret = _db.Filiais.AsNoTracking() .Where(e => e.Visible)…
-
7
votes3
answers1253
viewsWhat is Gzip? How does it improve a website?
How exactly Gzip improves a site’s performance? I wonder what it’s like under the table. I saw that some sites that test the speed of other sites usually check the gGzip, but what is this? How…
-
7
votes2
answers810
viewsWhat is embedded programming?
Reading a book about programming practices, at a certain point an excerpt about embedded programming. It doesn’t go into detail, but it talks a little bit about programming in microcontrollers and…
terminologyasked 7 years, 8 months ago viana 27,141 -
7
votes1
answer8639
viewsPass parameter from one route to another
I need to take a variable from the url and redirect with the parameter to another Function Route::get('doacao/{id}', function(Request $request){ return…
-
7
votes2
answers362
viewsHow to pass an array as argument of a function per copy?
Like we know a array is used as a pointer in various situations. A parameter that waits for a array is actually a pointer, so what you copy is the memory address and not the data from array, is a…
-
7
votes1
answer430
viewsUsing synchronous methods together with asynchrons
For development reasons, I needed to create a call to an asynchronous method in a synchronous method, but when publishing my project on the server, it is indefinitely running. Asynchronous method…
-
7
votes1
answer9661
viewshtmlspecialchars() expects Parameter 1 to be string, Object Given
I’m trying to make a button select in the Blade with @foreach to get the list of all Mysql databases. Only the @foreach works, I can get the values, but I’m not getting to put the bases inside a…
-
7
votes2
answers190
viewsEdit the style of the external div tag of a box in Shiny
I’m developing an app on R’s Shiny, and I’m having trouble editing the tag out of a box. When I turn the remote: box( title = 'Teste', width = 4 ) the corresponding HTML it creates is: <div…
-
7
votes3
answers1160
viewsMeta tag for geolocation
I was looking for meta tags for geolocation, to help search engines know that the information on my site refers to a specific city. I found this website which generates the following tags for an…
-
7
votes2
answers1130
viewsWhat is the safest way to identify that the upload file is an image?
I’m making a system where I can receive an image upload. To check on the server if the file type is image, I thought of this code: if (strpos($upload->getClientMimeType(), 'image') !== 0) { throw…
-
7
votes2
answers225
viewsProblems with sizeof
I’m trying to get back the size of array, but it’s making a mistake. What to do? #include <stdio.h> char *palavra[] = {"casa", "carro"}; int main(){ int i; for(i = 0;i <…
-
7
votes2
answers3355
viewsSearch item in a list using LINQ
I have a list and want to search it (as if it were a database). It is possible? Ex: list all names from the list that start with 'JOAO%'
-
7
votes2
answers753
viewsWhat is the difference between 301 and 302 redirects?
I would like to know the difference between these two types of redirect code: 301 and 302. I realized that they are called on Google’s Webmaster Tools Permanent redirection and Temporary…
-
7
votes1
answer255
viewsHow does function pointer work in PHP?
In C it is possible to use pointers in functions to reference other functions, see an example: int somar(int a, int b) { return a + b; } int (*sPtr)(int,int); int main(void) { sPtr = &somar; int…
-
7
votes1
answer1482
viewsWhat is the difference between __init__ and __new__?
What is the difference between the special methods __init__ and __new__ in Python?
-
7
votes1
answer1855
viewsWhy use const after function?
I noticed some codes from other C++ programmers that use functions like: bool CClass::isRunning() const { return this->_running; } I understood that in this way it is not possible to modify any…
-
7
votes1
answer1682
viewsInput type file does not work in webview
I have an HTML page that has a form of upload imaging in Chrome on pc or any browser works but in my app that has a WebView that opens this page then click on Choose file he does nothing. It is…
-
7
votes2
answers12106
viewsRemove arrows in type number field
Colleagues. I’m using the code below for when the user access by smartphone, appear the number pad: <input type="number" value="" class="form-control"> But on the desktop, when we click inside…
html5asked 7 years, 9 months ago user24136 -
7
votes1
answer10908
viewsWhat does a double precision variable mean?
I would like to understand the meaning of a variable of double precision.
-
7
votes1
answer5427
viewsHow to configure apache2 for python 3.5.2
I have been trying to study web programming with Python, but I can’t configure the server on my computer, can anyone help me? Whether it’s telling me how to set up or providing me with an already…
-
7
votes3
answers566
viewsSame types but with different objects. What is the best way to use it?
I had to create a new object but totally the same as the one in the C#system. Since the objects are the same I tried to do: ObjetoOriginal.Propriedades = ObjetoClone.Propriedades; Unfortunately it…
-
7
votes3
answers1777
viewsPHP picking up Cloudflare IP instead of user IP
I’m having a problem using the: $_SERVER["REMOTE_ADDR"]; eventually he catches a IP which is not the user’s, in case it started after I started using the Cloudflare... Does anyone know why this…
-
7
votes2
answers1332
viewsAre Quias the differences between Web App, Native App and Hybrid App?
Whenever I do research on mobile development I come across three terms that appear a lot in the surveys. Those terms are: Web App Native App Hybrid App And this generated me some doubts that I would…
-
7
votes1
answer816
viewsNavigation via HTML or Javascript
I’ve been working a lot with javascript and it makes me use it for almost everything. But I’m having a question. Is there any problem of semantics, indexing or search results of my page when I use:…
-
7
votes1
answer153
viewsWhat is an equal input parameter (allocation operator)?
I have a function defined as follows: public classeDeRetorno nomeDaFunção(string param1, string param2, string param3 = "") What does the param3 = ""? It equals the parameter to ""?…
-
7
votes1
answer392
viewsCreate algorithm for fluid simulation?
I want to create a simulation game with Unity and I need to simulate the movement of 2D fluids, I can’t think of a way to create an algorithm with enough performance to simulate a thousand particles…
-
7
votes3
answers4250
viewsWhat is the purpose of the "header()" function?
In my question about the HTTP protocol understood that HTTP requests have a format that is described by the protocol itself. However, in PHP there is a function that sends data to HTTP which is the…
-
7
votes4
answers4863
viewsHow to pick the first word of a string with jquery?
Ex.: "First word of string" I want to take the word "first"
-
7
votes1
answer1031
viewsHow do I know if a point (x, y) is within the filled percentage of a pie chart?
I arrived at this code showing whether a point (x, y) is inside or outside a circle on a Cartesian plane. def dentro_fora(p, x = 0, y = 0): r = cx = cy = 50 if (x - cx)**2 + (y - cy)**2 < r**2:…
-
7
votes4
answers2310
viewsI cannot disable a checkbox with enable = false
I need, in certain situations, to enable a checkbox or not. I made a Javascript function and I can’t enable/disable it. Here is the function: function ValidaCampoInserirAutorizacao(){ var vTussMed =…
javascriptasked 7 years, 9 months ago pnet 14,727 -
7
votes4
answers402
viewsHow to remove parentheses of values in an array?
I have an array and need to remove all parentheses from all values array. Follows the array: $array = array( "chave1" => "(valor1)", "chave2" => "(valor2)", "chave3" => "(valor3)" ); I need…
-
7
votes1
answer109
viewsWhy set a 0 or 1 output at the end of a program?
I have noticed that some programs always have a code snippet, which is always executed last, which takes as a parameter a number, usually 0 or 1. For better understanding, I put this example of a…
operating-systemasked 7 years, 9 months ago Wallace Maxters 102,340 -
7
votes1
answer11268
viewsWhat is the programming language for creating Android apps?
What programming language is used to create most Android mobile apps? For example, guide applications, questions etc...
-
7
votes1
answer1976
viewsField "__v" in all documents of a collection
All my documents in a Mongodb database have a field __v, what it means? > db.speeds.find({}).limit(2).pretty() { "_id" : ObjectId("586826f700890738a5e8cb3d"), "remoteId" : 1, "first" :…
-
7
votes2
answers798
viewsMariadb ERROR: ERROR 1709 (HY000): Index column size Too large. The Maximum column size is 767 bytes
When I run this code on Mariadb, it gives me this error when trying to create the toy table: ERROR 1709 (HY000): Index column size Too large. The Maximum column size is 767 bytes. I don’t know how…
-
7
votes2
answers331
viewsSemicolon(;) in Ecmascript 6 is no longer required?
When using Ecmascript 6 (ES6) it is no longer necessary to use semicolons (;) at the end of each code line?
-
7
votes2
answers1171
viewsEntitymanager or Session? What to use?
I have worked with projects that used both Session and Entitymanager but it was never clear which one to choose. On what basis they differ in terms of performance and compatibility. Someone can give…
-
7
votes3
answers1464
viewsHow to change the text of a link after clicked?
How do I do in HTML (or CSS if you have how) the text of a link where it is written "show more" change to "show less" and vice versa after clicked?