Most voted questions
150,413 questions
Sort by count of
-
4
votes1
answer101
viewsHow to globally save the output of a function in R?
I have trouble saving function output in R. In the following code, for example, I create an array representing a sudoku game: quantLinhas <- readline(prompt = 'insira o número de linhas do…
-
4
votes1
answer63
viewsYup Mixed does not work notRequired or nullable
Good afternoon, I am validating the data of a form with Yup and need that only images can be loaded, so I used the following code: // formato que pode ser upado no input de email const…
-
4
votes1
answer351
viewsMerge the contents of two lists by considering the contents in Python?
The scenario is this, I have two lists, ex: list1 = [1,2,3,4] list2 = [5,6,7,8] I want to generate a new list that looks like this: [15,26,37,48] That is, to "join" the elements of each index. I did…
-
4
votes1
answer76
viewsCreation of objects in Javascript
Let’s say we want to create an object called Retângulo (if desired, with properties such as length, width, perimeter and area). As shown in the next diagram (created based on the information present…
-
4
votes1
answer564
viewsHow to check if a process is running on the server?
Thinking about the nescidade of verifying if a certain application is running on the server, I came to mind if you have how to do this checking using Delphi and if positive as it would be? In case,…
-
4
votes2
answers83
viewsReference one color column based on another
I have a dataset with several columns, but a specific column is reference for the colors of the chart, as I can reference this column in scale_fill_manua ggplot automatically? Obs. The same color…
-
4
votes1
answer31
viewsNo convergence of the estimates of the parameters of the Richards model in the "nls" package of r even with good kick start
I am estimating parameters of nonlinear regression models sigmoidais, only the Richards model returns the error: fator de passos 0.000488281 reduzido abaixo de 'minFactor' de 0.000976562 found the…
rasked 4 years, 3 months ago George Lucas 41 -
4
votes1
answer28
viewsCommand line correction R in ggplot2
I used the following code to generate the attached chart ggplot(dados,aes(x = Espécies, y = DNASat, size = Reads, fill=Espécies)) + scale_y_discrete(limits = positions) + geom_point(shape = 21) +…
-
4
votes1
answer110
viewsIt is possible to access a port via TCP/UDP from a web application
It is possible to send data to a port (e.g.: 5151) via TCP or UDP from a site, on the front end, using Javascript for example. I’ve been searching for a while and the closest I’ve come so far is…
-
4
votes1
answer77
viewsWebscraping - Site with choices
I have a more general question (although this site is more suitable for more specific things), and I would appreciate it if someone could help with some tips on where to start. It is possible to…
-
4
votes1
answer63
viewsFunction to find complete word, but independent of position in string
I’m having trouble using the str_detect to capture part of a text. I need the str_detect take only the word "garlic", but regardless of her position in the string. Ex: "Brazilian garlic", "Brazilian…
-
4
votes2
answers106
viewsEquality comparison
I’m studying ADVPL and came across two ways to make the equality comparison. There are comparisons made with two signs of equal: if cVar == "Valor" endif But there are also a few cases that I found,…
-
4
votes1
answer130
views(Language R) How to make the axis of the graphs more detailed in ggplot2?
I would like to know how to add more numbers to my y axis, so that the bottom grid has more horizontal lines. Note that in my chart, the Y-axis only shows the markings every 500 units (0, 500, 1000…
-
4
votes1
answer86
viewsMovement Chain of Ants
I got a flea behind my ear and I was wondering if you guys could help me out on this. I’m trying to make the edge (dashed) of a div (for example) turn clockwise as if it were a chain of ants going…
-
4
votes1
answer93
viewsFunctions with async / await running out of order
Can anyone explain to me if this is the expected behavior, or if I made a mistake in the code below? The expected behavior (in my understanding) would be to log 1,2,3 in sequence. let funcao1 =…
-
4
votes1
answer97
viewsgroup by semester/year PHP
Hello, I have a table with date field, I want to group by semester/year, I did so. SELECT SUM(quantidade) quantidade, YEAR(DATA) ano FROM tbmanipulacao GROUP BY YEAR(DATA), MONTH(DATA) <=6,…
-
4
votes1
answer74
viewsOptional dynamic keys Typescript
I’m trying to create an interface with dynamic keys: type Keys = 'a' | 'b' | 'c'; interface MyInterface { [key: Keys]: string; } In doing so, I get the following error: An index Signature Parameter…
typescriptasked 4 years, 4 months ago Gabriel Ribeiro 495 -
4
votes1
answer49
viewsggridges: peak heights proportional to quantities
Would anyone know if it’s possible, using the ggridges, make the heights proportional to the quantities? Follow the example: The problem is that the summit height of the first element, A624, with a…
-
4
votes1
answer100
viewsWhat is Monomorphization?
I was reading that posting and I came across that term monomorphization I’d like to know: What is its meaning? When this process occurs? What performance gain/loss is obtained by this process?…
-
4
votes1
answer61
viewsFilter objects with criterion in the array within it
Why am I not able to return only the objects containing the discipline Matemática? I’m using the methods map() , filter() and, within the filter(), the includes(), but is returning all objects. Can…
javascriptasked 4 years, 4 months ago user194399 -
4
votes3
answers291
viewsIn R, what is a Tibble?
What is a tibble? How she differs from a data.frame? The code below creates a data frame.. set.seed(123) df <- base::data.frame( id = 1:10, texto = letters[1:10], numero = rnorm(10) ) df #> id…
-
4
votes2
answers119
viewsImporting public packages into Deno
I was looking at some examples of code in the new Deno, and something caught my attention and caused me some discomfort. It was the way public packages are imported by Deno, through a URL. I know…
denoasked 4 years, 4 months ago Cmte Cardeal 5,299 -
4
votes1
answer80
viewsUsing the Strategy standard when it affects other parts of the system
... serves to define a family of algorithms, encapsulate each of them and make them interchangeable. Strategy allows the algorithm to vary regardless of the clients using it. Okay, I get it. But…
-
4
votes1
answer103
viewsStacked area chart
I’m trying to make an area chart according to the image below: But I’m using a different database than the one used for this graph and I’m having some questions: 1- I am using the following code:…
-
4
votes1
answer58
viewsWhat are Fibers in Ruby and how to use them?
I was trying to do a reverse proxy using Webrick when I discovered that the version I had installed from Webrick did not contain the methods necessary to make a "chunked" worthy reading. So I…
-
4
votes1
answer58
viewsWhat is the difference between the function call with ":" and "."?
In ruby it is possible to make a call from some method, either from some object, either using :: how much using .. What is the difference between them?
-
4
votes1
answer291
viewsComposition of objects in Python
In this case, I’m trying to understand how the connection between two classes and their objects. Since, when creating an object, a space in memory would be reserved for it, this space includes the…
-
4
votes2
answers193
viewsDefine criteria for sorting a list of lists
I have a list of lists of strings. For example a list, in which the internal lists have size n=3: listEx = [['verde','preto','laraja'], ['rosa','lilás','azul'], ['bordô','cinza','branco'], [preto,…
-
4
votes1
answer101
viewsRmarkdown - How to create a . pdf with a different name than . Rmd?
I created a script in . Rmd that will be played for different years. So I would like to be able to change the name of the generated . pdf. As it is: Report File.Rmd generates Report.pdf How I would…
-
4
votes1
answer176
viewsHow to use . reduce with async/await?
In synchronous code I can have a .reduce to make a sum calculation (as in this simple example of a shopping list): const tipos = ['leite', 'manteiga', 'pão']; const precos = [23, 21, 32]; const…
-
4
votes1
answer58
viewsWhat is the "-->" operator in C?
I’ve never seen this operator before, just another like ->, but it makes no sense in the context of that code. Code #include <stdio.h> int main() { int x = 10; while (x --> 0) { // x…
casked 4 years, 5 months ago Vitor Guimarães 367 -
4
votes1
answer68
viewsError in nls: step factor 4.65661e-10 reduced below 'minFactor' of 9.31323e-10
I’m trying to run an analysis "nls", but the following error appears: "step factor 4.65661e-10 reduced below 'minFactor' of 9.31323e-10" I am using the following data sets and formula:…
rasked 4 years, 5 months ago Milton de Paula 305 -
4
votes2
answers189
viewsSum function with a large value returns a wrong result
Why is my summation function returning to me 633223344234234200000 and not 633223344234234234235? function plus(n) { return n+1; } console.log(plus(633223344234234234234))…
-
4
votes2
answers242
viewsObject orientation: what defines the identity of an entity?
I know that the concept of identity, in this context, is abstract and it is precisely to make it more tangible that I asked this question. Follow the questions: Only database id defines an entity’s…
-
4
votes2
answers253
viewsIs it OK to use a switch inside a for?
Came to me a question related to the use of a switch within a for. I saw that it works for my purpose but this is correct to do in the world of programming? There is a better way to get the result…
-
4
votes1
answer241
viewsShould I ask for the user’s password twice at the time of registration?
In the registration forms, it is common to see the "Enter your password again" field, as a confirmation to make sure that the user has not missed the password entered. Thinking about the user…
-
4
votes2
answers154
viewsIs it possible to condition an operator += in a ternary?
I have an empty object: obj = {} I’m trying to check if there’s a key op1 in that object. If there is I want to add the key and any value, getting like this: obj = { op1: 10 } // O valor 10 é…
-
4
votes1
answer41
viewsDoubt about "resorteio" of equal values
I did a giveaway exercise using dictionary: from random import randint from time import sleep from operator import itemgetter jogo = {'jogador 1': randint(1,6), 'jogador 2': randint(1,6), 'jogador…
-
4
votes1
answer96
viewsIs it correct to read the Migrations files and the configuration file?
Files that make the database Migrations should be added in Git versioning? I am using Phinx and I have this doubt regarding the classes that represent the tables that are generated by this library.…
-
4
votes2
answers122
viewsAdd two array values and transform into a single Javascript variable
I’m a beginner and still in the saga of building a calculator. I can’t use it() I don’t know if it was the right choice but I used array to store the numbers, I’ve tried to use a third array to get…
javascriptasked 4 years, 5 months ago Caroline Santos 125 -
4
votes2
answers70
viewsPointer pointing to another pointer, how to use the free() correctly?
When I have a pointer pointing to another pointer like: int *ponteiro1 = malloc(sizeof(int)); int *ponteiro2; *ponteiro1 = 5; ponteiro2 = ponteiro1; free(ponteiro2); And I use the command…
-
4
votes1
answer145
viewsHow to make forecast charts in R?
I have a model that makes predictions and would like to plot the observed series and then the predictions, according to this graph: I tried to use the geom_smooth along with the geom_line, but…
-
4
votes1
answer182
viewsHow to improve angular performance with webpack or demand loading?
I have a large project with angular and need to leave the pages loading with a good performance, at first I set up a Customized Webpack for the application. But by applying it the downloaded files…
-
4
votes2
answers250
viewsPrint struct data with read values from a text file in C
I’m trying to make a simple program to read data from a text file, store it in a struct, and print that data on the screen. The code I have is this:: #include <stdio.h> #define max 70 typedef…
-
4
votes1
answer44
viewsHeap things on a function x DRY
That bold bit taken from here it wasn’t very clear to me: DRY solves what? Some may still be thinking that DRY is to reduce typing. Or at least gain maintenance time. It’s even in the latter case,…
-
4
votes1
answer48
viewsHow to make a parent <ul> element have the width of your children’s total <li>?
Have a div that dynamically displays a series of items grouped into a horizontal list. The parent element of this list has a maximum width defined in my CSS. It is possible to make the specific…
-
4
votes1
answer63
viewsWhat is the code convention name for variables that use _?
If variables declared as such: var camelCase = ""; follow the pattern camelCase, what is the default name for variables that use the _, as below? ruby_var = "a questão vale 10 pontos =)"…
-
4
votes1
answer342
viewsBar graph with different colors in ggplot2
I have a bar graph in the R with percentage variation, I would like the negative percentage values to be red, as in this example: But my chart is getting this way: Code I am using:…
-
4
votes3
answers56
viewsHow to Capture a File Extension in R
I am having difficulty capturing the extension of imported files. I would like to extract the file extension and store in a variable. arquivo <- "dados/Inscritos.xls" extensao <- ?…
rasked 4 years, 6 months ago Michel Andrade 41 -
4
votes1
answer90
viewsMultiple dispatch in Julia language
I’m studying about the language Julia and read that the multiple dispatch allows the functions to be dispatched dynamically, but it’s still not clear to me.