How can Bitcoin transactions be traced if you can change your address?

Question: I understand in Ethereum you can trace it because wallet address never changes. But in Bitcoin you can change your address, no? Thanks.
Answer:
How can Bitcoin transactions be traced if you can change your address?

In Bitcoin you don't change your address. You create new receiving addresses.
This is normally done so that a new address is created for each new transaction with the intention to increase privacy.
However in each transaction there are inputs and outputs and if a transaction has one input and two outputs, if you can infer which output is change, you know that there is some connection between the input address and the output address. You may be able to then trace that connection further back through a series of transactions. This is approximately like tracing possession of a coin passing through a series of people or businesses in a series of transactions.
This becomes more difficult if transactions have much more than one input and much more than two outputs.
Transactions may have certain characteristics such as address-types, size, timing and so on that may make it possible to make inferences. Transactions with differing characteristics could be inferred as being different parties, those with similar characteristics might be potentially associated with a single party of interest.
For example, if you see a large transaction with hundreds of inputs and one high-value output occur every Friday at 19:00 UTC, you might suspect it was a large exchange moving funds into cold storage as part of it's regular operational procedures. The timing might suggest a specific timezone.
We know that organisations such as the FBI perform blockchain analysis to trace illegal activity. The details of their methods are not published, so far as I know.
See

https://bitcoin.stackexchange.com/search?q=blockchain+analysis which leads to
How can there exist businesses that "specialize in blockchain analysis looking for patterns of usage that reveal how money is being used"?
How can I find a digital forensics expert to help trace stolen bitcoins?
etc
Answer: Let me give you two examples:

You want to send 3BTC to address 1abc... .  Your wallet uses for this transaction input address 1def... with balance 2BTC and input address 1ghj... with balance 2 BTC. On the output side you see address 1abc... with 3 BTC and 1pqr... with 1 BTC. Then it's very likely (not sure) for third parties that 1pqr is the change address belonging to the same entity as 1def... and 1ghj. This is because otherwise one input address would have been enough to do the transaction. For your next transaction 1pqr is spend together with 1stu... as common input. Even if you didn't re-use an address it's now likely that 1def..., 1ghj..., 1pqr... and 1stu are controlled by the same person. We linked addresses although they weren't re-used.
Tracing through a mixer transaction (e.g. wasabi): You have address 3abc.. and 3def... in your wallet and both addresses are likely known belonging to the same person (derived by analytical techniques like in 1.). Now you send 3abc through a mixer and your new address is 3ghj... . If now or later 3ghj ends in the same wallet as 3def and will be co-spend together then the mixer transaction privacy is revealed for 3abc. One of my peers recently traced a wasabi transcation and was able to link 22% of the output addresses to their inputs with this method.
Comment: I like this explanation.  My question, what if the amount was emptied (0) after each use?
Comment: You mean a transaction without change address? You can do this but then you donate bitcoin if you  have not exactly the right amount to send (having the exact amount is very unlikely in an 8 digits currency). If I see this transaction I'd check if the output address is a deposit address of an exchange. Alternatively I'd assume you just consolidated or moved funds into the new address which is as well yours.
Answer: ethereum addresses are interchangeable just like bitcoin addresses, you can track bitcoin for example at blockchair.com and ethereum addresses at etherscan.io


Does texlive-full install beside texlive or over it?

Question: I installed texlive, but I changed my mind and now I would like to install texlive-full. I'm wondering if I can just install texlive-full now, and it will just skip over everything that's already installed and fill in the rest, or if that will mean I two separate versions installed, texlive and texlive-full. If it's the latter, I think it would probably be best to just start over with a clean slate, so that I don't have a bunch of unnecessary junk cluttering up my computer.
Comment: What exactly did you do when you installed texlive? It sounds like you're using Ubuntu or similar if you just installed some of their texlive Ubuntu packages, installing texlive-full will install the rest of them
Comment: list out the steps you followed for the install for a fruitful answer -- do note your dependencies will/ may change
Comment: It just add packages to the already installed. BTW, installation with Linux packages most probably will install an outdated version. To install a Full TeX Live distro, consider the vanilla installation, in /usr/local for instance. This will not replace anything, because installation and updates are beside the apt ecosystem, so before install it purge all texlive .deb packages.
Answer: Both texlive and texlive-full1 are meta-packages, which means that they don't have any files of their own and consist only of dependencies, i.e., these packages basically install the dependent packages and nothing else.
On the package details pages you can see that texlive has three packages, texlive-fonts-recommended, texlive-latex-base and texlive-latex-recommended. All three packages are also included in texlive-full, with many others. Therefore, when installing first texlive and then texlive-full, then the dependency checking for texlive-full will skip those three packages (because they are already installed) and install the others.
1The links are for the current Ubuntu LTS (20.04). This distribution contains TeX Live 2019, so two years behind the latest release (TL 2021). For normal use this is generally fine, however you might come across a new package or an answer here on TeX.SE that uses functionality which is not available in TL2019. On the other hand you will not have to deal with newly introduced errors, backwards/cross-package compatibility issues, and the need for frequent updates that vanilla users encounter (and at the point that Ubuntu starts packaging TL2021 these issues are likely to be mostly ironed out).


Poincaré Duality for non-compact manifolds without Zorn's Lemma

Question: Does exists a proof of the Poincaré Duality version for non-compact manifolds without using the Zorn's Lemma? I know that there is a proof using the Whitney embedding theorem, but I don't know this theorem's proof, so I don't know if it uses the Zorn's Lemma too.
Comment: Where is Zorn's lemma used in the proof you have in mind?
Comment: Yes, Poincare's original proof works just fine -- for manifolds with triangulations.   Technically, Whitehead's triangulations proof uses Whitney's theorem but triangulability is quite different in character.  Whitney's theorem has fairly direct proof.  I encourage you (really, everyone) to learn the proof. It is analogous to quite a few other basic theorems.  I suppose the handlebody proof of Poincare duality does not use Zorn's lemma in any heavy-handed way.
Comment: Sorry, mistake, editing.
Comment: I meant the Poincaré Duality for non-compact manifolds. The proof I read is the one from Hatcher.
Comment: Can you add the proof you're telling me to read it please?
Comment: Poincare's proof?
Comment: Yes, the original one you're making mention.
Answer: Often the definition of a manifold includes a condition to exclude strange manifolds that are "very large" such as the Prüfer surface. One condition commonly assumed is that the topology on the manifold is second countable. This is necessary for embedding the manifold in Euclidean space for example. Second countability implies that there is a countable cover by coordinate charts, and in this case the proof of Poincaré duality in my book works without Zorn's Lemma, as stated at the end of step (3) of the proof on page 248. Perhaps I should have assumed second countability and skipped the part of the proof using Zorn's Lemma, but I thought it was kind of interesting that duality holds in the more general setting if one is willing to use Zorn's Lemma. I don't know whether the general case can be proved without Zorn's Lemma (or something equivalent). As a test case one could look for a Zornless proof for the Prüfer surface. Even simpler, one could look at the disjoint union of an uncountable number of copies of Euclidean space.
Comment: I can only say that I feel honored to be answered by you, Dr. Hatcher. I will take a look about that proof for the Prüfer surface you're telling.
Answer: A slight modification of Hatchers Proof gives you what you want:
Hatcher relies on the fact that if $M$ is a union of opens totally ordered by inclusion, which satisfy PD, then $M$ does, too. It is easy to see that you can weaken that to the opens only being directed. Also, another case tells you that all finite intersections of coordinate balls satisfy PD, so all finite unions do too. Then, at the end instead of using Zorn's Lemma you only have to look at the cover of all finite unions of coordinate balls, which are obviously directed w.r.t. inclusion.


