Search Results

Search found 1863 results on 75 pages for 'clone of anton makrushin'.

Page 19/75 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Mercurial mirror: abort: No such file or directory: http://[...]/00manifest.i

    - by Sridhar Ratnakumar
    I am trying to setup a daily mirror of a mercurial repository - code.python.org in particular - within our local network, and serve that via Apache HTTPD. On the remote host that hosts apache, I did this: $ cd /var/www $ hg clone http://code.python.org/hg/trunk/ On my macbook, I ran: $ hg -v clone http://remote/trunk/ (falling back to static-http) abort: No such file or directory: http://remote/trunk/.hg/store/00manifest.i Google does not show any relevant result for this particular error. I remember back in those days being able to setup Bazaar mirrors by a simple clone. Doesn't Mercurial work like that? How do I setup a mirror that must further act like a clone URL?

    Read the article

  • How to copy only VM changes in VMware to another physical machine

    - by Paul
    How can I use VMware Workstation to copy only changes to a VM to another physical machine, rather than recopying the entire VM every time? Can I just copy the snapshot files, if the second physical machine starts from a pristine copy of the VM? Would it be best to create a linked clone against the original VM, and then copy the linked clone directory each time? Does that even work? (I'm assuming I'll have to change the path in the VM's metadata file, since the paths will be different. I'm assuming I can't clone a linked clone w/o cloning the base.) Background: I and another developer with VMware Workstation are using VM's for systems development. I have to work from a home desktop. Transporting a multi-gigabyte VM either direction takes several hours at best. Downloading it is easiest, but that takes an hour to get it on a DMZ machine for download and then many hours to actually download.

    Read the article

  • Firefox clones for Ubuntu

    - by cipricus
    In Windows I use, beside the main Firefox installation, one or even two "Firefox clones" for different purposes (specifically oriented addons and configurations, light configuration without addons, configuration for a different user, etc). A clone of Firefox is a browser that is identical to Firefox except the name. (It may have more - but not less - features than FF and it must be installable beside Firefox, not on top/instead of it. So, a clone is not a replacement/exclusive alternative of FF: in the way Swiftfox is, taking all previous Firefox extensions and configuration.) For example, in Windows, Pale Moon, Cometbird and Wyzo are FF clones (but they do not have Linux support). Basically, Flock browser would also qualify, and it had support for Linux: but it was discontinued. What remains as closest to being a full clone is Seamonkey, has support for Linux, but it is not a complete clone (although it can use a lot of FF extensions): themes are not working, the interface is in general different and rather primitive. It has the merit of keeping the pace with FF 4+ (in contrast with Swiftweasel, for example.) Are such more browsers available in Ubuntu? (As for comments asking why I "really" need these clones, I am just used to doing that, I like two separate Firefox-like browsers: why pleasure, just like curiosity, would not be enough??)

    Read the article

  • 8-Puzzle Solution executes infinitely [migrated]

    - by Ashwin
    I am looking for a solution to 8-puzzle problem using the A* Algorithm. I found this project on the internet. Please see the files - proj1 and EightPuzzle. The proj1 contains the entry point for the program(the main() function) and EightPuzzle describes a particular state of the puzzle. Each state is an object of the 8-puzzle. I feel that there is nothing wrong in the logic. But it loops forever for these two inputs that I have tried : {8,2,7,5,1,6,3,0,4} and {3,1,6,8,4,5,7,2,0}. Both of them are valid input states. What is wrong with the code? Note For better viewing copy the code in a Notepad++ or some other text editor(which has the capability to recognize java source file) because there are lot of comments in the code. Since A* requires a heuristic, they have provided the option of using manhattan distance and a heuristic that calculates the number of misplaced tiles. And to ensure that the best heuristic is executed first, they have implemented a PriorityQueue. The compareTo() function is implemented in the EightPuzzle class. The input to the program can be changed by changing the value of p1d in the main() function of proj1 class. The reason I am telling that there exists solution for the two my above inputs is because the applet here solves them. Please ensure that you select 8-puzzle from teh options in the applet. EDITI gave this input {0,5,7,6,8,1,2,4,3}. It took about 10 seconds and gave a result with 26 moves. But the applet gave a result with 24 moves in 0.0001 seconds with A*. For quick reference I have pasted the the two classes without the comments : EightPuzzle import java.util.*; public class EightPuzzle implements Comparable <Object> { int[] puzzle = new int[9]; int h_n= 0; int hueristic_type = 0; int g_n = 0; int f_n = 0; EightPuzzle parent = null; public EightPuzzle(int[] p, int h_type, int cost) { this.puzzle = p; this.hueristic_type = h_type; this.h_n = (h_type == 1) ? h1(p) : h2(p); this.g_n = cost; this.f_n = h_n + g_n; } public int getF_n() { return f_n; } public void setParent(EightPuzzle input) { this.parent = input; } public EightPuzzle getParent() { return this.parent; } public int inversions() { /* * Definition: For any other configuration besides the goal, * whenever a tile with a greater number on it precedes a * tile with a smaller number, the two tiles are said to be inverted */ int inversion = 0; for(int i = 0; i < this.puzzle.length; i++ ) { for(int j = 0; j < i; j++) { if(this.puzzle[i] != 0 && this.puzzle[j] != 0) { if(this.puzzle[i] < this.puzzle[j]) inversion++; } } } return inversion; } public int h1(int[] list) // h1 = the number of misplaced tiles { int gn = 0; for(int i = 0; i < list.length; i++) { if(list[i] != i && list[i] != 0) gn++; } return gn; } public LinkedList<EightPuzzle> getChildren() { LinkedList<EightPuzzle> children = new LinkedList<EightPuzzle>(); int loc = 0; int temparray[] = new int[this.puzzle.length]; EightPuzzle rightP, upP, downP, leftP; while(this.puzzle[loc] != 0) { loc++; } if(loc % 3 == 0){ temparray = this.puzzle.clone(); temparray[loc] = temparray[loc + 1]; temparray[loc + 1] = 0; rightP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); rightP.setParent(this); children.add(rightP); }else if(loc % 3 == 1){ //add one child swaps with right temparray = this.puzzle.clone(); temparray[loc] = temparray[loc + 1]; temparray[loc + 1] = 0; rightP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); rightP.setParent(this); children.add(rightP); //add one child swaps with left temparray = this.puzzle.clone(); temparray[loc] = temparray[loc - 1]; temparray[loc - 1] = 0; leftP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); leftP.setParent(this); children.add(leftP); }else if(loc % 3 == 2){ // add one child swaps with left temparray = this.puzzle.clone(); temparray[loc] = temparray[loc - 1]; temparray[loc - 1] = 0; leftP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); leftP.setParent(this); children.add(leftP); } if(loc / 3 == 0){ //add one child swaps with lower temparray = this.puzzle.clone(); temparray[loc] = temparray[loc + 3]; temparray[loc + 3] = 0; downP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); downP.setParent(this); children.add(downP); }else if(loc / 3 == 1 ){ //add one child, swap with upper temparray = this.puzzle.clone(); temparray[loc] = temparray[loc - 3]; temparray[loc - 3] = 0; upP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); upP.setParent(this); children.add(upP); //add one child, swap with lower temparray = this.puzzle.clone(); temparray[loc] = temparray[loc + 3]; temparray[loc + 3] = 0; downP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); downP.setParent(this); children.add(downP); }else if (loc / 3 == 2 ){ //add one child, swap with upper temparray = this.puzzle.clone(); temparray[loc] = temparray[loc - 3]; temparray[loc - 3] = 0; upP = new EightPuzzle(temparray, this.hueristic_type, this.g_n + 1); upP.setParent(this); children.add(upP); } return children; } public int h2(int[] list) // h2 = the sum of the distances of the tiles from their goal positions // for each item find its goal position // calculate how many positions it needs to move to get into that position { int gn = 0; int row = 0; int col = 0; for(int i = 0; i < list.length; i++) { if(list[i] != 0) { row = list[i] / 3; col = list[i] % 3; row = Math.abs(row - (i / 3)); col = Math.abs(col - (i % 3)); gn += row; gn += col; } } return gn; } public String toString() { String x = ""; for(int i = 0; i < this.puzzle.length; i++){ x += puzzle[i] + " "; if((i + 1) % 3 == 0) x += "\n"; } return x; } public int compareTo(Object input) { if (this.f_n < ((EightPuzzle) input).getF_n()) return -1; else if (this.f_n > ((EightPuzzle) input).getF_n()) return 1; return 0; } public boolean equals(EightPuzzle test){ if(this.f_n != test.getF_n()) return false; for(int i = 0 ; i < this.puzzle.length; i++) { if(this.puzzle[i] != test.puzzle[i]) return false; } return true; } public boolean mapEquals(EightPuzzle test){ for(int i = 0 ; i < this.puzzle.length; i++) { if(this.puzzle[i] != test.puzzle[i]) return false; } return true; } } proj1 import java.util.*; public class proj1 { /** * @param args */ public static void main(String[] args) { int[] p1d = {1, 4, 2, 3, 0, 5, 6, 7, 8}; int hueristic = 2; EightPuzzle start = new EightPuzzle(p1d, hueristic, 0); int[] win = { 0, 1, 2, 3, 4, 5, 6, 7, 8}; EightPuzzle goal = new EightPuzzle(win, hueristic, 0); astar(start, goal); } public static void astar(EightPuzzle start, EightPuzzle goal) { if(start.inversions() % 2 == 1) { System.out.println("Unsolvable"); return; } // function A*(start,goal) // closedset := the empty set // The set of nodes already evaluated. LinkedList<EightPuzzle> closedset = new LinkedList<EightPuzzle>(); // openset := set containing the initial node // The set of tentative nodes to be evaluated. priority queue PriorityQueue<EightPuzzle> openset = new PriorityQueue<EightPuzzle>(); openset.add(start); while(openset.size() > 0){ // x := the node in openset having the lowest f_score[] value EightPuzzle x = openset.peek(); // if x = goal if(x.mapEquals(goal)) { // return reconstruct_path(came_from, came_from[goal]) Stack<EightPuzzle> toDisplay = reconstruct(x); System.out.println("Printing solution... "); System.out.println(start.toString()); print(toDisplay); return; } // remove x from openset // add x to closedset closedset.add(openset.poll()); LinkedList <EightPuzzle> neighbor = x.getChildren(); // foreach y in neighbor_nodes(x) while(neighbor.size() > 0) { EightPuzzle y = neighbor.removeFirst(); // if y in closedset if(closedset.contains(y)){ // continue continue; } // tentative_g_score := g_score[x] + dist_between(x,y) // // if y not in openset if(!closedset.contains(y)){ // add y to openset openset.add(y); // } // } // } } public static void print(Stack<EightPuzzle> x) { while(!x.isEmpty()) { EightPuzzle temp = x.pop(); System.out.println(temp.toString()); } } public static Stack<EightPuzzle> reconstruct(EightPuzzle winner) { Stack<EightPuzzle> correctOutput = new Stack<EightPuzzle>(); while(winner.getParent() != null) { correctOutput.add(winner); winner = winner.getParent(); } return correctOutput; } }

    Read the article

  • When I shoot from a gun while walking, the bullet is off the center, but when stand still it's fine

    - by Vlad1k
    I am making a small project in Unity, and whenever I walk with the gun and shoot at the same time, the bullets seem to curve and shoot off 2-3 CMs from the center. When I stand still this doesn't happen. This is my main Javascript code: @script RequireComponent(AudioSource) var projectile : Rigidbody; var speed = 500; var ammo = 30; var fireRate = 0.1; private var nextFire = 0.0; function Update() { if(Input.GetButton ("Fire1") && Time.time > nextFire) { if(ammo != 0) { nextFire = Time.time + fireRate; var clone = Instantiate(projectile, transform.position, transform.root.rotation); clone.velocity = transform.TransformDirection(Vector3 (0, 0, speed)); ammo = ammo - 1; audio.Play(); } else { } } } I assume that these two lines need to be tweaked: var clone = Instantiate(projectile, transform.position, transform.root.rotation); clone.velocity = transform.TransformDirection(Vector3 (0, 0, speed)); Thanks in advanced, and please remember that I just started Unity, and I might have a difficult time understanding some things. Thanks!

    Read the article

  • Re: # 47209 How to copy an Existing HD to a new one and have it be bootable?

    - by user281151
    Help please! My backup method of choice is to clone my "working" drive to another identical drive. I have 2 windows drives and I clone my working one to the other one once per month. No problem - each will boot if I select it. Now with the lack of future support for XP, I am getting familiar with Ubuntu 14.04 LTS. I have it on one drive and I have a second identical drive that I want to be able to clone it to once/month. Not as necessary to do this with Ubuntu as with windows, I know, but I'm anal. So I have followed #47209 MestreLion's procedure with just the two Ubuntu drives "on line". I.e., boot my "working" drive with Live CD, use Gparted to be sure I know what's what, open terminal and enter and execute the dd command, Go to bed till the clone is done, shut down the computer, disconnect the input/source drive, boot up using BIOS to select the remaining output drive. The drive starts fine but all is not OK. It puts up a screen that says I'm on a Guest Session and asks for a password. Well, for one thing I have my Ubuntu set up to start without a password being entered. I have one, of course, I put it in but it isn't accepted. I can't get by this Guest Session screen. I am fine, of course. I can disconnect this drive, hook up my "main" ubuntu drive and all the rest, and go on with my business. But I don't have the desired "emergency backup" drive working where I could jump on and use it immediately if I needed it. Can someone give me some guidance here?? What (else) do I need to do. Love Ubuntu but learning. Thanks, Wes.

    Read the article

  • Why am I getting a segmentation fault with this code?

    - by gooswa
    Trying to make a simple rectangle/bin packer in C. Takes a given area and finds placement for any given size rectangle. About after 4 recursions is when I get the segmentation fault. #include <stdio.h> #include <stdlib.h> typedef struct node_type PackNode; struct node_type { int x , y; int width , height; int used; struct node_type *left; struct node_type *right; }; typedef struct point_type PackPoint; struct point_type { int x,y; }; PackNode _clone(PackNode *node) { PackNode clone; clone.used = 0; clone.x = node->x; clone.y = node->y; clone.width = node->width; clone.height= node->height; clone.left = NULL; clone.right= NULL; return clone; } PackNode root; int rcount; PackPoint* recursiveFind(PackNode *node, int w, int h) { PackPoint rp; PackPoint *p = NULL; rcount++; printf ("rcount = %u\n", rcount); //left is not null go to left, if left didn't work try right. if (node->left!=NULL) { //move down to left branch p = recursiveFind(node->left, w, h); if (p!=NULL) { return p; } else { p = recursiveFind(node->right, w, h); return p; } } else { //If used just return null and possible go to the right branch; if (node->used==1 || w > node->width || h > node->height) { return p; } //if current node is exact size and hasn't been used it return the x,y of the mid-point of the rectangle if (w==node->width && h == node->height) { node->used=1; rp.x = node->x+(w/2); rp.y = node->y+(h/2); p = &rp; return p; } //If rectangle wasn't exact fit, create branches from cloning it's parent. PackNode l_clone = _clone(node); PackNode r_clone = _clone(node); node->left = &l_clone; node->right = &r_clone; //adjust branches accordingly, split up the current unused areas if ( (node->width - w) > (node->height - h) ) { node->left->width = w; node->right->x = node->x + w; node->right->width = node->width - w; } else { node->left->height = h; node->right->y = node->y + h; node->right->height = node->height - h; } p = recursiveFind(node->left, w, h); return p; } return p; } int main(void) { root = malloc( root.x=0; root.y=0; root.used=0; root.width=1000; root.height=1000; root.left=NULL; root.right=NULL; int i; PackPoint *pnt; int rw; int rh; for (i=0;i<10;i++) { rw = random()%20+1; rh = random()%20+1; pnt = recursiveFind(&root, rw, rh); printf("pnt.x,y: %d,%d\n",pnt->x,pnt->y); } return 0; }

    Read the article

  • 2010 FIFA World Cup Silverlight Smooth Streaming Player with Live Messenger

    - by FernandoCortes
    Finally after weeks of hard work the World Cup Silverlight player is ready to watch the spanish team in action. This Silverlight Player use Smooth Streaming technology, enables adaptive streaming of media to Silverlight and other clients over HTTP. Smooth Streaming provides a high-quality viewing experience that scales massively on content distribution networks, making true HD 1080p media experiences a reality. The player integrate leading social networks such as Microsoft Live Messenger, Twitter and Facebook to chat in a public chat and with your Windows Live Messenger contacts list completely private. All supported on Microsoft Azure in one of the biggest deployments in this platform (350 instances). We integrate Windows Live Messenger with Siverlight using the javascript messenger library, version 3.5. Check out this video, in spanish, where Antón and me explain how to integrate Silverlight and Live Messenger: http://www.channels.com/episodes/show/8900143/-Codecamp-es-2009-Messenger-Cortes-Molleda   Player Uri http://mundial2010.telecinco.es/ (Spanish Television)   Developer & Design Team Antón Molleda (Developer) Luis Guerrero (Developer) Raúl Varela (Designer) Ricardo Acosta (Designer) Fernando Cortés Hierro (myself)

    Read the article

  • Simplified knapsack in PHP

    - by Mikhail
    I have two instances where I'd like to display information in a "justified" alignment - but I don't care if the values are switched in order. One example being displaying the usernames of people online: Anton Brother68 Commissar Dougheater Elflord Foobar Goop Hoo Iee Joo Rearranging them we could get exactly 22 characters long on each line: Anton Brother68 Foobar Commissar Elflord Goop Dougheater Hoo Iee Joo This is kind of a knapsack, except seems like there ought to be a P solution since I don't care about perfection, and I have multiple lines. Second instance is identical, except instead of names and character count I would be displaying random images and use their width.

    Read the article

  • Legal question.

    - by Kjow
    Hi all, a question bounces in my head from some time. Copyright laws are different by nation to nation, but generally which is the border line to break a copyright? Suppose to make a game that is very similar to an other come out in the past, e.g. a Pacman clone or a Space Invaders clone, but nothing from original titles are grabbed and maybe they're not made in 2d, but in 3d. The titles aren't "Pacman clone - the return" or "Space Invaders - they did it again", and not also "Pocman" or "Space Evaders" (maybe this last could be fun for some "creative financers" that need to escape from earth :D). Finally suppose to call these some thing like "Popcorn, fruit and ghosts" (or the acronym: "PFG") and "Kill all enemy" (or the acronym: "KAE"). In this case (not grab- all self-made) and no references to original titles, but with a game that feels very similar to "ispiration ones"... they could be sold to somewhere like "Valve's Steam"? Regards, Kjow

    Read the article

  • Abstract class + Inheritance vs Interface

    - by RealityDysfunction
    Hello fellow programmers, I am reading a book on C# and the author is comparing Abstract classes and Interfaces. He claims that if you have the following "abstract class:" abstract class CloneableType { public abstract object Clone(); } Then you cannot do this: public class MiniVan : Car, CloneableType {} This, I understand. However he claims that because of this inability to do multiple inheritance that you should use an interface for CloneableType, like so: public interface ICloneable { object Clone(); } My question is, isn't this somewhat misleading, because you can create an abstract class which is "above" class Car with the method Clone, then have Car inherit that class and then Minivan will inherit Car with all these methods, CloneAble class - Car class - Minivan Class. What do you think? Thanks.

    Read the article

  • FFMPEG compilation errors

    - by Nitin Sagar
    First of all i am a newbie to Ubuntu Linux and have been trying to install and compile FFMPEG on an Ubuntu machine... I am trying to compile FFMPEG on an Ubuntu machine, using the following link reference: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide I have already install git packages from resource centre whatever it results in search... Whatever i am trying to clone to is showing the below error... and please note that the network is wireless and connected with full bandwidth and i am able to browse through website and not sure why its showing an error as unable to connect and connection timed out.... root@ubuntu:~# cd root@ubuntu:~# git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git Cloning into 'fdk-aac'... fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out Tried these commands as well to install x264 lib: cd git clone --depth 1 git://git.videolan.org/x264 cd x264 I am doing all this as a root user. Any help and comments would be appreciated. Thanks Nitin

    Read the article

  • Where does node.js install to?

    - by Ash Scott
    I'm trying to install a script, which is a clone of a game, and uses node.js for it. Now, the documentation says I should copy the node.exe (windows) and put it where the clone is. Now, I can't find the node.exe ubuntu equivalent, I can't even find where it's installed?! Don't really want this hosted on a windows machine due to licensing. Here's a snipet from the doc: Download : Node.js (Install Button) Go where you are install Node.js (For Windows 8 it's C:/Programms/nodejs) Copy node.exe and paste on the clone folder Now I need to do this in ubuntu, however I can't find where node is installed to? Any ideas?

    Read the article

  • Client-Side script to upload attachments to the Sharepoint 2007 list

    - by Clone of Anton Makrushin
    Hello. I have no good script-writing experience. So, I have a list created on MOSS 2007 with about 1000 elements and attachments enabled. I need to attach to each list item file (*.jpg) from a local folder. I doesn't have administrator privileges at MOSS server, only contributor rights Here is my script: $web = new-Object system.Net.WebClient $web.Credentials = [System.Net.CredentialCache]::DefaultCredentials $web.Headers.Add("user-agent", "PowerShell Script") $web.UploadFile('http://ruglbsrvsps/IT/Lists/Test1/', 'C:\temp\Attachments\14\Img1.jpg' ) Test1 - target list; Item1, Item2, Item3 - list items, without attachments, created manually When I run script, it returns byte array and does not upload file to the list item. Can you fix my script or advice better solution for my task (attach bulk of files to the MOSS list items, only contributor rights for target Sharepoint 2007 list) Thank you.

    Read the article

  • DirectSound affects system volume on WinXP

    - by Anton
    Hello guys, I'm currently developing an audio engine that is used in voice network chat software. Everything is working fine - capture/playback/mixing channels. The problem is in using it under Windows XP. I've been getting user reports with information that their global system volume is set to zero after launching the application. I'm assuming that happens because of WaveOut/DSound conflict. How can I force DSound not to affect system volume? Playback device is initialized: DirectSoundCreate8(&GUID, &pAudio, NULL); and: pAudio-SetCooperativeLevel(parentWnd, DSSCL_PRIORITY); I'm currently not able to debug the application, cause I'm using Vista and everything is OK. Hope you can help me with this issue! Thanks a Lot! Regards, Anton.

    Read the article

  • How does Qt implement signals and slots?

    - by anton
    Can someone explain to me the basic idea of Qt signals&slots mechanism IMPLEMENTATION? I want to know what all those Q_OBJECT macros do "in plain C++". This question is NOT about signals&slots usage. added: I know that Qt uses moc compiler to transform Qt-C++ in plain C++. But what does moc do? I tried to read "moc_filename.cpp" files but I have no idea what can something like this mean void *Widget::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_Widget)) return static_cast<void*>(const_cast< Widget*>(this)); return QDialog::qt_metacast(_clname); } Thanks in Advance, anton

    Read the article

  • interesting network or git problem

    - by bogumbiker
    I have a setup my own git repository with gitosis on dedicated debian server. The server is visible via port 22 from outside (the port 22 is forwarded from my router to my git server). On the local network the git repository works perfectly. The problem happens once I try to do "git clone.." from remote server. So once I do "git clone.." from remote I am getting git clone hung after cloning around 20-30% of the repository (small around 2MB) and I think this is the random percentage. I can do scp to and from the git server without any problems. Also as I mentioned the git clone, push, etc works perfectly within my internal network. Any idea how to debug this problem? thanks

    Read the article

  • Unit tests for deep cloning

    - by Will Dean
    Let's say I have a complex .NET class, with lots of arrays and other class object members. I need to be able to generate a deep clone of this object - so I write a Clone() method, and implement it with a simple BinaryFormatter serialize/deserialize - or perhaps I do the deep clone using some other technique which is more error prone and I'd like to make sure is tested. OK, so now (ok, I should have done it first) I'd like write tests which cover the cloning. All the members of the class are private, and my architecture is so good (!) that I haven't needed to write hundreds of public properties or other accessors. The class isn't IComparable or IEquatable, because that's not needed by the application. My unit tests are in a separate assembly to the production code. What approaches do people take to testing that the cloned object is a good copy? Do you write (or rewrite once you discover the need for the clone) all your unit tests for the class so that they can be invoked with either a 'virgin' object or with a clone of it? How would you test if part of the cloning wasn't deep enough - as this is just the kind of problem which can give hideous-to-find bugs later?

    Read the article

  • How are java.lang.Object's protected methods protected from subclasses?

    - by Adrian Lang
    The keyword protected grants access to classes in the same package and subclasses (http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html). Now, every class has java.lang.Object as superclass (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html). Hence I conclude that every class may access java.lang.Object's methods even if they are protected. Take a look at the following example: public class Testclass { public Object getOne() throws CloneNotSupportedException { return this.clone(); } public Object getTwo() throws CloneNotSupportedException { return ((Object) this).clone(); } } While getOne() compiles fine, getTwo() gives Testclass.java:6: clone() has protected access in java.lang.Object return ((Object) this).clone(); I neither understand why getTwo() doesn't compile nor what's the difference (regarding the access of java.lang.Objects members) with getOne().

    Read the article

  • git: having 2 push/pull repos in sync (or 1 push/pull and 1 pull in sync)

    - by xavjuan
    Hello, We work on multiple geographically seperate sites. Today I have our git clones all live on one site A. Then users from site B have to ssh over to do a git clone or to push in changes. These are bare repos where the update is through pushes. Ideally, for git clone/push performance, I'd like to limit having to go over ssh. I'd like to have a copy of git repo X live on site A and site B... and have some syncing mechanism between them. OR to have X live on both sites, but only allow pushing to A (and have that setup correctly at clone time on B) I'm worried about the case where someone on site A pushes changes to the repo at site A at the same time that someone on site B pushes a truely conflicting change to the repo at site B. Is there some 'sync'ing solution built into git for distributed open repos like this? Or a way to have a clone from X set the origin/parent to the X from the other site? thanks, -John

    Read the article

  • How can I switch to a tag/branch in hg?

    - by n179911
    Hi, I have followed the documentation in https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial And I have download FF source using this: hg clone http://hg.mozilla.org/mozilla-central/ src But how can i switch to the FF3.6 'branch' or 'tag'? The documentation said 'hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/ 192src' but I don't want to clone both FF main and Ff3.6 twice? Thank you.

    Read the article

  • Getting ID of a cloned element

    - by Haris
    I'm using jQuery draggable and droppable. I'm cloning the draggable widget on drop event of droppable. I want to fetch the ID of the cloned element which will be sent to the the application with the AJAX request. I'm unable to fetch the ID. console.log returns blank string. var dropElem = ui.draggable.html(); var clone = $(dropElem).clone(); var widgetType = $(clone).attr('id'); $(this).append(clone); Also, I want to change the ID of the cloned element on the response event of the ajax request. How do I specially change the ID of the cloned event after it has been appended?

    Read the article

  • Bazaar offline + branches

    - by cheez
    I have a Bazaar repository on Host A with multiple branches. This is my main repository. Until now, I have been doing checkouts on my other machines and committing directly to the main repository. However, now I am consolidating all my work to my laptop and multiple VMs. I need to be working offline regularly. In particular, I need to create/delete/merge branches all while offline. I was thinking of continuing to have the master on Host A with a clone of the repository on the laptop with each vms doing checkouts of the clone. Then, when I go offline, I could do bzr unbind on the clone and bzr bind when I am back online. This failed as soon as I tried to bzr clone since bzr clone only clones a branch(!!!!) I need some serious help. If Hg would handle this better please let me know (I need Windows support.) However, at this moment I cannot switch from Bazaar as it is too close to some important deadlines. Thanks in advance!

    Read the article

  • not work jquery for for input value

    - by Mohammad
    main code : var clone = div.clone(); clone.attr('id', sabad_kala_id); $('.content').append(clone); $('div#'+sabad_kala_id).replaceWith('<tr id='+sabad_kala_id+'><td width="50"><a class="del_kala" id='+sabad_kala_id+'><img src="images/delete.png" alt="delete" /></a></td><td width="50">1.</td><td width="388">'+title+'</td><td width="80" clas="mm"><input class="count" type="text" value='+count+' /></td><td width="100">'+price+' $</td><td width="120">'+price_count+' $</td></tr>'); and this code run perfect after append and replace , user can edit input.count in table and below code have run : ('input.count').keyup(function(e){ alert(test); }); but this code not work :(

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >