Search Results

Search found 440 results on 18 pages for 'cloning'.

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

  • C#: BackgroundWorker cloning resources?

    - by Dav
    The problem I've been struggling with this partiular problem for two days now and just run out of ideas. A little... background: we have a WinForms app that needs to access a database, construct a list of related in-memory objects from that data, and then display on a DataGridView. Important point is that we first populate an app-wide cache (List), and then create a mirror of the cache local to the form on which the DGV lives (using List constructor param). Because fetching the data takes a good few seconds (DB sits on a LAN server) to load, we decided to use a BackgroundWorker, and only refresh the DGV once the data is loaded. However, it seems that doing the loading via a BGW results in some memory leak... or an error on my part. When loaded using a blocking method call, the app consumes about 30MB of RAM; with a BGW this jumps to 80MB! While it may not seem as much anyway, our clients are not too happy about it. Relevant code Form private void MyForm_Load(object sender, EventArgs e) { MyRepository.Instance.FinishedEvent += RefreshCache; } private void RefreshCache(object sender, EventArgs e) { dgvProducts.DataSource = new List<MyDataObj>(MyRepository.Products); } Repository private static List<MyDataObj> Products { get; set; } public event EventHandler ProductsLoaded; public void GetProductsSync() { List<MyDataObj> p; using (MyL2SDb db = new MyL2SDb(MyConfig.ConnectionString)) { p = db.PRODUCTS .Select(p => new MyDataObj {Id = p.ID, Description = p.DESCR}) .ToList(); } Products = p; // tell the form to refresh UI if (ProductsLoaded != null) ProductsLoaded(this, null); } public void GetProductsAsync() { using (BackgroundWorker myWorker = new BackgroundWorker()) { myWorker.DoWork += delegate { List<MyDataObj> p; using (MyL2SDb db = new MyL2SDb(MyConfig.ConnectionString)) { p = db.PRODUCTS .Select(p => new MyDataObj {Id = p.ID, Description = p.DESCR}) .ToList(); } Products = p; }; // tell the form to refresh UI when finished myWorker.RunWorkerCompleted += GetProductsCompleted; myWorker.RunWorkerAsync(); } } private void GetProductsCompleted(object sender, RunWorkerCompletedEventArgs e) { if (ProductsLoaded != null) ProductsLoaded(this, null); } End! GetProductsSync or GetProductsAsync are called on the main thread, not shown above. Could it be that the GarbageCollector just gets lost with two threads? Or is it the task manager that shows incorrect values? Will be greateful for any responses, suggestions, criticism.

    Read the article

  • C# reflexion, cloning

    - by Enriquev
    Say I have this class Myclass that contains this method: public class MyClass { public int MyProperty { get; set; } public int MySecondProperty { get; set; } public MyOtherClass subClass { get; set; } public object clone<T>(object original, T emptyObj) { FieldInfo[] fis = this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object tempMyClass = Activator.CreateInstance(typeof(T)); foreach (FieldInfo fi in fis) { if (fi.FieldType.Namespace != original.GetType().Namespace) fi.SetValue(tempMyClass, fi.GetValue(original)); else fi.SetValue(tempMyClass, this.clone(fi.GetValue(original), fi.GetValue(original))); } return tempMyClass; } } Then this class: public class MyOtherClass { public int MyProperty777 { get; set; } } when I do this: MyClass a = new MyClass { MyProperty = 1, MySecondProperty = 2, subClass = new MyOtherClass() { MyProperty777 = -1 } }; MyClass b = a.clone(a, a) as MyClass; how come on the second call to clone, T is of type object and not of type MyOtherClass

    Read the article

  • Cloning objects in C#

    - by Alison
    I want to do something like... myObject myObj = GetmyObj()//create and fill a new object myObject newObj = myObj.Clone(); ...and then make changes to the new object that are not reflected in the original object. I don't often need this functionality so when it's been necessary I've resorted to creating a new object and then copying each property individually but it always leaves me with the feeling that there is a better/more elegant way of handling the situation. How can I clone/deep copy an object so that the cloned object can be modified without any changes being reflected in the original object?

    Read the article

  • Get exact size in bytes of a disk & partitions in windows

    - by Antonius Bloch
    Hi, I'm using dd (under cygwin) to copy a shadow image of a disk in windows. Shadow copy will only give me a partion, so what I am doing is: 1) using dd to grab the disk header (32k on Win2003) 2) using dd to copy the shadow partition 3) using dd to copy the end of of the disk (8 meg reserved on Win2003) 4) stitch them all together and boot on KVM I need the exact size of all the partitions and non partitioned space on this windows drive. Unfortunately most windows disk tools seem to fudge the numbers a bit, or at least give me a different size than Linux does. I could guess like this 32k + partition size + 8M, but I want to double check. If I make a mistake I could lose data. This is on a remote & live Windows 2003 server so no offline solutions will be helpful. Latest cygwin is installed.

    Read the article

  • How to clone and deploy multiple machines?

    - by Mimi
    Hi, See what I wanna do is basically make bootable clones or disc images or whatever(let's call it "stuff" for now ) and store many of them in a single big HDD. Then, I wanna use that big HDD and the "stuff" in it to be able to deploy new machines without the hassle of reinstalling Windows and whatnot(i.e. I do not want to restore nor simply clone a same machine, I literally want to use clones to save time during machine set up). Obviously I'd deploy the "stuff" onto an HDD going into a machine that I know the hardware of to avoid driver issues and whatnot. I alos have enough Windows keys to deal with the multiple activations. I tried using Acronis True Image but it doesn't seem to do what I want(unless idk how to use it properly). Any advice is welcome thanks :)

    Read the article

  • Cloning just a particular directory with hg?

    - by leeand00
    I come from a Subversion background, but I am slowly migrating to Mercurial. When starting on many of my projects, I would setup a development environment that was configured to a particular starting point in developing an app/webapp/program (much like a Maven 2 archetype, but not necessarily Java/Maven). Later I would checkout this archetype/template project out of my svn repo by its particular path; and than export the working copy from version control by the repository; so that I could import the working copy back in to another repository without adding the changes that I made to the working copy to the base the template/archetype project. I've tried doing the same thing in Mercurial, and I've run into a wall since I can't check out, er..um..no, clone a specific path from the hg repository. If I want to achieve the same sort of functionality using Mecurial, what should I do? Use tagged branches? The archetypes/template projects are very different, but I'd like to keep them in the same repository.

    Read the article

  • Cloning java ArrayList and preventing it from modifications

    - by user222164
    I have a data structure like a database Rowset, which has got Rows and Rows have Columns. I need to initialize a Columns with null values, current code is to loop thru each column for a row and initialize values to NULL. Which is very inefficient if you have 100s or rows and 10s of column. So instead I am keeping a initialized ArrayList of columns are RowSet level, and then doing a clone of this Arraylist for individual rows, as I believe clone() is faster than looping thru each element. row.columnsValues = rowsset.NullArrayList.clone() Problem with this is NullArrayList can be accidentally modified after being cloned, thus sacrificing the integrity of ArrayList at RowSet level, to prevent I am doing 3 things 1) Delcaring ArrayList as final 2) Any elements I insert are final or null 3) Methods thurough this arrayList are passed to other arrays are declared a final. Sounds like a plan, do you see any holes ?

    Read the article

  • C# reflection, cloning

    - by Enriquev
    Say I have this class Myclass that contains this method: public class MyClass { public int MyProperty { get; set; } public int MySecondProperty { get; set; } public MyOtherClass subClass { get; set; } public object clone<T>(object original, T emptyObj) { FieldInfo[] fis = this.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object tempMyClass = Activator.CreateInstance(typeof(T)); foreach (FieldInfo fi in fis) { if (fi.FieldType.Namespace != original.GetType().Namespace) fi.SetValue(tempMyClass, fi.GetValue(original)); else fi.SetValue(tempMyClass, this.clone(fi.GetValue(original), fi.GetValue(original))); } return tempMyClass; } } Then this class: public class MyOtherClass { public int MyProperty777 { get; set; } } when I do this: MyClass a = new MyClass { MyProperty = 1, MySecondProperty = 2, subClass = new MyOtherClass() { MyProperty777 = -1 } }; MyClass b = a.clone(a, a) as MyClass; how come on the second call to clone, T is of type object and not of type MyOtherClass

    Read the article

  • Disk image of a Windows 2000 NTFS hard drive

    - by Federico
    Hi, I need to create a disk image from a Windows 2000, NTFS formatted, hard drive. This image has to be used to create backup hard drives to replace the original disk in case an emergency situation arises. This is a medical equipment, so I cannot physically disconnect the disk because I would violate the warranty of the equipment. This machine has a DVD R/W, ethernet and USB 2.0 access, and we have the rights to install any application I want in the Windows 2000 system. 1) Is there any way to do this without installing any new software in the Windows 2000 system, so it is the least invasive as possible? 2) If we have to install a software to do the backup, which software do you recommend? Any hint will be greatly appreciated. Thanks in advance, Federico

    Read the article

  • Solaris 10: How to image a machine?

    - by nonot1
    I've got a Solaris 10 workstation that I'd like to create a full image backup from. The machine has 2 drives, one UFS for system root, and 1 ZFS for data storage. I intend to add a third HD to keep the backup images of both primary drives (including any zfs snapshots). The purpose is not disaster recovery, but rather to allow me to easily blow away a series of application installation/configuration changes I intend to try. What's the best way to do this? I'm not too familiar with Solaris, but have some basic Linux knowledge. I looked at CloneZilla, but it does not support Solaris. I'm OK with just a dd | gzip > image style solution, but I'd need some way to first zero-out the non-used blocks on the primary drives to aid gzip. They are are much larger than my 3rd drive, but hardly have any real data. Update to clarify: I specifically want to avoid using any file-system snapshot functionality, because part of the app configuration changes involve/depend slightly on existing and new snapshots. Ideally the full collection of snapshots should be part of the backup. Virtualization not an option, because the goal is to do performance evaluation on a very specific HW configuration. For the same reason, the spurious "back up" snapshots could skew performance data. Thank you

    Read the article

  • problem when cloning jQuery UI datepicker

    - by h3
    I have a div in which there is a datepicker. I use something like this to clone it: mydiv = $('#someDiv'); // works fine so far mydiv.find('input.datefield').datepicker(); // clone without the events and insert newDiv = myDiv.clone(false).insertAfter(myDiv); // datepicker won't re-init if this class is present newDiv.find('.hadDatepicker').removeClass('hadDatepicker'); // reinitialize datepicker newDiv.find('input.datefield').datepicker(); This is a stripped down version of my code. It works and the calendar shows up as expected where it is expected .. but when a date is clicked, the previous datepicker's value gets updated.. (the one from which it was cloned). I've tried to destroy the (inexisting) instance before like this: newDiv.find('input.datefield').datepicker('destroy').datepicker(); No luck .. I've checked how it keeps track of instances and manually cleared the data like this: newDiv.find('input.datefield').data('datepicker', false).datepicker('destroy').datepicker(); Still no luck. What I don't understand is that only the date selection behavior is buggy, everything else works as expected. I really don't know what else to check now ..

    Read the article

  • How to Mirror or Clone a Spanned Volume in Windows 2008

    - by Matt
    I have a spanned volume (3x6+ TB disks spanned to one 20+ TB volume) that I need to mirror or clone to a new 20+ TB (unspanned) volume. Once mirrored or cloned I'm going to destroy the original volume and reuse the storage elsewhere. Windows 2008 will not allow me to mirror it because the original is a spanned volume. I cannot simply copy the data, because there are sparse files on the volume. So the OS thinks there is 150+ TB used on the disk when there really is only around 18TB used physically. When I try to use the copy command it won't run because it thinks the destination volume needs to be 150+ TB to hold it all. A conundrum, but I figure someone here has the answer. Thanks, Matt

    Read the article

  • Question about cloning in Java

    - by devoured elysium
    In Effective Java, the author states that: If a class implements Cloneable, Object's clone method returns a field-by-field copy of the object; otherwise it throws CloneNotSupportedException. What I'd like to know is what he means with field-by-field copy. Does it mean that if the class has X bytes in memory, it will just copy that piece of memory? If yes, then can I assume all value types of the original class will be copied to the new object? class Point { private int x; private int y; @Override public Point clone() { return (Point)super.clone(); } } If what Object.clone() does is a field by field copy of the Point class, I'd say that I wouldn't need to explicitly copy fields x and y, being that the code shown above will be more than enough to make a clone of the Point class. That is, the following bit of code is redundant: @Override public Point clone() { Point newObj = (Point)super.clone(); newObj.x = this.x; //redundant newObj.y = this.y; //redundant } Am I right? I know references of the cloned object will point automatically to where the original object's references pointed to, I'm just not sure what happens specifically with value types. If anyone could state clearly what Object.clone()'s algorithm specification is (in easy language) that'd be great. Thanks

    Read the article

  • How do I restore to a delta file (disk) on Vmware ESXi

    - by Oscar
    Using VMware Server ESXi (freebie version) I have a Virtual Machine (win 2k3 r2 server). When I first provisioned it I took a snapshot of it. I recently tried to clone the primary drive using my standard hardware-based method to grow a windows disk. (using knoppix, clone drive to a new drive, make it bootable, then I intended to extend the partition via diskpart from within windows). This process failed; I tried setting the cloned drive (via the vmware gui) to replace the original drive, boot and be done. This didn't work out so well. The machine never booted. I checked the boot order, the disk location and all the basics I usually do. As a failsafe, I then tried changing all the settings back so the machine would boot to the original drive and I could figure out (as I eventually did) a better way of growing the disk. However when I powered on the machine with the original drive, it reverted back to that initial snapshot I created; It lost all the changes since. I looked in the file system and found a few files, I think the keyfile here is one named "delta" and I'm assuming that's the disk I want, but I can't find a way to have the Virtual Machine actually use that drive/file. It isn't available to add when I go to add an existing drive. Do I need to somehow commit that delta to the original drive and then boot from it again? Can you point me in the right direction? I've since discovered the proper way of growing drives using "vmkfstools" but I need to get back to the original state of the machine to try this out. Any help would be greatly appreciated.

    Read the article

  • Clone a 2TB WD Green internal drive with bad sectors to a 3TB partitioned external

    - by ron
    I have a 2TB WD Black drive and would like to simply do a straight clone from a failing 3TB drive to it. Both are SATA. Will I be able to just install the new drive alongside the faulty one and then do the clone/rescue attempt with ddrescue or is there a better method? The faulty internal drive mentioned has bed sectors although am usually able to boot into Windows 7 Ultimate with it and navigate and access all my programs. I have been attempting some trials with an Ubuntu Live CD using ddrescue but am not sure I'm doing it right. I have a 3TB WD my book essential external which is GPT and have created a separate 2TB partition on it which I am trying to clone to. I assume I need to format the new drive first to NTFS? Can I do that via the Ubuntu Rescue Remix 12-04 live DVD that I've been booting with?

    Read the article

  • help building a PC that can image a dozen hard drives simultaneously

    - by Bigbio2002
    Not sure if this belongs on here or SuperUser, but here goes... I'm trying to figure out how to make a mass hard drive imaging PC out of COTS parts. A dedicated imaging device can do 10 drives at a time, but costs several thousand dollars. So far, I'm thinking to use several 3-port PCI-E Firewire cards, and use some kind of Firewire-to-IDE adapter to connect the drives themselves. The "software" would consist of scripting diskpart, or some other imaging utility. The problem is that I can't seem to find any sort of adapter. I could use standard external hard drive bays, but then I'd have a dozen power cables that I need to plug in. Ugly, messy, and inefficient. I picked Firewire over USB not only for better transfer speeds, but also because FW can deliver power over the bus (and could theoretically power a hard drive). Does anyone have any input on this?

    Read the article

  • Cloning input type file and set the value

    - by jribeiro
    I know that it isn't possible to set the value of an input type="file" for security reasons... My problem is: I needed to style an input type="file" so what I did was have a button and hide the file input. like: <a href="#" onclick="$('input[name=&quot;photo1&quot;]').click(); return false;" id="photo1-link"></a> <input type="file" name="photo1" class="fileInput jqtranformdone validate[required]" id="photo1" /> These works great in all browsers except IE which gives me an access denied error on submitting through ajax. I'm using the ajaxSubmit jquery plugin (malsup.com/jquery/form/) So after reading for a while I tried to do: var photo1Val = $('#photo1').val(); var clone1 = $('#photo1').clone().val(photo1Val); $('#photo1').remove(); clone1.appendTo('form'); console.log(photo1Val) //prints the right value C:/fakepath/blablabla.jpg $('form').ajaxSubmit(options); The problem is that after this the value of $('#photo1') is empty... Any ideas how to work around this? Thanks

    Read the article

  • What's the best way to clone multiple PCs from one machine?

    - by Jason T.
    Where I work we have dozens and dozens of old ThinkPad laptops. A lot of these can be reused but not for our needs. They have been long since replaced. The higher-ups have decided to donate them to charity. For better or for worse I have been tasked with reimaging them. I took a laptop and installed the factory copy of Windows, updated it, configured it appropriately. Now I'm trying to reimage it to dozens of other laptops. What's some good software to do this? First I used clonezilla to clone the hdd in the laptop to an internal drive in an external enclosure and it worked. Then I tried taking the base image out and connecting it externally to a laptop that needed to be imaged and I got it to work a few times. So far so good, right? Well once I informed my boss of my findings and what I would want to do then the images started to not work on new laptops. One of three things would happen: The Thinkpads would just blink at me and Windows wouldn't load. Or Windows would load but freeze within two minutes. Last but not least the laptops would BSOD during the Windows XP bootup. These laptops are not going to be used by the company. They're going to charity. So can anyone else recommend a way to reimage multiple laptops?

    Read the article

  • Cloning a selector + all its children in jQuery?

    - by HipHop-opatamus
    I'm having trouble getting the following JQuery script to function properly - its functionality is as follows: 1) Hide the content below each headline 2) Upon clicking a headline, substitute the "#first-post" with the headline + the hidden content below the headline. I can only seem to get the script to clone the headline itself to #first-post, not the headline + the content beneath it. Any idea why? <HTML> <HEAD> <script src="http://code.jquery.com/jquery-latest.js"></script> </HEAD> <script> $(document).ready( function(){ $('.title').siblings().hide(); $('.title').click( function() { $('#first-post').replaceWith($(this).closest(".comment").clone().attr('id','first-post')); $('html, body').animate({scrollTop:0}, 'fast'); return false; }); }); </script> <BODY> <div id="first-post"> <div class="content"><p>This is a test discussion topic</p> </div> </div> <div class="comment"> <h2 class="title"><a href="#1">1st Post</a></h2> <div class="content"> <p>this is 1st reply to the original post</p> </div> <div class="test">1st post second line</div> </div> <div class="comment"> <h2 class="title"><a href="#2">2nd Post</a></h2> <div class="content"> <p>this is 2nd reply to the original post</p> </div> <div class="test">2nd post second line</div> </div> </div> <div class="comment"> <h2 class="title"><a href="#3">3rd Post</a></h2> <div class="content"> <p>this is 3rd reply to the original post</p> </div> <div class="test">3rd post second line</div> </div> </div> </BODY> </HTML>

    Read the article

  • Pushing a local mercurial repository to a remote server or cloning at server from local

    - by Samaursa
    I have a local repository that I have now decided to push to a remote server (for example, I have a host that allows mercurial repositories and I am also trying to push to bitbucket). The repository has a lot of files and is a little more than 200mb. Locally, I am able to clone the repository without problems. Now I have a lot of changes in this repository, and I have wasted a couple of days trying to figure out how to get the remote server to clone my repository. I cannot get hg serve to work outside of the LAN. I have tried everything. So instead, I created a new repository at the remote servers (both at the host and bitbucket) with nothing in it. Now I am pushing the complete repository that I have locally to these remote locations. So far it has been unsuccessful, as the push operation is stuck on searching for changes and does not give me any other useful output. I have let it go for about an hour with no change. Now my questions is, what am I doing wrong as far as hg serve is concerned? I can access it locally but not remotely (through DynDns - I have configured it properly and the router forwards the ports correctly) so that I can get the server to clone the repository the first time after which I will be pushing to it. My second question is, assuming the clone at server does not work (for example, if I was to push my current repository to bitbucket), is creating an empty repository at the server and then pushing a local repository to the new remote repository ok? Is that the source of the searching for changes problem? Any help in this regard would be greatly appreciated.

    Read the article

  • how to restore os using acronis

    - by user23950
    I have made a backup using Acronis 2010. And I've tested it on vmware. And I'm having problems booting up the dual boot vm. After restoring from the .tib file. What do I do?What other software that can image the os can you recommend that is easier to use than Acronis.

    Read the article

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