Most voted questions
150,413 questions
Sort by count of
-
3
votes2
answers56
viewsApply a function to a dataframe R
I created a function to automatically check if the value of a column is contained in a list. I could do dplyr::mutate + dplyr::ifelse, but as they are for many columns, it would be a very long code.…
-
3
votes1
answer81
viewsIs it correct to use an object to call a method where it will be the parameter?
I am creating a small project in without Entity Framework and I have a question at the time of passing an object as parameter, it is correct to pass the same object that calls the method as…
-
3
votes2
answers86
viewsWhy does Node.js accept value assignment with the "Undefined" identifier?
I was conducting a quiz on Node.js until I came across the following question: Which message will appear in the terminal for the following code executed by Node.js: Code (note that it runs outside…
javascript node.js characteristic-language objects undefinedasked 3 years, 6 months ago Cmte Cardeal 5,299 -
3
votes1
answer45
viewsAutomatically creating new variables through interaction between two pre-existing variables
Suppose I own the following set of dados: dados #> letras numeros cores valor #> 1 a 1 branco 2 #> 2 a 1 preto 1 #> 3 a 2 branco 9 #> 4 a 2 preto 4 #> 5 a 3 branco 8 #> 6 a 3…
-
3
votes1
answer48
viewsUnable to initialize a generic object with inheritance
I’m having a hard time accepting an inherited class as a generic class type. public class Teste { private void Testando() { var dog = new Cachorro(); dog.Nome = "Toy"; dog.Patas = 4;…
-
3
votes1
answer56
viewsDoubt with the counter at the while
Analyzing this code that serves to calculate arithmetic progression and that is working correctly: primeiro_termo = int (input ('Primeiro termo: ')) razao = int (input ('Razão: ')) contador = 1…
-
3
votes1
answer37
viewsWhat’s the difference between using one or two Arrow Functions in Useeffect?
In this reply from Soen, one uses a useEffect with two Arrow functions followed. Thus: useEffect(() => () => { window.removeEventListener('resize', compareSize); }, []); I wonder why the duo…
-
3
votes1
answer303
viewsWhat is the difference between Random.Choice and Random.Choices in Python?
I know they both draw random numbers, but what’s the difference between them ?
-
3
votes2
answers124
viewsALTER TABLE CHANGE is not renaming constraints automatically on the production server
According to the Mysql documentation (which in this case, I believe, also applies to Mariadb), when the command CHANGE is used to rename a column, the constraints are automatically renamed as well:…
-
3
votes3
answers81
viewsIs it possible to use functions in an arbitrary order in C++?
Apparently, the order in which functions are written matters in C++. Example, this code compiles: #include <iostream> using namespace std; int add_number(int x, int y){ return x+y; } int…
-
3
votes0
answers32
viewsWhat is it, Edgedb?
It’s quite common to see discussions like How to choose between Nosql and SQL? or even questions that question which bank is best. When reading more deeply we see that each type of bank seeks to…
-
3
votes2
answers102
viewsMy code is only returning half of what it should
I’m doing some simple exercises in Python and this code should return a list organized by the size of the fruit name, with the fruit with the shortest name first (in case, 'uva'). lista = ['maça',…
-
3
votes1
answer133
viewsHow to test the application with Kivymd?
I’ve developed a small test app that checks both the battery status and whether the phone is being charged. The app is running local from python main.py, but when I install it in Android Studio…
-
3
votes1
answer95
viewsHow to import content from a JSON within an ESM (Ecmascript modules) module in Node.js?
It is common for me to see online courses, articles and tutorials over the internet, Node.js codes that can import local JSON files into code to be manipulated, used, tested, etc... In these…
-
3
votes1
answer97
viewsHow to compare two string values with pandas?
Hello! I have two pandas dataframes and selected a column of each with ids. I want to compare the ids to see if the id of one dataframe is contained in another, but it does not have the same amount…
-
3
votes2
answers223
viewsCookie and sharing between subdomains?
I have a website with the following address http://www.mysite.com.br that in programming back-end is created some cookie settings and even information with encrypted data. A subdomain has now been…
-
3
votes1
answer48
viewsWhat is the point of using Option as a type in the argument of a function?
I’m trying to use a function that has as argument a variable of type Option. An example without Option: fn main() { next10(9); } fn next10(n: i32) { for i in n..n+10 { println!("{}", i) } } An…
-
3
votes5
answers145
viewsCheck if a string is composed only of '0' and '1'
I want to check, for example, if the string '01001011' is composed only of '0' and '1'. I’m creating an html learning project to convert binaries to decimal, and I want to create a function that…
-
3
votes2
answers36
viewsCount frequency of occurrences including zeroes
For the following case the x count using the function table will return the frequency of the existing values. I would like to know how to return the count to the discrete interval from 1 to 12,…
-
3
votes1
answer172
viewsWhat is the breakpoint function for
I’m digging myself in python, and as a good curious beginner I am researching the functions already present in the python without the use of any library, when I come across the function…
-
3
votes0
answers22
viewsWhat is Edge Computing?
What would Edge Computing be? How does it relate to Industry 4.0 and Cloud Computing?
-
3
votes1
answer35
viewsNeural network with a scalar input (time) and 3 output values that does not train properly
Hello! I am building a network that should map time values to a vector containing 3 values of reagent concentrations, simulating a chemical reaction of type A->B->C. The concentration values…
-
3
votes1
answer33
viewsHow to set a stylesheet for a widget without affecting your child widgets in Pyqt5?
I am creating a window with Pyqt5 Framework and need to add to it a background image. For this, I am setting your stylesheet thus: mainWindow.setStyleSheet('background-image: url("./MyImage.png");')…
-
3
votes3
answers69
viewsMatplotlib sorting using index as bar denominator
I am at an impasse and cannot find a solution. I wish to generate a Bar Plot from a dataframe that is reordered in descending order. I would like the bar name to be the index (0 to 5) When I plot my…
-
3
votes2
answers84
viewsHow to access the position of multiple matchs of a regex in a string?
I know I can access the position of a match of a regex in a string using the methods start, end and span. Example of a program that identifies repetitions in a text: import re from colorama import…
-
3
votes1
answer90
viewsImage transformation according to parameters of a photo
I have an aerial photo of a lake and I have a file . geojson with a polygon that represents the outline of that lake on a real map. I am converting latitude, longitude and altitude to X, Y, Z using…
-
3
votes0
answers48
viewsProblems with formData in Multiple Upload Express and Multer
I’m having trouble uploading multiple images to the backend. The method in the backend is correct, when I test via insominia the right one, however from my front it does not generate the data…
-
3
votes2
answers87
viewsRegex to catch single word
I’m trying to create a regex that takes an exact value within a text, example: let texto = "troquei meu carro por um outro carro uma carroça" console.log(texto.replace(/carro/g, 'barco')) The…
-
3
votes1
answer122
viewsWhat is the difference between "javascript:void(0)" and only "void(0)" when defining onclick in HTML?
When using Phpstorm, I noticed a Warning pointing to the code where I did onclick="javascript:void(0)", recommending that you leave only onclick="void(0)". Is this a good and valid practice? I found…
-
3
votes1
answer56
viewsHow to calculate average between lines
I have a dataset of information with years on the line. I need to do an average every two years, as the example below, where the first four columns are the existing data and the last two, which is…
rasked 3 years, 7 months ago Daniel Manzi 51 -
3
votes1
answer60
viewsHow can a value be invoked (as a function) at the same time as it contains properties (as an object) in Javascript?
I was left with a question concerning the structure of the Express. How Express can be invoked, as in express(), but can also have in its structure access to the Router property, for example? I…
javascript node.js function characteristic-language objectsasked 3 years, 7 months ago Otavio Fagundes 978 -
3
votes1
answer47
viewsggplot: geom_area - error with aes(Fill)
I have the following data and would like to create a chart with the ggplot2::geom_area() with different colors for the positive and negative values. However, I am getting an error and I am not being…
-
3
votes1
answer36
viewsProblem with dots that don’t join lines in ggplot
I have the following data file Go for data reading structure(list(ano = c(2018L, 2018L, 2018L, 2018L, 2019L, 2019L, 2019L, 2019L, 2020L, 2020L, 2020L, 2020L), Regiao = c("BaixadaFluminense",…
-
3
votes3
answers68
viewsRegular expression to take one or more occurrences that precede and follow a given letter
I have the following cases... a first text as follows:: let text = "olá meu numero é trezentos e vinte e quatro tudo bem?" And this text I want to receive can also be as an example: let text = "olá…
-
3
votes1
answer167
viewsHow to use setTimeout to show a component only after a certain time with React?
I want a certain component to appear on the screen after 1 second. You can do this using JSX block? When I put the code below, a number appears on the screen instead of the message. function App() {…
-
3
votes1
answer64
viewsWhat is the access modifier of an explicit implementation?
I created an iterator class that implements the interface IEnumerable<T>, implementing the interface IEnumerable. To make the implementation correctly, it is necessary to explicitly implement…
-
3
votes1
answer148
viewsHow to hide characters from a Cpf using substr_replace() in table column?
I was able to hide the characters of an email in an employee listing table using substr_replace() leaving as an example c*****[email protected]. Now I don’t know how to do it in the field cpf. Here is…
-
3
votes2
answers53
viewsProcess command line arguments
Hello, I’m trying to work with command line argument process, I’ll show you an example command line I’m using: user@notebook$ python arquivo.py -nome Lucas --idade 12 --pais Brasil Code: import sys…
pythonasked 3 years, 8 months ago Afuro Terumi 231 -
3
votes1
answer103
viewsWhat is the Unicode flag "u" in regular expressions? What is its function?
Some time ago I discovered that regular expressions can also use the flag u, which I think is short for Unicode. What is the purpose of this flag? I know it was added in some recent version of…
-
3
votes2
answers100
viewsProblem with Javascript date comparison
I have a Javascript function that is to check if the "current data_is" is larger than "data_validity". If larger, it is to display on the screen the "Expired" text, if not, keep the "Valid" text".…
-
3
votes2
answers450
viewsWhat is Aggregate in Mongodb?
I know this kind of doubt I find "easily" in the documentation itself and on the internet, however even in the official documentation became very confused and very technical with several unknown…
-
3
votes3
answers220
viewsHow to popular a dynamically key and value dictionary?
Write a program that takes an integer n value and returns a dictionary where the keys are numbers from 1 to n and the values are the squares of their respective keys. Ex: for n = 8, the result…
-
3
votes1
answer62
viewsDifference of {} and = in a declaration
What is the difference of two statements? On what occasions should I use each one? - int Num{15}; - int Num = 15;
-
3
votes2
answers65
viewsPrint an Array in <li> line by line with javascript
I need to place the array values inside a list (li), line by line, but the result received brings values in single line. let x = [ { y: 'Título 1', z: ['1' , '2'] } ]; html = ''; for(let i of x){…
-
3
votes1
answer73
viewsggplot2: get color palette used in scale_color
Do you know if it is possible to get the color palette used in scale_color_*? I would like to get the specific colors (Hex color codes) used with the package paletteer in each case to then use it in…
-
3
votes2
answers60
views -
3
votes1
answer677
viewsWhat does Please Tell me who you are in git mean?
I am totally new in this area of technology, I am following a course but I stopped. When I try to give a git commit -m "commit inicial" the string message in git is this: Author identity unknown ***…
-
3
votes1
answer32
viewsProblem extending the Django.db.models.Manege class
I extended the class django.db.models.Manager to pick up the records that are públicos and by doing so I can no longer list all the calling records Product.objects.all() Even in my administration…
djangoasked 3 years, 8 months ago danilomarto 59 -
3
votes1
answer56
viewsHow to write tests for an External API call?
I am researching about Unit Testing and TDD and wanted to apply this to some scripts I have developed. The issue is that these scripts create data on an external service by calling API methods, for…
-
3
votes1
answer35
viewsCenter values from each bar on matplotlib charts using Python
I’m doing studies on the library matplotlib in Python language extracting data from a local database, also using bilioteca sqlite3, the amount of cities that make birthday at home month of the year.…