delete

Delete operator and arrays

I have an abstract Base class and Derived class. int main () { Base *arrayPtr[3]; for (int i = 0; i < 3; i++) { arrayPtr[i] = new Derived(); } //some fuctions here delete[] arrayPtr; return 0; } I'm not sure how to use the delete operator. If I delete array of base class pointers as shown above, will this call de...

Delete Lines From Beginning of Multiline Textbox in C#

Hello. Is there a graceful way in C# to delete multiple lines of text from the beginning of a multiline textbox? I am using Microsoft Visual C# 2008 Express Edition. Thanks. EDIT - Additional Details The multiline textbox in my application is disabled (i.e. it is only editable by the application itself), and every line is terminated ...

Silverlight IsolatedStorage: Delete not working, Truncate leaving blank space

Hi, I'm using IsloatedStorage in a Silverlight app to log information on the client, and I added a function to clear the log file... However I have had problems with the two approaches I tried: Approach one: use IsolatedStorageFile.DeleteFile("log.log"); Result: This fails and returns an "[IsolatedStorage_DeleteFile]" error (No othe...

SQL delete orphan

Assuming that all foreign keys have the appropriate constraint, is there a simple SQL statement to delete rows not referenced anywhere in the DB? Something as simple as delete from the_table that simply skip any rows with child record? I'm trying to avoid manually looping through the table or adding something like where the_SK not in (...

JavaScript DELETE statement. Query

I was just wondering if the DELETE statement is supported by all browsers e.g: delete myObj; I just want to make 100% sure if all browsers support this or not? Also is there any browser or maybe mobile (cell) phones that do not? The more information the better... ...

Mysql delete query deletes only two columns in a row...!!

Hi all... I have a table with the following structure.... FIELD TYPE EXTRA faciltiy_id int auto_increment(Primary Key) hotel_id int facility_title varchar(20) facility_desc varchar(300) When i want to delete a row with a particular facility_id i use the code.... DELETE FR...

Python: delete item in a list using a for-loop

Hello. I have an array with subjects and every subject has connected time. I want to compare every subjects in the list. If there are two of the same subjects, I want to add the times of both subjects, and also want to delete the second subject information (subject-name and time). But If I delete the item, the list become shorter, and I ...

JPA parent child delete problem

I have two entities: @Entity public class Game implements Serializable{ @ManyToOne @JoinColumn(name = "target_id") protected GameObject target; } @Entity public class GameObject implements Serializable { @OneToMany(mappedBy = "target", cascade = CascadeType.ALL) protected Collection<Game> games = new HashSet<Game>(); } In one t...

URLRequest with DELETE method

Need to find a way to send a delete method from Flash Player (Flex). Currently it's not done by default (except for from AIR), but I am sure someone has augmented the URLRequestHeader to get it to work properly. I've tried this, it isn't working: request.requestHeaders = [new URLRequestHeader("X-HTTP-Method-Override", DELETE_REQU...

Sharepoint : Access denied when trying to delete a page layout or master page

I'm getting a : "This item cannot be deleted because it is still referenced by other pages." When I try to delete a master page or a page layout. All the pages that were made with those are now gone. ...

SQL for delete query

Hi, I'm trying to write an SQL query for my program, but I just can't figure out how. I don't know enough SQL. I'm trying to implement an online team system (for some website). I have two tables: teams | teamId, eventId teammembers | teamId, userId, status Now, I need to: "delete all records in teammembers where the eventId for the ...

Search and delete multiple lines

In vim :g/George Bush/d deletes all lines with George Bush. What if I wanted to delete 5 lines below that start with George Bush? Another realistic example would be to find all DEBUG in a log4net log and delete up to the end of stack trace (which I know will be another 10 lines below it) ...

sql server delete slowed drastically by indexes

I am running an archive script which deletes rows from a large (~50m record DB) based on the date they were entered. The date field is the clustered index on the table, and thus what I'm applying my conditional statement to. I am running this delete in a while loop, trying anything from 1000 to 100,000 records in a batch. Regardless of ...

Prompt on file/directory delete

When coding in Python, I often need to write a function like this one: def delete_dir(dir_name): if os.path.exists(dir_name): reply = raw_input("Delete directory "+dir_name+"? [y/[n]] ") if reply=='y': os.system('rm -r '+dir_name) else: print "Aborting..." sys.exit() whi...

Will it leak if delete using base-class pointer?

Given two classes have only primitive data type and no custom destructor/deallocator. Does C++ spec guarantee it will deallocate with correct size? struct A { int foo; }; struct B: public A { int bar[100000]; }; A *a = (A*)new B; delete a; I want to know do I need to write an empty virtual dtor? p.s. I have tried g++ and vc++2008 and...

iPhone UITableView - Delete Button

I am using the 'swipe to delete' functionality of the UITableView. The problem is I am using a customised UITableViewCell which is created on a per item basis in - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath I need to alter the position of the delete button (simply to move it ...

Glitch in sent mail delete function

Hello, I am still a newbie.So that being said, my site has a messaging system that allows users to delete their sent messages. Its been discovered that if I erase my messages out of my 'sent' box, it erases the message out of the recipients inbox. I have two ways to delete messages out of your sent mail, 'erase all messages' and one by o...

How to properly cascade delete managed objects in Core Data?

I have a Core Data model which has three entities: A, B, and C. A has a one-to-many relationship with B, and B has a many-to-many relationship with C. The delete rule for A -> B is "Cascade", and B -> A is "No Action". The delete rule for B -> C is "No Action", and C -> B is "Deny". I am having trouble performing a delete on the A entit...

PostgreSQL: purge all tables

Possible Duplicate: How to empty a SQL database? What is the fastest way to delete all records from all tables in the db supposing they do not have too much data(may be a few records in some tables but no more)? I believe that recreate the database from structure dump is much longer variant. ...

Stopping an implicit cast on operator delete.

My String class provides an operator char* overload to allow you to pass the string to C functions. Unfortunately a colleague of mine just inadvertently discovered a bug. He effectively had the following code. StringT str; // Some code. delete str; Is there anyway to prevent delete from casting the string object to a char* to prev...