Questions tagged [overwrite]

Overwriting is a process of replacing content with other content in place. It can be physically replaced on storage, or overridden with newer version of content type.

Overwriting is a process of replacing content with other content in place. It can be physically replaced on storage, or overridden with newer version of content type.
Not to be confused with Override in Object Oriented Programming.

1479 questions
17
votes
6 answers

C++ Overriding... overwriting?

I know what overriding is in C++. But, is there overwriting? If so, what does it mean? Thanks.
Simplicity
  • 47,404
  • 98
  • 256
  • 385
16
votes
3 answers

Is there any way to prevent override/overwrite of functions/variables in singleton instance?

Consider this pseudo code: (function(window){ var options = { /*where everything goes */ }; var instance = (function(options){ for (var i in options){ if (options.hasOwnProperty(i)){ this[i] = options[i]; } …
pocesar
  • 6,860
  • 6
  • 56
  • 88
16
votes
2 answers

Python inheritance - calling base class methods inside child class?

It baffles me how I can't find a clear explanation of this anywhere. Why and when do you need to call the method of the base class inside the same-name method of the child class? class Child(Base): def __init__(self): …
user1369281
  • 161
  • 1
  • 1
  • 3
15
votes
5 answers

Force SVN update / checkout to overwrite local files

i'm planning to run (on my server!) svn update to update my LIVE website with updates. However, i'm worried about 'C' conflicts which will prevent my site scripts from functioning. How can I force the checkout / update process to overwrite all…
siliconpi
  • 8,105
  • 18
  • 69
  • 107
14
votes
1 answer

How to force NLog to overwrite the log file

I need NLog to overwrite the log file when the application is restarted. Currently it appends to existing file. For example I have something like this in my NLog.config
Vadim
  • 21,044
  • 18
  • 65
  • 101
13
votes
1 answer

spark [dataframe].write.option("mode","overwrite").saveAsTable("foo") fails with 'already exists' if foo exists

I think I am seeing a bug in spark where mode 'overwrite' is not respected, rather an exception is thrown on an attempt to do saveAsTable into a table that already exists (using mode 'overwrite'). Below is a little scriptlet that reproduces the…
Chris Bedford
  • 2,560
  • 3
  • 28
  • 60
13
votes
3 answers

Get text and rewrite(update) file contents in Python

I'm trying my hand at this rosalind problem and am running into an issue. I believe everything in my code is correct but it obviously isn't as it's not running as intended. i want to delete the contents of the file and then write some text to that…
Tare Gaskin
  • 1,209
  • 2
  • 10
  • 13
13
votes
2 answers

Reading a file and then overwriting it in Python

I've been trying to read a file and then overwrite it with some updated data. I've tried doing it like this: #Created filename.txt with some data with open('filename.txt', 'r+') as f: data = f.read() new_data = process(data) # data is being…
pystudent
  • 531
  • 1
  • 5
  • 19
12
votes
2 answers

python overwrite previous line

how do you overwrite the previous print in python 2.7? I am making a simple program to calculate pi. here is the code: o = 0 hpi = 1.0 i = 1 print "pi calculator" acc= int(raw_input("enter accuracy:")) if(acc>999999): print "WARNING: this…
Cinder
  • 1,599
  • 2
  • 13
  • 23
12
votes
2 answers

Overwrite existing read-only files when using Python's tarfile

I'm attempting to use Python's tarfile module to extract a tar.gz archive. I'd like the extraction to overwrite any target files it they already exist - this is tarfile's normal behaviour. However, I'm hitting a snitch in that some of the files have…
victorhooi
  • 16,775
  • 22
  • 90
  • 113
12
votes
6 answers

how to read and write to the same file in spark using parquet?

I am trying to read from a parquet file in spark, do a union with another rdd and then write the result into the same file I have read from (basically overwrite), this throws the following error: couldnt write parquet to file: An error occurred…
roshan
  • 121
  • 1
  • 1
  • 4
12
votes
7 answers

How do I Insert or Update (or overwrite) a record using NHibernate?

I need to write a row to the database regardless of whether it already exists or not. Before using NHibernate this was done with a stored procedure. The procedure would attempt an update and if no rows were modified it would fallback to an insert.…
g .
  • 8,110
  • 5
  • 38
  • 48
12
votes
5 answers

Overwriting previously extracted files instead of creating new ones

There are a few libraries used to extract archive files through Python, such as gzip, zipfile library, rarfile, tarfile, patool etc. I found one of the libraries (patool) to be especially useful due to its cross-format feature in the sense that it…
multigoodverse
  • 7,638
  • 19
  • 64
  • 106
12
votes
3 answers

Using write.xlsx to replace an existing sheet with R package xlsx

I am using package xlsx Version:0.5.7 Date: 2014-08-01. in R version 3.0.1 (2013-05-16) -- "Good Sport" Platform: i386-w64-mingw32/i386 (32-bit). I have an xlsx file with at least 2 sheets (say A and B). I need to read data from A, edit them and…
Filippo
  • 309
  • 1
  • 2
  • 10
11
votes
2 answers

R: Avoid accidently overwriting variables

Is there any way to define a variable in R in your namespace, such that it can't be overwritten (maybe ala a "Final" declaration)? Something like the following psuedocode: > xvar <- 10 > xvar [1] 10 xvar <- 6 > "Error, cannot overwrite this…
bigO6377
  • 1,256
  • 3
  • 14
  • 28
1 2
3
98 99