Acting force in moving frame of reference

Question: A charged particle moving parallel to a current carrying wire with some constant velocity. Now the frame of reference is also moving with same constant velocity as that of the particle. In my book it's written that the particle would move towards the current carrying wire in same way when a stationary frame of reference is considered. But in the moving frame of reference there is no magnetic force acting on the particle, which is the cause of movement of the charged particle in the fixed frame of reference. And since the wire is electrically neutral electric force can't be in play here. So what causes the movement of the particle? And how? And if it's written wrong in my book then what's correct?
Comment: Possible duplicate of [current in wire + special relativity = magnetism](https://physics.stackexchange.com/q/82821) ?
Comment: Yes, that would be the reason.
Comment: I recommend you read the link provided here in the comments too.
Answer: This is a consequence due to special relativity and length contraction so causing the charge densities for the attractive or repulsive forces.
Please watch this video it answers your questions.
Special Relativity and Magnetism


Adjoint representation

Question: I was just wondering why the adjoint representation of the Lie group $Ad$ and Lie algebra $ad$ are called representation. Maybe this word is derived from abstract algebra somehow, but I don't understand this terminology. For sure, $Ad$ does not enables us to represent elements in the Lie group and $ad$ does not enable us in general to represent every element in $\mathfrak{g}$, so where does the name come from?
Answer: The term representation comes from representation theory.  In particular, Ad gives us a group representation, and ad gives us a Lie-algebra representation.
In particular: given a Lie group $G$ and $A,B \in G$, $\operatorname{Ad}$ is a map from $G$ to $GL(\mathfrak{g})$ such that
$$
\operatorname{Ad}_A \operatorname{Ad}_B = \operatorname{Ad}_{A B}
$$
Similarly: given a Lie algebra $\mathfrak g$ and $X,Y \in G$, $\operatorname{ad}$ is a map from $\mathfrak g$ to $\mathfrak{gl(g)}$ such that
$$
[\operatorname{ad}_X,\operatorname{ad}_Y] = \operatorname{ad}_{[X,Y]}
$$
While these need not be full or faithful representations, they are representations nevertheless.
Answer: The linear map $\operatorname{ad}:\mathfrak{g} \to \operatorname{End}(\mathfrak{g})$, given by $x ↦ ad(x)$ is a representation of a Lie algebra, so it does enable us to "represent every element in $\mathfrak{g}$" by matrices, though not always faithfully (ad is faithful if and only if the Lie algebra has a trivial center). For example, let $\mathfrak{g}=\mathfrak{sl}(2,K)$ be the $3$-dimensional Lie algebra consisting of traceless $2\times2$-matrices. Then $ad$ represents every element $x$ of $\mathfrak{g}$ faithfully by the matrix $ad(x)$. For details see here.

Adjoint representation


Can aliquis function as an adjective?

Question: Aliquis is typically a pronoun, but can it also function as an adjective like aliqui?  For example, aliqui homo currit versus aliquis homo currit.
Answer: I disagree with LaFeeVerte, and would like to posit that aliquis can function as an adjective. A quote from one of my favorite sources, Bennett's Latin Grammar:

Aliquis may be used adjectively, and (occasionally) aliquī substantively.

Unfortunately, no examples are provided to show its adjectival use, but the fact that it can be used as an adjective makes sense based upon dictionary definitions elsewhere, such as this one from Lewis Elementary, which does provide a quote from Terence as an example:

II.II. adj. (cf. aliqui): nos quibus est alicunde aliquis obiectus labos, T.: ut aliquis metus adiunctis sit ad gratiam.

As Cataline mentions, there is a separate adjective (aliqui, aliqua, aliquod that means "some, any" that would serve the same purpose as the pronoun aliquis; however, aliquis can still serve as an adjective.
Answer: Generally, the answer is no. The adjective 'aliqui, aliquae, aliquod' should be used instead.
That being said, however, Virgil (Aeneid, book II, line 48) seems to use 'aliquis' as an adjective, saying 'aut aliquis latet error'. Here both 'aliquis' and 'error' are in the nominative, which suggests that you can use 'aliquis' as an adjective.
But perhaps 'error' should be translated predicatively, as in 'something lies hidden as a trap' instead of 'some trap lies hidden'.
So you probably shouldn't use it as an adjective, but you might not be wrong.
Comment: I believe you mean _aliqua_ instead of _aliquae_, which is plural.
Comment: @SamK I believe both can be used. Cambridge Latin Grammar uses 'aliquae', but I've definitely seen 'aliqua' used before.
Comment: That's interesting. Bennett's Latin Grammar lists only _aliqua_, but it lists both _qua_ and _quae_ as nominative feminine, which is an interesting difference.

Can aliquis function as an adjective?


Compact 3-manifold implies finite triangulability

Question: I know that it's a theorem by Moise that every compact 3-manifold admits a finite triangulation but to me the astounding part of that statement is the existence part instead of the finite one. So I was wondering: Is there an easier (possibly more modern) way to show that every compact, triagulable 3-manifold already admits a finite triangulation? All attempts I've made so far end up with me choosing a metric but I'd rather avoid that.
Comment: What is your definition of "triangulation"?  If in particular any triangulation gives your space the structure of a CW complex, it is a standard theorem that any infinite CW complex is not compact.
Comment: By a triangulation of a $3$-manifold $M$ I mean that there exists a simplicial complex, say $\sigma$, with geometric realization $\vert \sigma \vert$ homeomorphic to M. The finiteness condition then means that $\sigma$ contains only finitely many $3$-simplicies. I should have made that clear.
Answer: Suppose you have a compact space $X$ and a triangulation (or more generally, a CW complex structure) of $X$.  Choose one point in the interior of each simplex, and let $S\subseteq X$ be the set of all these points.  Then $S$ is closed, because its intersection with each closed simplex is finite and hence closed (it contains only one point in the interior of each face of the simplex).  Thus $S$ must be compact.  But the exact same argument shows that any subset $A\subset S$ is also closed, so $S$ has the discrete topology.  Thus $S$ must be finite, so the triangulation of $X$ can have only finitely many simplices.


eigenvalues by inspection

Question: Well, May be my question does not make any sense, But one of my junior asked me whether we can say eigenvalues of a matrix by inspection may be for $3\times 3$ matrix? He said for the following matrix, will $3$ be an eigenvalue with multiplicity $3$ with out calculation?
$$\left(
  \begin{array}{ccc}
    3 & 2 & 2 \\
    2 & 3 & 2 \\
    2 & 2 & 3 \\
  \end{array}
\right).$$
So far I know that if it is real symmetric then its eigenvalues are purely real, if skew then purely imaginary, if diagonal then all the entries, and if unitary then with modulus 1, known facts at all.If any one knows more about this please write.
Comment: No more likely than solving a cubic equation by inspection.
Comment: The eigenvalues of your matrix are $1$ (multiplicity $2$) and $7$.
Comment: So, I hope there is no magic to guess eigen values by inspection right in general?
Answer: In this case you can see the eigenvalues "by inspection".
Item #1: If you subtract the identity matrix from your matrix, you get three repeated rows,
i.e. $A-I$ has rank $1$ only. This means that the eigenspace associated with $\lambda=1$ is $2$-dimensional, IOW it is a double eigenvalue (and a double root of characteristic polynomial).
Item #2: The sum of entries on all rows is equal to $7$. This means that the vector $(1,1,1)^T$ is an eigenvector belonging to $\lambda=7$.
This is a 3x3 matrix, so that's all.
Answer: The Gershgorin circle theorem comes close to estimating the eigenvalues by 'inspection' - by summing the absolute values of the row elements (except the ones on the diagonal). So in this case the three eigenvalues are all in the interval [3-4,3+4].
Comment: Thanks for posting this. I was not previously aware of the Gershgorin circle theorem. and I'm glad you brought it to my attention. I'm starting to study spectral graph theory, and it seems to me that this theorem will be particularly helpful for understanding the eigenvalues of graph adjacency matrices, which have small row sums and always have zeroes on the diagonal.

eigenvalues by inspection


I have two audio files of same song one is from vinyl and other is from CD source, I want to compare those and technically see the difference between

Question: Music comparison for getting vinyl effect in CD recording conversation from CD rip to vinyl rip
Comment: Reading between the lines, you want to make a CD rip sound like vinyl… why?
Comment: What is your question? You can use all sorts of frequency analysis tools to highlight the differences in dynamic range, frequency range, eq etc if that is what you want to know. Please edit your post to let us know what your question is.
Comment: I don't know why vinyl Rip is comfortable to me. I have studied that CD is technically far superior than vinyl in all technical aspects, but vinyl Rip sounds very good. Is there any training tool if I train to identify CD and Vinyl than same will helpe me to convert. The comparison should be with almost musical attributes frequency, amplitude, dynamics, loudness etc. I need to technically differ them, by deeplearning or training a model. It least a model which will after Deep learning will identify the difference and the same will help to convert. Like Music retrieval I confused where to start
Answer: This answer may contain nuts cynicism.
To make a CD rip sound like the average consumer vinyl rip, you need to do the following…

Apply a gentle roll-off of frequencies above 4KHz, not too much, just enough that there's nothing much left above about 12k.

Hard roll off anything below 45Hz.

Add gentle tube or tape saturation.

Optional. De-tune [by simply speeding or slowing] to within approximately 50 cents of original pitch. Do this randomly per rip.

Optional, for older records… compress using a very slow attack & release, to make it 'as loud' as a new record.

Use something like Steinberg's 'Vinyl' VST plugin to add some gentle pops, clicks & rumble. This can also add considerably more distortion & frequency squeezing if you want that authentic 78 sound.

Transcode to FLAC [or round robin to low bitrate mp3, then back to FLAC 48kHz] & sit back, happy you made it 'better' than the CD.
Comment: @RoryAlsop - for sure;))  I have some fabulous old vinyl albums, & some early CDs rushed off the EQ masters which were downright bloody awful, but my point really is that the average vinyl ripper's gear is simply not up to the task, & once ripped tends to go through some kind of voodoo 'upscaling' process before being shared on usenet/torrent to fool people into thinking it's better than it is. Most times you'd get a better sounding file off iTunes, which at least these days come off the 24-bit masters.
Comment: So cynical:-) I have to say I far prefer the sound of a well mastered old school LP to modern mastering. I don't think it's better, I just like what I grew up with, probably


Help With (supposedly) Simple Command

Question: I am making a map that has a pile of blocks (15 total)  and need to know when one has been broken because the game will end when all have been broken.(I am using Exotic Blocks so there is no chance of there being another of it.)
THIS IS A UPDATE
 I am wondering if it would be possible to use a scoreboard to test how many blocks a player has broken of a type if someone could show me how to do this I would appreciate it.
Comment: Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
Comment: I dont know if the testfor command would do what I need
Comment: Like I said; Arqade works better when it looks like you've tried to solve your own issue.  If you have an idea, give it a shot!  At least you're trying, and that helps immensely.
Comment: If you could respond ASAP because my friends and family are very anxious for the release of the new game xD
Answer: Use this command for each block, connected to a repeating circuit:
/testforblock x y z [blockname] [Damage] {dataTags}

