This tag refers to the process of removing or deleting data, text, files, or memory.
Questions tagged [erase]
739 questions
20
votes
14 answers
Clearing the terminal screen?
I'm reading data from 9 different sensors for my robot and I need to display them all steadily, in the same window so I can compare the values and see if any of the readings is off.
The problem I'm having with both Serial.print and lcd.print is that…

Eugen
- 1,537
- 7
- 29
- 57
19
votes
12 answers
C++ Remove punctuation from String
I got a string and I want to remove all the punctuations from it. How do I do that? I did some research and found that people use the ispunct() function (I tried that), but I cant seem to get it to work in my code. Anyone got any ideas?
#include…

NewFile
- 501
- 5
- 10
- 16
18
votes
2 answers
HTML5 Canvas eraser tool without overdraw white color
I have canvas. I have paint tools pencil and eraser. How i can erase drawings without overwrite(overdraw) with white color.
this my code eraser over drawing with white color:
http://jsfiddle.net/66z12xb0/
I have in back end save image after…

Asker
- 291
- 1
- 3
- 11
16
votes
6 answers
How do I erase printed characters in a console application(Linux)?
I am creating a small console app that needs a progress bar. Something like...
Conversion: 175/348 Seconds |========== | 50%
My question is, how do you erase characters already printed to the console? When I reach the 51st percentage, I…

Binny V A
- 2,036
- 3
- 20
- 23
15
votes
4 answers
Fast erase (not clear) a ByteBuffer in Java
I am trying to "clean up" a ByteBuffer to be all zero bytes (all 0x00). I tried to loop over all positions in the buffer and set them to 0x00, but the efficiency is bad. Is there any better way to quickly clear a ByteBuffer - similar to what…

asksw0rder
- 1,066
- 1
- 12
- 19
13
votes
9 answers
How does a 7- or 35-pass erase work? Why would one use these methods?
How and why do 7- and 35-pass erases work?
Shouldn't a simple rewrite with all zeroes be enough?

stalepretzel
- 15,543
- 22
- 76
- 91
11
votes
1 answer
Erasing element from a vector – rbegin() vs begin()
I'm trying to solve a problem in C++, a part of which requires me to erase elements from a vector using the rbegin() member function. However, the compiler throws an error every time I write the below-mentioned code. What's wrong here?
int main()…

RedHelmet
- 213
- 1
- 7
11
votes
2 answers
Why doesn't erase support reverse iterators?
I've just written the following code, and was very surprised it doesn't compile:
std::deque container;
// filling the container...
for (auto it = container.rbegin(); it != container.rend(); ++it)
if (*it == 5)
{
…

Violet Giraffe
- 32,368
- 48
- 194
- 335
10
votes
2 answers
std::unordered_map::extract references/pointers invalidation
For the new C++17 std::unordered_map::extract function the documentation says:
Extracting a node invalidates only the iterators to the extracted
element, and preserves the relative order of the elements that are not
erased. Pointers and…

haelix
- 4,245
- 4
- 34
- 56
10
votes
1 answer
std::vector::erase vs "swap and pop"
The "normal" way of deleting an element from a vector goes like this:
vec.erase(vec.begin() + index);
But in theory it's faster just to do this:
if (vec.size() > 1)
{
std::iter_swap(vec.begin() + index, vec.end() - 1);
…

user112513312
- 459
- 1
- 7
- 15
10
votes
2 answers
Remove Duplicate Entries in a C++ Vector
Just want to remove duplicates. Pool is vector> but I seem to miss some elements at the start of the vector somehow. Can anyone verify the logic of the removal? Thanks :)
Pool Master::eliminateDuplicates(Pool generation)
{
…

Jarrod Cabalzar
- 408
- 1
- 5
- 24
9
votes
2 answers
How do you erase *AND CONTINUE* using a std::reverse_iterator?
I've been up and down stackoverflow and even the very, very nice Dr. Dobbs article but I can't find a definitive answer to the question.
A section of the answer to the question What are the shortcomings of std::reverse_iterator? says that it might…

Migs
- 825
- 1
- 9
- 16
9
votes
6 answers
How to delete a file such that the delete is irreversable?
I want to delete a sensitive file (using C++), in a way that the file will not be recoverable.
I was thinking of simply rewriting over the file and then delete it, Is it enough or do I have to perform more actions ?

TCS
- 5,790
- 5
- 54
- 86
9
votes
1 answer
Blending a texture to erase alpha values softly with OpenGL
I have a little paint application which was based on the GLPaint sample code. It is working fine.
My Problem is that I need to implement a "brush" that erases the textures which were already drawn.
My goal is to have an eraser which has soft edges.…

Hung Dang
- 105
- 1
- 6
9
votes
5 answers
Python securely remove file
How can I securely remove a file using python? The function os.remove(path) only removes the directory entry, but I want to securely remove the file, similar to the apple feature called "Secure Empty Trash" that randomly overwrites the file.
What…

kyle k
- 5,134
- 10
- 31
- 45