deletion

Re-using soft deleted records

If I have a table structure that is: code+description+isdeleted where code is the primary key. The user creates a record, then later on deletes it. Because I am using soft deletes the isdeleted will be set to true. Then in my queries I would be doing a select with the where clause: and not isdeleted Now if a user goes to create a...

SQL: Complex Deletion help

I basically created some tables to play around with: I have Two main tables, and a Many-Many join table. Here is the DDL: (I am using HSQLDB) CREATE TABLE PERSON ( PERSON_ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, NAME VARCHAR(50), MAIN_PERSON_ID INTEGER ) CREATE TABLE JOB ( JOB_ID INTEGER GENERATED BY DEF...

How can I make my batch script for deletion of old files work?

Inside a folder (say c:\test) I want to delete the oldest file if the number of files are over 21. This is what I came up with, issue is that it one time deletes the oldest file, second run it does nothing and deletes the oldest for third, continues like that. Also it doesn't care if the file amount is lower than 21, deletes even if it ...

Race condition when calling FSDeleteObject

I have implemented a "safe save" operation that goes something like this: Save some data to temporary file A Copy contents of A to final destination B Delete A I have a race condition at step 3 where Mac OS X will occasionally come back with error -47 (fBsyErr) when trying to delete the file using FSDeleteObject. I am completely conf...

MySQL auto increments disappeared

I have a mysql database with 60 tables most of the tables have primary keys (expect pivot tables) all these primary keys had the attribute AUTO INCREMENT Then over night some how all the primary keys had that attribute removed, and the default value set to 0. I have no idea how this may have been caused. Any suggestions? ...

How to overwrite the data in a file with bash

I'm writing a bash script that encrypts the data of a folder or file #!/bin/bash file_name=$1 tmp_file=/tmp/tmpfile.tar # tar compress file tar -cf $tmp_file $file_name; # encrypt file gpg -c $tmp_file # remove temp file rm -rf $tmp_file $file_name # mv encrypted file to orignal place mv ${tmp_file}.gpg $file_name but the data wi...

UITableView: Juxtaposing row, header, and footer insertions/deletions

Consider a very simple UITableView with one of two states. First state: One (overall) table footer One section containing two rows, a section header, and a section footer Second state: No table footer One section containing four rows and no section header/footer In both cases, each row is essentially one of four possible UITable...

UITableViewCell: Allowing Selective Deletion

I have a table view and want to allow reordering of all cells, however there are certain cells that i do not want to be allowed to be deleted. when the UiTableView is put into deletion mode i do not want the red '-' button to appear on the left hand side, and do not want the swipe gesture to bring up the Delete button of these cells but ...

Has Dreamweaver CS5 been deleting local files instead of remote files?

As scary as it sounds. I select a remote file, I hit delete. Instead of deleting the selected remote file, Dreamweaver chooses to delete the currently selected LOCAL file(s) - even if they're unrelated. EDIT: I am not able to 'deselect' the soon-to-be-deleted LOCAL file, not that I should have to. Didn't work this way in CS3. The only...

Core Data: Error, "Can't Merge Models With Two Different Entities Named 'foo' "

I'm working on an iPhone app that uses Core Data. Most times, I just test in the simulator, but occasionally pump the app down to the iPad to make sure. I've recently changed my Core Data model, and now when I send the app to the iPad, I get a SIGABRT exception telling me: Can't merge models with two different entities named 'foo' O...

Speed up deletions on SQL Server 2005?

Most questions I've seen on similar subjects relate to how to speed up inserts into a table. I want to know what can I do to speed up deletes? I can't truncate nor drop a table, I have to do something similar to DELETE FROM table WHERE id IN (SELECT id FROM other_table) ...

How can I use Array#delete while iterating over the array?

I have an array that I want to iterate over and delete some of the elements. This doesn't work: a = [1, 2, 3, 4, 5] a.each do |x| next if x < 3 a.delete x # do something with x end a #=> [1, 2, 4] I want a to be [1, 2]. How can I get around this? ...

Securely deleting/wiping MySQL data from hard disk

We're running MySQL 5.1 on CentOS 5 and I need to securely wipe data. Simply issuing a DELETE query isn't an option, we need to comply with DoD file deletion standards. This will be done on a live production server without taking MySQL down. Short of taking the server down and using a secure deletion utility on the DB files is there a wa...

mysql deletion efficiency

I have a table with large amount of data. The data need to be updated frequently: delete old data and add new data. I have two options whenever there is an deletion event, I delete the entry immediately I marked delete the entries and use an cron job to delete at unpeak time. any efficiency difference between the two options? or an...

Can't delete a service executable after uninstalling it

I'm uninstalling a service like this: using (AssemblyInstaller installer = new AssemblyInstaller(serviceFileName, new String[] { })) { installer.UseNewContext = true; installer.Uninstall(null); } which works fine, but then I try to do a Directory.Delete, and it throws an exception saying that access to the service's executable...

Mass Deletion of User Profiles in Win XP ( SP3 )

Hi All, I was wondering if anyone has a script to delete all user profiles from a machine without deleting the basic ones that XP needs to operate, mainly: Administrator ( local ) All Users Default User ( Normally Hidden ) LocalService ( Normally Hidden ) NetworkService ( Normally Hidden ) Perferrably in Powershell, .BAT, .VBS, or ....