Where the "[blockname]" the block's name, and "x y z" are the coordinates of the block. With mods, the name can vary from something like minecraft:grass to a modded ID like mocreatures:fish_egg, so it's good to look up the ID beforehand with mods involved. You can hook these command blocks up to your scoreboard system with a redstone torch on a block to change the signal around. If you don't know how to build one, or something's wrong with yours, just leave a comment, and I will add the scoreboard commands.
Another way is to use the command:
/testforblock x y z minecraft:air

It will test for when a block isn't there. You don't have to use a redstone torch with that, and it's way simpler, so I definitely recommend it.
Comment: That's a terrible way to test for a large amt. of blocks, you would need a single cmd block for each one. If all he cares about is when it's empty, he should have an empty space somewhere, and use `/testforblocks`.
Comment: Sorry... a small error... just fixed it. (wrote this post just after i woke up.)

Help With (supposedly) Simple Command


Accumulated drainage area using r.terraflow

Question: I am trying to compute the accumulated drainage area (flow accumulation) using the GRASS' r.terraflow algorithm in QGIS (QGIS 3.20.3 and GRASS 7.8.6RC2 were installed using the OSGeo4W Network Installer).
Upon inspection of the output raster with the Identify Features tool it seems as if some raster cells got floating numbers assigned to them (e.g. 54318.957, where large drainage areas contribute), whereas the majority of the cells contains integer numbers as one would expect.
I wanted to inquire about possible causes for these results and value any suggestion.
Answer: I believe this is due to how r.terrflow choosed the flow direction algorithm. From the man page:

If flow accumulation of a cell is larger than the value given by the
d8cut option, then the flow of this cell is routed to its neighbors
using the SFD (D8) model. This option affects only the flow
accumulation raster and is meaningful only for MFD flow (i.e. if the
-s flag is not used)

So in some cases the MFD algortihm is chosen, and then you can get fractions of cells in the flow accumulation.


Can I set up a retirement plan for an LLC with negligible income?

Question: I am currently working as a W2 contractor, with no access to a 401(k) plan through the contracting agency. However, I do own an LLC, with, unfortunately, negligible revenue earnings. Here are my questions:

Could I use the LLC to set up and contribute to a retirement plan?
Is there any restriction on using only the (negligible) income earned by the LLC towards the retirement plan contribution, or can I use my W2 contractor income to contribute into that account as well? Especially since the taxes for the LLC are filed along with my personal taxes.
Finally, if possible, would such a situation warrant a specific retirement plan, or would a basic SEP-IRA or 401(K) with my financial institution suffice?
Answer: 401k plans are run by an employer, including as a special case, a self-employed person. While the LLC can set up a 401k plan, its employees can only contribute the smaller of what the IRS allows and the total compensation  from the LLC.  In short, your W-2 wages cannot used to contribute to the LLC 401k plan; you are limited to what the LLC pays you.


Is Moksham guaranteed if have Phanchasamskaram done for me?

Question: Is Moksha guaranteed if I have Pancha Samskaram (Samashrayanam) done for me? I heard that Perumal promised Swamy Ramanujacharya that anyone who has Pancha Samskaram (Samashrayanam) done will get Moksha. Is that true?
Comment: @NikhilRaghavendra - It is matter of extreme faith or Mahaviswasa in Lord. So, in short, Samasrayanam and Bharasamarpanam will surely lead to Moksha. Swami Desikan and Swami Pillai Lokacharyar in their Rahasya granthas have written extensively on it. Please approach a SriVaishnava acharya and try to read them to have a better understanding. It is matter of absolute faith in the redemption power of the almighty. As Krishna says in Bhagavad Gita " sarva-dharmān parityajya mām ekaḿ śaraṇaḿ vraja ahaḿ tvāḿ sarva-pāpebhyo mokṣayiṣyāmi mā śucaḥ"
Comment: @NikihilRaghavendra - Please check the link provided below. Hope it helps in clarifying your doubt or doubts, at least to some extent.                             http://anudinam.org/2013/09/10/pancha-samskara-samasrayanam-a-dialogue/
Comment: Welcome to Hinduism.SE!  Personal advice questions aren't allowed on this site, so I'm temporarily putting your question on hold.  If you want to remove the personal details and make the question more general, then edit it and flag me to reopen it.
Comment: @KeshavSrinivasan Thanks for pointing it out, I have edited it.
Comment: OK, I reopened it.
Comment: @Krishna, Thanks for the link, that helped me understand more about Samashrayanam.
Answer: What is Samashrayanam?

Samashrayanam can be defined as a process or custom in Sri Vaishnava Sampradaya  'to approach (Acharya) with  sincerity'. During the process of Samashrayanam, the Acharya takes the person    as his shishya or disciple, irrespective of his caste, creed or other differences. Concurrently, it is also expected that the shishya is to live as per the wishes of the Acharya. Thus the person gets the link to the rich Sri Vaishnava heritage. The most revered Pancha Samskaram is performed when one takes the process of Samashrayanam.

What about the life after taking the process of Samashrayanam?

Samashrayanam is indeed a great turning point in the life of Jeevathma, who has got entangled in the maze of life and death.  The Pancha Samskaram (or the five-fold-purification) performed is invaluable. But , one has to keep up the Samskaram by his regular devotional activities. The Pancha Samskarams performed to the person loses significance and potential, if he gets involved in worldly activites and pleasures throwing more indifference to the Paramatman(Sriman Narayana). After all, the ultimate purpose of Pancha Samskaram is to make a person eligible to take part in the various activities of the Sanatana Dharma and to serve the Divya Dhampathi (Sriman Narayana and His consort, Sri Mahalakshmi). Sharanagadhi towards the Lord must be the only objective in our life.  Samashrayanam helps in a great way to make a person progress towards achieving this goal.

Pancha Samskaram (Samashrayanam)
Sources1
Sources2


Why does data augmentation using synthetic data generated by one model improve the performance of another model?

Question: I understand from articles like this one that synthetic data generated by one model based on real data can improve the performance of a second model. Can anyone help me understand the intuition behind why this works? Specifically, why not directly use the real data to train the second model? Since the data generated by the first model is at most as good as the real data used for that model, won't the performance be actually better if the real data are directly used to train the second model?
Answer: The reasoning behind synthetic data is the same behind classic data augmentation,so the goal is to increase the amount of training instances to improve generalization.
The difference with classic data augmentation techniques is that classic data augmentation rely on linear transformations like flipping or rotation that do not provide as much variation as we would like. Synthetic data instead are usually generated with generative models, which sample new data from a posterior distribution learned from real data. This difference is huge. Imagine augmenting data with a flipped pictures of the same dog flipped around vs augmenting the data with a pictures of different dogs not present in your current real data.
Now the problem of course is that training generative model to produce good samples is as hard. Training a GAN on MNIST or other toy datasets is rather easy, doing so on real datasets with much less instances and all sort of imperfections (picture taken with different cameras to give an example) is many times a rabbit hole in itself. So you always want to do a good list of pros and cons before deciding to invest time in training a model just for synthetic data generation.
On the other hand, it's not impossible to find synthetic datasets ready to be used out of the shelf. In that case exploring the data to check they fit your use case is usually a no brainer and time worth spending for sure. An example is SynthCity, a dataset for point cloud segmentation, I found it very handy for a project I was working on where we didn't have lot of point clouds to start with.
Update
Why not feeding the real data used to train the generative model directly?
First answer is that you always feed the real data as well, i.e. you never train only on synthetic data, the point again is to augment you initial dataset, not replacing it.
So you move from a situation like this:
real data + naive augmentation -> model
to this:
real data + synthetic data + naive augmentation -> model
Second answer is that not always synthetic data are generated trough machine learning, there are situations in which you can use analytic methods to produce them (for example fluid simulations trough differential equations). So in this case you're not even starting from real data at all.
Comment: I've updated the answer, hope it's more clear!
Comment: Thanks. Yes, I can see how giving a model new data that does exist in the original sample can improve performance, but digging deeper, my question is really why we need a separate model to do the generation of new data. Why can't we input the real data (from which the first model learns the distribution) directly into the second model? Can the second model not both learn the distribution and generalize? Or is it hard to architect such a model that does both?


How work the Ctrl +Z by command line not by keyboard key?

Question: How work the Control+Z by command line not by keyboard key? (on Linux)
I'm need stop all terminal are running and resume it later.
Comment: You asked this before at https://unix.stackexchange.com/questions/386200/ , and with this duplicate you have not actually made clear the things that people have asked to be made clear.
Comment: Not a true duplicate. This question is about Ctrl-Z, the other is about Ctrl-S, but the answer is actually the same.
Comment: No, the other one is _not_ about Ctrl+S.  At least that much is stated in the question.
Answer: Control+Z writes the control character susp, which sends the signal SIGTSTP (number 20 on Linux amd64, 24 on Solaris amd64, 18 on FreeBSD amd64... it's better to avoid referring to signals by number as that's not portable) to all the processes in the foreground process group of the terminal.
You can send a signal to stop a process from the command line by using the kill-command.
kill -s STOP <pid>

(where <pid> is the id of the process you want to suspend) or, if you want to address all processes of a program with a certain name (technically, all processes whose name match a given extended regular expression):
pkill -STOP xterm

(where xterm is an example name).
When you need to resume the processes, send signal SIGCONT in the same way.
Comment: It sends the SIGTSTP (20 on Linux on amd64 at least) signal, not SIGSTOP, and to the foreground process _group_ of the terminal device. SIGTSTP can be handled, not SIGSTOP.
Comment: but how to know the number of session the terminal is running
Comment: What is the meaning of `pid` ?
Comment: @abuali "PID" is short for "process ID". See https://en.wikipedia.org/wiki/Process_identifier
Comment: @ Stéphane Chazelas   how konw `process ID` special in the the terminal opened
Comment: I'm is running the some terminal , I'm need the stopped all this terminal and resume it later by script
Answer: If you wanted to stop all the processes that have /dev/pts/12 as their controlling terminal (including all the foreground and background jobs running in that terminal and the shell), you could do:
pkill -STOP -t pts/12

That would also suspend the session leader. In some cases, that one may be resumed automatically. For instance, GNU screen resumes the session leader as soon as it detects that it has been suspended.
If you wanted to send the SIGTSTP signal to the foreground process group of that terminal like ^Z would you'd do:
kill -s TSTP -- "-$pgid"

Where $pgid is the process group ID of that  foreground process group. On Linux and BSDs at list, you can find out which it is by running ps -o tpgid= -p "$pid" where $pid is the id of any process that has that terminal as its controlling terminal. On most systems, any of those processes could also find it out using tcgetpgrp().
In both cases, you resume those processes by sending the SIGCONT signal in place of SIGSTOP/SIGTSTP.
Answer: Send the STOP signal to the process(es) that you would like to suspend.
You may later send the CONT signal to unsuspend a suspended process.
For example:
pkill -STOP terminal

This would suspend all terminal processes.
 pkill -CONT terminal

This would unsuspend all processes named terminal.
Comment: but how to know the number of session the terminal is running
Comment: @abuali I'm not sure what you mean. `pkill` will look up all processes matching the name that you supply and send the signal to all of those. If you want to limit to a particular user, add `-u username`.


Property default values using Properties.Settings.Default

Question: I am using .Net 2 and the normal way to store my settings. I store my custom object serialized to xml. I am trying to retrieve the default value of the property (but without reseting other properties). I use:
ValuationInput valuationInput = (ValuationInput) Settings.Default.Properties["ValuationInput"].DefaultValue;

But it seems to return a string instead of ValuationInput and it throws an exception.
I made a quick hack, which works fine:
string valuationInputStr = (string)
Settings.Default.Properties["ValuationInput"].DefaultValue;
XmlSerializer xmlSerializer = new XmlSerializer(typeof(ValuationInput));
ValuationInput valuationInput = (ValuationInput) xmlSerializer.Deserialize(new StringReader(valuationInputStr));

But this is really ugly - when I use all the tool to define a strongly typed setting, I don't want to serialize the default value myself, I would like to read it the same way as I read the current value: ValuationInput valuationInput = Settings.Default.ValuationInput;
Answer: At some point, something, somewhere is going to have to use Xml Deserialization, whether it is you or a wrapper inside the settings class. You could always abstract it away in a method to remove the "ugly" code from your business logic.
public static T FromXml<T>(string xml)
{
    XmlSerializer xmlser = new XmlSerializer(typeof(T));
    using (System.IO.StringReader sr = new System.IO.StringReader(xml))
    {
        return (T)xmlser.Deserialize(sr);
    }
}

http://www.vonsharp.net/PutDownTheXmlNodeAndStepAwayFromTheStringBuilder.aspx
Answer: @Grzenio,
Why don't you use your object type directly? You can set type of your setting on Project Properties->Settings tab. You can select your type by clicking on Browse in drop down for Type column.
Citation from MSDN:

Application settings can be stored as
  any data type that is XML serializable
  or has a TypeConverter that implements
  ToString/FromString

That way you can have strongly typed settings, i.e. (ValuationInput) Settings.Default.Properties["ValuationInput"].DefaultValue; will return an object instead of string.


Is it possible to filter which applications can use my iPhone's Personal Hotspot?

Question: Is it possible to filter which applications (in Windows) can use my iPhone's Personal Hotspot?
Comment: This might be better asked in a windows forum. The iPhone part is the personal hotspot software isn't configurable unless you jailbreak the phone and modify that code. Perhaps edit the question to ask this specifically if that is your intent.
Answer: No, it is not possible. Even by jailbreaking would not enable this, or more exactly not in a practical way.
Answer: Technically yes you can but it depends on what firewall you use.
Since the connection to the Hotspot will be a distinct Network Connection (interface), if your firewall will allow you limit apps based on process name and interface, then this will in fact achieve your goal.


Understanding voltage

Question: I understand that water flows because of height difference and current flows because of potential dfference. Now, in this analogy, I can understand height but I fail to realise what potential is. Is it the number of electrons? Say, A has 10 electrons, B has 20 and C has 100 electrons. So, can I say AC has more potential difference than AB and can I also say C has the highest potential?
Answer: The potential is always measured relative to a potential in some other point. It is not an absolute value (in electronics this relative point is defined by the ground, the spot where the potential is taken to be zero). This is due to the fact that potential is related to the work which one does moving electron from one point to another. Usually, as a reference point, one take a point somewhere at infinity. Moving electron from infinity to a spot occupied by 10 electrons requires less energy than moving electron to a spot occupied by 20 electrons due to repulsion.
Answer: Potential is a measure of usable energy above some averaged background energy.  So in the case of gravity, since the Earth or any other solid object has some mean radius (generally speaking), then an object on a peak that is greater then the mean radial distance from the center of the earth has some amount usable energy; one can think of the situation as also implying a low entropy condition.
Voltage is no different.  When we talk of voltage one is actually talking about voltage above ground voltage, e.g. usable energy above the mean energy of the entire system one is connected with.  Since electrical energy of the ground is effectively "thermal" with the rest of the Earth, we tend to use the Earth as our electrical ground state.  So voltage in a circuit is a direct measure of the amount of usable energy one has (speaking very generally).  A high voltage relative to ground again implies the system is in a low entropy condition.
Also the number of electrons itself does not imply a voltage difference.  Only the difference in number of electrons in a system that would prefer to establish equilibrium.  A battery for instance as a total system is going to have the same number of electrons at its beginning and end state.  However at the beginning state, some of those electrons are concentrated on one side of the total system.  So a distribution that has a bias of 100 electrons will have more potential then one with a bias of only 10 electrons.
Answer: I had the same problem with potential when I learned about it for the first time. I admit it is not easy to see similarity between water example and potential.
The best way I can describe it is, the potential is a measure of the internal pressure of charged particles. In other words, a measure of the intensity of pushing among charges to each other. Think of it as a group of people who don't like each other. If you put them in a small room "the tension" among them is going to rise. If they were distributed in different rooms "the tension" will go away. The "tension" in this example is somehow similar to potential.
One need to keep in mind that potential is relative. It is meaningless to speak about absolute potential. Potential difference is what matters. Charge carriers move from high potential to low potential. Just like people who hate each other would go away if they have that option which will cause the tension to go down among them. The motion of charge carrier is what is called current.
With respect to electrons as you mentioned in your question. Think of a billion of electrons confined in a cube of size 1 mm cube. The absolute potential of electrons is meaningless. However, if you brought another cube with a million electrons in it, you can define the voltage difference between the two cubes. If you connected them a huge number of electrons in more dense cube will rush to less dense cube. The quantification of the difference is called the potential difference. It is basically like a guy who lives on an island, he can't realize whether he is rich or poor unless he compares himself to somebody else.
You quite frequently hear potential without difference, the reason is that in such a case it is meant that potential is taken with respect to ground.
I hope that helped

Understanding voltage


Gravitational potential energy equation question

Question: The gravitational potential energy of a mass $x$ meters away from the center of the Earth is calculated from the formula $$G\frac {Mm}{x}$$ where $M$ is the mass of the Earth and $m$ is the mass of the other mass and $x$ is the distance it is away from the center. In this formula, why isn't the gravitational potential energy between the Earth and the Moon found by $$G\frac{M_{\text{Earth}}M_{\text{Moon}}}{r}$$ affect the result found?
Answer: It is not the gravitational potential energy of the mass alone rather it is the gravitational potential energy of the system which comprises the Earth and the mass.
$ {\Large \color{red}{\mathbf-}}\dfrac{GMm}{x}$ is the gravitational potential energy of a system of two masses, $M$ and $m$, with a separation of $x$ assuming that the zero of gravitational potential energy is when the two masses have an infinite separation.
If you now add the Moon then the system now contains three objects, Earth, Moon and mass.
You now have to include two extra terms to the gravitational potential energy of the system which also depend on the separation between the Earth and the Moon, $y$, and the separation between the Moon and the mass, $z$.
Answer: The mass of the Moon is about 1.2% the mass of Earth. Unless the mass $m$ is very close to the Moon, its effect on the Earth gravitational field can be neglected. Indeed,
$$U=m\left(\frac{M_e}{x} + \frac{M_m}{R-x}\right)$$
where $R$ is the distance between the Earth and the Moon. With $x\approx R_e$, that is, the Earth radius, $R-R_e\approx R$, so that
$$U\approx\frac{mM_e}{x}\left(1 + \frac{M_m}{M_e}\frac {R_e}R\right).$$
The second term inside the parenthesis is negligible, so a good approximation is
$$U\approx\frac{mM_e}{x}$$
Comment: RE: "Unless the mass m is very close to the Moon, its effect on the Earth gravitational field can be neglected." Unless, for example, you want to know when the tide is going out so you can get your sailing ship out of port.
Comment: Compared to $R$, the tide is also negligible
Answer: Your question could be worded better.  Are you asking if the Earth moon potential is part of the Earth mass system or if the Moon affects the potential energy that the mass will have near the earth?  The answer is yes to both.
If you bring the Moon into the problem then there are three bodies in the problem and one speaks of the potential energy of the system, that is proportional to the amount of work required to bring the masses into their configuration from infinity.  In this case you will have three contributions, Earth-mass, Earth-moon, and Moon-mass.
If you consider the Earth and Moon to be fixed for a moment and want to calculate the potential energy of the mass that you brought in to a fixed location then you have two terms to calculate, the potential from Earth-mass (which you have in the first formula with $M = M_{Earth}$) and the potential from Moon=mass (which you get by replacing $M = M_{Moon}$, and x with the distance from the Moon to the mass).  Adding the results gives the total potential energy of the mass in the presence of the Earth and Moon.
If you are asking why the Moon is not considered as part of the calculation I think this has been answered by another post.  In a nutshell you could ask why the Sun, Jupiter, etc are not included.  In reality the presence of all the matter in the universe creates a Net gravitational field at any location.  The "complete" potential energy of a mass placed at a location is $m\;U$, where U is the potential at that point due to all other mass.  If the test mass in question is very close to one object and very far from all others then we are justified in neglecting everything else.  Near the Earth (near the surface) it is the effect of the Earth's gravity that we feel the most.  The Moon can affect the tides, so perhaps it is not negligible, but for most applications we can ignore it.  If you are solving basic physic problems you are probably taught to ignore it to make things easy.  In fact everything affects the result, just to varying degrees.


ASP.NET unhandled errors in application log - how to disable?

Question: As the title says - how do I disable all of the ASP.NET unhandled errors appearing in the event log? Cant see anything obvious in IIS / the web.config...
Answer: The easiest way I can think of right now is through a code-based solution, not web.config. In the global.asax file for your application, you can add an Application_Error event handler. In this, you can do whatever you want to do to log the error (or not...) and then redirect to an appropriate error page. Call Context.ClearError() before redirecting, and none of the standard ASP.Net unhandled excpetion stuff will kick in. This is not a pretty way to handle this though, so hopefully somebody else has a better answer.
A simple global.asax that does only this functionality would look like:
<%@ Application Language="C#" %>
<%@ Import namespace="System.Diagnostics" %>

With all that being said, there has to be a way to do this using the web.config healthMonitoring section, I just can't figure out how to say "turn off logging for all events".


Script to change color of image files

Question: I have lot of image files (png) in a folder on my mac. They are all same color (say blue) and I would like to change their color to another same color (assume some RGB value that i already know).
Is it possible to achieve it through a script? shell script, applescript etc.
Until now, i have been doing this through online color editor tool ( http://pixlr.com/editor/ ). That is, open these files (png files) in this online editor and select one at a time and open "Color balance" dialog and set the same RGB value (say 20,30,40) for each file and save it.
This is a repetitive task and I would like to automate it using some script or free app tool on mac. Pls help.
Answer: Color modification with ImageMagick

Script to change color of image files


How to scale a plane to the exact dimensions of a loop cut?

Question:
I have a plane and a loop cut that is highlighted as shown in the image above. I wanted to know how do I scale the plane to the exact dimensions of the loop cut?
Answer: You may do it using a snapping tool.
First select the edge loop in Edit Mode (Alt+RMB) and snap the cursor to it (Shift+S-->Cursor to Selected). Then select the plane in Object Mode and press Shift+S-->Selection to Cursor [Offset]).

Next press the magnet icon to enable the snapping tool and change its type to Vertex. Scale the plane until it snaps to the loopcut's border.

To see the loopcut in Object Mode check the Wire and Draw All Edges checkboxes in Display panel of the Object header.

For irregular planes you can scale along the chosen axes (e.g. S,Y).

You may also snap the plane to the corner of the edge loop in Object Mode. Then change the pivot point type to 3D Cursor, snap the cursor to the corner of the plane in Edit Mode with Shift+S-->Cursor to Selected and then scale it until it fits the edgeloop.
Answer: You could also simply select the loop. Duplicate it. Then fill the duplicate (f key). Check your normals to make sure they are going the right direction.


The relationship between the intercepts and the remainder in the remainder theorem

