Most voted questions
150,413 questions
Sort by count of
-
3
votes1
answer622
viewsHow to reverse git push --force?
I made a git push --force, but I wish I had git push --force-with-lease it is possible to reverse this?
-
3
votes1
answer588
viewsHow to start an object in Typescript without declaring all properties at once?
Taking into account the following interface: interface Usuario { nome: string; senha: string; email: string; } It is possible to declare an object "slowly" without creating a new type or interface…
-
3
votes1
answer63
viewsWhat is the parameter passed in Sort()
Doing an exercises I came across the following parameter passage in sort(): let notas = [7,6,10] notas.sort((a,b) => a < b ? 1 : -1) console.log(notas) I could not understand, since I have…
-
3
votes1
answer354
viewsRegex in input Pattern is not valid, but the expression is functional
I have a field on a form that can only accept Youtube or Vimeo Urls. Having this, I found the following regex:…
-
3
votes1
answer138
viewsHow to evaluate whether a string is present in an array in Powershell?
I’m writing a git hook to check if the commit message matches an array of words. $array = @('Adiciona', 'Altera', 'Corrige', 'Refatora', 'Remove') $msg = "Coloca coisas ao projeto." if…
powershellasked 4 years, 5 months ago João Antonio Santana 31 -
3
votes2
answers124
viewsLANGUAGE R: Error "Error in course[[1:98]] : recursive indexing failed at level 2" when trying to search the items in a list, how do I resolve?
I have a "course" list in R, it consists of 98 items, each item has one or two variables of type Character. I want all the first variables of each item in the list, but when typing the command:…
-
3
votes0
answers35
viewsHow does the Python identity operator work?
I’m starting in Python and would like to ask a question based on the code below: Case 1 x = 5 y = 5 print(x is y) # retorna True Case 2 x = "carro" y = "carro" print(x is y) # retorna True Case 3: x…
-
3
votes1
answer74
viewsWhy char. Parse(string) returns a number?
I am making a program that uses Typecast, but when I converted a string to char (char.Parse()), received the following return: 115's' What is the reason for the conversion of string to char return a…
-
3
votes2
answers71
viewsAllocation of values other than normal
def testes(x, y): while y: x, y = y, x % y return x I don’t understand this part of the code, what happens with the 'x' and the 'y' on the left side of the equals sign and what the 'y' does on the…
-
3
votes1
answer99
viewsCoding Problem Between Javascript Client and Python Server
I have a server socket in Python, follow the code: from socket import * host = '127.0.0.1' port = 6060 try: server = socket(AF_INET, SOCK_STREAM) server.bind((host, port)) server.listen(5)…
-
3
votes1
answer119
viewsCSS: Shading of "triangle" created using ::after
I created a box by css and created a "triangle" using ::after to give that effect of the top bigger than the bottom, just to improve the same aesthetics.. I simplified the code to study character:…
-
3
votes3
answers95
viewsDifference between creating a list with each iteration and using a list comprehension
I need to calculate the distance between the points (0,0) and (1,1). For that, I wrote the following code: def distance(x, y): if len(x) != len(y): return "x and y não possuem o mesmo comprimento"…
-
3
votes1
answer258
viewsHow to clear the data of the fields that were requested by JSON when the client is not selected?
My JSON code makes a data request through a query by the client ID, only that I realized that when it does not select the client the data of the previous request still remain in the fields. That is…
-
3
votes0
answers122
viewsHow to add/remove shadows from an element with "position: Sticky" as scrolled?
I made a table with the header and the last fixed column using position: sticky. To give an impression that it is above other columns/rows, I used box-shadow, but it gets weird to leave the…
-
3
votes0
answers37
viewsRefresh in a <li>
I have a content inside a <li> I need to refresh her at the event onclick. But within this li there is a function in php. How would that be possible?…
-
3
votes1
answer117
viewsHow to access static methods of a class included in the consign in Nodejs?
Hello. I am building an application with nodejs and I need to authenticate users by registering a new user and logging into the application. I’m using consign to perform autoload of my scripts, as…
-
3
votes1
answer64
viewsWhat are HTML interfaces for?
Every specification (documentation) that I see of a certain HTML element, always specify the element to a type of interface as, for example: HTMLTableCaptionElement HTMLButtonElement HTMLBRElement…
-
3
votes1
answer131
viewsWhat is the advantage of using Perl-compatible regular expression functions or POSIX-compatible ones in PHP? In what context do you use both?
PHP has regular expression functions compatible with Perl and POSIX. However, I can’t see if one stands out from the other or which contexts of use favor one or the other. It would just be a matter…
-
3
votes1
answer177
viewsPython List Invert Values
I am trying to invert two values within a nested list. Example: In the list list there are two values [[1,11],[2,22],[3,33],[4,44]] and would like to reverse the values for…
-
3
votes2
answers294
viewsHow to plot distinct regression models using the ggplot2 + ggpmisc or gridExtra packages?
Hello! I have some difficulty generating graphs with different regression models (quadratic, linear) (FIGURE 1), it is observed that the graphics are loose ("free" scales) when using the…
-
3
votes1
answer225
viewsI have a problem with my Github repository - Empty directories
I have a problem after submitting my project on Github, which contains two directories. However, after sending and committing, the repository on Github gets empty folders and a little arrow. This…
-
3
votes1
answer23
viewsHow to count records in the Onetomane relation returning zero when there is no match
Friends, I am trying to make an app to control investments in shares. In DB of this app I have the table portfolio and active table. I need to make a select that returns to me the active portfolios…
-
3
votes1
answer342
viewsDate coming with date tomorrow instead of today
My date’s coming up with the wrong date, tomorrow’s coming up plus I want today’s date. For my application the date and time cannot be wrong. I’ve checked the date on the server and it’s correct:…
-
3
votes2
answers194
viewsCondition to continue loop while invalid value
I wanted to know about this code: Algoritmo "Brincadeira2Ou1 " Var A, C, P: inteiro Inicio A <- 0 C <- 0 P <- 0 escreval ("(=====================2===OU===1=====================)") escreval…
-
3
votes1
answer307
viewsWhat is the difference between object code and intermediate code?
In this question a user answered that the object code is different from intermediate code. Since most courses say that the object code is in the middle of the process, then we could not call it…
-
3
votes1
answer463
viewsWhat is object code?
What is object code? What is object code for? What is the process of translating object code into machine code called? I’ve seen talk until the language C uses Assembly as object code, is that…
-
3
votes3
answers116
viewserror in Count function
The function count is always showing the result 0, someone can help me? nome = [] voto = [] aux = 1 while aux != 0: nome = str(input("Qual é o seu nome? ")) aux = int(input("Qual é o melhor sistema…
pythonasked 4 years, 5 months ago Kevin Jordan 43 -
3
votes1
answer292
viewsWhere can I find the reference for defining dates of the dd/mm/yyyy format?
I’m doing the documentation of an API, but I don’t know where I can find what defines the date in the Brazilian, Italian, etc., formatting styles dd/mm/yyyy. Dates in format yyyy-mm-dd are defined…
-
3
votes3
answers1081
viewserror install virtualenv in python
I can’t create virtualenv, I did a search teaching how to install and when I run the install from it this error here Python version 3.8.3 > root@AlexPc:/# apt install python3-virtualenv Lendo…
-
3
votes1
answer50
viewsDifference between conventional SELECT and INNER JOIN
Model of the structure of the tables: Tabela: Bancos Cod Nome Tabela: OperacoesBanco Cod CodBanco ValorOp Historico Well I have these two models of SELECT: Example 1 SELECT b.Nome, o.ValorOp,…
-
3
votes1
answer91
viewsHow to deal with business rules?
I am working on a C# WPF + EF6 application and find myself lost when it comes to reusing business rules. I’m using the standard repository + Unit of work, but I believe that copying-pasting complex…
-
3
votes1
answer77
viewsDelete records in 2 tables with only 1 DELETE command
Model of the structure of the tables: Tabela: Produtos id_produto titulo_produto descricao_produto Tabela: Fotos id_foto descricao_foto id_produto We can observe that the tables have in common the…
-
3
votes3
answers77
viewsHow can I access a subclass method through a superclass-like object
Having an ABC super class public class ABC { int x = 0; public int getABC() { return x; } } public class XYZ extends ABC { int y = 0; public int getXYZ() { return y; } } Instantiating an ABC object…
-
3
votes1
answer579
viewsCalling child method in parent component within a v-dialog
Hi, I’m trying to call a method that’s in the child component through the parent component. The HOWEVER is that if I involve the child component specifically in a 'v-dialog' the code does not work,…
-
3
votes1
answer66
viewsRollback does not work
So guys I have a transaction to persist various data on different tables in my database, if by some chance a record goes wrong I need it from a rollback, after all I depend on the return id of one…
-
3
votes1
answer45
viewsLoop with R arrays
I need to create a matrix that has all the coordinates for a 128x128 matrix in R if it were a 3x3 matrix, ex: 1 2 3 1 a b c 2 d e f 3 g h i I would need the following matrix x y 1 1 1 2 1 2 3 1 3 4…
-
3
votes1
answer69
viewsHow to put currency prefix (R$) in the status bar of the shinyWidgets R package?
Is there any way to show the numbers as currency (R$), including thousands and cents separator, in the progress bars of Shiny’s shinyWidgets package? I’m trying to run some code, but they all…
-
3
votes1
answer50
viewsWhat does the "~" operator mean in tidyverse context?
Suppose the data set below: df_1 <- structure(list(var_1 = c(42.0324095338583, 86.828490421176, 42.4499513395131, 87.8373390808702, 69.4962524808943), var_2 = c(52.6775231584907,…
-
3
votes3
answers1427
viewsMoving average in R
I need to make a simple 7-day moving average on R, I’m using the function rollmean package zoo, but the values being returned are incorrect. Example: library(zoo) teste <- sample(1:50) mean <-…
rasked 4 years, 6 months ago Alexandre Sanches 1,223 -
3
votes1
answer72
viewsProblem with key in ggplot, using double axis y
I would like a help to solve this problem. I would like the caption to present dotted lines (linetype), dotted (shape) and colors (colour) equal to the graph, but this graph has a double axis for y,…
-
3
votes2
answers129
viewsLoop Operation with Multiple Data Frames
Assuming the following example in R: Sample_data <- data.table(code = c("AAPL","AAPL","AAPL", "AMZN","AMZN","AMZN", "MSFT","MSFT", "GOOG","GOOG","GOOG", "FB"), date =…
-
3
votes2
answers177
viewsHow to insert objects using canvas (javascript) and avoid 2 objects in the same position
I’m doing a canvas test to randomly insert various polka dots into a rectangle. I use a random position for each ball, as long as the limit is less than the width of the rectangle. So far so good,…
-
3
votes1
answer47
viewsHow to concatenate columns identified by surname?
I have the following appointment: select case when datediff(...) > 0 then month(tblData.data1) when day(tblData.data2) > 10 then month(tblData.data2) when month(tblData.data2) = 1 then 12 else…
-
3
votes1
answer56
viewsHow to bring an array that is in a separate file to the application?
I have a JS (data.js) file that contains an array of the information below: module.exports = [ { "photo":…
-
3
votes1
answer438
viewsHow to increase Y-axis scale marks in graphics in ggplot2?
I have a chart with very long scale marks between you, I’d like to increase the amount, but I don’t know how it’s possible. I would like to increase the number of values in the Y axis, for example,…
-
3
votes1
answer62
viewsHow to plot negative coordinates (South Pole) using ggmap, ggplot?
I’m trying to plot some points between South America and the Antarctic Peninsula, but from the error when I delimit the area I wish to appear on the map (xlim, ylim). I had already plotted the map…
-
3
votes2
answers349
viewsHow to calculate the result of an arithmetic expression contained in a tuple respecting the operators' precedence?
I have a tuple containing the tokens of an arithmetic expression: ('5', '+', '2', '*', '5'). I tried to calculate the result of the expression, but it is not respecting the precedence of the…
-
3
votes1
answer524
viewsHow to insert animated gif into pygame
Good afternoon, I’m doing a college job, it’s a python game and I need to insert a gif in the code but when I use the command pygame.image.load("correr.gif") it shows the image of the gif frozen,…
-
3
votes0
answers32
viewsDoubt in the MVC standard: should one service talk to another directly?
It is correct for one service to talk to another directly through dependency injection, or who should manage this communication is the controller. Ex.: I have a service(A) that needs a data obtained…
-
3
votes2
answers65
viewsGET by passing all records in URL and POST Presents only the last record
Good afternoon guys, all right ? I’m trying to create a page to insert items inside a cart, this page keeps the client code and the command code in a variable and passes it between screens, on my…