standard solution for /lib64/libc.so.6: version `GLIBC_2.14' not found

Question: I am getting this error while I am running the code in GLIBC version 2.12, which was compiled in 2.19.What is the standard solution to this problem, so that the code can run in all versions.Upgrading the target machine to 2.19 is not an option because this software is supposed to run in at least 5000 machines.Dow grading the development machine to 2.12 is also not a proper solution. Because 2.19 is just one example. The 5000 target machines can have any version.What is the standard solution for this ? Anyway of static compilation ? I mean bundling the entire GLIBC with the code .
Answer: The easiest solution is to simply create a "build server" which you use for your production builds, and keep this server on the oldest version of everything you need to support, including glibc.
This can be done using a VM inside your development server if you don't want to use a physical machine.
Comment: Or instead of a VM, just use a plain chroot or some container manager.
Comment: I am trying to do the same only.I don't know how much complicated will it be to downgrade to the oldest possible version because of dependencies.That why , I had thought about static compilation.
Comment: Don't downgrade, just install the same OS on the build server as you have in production on your oldest machine.  Then glibc and other things will automatically be an appropriate version in many cases.
Comment: @JohnZwinck what I mean is that latest OS may not support older glibc.
Comment: @BusyTraveller: If your concern is that your newest servers will fail to execute programs built against older glibc, this won't be a problem.
Answer: Bbinaries compiled against glibc should be forward-compatible; the binaries you compiled against glibc 2.19 were using an API version that appeared in 2.14. If instead you compile against 2.12 it should work at runtime with Glibc 2.19 as well.

In Python-land, they're now offering prebuilt Linux C extensions that are built on Centos 5.11 Docker images; The PEP 0513 explains details. They seems to work pretty well there. Centos 5.11 seems to have glibc 2.5; Centos 6 has glibc 2.12. I am using these prebuilt .sos on Ubuntu 14.04 and 15.10 myself without any problems.
Answer: There is also a very hackish solution, by placing the required libc.so (2.19) file in a specific directory (just copy it over), creating a runner script, where you set the LD_LIBRARY_PATH to have the specific directory and then you run the executable. The system should pick up the libc.so from the specific directory before the one provided by the system, so it should work.


Did Starkiller base have a hyperdrive? If so, what class?

Question: It has been mentioned that the first Death Star had a class 4 Hyperdrive and a class 20 backup, so it could move from system to system (so it could destroy targets.) As the weapons system of the First Order's Starkiller base is partly based off of the Death Star weapons system, does Starkiller base have a hyperdrive to move?
Comment: It would seem necessary to find another star if you wanted to fire it more than once?
Comment: @DavidW What's the need of firing more than once if there was no target left after first firing?
Answer: No, it was made stationary
Starkiller was built stationary on a planet. Also, it used hyperspace to target systems very far away, thus eliminating the need to move in order to fire. It is never mentioned that the station was moved from one location to another, but secretly built on a remote planet in unknown areas of the Galaxy.
The planet-station is mentioned as 'mobile', but only rocket ports are used for that. It is unlikely that such technology could be effectively used to move the planet across the galaxy, but rather for orbit correction and rotation (as in real life space stations), so that the firing side can be properly adjusted.
From Star Wars: Force Awakening official novelization eBook by Alan Dean Foster, Chapter X (emphasis mine)

The fleet of Star Destroyers stood off the white world. Spectacular and isolated, with a mean surface
  temperature varying from merely cold to permanently arctic, the planet had been altered: its mountains
  tunneled into, its glaciers hacked, and its valleys modified until it no longer resembled its original
  naturally eroded form. Those who had remade it had renamed it.
Starkiller Base.

Chapter XIV
Finn:

"General Hux told us it's the most powerful weapon ever built. He said that it can reach
  halfway across the galaxy." Fresh murmurs of disbelief greeted this latest assertion. "And in real time.
  Because it doesn't reach across the galaxy; it reaches through it."

From Wookieepedia article on Starkiller base: (emphasis mine)

Starkiller Base was a mobile ice planet located in the Unknown Regions that served as a stronghold of the First Order thirty years after the Battle of Endor. Commanded by an unofficial triumvirate of General Armitage Hux, Kylo Ren and Captain Phasma, it was armed with a superweapon capable of destroying entire star systems halfway across the galaxy. The First Order viewed this ability as an evolution of the planet-destroying capabilities of the Galactic Empire's Death Star designs, with the weapon serving as the ultimate culmination of Old Empire research into dark energy translations and hyperspace tunneling.

10 Facts on The Force Awakens - Empire Magazine, quoted in the article above

Fun facts that aren't revealed in the film: 1) the First Order chose this planet because of its minerals, and 2) yes, it can move, since it has rocket ports on its far side
Comment: https://scifi.stackexchange.com/a/111715/20774 - It's mobile
Comment: Note that the Wookiepedia article says it's a "**mobile** ice planet," and the footnote suggests that there's a source for that.
Comment: The whole idea of the Starkiller base was to draw energy from a star and target it via hyperspace to a remote system. Will find a supporting quote from the same book.
Comment: Interesting - do you have a source / quote on it using hyperspace to target distant systems? I wasn't aware that was possible.
Comment: @DavidW the source is unofficial and mentions "rocket ports". I think these are mainly for orbit correction and rotation, so that the fire can be directed, but not for long range space travel.
Comment: I am finding it hard to accept this answer, when in fact @Valorum has just detailed a contradiction
Comment: At the very least, nothing in the quotes presented here *preclude* the ability to move the entire base through hyperspace, only that the base doesn't *need* to do so (assuming it doesn't entirely consume the local star).
Answer: It has to have a hyperdrive or it would take years to reload a shot, if each firing of it's main weapon can destroy multiple planets and requires a whole star to be consumed for fuel, then it would need hyperspace travelling capabilities to have moved to another star. In The Force Awakens, the First Order fire an initial volley of the main weapon at the Hosnian System, this presumably used up the star they were fuelling Starkiller Base with at the start of the movie. They're going to need to move several light years to get close to another star in order for it's next shot at the Rebel Base on D'Qar to have the energy it needs.
Though during the final charging sequence at the end of TFA, we do see the sky go dark, while there is sunlight visible during the firing sequence that targeted the New Republic. The system it's located in may be a binary star system as we have seen with Tatooine and multiple real world examples. But I doubt the First Order spent decades and huge amounts of resources to refit an entire planet into a superweapon in order to just use it twice, it would have to have a hyperdrive, even a very slow one, in order to be a worthwhile investment, the only other alternative is even more absurd, which is that they somehow can move entire stars through hyperspace towards Starkiller Base, and if they had that technology, why not just use it to move the Hosnian System's Star into the New Republic planets?
Comment: do you have any canon evidenciary source for this answer, espcially considering that the question linked in this comment seems to have an official confirmation that it is indeed mobile? https://scifi.stackexchange.com/questions/111712/how-is-the-starkiller-base-supposed-to-work-more-than-one-time-given-how-it-dra/


Ring theory exercises at the graduate level

Question: Do you know any book or an online source that contains exercises on ring theory? I've solved some exercises of Lang's Algebra and Dummit & Foote's Abstract Algebra but there is a huge gap between these two. I need a graduate level problem book but not as hard as Lang. Thanks in advance.
Comment: Also, Atiyah-Macdonald... and Matsumura. But these are all commutative stuff.
Comment: This will be limited to commutative rings, but some great resources are the Commutative Algebra and Exercises chapters of http://www.math.columbia.edu/algebraic_geometry/stacks-git/browse.html (the Stacks Project)
Comment: Jacobson's *Basic Algebra II* has plenty of material.
Answer: How about Exercises in Classical Ring Theory and Exercises in Basic Ring Theory?
Comment: Also by T.Y. Lam: http://www.amazon.com/Exercises-Modules-Rings-Problem-Mathematics/dp/1441931759/ref=ntt_at_ep_dpt_5
Comment: If you have access to SpringerLink, you can download [Exercises in Classical Ring Theory](http://dx.doi.org/10.1007/b97448).
Answer: Harry C. Hutchins, Examples of Commutative Rings has many interesting examples (and/or counterexamples) which may serve as good exercises, with hints and literature references. The book was based upon Hutchins' 1978 Chicago thesis (under Kaplansky). It was apparently intended as a companion to Kap's classic textbook Commutative Rings (many references refer to Kap's book).  There is also a 3 page list of errata, updates,... dated July 1983, which is distributed with the book. Below is the AMS Math Review.
Hutchins, Harry C. 83a:13001 13-02
Examples of commutative rings.
Polygonal Publ. House, Washington, N. J., 1981. vii+167 pp. ISBN 0-936428-05-8
The book is divided into two parts: a brief sketch of commutative ring theory which includes pertinent definitions along with main results without proof (but with ample references), and Part II, the 180 examples. The examples do cover a very large range of topics. Although most of them appear elsewhere, they are enhanced by a fairly complete listing of their properties. Example 67, for instance, is M. Hochster's counterexample to the polynomial cancellation problem, and it lists a number of properties of the two rings that were not given in the original paper Proc. Amer. Math. Soc. 34 (1972), no. 1, 81 - 82; MR 45 #3394. Some of the examples appear more than once, since many rings exhibit more than one interesting property. ($\rm\:R = K[x, y, z]\:$ is used in Examples 6 and 22.) The examples are grouped into areas, but a drawback is that these have not been labeled and separated off. In addition, the Index is for Part I and definitions only, and this means that searching for a specific example with certain properties can be time consuming.
The book can be used as a supplement to one of the standard texts in commutative ring theory, and it does appear to complement the monograph by I. Kaplansky Commutative rings, Allyn and Bacon, Boston, Mass., 1970; MR 40 #7234; second edition, Univ. Chicago Press, Chicago, Ill., 1974; MR 49 #10674.
Reviewed by Jon L. Johnson
Answer: In the UK most (leading) unis provide problem sets openly.
Comment: While probably true, I don't see how this answer is very helpful to the OP.  Are you suggesting that s/he move to the UK and enroll in a (leading) university there?
Comment: ... a slightly less difficult task would be utilizing google's searching facilities  to see that for instance, you can get example sheets (a.k.a problem sets) at practically all 'leading' unis. For some reason, the unis that - while all equivalent - are looked upon as being 'average' (whatever that means) do not provide this access, instead requiring, for isntance, a username and password.


How do I create a selection rectangle?

Question: I have a basic prototype working with health, resources and units. The problem is: How do I select multiple units? I have an idea of making an rectangle which dynamically extends with the mouse position. I think I need to convert this rectangle to transparent rectangle.
Answer: pygame.draw.rect should be enough to draw transparent rectangles, according to documentation if you use width > 0, then the rectangle won't be filled.
Comment: @piyush3dxyz It's not the idea you stack up questions one after the other. Threads are just that they handle one question and if you're satisfied with the answer given you mark them so that your question is solved. As for your A* first do some own research. If you can't figure it out post a new question. Search if the question is already asked though.
Comment: thanks buddy ... Its worked perfectly......
Anyone know easy implementation of a* Algorithm in RTS....Coz unit intersect with other unit and building....I think implementing a* would we so confusing,,,,,,
Comment: ok i got it....

How do I create a selection rectangle?


Win server 2003 sp2 'local' Privilege escalation via thin client

Question: Just asking if there is any known exploit that allows a client connected a win server 2003 sp2 x64 via SunRay thin-client to infiltrate (or preform a local privilege escalation on) the server. The thin  clients currently have limited privileges, no cd/usb input and neither the server nor the clients have any internet access.
Answer: Windows Server 2003 SP2 is out of MSFT's support lifecycle.  Microsoft requires your server to be at SP3 in order to be eligible for security and other hotfixes.

Mainstream support for Win 2003 SP3 ended 7/13/2010.
Extended support ends 7/14/2015.

Your server is vulnerable all the security patches that SP3 fixed.  Of course your deployment mitigates this somewhat.
http://support.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=windows+server+2003+&Filter=FilterNO
If the SunRay thin client issues an RDP call to your server, and the ethernet cable to the thin client is disconnected and placed into a laptop (etc), then the RDP could be exploited.  There are several known issues with unpatched RDP.
There are also MITM issues with Win2003 RDP if the attacker saw an administrator log in from another machine.
Comment: Thanks for the reply. The system's 480 clients are connecting via RDP but the network is constantly monitored. My main concern is if that an attacker with access to one of the clients can take over locally without any external software or access to the boot menu.
Comment: You're asking two different questions: `Can the server be exploited?` and `Can the client take over locally?`.  The answer to both can be yes.  For example, can clients access csc.exe in the .NET framework?  If so, they can use notepad (in theory) to write a program to exploit a known vulnerability on the server.  No local "exploit" is needed.


How good is the ux of adding an extra segment control dynamically, when certain conditions are satisfied?

Question: Initially there are only 2 controls but, when there are options nearby for a user, an additional segment control pops up and displays options. How good is this ux. If this is bad, please help me with reasons.
Comment: Could you provide more details? Some mockup maybe? What you are talking about can be either beneficial or build uncertainty for the User depending on the particular case.
Comment: I mean: if properly applied, this additional control can be just contextual. Then it would be fine, maybe even the best solution to choose. But should it be unclear for the User why this control is sometimes there and sometimes not, then it can be distracting.
Answer: From what you write, I assume you want to use a segmented button control with 2 (standard case) or 3 (special case) segments. Please provide a sketch if my assumption is wrong.
I would recommend to look for alternatives, for these reasons:

People might be frustrated when they cannot easily understand why the available functions change.
Adding a segment will change the size of the segments. People who (like me) are "topological" will hit the wrong segment because they remember the position, not the label.

As for alternatives:

Always use three segments, deactivating the one which is unavailable.
You might even have it active, explaining when the function will be available.
Put the dynamic function elsewhere (you post is not specific enough for a more detailed suggestion)
Answer: Limit the number of segments to improve usability. Wider segments are easier to tap. On iPhone, a segmented control should have five or fewer segments.
See Apple's Human Interface Guideline for segmented controls for more info.

Segmented Controls
A segmented control is a linear set of two or more segments, each of
  which functions as a mutually exclusive button. Within the control,
  all segments are equal in width. Like buttons, segments can contain
  text or images. Segmented controls are often used to display different
  views. In Maps, for example, a segmented control lets you switch
  between Map, Transit, and Satellite views.
Limit the number of segments to improve usability.  Wider segments are easier to tap. On iPhone, a segmented control should have five or
  fewer segments.
Try to keep segment content size consistent.  Because all segments have equal width, it doesn't look great if content fills some segments
  but not others.


Function with continuous inverse is continuous?

Question: If function $\textbf{F}^{-1}(x)$ is an inverse of function $\textbf{F}$ and $\textbf{F}^{-1}(x)$ is continuous. Is it true that $\textbf{F}(x)$ is continuous too?
Answer: Take $f^{-1}(x) = x$ on $[0,1)$ and $f^{-1}(x) = x-1$ on $[2,3]$.
Then  $f(x) = x$ on $[0,1)$ and $f(x) = 1+x$ on $[1,2]$.
Here $f^{-1}:[0,1) \cup [2,3] \rightarrow [0,2]$ is continuous, and $f$ is discontinuous at $x=1$.
Answer: The answer is no: take $f^{-1}(x) = e^{ix}$, defined from $[0,2\pi)$ to $\mathbb{S}^1$ (the unit sphere in the plane)
This function is clearly continuous.
Unfortunately, its inverse cannot be continuous since otherwise $[0,2\pi)$ would be compact being the image of the compact set $\mathbb{S}^1$ under a continuous function.
I hope it helps, let me know if the details are clear enough :)
EDIT: something easier to check: the identity map from the reals with the lower limit topology ($\mathbb{R}_l$) to the real with the standard topology ($\mathbb{R}$) is another counterexample!
This is immediate to check since the inverse of the identity map is of course the identity map itself which now goes from $\mathbb{R}$ to $\mathbb{R}_l$. Clearly the pre image of the open set $[a,b)$ is not open!
Comment: Don't you mean [0, 2\pi) would be compact?
Comment: yeah, of course I do! :) thank you for pointing it out!
Answer: I think  the map $f:[0,1) \rightarrow S^1$ given by $x \rightarrow (\sin 2\pi x, \cos 2\pi x)$ is a counter.
For a somewhat-trivial example , take $id: (X,\text{discrete} )\rightarrow (X, \text{indiscrete})$ , for any set $X$ .
As a general result, if $f A \rightarrow B$ is a continuous bijection; $A$ is compact and $B$ is Hausdorff, then $f^{-1}$ is necessarily continuous.
For counters from a space to itself with the same topology, see:
https://mathoverflow.net/questions/30661/non-homeomorphic-spaces-that-have-continuous-bijections-between-them


How do extreme points work in Statistical Mechanics?

Question: Suppose that I have an $S,V,N$ ensemble. Every variable is a function of the other variable: $U(S,V,N)$, $S(U,V,N)$, $V(S,U,N)$ and $N(S,U,V)$. The functions are everywhere differentiable. But there should also be extreme points. Consider the maximum of $S$. Here we have
$(\frac{dS}{dU})_{V,N}=0$.
What is now the value of $(\frac{dU}{dS})_{V,N}$? I would expect by the chain rule that $1=(\frac{dS}{dU})_{V,N}\cdot (\frac{dU}{dS})_{V,N}=0\cdot (\frac{dU}{dS})_{V,N}=0$, but that is a contradiction.
What am I doing wrong?
Comment: See e.g. [here](https://en.wikipedia.org/wiki/Inverse_function_theorem#Statements). It has nothing to do with thermodynamics per se.
Comment: There might be confusion about which of them are state functions, and which are variables. Some can serve as both, but not simultaneously - the transition requires a Legendre transformations. See [Thermodynamic potential](https://en.wikipedia.org/wiki/Thermodynamic_potential). Specifically, in $S, V, N$ ensemble $S$ is not a function of state, but an independent variable.
Comment: when you have $1=(\frac{dS}{dU})_{V,N}\cdot (\frac{dU}{dS})_{V,N}=0\cdot (\frac{dU}{dS})_{V,N}=0$ it is, probably, because $(\frac{dU}{dS})_{V,N}=\infty$. And then you  are calculating the product $0 \cdot \infty $ that can be anything.
Comment: So in this ensemble, $(\frac{dS}{dU})_{V,N}$ is not defined? What would be a potential for which we can take the derivative of $S$ with respect to that potential?
Comment: Also an exercise of my physics course says: 'by now you are familiar with the formula $$dU=TdS-PdV+\mu dN.$$ Rewrite this equation to the form $dS=...$, and find expressions for $(\frac{dS}{dV})_{U,N}$ and $(\frac{dS}{dN})_{U,V}$.' How can this be possible if $S$ is not a function of state?
Comment: How can the derivative be infinity is $U$ is an actual state function?
Answer: The concepts 'entropy is maximized' and 'energy is minimized' have a different meaning than I thought. The entropy is only maximized with respect to $V,N$ but not with respect to $U$. The energy is only minimized with respect to certain variables and not with respect to $S$. The value of $(\frac{\delta U}{\delta S})_{V,N}$ equals $T$, which is positive. The value of $(\frac{\delta S}{\delta U})_{V,N}$ equals $\frac1T$, which is also positive.
Answer: I think there is a confusion about the second law of thermodynamics.
The first thing you need to do is pick an ensemble.
This means you need to pick what variables you will arbitrarily hold fixed, and which variables you allow to relax.
If you pick the $S$, $V$, $N$ ensemble, you cannot write the entropy as a function of the other variables; you already control the entropy independently!
The clearest ensemble to understand the second law is the $UVN$ ensemble.
Here, the thermodynamic potential is the entropy $S(U, V, N)$.
The entropy is not maximized with respect to $U$, $V$ or $N$. It is maximized with respect to all unconstrained variables, most of which we do not even think about when we are doing equilibrium statistical mechanics. The change of entropy when you adjust the state variables (like $U$, $V$, $N$) gives rise to thermodynamic forces, like temperature, pressure and chemical potential. You can think of the state variables as constraints you impose on the system.
Now, when you calculate $\partial S / \partial U$, you calculate the thermodynamic force that 'pulls on you' as you increase the internal energy. This is (one over) the temperature of the system:  $\partial S / \partial U = 1/T$.
Similarly, when you calculate $\partial S / \partial V = p/T$, you calculate the pressure of the system.
The second law of thermodynamics says that if you relax the constraints you put on the system a little, the system can and will go to a state of higher entropy. The derivatives of the entropy tell you how much of an entropy gain the system could achieve by working against your constraints, which corresponds to the 'force' the system exerts against you.
Regarding your question what happens at points where $\partial S / \partial U = 1/T = 0$: The inverse function rule tells you that at that point $\partial U / \partial S = (\partial S / \partial U)^{-1} = \infty$.
From a more physical perspective, this point corresponds to infinite temperature.
Comment: What would be some of those unconstrained variables?


Access particular server behind load-balanced tomcat

Question: I'm building production configuration where 2 tomcats are sitting behind the apache with load-balancer and mod_proxy. What I need is the script which checks whether particular instance of tomcat is running. The problem is I use AJP connector in tomcat. Is it possible to issue HTTP request to apache somehow that I make sure only needed instance of tomcat will respond?
Answer: Take a look at mod_proxy_balancer
But most parts of balancer are documented in mod_proxy
If you revers proxy to a balancer, the balancer will choose a backend which is available.


How to find a wep key inside a pcap file with only 2 IV?

Question: I have a pcap file that contains 3 packets. I need to find a WEP key inside these packets. These packets contains only two IV. It's not a live attack so I can't try brute force.
Comment: Are the two IVs the same? If yes, got everything you need for an attack.
Comment: Also, what does brute force have to do with it being a live attack? No one would do a brute force on any WiFi authentication live. Get a handshake, crack the password offline.
Comment: @SmokeDispenser they have different IVs. You are right it doesn't have anything to do with a live attack, thx.
Answer: In order to break WEP you need to catch 2 packets with the same key and reused IVs. The number of packets in order to break the key depends on the length of the IV, but you usually need more than one thousand.
In your case probably your 3 packets do not share the same IVs. This means that you cannot break easily the key. Your only way will be brute forcing the key and for that, you do not need any live attack.
You can use airdecap-ng for bruteforce the key.


What are some of the struggles that come with teaching formal logic?

Question: I'm currently an undergraduate student who wants to do research on the pedagogy of formal logic. As a result, I wanted to know what are some challenges that instructors (or even students for that matter) encounter when teaching introductory formal logic (propositional, first-order, modal). Proofs are the obvious answer, since natural deduction may sometimes not come across as intuitive to students, or just the abstract nature of logic in general. Some students, such as computer science, mathematics, and engineering students may find formal logic easier since it relates to some of their topics (boolean logic, for example), whereas others that aren't as logically inclined may struggle. This is what I have so far. Does anyone have any stories or other examples? Thanks!
Comment: I think this is a great question on its own, but probably not a good fit for this site. [Matheducators.stackexchange](https://matheducators.stackexchange.com/) would be a better fit, but it would still be at risk of closure due to being potentially too open-ended; I don't know the standards of that site.
Answer:
Every discipline has its own technical terms, and it is often difficult to become accustomed to the ones used in logic. Validity, entailment, interpretation, model, theory, satisfaction, are among the terms used in logic that differ from their ordinary meanings. In particular, 'valid' is one that nearly all newcomers to logic have difficulty with. People are accustomed to using it as an evaluative term meaning that an argument is good, and it takes a while to get used to using it to describe an argument in which if the premises are true the conclusion follows necessarily.

Logic over the last 120 years or so has evolved away from its traditional roots of being concerned with what distinguishes a good argument from a bad argument. Logic is mainly a formal exercise and much of what used to be considered logic is now part of epistemology. The evaluation of grounds, reasons and justification is no longer something that logicians typically concern themselves with. This distinction is something that causes confusion among students. They may have trouble accepting, for example, that an argument is not invalid because it has irrelevant premises, or premises that don't provide a reason to believe the conclusion. Or that an argument with inconsistent premises is always valid.

Some students may have difficulty with the idea that there are many logics. It is usual to teach classical logic to beginners, since it is the most commonly used logic, but there are non-classical logics. If students advance to learning modal logic they will at least have to get used to the idea that there are many distinct systems of modal logic.

The logic of conditionals tends to cause problems for beginners in logic, though this is partly because it is often badly taught. Students are introduced to material implication, because this is the simplest of all the conditionals and the only one that is a truth function, and they are often left with the misleading impression that it is the only way to represent conditionals in logic. This leads to a great deal of confusion as to why ordinary English statements using 'if' turn out incorrect if you translate them directly using material implication. The so-called paradoxes of material implication are not really paradoxes at all; they are just examples of conditionals that are not material implications.

An obvious point is that formal logic looks like mathematics, so inevitably any math-phobic students will struggle.


Google Analytics In-Page Tracking For  Clicks

Question: The in-page view in Google Analytics shows the website in an IFrame and overlays the statistics of link clicks. How is this done to track and show clicks (or entered data) for textbox ( elements)?
Answer: In order to track the use of the textbox you need to add event tracking. You can find a detailed guide here: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html.
For example, I got this snippet of code:
<code>onchange="pageTracker._trackEvent('Coupons', this.form.action, this.value);"
</code>
from here: https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/analytics/discuss-google-analytics-features-with-other-users/eLw4H2WsMDA.
Once you've set that up you can see clicks, but you can't see entered data via the overlay. To do that you'll have to look at the event reports.
Comment: If you are using the async tracking it's: `_gaq.push(['_trackEvent', 'Coupons', this.form.action, this.value]);">`


How can I easily remove caves for my mob trap?

Question: I made a mob trap recently but it did not seem efficient so I found out caves affect your mob traps but how do I get rid of the caves easily or at least stop the mobs from spawning in them.
Comment: I guess technically you could fill your cave with torches to prevent spawning in it but that sounds tedious and you're prone to miss a shaft somewhere.
Comment: The only place where traps really work is a place like skyblock
Answer: This is less of an answer (unless you'll accept "no way" as one), and more of an extended comment.
Missing a shaft or two is not a big deal. But lighting up caves for spawner efficiency is a huge work, as you need to proof all caves in 128 meter sphere around your position at killing floor. I've done it once and vowed to never again build a spawner in the ground. See: I made shafts every 20 meters in one cardinal direction, starting from a main shaft in the other direction (like a branch mine), making a circle of 140, to be sure.

That gives 280 + 280 + 280 + 260 + 240 + 220 + 180 + 100 = 1840 meters of pure mining, without spelunking, per level of which you'd want three (to cover 64 meters of depth at 20 meters between levels). Adding vertical access, some ease of navigation and diagonal shafts that you'll dig a lot of to find caves by sound we have quite above six kilometers of digging, plus cave adventures (imagine those multi-leveled jagged open caves with holes in the ceiling raining creepers!).
And the surface. You have to light up almost 20 acres of land, more than 70000 square meters - or always be sure to sleep the nigh over.
So, my advice is: make your spawner in the sky. 128 meters above surface, or 100 above ocean, and you're all set and are only dealing with its ugliness (build it away, go via portal).
Comment: This is the manual work from my answer better explained. Good answer.
Answer: If you build your spawner on the surface (rather than in the sky), you will need to find and light up all of the caves, there is no way around it.
Personally I find the "x-ray machine" to be "cheating" and instead have my own technique for finding caves. Create a grid of holes about 8 or 16 blocks apart (depending on how accurate you want to be). These holes should be dug from the surface to the bottom of the map (or at least until you reach the infamous "lava layer"). The added bonus with this technique is these holes to the surface will also prevent any void fog at the bottom of your world.

If you use this technique, to be on the safe side, put everything except the necessities (torches for if you find caves, and tools needed to dig: pickaxe, shovel, sword; all of which can be of stone or iron) in a chest so as to not lose it if you fall into a pool of lava or appear in a dangerous area.
Comment: Oh... I sometimes forget you can play not on Hardcore B-)
Answer: To prevent spawning in caves, you need to fill them in, light them up or flood them with water (or lava). There are a few ways to do it.

