Search Results

Search found 8982 results on 360 pages for 'delete'.

Page 25/360 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Is extending a base class with non-virtual destructor dangerous in C++

    - by Akusete
    Take the following code class A { }; class B : public A { }; class C : public A { int x; }; int main (int argc, char** argv) { A* b = new B(); A* c = new C(); //in both cases, only ~A() is called, not ~B() or ~C() delete b; //is this ok? delete c; //does this line leak memory? return 0; } when calling delete on a class with a non-virtual destructor with member functions (like class C), can the memory allocator tell what the proper size of the object is? If not, is memory leaked? Secondly, if the class has no member functions, and no explicit destructor behaviour (like class B), is everything ok? I ask this because I wanted to create a class to extend std::string, (which I know is not recommended, but for the sake of the discussion just bear with it), and overload the +=,+ operator. -Weffc++ gives me a warning because std::string has a non virtual destructor, but does it matter if the sub-class has no members and does not need to do anything in its destructor? -- FYI the += overload was to do proper file path formatting, so the path class could be used like class path : public std::string { //... overload, +=, + //... add last_path_component, remove_path_component, ext, etc... }; path foo = "/some/file/path"; foo = foo + "filename.txt"; //and so on... I just wanted to make sure someone doing this path* foo = new path(); std::string* bar = foo; delete bar; would not cause any problems with memory allocation

    Read the article

  • deleting object with template for int and object

    - by Yokhen
    Alright so Say I have a class with all its definition, bla bla bla... template <class DT> class Foo{ private: DT* _data; //other stuff; public: Foo(DT* data){ _data = data } virtual ~Foo(){ delete _data } //other methods }; And then I have in the main method: int main(){ int number = 12; Foo<anyRandomClass>* noPrimitiveDataObject = new Foo<anyRandomClass>(new anyRandomClass()); Foo<int>* intObject = new Foo<int>(number); delete noPrimitiveDataObject; //Everything goes just fine. delete intObject; //It messes up here, I think because primitive data types such as int are allocated in a different way. return 0; } My question is: What could I do to have both delete statements in the main method work just fine? P.S.: Although I have not actually compiled/tested this specific code, I have reviewed it extensively (as well as indented. You're welcome.), so if you find a mistake, please be nice. Thank you.

    Read the article

  • Azure batch operations delete several blobs and tables

    - by reft
    I have a function that deletes every table & blob that belongs to the affected user. CloudTable uploadTable = CloudStorageServices.GetCloudUploadsTable(); TableQuery<UploadEntity> uploadQuery = uploadTable.CreateQuery<UploadEntity>(); List<UploadEntity> uploadEntity = (from e in uploadTable.ExecuteQuery(uploadQuery) where e.PartitionKey == "uploads" && e.UserName == User.Idendity.Name select e).ToList(); foreach (UploadEntity uploadTableItem in uploadEntity) { //Delete table TableOperation retrieveOperationUploads = TableOperation.Retrieve<UploadEntity>("uploads", uploadTableItem.RowKey); TableResult retrievedResultUploads = uploadTable.Execute(retrieveOperationUploads); UploadEntity deleteEntityUploads = (UploadEntity)retrievedResultUploads.Result; TableOperation deleteOperationUploads = TableOperation.Delete(deleteEntityUploads); uploadTable.Execute(deleteOperationUploads); //Delete blob CloudBlobContainer blobContainer = CloudStorageServices.GetCloudBlobsContainer(); CloudBlockBlob blob = blobContainer.GetBlockBlobReference(uploadTableItem.BlobName); blob.Delete(); } Each table got its own blob, so if the list contains 3 uploadentities, the 3 table and the 3 blobs will be deleted. I heard you can use table batch operations for reduce cost and load. I tried it, but failed miserable. Anyone intrested in helping me:)? Im guessing tablebatch operations are for tables only, so its a no go for blobs, right? How would you add tablebatchoperations for this code? Do you see any other improvements that can be done? Thanks!

    Read the article

  • SQL trigger to delete rows from database

    - by wpearse
    I have an industrial system that logs alarms to a remotely hosted MySQL database. The industrial system inserts a new row whenever a property of the alarm changes (such as the time the alarm was activated, acknowledged or switched off) into a table named 'alarms'. I don't want multiple records for each alarm, so I have set up two database triggers. The first trigger mirrors each new record to a second table, creating/updating rows as required: CREATE TRIGGER `mirror_alarms` BEFORE INSERT ON `alarms` FOR EACH ROW INSERT INTO `alarm_display` (Tag,...,OffTime) VALUES (new.Tag,...,new.OffTime) ON DUPLICATE KEY UPDATE OnDate=new.OnDate,...,OffTime=new.OffTime The second trigger should execute after the first and (ideally) delete all rows from the alarms table. (I used the Tag property of the alarm because the Tag property never changes, although I suspect I could just use a 'DELETE FROM alarms WHERE 1' statement to the same effect). CREATE TRIGGER `remove_alarms` AFTER INSERT ON `alarms` FOR EACH ROW DELETE FROM alarms WHERE Tag=new.Tag My problem is that the second trigger doesn't appear to run, or if it does, the second trigger doesn't delete any rows from the database. So here's the question: why does my second trigger not do what I expect it to do?

    Read the article

  • DRY jQuery for RESTful PUT/DELETE links

    - by Aupajo
    I'm putting together PUT/DELETE links, a la Rails, which when clicked create a POST form with an hidden input labelled _method that sends the intended request type. I want to make it DRYer, but my jQuery knowledge isn't up to it. HTML: <a href="/articles/1" class="delete">Destroy Article 1</a> <a href="/articles/1/publish" class="put">Publish Article 1</a> jQuery: $(document).ready(function() { $('.delete').click(function() { if(confirm('Are you sure?')) { var f = document.createElement('form'); $(this).after($(f).attr({ method: 'post', action: $(this).attr('href') }).append('<input type="hidden" name="_method" value="DELETE" />')); $(f).submit(); } return false; }); $('.put').click(function() { var f = document.createElement('form'); $(this).after($(f).attr({ method: 'post', action: $(this).attr('href') }).append('<input type="hidden" name="_method" value="PUT" />')); $(f).submit(); return false; }); });

    Read the article

  • Unable to delete inherited entity class in EF4

    - by Coding Gorilla
    I have two entities in an EF4 model (using Model First), let's call them EntityA and EntityB. EntityA is marked as abstract, and EntityB inherits from EntityA. They are similar to the following: public class EntityA { public Guid Id; public string Name; public string Uri; } public class EntityB : EntityA { public string AnotherProperty; } The generated database tables look as I would expect them, with EntityA as on table, and then another table like: EntityA_EntityB Id (PK, FK, uniqueidentifier) AnotherProperty (varchar) There is a foreign key constraint on EntityA_EntityB that references EntityA's Id property, no cascades are configured (although I did try changing these myself). The problem is that when I attempt to do something like: Context.DeleteObject(EntityA_EntityB); EF attempts to delete the EntityA_EntityB table record before deleting the EntityA table record, which of course violates the foreign key constraint on EntityA_EntityB table. Using EFProfiler I see the following commands being sent to the database: delete [dbo].[EntityA_EntityB] where (([Id] = '5c02899f-09ea-2ed9-d44b-01aef80f6b64' /* @0 */) followed by delete [dbo].[EntityA] where ([Id] = '5c02899f-09ea-2ed9-d44b-01aef80f6b64' /* @0 */) I'm completely stumped as to how to get around this problem. I would think the EF should know that it needs to delete the base class first, before deleting the inherited class. I know I could do some triggers or other database type solutions, but I'd rather avoid doing that if I can. All my classes are POCO built using some customized T4 templates. I don't want to paste in a lot of extraneous code, but if you need more information I'll provide what I can.

    Read the article

  • JQuery remove() not working with a two word id

    - by Programer
    I have a button <button onclick="takedown()"> take down </button> that creates a H1 and button with the id of the text in my text field and h1 at the end for the h1 and button at the end for the button the button has a onclick onclick="delete()". This is that function function takedown(){ note = document.getElementById("noteinput").value; idh1 = note + "h1"; idbutton = note + "button"; idcenter = note + "center"; $('<center id="' + idcenter + '"> <h1 id="' + idh1 + '">' + note + '</h1> <button id="'+ idbutton +'" onclick="deletenote()"> Delete </button> </center>').appendTo("body"); } For the delete function the remove() works only if the id of the button and the h1 is one word. function deletenote(){ // First setting var idbuttondelete = event.target.id; var idh1delete = idbuttondelete.replace("button", "h1"); // Removing the button, h1,center $('#' + idbuttondelete).remove(); $('#' + idh1delete).remove(); } Does anybody know whats wrong or how to use JQuery to delete something if it has a two word id.

    Read the article

  • PHP delete script, return to 'viewsubjects.php?classroom_id=NO VALUE'

    - by Derek
    Hi, As the title states... I am deleting a 'subject' from a 'classroom' I view classrooms, then can click on a classroom to view the subject for that classroom. So the link where I am viewing subjects looks like: viewsubjects.php?classroom=23 When the user selects the delete button (in a row) to remove a subject from a class, I simply want the user to be redirected back to the list of subjects for the classroom (exactly where they were before!!) So I though this is simply a case of calling up the classroom ID within my delete script. Here is what I have: EDIT: corrected spelling mistake in code (this was not the problem) $subject_id = $_GET['subject_id']; $classroom_id = $_GET['classroom_id']; $sql = "DELETE FROM subjects WHERE subject_id=".$subject_id; $result = mysql_query($sql, $connection) or die("MySQL Error: ".mysql_error()); header("Location: viewsubjects.php?classroom_id=".$classroom_id); exit(); The subject is being removed from the DB, but when I am redirected back the URI is displaying with an empty classroom ID like: viewsubjects.php?classroom_id= Is there a way to carry the classroom ID through successfully through the delete script so it can be displayed after, allowing the user to be redirected back to the page? Thanks for any help!

    Read the article

  • IOException: Unable To Delete Images Due To File Lock

    - by Arslan Pervaiz
    I am Unable To Delete Image File From My Server Path It Gaves Error That The Process Cannot Access The File "FileName" Because it is being Used By Another Process. I Tried Many Methods But Still All In Vain. Please Help me Out in This Issue. Here is My Code Snippet. using System; using System.Data; using System.Web; using System.Data.SqlClient; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Globalization; using System.Web.Security; using System.Text; using System.DirectoryServices; using System.Collections; using System.IO; using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Drawing2D; //============ Main Block ================= byte[] data = (byte[])ds.Tables[0].Rows[0][0]; MemoryStream ms = new MemoryStream(data); Image returnImage = Image.FromStream(ms); returnImage.Save(Server.MapPath(".\\TmpImages\\SavedImage.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg); returnImage.Dispose(); \\ I Tried this Dispose Method To Unlock The File But Nothing Done. ms.Close(); \\ I Tried The Memory Stream Close Method Also But Its Also Not Worked For Me. watermark(); \\ Here is My Water Mark Method That Print Water Mark Image on My Saved Image (Image That is Converted From Byte Array) DeleteImages(); \\ Here is My Delete Method That I Call To Delete The Images //===== ==== My Delete Method To Delete Files================== public void DeleteImages() { try { File.Delete(Server.MapPath(".\\TmpImages\\WaterMark.jpg")); \\This Image Deleted Fine. File.Delete(Server.MapPath(".\\TmpImages\\SavedImage.jpg")); \\ Exception Thrown On Deleting of This Image. } catch (Exception ex) { LogManager.LogException(ex, "Error in Deleting Images."); Master.ShowMessage(ex.Message, true); } } \ ==== Method Declartion That Make Watermark of One Image On Another Image.======= public void watermark() { //create a image object containing the photograph to watermark Image imgPhoto = Image.FromFile(Server.MapPath(".\\TmpImages\\SavedImage.jpg")); int phWidth = imgPhoto.Width; int phHeight = imgPhoto.Height; //create a Bitmap the Size of the original photograph Bitmap bmPhoto = new Bitmap(phWidth, phHeight, PixelFormat.Format24bppRgb); bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution); //load the Bitmap into a Graphics object Graphics grPhoto = Graphics.FromImage(bmPhoto); //create a image object containing the watermark Image imgWatermark = new Bitmap(Server.MapPath(".\\TmpImages\\PrintasWatermark.jpg")); int wmWidth = imgWatermark.Width; int wmHeight = imgWatermark.Height; //Set the rendering quality for this Graphics object grPhoto.SmoothingMode = SmoothingMode.AntiAlias; //Draws the photo Image object at original size to the graphics object. grPhoto.DrawImage( imgPhoto, // Photo Image object new Rectangle(0, 0, phWidth, phHeight), // Rectangle structure 0, // x-coordinate of the portion of the source image to draw. 0, // y-coordinate of the portion of the source image to draw. phWidth, // Width of the portion of the source image to draw. phHeight, // Height of the portion of the source image to draw. GraphicsUnit.Pixel); // Units of measure //------------------------------------------------------- //to maximize the size of the Copyright message we will //test multiple Font sizes to determine the largest posible //font we can use for the width of the Photograph //define an array of point sizes you would like to consider as possiblities //------------------------------------------------------- //Define the text layout by setting the text alignment to centered StringFormat StrFormat = new StringFormat(); StrFormat.Alignment = StringAlignment.Center; //define a Brush which is semi trasparent black (Alpha set to 153) SolidBrush semiTransBrush2 = new SolidBrush(Color.FromArgb(153, 0, 0, 0)); //define a Brush which is semi trasparent white (Alpha set to 153) SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(153, 255, 255, 255)); //------------------------------------------------------------ //Step #2 - Insert Watermark image //------------------------------------------------------------ //Create a Bitmap based on the previously modified photograph Bitmap Bitmap bmWatermark = new Bitmap(bmPhoto); bmWatermark.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution); //Load this Bitmap into a new Graphic Object Graphics grWatermark = Graphics.FromImage(bmWatermark); //To achieve a transulcent watermark we will apply (2) color //manipulations by defineing a ImageAttributes object and //seting (2) of its properties. ImageAttributes imageAttributes = new ImageAttributes(); //The first step in manipulating the watermark image is to replace //the background color with one that is trasparent (Alpha=0, R=0, G=0, B=0) //to do this we will use a Colormap and use this to define a RemapTable ColorMap colorMap = new ColorMap(); //My watermark was defined with a background of 100% Green this will //be the color we search for and replace with transparency colorMap.OldColor = Color.FromArgb(255, 0, 255, 0); colorMap.NewColor = Color.FromArgb(0, 0, 0, 0); ColorMap[] remapTable = { colorMap }; imageAttributes.SetRemapTable(remapTable, ColorAdjustType.Bitmap); //The second color manipulation is used to change the opacity of the //watermark. This is done by applying a 5x5 matrix that contains the //coordinates for the RGBA space. By setting the 3rd row and 3rd column //to 0.3f we achive a level of opacity float[][] colorMatrixElements = { new float[] {1.0f, 0.0f, 0.0f, 0.0f, 0.0f}, new float[] {0.0f, 1.0f, 0.0f, 0.0f, 0.0f}, new float[] {0.0f, 0.0f, 1.0f, 0.0f, 0.0f}, new float[] {0.0f, 0.0f, 0.0f, 0.3f, 0.0f}, new float[] {0.0f, 0.0f, 0.0f, 0.0f, 1.0f}}; ColorMatrix wmColorMatrix = new ColorMatrix(colorMatrixElements); imageAttributes.SetColorMatrix(wmColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); //For this example we will place the watermark in the upper right //hand corner of the photograph. offset down 10 pixels and to the //left 10 pixles int xPosOfWm = ((phWidth - wmWidth) - 10); int yPosOfWm = 10; grWatermark.DrawImage(imgWatermark, new Rectangle(xPosOfWm, yPosOfWm, wmWidth, wmHeight), //Set the detination Position 0, // x-coordinate of the portion of the source image to draw. 0, // y-coordinate of the portion of the source image to draw. wmWidth, // Watermark Width wmHeight, // Watermark Height GraphicsUnit.Pixel, // Unit of measurment imageAttributes); //ImageAttributes Object //Replace the original photgraphs bitmap with the new Bitmap imgPhoto = bmWatermark; grPhoto.Dispose(); grWatermark.Dispose(); //save new image to file system. imgPhoto.Save(Server.MapPath(".\\TmpImages\\WaterMark.jpg"), ImageFormat.Jpeg); imgPhoto.Dispose(); imgWatermark.Dispose(); }

    Read the article

  • NetBackup with VSS and Instant Recovery - Failing to delete old snapshots

    - by Jonathan Bourke
    We are attempting to implement Microsoft VSS for snap-shotting in our NetBackup 6.5.3.1 environment. The clients are both 32 & 64 bit Windows 2003 Server. Snapshot parameters are: Instant recovery is enabled Maximum snapshots = 1 Provider type = 1 (System) Snapshot attribute = 1 (Differential) All backups successfully complete, and VSS shadows are successfully created both for the snapshot backup and for the open files (shadow copy components). The Issue: NetBackup is not clearing or overwriting old snapshots with each successive backup. When we list shadows, and shadow storage, it is increasing and increasing. IT is not honouring the Maximum Snapshot setting. The Logs: The bpfis log doesn’t really appear to show any errors other than for methods which we are not employing (VxVM, Flashsnap, etc.). A section is as follows: 11:54:10.744 [348.4724] <2> logparams: D:\Program Files\Veritas\NetBackup\bin\bpfis.exe delete -nbu -id htpststr001.san.mgmt.det_1248918143 -bpstart_to 300 -bpend_to 300 -clnt htpststr001.san.mgmt.det 11:54:10.744 [348.4724] <4> bpfis: INF - BACKUP START 348 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS error 10; see following messages: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: Non-fatal method error was reported 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: vfm_configure_fi_one: method: FlashSnap, type: FIM, function: FlashSnap_init 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS method error 3; see following message: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: FlashSnap_init: Veritas Volume Manager not installed. 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS error 10; see following messages: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: Non-fatal method error was reported 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: vfm_configure_fi_one: method: vxvm, type: FIM, function: vxvm_init 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS method error 3; see following message: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: vxvm_init: Veritas Volume Manager not installed. 11:54:11.713 [348.4724] <4> onlfi_thaw: Thawing C:\ using snapshot method VSS. 11:54:11.713 [348.4724] <2> onlfi_vfms_logf: vfm_thaw: delete snapshot ... 11:54:11.744 [348.4724] <2> onlfi_vfms_logf: snapshot services: emcclariionfi:Thu Jul 30 2009 11:54:11.744000 <Thread id - 4724> Unable to import any login credentials for any appliances. 11:54:11.760 [348.4724] <2> onlfi_vfms_logf: snapshot services: hpevafi:Thu Jul 30 2009 11:54:11.760000 <Thread id - 4724> CHpEvaPlugin::init: CLI tool is not installed. 11:54:11.760 [348.4724] <2> onlfi_vfms_logf: snapshot services: hpmsafi:Thu Jul 30 2009 11:54:11.760000 <Thread id - 4724> No array mangement credentials are available in configuration file. 11:54:13.806 [348.4724] <4> onlfi_thaw: do_thaw return value: 0 11:54:13.806 [348.4724] <4> onlfi_thaw: Thawing D:\ using snapshot method VSS. 11:54:15.806 [348.4724] <4> onlfi_thaw: do_thaw return value: 0 11:54:19.806 [348.4724] <2> fis_delete_id: removing D:\Program Files\Veritas\NetBackup\online_util\fi_cntl\bpfis.fim.htpststr001.san.mgmt.det_1248918143.0 11:54:19.806 [348.4724] <2> fis_delete_id: removing D:\Program Files\Veritas\NetBackup\online_util\fi_cntl\bpfis.fim.htpststr001.san.mgmt.det_1248918143.0.fiid 11:54:19.853 [348.4724] <4> bpfis: INF - EXIT STATUS 0: the requested operation was successfully completed The Question: Has anyone any experience of NetBackup / VSS not clearing snapshots after backups? We will ultimately be using a HP EVA for the snapshots, but we want to ensure correct functioning at a VSS level before we go further. Regards, Jonathan (PS: Question previously posted by my colleague on entsupport.symantec.com)

    Read the article

  • Cant delete more than 200 contacts in HTC HERO

    - by rahul
    I'm working on security application which will copy all contacts to some other database and delete all contacts from phonebook. I'm testing this on android HTC HERO. I'm successful to delete contacts from phonebook and create new contact info database, Till 200 it is working, but after 200 contacts its not working properly. After tht application starts throwing error. There is one Sync with Google Option in MenuSettingData Sync, I think that is creating problem. There is notification that "Too many contacts deleted" n if i click tht there will b a dialog with title "Delete Limit exceeded". Is there anything i can do to stop syncronization or any other ideas by which i can achieve required output? Please Help me on this

    Read the article

  • SQL Server, temporary tables with truncate vs table variable with delete

    - by Richard
    I have a stored procedure inside which I create a temporary table that typically contains between 1 and 10 rows. This table is truncated and filled many times during the stored procedure. It is truncated as this is faster than delete. Do I get any performance increase by replacing this temporary table with a table variable when I suffer a penalty for using delete (truncate does not work on table variables) Whilst table variables are mainly in memory and are generally faster than temp tables do I loose any benefit by having to delete rather than truncate?

    Read the article

  • how to delete duplicates in mysql using case

    - by JPro
    Right now I am using something like this to delete duplicates in mysql table : delete t2 from my_table1 as t1, my_table1 as t2 where t1.TestCase = t2.TestCase and t2.id > t1.id; say I have a structure like this : ID TestCAse Result 1 T1 PASS 2 T2 FAIL 3 T3 FAIL 4 T3 PASS now, in the above case T3 is duplicate entry, and if I use the SQL that I mentioned above, it would delete 4th row where the result is PASS, but this is the row that I want to keep and I want row 3 to get deleted which is FAIL. Any help please? Thank you.

    Read the article

  • JPA Cascade delete.

    - by Win Man
    Hi, I am new to JPA/Hibernate. Currently using EJB3, Hibernate/JPA. I have an inheritacnce structure as follows.. @Entity @DiscriminatorColumn(name = "form_type") @Inheritance(strategy = InheritanceType.JOINED) @GenericGenerator(name = "FORMS_SEQ", strategy = "sequence-identity", parameters = @Parameter(name = "sequence", value = "FORMS_SEQ")) @Table(name = "Forms") public abstract class Form{ //code for Form } @Entity @Table(name = "CREDIT_CARDS") @PrimaryKeyJoinColumn(name="CREDIT_CARD_ID") public class CreditCardForm extends Form { //Code for CreditCards. } When I add a row with save the rows are properly inserted into the parent and the child table. However when I try to delete I get an error - 10:19:35,465 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: Removing a detached instance com.data.entities.form.financial.CreditCard#159? I am using a simple for loop to determine the inheritance type - CreditCard or DebitCard and then calling entityManager.remove(entity). What am I doing wrong? Code for delete.. for(Form content: contents){ if(content.getType()==Type.CREDIT_CARD){ creditCardService.delete((CreditCard)content); } Thanks. WM

    Read the article

  • How do you handle the deletion of your model working with ViewModels and keeping them in sync ?

    - by Lisa
    Hello, these could be my entity relations: 1 Pupil has 1 Chair 1 Pupil has N Documents 1 Pupil has N Marks 1 Pupil has N IncidentReports etc... So with that sample I get 4 IEnumerable from my database put each into an ObservableCollection. Now I have 4 different Views each bound to one of those 4 collections. Lets assume I delete a single PupilViewModel in the AdministrationController which is the only View where I can delete a PupilViewModel. Now I have to inform 3 other Controller and their ObservableCollections about the one deleted PupilViewModel to keep the whole application synchronized... thats stupid somehow. Do you have any good advice on that scenario? AND it gets even worse. If I delete a schoolclass I have to sync the pupils everywhere AND the documents or incidentreports or marks... gush... o_O

    Read the article

  • Delete a line from a file in java

    - by dalton conley
    Ok, so I'm trying to delete lines from a text file with java. Currently the way I'm doing this, is I'm keep track of a line number and inputting an index. The index is the line I want deleted. So each time I read a new line of data I increment the line count. Now when I reach the line count that is the same index, I dont write the data to the temporary file. Now this works, but what if for example I'm working with huge files and I have to worry about memory restraints. How can I do this with.. file markers? For example.. place the file marker on the line I want to do delete. Then delete that line? Or is that just too much work?

    Read the article

  • How to delete a contact in android 2.1

    - by Rishabh
    Hi, I have added one contact to android by following code. ContentValues values = new ContentValues(); Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values); long rawContactId = ContentUris.parseId(rawContactUri); values.clear(); values.put(Data.RAW_CONTACT_ID, rawContactId); values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE); values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan"); getContentResolver().insert(Data.CONTENT_URI, values); It shows up on emulator 2.1, but when i am going to delete it manually by "delete contact" option, its not deleteing from emulator. If I edit some thing on it then only it deletes. How can i directly delete it from menu ? Thanks in advance...

    Read the article

  • NetBackup with VSS and Instant Recovery - Failing to delete old snapshots

    - by Jonathan Bourke
    We are attempting to implement Microsoft VSS for snap-shotting in our NetBackup 6.5.3.1 environment. The clients are both 32 & 64 bit Windows 2003 Server. Snapshot parameters are: Instant recovery is enabled Maximum snapshots = 1 Provider type = 1 (System) Snapshot attribute = 1 (Differential) All backups successfully complete, and VSS shadows are successfully created both for the snapshot backup and for the open files (shadow copy components). The Issue: NetBackup is not clearing or overwriting old snapshots with each successive backup. When we list shadows, and shadow storage, it is increasing and increasing. IT is not honouring the Maximum Snapshot setting. The Logs: The bpfis log doesn’t really appear to show any errors other than for methods which we are not employing (VxVM, Flashsnap, etc.). A section is as follows: 11:54:10.744 [348.4724] <2> logparams: D:\Program Files\Veritas\NetBackup\bin\bpfis.exe delete -nbu -id htpststr001.san.mgmt.det_1248918143 -bpstart_to 300 -bpend_to 300 -clnt htpststr001.san.mgmt.det 11:54:10.744 [348.4724] <4> bpfis: INF - BACKUP START 348 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS error 10; see following messages: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: Non-fatal method error was reported 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: vfm_configure_fi_one: method: FlashSnap, type: FIM, function: FlashSnap_init 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS method error 3; see following message: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: FlashSnap_init: Veritas Volume Manager not installed. 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS error 10; see following messages: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: Non-fatal method error was reported 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: vfm_configure_fi_one: method: vxvm, type: FIM, function: vxvm_init 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: VfMS method error 3; see following message: 11:54:11.713 [348.4724] <8> onlfi_initialize_vfms: vxvm_init: Veritas Volume Manager not installed. 11:54:11.713 [348.4724] <4> onlfi_thaw: Thawing C:\ using snapshot method VSS. 11:54:11.713 [348.4724] <2> onlfi_vfms_logf: vfm_thaw: delete snapshot ... 11:54:11.744 [348.4724] <2> onlfi_vfms_logf: snapshot services: emcclariionfi:Thu Jul 30 2009 11:54:11.744000 <Thread id - 4724> Unable to import any login credentials for any appliances. 11:54:11.760 [348.4724] <2> onlfi_vfms_logf: snapshot services: hpevafi:Thu Jul 30 2009 11:54:11.760000 <Thread id - 4724> CHpEvaPlugin::init: CLI tool is not installed. 11:54:11.760 [348.4724] <2> onlfi_vfms_logf: snapshot services: hpmsafi:Thu Jul 30 2009 11:54:11.760000 <Thread id - 4724> No array mangement credentials are available in configuration file. 11:54:13.806 [348.4724] <4> onlfi_thaw: do_thaw return value: 0 11:54:13.806 [348.4724] <4> onlfi_thaw: Thawing D:\ using snapshot method VSS. 11:54:15.806 [348.4724] <4> onlfi_thaw: do_thaw return value: 0 11:54:19.806 [348.4724] <2> fis_delete_id: removing D:\Program Files\Veritas\NetBackup\online_util\fi_cntl\bpfis.fim.htpststr001.san.mgmt.det_1248918143.0 11:54:19.806 [348.4724] <2> fis_delete_id: removing D:\Program Files\Veritas\NetBackup\online_util\fi_cntl\bpfis.fim.htpststr001.san.mgmt.det_1248918143.0.fiid 11:54:19.853 [348.4724] <4> bpfis: INF - EXIT STATUS 0: the requested operation was successfully completed The Question: Has anyone any experience of NetBackup / VSS not clearing snapshots after backups? We will ultimately be using a HP EVA for the snapshots, but we want to ensure correct functioning at a VSS level before we go further. Regards, Jonathan (PS: Question previously posted by my colleague on entsupport.symantec.com)

    Read the article

  • How to delete recently created Google Contact?

    - by Preeti
    Hi, I am temporary creating one contact and immediatly after that i want to delete that contact. I am creating contact as follows: ContactEntry[] ContactEntry = new ContactEntry[2]; ContactEntry[0] = new ContactEntry(); ContactEntry[0].Title.Text = "Temp"; Uri feedUri = new Uri(ContactsQuery.CreateContactsUri("default")); ContactEntry createdEntry = (ContactEntry)obj_ContactService.Insert(feedUri, ContactEntry[0]); In order to delete above contact if i use: ContactEntry[0].Delete(); It is throwing Exception : "No Service object set". Note: I am using Google Apps API Ver 2 for .NET Thanx

    Read the article

  • Will this safely delete my record?

    - by Sergio Tapia
    I hate these three tables that. Two tables have a many to many relationship and as such it generates a third table. I'm using Linq-to-SQL and in the .dbml file I've dragged all the folder there to the graphic surface. Here is the method I'm using to delete an Area safely. Remember that documents are associated to an Area, so I can't just delete it and leave documents hanging. ScansDataContext db = new ScansDataContext(); /// <summary> /// Deletes an Area object from the database along with all associations in the database. /// </summary> /// <param name="area">Area object to save</param> public void Delete(Area area) { db.DocumentAreaRelations.DeleteAllOnSubmit(area.DocumentAreaRelations); db.Areas.DeleteOnSubmit(area); db.SubmitChanges(System.Data.Linq.ConflictMode.FailOnFirstConflict); }

    Read the article

  • Ant delete task

    - by user315228
    Hi, I have several files with name abc* and i want to delete all those files. is it possible using ant task. For eg. my directory structure is: c:\ myapp\ abc.xml abc.txt abc-1.2.xml abc-abc.xml abcdef.xml pqr.xml xyz.xml abc\ so from this, i need to delete all abc* files. So if i use ant it should delete following: abc.xml abc.txt abc-1.2.xml abc-abc.xml abcdef.xml it should leave directory with abc* Can somebody help me. Almas

    Read the article

  • Delete Button issue

    - by Dilse Naaz
    Hi, I am using one link button in an asp.net application for delete purpose. For the confirmation i added the property of OnClientclick="return ValidateOnDelete();". By Default it works as fine. But i have One condition is that When the user is not admin, the delete button will be disabled. My problem is that, if the user clicks on the delete button when it is in disabled mode, the confirmation message will come. How it can avoid this issue?

    Read the article

  • Delete files from blobstore using file serving URL

    - by Arturo
    In my app (GWT on GAE) we are storing on our database the serving URL that is stored on blobstore. When user selects one of these files and clicks "delete", we need to delete the file from blobstore. This is our code, but it is not deleting the file at all: public void remove(String fileURL) { BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); String key = getBlobKeyFromURL(box.getImageURL()); BlobKey blobKey = new BlobKey(key); blobstoreService.delete(blobKey); } Where fileURL looks like this: http://lh6.ggpht.com/d5VC0ywISACeJRiC3zkzaZug-tPsaI_LGt93-e_ATGTCwnGLao4yTWjLVppQ And getBlobKeyFromURL() would return what is after the last "/", in this example: d5VC0ywISACeJRiC3zkzaZug-tPsaI_LGt93-e_ATGTCwnGLao4yTWjLVppQ Could you please advice? Thanks

    Read the article

  • Deleting rows with MySQL LEFT JOIN

    - by fabrik
    Hello! I have two tables, one for job deadlines, one for describe a job. Each job can take a status and some statuses means the jobs' deadlines must be deleted from the other table. I can easily SELECT the jobs/deadlines that meets my criteria with a LEFT JOIN: SELECT * FROM `deadline` LEFT JOIN `job` ON deadline.job_id = job.job_id WHERE `status` = 'szamlazva' OR `status` = 'szamlazhato' OR `status` = 'fizetve' OR `status` = 'szallitva' OR `status` = 'storno' (status belongs to job table not deadline) But when i'd like to delete these rows from deadline, MySQL throws an error. My query is: DELETE FROM `deadline` LEFT JOIN `job` ON deadline.job_id = job.job_id WHERE `status` = 'szamlazva' OR `status` = 'szamlazhato' OR `status` = 'fizetve' OR `status` = 'szallitva' OR `status` = 'storno' MySQL error says nothing: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN `job` ON deadline.job_id = job.job_id WHERE `status` = 'szaml' at line 1 How can i turn my SELECT into a working DELETE query? Thanks, fabrik

    Read the article

  • DataTable Delete Row and AcceptChanges

    - by Pang
    DataTable DT num type name =================================== 001 A Peter 002 A Sam 003 B John public static void fun1(ref DataTable DT, String TargetType) { for (int i = 0; i < DT.Rows.Count; i++) { string type = DT.Rows[i]["type"]; if (type == TargetType) { /**Do Something**/ DT.Rows[i].Delete(); } } DT.AcceptChanges(); } My function get specific data rows in datatable according to the TargetType and use their info to do something. After the datarow is read (match the target type), it will be deleted. However, the row is deleted immediately after .Delete() execute, so the location of the next row (by i) is incorrect. For example, if TargetType is A. When i=0, the "Peter" row is deleted after .Delete executed. Then when i=1, I suppose it will locate the "Sam" row but it actually located "John" row because "Peter" row is deleted. Is there any problem in my codes?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >