Search Results

Search found 231 results on 10 pages for 'detach'.

Page 6/10 | < Previous Page | 2 3 4 5 6 7 8 9 10  | Next Page >

  • GAE/JDO: How to check whether a field in a detached object was loaded

    - by tempy
    My DAO detaches and then caches certain objects, and it may retrieve them with different fetch groups. Depending on which fetch group was used to retrieve the object, certain fields of that object may be available, or not. I would like to be able to test whether a given field on that object was loaded or not, but I can't simply check whether the field is null because that results in a "JDODetachedFieldAccessException" which demands that I either not access the field or add detach the field first. I could always catch that exception, but that doesn't smell right. So, does anyone know whether its possible to check if the field was detached?

    Read the article

  • How to do this in VB 2010 (C# to VB conversion)

    - by user203687
    I would like to have the following to be translated to VB 2010 (with advanced syntaxes) _domainContext.SubmitChanges( submitOperation => { _domainContext.Load<Customer>( _domainContext.GetCustomersQuery(), LoadBehavior.RefreshCurrent, loadOperation => { var results = _domainContext.Customers.Where( entity => !loadOperation.Entities.Contains(entity)).ToList(); results.ForEach( enitity => _domainContext.Customers.Detach(entity)); }, null); }, null); I managed to get the above with other ways (but not using anonymous methods). I would like to see all the advanced syntaxes available in VB 2010 to be applied to the above. Can anyone help me on this? thanks

    Read the article

  • Singleton again, but with multi-thread and Objective-C

    - by Tonny Xu
    I know Singleton pattern has been discussed so much. But because I'm not fully understand the memory management mechanism in Objective-C, so when I combined Singleton implementation with multithreading, I got a big error and cost me a whole day to resolve it. I had a singleton object, let's call it ObjectX. I declared an object inside ObjectX that will detach a new thread, let's call that object objectWillSpawnNewThread, when I called [[ObjectX sharedInstance].objectWillSpawnNewThread startNewThread]; The new thread could not be executed correctly, and finally I found out that I should not declare the object objectWillSpawnNewThread inside the singleton class. Here are my questions: How does Objective-C allocate static object in the memory? Where does Objective-C allocate them(Main thread stack or somewhere else)? Why would it be failed if we spawn a new thread inside the singleton object? I had searched the Objective-C language [ObjC.pdf] and Objective-C memory management document, maybe I missed something, but I currently I could not find any helpful information.

    Read the article

  • bitmap button not displaying in 3D style

    - by Rohit Sasikumar
    Hi, I want to display on my dialog, a bitmap button. I am using the below code CImage image; hr = image.Load(_T("myimage.png")); // just change extension to load jpg bitmap.Attach(image.Detach()); m_button.ModifyStyle(0,BS_BITMAP); m_button.SetBitmap(bitmap); This way bitmap is correctly displayed on button, but the button is not displayed in 3D style as normal buttons would look. I have set owner drawn property to false, still it displaying like this. Any ideas as to what could be wrong? Thanks, Rohit

    Read the article

  • Qt undocumented method setSharable

    - by soxs060389
    I stumbled about a method which seems to be present in all DataObjects like QList, QQueue, QHash... I even investigated so far i can see the source code of it, which is inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } in qlist.h (lines 117) but what effect does it have on the QList, QQueue, QHash... ? And is it in any way related to threading? (which sounds reasonable) Thanks for any answer, and please only answer if you got actual knowledge.

    Read the article

  • Dynamically creating controls in MFC (Collection question)

    - by ProgramWriter
    Hello all, I have some custom control inside of which i should create radiobuttons or checkboxes. The count of child controls is available only at runtime (it loads some file from which it gets this count). So i need to create variable number of controls. Which collection i should use for this purpose? Solution 1: simply use std::vector (or CArray) - not suitable because i want use MFC (CButton). Of course i can Attach() and later Detach() handle to window each time i need this window, but it will give big overhead. Solution 2: use std::vector or CArray or CList or... In this case i take care about making 'new' and appropriate 'delete' when control is unneeded. I am forgetful :) MFC handle map contains pointer to CButton and i can't use simple CArray, because it will move my objects each time when his size will grow. ... and the question is: Which collection i should use for containing variable count of MFC control classes?

    Read the article

  • object won't die (still references to it that I can't find)

    - by user288558
    I'm using parallel-python and start a new job server in a function. after the functions ends it still exists even though I didn't return it out of the function (I used weakref to test this). I guess there's still some references to this object somewhere. My two theories: It starts threads and it logs to root logger. My questions: can I somehow findout in which namespace there is still a reference to this object. I have the weakref reference. Does anyone know how to detach a logger? What other debug suggestions do people have? here is my testcode: def pptester(): js=pp.Server(ppservers=nodes) js.set_ncpus(0) fh=file('tmp.tmp.tmp','w') tmp=[] for i in range(200): tmp.append(js.submit(ppworktest,(),(),('os','subprocess'))) js.print_stats() return weakref.ref(js) thanks in advance Wolfgang

    Read the article

  • Strategy for unsubscribing event handlers

    - by stiank81
    In my WPF application I have a View that is given a ViewModel, and when given this View it adds event handlers to the ViewModel's PropertyChanged event. When some action occur in the GUI I remove the View and add another View to the holding container - where this new one is bound to the same ViewModel. After this has happened the old View still keeps handling PropertyChanged events in the ViewModel. I'm assuming this happens because the View hasn't been collected by the Garbage Collector yet, and therefore is alive? Well - I need it to stop. My assumption is that I need to manually detach the event handler from the ViewModel? Is there a best-practice on how to handle this?

    Read the article

  • Pattern for managing reference count and object life

    - by Gopalakrishnan Subramani
    We have a serial port which is connected to hundreds of physical devices on the same wire. We have protocols like Modbus and Hart to handle the request and response between the application and devices. The question is related to managing the reference count of the channel. When no device is using the channel, the channel should be closed. public class SerialPortChannel { int refCount = 0; public void AddReference() { refCount++; } public void ReleaseReference() { refCount--; if (refCount <= 0) this.ReleasePort(); //This close the serial port } } For each device connected, we create a object for the device like device = new Device(); device.Attach(channel); //this calls channel.AddReference() When the device disconnect, device.Detach(channel); //this calls channel.ReleaseReference() I am not convinced by the reference count model. Are there any better way to handle this problem in .NET World?

    Read the article

  • Setting up a SQL Membership Provider and attaching the MDF file in Visual Studio 2008

    - by aubreyrhodes
    I'm trying to set up a SQL Membership Provider for an ASP.NET MVC 1.0 and I'm having problems setting up the tables and stored procedures in the database. I've tried attaching both the applications current database and a blank database to my local SQLEXPRESS instance (using SSEUtil) and then running the aspnet_regsql wizard against them. When I detach the mdf file and try to load it in Visual Studio 2008, the data connection in the server explorer shows that the database has no tables or stored procedures. Am I missing a step or something here? I've been having a heap of trouble with compatibility between Visual Studio and SQLEXPRESS.

    Read the article

  • CAsyncSocket and ThreadPool problem

    - by zabulus
    I have a server application with such structure: There is one object, call him Server, that in endless cycle listens and accepts connections. I have descendant class from CAsyncSocket, that has overriden event OnReceive, call him ProxySocket. Also I have a thread pool with early created threads. When connection is received by server object he accepts the new connection on the new object ProxySocket. When data arrives to the ProxySocket, he creates a command object and gives it to thread pool. In this command object I giving the socket handle of a ProxySocket. When new object of command is creating - I creating a new Socket in working thread and attach handle to it. My issue is next: When command ends, socket doesn't close, I just detach handle it and set CSocket handle to INVALID_SOCKET value, as planned. But my first ProxySocket object doesn't receives messages of new data receiving after that. How can I solve this?

    Read the article

  • Attach Console to Service

    - by MemphiZ
    I currently have a WCF Service Library which will be started through a Console Application acting as ServiceHost. The ServiceHost starts the service and then waits with Console.ReadLine() for the "quit" command. If i do "Console.WriteLine();" in the service this will be printed to the ServiceHosts Console of course. The Service prints some information when the clients connect for example. Is it possible to have the ServiceHost converted to a real Windows Service (to start up when the machine boots without console window) and attach or detach a command prompt (cmd.exe) or another Console Application to it when needed? For example if I want so see which clients connect from now on? Thanks in advance!

    Read the article

  • increasing amazon root volume size

    - by OCD
    I have a default amazon ec2 instance with 8GB root volume size. I am running out of space. I have: Detach the current EBS volume in AWS Management Console (Web). Create snapshot of this volume. Created a new Volume with 50G space with my snapshot. Attach the new volume back to the instance to /dev/sda1 However, when I reconnect to the account with: > df -h I can see from the management console that my new Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8256952 8173624 0 100% / tmpfs 308508 40 308468 1% /dev/shm It's still not using my new volume's size, how to make this work?

    Read the article

  • Can't type after "ruby script/server" in InstantRails

    - by mathee
    I'm a newb to RoR. I'm using the book "Agile Web Development with Rails" to get started on Windows 7. In the command window, I run the following. >rails demo >cd demo >ruby script/server At this point, it boots the Mongrel server: => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server The book goes on to tell me to run ruby script/generate controller Say but, I cannot Ctrl-C -- or type anything for that matter -- after booting the Mongrel server. Am I supposed to create the new controller in another instance of the InstantRails command window? Right now, the only way I can stop the server is closing the window in which I started the server! Please let me know if you need any other details. tia.

    Read the article

  • Modifying association arrays on cloned ActiveRecord objects

    - by Craig Walker
    I have an ActiveRecord model class Foo that has_many Bar. I want to clone a Foo (to get duplicates of most of its attributes) and then modify its Bar instances. This is a problem because cloned ActiveRecord instances share the same associated array; changes to one affect the other. f1 = Foo.new b = Bar.new f1.bars << b f2 = f1.clone f2.bars.includes? b # true f1.bars.clear f2.bars.includes? b # now false The real problem is that I can't detach the bars arrays from either Foo: f1.bars << b f2.bars.includes? b # true f2.bars = [] f2.bars.includes? b # now false f1.bars.includes? b # now also false If I could do that, then I could replace the Bars as I wanted to. However, any change to one Foo seems to affect the other.

    Read the article

  • NSAutoreleasePool carrying across methods?

    - by Tim
    I'm building an iPhone application where I detach some threads to do long-running work in the background so as not to hang the UI. I understand that threads need NSAutoreleasePool instances for memory management. What I'm not sure about is if the threaded method calls another method - does that method also need an NSAutoreleasePool? Example code: - (void)primaryMethod { [self performSelectorInBackground:@selector(threadedMethod) withObject:nil]; } - (void)threadedMethod { NSAutoreleasePool *aPool = [[NSAutoreleasePool alloc] init]; // Some code here [self anotherMethod]; // Maybe more code here [aPool drain]; } - (void)anotherMethod { // More code here } The reason I ask is I'm receiving errors that objects are being autoreleased with no pool in place, and are "just leaking." I've seen other questions where people didn't have autorelease pools in place at all, and I understand why an autorelease pool is needed. I'm specifically interested in finding out whether an autorelease pool created in (in this example) threadedMethod applies to objects created in anotherMethod.

    Read the article

  • How to consolidate multiple LOG files into one .LDF file in SQL2000

    - by John Galt
    Here is what sp_helpfile says about my current database (recovery model is Simple) in SQL2000: name fileid filename size maxsize growth usage MasterScratchPad_Data 1 C:\SQLDATA\MasterScratchPad_Data.MDF 6041600 KB Unlimited 5120000 KB data only MasterScratchPad_Log 2 C:\SQLDATA\MasterScratchPad_Log.LDF 2111304 KB Unlimited 10% log only MasterScratchPad_X1_Log 3 E:\SQLDATA\MasterScratchPad_X1_Log.LDF 191944 KB Unlimited 10% log only I'm trying to prepare this for a detach then an attach to a sql2008 instance but I don't want to have the 2nd .LDF file (I'd like to have just one file for the log). I have backed up the database. I have issued: BACKUP LOG MasterScratchPad WITH TRUNCATE_ONLY. I have run multiple DBCC SHRINKFILE commands on both of the LOG files. How can I accomplish this goal of having just one .LDF? I cannot find anything on how to delete the one with fileid of 3 and/or how to consolidate multiple files into one log file.

    Read the article

  • How to run Rails 3 application on localhost/<my_port> ?

    - by Misha Moroshko
    To run Rails application on Windows I do: cd < app_dir rails server I see the following: => Booting WEBrick => Rails 3.0.1 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2011-01-12 20:32:07] INFO WEBrick 1.3.1 [2011-01-12 20:32:07] INFO ruby 1.9.2 (2010-08-18) [i386-mingw32] [2011-01-12 20:32:07] INFO WEBrick::HTTPServer#start: pid=5812 port=3000 Question 1 Why port 3000 is selected ? Where is it configured ? Question 2 How could I run 2 applications in parallel ? I guess I need to configure one of them to be on other port (like 3001). How should I do this ?

    Read the article

  • Help with a cryptic error message with KGDB - Bogus trace status reply from target: E22

    - by fortran
    Hi, I'm using gdb to connect to a 2.6.31.13 linux kernel patched with KGDB over Ethernet, and when I try to detach the debugger I get this: (gdb) quit A debugging session is active. Inferior 1 [Remote target] will be killed. Quit anyway? (y or n) y Bogus trace status reply from target: E22 after that the session is still open, I can keep going on and on with ctrl+d, and the debugger doesn't exit. I've searched for that message in google and there are just 5 results (and none of them are useful :-/ ). Any idea of what could it be and how to fix it?

    Read the article

  • Shell Screen -X Stuff problems

    - by user1621988
    OPTIONS="java -Xms1024M -Xmx1024M -jar craftbukkit.jar" PROCESS=server01 screen -dmS $PROCESS $OPTIONS nogui # Starting the application screen -x $PROCESS -X stuff `printf "stop\r"` # Closing the application screen -x $PROCESS # Attaching to the terminal of the application Starting the application work fine, however I got problems with stuff 'printf "stop/r"' It seems not to work when I just start up, wait some time and then try to Stop it with command above. But the strange thing is, that IF I did screen -x $PROCESS and detach (ctrl-A & ctrl-D) and then I use the Stop command it does work. So is there a way around to stuff printf without -screen -x the $PROCESS? Thank You in Advance

    Read the article

  • thread destructors in C++0x vs boost

    - by Abruzzo Forte e Gentile
    Hi All These days I am reading the pdf Designing MT programs . It explains that the user MUST explicitly call detach() on an object of class std::thread in C++0x before that object gets out of scope. If you don't call it std::terminate() will be called and the application will die. I usually use boost::thread for threading in C++. Correct me if I am wrong but a boost::thread object detaches automatically when it get out of scope. Is seems to me that the boost approach follow a RAII principle and the std doesn't. Do you know if there is some particular reason for this? Kind Regards AFG

    Read the article

  • C++0x error : variable 'std::packaged_task<int> pt1' has initializer but incomplete type

    - by Eternal Learner
    Hi All, Below is a simple program in c++0x that makes use of packaged_task and futures. while compiling the program i get error : variable 'std::packaged_task pt1' has initializer but incomplete type the program is below #include #include using namespace std; int printFn() { for(int i = 0; i < 100; i++) { cout << "thread " << i << endl; } return 1; } int main() { packaged_task<int> pt1(&printFn); future<int> fut = pt1.get_future(); thread t(move(pt1)); t.detach(); int value = fut.get(); return 0; }

    Read the article

  • Program quits if pipe is closed

    - by givemelight
    I am trying to write to a pipe using C++. The following code gets called in an extra thread: void writeToPipe() { int outfifo; char buf[100]; char outfile[] = "out"; mknod(outfile, S_IFIFO | 0666, 0); if ((outfifo = open(outfile, O_WRONLY)) < 0) { perror("Opening output fifo failed"); return false; } int currentTimestamp = (int)time(0); int bufLen = sprintf(bug, "Time is %d.", currentTimestamp); write(outfifo, buf, bufLen); } The thread is called in main using: thread writeThread(writeToPipe); writeThread.detach(); If the pipe is not opened by another process, the C++ program just quits without an error. I don't know how to check if the pipe is opened.

    Read the article

  • jQuery.remove() - Is there a way to get the object back after you remove it?

    - by Jack Marchetti
    I basically have the same problem in this questions: Flash Video still playing in hidden div I've used the .remove jquery call and this works. However, I have previous/next buttons when a user scrolls through hidden/non-hidden divs. What I need to know is, once I remove the flash object, is there a way to get it back other than refreshing the page? Basically, can this be handled client side or am I going to need to implement some server side handling. detach() won't work because the flash video continues to play. I can't just hide it because the video continues to play as well.

    Read the article

  • SQL SERVER – Move Database Files MDF and LDF to Another Location

    - by pinaldave
    When a novice DBA or Developer create a database they use SQL Server Management Studio to create new database. Additionally, the T-SQL script to create a database is very easy as well. You can just write CREATE DATABASE DatabaseName and it will create new database for you. The point to remember here is that it will create the database at the default location specified for SQL Server Instance (this default instance can be changed and we will see that in future blog posts). Now, once the database goes in production it will start to grow. It is not common to keep the Database on the same location where OS is installed. Usually Database files are on SAN, Separate Disk Array or on SSDs. This is done usually for performance reason and manageability perspective. Now the challenges comes up when database which was installed at not preferred default location and needs to move to a different location. Here is the quick tutorial how you can do it. Let us assume we have two folders loc1 and loc2. We want to move database files from loc1 to loc2. USE MASTER; GO -- Take database in single user mode -- if you are facing errors -- This may terminate your active transactions for database ALTER DATABASE TestDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO -- Detach DB EXEC MASTER.dbo.sp_detach_db @dbname = N'TestDB' GO Now move the files from loc1 to loc2. You can now reattach the files with new locations. -- Move MDF File from Loc1 to Loc 2 -- Re-Attached DB CREATE DATABASE [TestDB] ON ( FILENAME = N'F:\loc2\TestDB.mdf' ), ( FILENAME = N'F:\loc2\TestDB_log.ldf' ) FOR ATTACH GO Well, we are done. There is little warning here for you: If you do ROLLBACK IMMEDIATE you may terminate your active transactions so do not use it randomly. Do it if you are confident that they are not needed or due to any reason there is a connection to the database which you are not able to kill manually after review. Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Backup and Restore, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10  | Next Page >