Most voted questions
150,413 questions
Sort by count of
-
4
votes2
answers277
viewsIs it possible to use the resize function of the textarea in an input?
Good morning, everyone. I’m making a form, and I wanted to make a <input type='text' /> that the user could set the width, with that drag resize that exists in the textarea. I want to insert…
-
4
votes2
answers77
viewsHow to Make an Onclick on all Page Images?
I would like to know how to, when clicking on ANY image on the page, activate a function. I tried it in the following ways: 1- var imagez = document.getElementsByTagName('img'); imagez.onclick = ()…
-
4
votes2
answers298
viewsWhy does factorial above 170 return infinite?
I made this php code to calculate the factor of positive integer numbers , however , for numbers from 170 the result is always infinite and I would like to understand why this. Ex3 $numero_usuario =…
phpasked 4 years, 6 months ago Vitor de Almeida 43 -
4
votes2
answers77
viewsUsing integers as Java Locks
I have the following code snippet: class classe{ public static void main(String[] args){ Integer lock = 0; Thread t1 = new Thread(){ public void run(){ // instruções thread sem sincronia…
-
4
votes1
answer87
viewsWhat’s the difference between debauchery and Throttle?
I see that many people use techniques such as debauch to prevent a function from being called many times. But I also see a technique called Throttle. Ness sense, what’s the difference between…
uiasked 4 years, 6 months ago Luiz Felipe 32,886 -
4
votes1
answer402
viewsPython - does not allow assigning value to the variable in if conditional, why?
I did something in Python that is common to do in C and javascript, ie, give a value to a variable when an if condition is met. I’m sure that in Python it’s also possible to program in this way,…
-
4
votes1
answer198
viewsHow to show all the contents of a variable using var_dump?
I’m thrashing an object (let’s say), but when I use var_dump, the entire content of this object does not appear. var_dump($obj[0]->link); Upshot: string…
-
4
votes3
answers391
viewsWhat are literal types in Javascript?
I’ve seen several times the terms in the programming of literal types, but I don’t know what that is, for example, literal string, literal numbers, literal objects and so on. What is that? There’s a…
javascriptasked 4 years, 6 months ago felipe cardozo 275 -
4
votes1
answer225
viewsRatio of threads to number of processors
In the image below my task manager there are 3058 Threads. My processor has 4 threads. This means that of these 3058 it will run 4 in 4 threads? My processor has 4 cores and 4 threads, that means…
-
4
votes2
answers112
viewsfunction does not execute regex equal words
I got some string: "novamente mais brevemente uma vez claro, claramente demente, igualmente. novamente." I run a Javascript regex to get the words finished in "mind": var target =…
-
4
votes3
answers1145
viewsHow to remove spaces from a string in Python without also removing line breaks?
I need to remove unnecessary spaces from the strings, but not the break between the lines. I have used the command below, which removes the spaces, but also removes the break with the /n. Does…
-
4
votes1
answer68
viewsDifference between query with and without Inner Join
What is the difference between doing the two queries below, one with and the other without INNER JOIN? What is the most appropriate? SELECT p.Descricao as Produto, c.Descricao as Categoria FROM…
-
4
votes3
answers170
viewsRemove the brackets from the Sorted() function
I was creating a quadratic function calculator and wanted to lay down roots in the ascending order. Searching, I arrived at the function sorted(). raiz1 = round((-b + math.sqrt(delta)) / (2 * a), 2)…
pythonasked 4 years, 7 months ago Bernardo Lansing 121 -
4
votes2
answers79
viewsUsing functional programming features to remove a word list from another list
I am analyzing a literary text and am having the following problem to remove a group of words from the text. These are not repeated words. link_words are words that will disturb a later analysis of…
-
4
votes1
answer56
viewsHow to catch the 29th of February php datetime
I do not know if it is a bug, I searched, I did not find it. But today, I need to recover a data from a month ago and to my surprise it happened this: $dateTime = new DateTime(); print_r($dateTime);…
-
4
votes1
answer59
viewsHow to deal encapsulated a field that is a list of immutable elements?
Imagine that you have an object and one of its fields is a list of immutable elements. You want to make this field available to the clients of this object in a controlled way, after all a list can…
-
4
votes2
answers86
viewsWhat is the difference between paths starting with ". /" and "~/" ? What is a best practice?
Both directories below point to the same file. These are Typescript import statements in an Angular application '~/app/shared/sevices/modules-services/inspections/checklist.service';…
-
4
votes1
answer96
viewsNonstatic nested interfaces can be used independent of instance of the enclosing class?
I was reading about JsInterop and I come across an example of code: package com.example; @JsType public class Bar { @JsFunction public interface Foo { int exec(int x); } public static int…
-
4
votes1
answer126
viewsecho output with % and %
When solving some exercises in Shell Script, I find this script: x="Este texto para teste." echo ${x% *} I confess that, when performing the table test, I could not solve it. When running this…
-
4
votes2
answers686
viewsHow to join two object arrays by different keys?
I have two object arrays: let mergedScreensAllCompanies = [ { id: 1, description: Cadastro de usuários, }, { id: 2, description: Cadastro de filiais, } ] let userScreens = [ { id: 1, user_id: 1,…
-
4
votes2
answers279
viewsHow to divide strings into equal parts
How to divide a texto with or more than 20,000 characters in equal parts and each part containing 5000 characters? (Nodejs) I have that function: textBreak = (data) => { const characterCounter =…
-
4
votes2
answers346
viewsDifferences between Monolith and Monorepo
I have read some articles on Monorepo and still do not understand what would be the difference between Monolito and Monorepo. Would someone explain to me?
front-endasked 4 years, 7 months ago Guilherme Nass 939 -
4
votes1
answer61
viewsHow to copy the script by running to another folder in Python?
I made a script in Python that runs some commands in the terminal, and I want it to move to another folder. I tried to use the cp teste.py minha_pasta/teste.py, but it doesn’t work. This is my code:…
-
4
votes1
answer62
viewsWhat would be the 'right' way to declare variables in PHP OO?
I’m starting to study O and fall into the following doubt: <?php class Caneta { var $modelo; var $cor; var $ponta; var $carga; var $tampada; } OR SO: <?php class Caneta { public $modelo;…
-
4
votes1
answer93
viewsLimit number on an input - 2nd doubt
My goal in a previous post was to put a maximum and minimum value in a text field, a user solved it almost perfectly. Let’s use as an example at most the number 37: function checa(e){ const mi =…
-
4
votes2
answers245
viewsI can’t push in GIT repose
I have a GIT repository on an SSH server and when trying to push, the following happens: Counting objects: 16, done. Delta compression using up to 8 threads. Compressing objects: 100% (14/14), done.…
-
4
votes3
answers289
viewsHow to print a Python operation by adding zero to the left?
a = int(input('Número: ')) b = int(input('Número: ')) c = a / b print(c) If I assign A = 10; B = 5 print will show 2, I wonder if there is some kind of format that allows print to show 02? Thank…
pythonasked 4 years, 7 months ago Eduardo Carlos Santos Pereira 41 -
4
votes3
answers1189
viewsCheck if a string exists in an array
Write a function that checks whether the past skill vector has the Javascript ability and returns a true/false boolean if it exists or not. function temHabilidade(skills) { // código aqui } var…
-
4
votes1
answer237
viewsRegex for positive, negative, sum and subtraction number tokens
I have to do a lexical parser in python using the PLY. Use REGEX to pick up tokens: Example: t_FLUTUANTE = r'flutuante' The expression above gives a match with the word flutuante and return me a…
-
4
votes1
answer57
viewsHow to identify the exact element that contains a specific word
To display only the element in which the searched word is found? In the example below he searches us filhos of container if the searched content is present in the element moves it to the saida. But…
-
4
votes1
answer168
viewscheck not allowed characters within the input and alert user
Good morning. On a system I’m working on, there’s this input inside the first div, and I need to check when the user type the letters I, The, Q in any of the 17 characters of the input, a text…
-
4
votes3
answers118
viewsWhy doesn’t my program display the output values?
var anoAtual = 0 var anonasci = 0 const idade = function(cl){ anoAtual - anonasci console.log(anoAtual - anonasci) } const imprimirresultado = function(c){ if(idade >18){ console.log(` sua idade…
javascriptasked 4 years, 7 months ago Rafael Silva 95 -
4
votes2
answers86
views"Child already has a Parent, it must be Removed first" when sending new object to Reducer
I have a table where I want to sort your data. The table is copulated through the values of this useSelector() const users = useSelector(state => state.userStates.users) When the user clicks on…
-
4
votes3
answers101
viewsWhy am I not able to modify the class of the element with the classList property?
I’m using the property classList to modify the class of the element, but it does not happen the result I want, because it does not modify the current class to the new. let p1 =…
javascriptasked 4 years, 7 months ago marquinho 489 -
4
votes1
answer115
viewsCreating a dictionary with void functions
I am for fun to develop a TCP server in C# that performs functions depending on the message that the connected client sends you, for now, I only managed to do what I want with functions that return…
-
4
votes1
answer50
viewsWhy does the dropEffect property not work?
I’m wanting to switch between cursors copy, move or link when a draggable element is dragged using the property dropEffect or when the event dragstart occur, but it changes nothing visually:…
javascriptasked 4 years, 8 months ago marquinho 489 -
4
votes0
answers139
viewsProject flyway and jpa-Ibernate getting confused
In the project we are creating, on site, to the initial JPA - Ibernate, created the tables and inserted some information, for tests. Well the project was growing and we decided to include the flyway…
-
4
votes2
answers59
viewsHow to gradually transform n number generation in normal distribution in R
I have developed a code to solve the image issue, which is to try to approximate the percentage of 68.2% numbers generated in the normal distribution that are between -1 and 1. Follow the code: x…
-
4
votes1
answer44
viewsWhat is the correct way to use the "%" operator in Sass?
I’m making changes to a page that was made using Sass, and I’m still very beginner with the framework, and I came across the following code: %cf { &:after { content: ''; display: block; clear:…
-
4
votes1
answer331
viewsWhat does the "$" dollar mean in the browser console or in Javascript?
On any empty page (no library at all), when typing a $ in the browser console is returned a function, as shown in the output below: ƒ $(selector, [startNode]) { [Command Line API] } If I type two $…
-
4
votes3
answers717
viewsTernary operator with three possible conditions
For a certain status, I can have 3 different stages: 0 = Stopped 1 = Sending 2 = Delivered Then you could have: status = 0 or status = 1 or status = 2 For each stage, I need to set an icon. If I had…
javascriptasked 4 years, 8 months ago Wagner Fillio 1,328 -
4
votes3
answers137
viewsSQL Query - ORA-01795
I need to make a report from a database query. The problem is that the query returns more than 1000 expressions and presents the following error: ORA-01795: the maximum number of expressions in a…
-
4
votes2
answers89
viewsChange string characters, except the last 4
The idea of the function is to change the characters of a string (minus the last 4 characters) per "#". I created the function, but I believe I have problems in the logic of the code. function…
-
4
votes1
answer37
viewsWhat is the difference between canplay and canplaythrough?
Both events canplay and canplaythrough are similar, but what is the main difference between using one and the other?
javascriptasked 4 years, 8 months ago marquinho 489 -
4
votes1
answer608
viewsVBA - Automatically Clear Cell Information - Event Change
The script below causes when selecting the column "H11" automatically clear the column "I11". How do I make the same script erase the I12 cell when selecting the H12 cell and so following the same…
-
4
votes1
answer1116
viewsWhat is a "Postback"?
It may seem like a silly question, but I can’t understand how a postback works, if anyone can explain to me thank you!
-
4
votes1
answer536
viewsHow to check if a string is inside a string set?
In the code below I have the set of strings ('M', 'F') and soon after I ask the user to enter their gender so that the value is recorded. valores = ('M','F') print(valores) sexo = str(input('Digite…
-
4
votes2
answers401
views"Watermark" with CSS
Test scenario I have an input on a <td>, in which the background of <td> has color: td { padding: 2em; background-color: yellow; } <table> <tr> <td class="marcado">…
-
4
votes0
answers379
viewsHow to change document language in rmarkdown using latex?
I’m writing a document in Rmarkdown and using Latex for figures and tables. I need the titles of figures and tables in Portuguese, so I tried the following: Rmarkdown file: --- Output: pdf_document:…
-
4
votes3
answers1553
viewsReturn the index of the largest element in an array
I’m trying to return the higher index of the vector, I made the following code but returns undefined in function: let array = [2, 3, 6, 7, 10, 1]; function retornaMaiorIndice(){ for (let i = 0; i…