Wikipedia:Reference desk/Archives/Computing/2015 October 7

= October 7 =

Keep track of changes on local file (one user)
How can I keep track of changes on a local file (like .emacs, or other config file)? What I am doing now is making copies of it when I change something (in case it does not work, I pull the back-up). Would learning about git make sense or is it overkill? Could this be dealt with a couple of cli commands? --YX-1000A (talk) 00:44, 7 October 2015 (UTC)


 * If it's a small file, then what you are doing (making "full image backups") is probably best. Where this method becomes problematic is if you have huge files with frequent minor updates.  In this case, all those backup copies take up too much space, and you might consider "incremental backups", which only store the changes since the last full image backup.  But, if you can avoid the complexity this involves and stick with full image backups alone, all the better. StuRat (talk) 03:56, 7 October 2015 (UTC)


 * The full-bore solution is to use a version control system like git, yes. It might be overkill for small, simple files, but small, simple files have a tendency to grow into large, complex ones over time. I'm moderately familiar with emacs, and I know that hardcore users tend to develop extremely complex .emacs files over time. Many such users manage their .emacs with a VCS. And if you are doing or intend to start doing serious programming, you'll need to become very familiar with VCS anyway --71.119.131.184 (talk) 04:17, 7 October 2015 (UTC)


 * emacs does backups, including numbered backups (one for each save.) Using distributed VCS-s like git for config files sounds a bit overkill-y (at home, anyway), but that's not to dissuade you from learning it. There's also the option, as StuRat rightly said, of making daily incremental snapshots of the FS with something like backintime, which uses rsync. Making them onto external storage guards against user error and hardware failure alike and is a bit like crude versioning Asmrulz (talk) 04:26, 7 October 2015 (UTC)


 * →Three-way comparison. This is what WP does in displaying difference of revisions and works on text files only. Using file systems, You need to grap the rights an owners and make an differential backup, managing versions if changes were saved to the file, see version control. -- Hans Haase (有问题吗) 11:53, 11 October 2015 (UTC)

Unitary Transformation
Is there (or, when is there) any unitary transformation that "changes" the probabilities (not only the phases) of the states? That is, $$\forall|x\rangle,|y\rangle\in\{|0\rangle,|1\rangle\}\ T(\alpha|0xz\rangle + \beta|1yz\rangle) = \alpha'|0xz'\rangle + \beta'|1yz'\rangle$$ where $$ \alpha, \beta, \alpha', \beta' $$ are fixed, and $$|\alpha|\ne|\alpha'|, |\beta|\ne|\beta'|$$ (and not only a phase change, i.e, not only $$\alpha\ne\alpha', \beta\ne\beta'$$), and $$|\alpha|^2+|\beta|^2=1, |\alpha'|^2+|\beta'|^2=1, 0\notin\{\alpha,\alpha',\beta,\beta'\}, |z\rangle =|00...\rangle $$, and maybe $$z=z'$$. (This question generalizes my prior question)31.154.92.179 (talk) 06:04, 7 October 2015 (UTC)
 * There is none. Proof: I'll write z'xy for the z' associated with a particular value of x and y. By linearity,
 * $$T(\alpha|00z\rangle + \beta|10z\rangle + \alpha|01z\rangle + \beta|11z\rangle) = \alpha'|00z'_{00}\rangle + \beta'|10z'_{00}\rangle + \alpha'|01z'_{11}\rangle + \beta'|11z'_{11}\rangle =$$
 * $$T(\alpha|00z\rangle + \beta|11z\rangle + \alpha|01z\rangle + \beta|10z\rangle) = \alpha'|00z'_{01}\rangle + \beta'|11z'_{01}\rangle + \alpha'|01z'_{10}\rangle + \beta'|10z'_{10}\rangle$$
 * so $$z'_{00} = z'_{01} = z'_{10} = z'_{11} = z'$$. Then, much like last time, we have
 * $$(\bar\alpha\langle 0xz| + \bar\beta\langle 10z|) (\alpha|0xz\rangle + \beta|11z\rangle) = (\bar\alpha'\langle 0xz'| + \bar\beta'\langle 10z'|) (\alpha'|0xz'\rangle + \beta'|11z'\rangle)$$
 * which reduces to $$|\alpha|^2 = |\alpha'|^2$$. -- BenRG (talk) 07:34, 7 October 2015 (UTC)


 * A beautiful proof, again! Thank you very much! 80.246.139.106 (talk) 09:14, 7 October 2015 (UTC)

Unitary Transformation (in the last time, I guess)
Is there any unitary transformation that satisfies $$\exists|z\rangle\forall|x\rangle,|y\rangle\in\{|0\rangle,|1\rangle\}\exists|z'\rangle\ T(|0xz\rangle+|1yz\rangle)=|0yz'\rangle+|1xz'\rangle$$? (i.e, it swaps $$|x\rangle$$ and $$|y\rangle$$, and writes some data, $$|z'\rangle$$, if needed). 31.154.92.179 (talk) 13:49, 7 October 2015 (UTC)
 * Oppss... Seems that it's only "Not" on the first qubit... Thanx however :) — Preceding unsigned comment added by 31.154.92.179 (talk) 19:23, 7 October 2015 (UTC)

