Search Results

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

Page 12/360 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Vista: Alt + Shift + P opens Windows Media Player; how to delete this hotkey?

    - by NotSuper
    I just bought a new laptop, and am having to learn Vista. (My desktop has XP.) I was just trying to set some shortcut keys, and wanted to use Alt + Shift + P for Anywho.com, but to my surprise Alt + Shift + P is already taken. It calls Windows Media Player. Now I like WMP and will use it a lot, but I want my Alt + Shift + P for AnyWho.com. BTW I have PC Magazine's Hotkey Detective 2 (http://www.pcmag.com/article2/0,2817,5082,00.asp), but it doesn't show that Alt + Shift + P is taken. How to do this?

    Read the article

  • "net use /delete" question

    - by tinmaru
    I want to delete a network connection. When I type net use I get this: Microsoft Windows XP [version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\totonet use État Local Distant Réseau OK M: \192.168.5.138\share Réseau Microsoft Windows OK R: \192.168.2.18\tools Réseau Microsoft Windows OK \192.168.2.43\data Réseau Microsoft Windows La commande s'est terminée correctement. The syntax for deleting a network map is : net use /delete X: if I want to delete a specific connection net use /delete * * if I want to delete all connections. How can I delete the \192.168.2.43\data connection which, as you can see, is not link to any logical letter?

    Read the article

  • SSIS – Delete all files except for the most recent one

    - by jorg
    Quite often one or more sources for a data warehouse consist of flat files. Most of the times these files are delivered as a zip file with a date in the file name, for example FinanceDataExport_20100528.zip Currently I work at a project that does a full load into the data warehouse every night. A zip file with some flat files in it is dropped in a directory on a daily basis. Sometimes there are multiple zip files in the directory, this can happen because the ETL failed or somebody puts a new zip file in the directory manually. Because the ETL isn’t incremental only the most recent file needs to be loaded. To implement this I used the simple code below; it checks which file is the most recent and deletes all other files. Note: In a previous blog post I wrote about unzipping zip files within SSIS, you might also find this useful: SSIS – Unpack a ZIP file with the Script Task Public Sub Main() 'Use this piece of code to loop through a set of files in a directory 'and delete all files except for the most recent one based on a date in the filename. 'File name example: 'DataExport_20100413.zip Dim rootDirectory As New DirectoryInfo(Dts.Variables("DirectoryFromSsisVariable").Value.ToString) Dim mostRecentFile As String = "" Dim currentFileDate As Integer Dim mostRecentFileDate As Integer = 0 'Check which file is the most recent For Each fi As FileInfo In rootDirectory.GetFiles("*.zip") currentFileDate = CInt(Left(Right(fi.Name, 12), 8)) 'Get date from current filename (based on a file that ends with: YYYYMMDD.zip) If currentFileDate > mostRecentFileDate Then mostRecentFileDate = currentFileDate mostRecentFile = fi.Name End If Next 'Delete all files except the most recent one For Each fi As FileInfo In rootDirectory.GetFiles("*.zip") If fi.Name <> mostRecentFile Then File.Delete(rootDirectory.ToString + "\" + fi.Name) End If Next Dts.TaskResult = ScriptResults.Success End Sub Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!

    Read the article

  • How should I unbind and delete OpenAL buffers?

    - by Joe Wreschnig
    I'm using OpenAL to play sounds. I'm trying to implement a fire-and-forget play function that takes a buffer ID and assigns it to a source from a pool I have previously allocated, and plays it. However, there is a problem with object lifetimes. In OpenGL, delete functions either automatically unbind things (e.g. textures), or automatically deletes the thing when it eventually is unbound (e.g. shaders) and so it's usually easy to manage deletion. However alDeleteBuffers instead simply fails with AL_INVALID_OPERATION if the buffer is still bound to a source. Is there an idiomatic way to "delete" OpenAL buffers that allows them to finish playing, and then automatically unbinds and really them? Do I need to tie buffer management more deeply into the source pool (e.g. deleting a buffer requires checking all the allocated sources also)? Similarly, is there an idiomatic way to unbind (but not delete) buffers when they are finished playing? It would be nice if, when I was looking for a free source, I only needed to see if a buffer was attached at all and not bother checking the source state. (I'm using C++, although approaches for C are also fine. Approaches assuming a GCd language and using finalizers are probably not applicable.)

    Read the article

  • Qt : crash due to delete (trying to handle exceptions...)

    - by Seub
    I am writing a program with Qt, and I would like it to show a dialog box with a Exit | Restart choice whenever an error is thrown somewhere in the code. What I did causes a crash and I really can't figure out why it happens, I was hoping you could help me understanding what's going on. Here's my main.cpp: #include "my_application.hpp" int main(int argc, char *argv[]) { std::cout << std::endl; My_Application app(argc, argv); return app.exec(); } And here's my_application:hpp: #ifndef MY_APPLICATION_HPP #define MY_APPLICATION_HPP #include <QApplication> class Window; class My_Application : public QApplication { public: My_Application(int& argc, char ** argv); virtual ~My_Application(); virtual bool notify(QObject * receiver, QEvent * event); private: Window *window_; void exit(); void restart(); }; #endif // MY_APPLICATION_HPP Finally, here's my_application.cpp: #include "my_application.hpp" #include "window.hpp" #include <QMessageBox> My_Application::My_Application(int& argc, char ** argv) : QApplication(argc, argv) { window_ = new Window; window_->setAttribute(Qt::WA_DeleteOnClose, false); window_->show(); } My_Application::~My_Application() { delete window_; } bool My_Application::notify(QObject * receiver, QEvent * event) { try { return QApplication::notify(receiver, event); } catch(QString error_message) { window_->setEnabled(false); QMessageBox message_box; message_box.setWindowTitle("Error"); message_box.setIcon(QMessageBox::Critical); message_box.setText("The program caught an unexpected error:"); message_box.setInformativeText("What do you want to do? <br>"); QPushButton *restart_button = message_box.addButton(tr("Restart"), QMessageBox::RejectRole); QPushButton *exit_button = message_box.addButton(tr("Exit"), QMessageBox::RejectRole); message_box.setDefaultButton(restart_button); message_box.exec(); if ((QPushButton *) message_box.clickedButton() == exit_button) { exit(); } else if ((QPushButton *) message_box.clickedButton() == restart_button) { restart(); } } return false; } void My_Application::exit() { window_->close(); //delete window_; return; } void My_Application::restart() { window_->close(); //delete window_; window_ = new Window; window_->show(); return; } Note that the line window_->setAttribute(Qt::WA_DeleteOnClose, false); means that window_ (my main window) won't be deleted when it is closed. The code I've written above works, but as far as I understand, there's a memory leak: I should uncomment the line //delete window_; in My_Application::exit() and My_Application::restart(). But when I do that, the program crashes when I click restart (or exit but who cares). (I'm not sure this is useful, in fact it might be misleading, but here's what my debugger tells me: a segmentation fault occurs in QWidgetPrivate::PaintOnScreen() const which is called by a function called by a function... called by My_Application::notify()) When I do some std::couts, I notice that the program runs through the entire restart() function and in fact through the entire notify() function before it crashes. I have no idea why it crashes. Thanks in advance for your insights! Update: I've noticed that My_Application::notify() is called very often. For example, it is called a bunch of times while the error dialog box is open, also during the execution of the restart function. The crash actually occurs in the subfunction QApplication::notify(receiver, event). This is not too surprising in light of the previous remark (the receiver has probably been deleted) But even if I forbid the function My_Application::notify() to do anything while restart() is executed, it still crashes (after having called My_Application::notify() a bunch of times, like 15 times, isn't that weird)? How should I proceed? Maybe I should say (to make the question slightly more relevant) that my class My_Application also has a "restore" function, which I've not copied here to try to keep things short. If I just had that restart feature I wouldn't bother too much, but I do want to have that restore feature. I should also say that if I keep the code with the "delete window_" commented, the problem is not only a memory leak, it still crashes sometimes apparently. There must surely be a way to fix this! But I'm clueless, I'd really appreciate some help! Thanks in advance.

    Read the article

  • Oracle HRMS API – Delete Employee Element Entry

    - by PRajkumar
    API --  pay_element_entry_api.delete_element_entry    Example -- Consider Employee has Element Entry "Bonus". Lets try to Delete Element Entry "Bonus" using delete API     DECLARE       ld_effective_start_date            DATE;       ld_effective_end_date             DATE;       lb_delete_warning                   BOOLEAN;       ln_object_version_number    PAY_ELEMENT_ENTRIES_F.OBJECT_VERSION_NUMBER%TYPE := 1; BEGIN       -- Delete Element Entry       -- -------------------------------         pay_element_entry_api.delete_element_entry         (    -- Input data elements              -- ------------------------------              p_datetrack_delete_mode    => 'DELETE',              p_effective_date                      => TO_DATE('23-JUNE-2011'),              p_element_entry_id               => 118557,              -- Output data elements              -- --------------------------------              p_object_version_number   => ln_object_version_number,              p_effective_start_date           => ld_effective_start_date,              p_effective_end_date            => ld_effective_end_date,              p_delete_warning                  => lb_delete_warning         );    COMMIT; EXCEPTION         WHEN OTHERS THEN                           ROLLBACK;                           dbms_output.put_line(SQLERRM); END; / SHOW ERR;  

    Read the article

  • Safely delete a TFS branch project

    - by Codesleuth
    I'm currently reorganising our TFS source control for a very large set of solutions, and I've done this successfully so far. I have a problem at the moment where I need to delete a legacy "Release Branch" TFS project that was branched for the old structure, and is no-longer required since I now host a release branch within the new structure. This is an example of how the source control now looks after moving everything: $/Source Project /Trunk /[Projects] /Release /[Projects] $/Release Branch Project /[Projects] /[Other legacy stuff] So far I've found information that says: tf delete /lock:checkout /recursive TestMain to delete a branch. TfsDeleteProject to delete a project tf delete seems to be only relevant when I need to delete a branch that is within the same project as the trunk, and TfsDeleteProject doesn't seem like it will delete the branch association from the source project (I hope I'm wrong, see below). Can someone tell me if the above will work, and in what order I should perform them in, to successfully delete the TFS $/Release Branch Project while also deleting the branch association (from right-click $/Source Project - Properties - Branches)?

    Read the article

  • Exception when ASP.NET attempts to delete network file.

    - by Jordan Terrell
    Greetings - I've got an ASP.NET application that is trying to delete a file on a network share. The ASP.NET application's worker process is running under a domain account (confirmed this by looking in TaskManager and by using ShowContexts2.aspx¹). I've been assured by the network admins that the process account is a member of a group that has Modify permissions to the directory that contains the file I'm trying to delete. However, it is unable to do so, and instead I get an exception (changed the file path to all x's): System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. --- System.UnauthorizedAccessException: Access to the path '\xxxxxxx\xxxxxxx\xxxxxxx\xxxxxx.xxx' is denied. Any ideas on how to diagnose/fix this issue? Thanks - Jordan ¹ http://www.leastprivilege.com/ShowContextsNET20Version.aspx

    Read the article

  • Why is the hard drive still full after deleting some files?

    - by julio
    I have a server running Ubuntu Server 12.xx. Today some services stopped and I found some messages about full disk, so I ran df -h: Filesystem Size Used Disp Use% /dev/mapper/ubuntu-root 455G 434G 0 100% / udev 1,7G 4,0K 1,7G 1% /dev tmpfs 689M 4,2M 685M 1% /run none 5,0M 0 5,0M 0% /run/lock none 1,7G 0 1,7G 0% /run/shm /dev/sda1 228M 51M 166M 24% /boot overflow 1,0M 0 1,0M 0% /tmp I tried to delete some files remotely from a Windows computer by right-clicking and choosing "delete", but the hard drive remained full. Is there a Trash folder in Ubuntu Server? What could be happening?

    Read the article

  • Leaked Gmail for Android Version 4.2 Features Pinch-to-Zoom and Swipe-to-Delete [Video]

    - by Jason Fitzpatrick
    If you love keeping an eye at what’s around the corner, this video showcases some of the new features in Gmail for Android–there’s even an APK for those adventurous readers who want to try it. Courtesy of AndroidPolice, we’re treated to the above video showcasing Gmail for Android’s new look and features–including pinch-to-zoom and a swipe-to-delete (or archive), similar to the notification dismissal in Android Jelly Bean. If you’re up for a little unofficial app installation, you can even hit up the link below to check out the full writeup and grab a copy of the unofficial installer. Exclusive: Upcoming Gmail For Android 4.2 Will Finally Have Pinch-To-Zoom, Swipeaway Delete/Archive [AndroidZoom] HTG Explains: What is the Windows Page File and Should You Disable It? How To Get a Better Wireless Signal and Reduce Wireless Network Interference How To Troubleshoot Internet Connection Problems

    Read the article

  • How do I delete a [sub]hash based off of the keys/values of another hash?

    - by Zack
    Lets assume I have two hashes. One of them contains a set of data that only needs to keep things that show up in the other hash. e.g. my %hash1 = ( test1 => { inner1 => { more => "alpha", evenmore => "beta" } }, test2 => { inner2 => { more => "charlie", somethingelse => "delta" } }, test3 => { inner9999 => { ohlookmore => "golf", somethingelse => "foxtrot" } } ); my %hash2 = ( major=> { test2 => "inner2", test3 => "inner3" } ); What I would like to do, is to delete the whole subhash in hash1 if it does not exist as a key/value in hash2{major}, preferably without modules. The information contained in "innerX" does not matter, it merely must be left alone (unless the subhash is to be deleted then it can go away). In the example above after this operation is preformed hash1 would look like: my %hash1 = ( test2 => { inner2 => { more => "charlie", somethingelse => "delta" } }, ); It deletes hash1{test1} and hash1{test3} because they don't match anything in hash2. Here's what I've currently tried, but it doesn't work. Nor is it probably the safest thing to do since I'm looping over the hash while trying to delete from it. However I'm deleting at the each which should be okay? This was my attempt at doing this, however perl complains about: Can't use string ("inner1") as a HASH ref while "strict refs" in use at while(my ($test, $inner) = each %hash1) { if(exists $hash2{major}{$test}{$inner}) { print "$test($inner) is in exists.\n"; } else { print "Looks like $test($inner) does not exist, REMOVING.\n"; #not to sure if $inner is needed to remove the whole entry delete ($hash1{$test}{$inner}); } }

    Read the article

  • Why can't I reclaim my dynamically allocated memory using the "delete" keyword?

    - by synaptik
    I have the following class: class Patient { public: Patient(int x); ~Patient(); private: int* RP; }; Patient::Patient(int x) { RP = new int [x]; } Patient::~Patient() { delete [] RP; } I create an instance of this class on the stack as follows: void f() { Patient p(10); } Now, when f() returns, I get a "double free or corruption" error, which signals to me that something is attempted to be deleted more than once. But I don't understand why that would be so. The space for the array is created on the heap, and just because the function from inside which the space was allocated returns, I wouldn't expect the space to be reclaimed. I thought that if I allocate space on the heap (using the new keyword), then the only way to reclaim that space is to use the delete keyword. Help! :)

    Read the article

  • multiple C++ deletion of a memory pointed by multiple objects

    - by elgcom
    Another c++ pointer deletion question is in the following example: class Foo { public: int *p; ~Foo() { delete p; p = NULL; } }; Foo *f1 = new Foo(); Foo *f2 = new Foo(); f1->p = new int(1); f2->p = f1->p; delete f2; // ok delete f1; // no error? Why I did not get error when calling "delete f1"? didn't I delete the same address (*p) twice? If I directly delete the pointers in the last 2 lines of code, I will get error. delete f2->p; // ok delete f1->p; // error!! *** glibc detected *** double free or corruption (fasttop) ***

    Read the article

  • Mass Delete Using Gridview with Checkboxes

    This sample shows how to use a Gridview to delete multiple records all at once, having marked them with a Checkbox, and clicking one button, external to the Gridview, to delete them all As usual, here, we're using the Northwind Database. If you want to try this on your own Northwind database, adhere to this word of caution - "BACK IT UP FIRST". You will be making multiple deletes, so in order to get it back to the original state, you must make a backup and then restore afterwards. Remember too, that you will need to substitute your own Web.Config connectionstring entry for "YourNorthwindString" in the sample code

    Read the article

  • How do you DELETE rows in a mysql table that have a field IN the results of another query?

    - by user354825
    here's what the statement looks like: DELETE FROM videoswatched vw2 WHERE vw2.userID IN ( SELECT vw.userID FROM videoswatched vw JOIN users u ON vw.userID=u.userID WHERE u.companyID = 1000 GROUP BY userID ) that looks decent to me, and the SELECT statement works on its own (producing rows with a single column 'userID'. basically, i want to delete entries in the 'videoswatched' table where the userID in the videoswatched entry, after joining to the users table, is found to have companyID=1000. how can i do this without getting the error in my sql syntax? it says the error is near: vw2 WHERE vw2.userID IN ( SELECT vw.userID FROM videoswatched vw JOIN users u and on line 1. thanks!

    Read the article

  • How to delete a Dictionary row that is a Double by using an Int?

    - by Richard Reddy
    Hi, I have a Dictionary object that is formed using a double as its key values. It looks like this: Dictionary<double, ClassName> VariableName = new Dictionary<double, ClassName>(); For my project I have to have the key as the double as I require values like 1.1,1.2,2.1,2.2,etc in my system. Everything in my system works great except when I want to delete all the keys in a group eg all the 1 values would be 1.1,1.2, etc. I can delete rows if I know the full value of the key eg 1.1 but in my system I will only know the whole number. I tried to do the following but get an error: DictionaryVariable.Remove(j => Convert.ToInt16(j.Key) == rowToEdit).OrderByDescending(j => j.Key); Is there anyway to remove all rows per int value by converting the key? Thanks, Rich

    Read the article

  • How to delete files with a Python script from a FTP server which are older than 7 days?

    - by Tom
    Hello I would like to write a Python script which allows me to delete files from a FTP Server after they have reached a certain age. I prepared the scipt below but it throws the error message: WindowsError: [Error 3] The system cannot find the path specified: '/test123/*.*' Do someone have an idea how to resolve this issue? Thank you in advance! import os, time from ftplib import FTP ftp = FTP('127.0.0.1') print "Automated FTP Maintainance" print 'Logging in.' ftp.login('admin', 'admin') # This is the directory that we want to go to directory = 'test123' print 'Changing to:' + directory ftp.cwd(directory) files = ftp.retrlines('LIST') print 'List of Files:' + files # ftp.remove('LIST') #------------------------------------------- now = time.time() for f in os.listdir(directory): if os.stat(f).st_mtime < now - 7 * 86400: if os.directory.isfile(f): os.remove(os.directory.join(directory, f)) #except: #exit ("Cannot delete files") #------------------------------------------- print 'Closing FTP connection' ftp.close()

    Read the article

  • Can't delete a SQL Database?

    - by rlb.usa
    I want to delete some SQL Databases on my server, but I'm having problems. My login has the roles: public dbcreator serveradmin When I right click the database and hit Delete, it says that Delete backup history failed for server 'MYSERVER' (Microsoft.SqlServer.Smo) Additional Information: The EXECUTE permission was denied on the object 'sp_delete_database_backuphistory' How do I delete these databases?

    Read the article

  • RMDIR or RD (win cmd) Command

    - by serdar
    I want to delete all folders starting with "A" letter (including subfolder/files). For example There are three folder in D directory (D:\Air, D:\Abonden, D:\All....) And we need to delete all folders with "A" I try this: == RMDIR D:\A* /s /q <== but I get error :( del command works with * but I dont want to delete only files also I want to delete folders ... Cant we do this via RMDIR? Thak you in advance

    Read the article

  • How-to delete a tree node using the context menu

    - by frank.nimphius
    Hierarchical trees in Oracle ADF make use of View Accessors, which means that only the top level node needs to be exposed as a View Object instance on the ADF Business Components Data Model. This also means that only the top level node has a representation in the PageDef file as a tree binding and iterator binding reference. Detail nodes are accessed through tree rule definitions that use the accessor mentioned above (or nested collections in the case of POJO or EJB business services). The tree component is configured for single node selection, which however can be declaratively changed for users to press the ctrl key and selecting multiple nodes. In the following, I explain how to create a context menu on the tree for users to delete the selected tree nodes. For this, the context menu item will access a managed bean, which then determines the selected node(s), the internal ADF node bindings and the rows they represent. As mentioned, the ADF Business Components Data Model only needs to expose the top level node data sources, which in this example is an instance of the Locations View Object. For the tree to work, you need to have associations defined between entities, which usually is done for you by Oracle JDeveloper if the database tables have foreign keys defined Note: As a general hint of best practices and to simplify your life: Make sure your database schema is well defined and designed before starting your development project. Don't treat the database as something organic that grows and changes with the requirements as you proceed in your project. Business service refactoring in response to database changes is possible, but should be treated as an exception, not the rule. Good database design is a necessity – even for application developers – and nothing evil. To create the tree component, expand the Data Controls panel and drag the View Object collection to the view. From the context menu, select the tree component entry and continue with defining the tree rules that make up the hierarchical structure. As you see, when pressing the green plus icon  in the Edit Tree Binding  dialog, the data structure, Locations -  Departments – Employees in my sample, shows without you having created a View Object instance for each of the nodes in the ADF Business Components Data Model. After you configured the tree structure in the Edit Tree Binding dialog, you press OK and the tree is created. Select the tree in the page editor and open the Structure Window (ctrl+shift+S). In the Structure window, expand the tree node to access the conextMenu facet. Use the right mouse button to insert a Popup  into the facet. Repeat the same steps to insert a Menu and a Menu Item into the Popup you created. The Menu item text should be changed to something meaningful like "Delete". Note that the custom menu item later is added to the context menu together with the default context menu options like expand and expand all. To define the action that is executed when the menu item is clicked on, you select the Action Listener property in the Property Inspector and click the arrow icon followed by the Edit menu option. Create or select a managed bean and define a method name for the action handler. Next, select the tree component and browse to its binding property in the Property Inspector. Again, use the arrow icon | Edit option to create a component binding in the same managed bean that has the action listener defined. The tree handle is used in the action listener code, which is shown below: public void onTreeNodeDelete(ActionEvent actionEvent) {   //access the tree from the JSF component reference created   //using the af:tree "binding" property. The "binding" property   //creates a pair of set/get methods to access the RichTree instance   RichTree tree = this.getTreeHandler();   //get the list of selected row keys   RowKeySet rks = tree.getSelectedRowKeys();   //access the iterator to loop over selected nodes   Iterator rksIterator = rks.iterator();          //The CollectionModel represents the tree model and is   //accessed from the tree "value" property   CollectionModel model = (CollectionModel) tree.getValue();   //The CollectionModel is a wrapper for the ADF tree binding   //class, which is JUCtrlHierBinding   JUCtrlHierBinding treeBinding =                  (JUCtrlHierBinding) model.getWrappedData();          //loop over the selected nodes and delete the rows they   //represent   while(rksIterator.hasNext()){     List nodeKey = (List) rksIterator.next();     //find the ADF node binding using the node key     JUCtrlHierNodeBinding node =                       treeBinding.findNodeByKeyPath(nodeKey);     //delete the row.     Row rw = node.getRow();       rw.remove();   }          //only refresh the tree if tree nodes have been selected   if(rks.size() > 0){     AdfFacesContext adfFacesContext =                          AdfFacesContext.getCurrentInstance();     adfFacesContext.addPartialTarget(tree);   } } Note: To enable multi node selection for a tree, select the tree and change the row selection setting from "single" to "multiple". Note: a fully pictured version of this post will become available at the end of the month in a PDF summary on ADF Code Corner : http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html 

    Read the article

  • Why delete-orphan needs "cascade all" to run in JPA/Hibernate ?

    - by Jerome C.
    Hello, I try to map a one-to-many relation with cascade "remove" (jpa) and "delete-orphan", because I don't want children to be saved or persist when the parent is saved or persist (security reasons due to client to server (GWT, Gilead)) But this configuration doesn't work. When I try with cascade "all", it runs. Why the delete-orphan option needs a cascade "all" to run ? here is the code (without id or other fields for simplicity, the class Thread defines a simple many-to-one property without cascade): when using the removeThread function in a transactional function, it does not run but if I edit cascade.Remove into cascade.All, it runs. @Entity public class Forum { private List<ForumThread> threads; /** * @return the topics */ @OneToMany(mappedBy = "parent", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY) @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) public List<ForumThread> getThreads() { return threads; } /** * @param topics the topics to set */ public void setThreads(List<ForumThread> threads) { this.threads = threads; } public void addThread(ForumThread thread) { getThreads().add(thread); thread.setParent(this); } public void removeThread(ForumThread thread) { getThreads().remove(thread); } } thanks.

    Read the article

  • Hibernate Envers : How to delete entries from my audit table?

    - by Laurent T
    Hi everyone, I am currently working with Hibernate Envers. My problem is the following : How to delete entries in the audit table related to the entity I want to delete? My entity has no relation with other entities. I figured out that I have to do that in onPostDelete method of my custom listener : import org.hibernate.envers.event.AuditEventListener; import org.hibernate.event.PostCollectionRecreateEvent; import org.hibernate.event.PostDeleteEvent; import org.hibernate.event.PostInsertEvent; import org.hibernate.event.PostUpdateEvent; import org.hibernate.event.PreCollectionRemoveEvent; import org.hibernate.event.PreCollectionUpdateEvent; public class MyListener extends AuditEventListener { ... @Override public void onPostDelete(PostDeleteEvent arg0) { // TODO Auto-generated method stub super.onPostDelete(arg0); } ... } I've read the documentation, forums, many things but I can't figure it out. May be it's not possible, I don't know. Has someone ever done this before? Thank you :)

    Read the article

  • How do I delete folders in bash after successful copy (Mac OSX)?

    - by cohortq
    Hello! I recently created my first bash script, and I am having problems perfecting it's operation. I am trying to copy certain folders from one local drive, to a network drive. I am having the problem of deleting folders once they are copied over, well and also really verifying that they were copied over). Is there a better way to try to delete folders after rsync is done copying? I was trying to exclude the live tv buffer folder, but really, I can blow it away without consequence if need be. Any help would be great! thanks! #!/bin/bash network="CBS" useracct="tvcapture" thedate=$(date "+%m%d%Y") folderToBeMoved="/users/$useracct/Documents" newfoldername="/Volumes/Media/TV/$network/$thedate" ECHO "Network is $network" ECHO "date is $thedate" ECHO "source is $folderToBeMoved" ECHO "dest is $newfoldername" mkdir $newfoldername rsync -av $folderToBeMoved/"EyeTV Archive"/*.eyetv $newfoldername --exclude="Live TV Buffer.eyetv" # this fails when there is more than one *.eyetv folder if [ -d $newfoldername/*.eyetv ]; then #this deletes the contents of the directories find $folderToBeMoved/"EyeTV Archive"/*.eyetv \( ! -path $folderToBeMoved/"EyeTV Archive"/"Live TV Buffer.eyetv" \) -delete #remove empty directory find $folderToBeMoved/"EyeTV Archive"/*.eyetv -type d -exec rmdir {} \; fi

    Read the article

  • How to delete a row from a typed dataset and save it to a database?

    - by Zingam
    I am doing this as a small project to learn about disconnected and connected models in .NET 4.0 and SQL Server 2008 R2. I have three tables: Companies (PK CompanyID) Addresses (PK AddressID, FK CompanyID) ContactPersons (PK ContactPersonID, FK CompanyID) CompanyID is assigned manually by the users. The other IDs are auto-generated. Companies has a one-to-many relationship with ContactPerson. I have set any changes to cascade. I display all records in Companies in a DataGridView and when a row is clicked, the corresponding records in ContactPersons are displayed in a second DataGridView. I have successfully implemented updating and inserting new records but I completely fail in my attempts to delete rows and save the changes to the database. I us a typed dataset. If I use this: DataRow[] contactPersonRows = m_SoldaCompaniesFileDataSet.ContactPersons.Select("ContactPersonID = " + this.m_CurrentContactPerson.ContactPersonID); m_SoldaCompaniesFileDataSet.ContactPersons.Rows.Remove(contactPersonRows[0]); The records are displayed properly in the DataGridView but are not saved in the database later. If I use this: DataRow row = m_SoldaCompaniesFileDataSet.ContactPersons.Rows.Find(this.m_CurrentContactPerson.ContactPersonID); row.Delete(); The records are set but I get an exeception: DeletedRowInaccessibleException, when I try to refresh the DataGridView. The exception pop-s up in the auto-generated dataset.design file. I am pretty much stuck at this point since yesterday. I cannot find anything anywhere that remotely resembles my problem. And I cannot understand actually what is going on.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >