Search Results

Search found 2397 results on 96 pages for 'copying'.

Page 77/96 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Composite key syntax in Boost MultiIndex

    - by Sarah
    Even after studying the examples, I'm having trouble figuring out how to extract ranges using a composite key on a MultiIndex container. typedef multi_index_container< boost::shared_ptr< Host >, indexed_by< hashed_unique< const_mem_fun<Host,int,&Host::getID> >, // ID index ordered_non_unique< const_mem_fun<Host,int,&Host::getAgeInY> >, // Age index ordered_non_unique< const_mem_fun<Host,int,&Host::getHousehold> >, // Household index ordered_non_unique< // Age & eligibility status index composite_key< Host, const_mem_fun<Host,int,&Host::getAgeInY>, const_mem_fun<Host,bool,&Host::isPaired> > > > // end indexed_by > HostContainer; My goal is to get an iterator pointing to the first of the subset of elements in HostContainer hmap that has age partnerAge and returns false to Host::isPaired(): std::pair< hmap::iterator,hmap::iterator > pit = hmap.equal_range(boost::make_tuple( partnerAge, false ) ); I think this is very wrong. How/Where do I specify the iterator index (which should be 3 for age & eligibility)? I will include other composite keys in the future. What exactly are the two iterators in std::pair? (I'm copying syntax from an example that I don't understand.) I would ideally use std::count to calculate the number of elements of age partnerAge that are eligible (return false to Host::isPaired()). What is the syntax for extracting the sorted index that meets these requirements? I'm obviously still learning C++ syntax. Thanks in advance for any help.

    Read the article

  • IE9 selectAllChildren on an out-of-view element

    - by MrSlayer
    I am trying to replicate a service that is provided by Tynt.com that appends some text to a user's selection when copying. I understand that users don't particularly like this, but it is a client's request to append the URL and copyright notice whenever a user copies something from their website. In current browsers, I am able to do this by creating a DOM element, adding the selected text, appending the copyright text and then selecting the new node: var newSelection = document.createElement( 'div' ); newSelection.style.cssText = "height: 1px; width: 1px; overflow: hidden;"; if( window.getSelection ) { var selection = window.getSelection( ); if( selection.getRangeAt ) { var range = selection.getRangeAt( 0 ); newSelection.appendChild( range.cloneContents( ) ); appendCopyright( ); document.body.appendChild( newSelection ); selection.selectAllChildren( newSelection ); // ... remove element, return selection } } In IE9, this errors out on the selection.selectAllChildren( newSelection ) statement and I was able to figure out that this is because newSelection was effectively "hidden" from the viewport due to the styles applied in the second line above. Commenting that out works, but obviously the new node is shown to the end user. It appears that this was resolved in later versions of IE, but I am having trouble coming up with a workaround that is sufficient for IE9, a browser that I need to support. I've tried a variety of alternatives, like setting visibility: hidden;, positioning it off-screen, and trying some alternative selection functions, but they each present different problems. The error thrown by IE is: SCRIPT16389: Unspecified error.

    Read the article

  • Bind members of different classes

    - by 7vies
    In a C++ program I have two classes (structs) like struct A { int x; double y; // other members }; struct B { int x; double y2; // other members }; I'd like to somehow "bind" the corresponding members, e.g. A::x to B::x and A::y to B::y2. By "bind" I mean ability to obtain a reference to the bound variable, for example given a member of class A I could assign it to the value of the corresponding B member. Once I have such bind, I'd like to build a bind table or something similar which I could iterate over. This would allow, for example, copying the corresponding fields from A a; to B b; like CopyBound(a, b, bind_table);, but probably also doing some other things not limited to Copy interface. The problem with this bind_table is that I want static typing and the bind_table would have to contain different types in this case. For example, a table of pointers to class members would contain &A::x and &A::y, but they are of different type, so I cannot just put them say into an array. Any ideas how this can be conveniently implemented, having as much compile-time type checking as possible?

    Read the article

  • Git-svn refuses to create branch on svn repository error: "not in the same repository"

    - by Danny
    I am attempting to create a svn branch using git-svn. The repository was created with --stdlayout. Unfortunately it generates an error stating the "Source and dest appear not to be in the same repository". The error appears to be the result of it not including the username in the source url. $ git svn branch foo-as-bar -m "Attempt to make Foo into Bar." Copying svn+ssh://my.foo.company/r/sandbox/foo/trunk at r1173 to svn+ssh://[email protected]/r/sandbox/foo/branches/foo-as-bar... Trying to use an unsupported feature: Source and dest appear not to be in the same repository (src: 'svn+ssh://my.foo.company/r/sandbox/foo/trunk'; dst: 'svn+ssh://[email protected]/r/sandbox/foo/branches/foo-as-bar') at /home/me/.install/git/libexec/git-core/git-svn line 610 I intially thought this was simply a configuration issue, examination of .git/config doesn't suggest anything incorrect. [svn-remote "svn"] url = svn+ssh://[email protected]/r fetch = sandbox/foo/trunk:refs/remotes/trunk branches = sandbox/foo/branches/*:refs/remotes/* tags = sandbox/foo/tags/*:refs/remotes/tags/* I am using git version 1.6.3.3. Can anyone shed any light on why this might be occuring, and how best to address it?

    Read the article

  • "Programming In Haskell" error in sat function

    - by Matt Ellen
    I'm in chapter 8 of Graham Hutton's Programming in Haskell and I'm copying the code and testing it in GHC. See the slides here: http://www.cis.syr.edu/~sueo/cis352/chapter8.pdf in particular slide 15 The relevant code I've copied so far is: type Parser a = String -> [(a, String)] pih_return :: a -> Parser a pih_return v = \inp -> [(v, inp)] failure :: Parser a failure = \inp -> [] item :: Parser Char item = \inp -> case inp of [] -> [] (x:xs) -> [(x,xs)] parse :: Parser a -> String -> [(a, String)] parse p inp = p inp sat :: (Char -> Bool) -> Parser Char sat p = do x <- item if p x then pih_return x else failure I have changed the name of the return function from the book to pih_return so that it doesn't clash with the Prelude return function. The errors are in the last function sat. I have copied this directly from the book. As you can probably see p is a function from Char to Bool (e.g. isDigit) and x is of type [(Char, String)], so that's the first error. Then pih_return takes a value v and returns [(v, inp)] where inp is a String. This causes an error in sat because the v being passed is x which is not a Char. I have come up with this solution, by explicitly including inp into sat sat :: (Char -> Bool) -> Parser Char sat p inp = do x <- item inp if p (fst x) then pih_return (fst x) inp else failure inp Is this the best way to solve the issue?

    Read the article

  • Make JAXWS-based webservice implement interface and unmarshall to known POJOs

    - by John K
    Given a Java SE 6 client, I would like to provide a configurable back-end: either directly to a database or through a web service which connects to a centralized DB. To that end, I've created some JPA- and JAXB-annotated entity classes and a DAO interface in a POJO library like the following: public interface MyDaoInterface { public MyEntity doSomething(); } @javax.persistence.Entity @javax.xml.bind.annotation.XmlRootElement public class MyEntity { private int a; .... } Now, I would like to have my auto-generated web service stubs implement that interface and interact with my defined entity classes, rather than the generated classes provided via the JAX-B unmarshaller. So, the client-side pseudo code would be something like MyDaoInterface dao; if (usingWebservice) dao = new WebserviceDao(); else dao = new JpaDao(); MyEntity e = dao.doSomething(); Is this possible with JPA, JAXB, JAXWS? Is this even advisable? Currently we achieve this through a slow manual process of massaging code, copying generating classes, and doing other things that seem just plain wrong to me.

    Read the article

  • Error while Installing Android app on Android virtual device

    - by Priyank
    Hi. I have created a small and simple android app. I tried installing it on an actual android device. But because it won't install, I created an AVD resembling my phone. I tried copying and installing app on that AVD and it still says that error. "Application xxx could not be installed on this phone". Before I tried installing my app on the phone or AVD I following steps: 1. Exported an unsigned copy of application onto my hard-drive. 2. User jarsigner to sign the app 3. Verified with jarsigner that my app is signed properly. 4. Used zipalign to optimize the app resources. I do not have an icon assigned to myapp but mandatory properties like version etc. have been specified properly. I had initially developed app using 2.1 version but because of compatability issues with my phone I reverted code to compile on 1.5 and it still doesn't get installed either on AVD or my phone. My AVD is on 2.1 though and code is compiled with 1.5. Is there a place where I can see the logs as to why app is not getting installed. It would be really helpful. Cheers

    Read the article

  • MonoRail: Testing, Route Extensions, Folder Structures

    - by Kezzer
    I've got a few questions related to the use of MonoRail Testing Does everyone tend to use NUnit for their testing? I haven't worked enough with testing to know if this is a good testing framework to use. I'm just looking to get more into testing my applications a lot more than before and wanted to know if there's any general guidelines. Are you supposed to copy the controller over to a test area and just rename it with test in the name and re-run it? How do you ensure your test project and main project coincide with one another? Is it just a case of copying everything over again or are there tools available to do it for you? Route Extensions MonoRail tends to use <action>.rails, can you omit the .rails part if you configure your routing correctly? Why does this seem to be the standard? Folder Structures I haven't found anywhere which really points out your standard folder structure. Sure, you have Controllers, Models, and Views. But your Models folder should contain your data access objects as well. I've seen some have something like -> Models -> DaoClasses -> Entities But what about custom structures used to get data out of views? And if you're using NHibernate, where's a good place to stick the mappings? I know it's entirely dependent on the developer, but I haven't really seen any standard approach. Cheers

    Read the article

  • hg archive to Remote Directory

    - by Brett Daniel
    Is there any way to archive a Mercurial repository to a remote directory over SSH? For example, it would be nice if one could do the following: hg archive ssh://[email protected]/path/to/archive However, that does not appear to work. It instead creates a directory called ssh: in the current directory. I made the following quick-and-dirty script that emulates the desired behavior by creating a temporary ZIP archive, copying it over SSH, and unzipping the destination directory. However, I would like to know if there is a better way. if [[ $# != 1 ]]; then echo "Usage: $0 [user@]hostname:remote_dir" exit fi arg=$1 arg=${arg%/} # remove trailing slash host=${arg%%:*} remote_dir=${arg##*:} # zip named to match lowest directory in $remote_dir zip=${remote_dir##*/}.zip # root of archive will match zip name hg archive -t zip $zip # make $remote_dir if it doesn't exist ssh $host mkdir --parents $remote_dir # copy zip over ssh into destination scp $zip $host:$remote_dir # unzip into containing directory (will prompt for overwrite) ssh $host unzip $remote_dir/$zip -d $remote_dir/.. # clean up zips ssh $host rm $remote_dir/$zip rm $zip Edit: clone-and-push would be ideal, but unfortunately the remote server does not have Mercurial installed.

    Read the article

  • AudioFileWriteBytes fails with error code -40

    - by alexbw
    I'm trying to write raw audio bytes to a file using AudioFileWriteBytes(). Here's what I'm doing: void writeSingleChannelRingBufferDataToFileAsSInt16(AudioFileID audioFileID, AudioConverterRef audioConverter, ringBuffer *rb, SInt16 *holdingBuffer) { // First, figure out which bits of audio we'll be // writing to file from the ring buffer UInt32 lastFreshSample = rb->lastWrittenIndex; OSStatus status; int numSamplesToWrite; UInt32 numBytesToWrite; if (lastFreshSample < rb->lastReadIndex) { numSamplesToWrite = kNumPointsInWave + lastFreshSample - rb->lastReadIndex - 1; } else { numSamplesToWrite = lastFreshSample - rb->lastReadIndex; } numBytesToWrite = numSamplesToWrite*sizeof(SInt16); Then we copy the audio data (stored as floats) to a holding buffer (SInt16) that will be written directly to the file. The copying looks funky because it's from a ring buffer. UInt32 buffLen = rb->sizeOfBuffer - 1; for (int i=0; i < numSamplesToWrite; ++i) { holdingBuffer[i] = rb->data[(i + rb->lastReadIndex) & buffLen]; } Okay, now we actually try to write the audio from the SInt16 buffer "holdingBuffer" to the audio file. The NSLog will spit out an error -40, but also claims that it's writing bytes. No data is written to file. status = AudioFileWriteBytes(audioFileID, NO, 0, &numBytesToWrite, &holdingBuffer); rb->lastReadIndex = lastFreshSample; NSLog(@"Error = %d, wrote %d bytes", status, numBytesToWrite); return;

    Read the article

  • Debugging MinGW program with gdb on Windows, not terminating at assert failure

    - by devil
    How do I set up gdb on window so that it does not allow a program with assertion failure to terminate? I intend to check the stack trace and variables in the program. For example, running this test.cpp program compiled with MinGW 'g++ -g test.cpp -o test' in gdb: #include <cassert> int main(int argc, char ** argv) { assert(1==2); return 0; } Gives: $ gdb test.exe GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-mingw32"... (gdb) r Starting program: f:\code/test.exe [New thread 4616.0x1200] Error: dll starting at 0x77030000 not found. Error: dll starting at 0x75f80000 not found. Error: dll starting at 0x77030000 not found. Error: dll starting at 0x76f30000 not found. Assertion failed: 1==2, file test.cpp, line 2 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Program exited with code 03. (gdb) I would like to be able to stop the program from terminating immediately, like how Visual Studio's debugger and gdb on Linux does it. I have done a search and found some stuff on trapping signals but I can't seem to find a good post on how to set up gdb to do this.

    Read the article

  • Multimedia files written over WAN are getting truncated

    - by Dean
    I use the windows Multimedia API to create .wav files. 1. Open file with mmsioOpen 2. Creates WAVE,frm and data chunks using mmioCreateChunk 3. Write audio data using mmioWrite 4. Ascend out of the chunks using mmioAscend 5. Close file using mmioClose The file is being written into a temporary location, so after it has been closed it gets copied to another location using the CopyFile. This program is written in C++ and works great until the file it is writing resides over a WAN in a different city or country. The end result is a wav file that should be 20-30 seconds long ends up being 4 secodns long. It is always the last bit that is missing, so when you play it back it just stops before then of the recording. I initially thought that maybe I was copying the file too soon so as a test I put in a pause of 30 seconds after closing the file using Sleep(30000), but this made no difference to either it being truncated or by how much. I have modified the program to write to a file in parrallel using CreateFile and WriteFile, and the result is the same, so it is not an issue specifically with the mmio API's. Does anyone have any ideas why this is happening and if there is a work-around to it? I suspect that I may end up having the temporary location on the local drive, but this is quite a big change to the application as well as existing deployments. thanks for everyones time Dean

    Read the article

  • Per-pixel per-component alpha blending in Windows

    - by Crend King
    I have a 24-bit bitmaps with R, G, B color channels and a 24-bit bitmap with R, G, B alpha channels. I want to alpha blend the first bitmap to a HDC in GDI or RenderTarget in Direct2D with the alpha channels respectively. For example, suppose for one pixel, the bitmap color is (192, 192, 192), the HDC color is (0, 255, 255) and the alpha channels are (30, 40, 50). The final HDC color should be (22, 245, 242). I know I can BitBlt the HDC to a memory HDC first, do alpha blending by manually calculating the color of each pixel and finally BitBlt back. I just want to avoid the additional blitting and leave APIs do their job (faster since they are in kernel space). The first idea comes to my mind is to split the source bitmap into 3 red-only, green-only and blue-only 8-bit bitmaps, do normal alpha blending, then composite the 3 output bitmaps into the HDC. But I don't find a way to do the splitting and composition natively in Windows (would Direct2D layer help?). Also, the splitting and compositing may require many additional copying. The performance overhead would be too high. Or maybe do the alpha blending in 3 passes. Each pass apply the blending for one channel, while maintaining the other 2 unchanged. Thanks for any comment. EDIT: I found this question, and the answer should be good reference to this problem. However, besides AC_SRC_OVER, there is no other blending operation supported. Why don't Microsoft improve their API?

    Read the article

  • Red Box is not working

    - by palani
    Hi , I have install the Red box plugin by using the following command script/plugin install svn://rubyforge.org/var/svn/ambroseplugins/redbox . It installed successfully. and again ran the following command the following location /myapp/vendor/plugin/redbox/rake update_scripts . It shows me the following output (in /myapp/vendor/plugins/redbox) rake aborted! private method `copy' called for File:Class /home/myapp/vendor/plugins/redbox/Rakefile:28 (See full trace by running task with --trace) I don't know How to solve this ... Then i understand that "rake update_scripts" copying the Js and Css file only. so i manually copied the Redbox.js & redbox.css files into the respective places under /public folder I include the follwoing into my application.html.erb <%= stylesheet_link_tag 'redbox' % <%= javascript_include_tag :defaults % <%= javascript_include_tag 'redbox' % It included in the page successfully. The following is my view code : <%= link_to_remote_redbox('Red_box', :url = {:action= 'log'} ,:method ='get') % The popup box doesn't appear. I have no clue what is the exact error. Is that any Jquery clash? Please help me

    Read the article

  • Copy data from different worksheet to a master worksheet but no duplicates

    - by sam
    hi all, i want to clarify my initial question for a possible solutions from any savior out there. Say i have 3 excel sheets one for each user for data entry located in separate workbooks to avoid excel share workbook problems. I also have a master sheet in another workbook where i want individual data enter on those sheets precisely sheets 1 should copy to the next available row of sheet 1 in the master sheet as the users enter them. i need a vba code that can copy each record without copying a duplicate row in the master sheet but highlight the duplicate row and lookup the initial record in a master sheet and return the name of the Imputer looking up the row say column ( I) where each user sign there initials after every row of entry like below. All 4 worksheets are formatted as below: lastname account cardno. type tran amount date location comments initials JAME 65478923 1975 cash 500 4/10/2010 miles st. this acct is resolve MLK BEN 52436745 1880 CHECK 400 4/12/2010 CAREY ST Ongoing investigation MLK JAME 65478923 1975 cash 500 4/10/2010 miles st. this acct is resolve MLK I need the vba to recognize duplicates only if the account number and the card number matches the initial records. So if the duplicates exist a pop up message should be display that a duplicates exist and return the initial Imputer say MLK in COLUMN( I) to any user inputting in the individual worksheets other than warehouse sheets (master). So please any idea will be appreciated.

    Read the article

  • Safe to update separate regions of a BufferedImage in separate threads?

    - by finnw
    I have a collection of BufferedImage instances, one main image and some subimages created by calling getSubImage on the main image. The subimages do not overlap. I am also making modifications to the subimage and I want to split this into multiple threads, one per subimage. From my understanding of how BufferedImage, Raster and DataBuffer work, this should be safe because: Each instance of BufferedImage (and its respective WritableRaster) is accessed from only one thread. The shared ColorModel is immutable The DataBuffer has no fields that can be modified (the only thing that can change is elements of the backing array.) Modifying disjoint segments of an array in separate threads is safe. However I cannot find anything in the documentation that says that it is definitely safe to do this. Can I assume it is safe? I know that it is possible to work on copies of the child Rasters but I would prefer to avoid this because of memory constraints. Otherwise, is it possible to make the operation thread-safe without copying regions of the parent image?

    Read the article

  • What file format can represent an uncompressed raster image at 48 or 64 bits per pixel?

    - by finnw
    I am creating screenshots under Windows and using the LockBits function from GDI+ to extract the pixel data, which will then be written to a file. To maximise performance I am also: Using the same PixelFormat as the source bitmap, to avoid format conversion Using the ImageLockModeUserInputBuf flag to extract the pixel data into a pre-allocated buffer This pre-allocated buffer (pointed to by BitmapData::Scan0) is part of a memory-mapped file (to avoid copying the pixel data again.) I will also be writing the code that reads the file, so I can use (or invent) any format I wish. However I would prefer to use a well-known format that existing programs (ideally web browsers) are able to read, because that means I can visually confirm that the images are correct before writing the code for the other program (that reads the image.) I have implemented this successfully for the PixelFormat32bppRGB format, which matches the format of a 32bpp BMP file, so if I extract the pixel data directly into the memory-mapped BMP file and prefix it with a BMP header I get a valid BMP image file that can be opened in Paint and most browsers. Unfortunately one of the machines I am testing on returns pixels in PixelFormat64bppPARGB format (presumably this is influenced by the video adapter driver) and there is no corresponding BMP pixel format for this. Converting to a 16, 24 or 32bpp BMP format slows the program down considerably (as well as being lossy) so I am looking for a file format that can use this pixel format without conversion, so I can extract directly into the memory-mapped file as I have done with the 32bpp format. What raster image file formats support 48bpp and/or 64bpp?

    Read the article

  • Flex - Issues retrieving an XMLList

    - by BS_C3
    Hello! I'm having a problem retrieving a XMLList and I don't understand why. I have an application that is running properly. It uses some data from two xml files called division.xml and store.xml. I noticed that I have some data in division.xml that should be in store.xml, so I did a copy/paste of the data from one file to the other. This is the data I copied: <stores> <store> <odeis>101</odeis> <name></name> <password></password> <currency></currency> <currSymbol></currSymbol> </store> <store> <odeis>102</odeis> <name></name> <password></password> <currency></currency> <currSymbol></currSymbol> </store> </stores> In the application, I list all odeis codes and I need to retrieve the block store corresponding to the selected odeis code. Before moving the data into store.xml, this is how I retrieved the block: var node:XMLList = divisionData.division.(@name==HomePageData.instance.divisionName).stores.store.(odeis == HomePageData.instance.storeCodeOdeis) This is how I retrieve it after copying the data into store.xml: var node:XMLList = storeData.stores.(@name==HomePageData.instance.divisionName).store.(odeis == HomePageData.instance.storeCodeOdeis) And I'm currently getting the following error: ReferenceError: Error #1065: The variable odeis is not defined. Could anyone enlighten me? Cause I really have no clue of why it is not working... Thanks for any tips you can give. Regards, BS_C3

    Read the article

  • How to register assemblies using Windsor in ASP.NET MVC

    - by oz
    This is how my project looks: TestMvc (my web project) has a reference to the DomainModel.Core assembly where my interfaces and business objects reside. The class that implements the interfaces in DomainModel.Core is in a different assembly called DomainModel.SqlRepository; the reason behind it is that if I just want to create a repository for Oracle I just have to deploy the new dll, change the web.config and be done with it. When I build the solution, if I look at the \bin folder of my TestMvc project, there is no reference to the DomainModel.SqlRepository, which makes sense because it's not being reference anywhere. Problem arises when my windsor controller factory tries to resolve that assembly, since it's not on the \bin directory. So is there a way to point windsor to a specific location, without adding a reference to that assembly? My web.config looks like this: <component id="UserService" service="TestMvc.DomainModel.Core.Interface, TestMvc.DomainModel.Core" type="TestMvc.DomainModel.SqlRepository.Class, TestMvc.DomainModel.SqlRepository" lifestyle="PerWebRequest" /> There's many ways around this, like copying the dll as part of the build, add the reference to the project so it will get copied to the \bin folder or install it on the GAC and add an assembly reference in the web.config. I guess my question is specific to Windsor, to see if I can give the location of my assembly and it will resolve it.

    Read the article

  • Sharing large objects between ruby processes without a performance hit

    - by Gdeglin
    I have a Ruby hash that reaches approximately 10 megabytes if written to a file using Marshal.dump. After gzip compression it is approximately 500 kilobytes. Iterating through and altering this hash is very fast in ruby (fractions of a millisecond). Even copying it is extremely fast. The problem is that I need to share the data in this hash between Ruby on Rails processes. In order to do this using the Rails cache (file_store or memcached) I need to Marshal.dump the file first, however this incurs a 1000 millisecond delay when serializing the file and a 400 millisecond delay when serializing it. Ideally I would want to be able to save and load this hash from each process in under 100 milliseconds. One idea is to spawn a new Ruby process to hold this hash that provides an API to the other processes to modify or process the data within it, but I want to avoid doing this unless I'm certain that there are no other ways to share this object quickly. Is there a way I can more directly share this hash between processes without needing to serialize or deserialize it? Here is the code I'm using to generate a hash similar to the one I'm working with: @a = [] 0.upto(500) do |r| @a[r] = [] 0.upto(10_000) do |c| if rand(10) == 0 @a[r][c] = 1 # 10% chance of being 1 else @a[r][c] = 0 end end end @c = Marshal.dump(@a) # 1000 milliseconds Marshal.load(@c) # 400 milliseconds

    Read the article

  • Assigning a property across threads

    - by Mike
    I have set a property across threads before and I found this post http://stackoverflow.com/questions/142003/cross-thread-operation-not-valid-control-accessed-from-a-thread-other-than-the-t about getting a property. I think my issue with the code below is setting the variable to the collection is an object therefore on the heap and therefore is just creating a pointer to the same object So my question is besides creating a deep copy, or copying the collection into a different List object is there a better way to do the following to aviod the error during the for loop. Cross-thread operation not valid: Control 'lstProcessFiles' accessed from a thread other than the thread it was created on. Code: private void btnRunProcess_Click(object sender, EventArgs e) { richTextBox1.Clear(); BackgroundWorker bg = new BackgroundWorker(); bg.DoWork += new DoWorkEventHandler(bg_DoWork); bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted); bg.RunWorkerAsync(lstProcessFiles.SelectedItems); } void bg_DoWork(object sender, DoWorkEventArgs e) { WorkflowEngine engine = new WorkflowEngine(); ListBox.SelectedObjectCollection selectedCollection=null; if (lstProcessFiles.InvokeRequired) { // Try #1 selectedCollection = (ListBox.SelectedObjectCollection) this.Invoke(new GetSelectedItemsDelegate(GetSelectedItems), new object[] { lstProcessFiles }); // Try #2 //lstProcessFiles.Invoke( // new MethodInvoker(delegate { // selectedCollection = lstProcessFiles.SelectedItems; })); } else { selectedCollection = lstProcessFiles.SelectedItems; } // *********Same Error on this line******************** // Cross-thread operation not valid: Control 'lstProcessFiles' accessed // from a thread other than the thread it was created on. foreach (string l in selectedCollection) { if (engine.LoadProcessDocument(String.Format(@"C:\TestDirectory\{0}", l))) { try { engine.Run(); WriteStep(String.Format("Ran {0} Succussfully", l)); } catch { WriteStep(String.Format("{0} Failed", l)); } engine.PrintProcess(); WriteStep(String.Format("Rrinted {0} to debug", l)); } } } private delegate void WriteDelegate(string p); private delegate ListBox.SelectedObjectCollection GetSelectedItemsDelegate(ListBox list); private ListBox.SelectedObjectCollection GetSelectedItems(ListBox list) { return list.SelectedItems; }

    Read the article

  • Where to put external archives to configure running in Eclipse?

    - by Buggieboy
    As a Java/Eclipse noob coming from a Visual Studio .NET background, I'm trying to understand how to set up my run/debug environment in the Eclipse IDE so I can start stepping through code. I have built my application with separate src and bin hierarchies for each library project, and each project has its own jar. For example, in a Windows environment, I have something like: c:\myapp\myapp_main\src\com\mycorp\myapp\main ...and a parallel "bin" tree like this: c:\myapp\myapp_main\bin\com\mycorp\myapp\main Other supporting projects are, similarly: **c:\myapp\myapp_util\src\com\mycorp\myapp\uti**l (and a parallel "bin" tree.) ... etc. So, I end up with, e.g., myapp_util.jar in the ...\myapp_util\bin... path and then add that as an external archive to my myapp_main project. I also use utilities like gluegen-rt.jar, which I add ad external dependencies to the projects requiring them. I have been able to run outside of the Eclipse environment, by copying all my project jars, gluegen-rt DLL, etc., into a "lib" subfolder of some directory and executing something like: java -Djava.library.path=lib -DfullScreen=false -cp lib/gluegen-rt.jar;lib/myapp_main.jar;lib/myapp_util.jar; com.mycorp.myapp.Main When I first pressed F11 to debug, however, I got a message about something like /com/sun/../glugen... not being found by the class loader. So, to debug, or even just run, in Ecplipse, I tried setting up my VM arguments in the Galileo Debug - (Run/Debug) Configurations to be the command line above, beginning at "-Djava.libary.path...". I've put a lib subdirectory - just like the above with all jars and the native gluegen DLL - in various places, such as beneath the folder that my main jar is built in and as a subfolder of my Ecplipse starting workspace folder, but now Eclipse can't find the main class: java.lang.NoClassDefFoundError: com.mycorp.myapp.Main Although the Classpath says that it is using the "default classpath", whatever that is. Bottom line, how do I assemble the constituent files of a multi-project application so that I can run or debug in Ecplipse?

    Read the article

  • Error doing an MSBuild on a CLR Storedprocedure project on Build Server

    - by CraftyFella
    Hi, When building a CLR Storedprocedure Project using MSBuild on our build server (Team City) we're getting the following error: error MSB4019: The imported project "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\SqlServer.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk I've checked to see if the file exists on disk and sure enough it doesn't. I've checked on my own machine and it does exist. I don't really want to start copying over files manually to the build server. Here's the line from the csproj file which is being imported to the proj file: <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\SqlServer.targets" /> Here's the line from the proj file which is begin run by our Team City Server: <Import Project="..\$(ProjectName).csproj"/> My question is really: Where does this file comes from? Is it part of the Visual Studio install for example.. Or is there some re-distribution package somewhere to allow me to compile this project on our build server? Thanks BTW.. if i just copy the file onto the Build server it does actually work. Dave

    Read the article

  • Fork or copy a users browser session in IE

    - by jmoeller
    Is it possible to fork a users session (or do something similar) in a Internet Explorer plugin? I want to process the page the user is on when they click a button in the toolbar. To avoid interrupting the users browsing, I'd like to "copy" everything so I can parse and process the page in the background. The processing can involve things such as loading the content of the result links on a Google search, if that's where the button was clicked. So - what I basically want is to imitate "Ctrl+N" but hide the window from the user, so they won't be interrupted. As you can see, if you fill out and submit the form on http://www.snee.com/xml/crud/posttest.html and press "Ctrl+N", everything posted will still appear in the new window, but it won't post the data twice. I was thinking of somehow copying the IWebBrowser2, but: I'm not sure if that's possible (I haven't been able to find any information on MSDN) I don't know if it copies the sessions as well. Creating a new instance of the IWebBrowser2 and simply navigating to the current URL isn't a valid solution as POST-variables of course doesn't get carried over.

    Read the article

  • What is the best way to do testing database (MYSQL spesific)

    - by justjoe
    Right now i'm on testing something in a database. It's a wordpress database. i have to write and delete and do other operation on it. As you know it, it has indexing mechanism that will always make every new post inherit the next highest possible ID. Please consider that this database is a copying of used database. it has been written before. So, i will need to make sure when i finish my testing, it will be the same Right now, my only solution is making backup. So if i have end in some section of planned testing, i will backup it and start next testing on another copy of it. Fortunately, the size of database is only a small one. so delete and copy and backup it will be easy. but i know this way of database testing is only partial solution.It force me to create too many backup copy. I don't know what i will do if the database has bigger size. it will be a very long of testing nightmare. so i wonder is there any solution that work just like rollback. So it will just lock the database and just put new entry as some kind of cache. I can erase it or write it into the database. i use mysql and phpmyadmin and use it to developed some custom solution. EDIT ::: How to effectively doing testing on database when developing PHP solution ?

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >