Questions tagged [addition]

Addition is a mathematical operation that represents combining collections of objects together into a larger collection. It is signified by the plus sign (+).

Addition is a mathematical operation that represents combining collections of objects together into a larger collection. It is signified by the plus sign (+).

It is commutative, meaning that order does not matter, and it is associative, meaning that when one adds more than two numbers, order in which addition is performed does not matter.

(Wikipedia)

5629 questions
53
votes
7 answers

Add JavaScript object to JavaScript object

I'd like to have JavaScript objects within another JavaScript object as such: Issues: - {"ID" : "1", "Name" : "Missing Documentation", "Notes" : "Issue1 Notes"} - {"ID" : "2", "Name" : "Software Bug", "Notes" : "Issue2 Notes, blah, blah"} -…
Matt
  • 23,363
  • 39
  • 111
  • 152
51
votes
3 answers

Unable to track files within Git submodules

Problem: to add files at ./shells/smallApps/* to Git at ./.git/ when I do not have the files at ./.git/info/exclude nor at any .gitignore -files. This question is based on this tread where the problem is not solved completely. I run $git status …
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
49
votes
6 answers

Null values of Strings and Integers in Java

public class Test { public static void main(String[] args) { String s = null; String s1 = null; Integer i = null; Integer i1 = null; System.out.println(s+i); System.out.println(i+s); …
tania
  • 1,086
  • 2
  • 12
  • 31
48
votes
3 answers

How do I add two integers together with Twisted?

I have two integers in my program; let's call them "a" and "b". I would like to add them together and get another integer as a result. These are regular Python int objects. I'm wondering; how do I add them together with Twisted? Is there a…
Glyph
  • 31,152
  • 11
  • 87
  • 129
48
votes
1 answer

How can I add an int (minutes) to LocalDateTime.now()?

I want to modify LocalDateTime.now() by adding a certain amount of minutes to it. How do I do that?
user2765654
47
votes
6 answers

How to add rows to empty data frames with header in R?

Possible Duplicate: R: losing column names when adding rows to an empty data frame I created an empty dataframe with column names only as follows > compData <- data.frame(A= numeric(0), B= numeric(0)) > compData [1] A B <0 rows> (or 0-length…
Surjya Narayana Padhi
  • 7,741
  • 25
  • 81
  • 130
46
votes
9 answers

PHP: add seconds to a date

I have $adate; which contains: Tue Jan 4 07:59:59 2011 I want to add to this date the following: $duration=674165; // in seconds Once the seconds are added I need the result back into date format. I don't know what I'm doing, but I am getting odd…
ADM
  • 1,590
  • 11
  • 36
  • 54
45
votes
3 answers

Add canvas to a page with javascript

I am trying to use Javascript in order to add a canvas to one page which originally does not have one. I am trying to do the following: var canv=document.createElement("canvas"); canv.setAttribute("id", "canvasID"); alert(canv.id); var…
nick2k3
  • 1,399
  • 8
  • 18
  • 25
43
votes
9 answers

git: Unable to index file - permission denied

Only for one file, I am getting the following error: error: unable to write sha1 filename /opt/www/.git/objects/3f/ce3587c54a8be14c69b08c6b01f94949b11b47: Permission denied error: wp/wp-admin/css/theme-install.dev.css: failed to insert into…
h4xnoodle
  • 1,038
  • 1
  • 11
  • 14
41
votes
3 answers

git add multiple files at once

I had this project with a lot .c files in source directory,then I make the project, there is .o files inside of the project, I also want to push these files to repository,so instead of add each .o which is possible but...,how to add .o files…
user1051003
  • 1,211
  • 5
  • 16
  • 24
40
votes
4 answers

Java: Adding fields and methods to existing Class?

Is there, in Java, a way to add some fields and methods to an existing class? What I want is that I have a class imported to my code, and I need to add some fields, derived from the existing fields, and their returning methods. Is there any way to…
Pots Spi
  • 591
  • 1
  • 4
  • 4
39
votes
5 answers

C# way to add value in a List at index

Is there any way you can add a value at a specific index? I try to do indexator and I have Lists. Is there any trick for making this this in this context :D public class Multime { private List> multiSets; private List
TyGerX
  • 513
  • 1
  • 6
  • 11
38
votes
10 answers

Why is subtraction faster than addition in Python?

I was optimising some Python code, and tried the following experiment: import time start = time.clock() x = 0 for i in range(10000000): x += 1 end = time.clock() print '+=',end-start start = time.clock() x = 0 for i in range(10000000): x…
Statto
  • 381
  • 3
  • 3
37
votes
7 answers

Typescript : Trying the addition of two variables but get the concatenation of the two

I have three variable in my Typescript class : A:number; B:number; C:number; in another part of the class i try to make the addition of the two variable A and B : this.C = this.A+this.B; // A =20 and B = 50; and I display C in the html template…
Nacim Idjakirene
  • 1,882
  • 8
  • 26
  • 45
37
votes
2 answers

Git add a folder with spaces in the name

Problem When I want to add something to the staging area I normally type git add < folder-name >. However, I can't add folders with spaces in the name. My git add auto complete doesn't correctly escape the spaces. For example I have a folder named:…
Jonathan Yeong
  • 523
  • 1
  • 4
  • 8