Manual work
World editing mods (such as WorldEdit)
External world editing tools (such as MCEdit)

Manual work is the hardest option, but doesn't have side-effects: while mods and editors are much easier, they will restrict your exploration of the caves if you choose to fill them up and sometimes they might even corrupt your save, which is why it is highly recommended to take backups before using them.
Answer: If you build your spawner on the surface (rather than in the sky), you will need to find and light up all of the caves, there is no way around it. In order to assist in finding caves, it is very common for some users to make an "x-ray machine". This technique is described in the second half of the following video:

The X-Ray device works like this
xPGSx  P=Player         S=Piston
xPxxx  G=Glowstone
xxxxx  x=solid block (Dirt etc)

Activate the piston and it pushes the glowstone the player's head. If it were a solid block, you would suffocate. In the video, he does not suffocate. Since Glowstone is not visually transparent, it allows you to see through any wall directly in contact with the glowstone that was just pushed over your head by the piston. I'll leave it to you to figure out how to activate the piston. This requires no mods or 'cheats', but rather, it exploits the design of the 3D graphics environment, which some may consider cheating.
This edit contributed by musicwithoutpaper without permission, just in case the YouTube video gets removed.

Although he uses the machine to find pools of water, it can just as easily be used to find caves.
Comment: I think this glitch was fixed in 1.8
Answer: You could use a single command to fill everything in - the only requirement is being an op or having cheats enabled in single player. It's super efficient and a lot easier than having to create a sky mob trap or manually fill in all caves.
/fill 0 64 0 200 5 200 1
The first three numbers are the starting coordinates, the next three numbers are the ending coordinates, and the last number is the block ID you want to fill it with. If you used this exact command, you would replace every single block from x:0 z:0 to x:200 z:200 with stone, covering from about sea level (y:64) to a few blocks above bedrock (y:5). You would want to center your mob trap at x:100 z:100.
You can adjust coordinates accordingly depending on where you want to build your mob trap.


What to look for in the ARM64 assembly of a Golang binary to find the list of kill signals that affect the binary execution?

Question: I'm reverse engineering an ARM64 Golang binary built with musl and I've already detected kill -10,12,15 pid as the signals which interact with it, where 10 and 12 represent user-defined signals. I think there must be other signals as well and I wish to detect them. In particular, may there be other user-defined signals or only 2 SIGUSRs are available no matter what? Since signals are being sent to the binary during runtime I wanted to know if there are signature functions in Golang's runtime that may be imported in the binary and represent signal handling functionalities in the binary.
Answer: Traditionally only two signals are reserved for users - SIGUSR1 and SIGUSR2. But there are possibilities for others as well as mentioned here.
I would check if the signals SIGUSR1 and SIGUSR2 does anything besides the obvious, like maybe call other subroutines.


Why I recently lost lot of reputation?

