Most voted questions
150,413 questions
Sort by count of
-
5
votes1
answer158
viewsIn terms of user experience, is it impactful to remove accents and special characters from a URL?
I wonder if there is a reason to remove special characters from a URL. For example, the URL below (here from Sopt): en.stackoverflow.com/questions/27177/o-que-is-callback It has, of course, a…
-
5
votes2
answers238
viewsPython dictionary and functions
I don’t understand why the following code says that it is receiving more than one pro value same parameter. def foo(name, **kwds): return 'name' in kwds foo(1, **{'name' : 2})´ Typeerror: foo() got…
-
5
votes3
answers515
viewsSum of factorial in a specific range
I need to add the factors from 1 to 10, but I have not found the best way to implement this function. def soma_fatorial(): resultado = 1 for i in range(1, 11): resultado = resultado * i return…
pythonasked 4 years, 4 months ago Marco Raad 43 -
5
votes3
answers195
viewsList without negative number
The exercise is as follows: a program that reads the values and separates them into a list of pairs or odd numbers. The count only stops when a negative number comes (which should not be on the…
-
5
votes2
answers112
viewsCustom request validating Unique field on update
Good morning. Guys, I have a request created for user validation, but when I update a record it validates the Unique field I set in validation.. I tried to pass $this->id along so that it…
-
5
votes1
answer236
viewsWhat do you mean, "Empty Dataframe"?
I’m learning and doing a lesson from my college. My teacher asked to use format table filters .csv using the command .query() So original is like this: Funcionario Escolaridade Genero Idade Meses…
-
5
votes1
answer111
viewsSet does not remove duplicate objects
I have an array of objects and always to remove duplicate objects use the new Set(array), but this time did not work as expected. In the following example, it is easier to understand. I’m passing my…
-
5
votes1
answer101
viewsHow can I update a parent status via child in React?
I need to update a parent’s status via a link click on the child’s Komponent, but I’m not getting it. I’m trying this way: Component Pai export default function Home() { const [board, setBoard] =…
javascript react web-application app componentasked 4 years, 5 months ago João Paulo Santos Pessoa 51 -
5
votes3
answers635
viewsLocal Push Notification iOS
I’m using the lib React-Native-push-notification to schedule notifications in an app,. For Android I am able to create, but the same does not work for iOS. I wonder if you have any alternative to…
-
5
votes2
answers147
viewsIn Java because (250 >> 4) is more optimized than (250 / 16)
I’m taking a Java course and in a class the teacher said that this code: int xstart = Camera.x >> 4; int ystart = Camera.y >> 4; is more "fast or optimized" than this code: int xstart =…
-
5
votes1
answer42
viewsIn Java Swing, should I extend Jpanel and top-level containers like Jframe?
Has in the Soen but I was not satisfied with the answers, and temporarily I am not able to ask IF.. Top-level containers like the JFrame I guess there’s no need, but a JPanel kind of made to be an…
-
5
votes2
answers195
viewsWhat is the logic behind the switch case in Javascript?
I started my studies in Javascript and had contact with the switch, following example: let permissao; switch (permissao){ default: console.log('sem acesso'); break; case 'estagiário':…
-
5
votes1
answer241
viewsHow to test Exports of a package?
I have a file index.ts which is responsible for exporting all components as follows: export * from './components/com1' export * from './components/com2' export * from './components/com3' export *…
-
5
votes1
answer620
viewsHow to set a decimal display pattern in R?
I have a rmarkdown script that generates a report in . pdf. I would like to standardize the number of decimal places displayed, without needing to round() in every function. At the beginning of the…
-
5
votes2
answers237
viewsAccess Javascript properties: point notation or square brackets?
Let’s say we have an object called rectangulo and a property called area. We can access this property in the following ways: Point notation: rectangulo.area. Bracket notation: rectangulo['area']. I…
javascript characteristic-language objects propertyasked 4 years, 7 months ago Tiago Martins Peres 李大仁 236 -
5
votes2
answers197
views"List Comprehensions" is it worth it?
Is the use of List "Comprehensions" in Python a good use? Affects program performance (runtime, etc..)? Some examples: # Lista com números pares de 0 a 10: par = [x for x in range(11) if x % 2 == 0]…
-
5
votes2
answers98
viewsConvert "2012-01-01" to "2012-Jan-01" in R
good morning. It’s my first post here. I just started my journey in "R" and I’m having a hard time with dates. I even managed to get to the result I wanted, however I took a turn, in my view, VERY…
-
5
votes1
answer62
views'The number of derivatives returned by func() (2) must Equal the length of the initial conditions vector (4)' in R
I’m using ode, package deSolve to solve an R ED system, but I get the error: Error in checkFunc(Func2, times, y, rho) : The number of derivatives returned by func() (2) must equal the length of the…
-
5
votes2
answers328
viewsPrint multiple numbers with a separator between them, but do not put the separator after the last
Make a program that reads two integers, representing the start and end values of a range and print the multiples of 5 between them. My code: valores = input().split() numero1 = int(valores[0])…
-
5
votes1
answer126
views(NODE) What good is a processor with multiple nuclei if Nodejs only runs on one thread?
Example: If I want to set up a server, then I have to "worry" about the clock and not the amounts of nuclei ? Like, if I have two processors to buy X-Processor -> 8 2.0GHz Nucleus &&…
-
5
votes1
answer247
viewsAsync/await generates a new thread?
When reading about async/await methods, it is said that using these keywords alone will not cause your method to run in a new thread. However, I get the output below by running my code. A thread was…
-
5
votes2
answers59
viewsHow does R calculate the following code?
2 + 2 %>% sqrt() Because the result is not 2, but 3.4142?
-
5
votes2
answers333
viewsLabels for Plot box in ggplot2
I have this graph created by the function geom_boxplot. Would you like to label each boxplot correctly. What am I doing wrong? I am using the wrong factor?…
-
5
votes2
answers1480
viewsHow to add references in Visual Studio Code?
How can I refer dll’s in visual studio code? I’m trying to compile a c# project with MVC architecture.…
-
5
votes1
answer107
viewsIf everything in C# inherits from Object, why aren’t all types by reference?
If, for example, a struct type inherits from the class System.ValueType (who inherits from System.Object), why it, and the other types by value, are not allocated in the heap? By making a Boxing, we…
-
5
votes3
answers2304
viewsCheck how many times a number appears in the array
I have an array with the following values: let arrey = ["1","1","1","2","2","2"]; As it is possible to check how many times the number 1 appears and how many times the number 2 appears, for example,…
-
5
votes3
answers775
viewsWhat are the ".d.ts" files?
Studying Typescript I noticed that there are files .d.ts and that it is possible to declare the guys there, but: What is the actual usefulness of files .d.ts? If I already declare the guys in the…
-
5
votes1
answer175
viewsHow competition works on a single thread with C#
This is a purely didactic question. I’m trying to understand how the competition model works in C#, specifically by using the async modifier. I come from Javascript, and I understand that in the JS…
-
5
votes3
answers1204
viewsHow to get the system date in Javascript?
It’s a simple question I imagine, I’m starting my studies in Javascript and would like to know how to get the date of the computer (year, month, day, hour, minute and second). Also, does the date…
-
5
votes3
answers464
viewsWhat is a Guard clause?
What is a Guard clause? Possible translations and synonyms: Custody clause Guard status Sentinel clause Prevention clause Protection clause Fuller definition. What are its advantages? The code is…
-
5
votes1
answer351
viewsSecondary thread on flutter
Hello, I have the following problem in flutter: I currently have an application with the plugin flutter_background_geolocation based on the example that is provided by the plugin. While performing…
-
5
votes1
answer500
viewsWhat is npm @types and how do they work?
I’m starting a project with NodeJS and TypeScript and the instructor told to install the @types/node, beyond the npm package TypeScript. He quickly quoted that the @types/node creates types in the…
-
5
votes1
answer742
viewsHow does Python manage memory when assigning different types?
I wanted to understand how dynamic typing is done. In Python, for example, when we create a variable with content a number int and then that same variable gets a string, the fact of not giving…
-
5
votes3
answers816
viewsCompare values of 2 different arrays with JS
I am trying to compare values of 2 different arrays, one of which already has numbers saved in it and the other is filled by the user, when I try to do IF to compare all values of one array with the…
javascriptasked 4 years, 9 months ago felipe.silva 61 -
5
votes2
answers104
viewsDifficulty in interpreting Arrow functions that return Arrow functions in Javascript
I was seeing Javascript dependency injection and came across the following syntax: () => () => {} I know that () => {} is a Arrow Function which, in short, is a different way of creating a…
-
5
votes1
answer72
viewsWhat is Big Data and what is its relationship to the relational model?
I was reading about big data, However, I still can’t understand what the big data would actually be in its essence. I have always used the RDBMS model for data storage and manipulation and at this…
-
5
votes1
answer51
viewsHow to wait for a user action on a Job?
The Situation Having a service queue, where whenever a user enters the queue he receives a position number in the queue, I need to request the presence of the first of the queue. If the first row…
-
5
votes1
answer509
viewsPolymorphism in Typescript
I am creating my application with the following structure: An abstract class Person, and inheriting from Person, the classes PessoaFisica and PessoaJuridica, And finally, a class Cliente receiving…
-
5
votes3
answers203
viewsShould I always use Try catch to fix mistakes?
Sometimes when I know something may fail in my system I do a validation using if, equal is below: lista = [1,2,3] #um número que esteja entre os indices da lista numero = int(input(f'Digite um…
-
5
votes1
answer82
viewsR - Function to generate graphs and change axes
I need to display four charts several times in a Rmarkdown report. So I decided to create a function to plot the graphs. It was like this: gera_graficos <- function(base,var1,var2){ hist1 <-…
-
5
votes2
answers61
viewsWhat is the definition of delete in Javascript?
I came across an instruction that delete represents a type in Javascript. At least that’s what I understood. I’d like your help because I couldn’t find any references on the Internet. if…
javascript characteristic-language objects operators deleteasked 4 years, 9 months ago Willian Andrade 53 -
5
votes3
answers387
viewsIs there more than one way to use "if"?
const sequence = { _id: 1, get id() { return this._id++ } } const produtos = {} function salvarProduto(produto) { if (!produto.id) produto.id = sequence.id produtos[produto.id] = produto return…
-
5
votes2
answers181
viewsSimple ways to break a *while* with a function
I usually run into this problem: while True: input_chute = int(input("chute: ")) if input_chute == 0: break bla bla bla ... In that example above I break while with a condition and a break, however,…
-
5
votes1
answer140
viewsHow to make the ":. 0f" format not round my number
I wanted to know how I use the format ":.0f" without rounding up the number. I want to catch a input of seconds and turn it into minutes, here’s my code: segundos = int(input()) minutos = segundos…
-
5
votes4
answers823
viewsTransform String Array into Object Array
I got the following Array string: ["TagFuncao:CN Evento:TODOS", "TagFuncao:DOC.AGRO.INDUS Evento:TODOS"] I need to transform this Array into an Object Array where TagFuncao and Evento is property of…
-
5
votes2
answers441
viewsCheck if a string belongs to a list
This program is only printing that the letter entered by the user is a consonant, even when it is a vowel. I think it has to do with the in and not in, but I’m not sure. mensagem= list (input…
-
5
votes1
answer109
views -
5
votes1
answer40
viewsHow to scroll with 3 Divs
I’m facing a scroll problem .div-pai { margin: 30px; background-color: red; width: 300px; height: 300px; padding: 3px; overflow: auto; } .linha { padding: 5px; background-color: yellow; display:…
-
5
votes2
answers1104
viewsHow to eliminate variables that have some NA values in R
Currently I have a data frame with textual and numerical variables. However, some variables have NA in just a few observations, not all. For example, I have the following data frame Cidade Estado…
rasked 4 years, 10 months ago Lucas Azevedo 59 -
5
votes2
answers321
viewsHow to plot map with place names - ggplot - R
I downloaded the data and plotted a map with the demographic density of the cities of the Metropolitan Region of São Paulo. But it is difficult to identify the cities. rmsp <- readOGR("rmsp",…