Search Results

Search found 480 results on 20 pages for 'exclusive'.

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

  • LINQ and set difference

    - by Pierre
    I have two collections a and b. I would like to compute the set of items in either a or b, but not in both (a logical exclusive or). With LINQ, I can come up with this: IEnumerable<T> Delta<T>(IEnumerable<T> a, IEnumerable<T> b) { return a.Except (b).Union (b.Except (a)); } I wonder if there are other more efficient or more compact ways of producing the difference between the two collections.

    Read the article

  • Remove another user's lock obtained with sp_getapplock on SQL Server

    - by joshperry
    We have a system that uses sp_getapplock to create an exclusive mutex any time someone opens an order in the GUI. This is used to prevent multiple people from making changes to an order simultaneously. Sometimes people will open an order and go home, leaving it open. This effectively blocks anyone from being able to make changes to the order. I then get emails, calls and end up doing a kill <spid> in enterprise manager. Obviously I've gotten sick of this and want to make a quick self-service webform. The main problem I've run into is that kill requires sysadmin privileges, which I do not want to give to the user that the our website runs as. I have tried sp_releaseapplock but this doesn't let you release another user's lock (even when calling it as a sysadmin). So, finally my question; does anyone know of an alternative method to release a lock that was obtained by another user using sp_getapplock?

    Read the article

  • is it possible to lock oracle 10g database table with ADO.NET?

    - by matti
    I have a table that contains a maximum value that needs to be get and set by multiple programs. How can I lock the table for a while when old value is got and new is updated in C#? In other words: string sql = "lock table MaxValueTable in exclusive mode"; using (DbCommand cmd = cnctn.CreateCommand()) { cmd.CommandText = sql; // execute command somehow!! } maxValue = GetMaxValue(); SetMaxValue(maxValue + X); sql = "lock table MaxValueTable in share mode"; using (DbCommand cmd = cnctn.CreateCommand()) { cmd.CommandText = sql; // execute command somehow!! }

    Read the article

  • Facebook.streamPublish does not write on wall...why?

    - by dataflash
    $titleData = json_encode(array( 'gname' = $giftName, 'url' = $appCanvasUrl, )); $bodyTemplate = 'One gift to {actor}!'; $bodyData = json_encode(array( 'url' = $appCanvasUrl, )); $bodyGeneral = 'Send the exclusive gifts to all your friends!'; $imgSrc = $appcallbackurl.'gifts/'.$giftImage; $imgLink = $appCanvasUrl; $target_ids = $friends[0]; Facebook.streamPublish($titleTemplate, $titleData, $bodyTemplate, $bodyData, $bodyGeneral, $imgSrc, $imgLink, '', $target_ids); What am i doing wrong?I get the 500 error when i try to write on wall, i have permision, to post on wall, as i ask for it!Is there another way to use Facebook.streamPublish? tx a lot! I have a fbml app!

    Read the article

  • is it possible to lock oracle 10g database table with C#/(ADO?).NET 2.0

    - by matti
    I have a table that contains a maximum value that needs to be get and set by multiple programs. How can I lock the table for a while when old value is got and new is updated in C#? In other words: string sql = "lock table MaxValueTable in exclusive mode"; using (DbCommand cmd = cnctn.CreateCommand()) { cmd.CommandText = sql; // execute command somehow!! } maxValue = GetMaxValue(); SetMaxValue(maxValue + X); sql = "lock table MaxValueTable in share mode"; using (DbCommand cmd = cnctn.CreateCommand()) { cmd.CommandText = sql; // execute command somehow!! } -BR: Matti

    Read the article

  • 3D Screensaver interfering with WPF application (Windows XP)

    - by Andrew Keith
    I have a fairly large application that uses WPF for its user interface. I recently found an unusual defect regarding 3D screensavers. The 3D screensavers 3D FlowerBox,3D Flying Objects,3D Pipes,3D Text causes 1 of my WPF windows to disappear when the screensaver activates. Other screensavers are fine. My application only encounters this problem on Windows XP. I have some experience with DirectX. When a 3D screensavers activates, the d3d device context will be switched to exclusive mode. I reckon that WPF has trouble restoring the device context when the device switches back to cooperative mode (hence why its only affecting windows XP) Has anyone seen such a scenario occur before ? Is there a remedy for the problem ? Windows XP SP3, DirectX 9.0c, .NET 3.5

    Read the article

  • Can I un-check a group of RadioBottoms inside a group box?

    - by Claire Huang
    radio bottoms inside a group Box will be treated as a group of bottoms. They are mutual exclusive. How can I clean up their check states?? I have several radio bottoms, one of them are checked. How can I "clean" (uncheck) all radio bottoms?? "setChecked" doesn't work within a group, I tried to do following things but failed. My code is as following, radioButtom is inside a groupBox, and I want to unchecked it. The first setChecked does works, but the second one doesn't, the radioBottom doesn't been unchecked MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { QRadioButton *radioButton; ui->setupUi(this); radioButton->setChecked(true); radioButton->setChecked(false); } Where is the problem in my code?

    Read the article

  • Transaction & Locks Problem

    - by jay
    with in do transaction, i defined a label and in this label i am accessing a table with exclusive-lock.and at the end of label i have done all the changes in that table. bt now i am with in transaction block. Now, i tried to access that same table in another session.then it show an error, Table used by another user. So is it possible that, can we release teh table with in transaction,so another user can access it. Exe Session1) DO TRANSACTION: loopb: repeat: -- --------------------- control is here right now. end. /repeat/ -- end /do transaction/ Session2) I tried to access same table,bt it show an error,that table locked by another user.

    Read the article

  • Transaction & Locks Problem

    - by jay
    with in do transaction, i defined a label and in this label i am accessing a table with exclusive-lock.and at the end of label i have done all the changes in that table. bt now i am with in transaction block. Now, i tried to access that same table in another session.then it show an error, Table used by another user. So is it possible that, can we release teh table with in transaction,so another user can access it. Exe Session1) DO TRANSACTION: loopb: repeat: -- --------------------- control is here right now. end. /repeat/ -- end /do transaction/ Session2) I tried to access same table,bt it show an error,that table locked by another user.

    Read the article

  • Obtain Update Table Lock at start of Stored Procedure in SQL Server

    - by Jim Hurne
    I'm writing a SQL Server stored procedure in which I want to lock a table for update before executing the body of the stored procedure. I don't want to prevent other processes from reading the table, but I do want to prevent other processes updating the table. Here is my first attempt: CREATE PROCEDURE someProcedure BEGIN SET TRANSACTION ISOLATION LEVEL READ COMITTED BEGIN TRANSANCTION SELECT COUNT(*) FROM TheTable WITH (UPDLOCK, TABLOCK) -- Pause procedure so that we can view the locks with sp_lock WAITFOR DELAY '00:15' -- Do stuff COMMIT END When I execute the stored procedure, and invoke sp_lock, I see that the table is indeed locked. However, it's locked with an Exclusive lock instead of an update lock: spid | dbid | ObjId | IndId | Type | Resource | Mode | Status ------------------------------------------------------------------ 63 | 10 | 233208031 | 0 | TAB | | X | GRANT How can I get an update (U) lock instead?

    Read the article

  • How to generate a cryptographically secure Double between 0 and 1?

    - by Portman
    I know how to generate a random number between 0 and 1 using the NextDouble method of the pseudo-random number generator. var rng1 = new System.Random(); var random1 = rng1.NextDouble(); // generates a random double between 0 and 1.0 And I know how to fill a random byte array using the cryptographically secure random number generator. Byte[] bytes = new Byte[8]; var rng2 = new System.Security.Cryptography.RNGCryptoServiceProvider(); rng2.GetBytes(bytes); // generates 8 random bytes But how can I convert the byte-array output of RNGCryptoServiceProvider into a random number between 0 (inclusive) and 1 (exclusive)?

    Read the article

  • Modelling multiple simultaneous states

    - by James P.
    How can you go about modelling an object that can have multiple simultaneous states? For example, you could have a person that's waiting for a bus. That's one state. But they could also be reading a newspaper while waiting for the bus. Furthermore, they could be thinking about something while reading the newspaper. They could also be sniffing their nose because they have a cold. That's a four states in all taking place at the same time. Obviously using booleans would be tedious and unflexible. Also, a conventional state pattern would mean that states are exclusive and can't be simultaneous in nature. The only thing I can think of is a State pattern combined with a Composite. Would this do or is there a way of taking things further?

    Read the article

  • Lock Question - When is an Update (U) lock issued?

    - by Randy Minder
    We are trying to resolve a deadlock problem. The transaction that is getting rolled back is attempting to issue an Update (U) lock on a resource that another transaction has an Exclusive (X) lock on. According to Books Online (http://msdn.microsoft.com/en-us/library/ms175519.aspx), an Update lock is supposed to prevent deadlocks, not cause them. So, my question is, why/when is an Update lock applied to a resource? We're a little confused about this because the resource that is attempting to have the Update lock applied to will not be updated by the process that is having the transaction rolled back. Thanks for your help on this. Randy

    Read the article

  • How to dynamically modify NHibernate load queries at runtime? EventListeners? Interceptors?

    - by snicker
    I need to modify the query used to load many-to-one references in my model. Specifically, I need to be able to further filter this data. Unfortunately, NH will not allow me to filter many-to-one relationships using the built in filtering system (?). I could just be doing something incorrect. Is there a hook where I can manually and dynamically modify the query used to load the data? Or an alternative to filters that will allow me to specify parameters? Background: I am working with a database that is using a form of revision control, with each entity having a natural ID PK, an EntityId, a RevisionValidTo and RevisionValidFrom field. There may be many rows using the same EntityId, which is the reference for other tables to join on, but the Revision ranges are mutually exclusive. Thus, the relationship is only many-to-one IIF the filter is applied. However, NH offers no way to specify a filter on many-to-one references (they do for collections...)

    Read the article

  • How to ensure I can replace files in a directory?

    - by chaiguy
    I want to completely replace one directory on the file system with another directory in a temp directory. The tricky part is that the files in the folder to be replaced could be being used at any time, causing the replace operation to fail. I need to somehow wait on an exclusive lock on the directory so that I can delete all of its contents without failing, so I can then move the other directory in to replace it. To make matters potentially more difficult, the process that is likely to be using the files is my own (via a Lucene.net library and out of my hands). So it can't be a process-level lock it has to be an object-level lock. Any thoughts on how I might do this? Or should I just keep re-attempting until it succeeds? I guess that's always an option.

    Read the article

  • What are block expressions actually good for?

    - by Helper Method
    I just solved the first problem from Project Euler in JavaFX for the fun of it and wondered what block expressions are actually good for? Why are they superior to functions? Is it the because of the narrowed scope? Less to write? Performance? Here's the Euler example. I used a block here but I don't know if it actually makes sense // sums up all number from low to high exclusive which are divisible by a or b function sumDivisibleBy(a: Integer, b: Integer, high: Integer) { def low = if (a <= b) a else b; def sum = { var result = 0; for (i in [low .. <high] where i mod 3 == 0 or i mod 5 == 0) { result += i } result } } Does a block makes sense here?

    Read the article

  • How can I test whether a csv file is currently open and being written to - the file, not a file hand

    - by Henry
    I've seen a few questions/answers here that deal with this, but none really give me an answer/solution. I've got a Clipper system writing csv files to a Windows directory. I have a perl script running on a Linux server that is reading a mount of that Windows directory and importing the files to a database. Right now we're using flag files to indicate when a csv is no longer being written to; the flag files gets written after the csv is done. I'd really rather just get what I need from the csv itself, but I can't seem to find a way to tell when the file is open and being written to. lsof doesn't seem to answer my need. I've tried using flock and open the file with an exclusive lock, thinking it might throw an error if the file is being modified, but it doesn't. Any thoughts?

    Read the article

  • Can I avoid repeating myself in this situation (Java)

    - by UltimateGuy
    if (openFile == null) { new AppFileDialog().chooseFile("Save", appFrame); } if (openFile == null) { return; } Here I need to check to see if the user has already chosen a file. If not, they are given a prompt to. If the file is still null, the function returns without saving. The problem is the two identical if statements, can I avoid it? I take DRY very seriously, but at the same time KISS. Ideally the two go hand in hand, but in a situation like this, it seems they are mutually exclusive.

    Read the article

  • Joomla mailing list with referral plugin?

    - by Stu
    Hi all I've inherited a Joomla 1.5 site and I am trying to find a Joomla component that will let me add a signup/prizedraw page where people can also recommend the compo to a friend in the one form. Basically 1 - email to go out to our existing database asking them to recommend a friend for the chance to win x prize 2 – they are directed to the form on the website where they enter their details for the prize draw and also have the option to enter a few friends email addresses 3 – the recommender is entered into the draw (signed up), while the recommended friends get a princes square email saying ‘you have been recommended by....to receive exclusive offers etc etc.. click here to enter. Does anybody know if there any plugins out there that does this or is it a hand code jobby. Cheers muchly.

    Read the article

  • What is the difference between IEditableObject and IRevertibleChangeTracking?

    - by open-collar
    What is the difference between IEditableObject and IRevertibleChangeTracking (both from the System.ComponentModel namespace)? It looks as if the first supports explicit transaction whilst the second is more implicit - but the net result is the same. How should I go about implementing this in code? At the moment I do nothing in BeginEdit and call RejectChanges and AcceptChanges in EndEdit and CancelEdit respectively. My problem is that this will also accept the changes made prior to the BeginEdit. Is that really what MS wanted or am I trying to implement two mutually exclusive interfaces?

    Read the article

  • Does ASP.NET Make Request Scheduling Decisions Based Upon SessionID?

    - by Mike Murphy
    I know that a properly implemented SessionStateStoreProvider maintains an exclusive lock on session data for the duration of a request. However, considering that multiple requests could arrive simultaneously (e.g. via IFRAMEs) all but one would be able to make forward progress. All the other requests would block for a bit and reduce the number of worker threads available during that time. It seems if ASP.NET "peeked" at the session IDs on the requests early on, it could avoid running requests simultaneously that were on the same session. This would improve throughput under load for pages that didn't want to give up using IFRAMEs. This seems plausible enough that it might be true.

    Read the article

  • Use of bit-torrent for large file download as an alternative to FTP

    - by questzen
    The company I work for procures large volumes of data and does this by subscribing to FTP locations. I was wondering if it is possible to download the same using a tracker, the major challenge is authentication of the users IMO. Most ftp servers we subscribe to have a restriction of the number of ftp connection attempts. Does any one here have any experience with this? Any advice is welcome. Edit To clarify, we subscribe to third party vendors and access their ftp location using credentials provided by them. The service is not exclusive to us, they do sell their data to several others. If we could be part of the swarm, the download rates would be pretty high without added penalty. The question is about the possibility of achieving this, so that we can put-forth a proposal in those lines. The vendors obviously wouldn't share data to non-subscribers, so that is a constraint.

    Read the article

  • Do MySQL Locked Tables affect related Views?

    - by CogitoErgoSum
    So after reading http://stackoverflow.com/questions/1415602/performance-in-pdo-php-mysql-transaction-versus-direct-execution in regards to performance issues I was thinking about I did some research on locking tables in MySQL. On http://dev.mysql.com/doc/refman/5.0/en/table-locking.html Table locking enables many sessions to read from a table at the same time, but if a session wants to write to a table, it must first get exclusive access. During the update, all other sessions that want to access this particular table must wait until the update is done. This part struck me particularly becuase most of our queries will be updates rather than inserts. I was wondering if one created a table called foo on which all updates/inserts were carried out and then a view called foo_view (A copy of foo, or perhaps foo and a linkage of several other tables plus foo) on which all selects occured, would this locking issue still occur? That is, would SELECT quries on foo_view still have to wait for an update to finish on foo?

    Read the article

  • Delayed Jobs is not finding Records and failing..

    - by Trip
    In my app, delayed jobs isn't running automatically on my server anymore. It used to.. When I manually ssh in, and perform rake jobs:work I return this : * Starting job worker host:ip-(censored) pid:21458 * [Worker(host:ip-(censored) pid:21458)] acquired lock on PhotoJob * [JOB] host:ip-(censored) pid:21458 failed with ActiveRecord::RecordNotFound: Couldn't find Photo with ID=9237 - 4 failed attempts This returns roughly 20 times over for what I think is several jobs. Then I get a few of these: [Worker(host:ip-(censored) pid:21458)] failed to acquire exclusive lock for PhotoJob And then finally one of these : 12 jobs processed at 73.6807 j/s, 12 failed ... Any ideas what I should be mulling over? Thanks so much!

    Read the article

  • Using Drools to provide error processing and consequence management

    - by Mike
    Hi, I am working on a module whose purpose is to process Java exceptions and decide upon a strategy for dealing with them. The exceptions could be things I know about (explicit business exceptions eg TransformationException) or more general environmental stuff (JMS errors, IO errors etc) The facts inserted into the knowledge base are all the same class, and wrap (contain) an Exception. I want to write a rule that will explicitly match the exceptions I know how to deal with (eg TransformationException) and have another rule that catches 'everything else' The problem seems to me to be that for a fact containing a TransformationException, both rules will fire and the output will be uncertain. How would I go about writing such exclusive rules without relying on salience to steer the order of execution (this seems to be bad practice from what I have read)? I have a solution in place that I am not happy with whereby the outcome depends on the order in which the rules are defined in my .drl.

    Read the article

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