Question:
Recently, I got lots of negative reputation. Why? I guess, I earned all those reputation by accepting answer. But, some answers were written by me. Although, I lost reputation. But, I didn't get reputation for accepting that as answer.
Comment: [Screenshot](https://i.stack.imgur.com/vorWH.png) of the above. It correlates with your recent two negatively voted questions. To help avoid this in the first place, you could try be a little more cordial than "Don't suggest to solve the problem any other way", "Can't you see what I asked?", "Sorry! What the hell is it $\Re$?" (although, this isn't a guarantee anyway)
Comment: See: [When are serial downvotes classified as anomalous? What to do about a sequence of downvotes?](https://math.meta.stackexchange.com/q/3068) (There is also an older post - which might be cute if you are fan of puns, but the title makes it more difficult to find: [Cereal downvotes](https://math.meta.stackexchange.com/q/9179).)
Comment: It may be possible that someone is deliberately downvoting you since it is not possible to get so many downvotes in a matter of minutes, perhaps system will reverse these downvotes tomorrow.
Comment: Accept an answer if it helped you or was useful, not to earn +2 points.
Comment: According to the [reputation section of your profile](https://math.stackexchange.com/users/876873/istiak?tab=reputation), these are all downvotes. The links provided by Martin Sleziak should cover what to do.
Comment: The downvotes have now been [automatically removed](https://i.stack.imgur.com/76CWe.png).
Answer: You need not to worry about this. Someone who has deliberately downvoted most of your posts but you need not worry. This is serial voting and your reputation will be restored to you by 5 am UTC. If the 24 hours have already passed and the suspicious votes have not been reversed, you can then flag one of your own posts for "in need of moderator intervention" and explain in detail what happened. Also you can go to the bottom and click on contact (or in case you can't find it here is the link. Just explain them if within 24 hours your rep hasn't been restored and you feel someone is deliberately doing it. You will then soon receive information in your gmail from them within 24 hours.
To get more details about serial voting, what I need to do etc click on this link
Comment: @Istiak It is most often the case that moderator action is best initiated by *flagging*. That is the way it is meant to go.
Comment: I don't care of reputation. The problem is actually "moderator should do something against this type of things".
Comment: @Istiak don't worry [this user](https://math.stackexchange.com/users/-1/community) handles all the things and for mod attention you should flag one flag for mod attention as mod have 100s of work. Btw I am not able aware of which work :)

Why I recently lost lot of reputation?


Gears randomly switching

Question: So I have a Trek Fuel SLR 90 and whenever I ride on flat dirt roads, the back gears randomly keep switching on me. It gets really annoying to ride Please help
Comment: Welcome to bicycles.SX! To be able to help you, we might need some more information. Things like: how old is the bike? How many kilometers have you ridden it already? Was this random switching suddenly there, did it develop slowly over time, or was it always there since you have the bike? Does it happen at special occasions (e.g. when riding over some bump)? You may also want to have a look at our [help pages](https://bicycles.stackexchange.com/help) and take [the tour](https://bicycles.stackexchange.com/tour) to learn more about how good Q&A should look like.
Comment: Also, how is it "randomly switching"? Is it always going up or down or what? The first thing to check in all shifting problems in the back is if the rear derailleur is bent, though (especially if you've crashed recently).
Comment: I bought the bike from some friends recently and it is at least 10 years old so I don't know how much it has been ridden. Also I recently got the bike checked out at a shape and everything is still in great condition. The random switching has always been there only on super flat dirt paths. Otherwise it never happens. The rear gear shifts up and down on its own without using the shifting triggers. If I'm on any other type of terrain, the shifting works exactly how it should
Comment: I'll only add that a 10 year old rear mech is probably at (or past) end of life.
Comment: @DavidE, thanks for the comment with the additional info, but please edit the question to include this info.  People will see it sooner and it is more durable than the comments.
Comment: @GrimmTheOpiner - What?? Derailers can last much longer than that, if maintained reasonably well.
Comment: What you have is "creep".  On any sort of rough surface the vibration prevents it, but smooth surfaces it occurs.  Plus you pedal more consistently on smooth.  Hard to say the precise cause, but my guess is it's a combo of frame flex and your shifter cable setup.
Answer: If its just up and down one gear then you probably need to calibrate the derailleur cage a little using the barrel adjusters. Depending on the make of shifter and derailleur there will be a barrel adjuster on one or both ends of the cable outer which will allow you to make micro-adjustments to the cage position.
The jockey wheel centre should be roughly aligned with the center of the cassette cog. What you might find is that the jockey wheel is slightly left or right of the cog at a given shift position (the one that is jumping) so use the barrel adjuster to eyeball the wheel to line up with the cog. It shouldn't take more than a few turns to do this.
Also if the barrel adjuster is fully extended or screwed in, you may have to release the cable at the derailleur end and move it in/out to give you some adjustment room before reattaching the cable.
On the other hand if you are getting more than one shift up or down something is seriously wrong and you may have to replace parts.
Answer: Could be a lot of things.  I had an Ultegra in good shape that was jumping around.  It was two problems.  1) The cable was a bit frawed at the shifter.  2) I did not have the cassette tight enough - torque to specification.

Gears randomly switching


How to mute notification sounds during a call on Samsung Galaxy 6 Edge?

Question: While on a call, if I receive a text message, the notification sound for text message plays during the call. How do I mute the notification sounds for text messages while I'm on a phone call? My device is Samsung Galaxy 6 Edge.
Answer: This action in the Samsung Galaxy is controlled by the setting 'Alerts on call'.
It is set from within the default Phone app. After you have opened the Dialer, open Call Settings > Call Alerts > Alerts on call.
Deselect this setting to turn it off.


Basic FX-Forwards trading Guide

Question: What fundamentals or other factors should one follow to trade currency Forwards intraday?
Answer: Basically trading a forward contract is like trading the underlying currencies, you just have to factor in the foreign and domestic interest rates. For example, say you are trading a EURUSD forward. You just add the cost of carry (CoC) for that maturity to the current spot rate and you have the forward rate (you can find the cost of carry formula in like 2 seconds on the internet). What you would see from the CoC formula is that if EURUSD rises, the forward rises, if USD rates rise (all else being equal) the value of your forward rises and if EUR rates rise (all else being equal) the value of your forward will fall.

Basic FX-Forwards trading Guide


Making WSO2 ESB Version 4.5.1 ready for production environment

Question: I would like to know is the WSO2 ESB Version 4.5.1 installation out of the box production ready in terms of configuration, If no, can someone give me some hints, would like to know what to turn off in a production environment.
Answer: All the WSO2 products are production compatible out-of-the-box in general. But if you are using with distributed setup you may need to setup server in clusters with backend-frontend separation. And also you may need to use WSO2 Elastic Load Balancer. And the default embedded H2 database will not be efficient and you may need to change to MySQL.
Anyway if you are using a small setup in production all of them may not needed.


Unit stuck, can't do anything but delete it

Question: The weird thing is, that I can't even choose to "do nothing"!
I can only Gift it, delete it or start a war. Why don't I have the "do nothing" option?
Comment: Hard to see, but its because it ended up on the same tile as another unit that it didn't know had existed when it started its move, and due to 1UPT, it has to move. Really annoying when that happens, and nothing you can do about it except to get rid of it.
Comment: Isn't "space" the key for passing a unit's turn?  Or you could try "H" for holding position.
Comment: Damn, stupid AI that got there in the first place. Thanks anyway
Comment: @Affine You should make that an answer so that it can be voted on.
Answer: As you can see above the mini-map in the lower right-hand corner, your unit is stacked with another unit and cannot remain in that tile. However, the Galleass cannot enter ocean tiles, but that's the only tile within one move of its current position, and it only has one movement point left this turn.
In short, you're stuck and must either delete or gift the unit or declare war on La Venta. I'm really curious what would happen if you DoW since you cannot remain on the same tile as the other unit.
Comment: @user52549 Declare a War?
Comment: Yes, DoW means Declaration of War and is often used as a verb on Civ forums.
Answer: This is strange. It appears that because of your lack of mobility and because you can't seem to toggle the "Do Nothing" button I would assume that (it has happened rarely) that your unit has moved on top of another unit that wasn't shown at the beginning of your turn. Only way to fix it is to wait until the other player moves their unit.
Comment: He can't wait until the other player moves their unit; that would require ending his turn, but the game is very strict about not letting a player end turn while one of their units is stacked with something else.


Ubuntu 14.04 VM kernel panics once every ~5-9 days on Hyper-V

Question: I have an x64 Ubuntu 14.04.3 LTS virtual machine running the hardware monitoring and status software Nagios. The VM seems to be kernel panicking once every 5-9 days. I am unable to pin down the cause.
I am currently the only person that uses Nagios on this machine. When it kernel panics, it's not being used by anybody (and to my knowledge, not doing much else besides receiving monitoring updates from other computers). Additionally, the VM is only available on the local network, and I've regularly kept everything up-to-date using apt-get update and apt-get upgrade.
The link below shows two images showing the screen when the VM kernel panics. Every kernel panic seems to be a slight variation of one of these two images:
https://i.stack.imgur.com/4CrDD.png
The VM runs on Hyper-V on a computer with Windows Server 2012 Standard installed. However, the server runs 6 other VMs without incident (including Ubuntu 12.04 and CentOS 6 VMs).
Is it possible that Hyper-V integration services or drivers are at fault? I keep seeing hv_storvsc and references to Hyper-V in the kernel panics and am wondering if the Hyper-V drivers in 14.04 are subpar or have known issues.
The VM has been in operation for about 1.5 years, but these problems have only started surfacing a few months ago, if I recall correctly.
Additional information about the virtual machine:

1 virtual processor assigned
1024MB RAM
Hard drive on IDE Controller 0
Virtual hard disk resides on the server's C:\ drive
All integration services are enabled for the VM, including: operating system shutdown, time synchronization, data exchange, heartbeat, backup (volume snapshot)
Replication is enabled to a server in the same rack with identical hardware

Additional information about the host server that runs Hyper-V:

Powershell script runs every night that runs Windows Backup on all VMs to a local external hard drive
Motherboard: http://www.newegg.com/Product/Product.aspx?Item=N82E16813128577
CPU: AMD A8-5600K quad-core 3.6GHz CPU
RAM: 32GB (4x 8GB) CORSAIR Vengeance DDR3 1866
All RAM has been tested thoroughly with memtest86+
System has been stress tested with Prime95
System has been in operation for about 2.5 years
2x 1TB HDs set up in RAID1 using the motherboard's onboard RAID controller
Raid software has not given any indication of problems with the array

Any help would be appreciated. I've been Googling around for days and haven't come up with any reasonable theories. Thanks!
Answer: I made this experience with some specific kernel version. Upgrading to newer kernel version or going back to older kernel version fixed it for me.
Comment: This is a vague answer.  It would be helpful to the person who asked if you could supply a short procedure on how to accomplish this.


Do accidentals apply to notes in the same measure but in different octaves?

Question: In a work by Leonarda (1693) I find that there are octave leaps at a cadence with an accidental sharp on the first note but no explicit accidental on the lower note.  Surely the lower note should also be sharpened but this wouldn't appear to be the case in modern scores. Comments?
Comment: This question has been asked (several times) before. Please use the Search function in the top left hand corner of screen before posting questions.
Answer: In answer to the question -'Do they?' it's no. Not currently, nor for two or three centuries. However, back in the day, over three hundred years ago, things were still being formulated, and I guess composers weren't as vigilant as they could have been. Maybe Leonarda realised that anyone worth his salt would know by listening whether the octave note should be an exact octave or not.


How to show answer from yes/no item

Question: I have a uniform order form where at the summary total i want to show if embroidery was selected for that particular item. Currently Embroidery is a yes/no radio button and I just want it to show up in the payment summary as Embroidery: Yes or No depending on what was selected in the form. How do I go about showing the "Yes" or "No" answer?
Answer: You can use the Price field in Cognito Forms to have complete control over the appearance of line items that appear in the payment summary.  You can specify the following for each Price field:

Amount: The amount of the line item, which can be negative and includes support for constant values or calculations.  You can also hide Price fields and only have the amount appear in the payment summary.
Name: The name of the line item, like "Embroidery" in your case.  This can also be a calculation.
Description: The description or detail of the line item, like "Yes" or "No" in your case.  You could use a calculation like:
=if Embroidery then "Yes" else "No"

How to show answer from yes/no item


Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?

Question: Historically, processors often increase in bit-size by powers of 2, such as 8-bit, then 16-bit, 32-bit, 64-bit. Although this has not always been the case, it is a well known trend. One benefit is backwards compatibility. Another is that components can be scaled by combining two 8-bit components into a 16-bit, and so on, such as two 8-bit shift registers. I have also heard that some types of mathematical algorithms benefit from using powers of 2 bit sizes, but I cannot find anything about it, nor think of any. Is anyone here aware of any such algorithms, or such an argument for "powers of 2 bit sizes" in general?
Comment: See also [Why are word sizes in modern CPU's a power of 2?](https://cs.stackexchange.com/q/100501/14663) And on [retrocomputing.SE]: [Why are computer bus sizes integer multiples of the size of a byte, and when was that standardized?](https://retrocomputing.stackexchange.com/q/25146/28050), on [SU]: [Why are RAM module capacities in powers of two](https://superuser.com/q/235030/175275) and [Why are most of the common processors' bit counts powers of 2?](https://superuser.com/q/1735122/175275)
Comment: arguably most 64-bit computers are 40ish bit hybrids in the sense that physical addresses are limited to less than 64 bits
Comment: You seem to be referring to the data bus size; typically corresponding (in C) with the size of an int. Instead of "bit-size" you could use "bus-size", or else use (bus)"size-in-bits". The "size of a bit" doesn't make much sense .
Comment: @CarloWood well, data bus, size of registers, size of operations, size of words in memory, and similar things. seems like bit-size as "number of bits" made enough sense to generate a few answers and upvotes. peace!
Comment: If you have only two fingers, you count intuitively in powers of 2 ;-).
Comment: @BipedalJoe Sure, people are helpful enough to make the translation; most people can read typonese too. That doesn't mean you can't learn someone new and should be stuck with the typo the rest of your life.
Comment: @carlowood feel free to live your life and learn what you want and be stuck with what you want and anyone else can decide in theirs. peace!
Answer: Multiplying and dividing binary integers by powers of 2 is very cheap, like multiplying and dividing by 10 for decimal numbers.
It's qualitatively different from other factors because the other bits don't change, you just move digits left or right (shifting).  In hardware for fixed shift counts, it's literally just wiring.
As I mentioned below, array indexing like arr[i] with an index that counts in elements will involve (in hardware or software) scaling by the element size, if memory is byte addressable.  (If it's not in a loop, it can't be optimized to a pointer increment).  IDK if you'd call this an "algorithm", though.

https://superuser.com/questions/1735122/why-are-most-of-the-common-processors-bit-counts-powers-of-2/1735399#1735399 and other answers discuss some of the engineering problems you'd have with e.g. 24-bit words on a byte-addressable machine.  (24-bit DSPs use word-addressable memory) - some 3-byte words will span wider boundaries, differing in higher bits of the address.  But CPU caches and memory systems really want to group binary addresses by ignoring some low bits, not by doing a full division.
In algorithm terms, this is optimization of i / sizeof(int) into a right shift for unsigned i, and i * sizeof(int) into a left shift.
Another algorithm where this is relevant is a bit-array: given an integer bit-index, you need to break that up into a byte index or word index, and a bit number within the byte (to use as a shift count).
#include <limits>
int get_bit(unsigned int *bit_array, size_t n)
{
    size_t element_idx = n / std::numeric_limits<unsigned int>::digits;
    int bit_idx = n % std::numeric_limits<unsigned int>::digits;
    unsigned chunk = bit_array[element_idx];
    return  (chunk >> bit_idx) & 1;
}

When numeric_limits<unsigned int>::digits is a power of 2, like 32 on typical C++ implementations, this unsigned division and remainder become simple right-shift and bitwise AND, like n >> 5 and n & 31.
This wouldn't be the case for 24-bit unsigned int, for example, unless you choose to only use 16 of the 24 bits per unsigned int.  Division by a constant 24 or 3 is not very expensive if you have a fast multiplier, but it's  non-trivial.
In hardware it's even more significant: splitting a value into multiple fields is literally just wiring.  But for n%24, the remainder depends on all 24 bits, not just the low 5 bits, as well as requiring some significant computation.

std::vector's .size() member function, and indexing
Another more widely used data structure that benefits from it being very cheap to convert between element index and addresses is C++'s std::vector<T>, a dynamic array that knows its size and can reallocate when push_back exceeds the current capacity.  Typical implementations have 3 pointer members, perhaps named T *m_begin, m_end, and m_capacity.
The API includes .begin() and .data() which are trivial, just return the the start pointer.  Similarly .end() can just return the end pointer.  (C++ library functions that loop over a range take a start and end pointer, rather than a pointer + length).   .push_back can increment m_end += sizeof(T) and check m_end < m_capacity is still true.  (The size in bytes to pass to allocator functions can be obtained by casting to char* before subtracting.)  None of that benefits from sizeof(T) being a power of 2, which is good for use-cases with T = an odd sized struct.
But std::vector also has a .size() API, typically implemented as return end - begin;.  In C++, subtracting pointers returns the distance in elements, not bytes, so in asm it typically looks like sub r0, r1 / sra r0, 2 or something to arithmetic right shift the subtraction result to scale by sizeof(T).  If sizeof(T) isn't a power of 2, a right shift won't work for this division.  (It is at least a compile-time constant so a multiply and shift can do the trick.)
It's not rare for code to do for (size_t i = 0 ; i < vec.size() ; i++) do stuff with vec[i], or to use .size() for other things.  Compilers might transform this loop into a pointer increment, avoiding the division by sizeof(vec[0]), but some uses of .size() won't optimize away.
A non-power-of-2 sizeof(T) for common primitive types like int and int * would make some uses of vectors of those types less efficient.  (But implementations would probably keep the 3-pointer design, rather than needing to multiply by sizeof(T) more often with one pointer and size_t length, capacity.
It would also mean alignof(int) had to be 1, unless an implementation padded 3-byte int to a larger size.  Unless you redefine alignment to mean multiple-of-3 instead of multiple-of-2.
Also, array indexing by an integer is normally just a left-shift to multiply by sizeof(T) to get a byte offset.
Perhaps such a machine would include scaled-index addressing modes so asm that could scale by 3 and 6, with a shift+add like i + (i<<1) instead of just a shift.  For example current x86-64 can do mov eax, [rdi + rcx*4].  (The asm syntax is a multiply, but the only valid multipliers are 1, 2, 4, and 8; the machine code uses a 2-bit shift count.)  So a 24-bit machine might allow [rx + ry * 3] or *6 or *12.  Otherwise software would need to do more operations to generate addresses.
Many RISCs like MIPS and RISC-V only have 1-register addressing modes so scaling needs software, but maybe they'd provide a single instruction scale-by-3 for address-generation.  (Maybe also including a shift count to scale by 6 or 12 or whatever.)  3 only has two set bits, so a fixed shift (trivial in hardware) and an adder will do the trick.
Dividing by 3 is expensive, though.
If the caches on a byte-addressable machine with odd-sized words was still sized to a power-of-2 number of bytes, it could work a lot like a modern x86 which allows efficient unaligned loads/stores, with fairly efficient handling of cases where a load spans the boundary between two cache lines or even pages.  Addresses break into offset-within-cache-line vs. index vs. tag by treating the binary address as separate fields.
If cache line sizes were a multiple of 3, like 48 bytes, none of the int in an array will span a cache-line boundary.  (As long as the start of the array is "aligned" to a multiple-of-3 address!)  But if addresses are still binary numbers, cache indexing is no longer simple.  index = (address / 48) % num_sets, and tag = (address / 48) / num_sets.  (Assuming for simplicity physical index and tagging.)  Paging has a similar problem, power of 2 page size vs. multiple of 3.
(This is the same problem as for a bit-array where the unsigned int chunks aren't a power-of-2 size.)
Answer: On top of what everyone else has said, bit shift circuits are easier to design if the "shift amount" is a whole number of bits in size.
Comment: Not necessarily. You can just cut off the circuitry for the extra bits.
Comment: What do you mean by "shift in zeroes"? If you have 48 bit numbers you need a circuit for 48 bits, not 64.
Comment: I worded that badly, sorry. My point is that if you have 48 bit words, you need 6 bits to represent the "shift amount", and you still ned 6 stages in a barrel shifter, but you're not really "using" all of those 6 bits. There is precedent, of course, because FPUs often shift by amounts that are not $2^{2^k}$.
Comment: Yes, you can always shift-in zeroes (or the high bit if it's an arithmetic shift), but it's an inefficient use of circuitry.
Comment: Well, with 48 bit words we wouldn't have the very unsatisfactory situation that a shift by the number of bits in a word is undefined behaviour.
Comment: @gnasher729 It's only undefined behaviour in the instruction. Programming languages are allowed to define whatever behaviour they want (and thanks to conditional move, it's even pretty efficient).
Answer: The fast Fourier transform and its relatives, such as the discrete Fourier transform used in JPEG compression, work best with data sizes that are powers of two. So, if you were to implement the FFT on, say, a DEC PDP-10, with its 9-bit bytes and 36-bit words, you'd have to "waste" 11% of the bits available (and you might also run into some difficulties with masking the unused bits, etc.--it's been a very long time since I programmed a PDP-10, so I don't remember the specifics).
Comment: Unless you do a FFT on an array of bits (bit wise) , this is a non-argument. Most FFTs are run on integers of the corresponding platforms. There are some applicaitons for bit-wise FFT but i dont think that JPEG compression is one of these.
Comment: And if everyone used nine bit bytes, JPEG would operate on nine bit bytes and an architecture with 8 bit bytes would look completely unreasonable.
Answer: It's beneficial if you can combine smaller units into a larger unit. Imagine you had 12 bit and 20 bit numbers. 20 bits could hold one 12 bit number and waste 8 bit. 24 bits could hold one twenty bit number and waste four bit. You'd need to go up to 60 bits to hold 5x12 or 3x20 bits.
You wouldn't have that problem with 8, 24, 48 and 96 bit numbers. But then calculating the address of item #n is slightly more complicated.
Having 12 bit bytes and 12, 24, 48 and 96 bits would actually be quite good. UTF-12 would store all characters in two units. 48 bit floating point would very often be enough, and 96 bit would have lots of extra precision.
The only slight disadvantage is storing bit arrays because you often divide a bit number by the byte size or word size in bits, and typical hardware can divide by a constant power of two faster. On the other hand I would expect this hardware to have a fast "divide by 96 / modulo 96" instruction.
Comment: Right but that benefit of combining smaller units into larger, seems like it has to do with the backwards (and forwards...) compatibility I mentioned, rather than working within a certain processor. What I'm fishing for is the third benefit case, which I heard mentioned was certain mathematical algorithms, but I cannot find anything about which ones.
Comment: I very much doubt that any mathematical algorithms have affected hardware designs.
Comment: Well that could be an answer then to the question of math benefits to CPU that increases by powers of 2. I think I was asking more broadly about what math benefits from that, and Steve-OH pointed out that Fast Fourier Transform actually does, but that it hasn't been an important factor in CPUs could very well be true. It was a factor I did not know enough about myself, whereas I can understand all the other arguments like backwards/forwards compatibility.
Answer: On the level of assembly code, having $2^k$ bits in a word is convenient for bit operations. The result is that if you have an assembly command like "set bit $i$ of register $r$", then $k$ bits of the opcode will be devoted to specifying $i$. If the number of bits is not a power of $2$, then either some opcodes are wasted, or else the processor has a slightly harder time interpreting the opcodes.
If I wanted to make a case $2^n$-bit words based on mathematical algorithms, though, I'd bring up Hadamard codes. For all $k$, this is an error-correcting code that takes a $k$-bit input and encodes it as a $2^k$-bit codeword, with the property that any two codewords differ in at least $2^{k-1}$ bits. So, for example, we could take $6$-bit inputs and encode them as $64$-bit outputs; we get a rather inefficient but very error-resilient code in this way. The dual of a Hadamard code is a Hamming code, which also benefits from numbering the bits in a codeword in binary.
Finally, here's a very niche benefit: chess engines use bitboards to represent game state, which encodes a binary property like "which squares of the chessboard contain white pawns?" in a $64$-bit vector.
Answer: I think the story may be more complicated than some other answers suggest, even if they contain a lot of good arguments.
I add some observations:

systems with 12,18,24,36 and other bit sizes exist

Nibbles are the minimum needed for BCD arithmetic. it may sound like a distant memory from the past, but doing BCD arithmetic really simplifies building calculators and other hardware constrained machines, so using a multiple of a nibble was an efficient choice

Many processor series first (or as a cheaper version -> 8088) had an ALU being able to operate on the double size internally, and then got an external bus later (68000 was 16 bit data bus and had some 32 bit registers/arithmetic, 6809 hast 16 bit arithmetic with an 8 bit data bus, Z80 had some 16 bit registers/operations, 8088 was 8 bit data bus but had 16 bit registers)

The latter point is IMHO mainly responsible related to economics of designing computers:

Having internal register sizes multiples  the data bus means that you can use these registers as fast internal memory for applications requiring the lower bit number and not waste transfers.
having these at a low multiple means that your processing is not out-pacing your RAM access (it does not make sense to waste space for an ALU processing the data faster than you can fetch them)
having versions of your processor data bus at the register and half the size is good - it doesn't make sense to have a 1.5 times wide version

All in all this means that if you run 8 bit SW on a 16 bit data bus, you may have some wasted space, but not as mus as if you had 24 bits.
So i think doubling the bus/register width is the cheapest upgrade path for compatible designs.
Answer: General Situation
Since computers use a binary system to represent data, a heavy use of powers of 2 results in easier optimizations in general.
The key reason for this is that when you multiply by 2 (0b10[1] in binary), all you need to do is shift the bits in the number. For example, 3 is 0b011 and 6 is 0b110. Multiplication in binary is a vastly more complex operation, where-as shifting is a simpler one.
Word-Size in Hardware
As you mentioned, there are many answers describing the hardware reasons. I'd like to call out specifically that the hardware reasons are mostly about alignment to known data-type sizes.
Word-size specifically benefits from having all data sizes as factors. This means all of the following need to divide into word size:

1-bit (bool)
8-bit (char/byte)
32-bit (float/int), and
64-bit (double/long)

So, in general all of today's chips will use multiples of 64. There have been several pieces of hardware that deviate from powers of 2. As you mentioned, this comes with costs for hardware design every time you choose a new bit-size. So, going from one bit size to another will require all new circuits for many operations unless you always align to data-type sizes.
Word-Size in Software
All algorithms are using optimization that depend on hardware configurations. Hardware is the "reality of compute". So, we'll look at some reasons that span the hardware/software boundary. In these situations, there's a hardware design issue that makes either the software more complicated to optimize OR requires more customized hardware to equal the performance of a similar system that uses a power-of-2 bit size.
Data Spanning Words is costly
Now, imagine you're storing bytes (8-bits) in a CPU that uses a non-power-of-2 word-size. In this case, you would have to pack your bytes such that they span across multiple words. In a 36 bit system, you'd span 9 bytes over 2 words, with the 5th byte split over the last for bits of word 1 and the first 4 bits of word 2.
For the visually inclined:
   WORD 1    |   WORD 2
vvvvvvvvvvvvv|vvvvvvvvvvvvv
11 22 33 44 5|5 66 77 88 99
            ^ ^
           BYTE 5

This means that to get the 5th byte, you need to retrieve from both words and combine the data to create a byte. This results in less optimal access to any data that spans multiple words in memory. This results in loading more data into all caches and then into CPU registers, reducing the performance of all programs that use arrays like this one.
SIMD is more costly
CPUs also provide instructions that operate on multiple data in a single register. Consider a CPU today that has a 128 bit architecture. It supports instructions that allow you to operate on multiple data being stuffed into these bits. In this case, it can operate on 4 32-bit ints or floats simultaneously.
Now, if we had non-power-of-2 bits, this would be an inefficient use of the word.
Instead of using the word inefficiently, if we decided to pack as described in the previous point, the hardware would require further complexity to perform SIMD operations with different configurations. For example, with the setup described above (36-bit system), we'd need to have a circuit that supports both word configurations. With other bit-counts, it could be even more complex. 2 word configurations is the best we can do when we deviate from powers of 2.
Counting Data and Pointers
When data neatly packs into words, counting data and pointer-math become easy. It also means that you can (without knowing the index of data), have the same unpack logic for packed data. The reason why this is important is having a for loop like this would make branch prediction harder. Based on the 36-bit example above:
for (i in indices) {
  if (i % 2 == 0) {
    // unpack logic
  } else {
    // different unpack logic
  }
}

Conclusion
It's all about the hardware. Optimizing software is about learning your hardware and writing your software accordingly.
[1] 0bxx is a notation used in some languages to represent binary numbers. So, 0b01 == 1, 0b10 == 2, and so on. I am often trimming the leading 0s so that I don't have to write a full byte/word/etc of bits.
[2] CPUs don't execute exactly 1 instruction per clock cycle. Modern CPUs execute instructions in phases. The phases enable higher instruction throughput. CPU features like branch prediction can speculatively execute later instructions assuming your branch will take a particular path.
Comment: With a *non-power-of-2 word-size*, why would *byte*s be 8 bits?


How do I update a subset of values in DB2 based on related tables?

Question: I am trying to remove the last 10 characters from a CLOB field in a DB2 database. I can do so using:
UPDATE  report
SET     comment = LEFT(comment, (LENGTH(comment) - 10))

However, I want to limit the truncation to a subset of the rows based on whether or not the report is in the current reporting period. I tried this...
UPDATE  report
SET     comment =
        (   SELECT  LEFT(comment, (LENGTH(comment) - 10))
            FROM    report

                    INNER JOIN report_period
                    ON report.report_period_id = report_period.report_period_id

            WHERE   report_period.name = '2013 Interim Report'  )

...but I get
The result of a scalar fullselect, SELECT INTO statement, or
VALUES INTO statement is more than one row

What am I doing wrong?
Answer: Never mind... asking the question helped clear it up in my head. Just had to move the join to the WHERE clause....
UPDATE  report
SET     comment = LEFT(comment, (LENGTH(comment) - 10))
WHERE   report_id IN
        (   SELECT  report_id
            FROM    report

                    INNER JOIN report_period
                    ON report.report_period_id = report_period.report_period_id

            WHERE   report_period.name = '2013 Interim Report'  )


Coupon Collection Random Sum

Question: I have a problem which involves the standard coupon collector's problem to find a probability density from the generating convolution. I start by defining the problem and a few basic statistics. Let the number of unique coupons be $N$, numbered from $1$ to $N$. Our goal is to collect each unique coupon at least once.

I want to find the probability distribution of $$T=\sum\limits_{i=1}^R X_i$$ where

$X_i$ is the number of the coupon in the $i$-th draw
$R$ is the number of draws until all coupons are collected at least once.

Define $R$ to be the number of draws until we collect at least 1 of each unique coupon. This is itself a sum of N independent Geometric random variables $Z_i$, with $R=\sum\limits_{i=1}^N Z_i$.
By inclusion-exclusion principles and a little algebra, it is trivial to show $R$ has a probability distribution: $$\mathbb P(R=r)= \frac{N!}{N^r} \times {r-1 \brace N-1}. \quad R\ge N$$
Since $R$ is a sum of independent geometric random variables, it can be shown the probability generating function $g_R(t)$ is $$\mathbb E(t^R) = \prod_{i=1}^N \frac{N - i + 1}{N - (i - 1)t}. \quad |t| \lt \frac{N}{N - 1}$$
Define $X_i$ to be the value of the drawn coupon on each of the independent draws. They are i.i.d. with probability distribution $\mathbb P(X_i=x)= \dfrac 1N$, i.e. $X_i$ has a discrete uniform distribution with $ 1\le X_i \le N$. Therefore the probability generating function $\space g_{X_{i}}(t)$ is $$\mathbb E(t^{X_i}) = \frac {t \left({1 - t^N}\right)} {N \left({1 - t}\right)}. \quad |t| \lt 1$$
Therefore the random sum $T=\sum\limits_{i=1}^R X_i$ should have a convoluted probability generating function $$g_R(g_{X_{i}}(t))= \prod_{i=1}^N \frac{N - i + 1}{N - (i - 1) \times \dfrac {t \left({1 - t^N}\right)} {N \left({1 - t}\right)}}, \quad |t| \lt 1$$ which simplifies to
$$\prod_{i=1}^N \frac{N(1-t)(N - i + 1)}{N^2(1-t) - (i - 1) {t \left({1 - t^N}\right)}}.$$

I am as new as you can get to this site so sorry if I buggered something up! Never worked with latex so feel free to change any errors I made. Hopefully this is a fulfilling and interesting question and someone can find a naughty method. Given what I am doing is right (oops if I made a silly error and the answer is cat), if anyone can help with this fun looking convolution (I have chucked a few things at it and resulted in poop) it would be awesome! I have also tried it from first principles through computing $\mathbb P(T=t)$ using combinatorics and compositions but it seems I would need to read up a bit about A-restricted compositions, mostly of which I am having trouble getting my head around. Then again, I am stuck here too. Please help. Much appreciated. :)
Links below are just formality for those unfamiliar with the base problem.
The standard coupon collector's problem as can be found here.
The term in the braces for the distribution of $R$ is the Stirling number of the second kind.
Edit 1
Having thought about it for a few days, it seems this problem MAY be able to be done by the law of total probability. However I am still restricted by conditions on the collection, i.e. the number of each coupon collected should be at least $1$ to successfully complete the total. Let me explain:
$$\mathbb P(T=t)= \sum_i \mathbb P(T=t \mid R=i) \mathbb P(R=i),$$ where
$$i \in \left[ \bigg \lceil {\frac {T- \frac {N(N+1)}2}N} \bigg \rceil +N,N+ T-\frac {N(N+1)}2 \right]$$
So all we need is away to get $\mathbb P(T=t \mid R=i)$ for all $i$. And I know this can be achieved by finding: (1) How many ways in exactly $i-1$ steps we can get a total of $T-j$ for each for each $j \in [1,N]$, and divide it by: (2) the number of ways to finish in $i$ such that each number is rolled at least once not before collection step $i$.
Lets think about the case $N=6$ (a fir 6-sided dice) and $T=22$ It is clear our limits for $i$ are from $[\max(6,1)+1,6+1]=[7,7]$, which this implies the only way to achieve total of $22$ where we roll every number from $1 \to 6$ at least once is in exactly $7$ rolls. Hopefully we can see that is the case intuitively.
So (1) is calculated by all the permutations of $22-j$ without $j$ for each $j  \in [1,6]$ and (2) is calculated by all the permutations of finishing in $R=i$ goes, independent of finishing on a total of $22$.
My issue is then calculating (1) and (to some extent without high knowledge of A-restricted compositions) (2)!
Edit 2
I found a closed form for the simplest case N=2. Which is just a coin. With one side labeled a $1$. The other having a $2$.
$X_i$ is discrete uniform with $P(X_i=1)=1-P(X_i=2)=\frac 12$. I want to get $P(T=t)$ for $T \ge3$.
Let $T=3$. By counting, we can roll a total of 3 by:
$$(1,2) \ \ OR \ \ (2,1)$$
Either event has probability $\left( \frac 12 \right)^2$. So we have $P(T=3)=2\left( \frac 12 \right)^2=\left( \frac 12 \right)$
Let $T=4$. By counting, we can roll a total of 4 by:
$$(1,1,2)$$
This event has probability $\left( \frac 12 \right)^3$. So we have $P(T=4)=\left( \frac 18 \right)$
Here we do not count the event $(2,1,1)$ as a total of $4$ since by the second roll we have successfully achieved $D$. hence the actual total would be $3$ and we ignore the final $1$.
Now, let $T=5$. By counting, we can roll a total of 5 by:
$$(1,1,1,2) \ \ OR \ \ (2,2,1)$$
The first event has probability $\left( \frac 12 \right)^4$. The second event has probability $\left( \frac 12 \right)^3$ So we have $P(T=5)=\left( \frac 12 \right)^4+ \left( \frac 12 \right)^3$
If we continue in this fashion, we will always have exactly 2 ways of rolling a total of $T=t$. One with probability to the power of $T-\sum_{i=1}^2i=T-3$ and the other with probability to the power of $\frac {T-3}2$ when T is odd and $0$ if even. We can hence write down the closed form for the simplest case where $N=2$ as: $$P(T=t|N=2)=\frac 14 \left(\left(\frac 12 \right)^{t-3}+\Bbb I_{t \ is \ odd} \left(\frac 12 \right)^{\frac{t-3}2} \right)$$
But of course this still leaves me with not knowing $N=3,4,5,...$
Edit 3
The basic statistics for this problem follow from the definitions of $R$ and $X_i$. Firstly:
$$\Bbb E(T)=\Bbb E(\sum\limits_{i=1}^R X_i)$$.
It is known that:
$$\Bbb E(R)=N\ \sum\limits_{i=1}^N E(Z_i)=NH_N$$
for $H_n=\sum\limits_{i=1}^N \frac 1i$ the harmonic number.
Since $X_i$ is uniform: $$\Bbb E(X_i)=\frac {N+1}2 \ \ \forall i$$
Putting it all together using Wald's identity we get:
$$\Bbb E(T)=\Bbb E(R)\Bbb E(X_i)=N\sum\limits_{i=1}^N \frac 1i \frac {N+1}2$$
$$=\frac 12 N(N+1) \sum\limits_{i=1}^N \frac 1i$$
Next lets consider the variance:
$$\Bbb V(T)=\Bbb V(\sum\limits_{i=1}^R X_i)$$
It is also known that (from properties of i.i.d. geometric random variables):
$$\Bbb V(R)=N\sum\limits_{i=1}^N \frac {i-1}{(N-i+1)^2}$$
Since $X_i$ is uniform:
$$\Bbb V(X_i)=\frac {N^2-1}{12} \ \ \forall i$$
Now using the identity for the variance of a random sum via law of iterated variance:
$$\Bbb V(T)=\Bbb E(R) \Bbb V(X_i) + [\Bbb E(X_i)]^2 \Bbb V(R)$$
$$=N \sum\limits_{i=1}^N \frac 1i \frac {N^2-1}{12}+\frac {(N+1)^2}4 \sum\limits_{i=1}^N \frac {N(i-1)}{(N-i+1)^2}$$
$$=\frac {N(N+1)(N-1)}{12} \sum\limits_{i=1}^N \frac 1i+\frac {N(N+1)(N+1)}4 \sum\limits_{i=1}^N \frac {i-1}{(N-i+1)^2}$$
$$=\frac {N(N+1)}{12} \sum\limits_{i=1}^N \left[ \frac {N-1}i + \frac {3(N+1)(i-1)}{(N-i+1)^2} \right]$$
So for example when $N=6$, i.e. a die:
$$\Bbb E(T)=\frac 12 6(6+1) \sum\limits_{i=1}^6 \frac 1i=51.45$$
$$\Bbb V(T)=\frac {6(7)}{12} \sum\limits_{i=1}^6 \left[ \frac {5}i + \frac {3(7)(i-1)}{(6-i+1)^2} \right]=\frac {42}{12} 148.715= 520.5025$$
This makes sense. On average we roll $14.7$ times and get $3.5$ on each roll. $14.7 \cdot 3.5=51.45$.
In fact, a simulation of $10$ million collections shows that these are the correct values:
<code>> mean(Test$Roll_Total)
[1] 51.45751
> var(Test$Roll_Total)
[1] 520.5317
</code>
And the following diagram shows the distribution for the total $T$:

Aside: I have been trying to read up on generating functions for compositions and I cannot quite find what I am looking for in terms of restrictions. If someone finds one please let me know!
Help / hints appreciated :)
Comment: What is the problem? It is very difficult to read and dig trough all this material without knowing what it is leading to. Can't you write *at the top* a concise question, e.g. like a sentence that ends in a question mark? Mathematics problems are often easily described in a few short sentences. E.g. *"proof that $x^n + y^n = z^n$, with $x,y,z,n \in \mathbb{N}$, has no solutions for $n>2$"*
Comment: I changed it myself now. I hope this is ok.
Comment: Cross Link: https://math.stackexchange.com/questions/2795397/random-sum-in-coupon-collection
Answer: Note: I am writing a partial answer which is to be updated later
You can use  $$P(T=t|R=r) = \frac{N_{T=t,R=r}}{N_{R=r}}$$
the ratio of $N_{R=r}$ the number of ways the number of ways to finish in $r$ turns and $N_{T=t,R=r}$ the number of ways to finish in $r$ turns and the sum $T=t$.
You have
$$N_{R=r} = n^r \cdot P(R=r)$$
thus
$$P(T=t) = \sum_{r \geq n} P(T=t|R=r) P(R=r) = \sum_{r \geq n} \frac{N_{T=t,R=r}}{n^r} $$

Now one still needs to solve $N_{T=t,R=r}$ which is like a combinatorial problem. This is a bit more tricky but it could possibly be solved along the lines of the inductive solution in this simpler question.

Coupon Collection Random Sum


How to set a post featured image from an already made custom field

Question: So I migrated a website of a webdesigner and he used for news-posts a custom field for images. Now I made this website and I need to change 256 posts to set a featured image since it's not working with this custom field. Does anyone know how to set a post featured image from an already made custom field?
Answer: Your question is not entirely clear, but I suppose your new theme is using featured images in the normal way, which leaves empty featured images on older posts, because they are stored in a custom field. You can catch those using the filter at the end of get_the_post_thumbnail. Because I don't know how the custom field is made I can't give complete code, but it would look like this:
add_filter ('post_thumbnail_html','wpse303106_custom_featured_image',10,5);

function wpse303106_custom_featured_image ($html, $post->ID, $post_thumbnail_id, $size, $attr) {
  if ('' == $html && test-for-existence-of-custom-field) {
    $html = ... assemble from custom field ...
    }
  return $html;
  }

Comment: Can't speak dutch in here right? well this is the old website: https://vledder.nu/category/nieuws/  I dont even know what custom field it's using. Underneath 'Nieuws' there are different images, I need the images on the left of the news as the new featured image in the posts for example.
Comment: From the site I can't see the code that is generating the custom field. You'll have to ask the old developer. Building the filter shouldn't be more than 15 minutes work or so.


Modify Yellow Dotted Line in GIMP

Question: How do I remove or resize the marching ants from around the apple? It appeared when I used the move tool to move the position of the apple. It is in its own layer. I need to modify the image/layer outside that boundary but I am not allowed. I have tried select none. According to the select menu there is nothing selected. I'm a Photoshop user, but I'm trying to learn GIMP in order to teach my programing students how to illustrate games in a software that does not cost an arm & a leg, and is available in Linux.
Answer: You can change the layer boundaries size using the Layer Boundary Size option under the Layer menu. Thank you @johnpharrell for the right term to search by.
You can read more about it here.
Answer: Go to Edit -> Preferences -> Image Windows -> Appearance and untick "show layer boundary". Then you have to restart Gimp to make the changes.
Source: https://www.maketecheasier.com/make-gimp-look-like-photoshop/
That link may be helpful to you also. All the best.
Comment: ... and then forget about that setting, and wonder why you can suddenly not draw on a part of you image. The yellow line marks the boundary of the active layer - layers have a fixed size in GIMP.
Comment: @Michael Schumacher - I wondered if that would happen, the question then is how do you resize that boundary.

Modify Yellow Dotted Line in GIMP


How can I digitize features on an Y,Z plane in ArcGIS?

Question: How can I geo-reference and digitize features on a Y,Z plane of a vertical cross-section in ArcGIS?
The surface coordinate system is NAD 83 UTM 15.

This is a simplified version of the question found here:
How to digitize directional drilholes from scanned vertical sections?
Comment: What form does the output need to be in, Jakub?  3D vector objects?  3D coordinates for selected points?  2D coordinates at the surface plus depth and orientation?  Something else?
Comment: The desired output is a file of 2D polylines and polygons referenced to a Y,Z coordinate system (Y same as the surface coordinate (NAD 83 UTM 15) and Z coordinate in metres) No 3rd dimension or volume is required.
Comment: The goal is to create slices from interpreted geological contacts of a series of vertical cross sections. These "slices" (polygons) will be then exported into GEMS (Gemcom) and used for creating 3d solids.
Answer: <code>* Make sure the 3D Editor toolbar is already added to your display.
  Click Customize > Toolbars if you need to add it.
* Digitizing 3D feature vertices is supported for points, lines, and polygons.
</code>
Steps:

Start ArcScene or ArcGlobe and add the 3D feature class (pointZ, lineZ, polygonZ) you want to create new features for.
Add any other base layers you need to complete your digitizing. For example, any surface or building (extruded polygons or multipatches) layers on which you want to place the new 3D feature vertices.
Optionally add any imagery that you want to use as the backdrop for digitizing. Sometimes an image draped on the surface can make the view more realistic.
On the 3D Editor toolbar, click the 3D Editor drop-down and click Start Editing.
  If the layers in your table of contents come from more than one source, you may be prompted to choose the layer or workspace to edit.
If you prefer, now would be a good time to open the Snapping Environment window to set snapping properties. Open the window by clicking 3D Editor, expand the Snapping side menu, then click Snapping window.
Choose a feature template and select the edit construction tool from the Create Features window.
  Be sure to click within the extent of your work area. If you are zoomed out too far from the layer's extent, the feature vertex will not be created.
  Use CTRL+Z at any time to undo the last edit, for example, to remove the last segment of the line you just digitized.

(can be negative=underground vaules)
Finally >> Convert to 2D Polyline
Comment: Thank you for the extensive answer. The features I need to digitize only exist on a profile cross section scans. How can I geo-reference this image on an Y,Z plane? (The scans include coordinate system grid)
Answer: After disappointing results in other software packages, I created a workflow to build geology cross sections with the ability to display deviated and inclined downhole data, and digitizing lithology contacts in ArcGIS.
I am now re-mapping downhole surveys to view the data in East to West and South to North sectional views. (When importing points map X = Y and Y = Z and using unknown coordinate system set to metres for unit.) Adding 3D DXF subsurface objects is a bit tricky but after converting these models to point clouds and adding XYZ coordinates (I densifying the 3D mesh lines to get more contact points to digitize from) I can the remap the XYZ and query for a range of easting or northing values (however the section is oriented). This gives me a selection of points on the perimeter of the contact.  I had to create (and will create more to automate the process further) a few add-ins. 1. to convert mesh lines to 3D points using al vertices, 2. creating a coordinate grid i can use on the sections. (Northing, Elevation)
It's not the most dynamic process but afer i write a few tools for updating new drillholes it will hopefully get easier.
Answer: Try the script here: http://www.spatialhydro.com/scripts.html
It converts digitized 2d cross sections to 3d coordinates.