Most voted "summing-up" questions
48 questions
Sort by count of
-
6
votes5
answers223
viewsSum of hours greater than 24 hours
I have a variable with the value '18:00', which corresponds to a duration received through calculations between two times. $tempo = '18:00'; // queria somar 8:00 Answer: $temposomado = '2:00';…
-
3
votes2
answers1338
viewsr - sum of a variable relative to the values of another variable in a data frame
I have a multi-column dataframe. How do I add the values of a column within an element of another variable? I want to do this to summarize the data of each species within each campaign. I tried to…
-
2
votes2
answers142
viewsError summing each row of a 5x3 matrix
Hello, I’m having a problem adding up each of the lines of my matrix and storing in a vector my code is like this: #include <stdio.h> int conta(int * matriz[5][3], int * vet) { for (int i = 0…
-
2
votes1
answer629
viewsProgram in python regarding the factor of odd numbers up to the one typed by the user
I must ask the user to enter an odd number and return on the screen the sum of the factorial of all the odd numbers until the one typed by the user. I did the part that validates if the number typed…
-
2
votes3
answers723
viewsPython: conditional sum with variable condition
good morning. The task is as follows, I am trying to make a 'a,b,c' curve of products per company. I have the following df as an example: df = pd.DataFrame({"empresa":["HST", "HST", "HST", "HSC",…
-
1
votes2
answers683
viewsSum (SUM) of an irregularly formatted column
In my Mysql table I have a column called "weight". This column has the following values: 19.325 14.369 15.325 15.369 17.698 19.258 18.098 I simply need to accomplish the sum, but when I perform…
-
1
votes0
answers69
viewsHow to sum up an Oracle select case
I am trying to make a sum in a select case, but apparently it is not valid, the following error appears " ORA-01858: a non-numeric Character was found Where a Numeric was expected". when I remove…
-
1
votes0
answers44
viewsMulti-table Data Sum Problem using PHP and MYSQL
Guys, I developed a call system, and now I need to do the report of students with the amount of absences and attendance. I use 1 table(chamadas) to register some information of the call and when you…
-
1
votes1
answer187
viewsSum and Multiplication with items of a CSV
good night! I’m new to programming and I’m learning to code in python. Also, I’ve been trying to create something that’s relatively simple, but I’m finding it difficult to execute. I imported a list…
-
1
votes1
answer303
viewsSum of two floats with 2 decimal places resulting in 4 decimal places in JAVA
I am having a JAVA problem where I want to store calculation results with only 2 decimal places in SQL Server. For that at the end of my calculations I perform: Math.round(valor * 100.0f) / 100.0f;…
-
1
votes1
answer186
viewsSum PL SQL Lines
Galerinha, I created a code that organizes all the tasks of the company by sector. The objective of this code is to identify the percentage of delayed activities by sector. The result was expected.…
-
1
votes0
answers17
viewshow to make a summation range dynamic to include only the days of a given week
I have a table (google Sheets) that generates dynamically, by choosing the month, a calendar sheet formatted with different colors for weekends and holidays. I intend to add the weekly hours on the…
-
1
votes2
answers68
viewsAdd values inside XML tags with C#
I’m trying to create a C# script for a Plugin in Notepad++, where the goal is to add all the values inside the tags <ValorDesconto>, <ValorCancelamento> and <ValorTotalLiquido> of…
-
0
votes3
answers682
viewsSum of an array and PHP value concatenation
I have a dynamic array, it contains duplicate keys (TAG): [0] => Array ( [0] => Array ( [tag] => 5x1 Acessori Kids [pedido] => 6701622409 [quantidade] => 2125 ) ) [1] => Array (…
-
0
votes1
answer149
viewsAdd PHP multidimensional array
Good morning, I have the following array: Array ( [0] => Array( [data] => 2018-06-08 [grupo] => 1 [maq] => 1 [segundos] => 10089 ) [1] => Array ( [data] => 2018-06-08 [grupo]…
-
0
votes1
answer130
viewsAdd values from an array with different criteria each of them
0 : {idPVI: “10”, idPV: “3”, descri: “Portuguesa”, preco: “32” } 1 : {idPVI: “10”, idPV: “3”, descri: “Portuguesa”, preco: “32”} 2 : {idPVI: “13”, idPV: “3”, descri: “Calabresa”, preco : “35”} 3 :…
-
0
votes1
answer141
viewsAdd comma-separated records - PHP + MYSQL
In mysql database I have the following table: Note that the column field is in json format. I have several records in a single field. I need a script to count each record separated by comma and add…
-
0
votes1
answer1236
viewsSum values with PROV
I have an Excel sheet with monthly spending per food. The goal is, on a separate sheet, to calculate the sum of each food in every month. With the formula I’m using right now…
-
0
votes1
answer505
viewsConvert sum of minutes to hours format (eg 70min = 01:10) with jquery
I have the following script that takes the hours and minutes of each day of the week, where the variables that start with m are the minutes of each day of the week (coming from a select) and those…
-
0
votes1
answer1037
viewsCreate successive sum multiplication program in Python
The requirements are: solve positive and negative numbers; Do twice the one million, never a million times the 2, ie always the fewest sums; use the Try and ask for new execution. Like I’m trying to…
-
0
votes1
answer146
viewsArithmetic calculations (sum) in the Flask-Sqlalchemy database
I have a table in my database that the user places the total flight hours he has done. I wanted to know how to add all the hours of the user who is in the database and show in templates. Backend:…
-
0
votes3
answers597
viewsSumming up JSON values
I’m starting to mess with JSON and Javascript and have the following AJAX: $.ajax({ url: 'https://...', type: 'POST', dataType: 'json', data: 'inpnomeRequisitante=' + 'XXXXXXXXXX', success: function…
-
0
votes1
answer344
viewshow to do total in list elements Python Django
Enter primary data (raw data)where it has values . Flot and I am already calculating the total in function "totalv2" ta run class Funcionario(models.Model): Custocoleta = models.Decimalfield(…
-
0
votes1
answer43
viewsHow to add a number to an array?
Hello! All right with you? I’m making a code and I needed to define a function: def sigmoid (v): return 1/(1+np.exp(-v)) Only what I’m assigning to the function is an array 2d. My question is: in…
-
0
votes0
answers12
viewsReturn the sum of all integer numbers from up to the number
i have the variableNumber = 10 and I have to return a sum of all numbers from 1 to the numberNumber, but I have no idea how to do this, someone can help? for example: numeroInteiro = 10…
-
0
votes1
answer26
viewsHow to sum the lines of a two-dimensional vector and show the result of the sum of each line?
for (int i = 0; i < vetor.length; i++) { for (int j = 0; j < vetor.length; j++) { soma += vetor[j][i]; } System.out.print("Aluno " + (i + 1) + " : "); System.out.println(soma + " "); }…
-
0
votes2
answers719
viewsTotal sum with multiple values dynamically using jQuery
I’m trying to do a function that takes the values of all <div class="preco-produto"> make the total sum and population in the <div id="final">. I made the function that separates the…
-
0
votes2
answers165
viewsAlgorithm for summation of doubles
Given a vector V of integers, ordered, and a value s, write a complexity algorithm O(n) to compute how many pairs of numbers have sum s. In this vector there may be repeated numbers. Note that if V…
-
0
votes1
answer169
viewssoma_ll function that receives a list of lists and returns the sum of all numbers
def soma_ll(lista): return lista[0] + soma_ll(lista[1:]) Why doesn’t my test run? def test_600_soma_ll(self): self.assertEqual(soma_ll([1,2,3]),6) self.assertEqual(soma_ll([1,2,3,4]),10)…
-
0
votes2
answers54
viewsJS to add online checkbox
I don’t know much about you, so I need some help. I have a page that generates a form with a quotation map, in columns (each supplier in a column), and I need the user to select the checkbox he make…
-
0
votes1
answer250
viewsMysql extract from INPUT and OUTPUT tables
I’m a beginner in Mysql and PHP, I’m building a financial management application for a charity, (volunteer work), and I can’t solve this problem: Performing a Mysql query in the IN and OUT tables…
-
0
votes1
answer282
viewsHow to make a cumulative sum in Bigquery?
Hello. I need to create a Dashboard from a query. I would like to generate this column in the query always adding up to the previous month, ie a cumulative sum. ex: instead of: mês 1: 2 mês 2: 3 mês…
-
0
votes0
answers9
viewsHow to sum an equation with index (i-1) in Gams?
Hi, guys! I’m writing a program (Linear Programming Mixed Integer) that contains equations like the following: r2a(s,d,theta).. limitesuperior(s,d-1)*y4(s,d,theta) =l= sum(f,x1(f,s,d,theta));…
-
0
votes2
answers192
viewsSum of numbers in a range C++
I need to make a program with a recursive function that takes two integers as parameters n and m, where n <= m and returns the sum of the numbers in this range. For example, if n = 1 and m = 4…
-
0
votes1
answer321
viewsI need to add some specific lines in a data frame
I need to add the value of the lines in which appears "Resposnsável C', in a practical way I need to add lines 3, 4 and 9 from column 2, the result should be 112. So far I’ve been able to print the…
-
0
votes0
answers67
viewsSum function in SQL database
I need to create a user role (user function) which receives as input parameters a store identifier code and a category identifier code and returns as a result an integer value that informs the…
-
0
votes0
answers24
viewsSum date in a form field
I need to get the date sum from the integer number indicated in the form field, and display it in the second date field in a process form. I tried the following: var dias =…
-
-1
votes2
answers905
viewsAdd values from the same PHP array
It seems to be simple but could not, I would like to add the following array (are two arrays within one, it is divided with the array_chunk): $arr = [ [1, 2, 3, 4, 5], [6, 7, 8, 9, 0] ]; I would…
-
-1
votes3
answers737
viewsMake an "Update" with sum of a number that is as character
I need to perform a update summed in a table whose column is of the type text. Example: UPDATE produto SET codigo = 'codigo'+ 1; I have the following return: UPDATE produto SET codigo = 'codigo'+ 1;…
-
-1
votes1
answer61
viewsFunction for Python Sum and Average
I am trying to develop these functions, when I type the numbers 1, 2, 3, 4 and 5, they return me the results 1 and 0,2. Can help me know what I’m doing wrong? def soma(lista): soma_lista = 0 for i…
-
-1
votes1
answer31
viewsError request for Member 'salario' in Something not a Structure or Union
Guys, I need help with the sum of variables in a struct. the program does not compile and displays this error [Error] request for Member 'salario' in Something not a Structure or Union. The…
-
-1
votes2
answers104
viewsConcatenate string and return the number of characters
This is what I need to do: 1 - Create a function called tamanhoNomeCompleto 2 - I received name and surname as parameter, ie two parameters 3 - This function will return the full size, counting an…
-
-1
votes1
answer54
viewsSum of two numbers always results in zero
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,…
-
-2
votes1
answer103
viewsHow to add values from a for structure?
So, I need to solve a little problem in my code (I’m very newb), I’m just programming because I need it for my TCC, I don’t know much python but I’m trying to turn around. On line 126 there’s that…
-
-2
votes1
answer28
viewsSum of 2 date.frame columns
I need to add two columns of a date frame.. Example: Preiso add all rows of the columns rural and urban. I tried the apply and rowsum codes and all gave error. Error apply: apply(educa[, 3:4], 2,…
-
-2
votes1
answer36
viewshow do I see the total
I’m creating a college shopping app, I need that when I press the add button it shows the value of the specific product in total and that it adds together the following values when pressed the add…
-
-3
votes1
answer316
viewsSum in php does not work
Good morning, I have the following problem: I want to add the initial evaluation with the final evaluation and the result appear on the screen but always zero, where I am failing? <th> <div…
-
-5
votes1
answer111
viewsSum with vector and pointer in C
Goal: Sum 7 numbers typed by the user that will be stored in an array, the sum must be done with a pointer. Problem: The pointer generates an wrong result, if I take the asterisk from the pointer…