Let's say we got this:  this.myObject = {"id":1};  and we want to store the state of my object as my object original as the following:  this.myObjectORG  = this.myObject;  then you go on your business and change props on your object like this    this.myObject.id = 2;  and to your surprise down the road, you realize that   console.log (this.myObjectORG.id) // also reports 2  Well, that's just how JS works &amp; I'm not questioning that.   Is there a way to preserve the state of the myObject so I can do comparisons whether its properties changed since its original state?   At some point I'd like to be able to do something like this  if ( this.myObjectORG.id !== this.myObject.id ) {    // but this condition is never true  }
I have an object x. I'd like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted properties. This isn't a problem, since I'm copying one of my own literal-constructed objects.  How do I correctly clone a JavaScript object?
I've just been searching around the net for version control that has some support for graphic/Photoshop files. We're currently using BitBucket which is free and unlimited when it comes to file size but doesn't have any design review tools.  Here's what I've found. Does anyone else have any recommendations?  Pixelapse – Free/Beta, works well. Now has layer comp support.   Shipment – Private Beta (waiting for an invite)   LayerVault (out of business) – Windows/Mac, has layer comp support   PixelNovel – SVN Version control for Photoshop   CAD only?! But looks really good.   FileTrek – Very enterprise. No price or demo.   Kaleidoscopeapp – GIT with image compare   Apps that copy files with an incremented version I was wondering what the max. length restrictions are for SharePoint Online Managed Metadata Service:  - TermGroup name  - TermSet name  - Term/Label name/value  I could not find anything on MSDN. A link to a source or reference would be fantastic, too. Alternate Row Coloring in Django Template with More Than One Set of Rows Django templates offer the builtin tag cycle for alternating between several values at different points in a template (or for loop in a template) but this tag does not reset when it is accessed in a scope outside of the cycles definition.  I.e., if you have two or more lists in your template, the rows of all of which you'd like to use some css definitions odd and even, the first row of a list will pick up where the last left off, not with a fresh iteration from the choices (odd and even)  E.g., in the following code, if the first blog has an odd number of entries, then the first entry in a second blog will start as even, when I want it to start at odd.  {% for blog in blogs %}   {% for entry in blog.entries %}     &lt;div class="{% cycle 'odd' 'even' %}" id="{{entry.id}}"&gt;       {{entry.text}}     &lt;/div&gt;   {% endfor %} {% endfor %}   I've tried obviating this by patching with the resetcycle tag offered here:    to no avail.  (The code didn't work for me.)  I've also tried moving my inner loop into a custom tag, but this also did not work, perhaps because the compile/render cycle moves the loop back into the outer loop?  (Regardless of why, it didn't work for me.)  How can I accomplish this simple task!?  I'd prefer not to create a data structure in my view with this information pre-compiled; that seems unnecessary.  Thanks in advance. public static IQueryable&lt;TResult&gt; ApplySortFilter&lt;T, TResult&gt;(this IQueryable&lt;T&gt; query, string columnName)   where T : EntityObject {   var param = Expression.Parameter(typeof(T), "o");   var body = Expression.PropertyOrField(param,columnName);    var sortExpression = Expression.Lambda(body, param);   return query.OrderBy(sortExpression); }   Because the type for OrderBy is not inferred from sortExpression I need to specify it something like this at run time:  var sortExpression = Expression.Lambda&lt;T, TSortColumn&gt;(body, param);   Or  return query.OrderBy&lt;T, TSortColumn&gt;(sortExpression);   I don't think this is possible however as TSortColumn can only be determined during runtime.  Is there a way around this? Find orphaned users In SQL Server 2005, is there a way to find users that either don't exist at the server level (an account that was deleted at server level but wasn't disassociated from databases before it was deleted) or accounts that aren't linked (an account may have been deleted at the server level but not db level, then readded but the db level was never cleaned up).  I've got a very messy server and it would be awesome if there was a query to run to find these. Identical creatures entering the battlefield If I have two cards called  in hand and I play my first, Sin Collector (A). I use its triggered ability.   "When Sin Collector enters the battlefield, target opponent reveals his or her hand. You choose an instant or sorcery card from it and exile that card."  Now, I play Sin Collector (B), I use B's triggered ability.  But now my question. Does Sin Collector (A)'s ability trigger again as well? 'Sin Collector' entered the battlefield again, right? How do I prevent a line from appearing by itself:  Orphan: at the bottom of the page, or Widow: at the top of the page? How to solve 'I found no database files--while read file something.aux' Hi I am trying to include references into my paper but it keeps showing the following when I compile. I am using texstudio. Message: I'm skipping whatever remains of this command The style file: plain.bst I found no database files---while reading file term paper.aux Warning--I didn't find a database entry for "Astrov"  My code is like this:   \documentclass[letter,scriptaddress,twocolumn, prl,showkeys]{revtex4}  \usepackage{amssymb, amsmath, amstext, amscd, verbatim, mathtools, graphicx, float, caption, subcaption} \usepackage[utf8]{inputenc} \usepackage{natbib} \begin{document} This is my reference\cite[1]{Astrov}. \bibliography{term paper} \bibliographystyle{plain} \end{document}   They are all in the same directory. I am really panicing about this at the moment and apologize if similar questions have been asked before. Thanks in advance for your help! Is there an AmpScript function that can be used in an equivalent manner to sql left, right and mid functions?   Thanks, Mark Get dateformat based on Locale vertically align top line of item contents with item number \begin{enumerate}     \item This looks good.     \item       $\begin{aligned}         \mathrm{This} &amp;= \mathrm{is} \\                       &amp;= \mathrm{not\ nicely\ aligned}       \end{aligned}$     \item \begin{tabular}{ccc}             &amp; Neither &amp; is \\        this &amp; table.  &amp;    \\     \end{tabular} \end{enumerate}   It currently looks like this:    But I want it to look like this:    Vertically-aligned so that the top line of the ... item contents, lines up with the item number. External hard disk detection issue what exactly happened:  I have a Seagate 1 TB external hard disk.It was working fine till now.The problem started when I plugged it in my android phone and then back in my pc then simply it does not showup anywhere and :  It does not appear in file explorer   It does not appear in disk management   It is not listed in Diskpart command   It only appears in Device Manager under disk drives   It does not appear in BIOS  only makes sound when plugged and unplugged.  disk spins and light is also showing.   . What I already tried:   updated usb drivers.  used new cable also.  plugged in another pc  usb mass storage is also enabled in BIOS  no issue in any usb port  Anything else i can do? Irreducible polynomial which is reducible modulo every prime How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$? prove every connected manifold is path connected manifold .       my thought:      connected space : Let $ X$  be a topological space. A separation of $ X $ is a pair $U, V$ of disjoint    nonempty open subsets of $ X $ whose union is $X$. The space $ X $ is said to be connected    if there does not exist a separation of  $X$ .      Components: Given  $X$ , define an equivalence relation on $X$ by setting x~y if there    is a connected subspace of $X$  containing both $ x$  and $ y$ . The equivalence classes are    called the components (or the "connected components") of $ X$.       Path Component: I define another equivalence relation on the space $ X$  by defining x ~ у    if there is a path in $ X$  from $ x$  to $ y$ . The equivalence classes are called the path components of $ X$ .       Theorem  : The path components of $ X$  are path connected disjoint subspaces    of $X$  whose union is $X$ , such that each nonempty path connected subspace of $X$  intersects only one of them.       thank you so much I have a package (fcl) in my PPA  in my launchpad PPA and it depends on another package (libccd) which is in another PPA ppa:imnmfotmal/libccd. fcl has both build and run dependency in libccd. So i added libccd as a PPA dependency in launchpad and both are successfully build. but when i am trying to install fcl package after adding the fcl PPA, its throwing an error Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  fcl : Depends: libccd but it is not installable E: Unable to correct problems, you have held broken packages.  but its successfully getting installed after adding the libccd PPA also. I want fcl to install libccd automatically without adding its PPA. how can i achieve it ?? Output of apt-cache policy fcl fcl:   Installed: (none)   Candidate: 1.0-0ppa5   Version table:      1.0-0ppa5 0         500 http://ppa.launchpad.net/imnmfotmal/fcl/ubuntu/ trusty/main amd64 Packages Suppose that $5\leq q\leq p$ are both prime. Prove that $24|(p^2-q^2)$.   This is what I got so far. I figured that since $p,q$ are bigger than $5$, there are only odd primes for this conjecture. Then I can rename $p=2m+1,q=2n+1,m,n∈Z$.  We want to show $(p^2-q^2 )=24k,k∈Z$. By substituting $2m+1$ for $p$ and $2n+1$ for $q$, we get  $((2m+1)^2-(2n+1)^2)$. If we expand it, we get $4(m^2+n^2+m-n)$ Q. I think I can make $4(m^2+n^2+m-n)$ look like $24k$. How should I approach ?  And my prof. commented that "I would take this proof in small steps.  Rather than trying initially to prove that $24 | p^2-q^2$, look at the progress you already have.  You proved $4 | p^2-q^2$.  Can you prove 8 is a factor?  What about 3?  Then see if you can put together what you have to get 24 as a factor."  I am stuck here. Any helps? How to customize Latexian to use other TeX engines or biber? The Mac editor Latexian has built in methods for compiling using latex+dvips, pdflatex and xelatex.  Furthermore, it assumes bibtex and makeindex to deal with bibliographies and indexes, respectively.  How do I customize Latexian to use, e.g. LuaTeX for compiling or Biber for bibliographies? Prove the inequality $|xy|\leq\frac{1}{2}(x^2+y^2)$ Restore deleted photos I accidentally deleted the entire "downloaded" album full of pictures from my Samsung Galaxy S2 (SPH-D710) and am trying to use a  I downloaded.  My phone will not show up as a remove-able storage device on my computer, or on the program. I have tried to change the USB settings on my phone but there is no USB settings when I go to Settings > Wireless and networks as most information instructs.   I found the setting for USB debugging by going to Settings > Developer options and can turn that on and off, but that is the only setting I can find relating to USB storage.   When I connect it to the USB cord it gives me MTP or PTP options but again no USB options.   Any advice??? Thank you! Is it just for me, or has the privilege to review new posts and late answers changed for everyone?  I recently started being more active in reviewing, but the rep requirement just shot up and I can not review anymore? The rep requirement has shot up to 500. Is this just for me, as a 'process", or has it been changed site wide?