Question: The polynomial remainder theorem states that when a polynomial $P(x)$ of degree $> 0$ is divided by $x-r$ ($r$ being some constant) the remainder is equal to $P(r)$, that is:
$$\begin{array}l If & \quad P(x) = (x-r)Q(x)+R \\ then & \quad P(r) = R \end{array}$$
The algebra and the graphic representation make sense; the question is why. Why is the functional relationship between $r$ and $R$ the function $P(x)$? What are the mechanics, so to speak, that produce this result? Or is it just a fortunate algebraic "accident"?
Comment: It's the first time I see someone other than me identifying *'why'* not with plots, but with something else, in this case algebra. I salute you.
Answer: Polynomial long division gives a solution of the equation
$$f(x)=q(x)g(x) + r(x)\,,$$
where the degree of $r(x)$, is less than that of $g(x)$.
If we take $g(x) = x-a$ as the divisor, giving the degree of $r(x)$ as $0$, i.e. $r(x) = R$:
$$f(x)=q(x)(x-a) + R\,.$$
Setting $x=a $, we obtain: $f(a)=R.$
Comment: The algebra is a representation of certain logic; the representation is clear, the logic less so.
Comment: @Docom The logic is given in Bill's answer.
Comment: Indeed. Thanks!
Answer: It is clearer in congruence language, $\ {\rm mod}\ \,x\!-\!r\!:\,\ x\equiv r\,\Rightarrow\ P(x)\equiv P(r).\ $ This is true because polynomials are composed of sums and products, and congruences are equivalence relations that are compatible with sums and products, i.e. $\, A\equiv a,\,B\equiv b\,\Rightarrow\, A+B\equiv a+b,\ AB \equiv ab.\,$ See the proofs of the Congruence Sum, Product and Polynomials Rules below (written for the ring of integers $\,\Bbb Z,\:$ but also valid in any polynomial ring (or any commutative ring).

Congruence Sum Rule $\rm\qquad\quad  A\equiv a,\quad B\equiv b\ \Rightarrow\ \color{#c0f}{A+B\,\equiv\, a+b}\ \ \ (mod\ m)$
Proof $\rm\ \ m\: |\: A\!-\!a,\ B\!-\!b\ \Rightarrow\ m\ |\ (A\!-\!a) + (B\!-\!b)\ =\ \color{#c0f}{A+B - (a+b)} $
Congruence Product Rule $\rm\quad\ A\equiv a,\ \ and \ \  B\equiv b\ \Rightarrow\ \color{blue}{AB\equiv ab}\ \ \ (mod\ m)$
Proof $\rm\ \ m\: |\: A\!-\!a,\ B\!-\!b\ \Rightarrow\ m\ |\ (A\!-\!a)\ B + a\ (B\!-\!b)\ =\ \color{blue}{AB - ab} $
Congruence Power Rule $\rm\qquad \color{}{A\equiv a}\ \Rightarrow\ \color{#c00}{A^n\equiv a^n}\ \  (mod\ m)$
Proof $\ $ It is true for $\rm\,n=1\,$ and $\rm\,A\equiv a,\ A^n\equiv a^n \Rightarrow\, \color{#c00}{A^{n+1}\equiv a^{n+1}},\,$ by the Product Rule, so the result follows by induction on $\,n.$
Polynomial Congruence Rule $\ $ If $\,f(x)\,$ is polynomial with integer coefficients then  $\ A\equiv a\ \Rightarrow\ f(A)\equiv f(a)\,\pmod m.$
Proof $\ $ By induction on $\, n = $ degree $f.\,$ Clear if $\, n = 0.\,$ Else $\,f(x) = f(0) + x\,g(x)\,$ for $\,g(x)\,$ a polynomial with integer coefficients of degree $< n.\,$  By induction $\,g(A)\equiv g(a)\,$ so $\, \color{#0a0}{A g(A)\equiv a g(a)}\,$ by the Product Rule. Hence $\,f(A) = f(0)+\color{#0a0}{Ag(A)}\equiv f(0)+\color{#0a0}{ag(a)} = f(a)\,$ by the Sum Rule.
Beware $ $ that such rules need not hold true for other operations, e.g.
the exponential analog of above $\rm A^B\equiv\, a^b$ is not generally true (unless $\rm B = b,\,$ so it follows by applyimg the Polynomial Rule with $\,f(x) = x^{\rm b}).$
Comment: So let me see if I understand you correctly: Since the remainder is just the difference between two numbers, it persists through addition and multiplication operations (eg. `If b = a+r, then 5b = 5(a+r)`). Since the polynomial is constituted (or *constructed*) of just addition and multiplication, the remainder persists throughout the series of operations (or *transformation*) that is the polynomial, or alternatively - one might say the remainder "follows" the divisor throughout the function *P(x)*.
So essentially the remainder theorem is just the result of the elementary distributive property.
Comment: @Docom Consider the special case $\,r = 0.\,$ The answer says $\ {\rm mod}\ x\!:\ x\equiv 0\,\Rightarrow\, P(x)\equiv P(0),\,$ because $\,x\equiv 0\,\Rightarrow\,x^n\equiv 0\,$ by the Power Rule (iterated Prodcut Rule), so $\,c_n x^n\equiv c_n 0\equiv 0\,$ for $\,n\ge 1\,$ by the Product Rule, so $\,P(x) = c_0 + c_1 x+\cdots+c_n x^n \equiv c_0 + 0 +\cdots + 0\equiv c_0 = P(0)\,$  by applying the Sum Rule multiple times.
Comment: So, mod $\,x,\,$ every polynomial is equivalent to its remainder $= P(0) = c_0 = $ constant term, so arithmetic mod $\,x\,$ is essentially the same as arithmetic of the constant terms. The essence of the matter will become clearer when one studies quotient(residue) rings, and evaluation maps of polynomials rings. Then it boils down to $\,R[x]/(x-r) \cong R.\ \ $
Comment: Abstract algebra it is, then. Thanks.


script for clicking link in QTP/UFT

Question: I am currently stuck at a place while writing a script for clicking a link on a page using VB Script in QTP.
Please guide how to achieve this. Any help will be highly appreciated. I am stuck here and cannot proceed further.
Comment: To answer this best, you'll have to give a little more context. What code do you have now that isn't working? Is anything similar working? Is there something different between the link you're trying to click and others you've successfully clicked before?
Answer: For that you can write descriptive or directly drag and drop that link from OR and add event in the last for click.
For example:
<code>Browser("Google").Page("Google Search").Link("Help").Click
</code>

script for clicking link in QTP/UFT


How to deploy STATUS TRANSITIONS under Service Appointment Life Cycle from one sandbox to another sandbox/production?

Question: I am trying to find the metadata/data through which I can deploy STATUS TRANSITIONS under Service Appointment Life Cycle? is there any way via which I can migrate it or will I have to replicate it manually in other org? This is what I want to migrate:
Answer: Unfortunately there isn't a way to deploy status transitions through metadata. You'll need to add a post deployment to add manually.
Alternatively you can create a script to do this but I would recommend against this as it typically over complicates things.
Answer: Salesforce does not suggest to add the transitions using script with FSL Global API's.
These API's are to be used only in test classes.
Post Deployment steps is the only way we can add the transitions.


Why does simmering sauce make bubbles and how Is it different from boiling water

Question: Why does simmering sauce makes bubbles at different places. Is this like boiling water? Why or why not?
Comment: https://en.m.wikipedia.org/wiki/Convection#Convection_cells  might help.
Comment: you have to define the sauce. In an oil and tomato sauce for example it is the steam from water that makes bubbles that are more enduring then boiling water bubbles because of the viscosity of the sauce liquid. technical study http://www.terrapub.co.jp/journals/EPS/pdf/2008/6006/60060661.pdf
Answer: You can get a somewhat similar effect in a pot of water if you bring the water to a boil and then turn the heat down a bit. Do it just right and you'll see bubbles of steam form at the bottom of the pot, separate from the bottom, start to rise, only to vanish partway up. There's a vertical temperature gradient in that pot of simmering water. The water bottom of the pot is at the boiling point while the water at the top is well below the boiling point. This temperature gradient also exists in a simmering skillet or pot of food.
That said, there are marked differences between a simmering skillet or pot of food and a simmering pot of water. One key difference is the food. You need to stir the bottom lest the food stick and burn. Food doesn't burn at 100°C; the bottom of the pan (at least underneath the food) is well over 100°C. Another key difference is viscosity. The sauce isn't just water. It's water plus a bunch of other stuff. That "other stuff" changes the nature of the liquid. The combination of huge temperature gradients and viscosity makes the bubbles of steam much bigger and longer-lasting in the simmering pan of food and sauce than in the simmering pot of water.
Answer: Water transitions from liquid to vapor when it hits the boiling point. With a pot of water approaching boiling, you'll see (and hear) boiling begin as small bubbles across the bottom of the pan, where the water is locally at the boiling point. The bubbles collapse, depositing their heat energy, when they reach cooler (higher) areas of the water. As the temperature of the bulk of the water gets closer and closer to boiling, the bubbles will reach higher and higher into the water, until they'll finally break the surface and start a rolling boil. This happens fairly evenly across the pot since the warmer water convects, distributing the heat throughout the pan.
With sauce, the same thing happens, except that since it's thick there is far less convection going on, and thus the temperature can vary more. You'll see a spot on the surface of the sauce bump up and down as bubbles form and collapse on the bottom of the pan. These bubbles will heat the sauce immediately above them when they collapse and deposit their heat energy, so the next bubbles will reach further. Finally, you'll get a column of bubbles making it all the way to the surface and blurping bits of the hot sauce across your stove.
Since there's almost no convection, the bulk of the sauce can still be below boiling when it starts blurping: for proof, stir the sauce well and the boiling will go away for a while as the cooler parts bring the warmer parts below boiling. After a few of these cycles, stirring will no longer stop the boiling, as all the sauce will be at the boiling temperature.


Is it essential to let users change their email in an app?

Question: I'm developing an app that will target almost every segment of the general population and the login will be done with the user email. My question is, should I absolutely allow a user to change his email address?
Answer: Is any data connected to the login account? Then yes. People want to keep their stuff when they change email just like when they move houses.
Is there no data connected to the login account? Then why have a login at all?
Answer: The e-mail address is a way for you to notify/warn/inform users outside their account. If users prefer to use a different address for that kind of communication, let them change it.
So from UX perspective I would call it essential.
For accounts that use an email address as login name you can give the option to add antoher e-mail address for notifications etc.
Comment: I agree with this. It's frustrating to re-register for something when you change your e-mail address. You could however require that an e-mail address is unique in your app (so no 2 users can have the same e-mail address).
Answer: Use email for sign-in not database ID
Good thing: Allowing users to sign in with their email rather than an arbitrary user name.
Bad thing: Hard-coding that address in the database as the unique identifier.
The email should just be a property of some GUID in the database. If the user changes addresses or decides to use an alternate as their primary, don't let your system architecture stop them.
Comment: This is the way.
Answer: Assuming that the Email id is the primary source of account confirmation/communication, IMO..

Let your user add Secondary email ids (as in Facebook/other products) they may own but ask them to verify the id before permanently adding the same in the master DB.
Let the user change the Primary email id with a Secondary id iff the Secondary id is verified and is not used by any other account. This will ensure that the ids are not misused.

I think this will ensure that both the frontend and the backend are kept clean/tidy.


Principal Component Regression with an additional factor

Question: I am looking to tease out the significance and contribution of a particular variable to 2 different continuous responses. I have 7 continuous variables I know to be influential on the two responses (which have been considered by the literature). I also have a categorical variable that I wish to analyze to determine which response, if any, it is significant to and the degree of that significance. I have a small sample size, 18 observations. So I worry about power and error by using multiple linear regression on the 2 responses with 8 predictors. There is also a degree of colinearity between the continuous variables.  I was wondering about the drawbacks or error in using principal component analysis on the 7 continuous variables, and extracting components to use for multiple regression analysis. Then in addition to those PC's, adding the categorical variable in the MLR. Therefore the equation would look like this:
$$
Y = \beta_0 + \beta_1*PC Score + \beta_2*Categorical
$$
The reason I am suggesting this approach is because I want to find what contributions above and beyond the 7 other variables the categorical variable contributes and control for confounding. Any suggestions/insight or alternative approaches would be awesome.
Comment: Seems like a reasonable approach to me.
Answer: This is a reasonable approach, and you probably want to do something to reduce the dimensionality of your study. Since you asked about drawbacks and errors, here are some nightmare scenarios, with suggested remedies.

Using the first PC score assumes that the predictors impact Y through a linear relationship, as in a 1 factor model. If that's not true, then the 1PC model won't capture everything that's going on with the predictors.
If the omitted information is correlated with the categorical variable, then you might have created a confounding problem with interpretation of the categorical variable.You want to see what the categorical contributes beyond "the 7", but your transformed analysis will only show what the categorical contributes beyond a linear combination of the 7.
PCA, like all variance based methods, likes big sample sizes (i.e. more than 18 subjects).

And here are some possible fixes.

Presumably, you won't use the PC approach unless the first PC actually does explain a lot of the variation.
The first PC often just delivers the mean of the variables (especially if you standardized them first). So you could always just take the mean of your predictors and go from there. I'm saying this given that the small sample size makes it difficult to produce reliable estimates of the coefficients for the PC scores.
If you had a larger sample, I would recommend something like lasso regression to see if some of the predictors could be turfed out. As it is, you might try an informal "best subsets" -- at least to check if any of the 1 or 2 variable regressions are non-significant. Unless you have serious subject matter reasons for including all of them, perhaps some of them could be dropped. That, too, would be a way of reducing the complexity of the problem.
Comment: +1, but that "The first PC [...] delivers the mean of the variables" is only true if all the variables are positively (and similarly) correlated.
Comment: That is correct. In many applications, where the variables all represent some sort of positive input, the first PC often ends up being a sort of indicator of overall size, accomplishment, preference ... whatever it is. Not much is lost by taking the mean and skipping the PC in that case. That's also why the second PC is often more interesting.


how find datacenter using a ip address related to that datacenter?

Question: I have a vds and it's really good!
I have some problems with my reseller of that server because of their support.
I want to buy a server from that datacenter directly.
How can I find that datacenter using an IP address related to that datacenter?
Answer: In most cases the owner of the datacenter will be the same company that owns the IP subnet to which your IP belongs. IP subnets are assigned and kept track of by a few RIRs (Regional Internet Registries), one per geographical region: ARIN for North America, RIPE for Europe, APNIC for asia-pacific, AFRINIC for Africa, LACNIC for Latin America, etc.
You can query these registries just like DNS, using whois:
whois -h whois.arin.net 184.108.40.206
Or, as others pointed out, there are plenty of free web sites that query multiple RIRs at once and present you the results, like http://whois.arin.net.
Answer: Just use one of a thousand websites, which gives you an information about the IP address
owner:
(See the ISP field).
http://www.ip-adress.com/ip_tracer/
Answer: You could attempt to do a whois on the IP.
Here's a site that offers it: http://www.networksolutions.com/whois/index.jsp
Also, if you run Linux, you can type whois ipaddress and that'll give you the info as well.


How do I map a sequence of objects to Maps in Scala?

Question: How do I map a sequence of class instances to a sequence of Maps in Scala?
Assume that the instances are of the following type:
class Package(_name: String, _description: String, _homepage: String = null) {
  var name: String = _name
  var description: String = _description
  var homepage: String = _homepage
}

And we have a sequence of instances of this type:
var packages = Seq(
  new Package("A", "Package A", "https://github.com/package/a"),
  new Package("B", "Package B")
)

How do I map packages to a sequence of Maps?
The Maps should be equivalent to the following:
Seq(
  ("name" -> "A", "description" -> "Package A", "homepage" -> "https://github.com/package/a"),
  ("name" -> "B", "description" -> "Package B", "homepage" -> null)
)

Comment: What do the maps look like?
Answer: Based on your edit you can do:
packages.map(p => Map(("name", p.name), ("description", p.description), ("homepage", p.homepage)))

Answer: To create a map of packages with name as the key and Package as the value this would do.
scala> packages.map(p => p.name -> p).toMap
res7: scala.collection.immutable.Map[String,Package] = Map(A -> Package@c3cec2e, B -> Package@73b5c648)


How do I load money into my bitcoin account

Question: I don't understand how I load money into my bitcoin account so I can send it to someone
Comment: The process of trading money for some amount of a commodity is known as "buying". So what you are asking is how do you buy bitcoins. The short answer is that you find someone willing to sell them to you and give them money.
Answer: Bitcoin is an asset that you can purchase, more like an electronic version of a precious metal coin than like a payment service that you load money into.
To get Bitcoin you need to buy it from someone else or have someone pay you with it for providing some product or service.
To buy Bitcoins you can use services like Bitcoin exchanges (Popular exchanges in the US today are services like Gemini and Coinbase) or you can meet people in person and trade for bitcoin peer to peer (a popular service is localbitcoins).  The set of services available to you will be different depending on where you are.
As always, beware of scams online.  If you have any friends that use Bitcoin you can ask them for advice about what services they use.


Iwahori-Hecke algebra of $GL_2$

Question: I had make an old post about this, but since seeing it now shows that I had no idea how to explain my question (because I didn't understand it) I'll try to do it normally here.
So I am studying this paper https://arxiv.org/pdf/math/0309168.pdf on Iwahori-Hecke algebras, and I am trying to apply this in the group $G=GL_2(\mathbf{Q}_p)$. Setting $K=GL_2(\mathbf{Z}_p)$ and $I=K\cap B$ where $B$ is the Borel subgroup of upper triangular matrices, I would like to understand two algebras: the algebra $H=C_c(I \setminus G / I)$ and the algebra $H_K=C_c(K\backslash G / K).$ The confusion in the previous post came from the fact that they both mainly go under the name "the Hecke algebra". Now, for $GL_2$, from high-tech things such as the Satake isomorphism we can see that $H_K\cong Z(H)\cong \mathbf{C}[s_1^{\pm},s_2^{\pm}].$ But I am also curious what $H$ exactly is in this case.
My thought is: Using lemma 1.7.1, it is enough to find just $R,H_0$. Now $H_0$ is $C_c(I \setminus K / Ι)$. These double cosets seem like they should be just $I, wI$ where $w$ is the permutation matrix (the nontrivial element of the Weyl group). So $H_0=\mathbf{C}^2$, since complex functions in these two elements are just pairs of complex numbers. $R=\mathbf{C}[Χ_*]$, where $X_*$ are essentially the elements
$\begin{pmatrix}p^m & 0\\ 0 & p^n \end{pmatrix},$ so we can identify $R$ with $\mathbf{C}[s_1^{\pm},s_2^{\pm}]$, where the coefficient of the $z_1^mz_2^n$ term corresponds to the value of the function in $\begin{pmatrix}p^m & 0\\ 0 & p^n \end{pmatrix}$.
Now the lemma should give $H=R\otimes H_0\cong \mathbf{C}^2[s_1^{\pm},s_2^{\pm}]\cong (\mathbf{C}[s_1^{\pm},s_2^{\pm}])^2,$ but this is absurd since this algebra is cmmutative and we know that the center will be $H_K$. My impression would be that $H$ should something similar to what we found, but maybe something like $H=\mathbf{C}[s_1^{\pm},s_2^{\pm}]\rtimes S_2$ where $S_2$ acts by permuting the variables, which would imply that the center is what we want, and is kind of similar to $(\mathbf{C}[s_1^{\pm},s_2^{\pm}])^2$. The problem is that although I feel that my above argument was messy, I can't pinpoint the exact mistake, which may be obvious.
Could you tell me my mistakes in the above, and also help me calculate $H$?
Answer: The Hecke algebra $C_c(I\backslash G/I)$ is calculated in Bushnell-Henniart The Local Langlands Conjecture for GL(2) Section 17.2.

Iwahori-Hecke algebra of $GL_2$


Is an electric dryer's vent pipe a fire hazard when routed through the floor?

Question: I will be venting my electric clothes dryer through a pre-cut hole in the floor.  It will be vented using flexible, foil type tubing and traveling a short distance to an exhaust on the side of my home.  My concern is how hot the dryer venting may get that is almost touching the bare wood hole in the floor.  I haven't found a collar that would fit around the 4 inch tubing and fit the hole, which is around 5 inches.  Could I line the hole with a silver foil duct tape used for HVAC jobs, etc. to protect it against the heat?  Suggestions?
Comment: A dryer will destroy the clothing inside before it gets hot enough to damage the wood floor.
Answer: It's not a concern. Dryer exhaust might hit 200 degrees, but most have thermal fuses far below that. You'd need twice that and then some to start a fire. Heck, many dryers are vented through cheap vinyl hose. If it was a concern building codes would require double-wall flues akin to those used for gas appliance exhaust.
I do recommend against the lightweight foil hose, though. It really accumulates lint. Use semi-rigid aluminum pipe at least (example). Its ridges are much smaller and it's less likely to close up on itself in a bend.
You may have heard of the risk of not cleaning the lint filter. This can result in reduced airflow and heat accumulation, but any fire is likely to begin in the dryer in this case. More on that
Comment: I do agree but use solid pipe under the floor like isherwood + suggests flex on top and clean the lint that makes it through regularly, lint fires are a major cause of dryer fires even if the lint trap is cleaned, no worries on the heat of the pipe in normal operation as far as the wood is concerned. Also if you see lint whiskers restating to build on the outside vent it is a good time to clean out the pipe.
Comment: I use the thin wall "rigid" pipe all the time with a 4 piece adjustable 90, blast the output side of a shop vac down the pipe and because it is smooth all the lint ends up out side but the flex inside still needs to be cleaned because of all the ridges .
Comment: I assumed that the duct would need to be pulled and that rigid pipe wouldn't work, but definitely use wherever possible.


Some Apple Push Notifications from Azure Mobile Services not Arriving

Question: I've been struggling with this for a few days and am stuck. I am using Azure Mobile Services and have two scheduler scripts defined. One is very simple and just sends all device tokens for User ID #1 a test push notification:
<code>function SendTestNotification() {

    sendPushNotification(1, 'SendTestNotification @ ' + new Date());

    function sendPushNotification(userId, body) {
        var users = tables.getTable('NotificationTokens');
        users.where({
            User_Id: userId
        }).read({
            success: function(tokens) {
                tokens.forEach(function(token) {
                    var alert = {
                        badge: 0,
                        alert: body,
                        sound: 'default'
                    };

                    push.apns.send(token.Token, alert,
                    {
                        error : function(err) {
                            console.error(err);
                        }
                    });
                });
            },
            error: function(error) {
                console.error(error)
                return;
            }
        });
    }
}
</code>
I have a second scheduler script which is much more elaborate and contains the actual push notification logic for my app. It contains the exact same sendPushNotification() function shown above. This 2nd script also contains an additional call to send me a "test" notification.
So all told, with these two scripts setup and scheduled, my iOS devices should get a total of 3 push notifications every 15 minutes. I have them timestamped as well so that they show when the notification was sent from the server.
However, when I run these scripts either manually or just let them run on their own every 15 minutes, I almost never get all of the notifications. Sometimes I get none. Sometimes I only get the first test notification. Sometimes I get the first test notification, the "real" notification, but not the 2nd test notification (which should have been sent by the exact same code that sent the "real" notification).
I have checked the logs on the portal and there are no errors coming back from APNS. I know the logging is working as I've seen errors for invalid device tokens in the past.
I should also state that I've sent these devices push notifications via APNS using a simple C# application with absolutely no problem.
Can anyone give any suggestions or see what I may be doing wrong? I have an app waiting to be reviewed and would love to get this issue taken care of.
Comment: So this is the 2nd time I've spent the day wrestling with intermittent issues sending push notifications from Azure where things suddenly work hours later with absolutely no code change. Are people using this stuff in production?
Answer: Last time this happened to me I changed the scale from Free to Basic, and all notification were sent.
You said that there is no error, but just remember, if an error occurs you have to start over again from the point you stopped because the apns close the connection once an error occurs.


Does't Attach Database sql Server 2008 r2

Question: unfortunately delete F Drive from My pc . here location Sql 2008 R2(main DB) .mdf and .ldf file. anyway I recover with data recovery software All this file same drive and same folder. As like previous.now when I  tried  Attach my database but it's does't Attach.enter image description here
Comment: how many files are related do this database you're having problems to attach? I ask because the fact that it's a .mdf file doesn't guarantee that it's the main file of the database. It could just be a secondary file created with the .mdf extension.
Comment: nobody .mdf  file doesn't Attach.which recover from delete.
Comment: Ok, since you used a recovery software (and it probably means you don't have an available backup to restore from) you could try using [sp_attach_single_file_db](https://docs.microsoft.com/pt-br/sql/relational-databases/system-stored-procedures/sp-attach-single-file-db-transact-sql?view=sql-server-2017) although it's not intended for this purpose. Depending on how important was that data for your organization, you could also try something like [SysTools SQL Recovey](https://www.systoolsgroup.com/updates/sql-server-error-5171-mdf-is-not-a-primary-database-file/).
Comment: I didn't mention on the previous comment, but the error 5171 seems to be related to corrupted data. The tools I advised you to try I have never used them myself, so you're on your own.
Answer: It seems like you are facing issues attaching a recovered SQL Server database after accidentally deleting the F drive from your PC. Here are steps to troubleshoot and resolve the problem:

Check File Permissions:

Ensure that the recovered .mdf and .ldf files have the necessary permissions for the SQL Server service account to access them.

Move Files to Original Location:

If the recovered files are not already there, move the .mdf and .ldf files to the original location where the SQL Server instance expects to find them.

Update File Paths in SQL Server:

If you've moved the files, you may need to update the file paths in SQL Server. Use the SQL Server Management Studio (SSMS) to modify the file paths in the database properties.

Check SQL Server Error Log:

Examine the SQL Server error log for any error messages related to the attachment process. It may provide more details on why the attachment is failing.

Use T-SQL for Attach:

Instead of using the SQL Server Management Studio GUI, try using T-SQL commands to attach the database. Open a query window and run a command like:

sql

<code>CREATE DATABASE YourDatabaseName
ON (FILENAME = 'Path\To\Your\Database.mdf'),
(FILENAME = 'Path\To\Your\Database.ldf')
FOR ATTACH;
</code>

Check Database Compatibility:

Verify that the SQL Server version you are trying to attach the database to is compatible with the version from which the database was backed up.

Check SQL Server Service Account Permissions:

Ensure that the SQL Server service account has the necessary permissions to access and read the folder where the .mdf and .ldf files are located.

Check for File Corruption:

It's possible that the recovered files may be corrupted. Verify the integrity of the recovered .mdf and .ldf files.

Database Detach and Attach:

If you have the original .mdf and .ldf files before deletion, consider detaching the database from SQL Server, copying the files back to their original location, and then attaching the database again.

Seek Professional Assistance:

If all else fails, consider seeking assistance from a database administrator or SQL Server expert who may be able to diagnose and resolve the issue more specifically.
Comment: Is this A.I. generated?


how do i make an executable java archive run automatically when i login?

Question: How do I make a executable java archive run automatically in Ubuntu 12.04 lts? i tried going to the start menu and then clicking on start up applications, but when I restarted my computer to see if it worked, I found that it didn't start the program automatically. if it helps, I want to run minecraft automatically on start up. Please help -dkino14
Comment: Tell us how would you open the program from the terminal.
Answer: METHOD 1
sudo mv /minecraftstartscript.sh /etc/init.d/
sudo chmod +x /etc/init.d/minecraftstartscript.sh
sudo update-rc.d minecraftstartscript.sh defaults

From Dave at Stack Exchange I do not recommend this for loading minecraft at start. Please note that this creates something that can break your startup if applied inappropriately.
METHOD 2
My recommend method.
You should also look into the scripts that gnome (/home/{username}/.config/autostart) & X server runs to add your
/usr/bin/java /path/to/minecraft

command to.

add the command to run Minecraft to somefilename.desktop as well as a method to verify the network has been properly loaded.
move somefilename.desktop to /home/{username}/.config/autostart/
Profit?


Error 310 (net::ERR_TOO_MANY_REDIRECTS):

Question: What is this error:
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

I use PHP CodeIgniter and library SimpleLoginSecure, this is my code:
if ($this->session->userdata('logged_in')) {
    redirect('admin/index');
}

How can I resolve this error?
Regards
Answer: I'm guessing you get an infinite redirect loop: you get redirected to admin/index, this same code snippet is run again, redirecting to admin/index ad infinitum. You probably want to add a check to that snippet and only do the redirect if you're NOT on the admin/index page.
Comment: I had this happen to me and this was the problem.
Answer: You should not use redirect() function in your class's __construct().
Answer: My solution:
$self    = $_SERVER['PHP_SELF'];
$str2use = strrchr($self, '/');
$length  = strlen($str2use) -1;
@$fname  = substr($str2use, 1, $length);

if ($fname != "YOURPHPSCRIPT.php"){
    echo "";
    exit;
}

Answer: I just ran into this with a blog I manage and it ended up being a problem with the URLs set in wp_options. We moved the domain of the dev server and while one of domain prefix changes took in the database, the other didn't. If your url is set for http://domain.com, try setting it to http://www.domain.com.
Just goes to show it always helps to start with double-checking your settings, both in wp-config.php and the db site settings.
Answer: check maybe you loading "index" page again somewhere in your code when the index page loading.
redirect('admin/index');


Independent and dependent variables

Question: Im doing this presentation for school and we have to find out who exactly first used independent and dependent variables. I've searched everywhere but no answer was found its either John radford young or Marshall.
Answer: Have you seen the Earliest Known Uses of the Word of Mathematics.
https://jeff560.tripod.com/d.html
The point is that this might be first English usage? What about German or French?

"DEPENDENT/INDEPENDENT VARIABLE. Independent variable appears in 1813
in Memoirs of the Analytical Society (Cambridge): "The method of
Laplace for reducing an equation of the first order, where the
difference of the independent variable is any function of the variable
itself, to one wherein that difference is constant, is well known."
[Google print search by James A. Landau]
Subordinate variable and independent variable appear in English in the
1816 translation of Differential and Integral Calculus by Lacroix:
"Treating the subordinate variables as implicit functions of the
indepdndent [sic] ones" [OED].
Dependent variable appears in in 1831 in the second edition of
Elements of the Differential Calculus (1836) by John Radford Young:
"On account of this dependence of the value of the function upon that
of the variable the former, that is y, is called the dependent
variable, and the latter, x, the independent variable" [James A.
Landau].
In Statistics R. A  Fisher used the terms dependent and independent in
his presentation of regression analysis: see Section 25 of Statistical
Methods for Research Workers (1925) on "Regression coefficients". For
Fisher these terms qualified variate but later writers have generally
favoured variable.

Independent and dependent variables


Transformer: where is the output of the last FF sub-layer of the encoder used?

Question: In the "Attention Is All You Need" paper, the decoder consists of two attention sub-layers in each layer followed by a FF sub-layer.
The first is a masked self attention which gets as an input the output of the decoder in the previous step (and the first input is a special start token).
The second, 'encoder-decoder', attention sub-layer gets as an input queries from the lower self-attention sub-layer and keys & values from the encoder.
I do not see the use of the output of the FF sub-layer in the encoder; can someone explain where is it used?
Thanks
Answer: We can see this in the original Transformer diagram:

The output of the last encoder FF layer is added to the original input of the same layer, then layer normalization is applied and that is the output of the whole encoder, which is used as keys and values for the encoder-decoder attention blocks in the decoder.
Comment: "which is used"; how exactly is it used?
i.e., the last encoder, as all the encoders below it, outputs (using Q,K,V matrices) a sequence 'Z'.
Now, the decoder uses two types of attention mechanisms in each layer: the first is self attention which DOES NOT take an input directly from the encoder at all.
The second is encoder-decoder attention which takes as an input K,V directly from the encoder.
In both cases, 'Z' is not used by the decoder...
So where is this 'Z' used? Only in upper layers inside the encoder itself?
Thanks
Comment: The keys and values of the encoder-decoder attention blocks in the decoder **are** the output of the last layer of the encoder, as shown in the figure.
Comment: I don't know what you are referring to as 'Z'. I think the figure is very informative and complete. Which of the elements of the figure are you assigning that 'Z' ?
Comment: OK, I think I got it.
I did not ask about the keys and values (which are indeed the input to the 'encoder-decoder' attention sub-layer of the decoder), but about the sequence (I denoted by 'Z' above) which is generated in the second sub-layer of each encoder, i.e. after FF, Add & Norm; I wondered where it is used.
So probably this sequence is used only in the encoders, that is, each encoder outputs a sequence which is used as an input to the subsequent encoder layer; except for the last one, which as you wrote @noe, outputs the keys and values. Thanks.
Comment: I'm glad that the answer could help. Please, consider marking the answer as correct with the tick (✓ ) button.


Got a Yamaha MBK 100cc scooter the problem

Question: Yamaha MBK 100cc starting problem turn the key no lights on the dash no electric start but it will start off kick start but still no light none ov them
Comment: Welcome to Motor Vehicle Maintenance & Repair! Have you checked the condition of the battery to make sure it has a charge? No lights/start ... this is the first place I'd look.
Answer: Don't have enough points to comment, but I agree with Paulster2.  Almost certainly you have a marginal battery.  Enough power for the relatively low demands of the electronic ignition while you kick start, not enough to power the electric starter or instruments.


Boundary conditions for calculus of variations in phase space and under canonical transformations

Question: This might be a stupid question, but I just don't get it. In Hamiltonian mechanics, when examining conditions for a $(\boldsymbol{q},\boldsymbol{p})\rightarrow(\boldsymbol{Q},\boldsymbol{P})$ transformation to be canonical, one starts with
$$ \dot{q}_ip^i-H(\boldsymbol{q},\boldsymbol{p},t)= \dot{Q}_iP^i-\bar{H}(\boldsymbol{Q},\boldsymbol{P},t)+\frac{d}{dt}W(\boldsymbol{q},\boldsymbol{Q},t) \ ,$$
where $\bar{H}$ is the transformed Hamiltonian, and $W$ is the generating function (now a function of $\boldsymbol{q}$ and $\boldsymbol{Q}$). This term shouldn't break Hamilton's principle, since
$$ \delta\int_{t_1}^{t_2} dt\frac{d}{dt}W(\boldsymbol{q},\boldsymbol{Q},t)=\delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_2}-\delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_1}=0-0=0 \ . $$
But I don't see why the variation of $W$ should disappear at the endpoints (say at $t_1$). Expanding leads to:
$$ \delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_1}=\left(\frac{\partial W}{\partial q_i}\right)_{t_1}\underbrace{\delta q_i(t_1)}_{=0}+ \left(\frac{\partial W}{\partial Q_i}\right)_{t_1}\delta Q_i(t_1)=\left(\frac{\partial W}{\partial Q_i}\right)_{t_1}\delta Q_i(t_1) \ . $$
$\boldsymbol{Q}$ is itself a function of $\boldsymbol{q}$ and $\boldsymbol{p}$, so
$$ \delta Q_i(t_1)=\left(\frac{\partial Q_i}{\partial q_k}\right)_{t_1}\underbrace{\delta q_k(t_1)}_{=0}+\left(\frac{\partial Q_i}{\partial p_k}\right)_{t_1}\delta p_k(t_1)=\left(\frac{\partial Q_i}{\partial p_k}\right)_{t_1}\delta p_k(t_1) \ . $$
It seems as if we also needed the variation of $\boldsymbol{p}$ to vanish at the endpoints, and I don't get this because (at least in cartesian coordinates) $\boldsymbol{p}=m\dot{\boldsymbol{q}}$ and the velocity can be different along the original and the varied paths even at the endpoints (they can point in totally different directions), so in general $\delta \dot{\boldsymbol{q}}(t_1)\neq 0$. What am I doing wrong? Can someone help me with this, please?
Comment: Endpoints are held fixed during the path variation, so the variation of any function at the endpoints is zero.
Comment: Endpoints are fixed indeed ($\delta q(t_1)=\delta q(t_2)=0$), but for some function $f(\boldsymbol{q,p})$, $\delta f(\boldsymbol{q,p})=0$ would require $\delta p(t_1)=\delta p(t_2)=0$ too and I can't see how fixing the endpoints only (and not the derivatives!) guarantees this condition.
Comment: I think you're confusing $\delta p$ and $p$. We're varying both $q$ and $p$ when we work in a variational principle but hold both $q$ and $p$ fixed at the endpoints of the path. $\delta q = \delta p = 0$ at the endpoints, even if the values of $q$ and $p$ are nonzero themselves.
Comment: OK, I think this is, what I actually don't understand: here $\delta p(t_1)=\delta p(t_2)=0$ is the same as $\delta \dot{q}(t_1)=\delta \dot{q}(t_2)=0$ would be in Lagrangian mechanics (again, thinking in cartesian coordinates), but in Lagrangian mechanics we don't have this kind of condition for the velocity. Or do we?
Answer: These are very good questions.

Let us start with the old phase space variables $(q^k,p_{\ell})$. The Hamiltonian action is
$$S_H~=~\int_{t_i}^{t_f} \! dt ~L_H, \qquad L_H~:=~\dot{q}^j p_j - H(q,p,t).\tag{A}$$
Its infinitesimal variation reads
$$ \delta S_H ~=~ \text{bulk-terms} ~+~ \text{boundary-terms},\tag{B}$$
where
$$\text{bulk-terms}~=~\int_{t_i}^{t_f} \! dt \left(\frac{\delta S_H}{\delta q^j}\delta q^j + \frac{\delta S_H}{\delta p_j}\delta p_j  \right)\tag{C}$$
yield Hamilton's equations, and where
$$\text{boundary-terms}~=~\left[p_j\underbrace{\delta q^j}_{=0} \right]_{t=t_i}^{t=t_f}~=~0\tag{D}$$
vanish as they should because of, say$^1$, essential/Dirichlet boundary conditions (BCs)
$$ q^j(t_i)~=~q^j_i\qquad\text{and}\qquad q^j(t_f)~=~q^j_f. \tag{E}$$
Notice that the momenta$^2$ $p_j$ are unconstrained at the boundary.

Next let us consider new phase space variables $(Q^k,P_{\ell})$. The action of type 1 reads$^3$
$$S_1~:=~\int_{t_i}^{t_f} \! dt ~L_1~=~S_K+\left[ F_1(q,Q,t) \right]_{t=t_i}^{t=t_f}, \qquad S_K~:=~\int_{t_i}^{t_f} \! dt ~L_K, $$
$$ L_1~:=~L_K+\frac{dF_1(q,Q,t)}{dt}, \qquad L_K~:=~ \dot{Q}^j P_j - K(Q,P,t),\tag{F}$$
where the old positions $q^j=q^j(Q,P,t)$ are implicit functions of the new phase space variables $(Q^k,P_{\ell})$. Its infinitesimal variation reads
$$ \delta S_1 ~=~ \text{bulk-terms} ~+~ \text{boundary-terms},\tag{G}$$
where
$$\text{bulk-terms}~=~\int_{t_i}^{t_f} \! dt \left(\frac{\delta S_1}{\delta Q^j}\delta Q^j + \frac{\delta S_1}{\delta P_j}\delta P_j  \right)\tag{H}$$
yield Kamilton's equations, and where
$$\text{boundary-terms}~=~\left[\underbrace{\left(P_j+\frac{\partial F_1}{\partial Q^j}\right)}_{=0}\delta Q^j +\frac{\partial F_1}{\partial q^i}\underbrace{\delta q^j}_{=0} \right]_{t=t_i}^{t=t_f}~=~0\tag{I}$$
vanish as they should. One drawback is that it is non-trivial how to recast the Dirichlet BCs (E) in the new phase space variables $(Q^k,P_{\ell})$.

--
$^1$ Alternatively, one could impose natural BCs, or perhaps some mixture thereof.
$^2$ Note that in QM it would conflict with the HUP to simultaneously impose BCs on a canonical conjugate pair.
$^3$ Notation conventions: Kamiltonian $K\equiv\bar{H}$ and type 1 generating function $F_1\equiv G_1\equiv W$.
Comment: Ah, now I see! It is not $\delta Q^i$ (and thus not $\delta p_k$) which must vanish (and which could not happen anyway), but it's "coefficient", leading you to the well-known canonical conditions for the generating function. Thank you, nice answer :)


MacBook Pro (Late 2011) sound issues in Windows 10 (no Bootcamp)

Question: I recently installed Windows 10 on my MacBook Pro (Late 2011). I installed the drivers I could find from the internet (I installed this package https://support.apple.com/kb/dl1721?locale=en_GB) and everything is working fine (kind of very bad performance) but the sound. I can't get it to work, the speaker in the menubar (in windows) shows a red cross and when I hover the mouse over it it says: No Audio output device installed. In Device Manager, the internal speaker appears but it displays an initialization error (code 10). I wiped macOS during installation so I have no access to it (or to recovery mode). Please Help.
Comment: Are you using Bootcamp? Did you attempt to make a driver disc from the bootcamp installer and use that to install the appropriate Windows drivers for your hardware?
Comment: Nope, I wiped my entire hard drive. Originally I was going to install macOS again and then use bootcamp to install Windows but since I don't use macOS anyways, I chose to install Windows only.
Answer: If anyone is still interested I have found the solution for audio on MBP 2011 Windows 10 UEFI installs - it has taken me 4 years to figure out. I was given the answer from a tutorial only adjacently related -here:
https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/
essentially what we knew was that windows didn't 'see' the correct audio devices when booted in pure efi-
The part that was frustrating to me was that many users like myself have lots of UEFI installs on their 2011 MBP and those OS's have no problem 'seeing' the HD audio controller -
So what was windows doing different?
I had messed around with mm commands in a UEFI shell (The shell provided in the rEFIt package) to no avail*
I had tried to pass SETPCI commands from grub into Windows 10- no luck*
A quote from the link above got my brain spinning
"A Windows system's DSDT table root bridge definition (ACPI PNP0A08 or PNP0A03) is usually confined to a reserved 32-bit space (under 4GB) budgeted to be large enough to host the notebook's PCIe devices. A watermark TOLUD value is then set and locked in the system firmware. Windows OS honors the root bridge definition and will allocate PCIe devices within it. macOS ignores the root bridge constraints as too does Linux when booted with the 'pci=noCRS' parameter. Neither of those OS require a DSDT override and can allocate freely in the huge 64-bit PCIe address space"
So Windows 'honors' the root bridge and OSX and linux disregard it --hmmm interesting.
As someone who also deals in hackintoshes I am very aware of DSDT's and how editing them can help get OSX running on home brew PC hardware- I had played around with installing Clover (the UEFI bootloader almost synonymous with Hackintoshes) on USB thumb drives and putting the DSDT from my MBP 2011 in the /Clover/ACPI/Windows folder - still nothing-- I thought that pointing windows to a DSDT would be enough.......
A side note is that there are people who have 'bricked' their real Macs when using clover, I have never had that issue personally  (a sub-link in the link above describes such a situation)*
If you follow the guide and make a modified DSDT (one that add 'qwords' to the dwords section) you can test it in two ways-

I used Maciasl to extract and edit my DSDT to add a 'Qword' section - I placed the DSDT in two locations /EFI/Clover/ACPI/Patched [not sure if that one matters] & /EFI/Clover/ACPI/Windows
holding ALT/option during bootup I selected "EFI Boot" from the USB clover and booted into Clover
for the exact Clover configuration send me a message
After booting into windows the sound card was immediately working (this was because I had installed the cirrus logic drivers from bootcamp 4) - the display audio driver in device manager had an exclamation point but I was able to install the display audio driver from intel's driver support for the i7 2470m CPU in this machine-

I also looked at device manager via 'by resources' and saw that a new entry 'Large memory with an address range appeared

And low and behold the address range for the 'large memory section' contained the range for the hd audio controller

I then wanted to see if the method described in the initial link posted above where you force that memory map into the registry and turn on 'test signing' worked --
it did, which allowed me to boot directly into windows without the help of clover --
*NOTE: when I tested the registry method I skipped the first few steps since I already had a modified DSDT- I did need to create the 'C:\dsdt folder and extract the windows binaries to that folder - but I did not use their acpi dump nor compiler (I check for errors and compiled my dsdt in Maciasl in OSX)
I would gladly go more in depth but I doubt there are many more who need this information- just glad to have figured it out without the BIOS emulation of bootcamp- going to test this method on other 'pre 2013' Macs with non complient UEFI bios'
Comment: That is super interesting and helpful. I am having a similar issue with my Mid-2011 iMac where the Cirrus audio device doesn't get exposed to Windows 10 in EFI mode. Going to try this DSDT override and see how it goes; I would much rather keep Windows running with EFI than old MBR. Thanks so much for sharing.
Comment: Thanks for that guide!
Answer: For anyone stumbling upon this thread, some answers here are misleading.
You can install Win10 on a Late 2011 Macbook Pro.
But when you install it in EFI mode, you will have problems with sound - this can't be solved with drivers, as older (pre-2013) Macbook UEFI will simply not expose the sound card interface to Windows. You will also encounter problems with discrete graphics driver (eg. you can't use hardware acceleration or adjust screen brightness).
The easiest way to get it to work is to reinstall Win 10 in Legacy/BIOS/Hybrid MBR mode that Bootcamp offers. This is the best guide on how to do this: https://www.reddit.com/r/mac/comments/3rzxd5/guide_windows_10_bootcamp_on_unsupported_macs/
Quick workarounds:

use Bluetooth speakers/headset
Use a USB audio dongle

They will work independently of the sound card.
Comment: I've had the same problem with the same setup. The bluetooth headphone workaround worked a treat.
Comment: In my Macbook Pro mid 2012 there is no sound by legacy BIOS either.
Comment: Using [OpenCore](https://dortania.github.io/OpenCore-Legacy-Patcher/WINDOWS.html) as the UEFI bootloader worked perfectly well for reanimating an A1278 macbook where all else failed.
Answer: Read the webpage you downloaded the support software from more carefully.

Note: If you are using one of the Macs listed below, you should download Boot Camp Support Software 5.1.5621 instead:

MacBook Pro (13-inch,15-inch & 17-inch  Late 2011)

Try downloading and installing Boot Camp Support Software 5.1.5621 and that should fix your problem.
Comment: Tried it, sound still not working
Answer: I would check out this link here. Use Windows 10 on your Mac with Boot Camp
System Requirements

You need support software (drivers) installed with Boot Camp to use Windows 10.
This software is automatically downloaded when you use Boot Camp Assistant.
Boot Camp supports 64-bit versions of Windows 10 when used with a supported Mac.

Here's the Compatibility Charts for Windows 7.
The MacBook Pro Late 2011 is not listed on the Windows 10 compatibility charts.
**But really, here's the guide for installing and setting up Windows on a Mac support.apple.com/en-us/HT204923  support.apple com/en-us/HT204923 **
I did also poke around and found this guide for installing it sans bootcamp fgimian.github io/blog/2016/03/12/installing-windows-10-on-a-mac-without-bootcamp . But, actually, it's really a guide to doing everything manually past downloading Bootcamp from Apple.
I feel like you need to do this on your own, or an near identical machine. I'm guessing it downloads the specific driver package for your exact machine \ model.
Had to ruin some of the links here since I don't have enough reputation.
Sorry. :(
Answer:
I fixed the problem on my MacBook Pro (Late 2011).
1.Download BootCamp6.
2.Run as administrator on the win10 command line :
your bootcamp6 file directory\BootCamp6.0.6133\BootCamp\Drivers\Apple\BootCamp.msi

Comment: Answers on Ask Different need to be more than just a link. We expect answers to be self contained, since if your link goes down, or the link points to a non-english site, your answer will be useless. Paraphrasing the source and including any relevant information in the answer will ensure it stays relevant
Comment: So at the very minimum please include the actual command line to run *as text* so people can copy/paste it. If you also can take some of the explanations from the linked page and paraphrase them in english: even the better.
Comment: Either point your download link to an official Apple URL or delete your answer!
Comment: You do not need to run the Boot Camp Drivers **.msi** file from the Command Line, simply right-click on it and select **Run as  administrator**.
Comment: Do not try this method. Your computer will just BSOD. Trackpad and Keyboard will no longer work correctly
Answer: You just have to delete the audio file of realtek from bootcamp and make the install this solution works for me.


Abbreviations for pinyin and hepburn transliterations?

Question: Are there 2 letter ISO codes for the pinyin or hepburn transliterations? If not, are there non-ISO abbreviations in common use? Thanks.
Comment: As I recall and from what I understand, Hepburn is not used for transliterating Chinese, but Japanese. I've been wrong before though.
Comment: Yes, I know this. I should have been more clear.
Answer: ISO has codes for languages (ISO 639), and for scripts (ISO 15924); but it has no codes for transliterations, as you can see by perusing ISO's standards on Writing and Transliteration. ISO adopts and standardises transliterations; but unlike languages and scripts, it has not catalogued them.
Using existing ISO codes, zh-Latn means "Chinese in Latin Script", and zh-CN-Latn means "Chinese in Latin Script, localised to China"; but that just implies "Pinyin" (and what country would we attribute Hepburn to?) It is not a solution.
I can't find evidence that there are standard codes for transliterations anywhere else either. A 2011 IETF RFC draft for transliteration codes went nowhere.
Comment: In GNU/Linux computer environments (or others using the GNU libc), locales can have "variants" following an at-sign.  So `uz` is Uzbek but `uz@cyrillic` is Uzbek in Cyrillic; Kashmir has `ks@aran` (Perso-Arabic script) and `ks@deva` (Devanagari), etc. There aren't any for transliterations so far, but this "variant" system isn't used just for scripts; it includes things like dialects (`sr@ijekavian`), typographic tuning (`en@quot`), even jokes (`en@piglatin`). Of course, this isn't any sort of standard; I'm only commenting the existence of this system for completeness' sake.
Answer: ISO has some standard romanization systems listed at https://en.wikipedia.org/wiki/List_of_ISO_romanizations. Pinyin is ISO 7098, but unfortunately no other systems of Chinese romanizations have been given ISO codes so you may not find this useful.


(How) can I fill a visitor's cart by using a link?

Question: When using Commerce 2, is there a way to fill a client's cart with the contents of an (inactive) cart, by using a link? Use case: abandoned cart email.
Answer: There is currently no way to populate a cart from a link as a standard feature of Commerce 2.
But you could accomplish this in 2 ways.
1) With a smart template to add all items from the order to the current cart.
Create a template that takes an order number param like so:
cart/start-order?number=5bnuy8843nuy48bdy48u3bd84
In that template you would do the following:
{# @var craft \craft\web\twig\variables\CraftVariable #}

{% set number = craft.app.request.param('number') %}
{% set previousOrder = craft.orders.number(number).one() %}

{% if not order %}
  {% redirect 'shop' %}
{% endif %}

{# Get the current cart if there is one, also make sure the cart is persisted so we can add to it. #}

{% if cart is not defined %}
  {% set cart = craft.commerce.getCarts().getCart(true) %}
{% endif %}

{# Clears the current cart. This is optional as you may just want to add the items to the cart #}
{% do cart.setLineItems([]) %}

{% for oldLineItem in previousOrder.lineItems %}

  {% set lineItem = craft.commerce.lineitems.createLineItem(cart.id, oldLineItem.purchasableId, oldLineItem.options, oldLineItem.qty, oldLineItem.note) %}

  {% do cart.addLineItem(lineItem) %}

{% endfor %}

{% do craft.app.elements.saveElement(cart) %}

{%  for lineItem in cart.lineItems %}
  {{  lineItem.qty }} * {{ lineItem.description }}
{%  endfor %}

This add all items from the cart in the email link to the current cart. You would do a similar thing to populate addresses etc if you wish.
2) Alternatively, if you just want to replace the current cart in the users session with the incomplete cart you passed in from the email's number param, you could do the following

Create a plugin/model with a controller action.
The controller action would accept an order number param (like the template example above)
The controller action would do the following:

Code:
$request = Craft::$app->getRequest();
$session = Craft::$app->getSession();

$number = $request->getParam('number');
$order = \craft\commerce\elements\Order:find()->number($number)->one();

if ($order && !$order->isCompleted){
  // Forget the current cart in their session.
  \craft\commerce\Plugin::getInstance()->getCarts()->forgetCart();

  $session->set('commerce_cart', $number);
  return $this->redirect('shop/cart');
}

return $this->redirect('shop/cartLoadError');

This should get you mostly there. Let me know if you have any questions.
Comment: Thanks for these solutions, Luke! Will there be functionality like this in Commerce (as it's a very common use case), that would make it a better choice to wait a bit?