delete

What exactly happens if you delete an object? (gcc) (When double-delete crashes?)

Please note that I don't want to solve any problem with my question - I was thinking about probabilities of things to happen and thus was wondering about something: What exactly happens if you delete on object and use gcc as compiler? Last week I was investigating a crash, where a race condition lead to an double delete of an object. ...

How to properly delete elements in java arrays

I have a simple program that lets you add, edit, list, search and delete records by storing it on arrays. My problem now, is how to properly delete items on it. Here is my current code. System.out.print("Input number to delete: "); delnum=scanz.nextLine(); intdelnum=Integer.parseInt(delnum); n...

Logical destroy

Hi, i have used some of association in my project model. Corresponding child record will be deleted through dependent :destroy, if i delete any parent record.I have implemented logical delete which means every table has 'active' column by default it is 'true'. every true record is valid all other records are invalid(deleted record). in ...

Delete top row in Android SQlITE database

Ok, so currently I have this code in my program: public void delete(String id, String name, String phonenumber, String time, String message) { String[] args={id}; getWritableDatabase().delete("texts", "_ID=?", args); } It works fine, and deletes the specified row. However, I also want to implement it so that I can delete the...

Where in the C++ Standard does it say ::delete can change lvalues?

I ran into my first compiler that changes the lvalue passed to ::delete, but doesn't zero out the lvalue. That is the following is true: Foo * p = new Foo(); Foo * q = p; assert(p != 0); assert(p == q); ::delete p; assert(p != q); assert(p != 0); Note that p is not zero after the delete operation, and it has changed from it's o...

MySQL Transaction Log

Does MySQL keep a transaction log and if so where coudl I find it? A number of rows have mysteriously been deleted from a table and I want to try and see how and when it occurred... Thanks ...

mysql delete on join?

Hi there, I can use select * from sent_txts s LEFT JOIN received_txts r ON s.msg_link_id = r.id WHERE r.action_id = 6; top select matching rows, how can i write a query to delete the matching rows on both sides? something like delete sent_txts s LEFT JOIN received_txts r ON s.msg_link_id = r.id WHERE r.action_id = 6; cheers....

iPhone/Objective C: Can't delete a file

In my application, I let the user record a sound clip and later, if the user chooses, I want him to be able to delete it. This is the code I use: NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSLog(@"File exists: %d", [fileManager fileExistsAtPath:path]); NSLog(@"Is deletable file at path...

Delete files with AJAX/PHP

The problem I want to delete a file with AJAX/PHP. But the php says that the file name what I send with AJAX is not a file, but when I go directly to the link I can delete the files. Check out my current PHP, i've put in the IF/ELSE statement to check if the string is a file with: is_file, the result is false. Without is_file says t...

How to avoid UNLINK security risks in PHP?

I'm using UNLINK with PHP and AJAX. I know that in this way is very dangerous, because everyone can delete any files. But I need to use AJAX because I can't reload the page when I delete the files. So how should I do to allow to delete the file only for the user who owns it? Please let me know other things too if you think I'm doing h...

Cascade tree deleting in MS SQL Server Express 2005

One table has name "Stages", every Stage can have 0..infinity childrens, in table Stages there are column named Parent. This column is foreigh key for same table Stages. How to make cascade deleting in this tree? I want to on deleting any row in this table, auto delete all their childrens and childrens of their childrens....etc При тако...

Python Delete a File?

Hi, I'm trying to delete a certain file within the directory that I'm running my python program in. def erase_custom_file(): directory=os.listdir(os.getcwd()) for somefile in directory: if somefile=="file.csv": os.remove(???) I'm not sure what my next step should be. I know that os.remove takes in a pa...

Deleting many rows without locking them

Hello good people. In PostgreSQL I have a query like the following which will delete 250k rows from a 1m row table: DELETE FROM table WHERE key = 'needle'; The query takes over an hour to execute and during that time, the affected rows are locked for writing. That is not good because it means that a lot of update queries have to wait ...

Is it possible to do an unstoppable delete in C# ? (Compact Framework)

Given a folder i want to make sure that ALL the files on that directory are deleted. I know there maybe IOExceptions or Access Denied errors but how do just leave them aside and continue with my deletion of the files that I actually can delete? Is this possible? Please shed some light on me on where I can begin ...

DELETE SQL with correlated subquery for table with 42 million rows?

I have a table cats with 42,795,120 rows. Apparently this is a lot of rows. So when I do: /* owner_cats is a many-to-many join table */ DELETE FROM cats WHERE cats.id_cat IN ( SELECT owner_cats.id_cat FROM owner_cats WHERE owner_cats.id_owner = 1) the query times out :( (edit: I need to increase my CommandTimeout value, default is ...

deleting an object in C++

Here is a sample code that I have: void test() { Object1 *obj = new Object1(); . . . delete obj; } I run it in Visual Studio, and it crashes at the line with 'delete obj;'. Isn't this the normal way to free the memory associated with an object? I realized that it automatically invokes the destructor... is this normal? ...

Deleting posts from other user's wall using Javascript

Hello, I've managed to post to another user's wall, but I couldn't figure how to delete them using the access token. I'm using the JavaScript SDK. Can someone please help? Thanks in advanced! :) ...

delete function in cpp

hi, I saw an example of using the function: delete in cpp and I didn't completely understand it. the code is: class Name { const char* s; //... }; class Table { Name* p; size_t sz; public: Table(size_t s = 15){p = new Name[sz = s]; } ~Table { delete[] p; } }; what is the exact action of the command: de...

CakePHP, do database row DeleteAll where 1 field is equal to something and other field is NOT equal to something

I'm struggling with doing this, I want to basically do a database deleteAll where one field is equal to something and another field must NOT be equal to something.. its for deleting duplicate rows so I want to delete all but one row.. the way I tried below isn't working, I Would appreciate any advice: $conditions = array ( "Prox.prox...

What's the Javascript 'delete' keyword equivalent in Lua?

Javascript delete keyword deletes a named variable slot from nearest execution environment which it defined. What's the equivalent in Lua? ...