Questions tagged [append]

To append is to join or add on to the end of something.

Append is an operation usually defined on 1D data structures (e.g., , , , , etc.).
The append operation adds an element to the end of the data structure, consequently, increasing its size by one.

11138 questions
18
votes
3 answers

Adding to the end of list in LISP

Possible Duplicate: what is the ‘cons’ to add an item to the end of the list? After watching many tutorials on lisp and searching high and low on google for answers, I still cannot figure out how to add to the end of a list in LISP. I want my…
Bert
  • 814
  • 1
  • 7
  • 9
18
votes
2 answers

Append NSData to a file in Objective C

I'm attempting to download a large file on the iPhone and save it to disk as it is downloaded. Ideally, in: -(void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data { } I want to append 'data' to a file on disk. I've checked out…
Nick Cartwright
  • 8,334
  • 15
  • 45
  • 56
18
votes
5 answers

What's the difference between plus and append in python for list manipulation?

Possible Duplicate: Python append() vs. + operator on lists, why do these give different results? What is the actual difference between "+" and "append" for list manipulation in Python?
Bappy
  • 621
  • 1
  • 7
  • 16
17
votes
9 answers

what is the 'cons' to add an item to the end of the list?

what's the typical way to add an item to the end of the list? I have a list (1 2 3) and want to add 4 to it (where 4 is the result of an evaluation (+ 2 2)) (setf nlist '(1 2 3)) (append nlist (+ 2 2)) This says that append expects a list,…
r b
  • 181
  • 1
  • 1
  • 4
17
votes
1 answer

Append and prepend text nodes to a HTML element using DOM?

Here is my HTML code
A sample block
and child block
How can I use DOM to append and prepend text nodes to the BODY elements without hurting its siblings? $dom = new…
Teiv
  • 2,605
  • 10
  • 39
  • 48
17
votes
3 answers

How to create a CSV file if it does not exist and then only append to it Python

I want to know how to create a file if it does not exist in the directory. I want to only append data. I am getting this error in Python: No such file or directory. This is my code: with open (saveAddr+".csv",'a') as allpckts: …
alphiii
  • 1,597
  • 3
  • 21
  • 27
17
votes
5 answers

How to append data in a file in android

Can anyone tell me how to append data to a file that already has data in Android? I wrote some code but it's not working. This is my activity: package updatefile.developer.com.updatefiledemo; import android.support.v7.app.ActionBarActivity; import…
RD Division Medequip
  • 1,605
  • 4
  • 18
  • 32
17
votes
3 answers

If-statement inside jquery Append()

Inside my jquery Append() I wan't to run an IF-statement to include an image on all my objects except on the first one. Like: var i = 0; $('#divDetailsForSelectedInfo').append( '
Solders
  • 391
  • 1
  • 4
  • 11
17
votes
5 answers

How to remove an appended element with Jquery and why bind or live is causing elements to repeat

Now I know this basic question has been asked before, but I must be doing something wrong. I know that an appended element must bound before I can do anything to it. However, try as I might I can't get it to work. I am pulling in a message and…
user1197728
  • 181
  • 1
  • 1
  • 5
17
votes
2 answers

write a file, append if it exists otherwise create in bash

Im trying to write a file with the content of a variable, but if the file doesnt exist create it: So far i got this: echo "$Logstring" >> $fileLog What im missing because when the file doesnt exist theres an error. Is an if condition necessary?
coolerking
  • 501
  • 1
  • 5
  • 13
16
votes
3 answers

Appending HTML-encoded string as HTML, not as text

I'm trying to append this string: <div> hello </div> as an HTML node, but instead of appending HTML it just appends the text:
hello
How do I make jQuery append this as an HTML node, not just text? I'd like a solution that…
zakdances
  • 22,285
  • 32
  • 102
  • 173
16
votes
3 answers

How to append a list to pandas column, series?

Asume that I have the following dataframe: d = {'col1': [1, 2], 'col2': [3, 4]} df = pd.DataFrame(data=d) I would like to extend col1 with array xtra. However this errors out. xtra = [3,4] df['col1'].append(xtra) How can I append xtra to df.col1,…
callmeGuy
  • 944
  • 2
  • 11
  • 28
16
votes
1 answer

Why is it so slow when assigning a concatenated string to a variable in python?

If it is only concatenation of strings as follows, it finish immediately. test_str = "abcdefghijklmn123456789" str1 = "" str2 = "" start = time.time() for i in range(1, 100001): str1 = str1 + test_str str2 = str2 + test_str if i %…
uma66
  • 175
  • 7
16
votes
2 answers

List.append() changing all elements to the appended item

I seem to have a problem with my maze generating program made in Python. I'm trying to randomly create a path that branches out at select points, with the points getting stored as it goes along. When the maze gets to a dead end, it will sort back…
Matt Habel
  • 1,493
  • 2
  • 14
  • 35