This what I wanted to ask:
 * Is there some unitary transformation that satisfies $$\forall |a\rangle, |b\rangle, |c\rangle, |d\rangle\in \{|0\rangle,|1\rangle\}\ T(|abz\rangle+|cdz\rangle) = |adz'\rangle + |cbz'\rangle $$? (again, it swaps $$|b\rangle$$ and $$|d\rangle$$).
 * I know that no unitary transformation satisfies $$ \forall |a\rangle, |b\rangle, |c\rangle, |d\rangle\in \{|0\rangle,|1\rangle\}\ T(|ab\rangle+|cd\rangle) = |ad\rangle + |cb\rangle $$, since it's the identity on $$|ab\rangle$$ and on $$|cd\rangle$$, and non-identity on their sum - contradicting linearity. But I don't know if when we add $$|z\rangle$$ at the end, this transformation exists?132.66.201.186 (talk) 09:16, 8 October 2015 (UTC)
 * I think a similar counterargument still works when z is added: we have $$ T(2|abz\rangle) = 2|abz'_{abab}\rangle $$, so, e.g., $$ T(|01z\rangle+|10z\rangle) = |01z'_{0101}\rangle + |10z'_{1010}\rangle $$ which can't equal $$ |00z'\rangle + |11z'\rangle $$ for any $$z'$$. -- BenRG (talk) 21:29, 8 October 2015 (UTC)
 * (For the purpose of thinking intuitively about this, it may help to imagine superpositions as classical probability distributions. $$ |abz\rangle+|cdz\rangle $$ is like a probabilistic choice between $$|abz\rangle$$ and $$|cdz\rangle$$. The gate "sees" one or the other, not both. This is essentially what linearity means. The gate can't produce output that combines a (or b) with (c or) d because it can't see both of them. I don't think this qualifies as a proof but it may be helpful in understanding what unitary transformations are likely to exist.) -- BenRG (talk) 21:53, 8 October 2015 (UTC)
 * I'd tried to show that it's always the same $$|z'\rangle$$, and hadn't succeeded... Thank you for the proof and for your explanation! 31.154.92.193 (talk) 11:07, 9 October 2015 (UTC)

How to make layers translucent in GIMP?
I have a question about GIMP. I want to paste a layer on top of another layer, but I want the pasted layer to be translucent, so that the pixels in the pasted part end up being a half-and-half mix of those of the original layer and those of the pasted layer. In other words, I want the pasted layer to have a 50% opacity instead of 100%. How can I do this? J I P &#124; Talk 18:35, 7 October 2015 (UTC)


 * In the layer dockable, select the layer you want to change, and (below its mode dropdown) is a layer opacity slider. -- Finlay McWalterᚠTalk 18:53, 7 October 2015 (UTC)


 * GIMP is not always intuitive but this is might be what your after. > http://www.google.co.uk/url?q=http://www.gimp.org/tutorials/Layer_Masks/&sa=U&ved=0CBQQFjAAahUKEwiJ6O7ohbHIAhXFrD4KHdpSAHE&usg=AFQjCNHaBzSNIcTqK8OCfEVUII75okCoxQ < --Aspro (talk) 19:07, 7 October 2015 (UTC)
 * Layer masks aren't the right solution here; too complicated. Finlay is right, just adjust the opacity of the floating layer in the Layers dialog, before anchoring it. Looie496 (talk) 19:15, 7 October 2015 (UTC)


 * BTW, what you describe is 50% transparency, which is not the same as translucency. Translucent materials let the light through from behind, but blur it, as in frosted glass used in some bathroom windows for privacy. StuRat (talk) 04:18, 9 October 2015 (UTC)


 * In the right tool window, select the layer and shift its transparency bar to Your favorite value. Handling transparency inside the layer or picture, select picture, mode, RGB to skip the pictures default color palettes. This comed with GIF, TIFF PNG, and so on. JPG does not support transparency. Next, add the transparency channel. If it is not possible, select and mark a part outside the visible or needed part of the picture. In the menu choose colors, select change color to transparency, choose the favorite color You want to change to the layer below or background, select Ok. The transparency channel is added and the selected part became applied of Your settings. In the right tool window, layers can be lined up by drag and drop. An animated GIF can created by using the layers as flip book. -- Hans Haase (有问题吗) 11:36, 11 October 2015 (UTC)

HI there, I have on my macbook 2000 contacts on my iphone also, and I would like to know,
how I can sort them, that I will have shown users which have registered there number on FaceTime / apple-ID. Searching every of 2000 accounts each for each by hand is really a hard way. --Hijodetenerife (talk) 20:11, 7 October 2015 (UTC)


 * What I think OP is asking is: I have 2000 contacts. How can I sort out those who I also have FaceTime contact info for. And if I'm right, you can't.  That's according to the three iPhone users in the room with me now.  Dismas |(talk) 00:04, 8 October 2015 (UTC)
 * I agree that I don't think it's possible with the default iOS contacts management. But OP could look into other apps. Here is a suggestion, and links to a few alternatives, and I think it's likely that one of them will do what OP asks. SemanticMantis (talk) 14:43, 8 October 2015 (UTC)