IE9 and lower doesn't sends request body on AJAX call to a different domain

Question: I tried everything I found on Google to make it work, but without a success.
I'm trying to call an HTTP request to a server on a different domain.
On all browser it works, even on IE10. But, on IE9 and lower it doesn't seems to work correctly.
On IE9 and lower, it sends only the header without a body on all methods.
I'm using jQuery to make the AJAX call, the call can be called from a different domain (actually it can be from any domain).
A JavaScript example :
$.ajax({
    url: "http://api.domain.com/path",
    type: "POST",
    crossDomain: true,
    cache: false,
    data: JSON.stringify({data:"some body data in a json format"}),
    dataType: "json",
    contentType: "application/json",
    success: function(data, textStatus, jqXHR){
        console.log("Response data: ", data, textStatus, jqXHR);
    },
    error: function(jqXHR, textStatus, errorThrown){
        console.error("AJAX error: ", jqXHR, textStatus, errorThrown);
    }
});

Request on IE9:
POST /path HTTP/1.1
Origin: http://[some domain]
Accept-Language: en-GB
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: api.domain.com
Content-Length: 0
DNT: 1
Connection: Keep-Alive
Cache-Control: no-cache
Accept: */*

[no request body]

The response from the server is:
HTTP/1.1 500 Internal Server Error
Server: MochiWeb/1.1 WebMachine/1.9.2 (someone had painted it blue)
Date: Mon, 17 Jun 2013 11:24:26 GMT
Content-Type: text/html
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true

I'm using the jQuery.XDomainRequest plugin, but it doesn't helps.
I'm also set jQuery.support.cors = true;, but it doesn't helps either.
I thing it's important to mention that on IE10 it sends an OPTIONS request before the POST request, when on IE9 just POST request.
Any suggestions?
Answer: I am not aware with this jQuery plugin. But sending ajax post to cross domain is a security concern. So browser does not support this. It's amazing how you can manage posting data to other domain.
Below link might be helpful
Why the cross-domain Ajax is a security concern?
Comment: It is possible if the server responded with the header `Access-Control-Allow-Origin: *`


Intent and Karmic benefit

Question: With intent being so important, would the karmic benefit of saving someone's life because they were in danger be the same as doing it because you thought you would be rewarded for it?
Answer: While the act of saving someone's life does bring great overall benefits to the person's future lives, his intent does influence the orientation of such wholesome rewards. For example, a person performing the act with the intent toward relinquishment and liberation will receive an outcome conducive toward that direction, while another performing the same act, but with the intent of gaining worldly rewards, hence  would also get positive outcomes, though oriented towards more of a mundane worldly kind of merits.
Answer: The Pali scripture says "kamma is intention"

Intention, I tell you, is kamma. Intending, one does kamma by way of body, speech & intellect.
AN 6.63

Therefore, intention born of greed will not be the same as intention born of good-will.

Bhikkhus, a god, a human or any other good state would not be evident
from actions born of greed, hate and delusion. Yet, bhikkhus, from
actions born of greed, hate and delusion a hellish being, an animal
birth a ghostly birth or some other bad state would be evident.
AN 6.39
Answer: The intent is certainly the most important thing for karma.
Let's use giving gifts as an example.
There are eight reasons why one may give gifts.

"Bhikkhus, there are these eight grounds for giving. What eight? (1)
One gives a gift from desire. (2) One gives a gift from hatred. (3)
One gives a gift from delusion. (4) One gives a gift from fear. (5)
One gives a gift, thinking: 'Giving was practiced before by my father
and forefathers; I should not abandon this ancient family custom.' (6)
One gives a gift, thinking: 'Having given this gift, with the breakup
of the body, after death, I will be reborn in a good destination, in a
heavenly world.' (7) One gives a gift, thinking: 'When I am giving
this gift my mind becomes placid, and elation and joy arise.' (8) One
gives a gift for the purpose of ornamenting the mind, equipping the
mind. These are the eight grounds for giving."
AN 8.33

All eight are not equal.
Of the eight listed, the last one, which is ornamenting the mind or adorning the mind, is the highest reason with the highest benefit.
Please see this answer for details on what is meant by "ornamenting" or "adorning" the mind.

"Yes, Sariputta, there would be the case where a person gives a gift
of a certain sort and it does not bear great fruit or great benefit,
whereas another person gives a gift of the same sort and it bears
great fruit and great benefit. .......
"Having given this gift seeking his own profit—with a mind attached
[to the reward], seeking to store up for himself, [with the thought],
'I'll enjoy this after death'—on the break-up of the body, after
death, he reappears in the company of the Four Great Kings. Then,
having exhausted that action, that power, that status, that
sovereignty, he is a returner, coming back to this world. ......
"—but with the thought, 'This is an ornament for the mind, a support
for the mind'—on the break-up of the body, after death, he reappears
in the company of Brahma's Retinue. Then, having exhausted that
action, that power, that status, that sovereignty, he is a
non-returner. He does not come back to this world.
"This, Sariputta, is the cause, this is the reason, why a person gives
a gift of a certain sort and it does not bear great fruit or great
benefit, whereas another person gives a gift of the same sort and it
bears great fruit and great benefit."
AN 7.52
Answer: No the two are different in intent and what that intent does to you.
When you save someone with the intent of saving that person, that act is an act of compassion. Its an act you performed for the benefit of the other person. Not to accrue something for you. When you do such an act that Karma does little or no contribution to reinforce that the saknkna (signal) of yourself. Thus, such an act of altruism does not contribute to you building 'sakhkhaya dhitti' (the mistake of taking the process of living as a person - in short: 'I').
When you do the same act with an expectation on your mind, that act reinforces the concept of 'self' in you.
Say you saved person X, that means;

You are the savior of X
X exists
X exists as part of the existing World
If X was Saved by me, then I exist
Because World exists and I perceive it, I exist

At the core of it, the effort is to reinforce yourself that 'you' exist. This is quite dangerous for the practicing Buddhist. This is why, practicing Buddhists perform their acts without any expectations or returns. They are trying to see through the process which we simply take for-grant as 'myself'. Anything that reinforces it, is thought of as a hindrance to Nirvana.

Intent and Karmic benefit


How to get rid of _WIN32_WINNT not defined warning?

Question: _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)

This error keeps popping up during my compilation. It doesn't seem to affect compilation, but how should I get rid of it? Am I risking anything by ignoring it?
Answer: Set it to the oldest Windows Operating System you want your program to run on.
The possible values are given in this MSDN article, Using the Windows Headers.

You can define these symbols by using the #define statement in each
  source file, or by specifying the /D compiler option supported by
  Visual C++.
For example, to set WINVER in your source file, use the
  following statement:
 #define WINVER 0x0502    // Windows Server 2003 with SP1, Windows XP with SP2

To set _WIN32_WINNT in your source file, use the following statement:
#define _WIN32_WINNT 0x0502    // Windows Server 2003 with SP1, Windows XP with SP2

To set _WIN32_WINNT using the /D compiler option, use the following command:
cl -c /D_WIN32_WINNT=0x0502 source.cpp

Answer: It is defined for you through WinSDKVer.h. So just define it explicitly on the top of your source code (e.g. in the beginning of stdafx.h) and you will get rid of the warning.
Having it defined to the same value (as compared to _WIN32_WINNT_MAXVER from WinSDKVer.h) is highly unlikely to break anything.
For example, WinSDKVer.h of Windows® Software Development Kit (SDK) for Windows 7 and .NET Framework 3.5 Service Pack 1 contains:
// This list contains the highest version constants supported by content
// in the Windows SDK.

// [...]
#define _WIN32_WINNT_MAXVER     0x0601

Comment: I'd recommend adding it to StdAfx.h almost at the beginning. Here is a list of values for each OS. http://msdn.microsoft.com/en-us/library/aa383745%28VS.85%29.aspx
Comment: `WIN32_WINNT` is defined by default through `sdkddkver.h`, while `WinSDKVer.h` defines `_WIN32_WINNT_MAXVER` and related `MAXVER` macros (which are usually set to the most recent Windows version suppported by that version of the Windows SDK).

Defining `_WIN32_WINNT` to a valid value will resolve the warning which  User982367637 was asking about.  Whether that value should be `_WIN32_WINNT_MAXVER` or an older Windows version depends on whether they want their app to be able to run on older versions of Windows (as noted by the answer from user93353, below).
Answer: Solving in VS2019
Ways to solve this and a link to possible values to use can be found here in the super answer by user93353 which I used to solve the problem.
https://stackoverflow.com/a/12871547/3070485
However, after reading the solution, I set my compiler option in my IDE which is Visual Studio 2019.
For anyone wanting to set it there quickly and wanting to know the location (as these things change from IDE release to release, or maybe someone is more familiar with another IDE), here is where it went.

Configuration Properties
C/C++
Preprocessor
Preprocessor Definitions
_WIN32_WINNT=0x0502
Answer: Note: the #define _WIN32_WINNT must occur before any header file, including "stdafx.h".
Comment: @Stonz2 I dunno... [A] The OP complains he's getting a "_WIN32_WINNT not defined" error. [B] I tell him where to define _WIN32_WINNT to get rid of the error (see where he asks "how should I get rid of it?") . [C] Doesn't this sort of help him?
Comment: Down-voting.  See my answer below.
Answer: If using MFC: My preferred answer is to include windows.h. But if you are using MFC, you cannot do this*. To avoid defining WINVER in your project, instead you can include sdkddkver.h before afx.h.
#include <sdkddkver.h>
#include <afx.h>

The sdkddkver system header sets WINVER and _WIN32_WINNT so you don't need to add it to your project. This does the same as windows.h for versioning windows SDK/DDK from the system headers.
*if you include windows.h before afx.h you get: #error:  WINDOWS.H already included.  MFC apps must not #include <Windows.h>
Answer: #define _WIN32_WINNT and #define WINVER can occur in a header, so long as they occur before including SDKDDKVer.h or any headers from the Windows SDK (in particular Windows.h).  Visual Studio VC++ projects typically provide a targetver.h header, where you can include WinSDKVer.h, define _WIN32_WINNT, NTDDI_VERSION and WINVER, and then include SDKDDKVer.h.  Comments within this file say:
// If you wish to build your application for a previous Windows platform, include `WinSDKVer.h`
// and set the _WIN32_WINNT macro to the platform you wish to support before including `SDKDDKVer.h`.

The Microsoft article Update WINVER and _WIN32_WINNT goes out of its way to instruct you to define _WIN32_WINNT and WINVER in targetver.h (though it mentions these can be defined using command-line parameters, too).
Note: targetver.h gets included in certain .rc resource files generated by Visual Studio, so this is another reason to fill out the contents of the  targetver.h file as described, above.
Note: defining _WIN32_WINNT, NTDDI_VERSION and WINVER using command-line parameters or preprocessor directives within the project's build configurations can also work, but neither takes care of the need to include WinSDKVer.h and SDKDDKVer.h.
Note: when using the Windows 8.1 SDK (or newer), you may also need to define WINAPI_FAMILY in targetver.h depending on the specific Windows platform (server, desktop, phone, store, etc.) you need.  See winapifamily.h for details.
Note: In newer Windows SDK versions, the values NTDDI_VERSION, WINVER and _WIN32_IE can be set automatically based on the value you define for _WIN32_WINNT.  However, you may want to define a more specific version for NTDDI_VERSION explicitly prior to including SDKDDKVer.h.


Does Hostmonster support Django

Question: I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
Comment: I'm on a shared plan and have access to python 2.6.6, 2.7.3 and 3.2.3. As expected you have little ability to install new packages, but you can use http://pypi.python.org/pypi/virtualenv to add whatever packages you need (and just point your `fgci` file to your installation). Also, You'll want to use the `--system-site-packages` option when setting up virtualenv
Answer: I know this is an old question, but here is the answer: yes, Hostmonster does support Django
There used to be this Hostmonster KB article for details, including instructions on how to set it up, but that link appears to be dead these days, and the only article about Hostmonster article about Django is about troubleshooting. You can find instructions on how to set up Django on Hostmonster elsewhere.
Comment: Link's dead
(filling space filling space)
Answer: http://www.hostmonsterforum.com/showpost.php?p=20003&postcount=7
I tried the archive the user posted there, and it worked like a charm.
Answer: Well, if it support Python, you might be able to run Django using a FastCGI setup, as described here: FastCGI Docs. If it supports mod_python (which I guess it's what you mean), then sure, you can install it using the steps listed here: ModPython docs
Answer: Hostmonster uses cPanel (possible with CentOS), just like other host providers.   If you research into cPanel , you are more likely to get your answer.
Generally, the answer is "no" since out-of-the-box cPanel does not support python 2.5 or mod_wsgi. But it does support Apache2, so it's possible that hostmonster could use mod_wsgi to run sites built with Django.
Answer: There is a Github repository for hostmonster and Django it helps me:
hostmonster-django.markdown

Does Hostmonster support Django


Updating the User Information List

Question: So I'm trying to update the User Information List in SharePoint (hidden list). My User Profile Service and Mysites are all synced correctly with the most up-to-date information. Is there a particular Timer Job that will update the User Information List though?
Comment: why you trying to update the UIL?
Answer: There are two timer jobs that push data from the UPSA to the UIL. User Profile Service Application - User Profile to SharePoint Full Synchronization and User Profile Service Application - User Profile to SharePoint Quick Synchronization are responsible for this. That said, sometimes the sync stops working correctly. In that case, you may want to try running stsadm -o sync -deleteolddatabases 0 which will reset the sync status and when one of those timer jobs runs, will update the UIL correctly. You can also get the PowerShell version from Replacing stsadm -o sync with PowerShell.
Comment: So I tried both syncs and the information still didn't update. I then listed the databases with the stsadm command and both were in sync. Just in case though I did the stsadm delete command, then ran both syncs again. Unfortunately nothing changed still.

Updating the User Information List


Clopen subspaces of Stonean spaces

Question: A Stonean space is a compact Hausdorff space in which the closure of any open set is again open. Suppose S is Stonean and C is clopen in S, i.e. C is both open and closed. Now C, endowed with the subspace topology, is clearly compact and Hausdorff. Is it Stonean too?
Answer: Yes.  Any open set in $C$ has the form $C\cap U$, where $U$ is open in $S$.  It's easy to check that the closure in $C$ of $C\cap U$ is equal to $C\cap \bar{U}$, where $\bar{U}$ is the closure of $U$ in $S$.  Since $S$ is Stonean, $\bar{U}$ is open, so $C\cap \bar{U}$ is relatively open in $C$.
Answer: The following may seem like a moderately complicated way to think about it, but if you're fluent in it, you see instantaneously that the answer to the question posed here is "yes".
To every "Stonean space" there corresponds the Boolean algebra of all clopen subsets of the space.
To every Boolean algebra there corresponds the "Stonean space" of all $2$-valued homomorphisms on that algebra, with the topology of pointwise convergence of nets of such homomorphisms.
This pairs off Boolean algebras and "Stonean spaces" in a well behaved way, and the content of "well behaved" is an interesting story which I omit from this answer for the time being, and it reduces the question to this: If $a_0$ is a fixed member of a Boolean algebra $A$, then is $\{b\wedge a_0 : b\in A\}$ a Boolean algebra in its own right?  If you phrase it that way, then the answer is obviously "yes".
Comment: This is not quite right--Stonean spaces are not the same as Stone spaces, and correspond to complete Boolean algebras, not all Booolean algebras.  So you need $\{b\wedge a_0:b\in A\}$ to be complete if $A$ is complete, which is also true but slightly less obvious than just that it is a Boolean algebra.

Clopen subspaces of Stonean spaces


Affinity Designer: how to clean up compound path

Question: I don't really know how to describe this problem, but I just want a clean cut if you know what I mean. It seems like the ellipse is trying to form an ellipse again and so there are new lines in the middle, how can I get rid of the lines in the middle? Adobe Illustrator does the same thing.
Comment: That is perfectly normal strokes need to be expanded for them to react to operations.
Answer: What you're after is possible. There's two approaches I can think of that work.
Destructive
If you are happy with a destructive approach, expanding the stoke prior to the boolean operation will give you want you're after. To do this select the ellipse layer and choose Layer → Expand Stroke.
Non-destructive
If you'd like to maintain the ability to edit the stroke width, you'll likely have to use some of Affinity Designer's masking abilities. I've masked the circle with a compound path of two rectangles.

To do this, drag the layer you'd like to be masked to the layer you'd like to mask it with. Drag to the area just to the right of the layer thumbnail.

Given it's for a logo, using a destructive method is probably best for the final assets.
Comment: @Tanonic Not a problem at all. :D
Comment: With the newer versions of Affinity Designer, the Boolean Operations tools (Illustrator Pathfinder equivalent) allow a non-destructive workflow by holding Alt (Opt Mac) when clicking on the crop (or other operation) figure - this automatically creates a compound path which is saved in your layers studio - so that you can easily live-edit your boolean later.
Answer: Break the residues of the ellipse at the corners. Then delete the straight parts. You have the "Break Curve" tool in the context menu when you use the "Node" tool.
This leaves the ends as usual open curve ends. Should they be along the cutting line (=horizontal) - then this method does not work.


Update message in Kubuntu 16.04

Question: In the Kubuntu KDE update program "Entdecken" (discover?), when new updates are available, there is a general description of the program but i cannot find the update message, showing what the update fixes. Where can i find it?
Comment: Install synaptic : `sudo apt-get install synaptic` ... and open `synaptic` , click the button "Mark All Upgrades" , and you get a list of all the packages with an update.
Comment: @ cucujoida: Do you mean something like the "changelog" of the package in question?
Comment: @ellisistfroh: exactly. How can i change the default discover updater to plasma-discover-updater?
Answer: If you are using the plasma-discover-updater (german:Aktualisierungsverwaltung) it is enough to tick on the package-name in the list, then the "changelog" of the package appears in a given field.
Comment: How can i switch from the default discover updater to plasma-discover-updater and set the latter as the default?
Answer: @cucujoida,
The old muon-updater has been superceded by plasma-discover-updater. If you ensure that plasma-discover-updater has been installed, you can uninstall muon-updater if you still find that in your system.
I hope this helps.
Comment: Hello Valorie, plasma-discover starts for updates, plasma-discover-updater remains unused by automatic updates. Therefore, the changelog of the updates is invisible.

Update message in Kubuntu 16.04


iTouch, 5th Gen., Rear-Facing Camera

Question: Is there any way to remove the screen that is blocking the rear facing camera? Could I bring it into a store and pay to have it removed/a camera put in?
Answer: Nope. No authorized service personnel will do so even if paid. There is the good chance the device itself might not work if it finds to rear camera missing.

iTouch, 5th Gen., Rear-Facing Camera


No-equipment substitutes for Chair Step and Chair-assisted Triceps Dip exercises

Question: The traditional "7 Minute Workout" includes two exercises that require a chair or other elevated surface, the ones mentioned above in the title. Due to an unfortunate incident involving a guest who twisted too quickly in their chair and shattered the back (freak accident, I suspect), my wife has banned use of the chairs in the house for exercise. Until I acquire a secondhand chair from Goodwill, what are some good substitute exercises? It would need to be something I can do at high-intensity for 30 seconds. The two exercises are listed as "Whole body" and "Upper body" respectively for the body parts worked in the original list.
Answer: I can  recommend diamond push-ups or bodyweight tricep extensions both of them in combination with doing wide grip push ups where you go close to the ground and swing from the left to the right without pushing yourself up.
Answer: If you've got steps in your house/apartment, you can duplicate those exercises easily.  In fact, stairs can be used for a variety of exercises.  For starters, try Stair Tricep Dips with Triceps press on the stairs.  You can substitute step ups on the stairs for your leg work.  Additionally, if you can get a hold of an exercise ball, or, aerobic step, those make good substitutes for chairs also.


Which openid providers are not blocked in China?

Question: I'll need to choose an openid provider now that WordPress is being deprecated, and I suspect some providers are blocked in China. I don't expect to visit China very often, but I may want to ask questions on Stack Exchange (especially Travel.SE) while I'm there.
Comment: Is this really a question for meta?
Comment: @Dagon [I think yes](http://meta.stackexchange.com/search?q=title%3Achina)
Answer: None. If you're in China, you may experience problems using many parts of our site including the login system. As someone who works in the support desk, we've had reports of the entire site being completely unusable from China in some instances because a variety of stuff gets blocked:

jQuery, reCaptcha, and other Google-hosted utilities (almost always)
Our in-house OpenID system (frequently)
Our Stack Auth system which most of our login system runs off of (somewhat frequently)
Our content delivery network (less frequently)

So, even a lot of our stuff gets blocked on occasion, which can prevent any provider you use from working properly. If you're planning to do anything more than just browsing the site from China, you may not have the greatest of luck  if you're not running your requests through a VPN.


Is it possible to define $x+x+x+x...x$ times?

Question: Is it possible to define $x+x+x+x...x $ times? I need to compute its derivative. It differs from the derivative of $x^2$. It evaluates to $x$ via sum of derivatives.
Comment: If $x$ is an integer, we can: it's just $x^2$. For all other values of $x$, you'll need a suitable extension of the function. Might I recommend $x^2$?
Comment: What you are computing is $x\cdot \dfrac{dx}{dx}$. Remember the product rule: $$\dfrac{d(x\cdot x)}{dx} = x\cdot\dfrac{dx}{dx} + \dfrac{dx}{dx}\cdot x = 2x$$
Comment: http://math.stackexchange.com/questions/1096/where-is-the-flaw-in-this-argument-of-a-proof-that-1-2-derivative-of-repeated
Comment: We can define it this way :  $$\underbrace{x+x+\cdots+x}_{ y \text{times}}  =xy$$ (I would suspect that , in history, somewhere mathematicians thought about defining multiplication of non integer numbers this way as a generalization of  the integer property. Now the important thing this is **just a notation** , and you can define any notation you want in mathematics, just **don't apply some rules you did not prove**. For example: $$(\underbrace{f(x)+\cdots+f(x)}_{ g(x) \text{times}})'= \underbrace{f'(x)+\cdots+f'(x)}_{ g(x)\text{times}}+\underbrace{f(x)+\cdots+f(x)}_{ g'(x)\text{times}} $$
Comment: (continuation comment : in the previous comment property $\to$ propriety), the example is the correct rule of differentiation you have to apply if you defined the notation like I did, and you can prove it from the chain rule.  There is no contradiction in this. Intuitively speaking this is what we do in mathematics , we defined $a^x$ not as the product of $a$ $x$ times (the intuitive definition) but from the exponential $x\to e^x$  (extension of integer properties to real numbers and even complex numbers)
Answer: There are two problems with this expression.

First: How would $\underbrace{x+x+...+x+x}_{x}$ make sense if $x$ is not an integer? How would you add 3.5 to it self 3.5 times?
Second: This one is more related to calculus. Assume that $\underbrace{x+x+...+x+x}_{x}$ is well defined, then you don't only have to differentiate all the individual $x$es , but also the $x$ under the brace. However you can't really do that using this notation.

Just notate it with $x^2$ and find the correct derivative $2x$.
Comment: In a way we could apply the chain rule to $\underbrace{u+u+\ldots +u}_{v}$ and need to consider $\partial \over \partial u$ as well as $\partial \over \partial v$. Even though the notation still doesn't make sense completely, for noninteger $v$  we obtain $u+v$, i.e., $2x$ as derivative
Comment: couldn't we define it the same way we define multiplication? Multiplication is repeated addition right?
Comment: @KalpeshKrishna Multiplication is repeated addition, but the difference here is that we repeat adding $x$ namely $x$ times. Because they both are $x$, we can't differentiate them


Solution to the optimization problem in "Blessing of Dimensionality High ... the face verification"

Question: I am reading the work "Blessing of Dimensionality High dimensional feature and its efficient compression for the face verification" CVPR 2013.
One of the key contributes is the authors propose a new so called "rotated sparse regression" method for the dimension reduction. However, I don't know how to get the closed form solution for following optimization problem. The details are not given in the paper. Could someone give me a hint to  derive the following closed form in the following

Comment: @StefanoM, I think he means, "how do you prove this is the minimum of of the constrained problem above?"
Comment: @BillBarth You are right, sorry: I deleted the negative comment. May be the question should be edited to clarify? "I don't know how to get the closed form solution..." hints to "how to compute."
Comment: You should be able to work this out by differentiating the upper expression w.r.t. $R$, setting it equal to zero, and solving. At some point, you will want to apply the SVD expression they assume and the constraint.
Answer: There's a well known problem called the orthogonal Procrustes problem,
$ \min_{Q} \| AQ-B \|_{F} $
subject to the constraint
$ Q^{T}Q=I. $
Note that the norm in the objective function is the Frobenius norm rather than the matrix 2-norm.
For this problem, the solution is
$Q=UV^{T}$
where $A^{T}B$ has the SVD
$A^{T}B=U\Sigma V^{T}$.
This solution to the Procrustes problem is derived in lots of places.  See for example the Wikipedia page here:
http://en.wikipedia.org/wiki/Orthogonal_Procrustes_problem
If your problem had the objective $\min \| R^{T}Y-B^{T}X \|_{F} $ rather than $\| R^{T}Y-B^{T}X \|_{2}^{2}$, then the problem could be rewritten as a Procrustes problem by transposing inside the norm,
$
\min \| Y^{T}R - X^{T}B \|_{F}
$
subject to
$R^{T}R=I$.
The solution would be
$
R=UV^{T}
$
where $YX^{T}B$ has the singular value decomposition
$YX^{T}B=U\Sigma V^{T}$.
This matches up exactly with the solution given in the paper that you've quoted.
I don't believe that minimizing the 2-norm is equivalent to minimizing the Frobenius norm.  It seems to me that the authors of the paper you cite may have confused the Frobenius norm and the 2-norm.
Added after I finally got my hands on Watson's 1993 paper...
See
G. A. Watson.  Solving Generalizations of Orthogonal Procrustes Problems. In Contributions in Numerical Mathematics, World Scientific Series in Applicable Analysis, World Scientifc Publishers, 1993.
The classical solution using the SVD is optimal with respect to the 2-norm only if the matrices are square ($m=n$), and the $A$ matrix is the identity- that is, we're minimizing $\min \| Q-B \|_{2}$.
Otherwise, Watson offers an iterative algorithm that requires the solution of a quadratic programming problem at each iteration.
Comment: A lot of computer scientists mistakenly call the frobenius norm the "2-norm". It's so prevalent, I have started to suspect that its actually just a different naming convention in the field.
Comment: I think the simpler form of the Procrustes problem should work the same in the spectral norm; could you maybe have a look at my proof in the other answer? Although you may be right that the more general form with two matrices $\|AQ-B\|_2$ doesn't work out...
Comment: See the following reference (Google will show you the first few pages and I've got ILL working on getting a copy...)  The $UV^{T}$ formula doesn't work in general according to the abstract although it does in the special case of $\min \| M-Q \|_{2}$.  I think you'll find sufficient conditions in Watson's paper:  Watson, G. A. "Solving generalizations of orthogonal Procrustes problems." World Scientific Series in Applicable Analysis 2 (1993): 413-426.
Comment: A different citation for what appears to be a related paper:  Watson, G A. "The Solution of Orthogonal Procrustes Problems for a Family of Orthogonally Invariant Norms." Advances in Computational Mathematics. 2.4 (1994): 393-405.
Comment: From my reading of the article cited by the original poster, it appears that they're interested in the Frobenius norm anyway (the columns of the $Y$ matrix are feature vectors that are supposed to be rotated to match columns of $B^{T}X$.
Comment: @NickAlger that's been my experience as well.
Comment: @BrianBorchers thanks for pointing out the solution of this problem.
Answer: I couldn't find anything on the Procrustes problem in the spectral norm online, but I had a feeling that the same result as in the Frobenius norm should hold, so I worked something out.
Let's say we're given a matrix $M$ and want to find an orthogonal matrix $Q$ which minimizes
$$
  \min_{Q^T Q=I} \| M - Q \|_2.
$$
We take the SVD of $M$, i.e.,
$$
  M = U \Sigma V^T.
$$
In particular, we have normed singular vectors $u_j,v_j$ with $M v_j = \sigma_j u_j$ and hence $\|M v_j\| = \sigma_j$.
For any such orthogonal matrix $Q$ and any vector $v$ with $\|v\|=1$, we have
$$
 \| M - Q \|_2 \ge \| Mv - Qv \| \ge \Big| \| Mv \| - \| Qv\|\Big| = \Big| \| Mv \| - 1 \Big|,
$$
and by inserting the singular vectors $v_j$, we obtain
$$
  \| M - Q \|_2 \ge \max_j | \sigma_j - 1 |.
$$
On the other hand, the special choice $Q = UV^T$ leads to
$$
  \| M - Q \|_2 = \| U (\Sigma - I) V^T \|_2 = \| \Sigma - I \|_2 = \max_j |\sigma_j - 1|
$$
and is therefore the best approximation of $M$ in the spectral norm as well.
However, this does not hold for the generalization to the more general problem $\| A Q - B\|_2 \to \min$ according to the paper cited by Brian Borcher above: Watson, G. A. "Solving generalizations of orthogonal Procrustes problems." World Scientific Series in Applicable Analysis 2 (1993): 413-426


The fundamental group of Klein bottle/{3pt}

Question: The fundamental group of Klein bottle has been well discussed in many materials, I'm think if it is requested to calculate the fundamental group of Klein bottle/{3pt} or even more generally Klein bottle/{n points}. I found it might has deformation retraction onto Mobius band with $n$ circles but not very sure. I'm looking forward to idea on it
Answer: The Euler characteristic of the Klein bottle $K$ is equal to $0$.
From this, you can conclude that the Euler characteristic of $K$ minus $n$ points is $-n$.
It is a general fact that for any compact connected surface $S$ and any finite nonempty subset $P$, the complement $S-P$ deformation retracts onto a finite 1-complex $\Sigma$. So if we let $\Sigma_n$ denote a finite 1-complex onto which $K$ minus $n$ points deformation retracts, it follows that the Euler characteristic of $\Sigma_n$ equals $-n$ (and $\Sigma_n$ is connected).
The fundamental group of every finite connected graph $G$ is free of some rank $r \ge 1$, and the Euler characteristic of $G$ equals $1-r$.
Setting $-n = 1-r$, it follows that $r = 1+n$. So, the fundamental group of $K$ minus $n$ points is a free group of rank $1+n$.
Comment: If for K#K/{3pt} will the outcome be different ?
Comment: It will be different, but that's another question.
Comment: Is the question about spaces with 3 points removed or spaces with 3 points identified to a single point?


Why does unfreezing a track in Ableton change the tracks sound?

Question: I'm using Massive synth inside Ableton and I need to freeze tracks to save on the CPU usage. The problem is that when I unfreeze the synth tracks the sound of the synth is different from when I originally froze the track. The sound hasn't completely changed.. it's still the same sound but slightly different, like some of the parameters have been tweaked??
Answer: It's because when you unfreeze a track in ableton, the phases of the oscillators change.
If you want the oscillators to always be the same, you have to go to the OSC section, and then click "Restart via Gate". Doing so will make sure that the oscillators have the same phase every time you play a note.
Answer: I think there's some parameters in your Massive preset that are modulated randomly.
When you freeze a track you actually render it to audio, so everything is printed and fixed.
...


sigma delta modulator for DAC

Question: Can someone please provide an overview of sigma delta DAC? In particular, I would like to know how does the sigma delta modulator, which is digital, works for DAC. What is difference between sigma delta modulator for DAC and ADC?
Comment: _The Art of Electronics_ by Horowitz & Hill has a nice section on sigma-delta DACs and ADCs.
Answer: Disclaimer: I've only built one "true" sigma-delta DAC, and it was first-order because I was running it on a 25MHz FPGA and I only needed telephone-quality audio out of it.  So rather than spending my clients money to have fun, I stuck with the basics.
There doesn't need to be much difference between the analog/digital sigma-delta modulator you might build for an ADC vs. the all-digital one you'd make for a DAC.
Both have a modulating element that takes a continuous (in the case of the ADC) or many-valued (in the case of the DAC) signal from a loop filter and, at each sample instant of the loop*, turns it into a 0 or a 1.  Both translate that 0 or 1 to match the full scale of expected input values (with a carefully buffered digital output in the case of an ADC, and just a multiply or change of attitude in the case of the DAC).  Both have a loop filter that conditions the output of the summing junction to perform the noise shaping that makes a sigma-delta modulator worthwhile.
Here's a chart that sums up the differences between the elements -- all of which are present in either type of sigma-delta device:

function
ADC
DAC

modulating element
analog comparator
compare operation

modulator output
digital output
multiply operation

summing junction
analog circuit
subtraction operation

loop filter
analog filter
digital filter

* Note that the sampling rate of that binary sampler needs to be significantly higher than the "normal" sample rate of the desired signal.
Comment: Good point.  I added that as a footnote -- but I was really trying to focus on the differences.  Both ADC and DAC forms of the sigma-delta include massive oversampling so that the frequency-shaping has someplace to shape the noise _into_.  (And the amount of oversampling depends on the complexity of the loop filter and following reconstruction filter -- 64x oversampling implies at at least a 3rd-order filtering for a 16-bit device, or it implies that the designer is deliberately allowing more noise in the high frequencies).
Comment: Don't you need to upsample your 48 kHz input to 64× (like 3 MHz) before the compare operation?  Doesn't a ΣΔ DAC need the input to get upsampled to the high sample rate?
Answer: I will show the comparison of a first order Sigma Delta DAC and first order Sigma Delta ADC and then use the ADC to further detail the operation for sigma delta modulation. I will also show how this is expanded to higher order structures.
First I show the structure for a Sigma Delta DAC below with a simple explanation of its operation:

A higher precision digital waveform at the input, for purpose of explanation I will assume signed representation is subtracted from a full scale positive or negative result using the same number of bits. For example, if we had 8 bits coming in, this would have a range of -128 to +127 as signed representation given as integers. This would therefore be subtracted from either -128 or +127 depending on the state of the feedback.
The difference is applied to the input of an accumulator (the block with the $z^{-1}$ shown). So if the difference is a positive constant, the output of the accumulator would ramp up, and if the difference was a negative constant, the output of the accumulator would ramp down. The block shown as "MSB" selects the most significant bit of the word (the sign bit) and toggles the feedback state, and the output, whenever the accumulator causes the sign to change. The result, as we'll see in more detail below, creates a pulse density modulated output waveform- as a two level analog output. If we were to average the two-level output, the resulting average would converge to the precision given by the input. Averaging is a low-pass filtering process, and actual low pass filters designed for removing the higher frequency noise from the PDM waveform are more effective in producing the desired output in less time than a classical average would provide.
With that high level summary, for comparison the equivalent first order Sigma Delta ADC is shown below where we will see all the same functionality with digital and analog features swapped:

The operations are the same as described above for the DAC: The input is now an analog waveform (as shown here the first part of a sinusoid), the feedback is a two level analog waveform at the full scale range of the input, the difference is analog and provided to an integrator, which is an analog version of the digital accumulator. The integrator likewise will either ramp up or ramp down based on a constant difference value depending on if that difference is positive or negative. A 1 bit A/D Converter puts out a "1" or a "0" depending on if the output of the integrator is positive or negative. Importantly this selection occurs only at the update rate of the converter which as we will see results in the digital PDM waveform to be provided at the Sigma Delta ADC output.
So how does this work? I will show two sections of the sinusoidal input waveform shown above so that we see what happens when the input is low, and then close to mid scale, which should help provide further insight.
First when the input is low, I show below all the internal waveforms within the Sigma Delta ADC that results in a PDM waveform that would average to a low output value.

In this segment, the waveform starts low and slowing gets larger as the sinusoidal waveform proceeds in time. The feedback as I started it here is full scale low, so the difference is a small positive value, resulting in a slow rising ramp at the integrator output. The integrator as I started it was negative, so the output was low consistent with the full scale negative feedback (so all makes sense thus far, if we start in any other state it would proceed differently but with the same end result). Thus the output stays low for a relatively long time, since the accumulator is ramping up slowly. The point at which the output toggles is the next rising edge of our master clock (which is shown in green) AFTER the integrator has passed the zero crossing, which then causes the feedback to go positive. Due to the lower input value, the difference of the input and feedback will then snap to a large negative number (close to the largest it can be!), resulting in a relatively very fast slope downward at the accumulator output, back toward the zero crossing. For this reason, on the next rising edge of the sampling clock the integrator has already gone negative again causing the output to toggle back low--- thus we got very narrow high pulses with longer durations of low output. This is what we would expect for a low input level.
I show the same diagram for mid level values below, and the explanation for what is happening should now be obvious consistent with the above description, as to why in the mid level case we would get something close to a square wave out. We can also see now that for the high level case we would get narrow pulses going low with longer durations of high levels at the output:

A first order architecture is useful for gaining a basic understanding of the fundamental operation but it is not recommended for general implementation. The implementation suffers from stronger "pattern noise" which manifests as high spurious interference in the spectrum of the generated waveform. Higher order sigma delta implementations both improve the achievable resolution and reduce the pattern noise artifacts. These are formed by adding additional integration (accumulation) stages in series, with a penalty in reducing the full range of the output while maintaining stability. Below shows a simple 2nd order Sigma Delta ADC as stages in series. To be aware of, the MASH architecture (multi-stage noise shaping), is a popular approach implemented with stable low order modulators, providing better stability when the full output range is needed, and also results in a multi-level output.

The feedback operation provides noise shaping resulting in the equivalent of very high precision for a relatively small amount of oversampling compared to traditional data converters. The benefit of noise shaping is introduced briefly with the graphic below:

How do I know this? I teach courses on DSP and Python related to wireless comm through dsprelated.com and the ieee (with new courses running soon!) and have implemented higher order sigma delta modulators for data converter and fractional frequency synthesizer applications. These graphics are out of my "DSP for Software Radio Course" which includes Sigma Delta modulation and much more details related to noise shaping.
Comment: The formula for the gain of the comparator is $$ \frac{\frac{\Delta}{2} \overline{|x|}}{\overline{x^2}} $$ where the comparator output is $\pm\frac{\Delta}{2}$ and $x$ is the input.
Comment: Dan you need to more accurately model the effective gain of the comparator operation when you *"linearize"* the model and replace the comparator with an additive noise source. You can't just assume it's 1. What if you put a big non-inverting gain in front of the comparator? Would it change anything? Now what if you put that same gain in front of the additive noise source? Would ***that*** change anything?
Comment: @robertbristow-johnson completely understood if you are referring to trying to create a linear feedback model for such a non-linear system. That I get.
Comment: How else are you gonna model the noise shaping?
Comment: @robertbristow-johnson I am saying I agree with you. I've done approximate linearization for deriving the NTF with reasonable matching to the actual noise shape.

sigma delta modulator for DAC


Crypto currency as gift

Question: I'm staying in Germany and I have a friend in India. He has a few ether coins in his wallet in India which he bought mid of 2017. He now wants to sell them.  But in India, because of taxes, he will not gain much profit.
So he asked me if he could send them to my wallet in Germany as a gift. I can sell them in Germany and send him the amount in parts as and when we happen to meet.
Since it is a gift and I have not bought the coins I will not have to pay any tax on it in Germany. Is this legal and what are the risks?
Comment: I believe that in law It isn't a gift if the sender expects to receive something back in return. In this case you are providing a currency exchange service not simply receiving a gift.
Comment: I can't comment on your tax component since I am not familiar with German laws, but your friend will have to pay the tax if the amount is greater than 50,000 INR (about 650 EUR or about 0.5 ETH at the current price) even if it is a "gift" from you to him. It does not matter if you pay him back in cash or bank transfer, he will still be required to declare that as income. Not doing so would be illegal on his behalf.
Comment: What is the amount limit that can be given as a gift. Is it only INR 50,000 in a year ? I don't think so
Comment: Just that if the sum total amount of gifts received is greater than INR 50k, then its taxed. There's no upper limit for the amount that can be given as a gift.
Comment: What that means is, if the amount exceeds INR 50k, the entire amount gets added to the rest of his annual taxable income and that will be taxed according to the usual tax laws. This law does not apply if you're a direct family member btw.
Answer: I am from Germany and know a bit about the tax situation here.
If gains < 600€ in 1 year, then you don't need to pay taxes. You also don't need to pay taxes if you hold the Ether more than 1 year.
But you still have to include it into your tax report ("Steuererklärung").
Comment: @Jio It's not a gift. It's part of a larger transaction where you are being given the cryptocurrency in compensation for obligations you will satisfy later. A gift is given out of generosity and not in exchange for any future benefit.
Comment: Thanks for your input. But since the coins will be sent.to me by my friend as gift I don't have to pay taxes. There is no tax on gifts in germany. Isn't it ?
Comment: And for the exchanging? I don't think that it's legal. Otherwise, big companies could gift 10,000 BTC to a person in Germany who sells them and sends the euros/dollars back and no one has to pay taxes...
Comment: I understand it is not fair.  But how is it exactly illegal. ?do you know any law in germany which proves that it is illegal do so. .
Answer: As a general rule:

The person gifting has to declare it in their personal income tax declaration, in the section for capital gains and losses.

In some jurisdictions, the person receiving the gift is expected to declare a specific tax for donations. In some jurisdictions this tax may exist but not be actively prosecuted for small donations. In some jurisdictions it could be actively prosecuted and even be allowed prosecuting the person giving the gift if the person receiving the gift fails to comply with whatever local law requires.

The person receiving the gift, when releasing the gift either by gifting or by selling, has to declare it in their personal income tax declaration, in the section for capital gains and losses.

Being purist, no, what you want is not legal. If I understood you correctly, you are in a case of simulated contract, a contract that, by mutual agreement, does not express the true intent of the parties.
This is not legal advisory.
This problem is completely off topic here. It could be even slightly off topic in Money Stack Exchange. I would suggest starting in Law Stack Exchange.

Crypto currency as gift


Usage of preposition with the word 'employed'

Question: 1.my sister is employed in/on/by/with the railway.
What is the correct usage .If all are possible could you tell me the difference.
Answer: We can eliminate with straight away. To be employed with something is to share that state of employment with it, i.e. have a coworking relationship. On a technical level, this would mean that the sister and the railway are employed by a common party.
In and on are likewise simple to cast away. They refer to location, which could be correct but since I presume that you seek to convey the message that the sister's employer is the "railway", they don't quite fit.
That just leaves by. It's the right one, because by is what you use when an object or influence does something to something else. "The ball was thrown by Billy," "Dave was shot by Matt," "She stuck by me," all of these are example of by in action. Here, the sister is the party being subjected to a state of employment, and the railway is the entity subjecting her to it. So, in the end, the full sentence should be: my sister is employed by the railway.


Wiring a pole barn that is 750' from my main power box

Question: I have a barn that is 750' from my main panel. I would like to run power down to it myself because the power company quoted some crazy high prices. I plan on burying the wire and would like to know what size wire I should go with or if it is too far to do. Any help would be appreciated. The barn is going to have lights, some outlets and maybe a 220 outlet or two in case I need to power a welder from time to time, but thats about it. I would rather go bigger in case I need to expand in the future.
Comment: We've had a few Q&A's about long power runs and some of the answers are quite detailed about how to do it cheaper and more effectively by using transformers at both ends and running the intervening line at a higher voltage (not kilovolts, typically 480V rather than 240V, (so standard 600V wire insulation is fine) but it helps the wire size a LOT, which helps the cost.) For Example: https://diy.stackexchange.com/a/164293/18078
Comment: If you need lots of power, it is indeed a good question as to "more expensive and or higher voltage (thus, special wire and techniques) transformers being worth it" or if an engine driven welder that's common and portable makes more sense for the application.
Comment: Depending on how often you'll be working there, and how much you like hi-tech stuff, consider covering the barn roof with solar panels & putting in a wall-pack storage unit (and of course a DC - AC converter).  Won't be cheaper at the outset.
Comment: How open are you to plopping a couple of transformers in?  Also, how big is this barn, and how big of a welder do you have (I1eff and/or I1max)?
Comment: can you get by with solar for lighting and a generator for heavy loads? i bet that could be cheaper, and more flexible later on, or if you move.
Comment: Those are some pretty good questions. I really only need lights and some minor outlets. I think it will be cheaper for me to use a generator for welding and any other large tools
Answer: Long-distance circuits are a huge opportunity to spend way too much on wire unnecessarily.  Given the amount of money that is at stake here, let's debunk the usual 3% knee-jerk.
There are two huge mistakes when made when sizing circuits.

sizing for 3% voltage drop.  3% is simply wrong.  There's no support in Code for it anywhere (it's a suggestion, one place). This myth is widely spread by the companies who sell wire, for obvious reasons -- the first place they do it is in their "free" voltage drop calculators.  They default to 3%, and by that they mean literally 3.00% - if a cheaper option would come in at 3.25%, they will hide it, and "blame the computer" for being too literal.
Sizing for "breaker trip rating" instead of practical load.  Remember, loads are already supposed to be derated 20% (literally, breaker should be 125% of load), so sizing to breaker is always wrong.  Indeed, the simplest step of sizing to 80% of breaker usually results in a couple of wire size drops and thousand$ saved.  But you should go farther, and size to actual load.

Voltage drop is proportional to current right now
Remember that voltage drop in a circuit is a function of current actually flowed.  Here's what's not true: "The voltage drop the calculator says will always apply to all loads". Actually it will never apply to any loads.
Suppose someone puts in monster wire on their "50A" circuit and gets to 2.5% drop at 50A.

You draw 10A @ 120V.  You actually get 1.0% voltage drop.  Not what we expected, eh?
What happens if you have a "30A" dryer, which actually is 23A, and that actually is about 21A on the 230V side and 2A on the 120V side. So drops of 0.525%, 0.05%% and 0.575% per leg.  The 240V heating element sees 1.1% voltage drop, and the 120V mechanism sees a 0.575% voltage drop.
A 40A (9600W) heater sees 2.0% voltage drop, which it doesn't need -- heaters will work on 30-40% voltage drop.

Getting the idea how wasteful this is?
For a welder, consult with your manufacturer, but voltage drop is pretty normal for a variety of reasons inside welders, so it's probably not going to bother them all that much.
Transformers
Then there's using transformers to step up voltage.  All fixed-installation wiring is rated for 600V, and there is nothing wrong with stepping up power that high for the transition.  Transformers are expensive, but on a long haul, they're cheaper than wire.  Often, simply "stepping up" the circuit to 240V, and using a transformer at the far end to make 120V, is all you need.  I have plenty of postings about this.
Let's run some numbers in your case.
And to be clear, we'll be running aluminum wire, because running so much copper isn't even stupid.  Use the goop and torque to spec.
Scenario 1: Obedient Consumer.
Let's do exactly what the voltage drop calculator and wire companies say we should do. Compute on breaker trip and stick to 3%.  3/0 wire would have 3.05% drop and the computer says "no" to that and computers are smarter than us, so we are forced to 4/0 wire. 750' of 4-wire 4/0 URD will cost $2145, trench it at 24" and we're done.
Scenario 2: Compromises.
On a 50A breaker, actual draw shouldn't be more than 80% or 40A.  We go for 4% voltage drop at 40A. This comes up as 1/0 wire.  750' of 4-wire 1/0 URD will cost $1297.
Scenario 3: 480V Transformers.
In this case we use 15 KVA transformers and breaker for 60A (which is more power).  The transformer halves the current, which also halves the voltage drop, and voltage drop is only half as important anyway, since it's coming off 480V instead of 240V.  So now we can happily use much smaller wire.  240V at 40A becomes 480V@20A.   With #4 wire, voltage drop @ 20A draw happens at 2.45%.   Even if we max out the circuit to 60A@240V (30A@240V), voltage drop is only 3.67%.   Further, we only need 2 wires between the transformers, because neutral is created locally by the transformer.

The two 15KVA transformers cost $2000.
3-wire #4 SEU is only $555.

Scenario 4: Mini-transformer.
In this case, we only aspire to provision 20A (16A) practical, but we use a (smaller) transformer so we can transmit at 240V on 2-wire, even though we are only using 120V.  Fortunately, these smaller 5 KVA transformers are readily available on Craigslist for about $100. If we go for only one 20A circuit, then we base voltage drop on 8A@240V and the calc says we're just fine with 6 AWG aluminum at 3.58% drop.
However, instead, let's go for two 120V circuits at 20A breaker (that's table saw and dust collector). That will realistically be about 24A together, or about 12A@240V, but let's assume circuit continuous max of 16A x2, so 16A@240V. Voltage drop calc says that happens at 4.57% with 4 AWG Al.

one used 5 KVA transformer for $100
3-wire #4 SEU for $555.

And hey, that's the same #4 wire we use on our 480 scenario, and we know we can pump that to 60A or even 80A with better transformers.
Comment: @MartinBonner That's a good answer.  It's just not mine.   I would advise turning it into a proper answer.
Comment: So for this distance, the transformers are the most expensive option (but obviously get cheaper as the distance increases - there is a reason the electricity co uses high voltage for long distance transmission lines!)
Comment: What about my suggestion of "run less power, and buy a generator to run the welder"?
Answer: Not a lot of information to go on here but this resource:
Wire Size Calculator
May be helpful.  Assuming you want 240V and a 50A capacity (based on what my welder needs) I plugged those in with 750' distance and came up with 4/0 AWG Aluminum.  At this large size I think you'll find that Al is a much better value than copper.
Lots of other variables and I'll recommend that rather than direct burial you'll want to bury a conduit that is large enough to handle the 4/0 wire or something larger if you need more power in the future.
I'm going to guess that this is going to cost $5K or more.  The cost of the wire alone is going to be something like $3000.
Comment: @peinal you DO NOT run cat 5 in the conduit with power. Low and high voltage shall not mix. You run Cat 5e in its very own conduit, though there's little point at 750 feet unless you want analog phone or expensive (you'll need line extenders) slow data. You can run all-dielectric fiber optic with the power, but it's stupid to do so, since conduit is cheap and damaging your fiber when pulling the power wires and fiber together is all too possible. So you run a communications conduit, cap it, and open it up and run fiber or low voltage wire when you actually want that.
Comment: I see the problem.  That voltage drop calculator is lying up and down about what NEC requirements are.  **There is no 3% requirement for voltage drop, that is balderdash. Further it advises calculating drop on 125% of load, which is wrong**.  Also their calcs are optimized for irrigation motors so they're off by about 8% compared to my general purpose calc.  The 3% is "common knowledge" but I've called it balderdash on this site hundreds of times, and nobody's ever provided a code cite.  I think I see where they're getting it, and it doesn't say that.
Comment: @peinal, those are individual wires, so you need *3* of them (+ ground).  From Lowes, that would then be $4860, though buying from an electrical supply house may well be (much) cheaper, so the 3k estimate is reasonable.
Comment: Add a few load bearing splice boxes
Comment: Thanks, I know its not a lot of information. But its going to be a pretty basic set up.
Comment: The necessary wire size will go down *a lot* if the OP only provides enough power for the lights.  It might even be more economical to wire in the lights and then buy a generator for the welding.
Comment: Lowe's has 4/0 Al for $2.16/ft--which would be $1,620 for 750ft. Not great, but not $3K. I agree it should be put in conduit. Add conduit cost and rental of trencher, tax and you are probably around $2300-2500.  I would also consider adding a run of cat5 in the conduit while you are at it... cat5 is cheap compared to 4/0 ;)


Coupon collector's problem as Random Walk

Question: I see in a book the following as coupon collector's problem. We have $N$   coupons labelled $1,2,\dots,N$ from which we pick with replacement. I could not understand what is the random walk here.
Comment: As you sample each time, the number of types of coupon seen so far either stays the same or increases by one.  So you could see this as a random walk where you either make one step horizontally to the right (sample up by one, no new type of coupon) or diagonally right and up (sample up by one, one new type of coupon)
Answer: The state space is $\{0,1,\ldots,N\}$ and the steps of the random walk are $0$ and $+1$. When at some state $k$, the transition $k\to k+1$ has probability $1-\frac{k}N$ and the transition $k\to k$ has probability $\frac{k}N$. Thus, the transitions $0\to1$ and $N\to N$ both have probability $1$ and the state $N$ is absorbing. (Note that this process is not usually described as a (inhomogenous) random walk but rather as a Markov chain.)
Answer: You can also see this as a random walk on the complete graph on $N$ vertices with self-loops at each vertex, where you want to know when you've visited all vertices. See Find the expected number of steps needed until every point has been visited at least once. for the variant without self-loops.


Is there any alternative UI for tree structure?

Question: Is there any other better UI feature for tree structure to reduce the multilevel nodes.
Comment: What are you trying to achieve? Can you mockup the information you want to display - this will help work out possible solutions.
Answer: I don't know all the different ways of visually displaying a hierarchical list of 'nodes', but here are the four main ones I can think of:
Stacks

Columns

Arrays

Networks
Answer: An alternative that is used sometimes, is a Miller Columns view.

The idea is that the subnodes for the selected item in column a, are shown in column a+1 next to it. A benefit, especially with trees that contain different types of nodes on different levels, is that each column only contains one a single type. That is easy to understand. One downside is that you cannot view and compare multiple branches at the same time. Another is that parent brances move out of view quickly in deeper trees, and that the items which form the ancestors can be at different places in the lists.
An example of this pattern in use, are Apple style file dialogs like these:
Comment: Miller Columns aren't pretty but they do work well
Comment: Miller Columns seem to go against some UX rules. it's displaying data which is really not needed. Plus you can easily get overwhelmed with a complete overload of data. it is not friendly on the eyes that is for sure.
Comment: @Fractal I don't see it displaying any more data than a conventional tree view? Note that I think that _the_ major shortcoming of a conventional tree view is that it doesn't show _enough_ contextual information. In bigger trees, it is impossible to see your location within the tree quickly. Even the direct parent can easily scroll out of view. Miller Columns don't suffer from that problem as much. A bigger problem is that the hierarchy isn't visually defined all that clearly.
Answer: For certain types of hierarchies (such as nested text), a control that I call a 'NestView' might be suitable:

This actually evolved from a number of answers given to a question on Programmers.StackExchange:
https://softwareengineering.stackexchange.com/q/87077/27103
Comment: That's cool. I never imagined laying out indent levels like that. A little harder to read, but gives you the advantage of lining all the code up flush left (fits more characters on the screen horizontally).
Comment: While this solution is rather original, it's not easy to use and requires significant training.
Comment: @dnbv I agree that it will require some getting used to because its new. When the TreeView first appeared, it probably took a while to get used to this also.
Comment: +1 for originality. Time will tell whether it's usable, although I have my doubts.
Answer: One alternative - which may not fit your application is the treemap. It is a useful way to display data when the relative size of the nodes is important.

(wikipedia example treemap - in this instance showing changes in waiting times for patients)
This paper on Squarified Treemaps[pdf] is how I learned about the technique. It is quite accessible.
Comment: Note that as seen in the example above, the treemap can lead to unexpected UI/UX concerns as text becomes unreadable and small categories congregate into a blob.
Answer: There is also a great jQuery plugin for accomplishing iOS-like drill-down menus: http://filamentgroup.com/lab/jquery_ipod_style_and_flyout_menus/
Comment: UX isn't strictly web, of course. But most people working in UX today are working on web projects. So it's a safe assumption unless otherwise noted. "answers here should be about interface patterns & user behavior and not about code" -> they go hand in hand. And in this case, the answer was pointing to a pattern (that just happened to be coded already).
Comment: "iOS-like drill-down menus" are Miller columns that are shown one at a time. Moreover, the OP didn't say it was for a web project.
Comment: @dnbrv and here's the same.
Comment: @MechanisM: And here it's even more clear because the suggestion is to use the jQuery plugin not the concept.
Comment: @dnbrv okay, so let's ask someone to edit question and add "non-web" mention(if it's really is). so it's not confuse ppl.
Comment: @MechanisM: There's no need to edit the question. This SE is about UX, so the answers here should be about interface patterns & user behavior and not about code. Platform-specific solutions are necessary only when the platform in question has particular limits or established design paradigms.
Comment: @dnbrv "about UX, so the answers here should be about interface patterns & user behavior" - why it's can't be web related? And I didn't talked about code I'm just showed example of how tree can look/behave like and to test UX.
Comment: @dnbrv just take off from your mind the fact that my link goes to html/js example. imagine it's just some program's UI with tree!
Comment: @MechanisM: Yes, UX can be related to the Web. However, the point is that you linked to a jQuery sample not an explanation of why that pattern should be used (i.e. use cases/scenarios).
Comment: @MechanisM: What you're missing is that "iPhone-style menu" is actually Miller columns that are modified to fit mobile devices.
Comment: @dnbrv so you don't see any use cases for such kind of menu? it's can be nice part of interface to show trees. For example look at http://www.deviantart.com/ for first imagine it's not a web site(if it's so important for you web or non-web) lets look at it like some software interface.. look at sidebar category menu and imagine iphone menu instead of their category menu. will look much better. and better UX. And yeah I'm know about miller columns. Btw I'm talking about this one http://codecanyon.net/item/jquery-infinite-sliding-menu-plugin/full_screen_preview/164115 I don't like jQuery UI one.
Comment: @MechanisM: It's not a menu. It's Miller columns modified for mobile devices. It's not appropriate to use this pattern in most desktop environments because there aren't the limits, for which it was designed. Moreover, it wouldn't work on DevianArt because it's a completely different navigational pattern (quickly find a sub-category vs. browse through all content).
Answer: I would prefer to use smth like iPhone sliding menu for tree structure.
Smth like this one http://codecanyon.net/item/jquery-infinite-sliding-menu-plugin/full_screen_preview/164115
Comment: @dnbrv I'm just linked to concept of how it's can be done. and look like. not to code or realisation.
Comment: "iPhone sliding menu" is Miller columns that are shown one at a time. Moreover, the OP didn't say it was for a web project.
Comment: @dnbrv Who says it's for web or non for web? it's used in iPhone - so iPhone is web too? UI is UI and web or not doesn't matter.I can do same ui for web or not for web project.
Comment: You linked to a jQuery implementation without knowing what kind of project it is.
Answer: I have used a Tag Cloud as a way to organize all the content on my computer for a long time. I have found it to be a efficient way to quickly organize data. The only downside is that you need to make sure your content is tagged.
I use a program for Mac OS X called Leap and it has changed the way I store and access files on my computer.
Comment: A tree structure can be converted to tags. This conversion is usually one way, since tags usually do not have hierarchy. In that manner a tag cloud is not an alternative for a tree structure any more than a list view. One major difference, however, is that items can have multiple tags, which can provide a replacement for trees - if you turn every parent folder into an additional tag and you do not care about the order.
Comment: I find the lack of structure of multi-tag searching to be liberating and can lead to much quicker paths to finding a specific file
Comment: I prefer tags too, this is also the concept used in gmail (labels) as an alternative for moving new emails to folders (which also enables multiple labels and now also hierarchical labels). What I meant, is if the data source is a tree (e.g. organizational structure, file system) then the tags are not the equivalent (unless you use hierarchical tags).
Answer: A minimalistic solution is a "Breadcrumb", like most modern file managers have today. This example is from Wikipedia.
Comment: That's just one (incomplete) path from a hierarchy. It does not give much overview.
Answer: As a powerful alternative, I recommend the solution "stolen" from the Windows Explorer.

To make it easy to use, you have to make it simple:

list view - flat display of items at the current level,
breadcrumb - hierarchical display and navigation between chosen levels,
tree view (!) - but only to show the structure without items itself.
Answer: Other than the treemap, another hierarchical chart is the sunburst chart as explained here (the tree map is also mentioned) : https://support.microsoft.com/en-us/office/create-a-sunburst-chart-in-office-4a127977-62cd-4c11-b8c7-65b84a358e0c.
(The image below was generated with https://resources.wolframcloud.com/FunctionRepository/resources/PolarTreemapPlot/)
Answer: For navigation to the deepest nodes and if you don't need an overall view of the tree but only the lowest nodes, but visibility who they belongs to, then an great alternative that is used by many Car Occasion sites is that it uses combo boxes for navigation down the tree. Look at this: 1. Select car brand in combo box, 2. Select type of car in combo box. 3. Select build year in combo boxes 4. Text free word and then a list is presented with those cars.


How to disable content type HTML in Gmail?

Question: I'd like to receive all my emails with content-type text/plain by default while using Gmail (no clients), by default Gmail uses content-type text/html.
Comment: @msw some messages are sent with multiple content types (`multipart-messages`). When a `multipart-message` is sent to gmail, the web interface choose  the `text/html` over the `text/plain` body. I'd like to receive only the `text/plain` version if present.
Comment: Please clarify what you mean by "receive as plain"? You want gmail.google to send your browser plain text when you ask to see a message body? If you actually mean "receive into my inbox only plain text", you unfortunately don't get to choose what some sender across an SMTP link sends.
Answer: When you receive email in gmail, gmail honors the "text/html" body part if one is present.
I do not think there is any way to disable this behavior if you are using gmail's web interface.
However, for mail that is "sent from gmail", this is easily do-able:
I checked my gmail, and it is sending mail with:

Content-Type: text/plain; charset="iso-8859-1"

My Gmail "Settings --> General" has this enabled:

Outgoing message encoding: Use default text encoding for outgoing messages

And when I compose a message in gmail, I make sure I am using "plain text" for my email.
Comment: @joyjit, **10 years has passed**. any update?
Comment: Well, maybe a filter would do the trick; forward all the incoming email to self with `content-type: text/plain` and then removing the original message. (maybe tagging the original message with a new html label would work).
Comment: "maybe a filter would do the trick" -- if you are talking about using the native web-based gmail client, you cannot remove or modify email headers from a filter...
Answer: One option would be to use the mobile version of gmail, m.gmail.com.
Comment: Thanks but It wouldn't work for me, I'd like to review the emails from the gmail's web interface.


Why IA32 does not allow memory to memory mov?

Question: In Intel architecture IA32, instructions like movl, movw does not allow operands that are both memory locations. For example, instruction movl (%eax), (%edx) is not permitted. Why?
Comment: The ModR/M byte can't encode it. But then of course you can turn that into a "why did they make it so", well.. meanwhile, string move (`movsb`, `movsw`, `movsd`, `movsq`) has two memory arguments, but they're implicit.
Comment: It is 1976 and you can put 20,000 transistors on a chip to implement a 16-bit processor.  That requires cutting corners heavily, the very non-orthogonal design was part of the outcome.  And no room for finding the storage required to buffer the value between bus cycles.
Comment: @PeterCordes The original 8086 didn't even have one address generation unit, so that's not the reason. It did address calculations with the ALU.
Comment: I think a better explanation is that decoding insns with two full addressing-modes (`base + index + disp16`) would have required two AGU (address-generation-units), and would complicate the binary machine-code format a lot.  (which segment override applies to which operand?  How to allow encoding two memory addresses without bloating the code-size for the common case of one or both operands being registers?)
Answer: The answer involves a fuller understanding of RAM. Simply stated, RAM can only be in two states, read mode or write mode. If you wish to copy one byte in ram to another location, you must have a temporary storage area outside of RAM as you switch from read to write.
It is certainly possible for the architecture to have such a RAM to RAM instruction,  but it would be a high level instruction that in microcode would translate to copying of data from RAM to a register then back to RAM. Alternatively, it could be possible to extend the RAM controller to have such a temporary register just for this copying of data, but it wouldnt provide much of a benefit for the added complexity of CPU/Hardware interaction.
EDIT: It is worth noting that recent advancements such as Hybrid Memory Cube and High Bandwidth Memory are achitectures in which the RAM topology has become more like PCI-e and direct RAM to RAM transfers are now possible, but that is due to the support logic for the technologies, not the RAM itself. In the CPU architecture, this would be in the form of huge blocks of RAM at a time, like DMA, and not in the form of a single instruction, plus the CPU cache behaves like traditional RAM so the architecture would have to abstract it as per my original explanation
EDIT2: Per @PeterCordes comment, my original understanding was not entirely correct; x86 does in fact have a few memory to memory instructions. The real reason they are not available for most instructions (such as movl and movw) is to keep instruction encoding complexity low, but they could have implemented them. However, the basic idea in my original answer, that there is a temporary storage location outside of RAM in the form of a latch or register, is correct, but the idea that this is the reason why these instructions don't exist is not. Even older chips from the 1970s such as the 6502 and the 8086 have memory to memory instructions, and you could easily perform operations such as INC directly on a RAM location. This was accomplished by latching the memory fetch directly to the ALU and back out to memory again without going through a register used by the instruction set.
Comment: In x86, it's an insn-encoding limitation, as well as keeping the decode complexity low.  There *is* a mem-to-mem copy instruction (`movs`), but it uses two implicit operands.  There's also `push/pop [mem]` to read from the effective address encoded in the insn and write to `[rsp]`.  (or vice versa, push vs. pop).  The original 8086 had these insns, and it had a pretty small transistor budget (but obvious large enough to latch 16 bits between read and write).  In current CPUs, `rep movs` is really efficient for block-copies of large aligned buffers.
Comment: Also, all memory-destination instructions, like `inc byte [mem]` do a read-modify-write to memory.  It's to the same address, but that's still two separate commands.  This answer is not a bad guess, but it's pretty much unrelated to the right answer.
Comment: @Dougvj: turns out I *did* already write up an answer on [movl from memory to memory](https://stackoverflow.com/questions/33794169/movl-from-memory-to-memory), explaining the machine-encoding and ISA-design (and performance on modern CPUs) reasons for not having mem,mem instructions.  That question is an exact dup; I could and maybe should repost it here.
Comment: @PeterCordes Thank you for your input. I have learned quite a bit more since I have written this answer and realize I was not entirely correct. I have added an edit making note of this in the answer.
Comment: IA32 uses the same instruction set as 8086, just with some 32-bit extensions.  `inc dword [eax]` exists in IA-32.  (Or AT&T syntax, `incl (%eax)`.  It sounds like your last paragraph is claiming that 6502 and 8086 have this but IA-32 doesn't.
Comment: @PeterCordes That wasn't my intention, but I am unsure how to make that clearer. Go ahead and suggest an edit.
Comment: Oh, on a 2nd read I don't think it implies that, nvm.  This answer still needs a rewrite to start off with the correct reasons, rather than being wrong and then burying the right answer in an EDIT update.  Your answer shouldn't be a changelog, it should just be the best answer you can make it.
Comment: @PeterCordes Makes sense.  I have not been super familiar with the etiquette involved in such heavy rewrites, which is why I avoided it. Sometime when I have more time and interest I will do that. You should write your own answer surely it would be superior.
Answer: ia32 is x86, and x86 is evolution from the intel 8086 (iAPX 86). It was small and cheap chip based on 8-bit instruction sets, and had no "mov" with two explicit memory operands.
Wikipedia's author gives such explanation about instruction encoding of 8086:

Due to a compact encoding inspired by 8-bit processors, most instructions are one-address or two-address operations, which means that the result is stored in one of the operands. At most one of the operands can be in memory, but this memory operand can also be the destination, while the other operand, the source, can be either register or immediate. A single memory location can also often be used as both source and destination which, among other factors, further contributed to a code density comparable to (and often better than) most eight-bit machines at the time.

There were some CISCs with memory-memory instructions (single instruction to operate on two memory operands). The lecture https://www.cis.upenn.edu/~milom/cis501-Fall05/lectures/02_isa.pdf says that VAX can encode memory-memory instructions:

DEC VAX (Virtual Address eXtension to PDP-11): 1977

• Variable length instructions: 1-321 bytes!!!
• 14 GPRs + PC + stack-pointer + condition codes
• Data sizes: 8, 16, 32, 64, 128 bit, decimal, string
• Memory-memory instructions for all data sizes
• Special insns: crc, insque, polyf, and a cast of hundreds

This is OpenBSD memcpy source for VAX (instruction set manual http://h20565.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c04623178):
https://es.osdn.jp/projects/openbsd-octeon/scm/git/openbsd-octeon/blobs/master/src/sys/lib/libkern/arch/vax/memcpy.S
<code>         movq    8(ap),r1        /* r1 = src, r2 = length */
         movl    4(ap),r3        /* r3 = dst */
...
 1:      /* move forward */
         cmpl    r2,r0
         bgtru   3f              /* stupid movc3 limitation */
         movc3   r2,(r1),(r3)    /* move it all */
</code>
The "movc3" instruction here has two memory operands, which addresses are stored in registers.
x86 has several "string" instruction which will do memory-memory operations (*s, especially movs - http://x86.renejeschke.de/html/file_module_x86_id_203.html), but this instruction will use predefined registers SI & DI as addresses (implicit operands), and two memory operands still can't be encoded in x86.
Comment: I'm writing an answer right now.  IIRC, this question was previously closed as opinion based or something, otherwise I already would have posted one.  While going over my previous comments on this post, I was starting to realize that I should just answer it myself now.
Comment: NVM, found it: "2.2. Addressing Modes
The VAX-11 supports sixteen addressing modes. Each operand is represented in memory with an operand specifier, which consists of a mode byte followed by from zero to five additional bytes of information. The mode byte is broken into two fields: a four-bit mode specifier and a four-bit register designator."  From (google's html cache of) https://users.cs.jmu.edu/abzugcx/Public/Student-Produced-Term-Projects/Computer-Organization-2004-SPRING/VAX-Architecture-by-William-French-Ahmed-Kareem-Horatiu-Stancu-Steve-Tran-2004-Spring.doc.
Comment: Peter, what do you think about your own correct answer?
Comment: Update, I had already written an answer about this almost a year before my last comment:  [Why isn't movl from memory to memory allowed?](https://stackoverflow.com/q/33794169).  Finally happened to notice this old comment and my other answer at the same time.
Comment: Any idea how VAX machine code manages to stay compact when there's only one or zero memory operands to an instruction?  That's the issue for x86, where the original 8086 had pretty simple instruction decoding.  (That and potentially needing two AGUs, or two uses of one AGU).  8086 would have had to do something more complex than mod/rm byte, maybe with a variable-length encoding like 386's SIB byte.  VAX apparently manages to support [scaled-index addressing modes (with or without increment/decrement)!](https://www.cs.auckland.ac.nz/references/macvax/indexed-address-mode.html)
Comment: Pretty bulky vs. 8086, esp. since I've heard that original 8086 hardware was essentially always bottlenecked on code-fetch.
Answer: As far as I know, as a general rule in this architecture, only one memory access per instruction is allowed. This is because dealing with two memory accesses per instruction would complicate the processor's execution pipeline.
Comment: SCAS\*, MOVS\*, PUSH/POP mem, PUSHA/POPA and some other instructions do access multiple "words" of memory. But their memory operands aren't all encoded using the Mod R/M byte, which can refer to at most just one memory operand.
Comment: There is such a rule, but it's about µops in Intel processors.
Answer: RAM supports input and output, but not copying. Therefore a memory-to-memory move would actually be a memory-to-CPU-to-memory move. It would in theory be possible to implement such an instruction, but it probably wasn't because it wouldn't be very practical.
Here are some of the things that would need to be considered to implement such an instruction:

What temporary storage location do we use? A register?
If we use a register, which one do we hijack?

Not providing such an instruction leaves the above questions up to the programmer.
Comment: But they did provide it, see `movsb` and its family. And of course the register to use doesn't have to be architectural.
Comment: Adding to harold,@Kendall:- which register do you think call command hijacks?? and why something of this sort ,couldn't be used here???


Why does Photoshop CS6 open new documents in grayscale mode?

Question: When I open a new document in Photoshop CS6, it opens in grayscale mode. How can I change this?
Answer: In the 'New document' window you can change the 'Color Mode' to RGB/CMYK and then this is saved as a default, so every other new document will be set to RGB/CMYK.


Kitchen Cabinets over bare concrete floors

Question: I am installing kitchen cabinets and we are installing engineered wood after the cabinets are installed, floor installer said to just go right ahead and lay the cabinets over the bare concrete, which doesn't see right, anyway, the engineered floors will be approximately 5/8" to 1/2" in height, what would be the best course of action with this situation.  You help is greatly appreciated and with your answer, would you provide as much detail as possible on the exact procedure and process, please and thank you.
Comment: Every kitchen I remodeled, that has floors put in last.... I curse those people. Newer cabinets almost never fit in the floor cutout,shim the cabinets too much, toe kick doesn't cover the gap or is to short. What if one day you want to remove a base cabinet? Patch the floor? We always installed floor first, then cabinets. Damage floor during cabinet installation? Never! Cabinet installers should protect the floor while they are working.
Answer: Find out exactly how tall the floor will be, and use spacers (maybe pieces of the flooring) to raise the cabinets the same amount.  Ideally, install them after the floor is done.  Otherwise, try to have the flooring extend under the cabinets.  Your carpenter will probably install quarter round trim at the base of the cabinets to cover the seam where the cabinets and the floor intersect either way you do it.
Comment: Shoe molding in the kitchen? That's a hack for a job not properly done. That is what the toekick is for.
Comment: I see your point, as the floor should go up to the edge of the cabinet, but I still think it gives a more finished look.
Answer: From my experiences with remodeling my kitchen, baths, and looking at others, the floor is done last. Cabinets that were removed and the ones that were installed were installed on the bare plywood or concrete slab.  Shims were used to make sure the top of the cabinets were flush and level.  None were used to bring the cabinet up to a pre-determined floor height.
Floors were the final item to install and only with a 1/8 or 1/4" gap to the cabinet rough toe kick.  After floor was installed, the finished cabined baseboards were installed covering the gap.
My concern if the floors was laid first.  Who is responsible for the damage to the floor during the remaining constructions, cabinets, counter tops, sink, painting, other finishing work.
For bringing the base of the cabinet level with the floor height, Is there some un-written rule that a counter top must be exact "xx inches" from the floor.  All the various types of countertop have different thicksness.


Is there a way to reduce the strong flavour of mutton?

Question: Mutton has a slightly "gamey" flavor, is there a way to prep it before cooking which reduces this "gamey" flavour?
Comment: Is it mutton or lamb? They are not the same.
Comment: If you don't like mutton, maybe there is another ingredient you can use instead?
Answer:
Most of the gamey-ness comes from the fat. Unlike the pork or beef fat, mutton fat has a strong odor. You could try to trim off as much of it as possible.
http://chestofbooks.com/health/nutrition/Medicinal-Meals/Mutton-Fat.html

It also depends on whether the animal was grain-fed or grass-fed. The latter, although more natural, tend to produce meat that has a strong smell.

As for cooking mutton, I've found the only satisfactory way of getting rid of the smell is to make a curry out of it. There are many good Indian mutton curry recipes on the web.
Comment: While true that the flavor comes from the fat, which depends on the animal's diet, I don't think "most people" consider mutton fat to be inedible; this attitude is probably limited to Americans or people used to the bland taste of grain fed animals. In support of this, your own link at "chestofbooks.com" describes ways of preparing mutton fat and makes no mention of trimming it off.
Comment: I'm pretty sure mutton is meat from a sheep, not from a goat.
Comment: Mutton is another name for goat meat in certain regions of the world.
http://en.wikipedia.org/wiki/Goat_meat

Mutton is also used for sheep.
Comment: According to your Wikipedia link, *mutton* is a colloquial term for (adult) sheep meat in those areas, but is noted to technically refer to just sheep.
Comment: I made some edits to remove reference to goat (since mutton can refer to both goat and sheep in different parts of the world) and that "most people find it inedible"- simply not a fact.
Answer: The flavor will vary greatly depending on the cut of meat and the preparation.

Different cuts (eg: chops and legs) taste very differently from one another (legs and tougher meat taste more gamey)
Ground lamb has almost no gamey flavor
Well done meat will taste less gamey than medium (Edit: regarding "done-ness" this how it tastes to me. Since answering, I've discussed this with someone else who says the opposite is their experience)
Cooking with a lot of vegetables or a flavorful starch will by contrast cut down on the strong flavor more than a bland starch. A bland starch will result in highlighting the strong gamey taste
Answer: Are you talking about lamb in general or mutton?
Mutton does have a strong flavour - this can be reduced by removing the pink skin and trimming off superfluous fat.
You can also complement the flavour by adding things like garlic, olive oil, mint, wine,  rosemary and thyme, pepper, dry mustard and curry powder.
Answer: The best way to reduce the gamey flavor of mutton is to use lamb instead of mutton.  In most parts of the world, lamb is meat from a sheep that is less than 1-2 years old.  Mutton is meat from an adult sheep.
Lamb meat tends to be more tender and less gamey than meat from an older sheep.
Comment: Doesn't answer the Q *as asked*. But this does answer the OP concern of getting rid of the *gamey flavor*.   Signed.. Jerry Seinfeld *salad ain't got nothing on this mutton*
Answer: Before cooking,

Remove solid fat
Wash the meat well in cold water to get rid of blood
Boil the meat and then drain the water
a. Do this until the smell is gone

While cooking

Use generaous amount of ginger
Comment: I've noticed from watching 'Dining with the Chef' that Japanese cooking tends to do that step of boiling after cutting up the meat, then finish cooking in some other manner (in a pan or such) quite a bit.  They even use it for pork, not just gamey meats (although it might also be a sign that they haven't bred out all of the flavor like in the US)


Question regarding field extensions and basis

Question: Given a = $e^\frac{2i\pi}{18}$, field extension $|\Bbb Q(a):\Bbb Q| = 6$, I was wondering what the basis for $\Bbb Q(a)$ being, or how the elements are represented. I found the minimal polynomial to be $x^6-x^3+1$, which is degree 6 in $\Bbb Q$, so I'm guessing the basis for $\Bbb Q(a)$ would $\{1,a,a^2,a^3,a^4,a^5\}$. Does that make any sense? Normally the bases I have dealt with were degree $2$ so the elements were just like $a+bi$ or something with basis $\{1,i\}$
Comment: Since $f(x) = x^6-x^3+1$ is irreducible and $f(a) = 0$ you know $\mathbb{Q}[a] = \{ \sum_{n=0}^5 c_n a^n, c_n \in \mathbb{Q}\}$. For proving that $\mathbb{Q}(a) = \mathbb{Q}[a]$ you need to show that $\mathbb{Q}[x]/f(x)$ is a field. With $\phi(p(x)) = p(a)$ you have an isomorphism $\phi : \mathbb{Q}[x]/f(x) \to \mathbb{Q}[a]$, ie. $\mathbb{Q}[a]$ is a field.
Comment: Oh I see. Thank you very much. This might be much, but how would I attempt to find the galois group for Q(a):Q? If you don't want to answer thats fine.
Comment: The Galois group of cyclotomic extensions is easy : $\sigma(\zeta_9)=\zeta_9^k$ where $gcd(k,9) = 1$. There are $\varphi(9) = 6$ such automorphisms.
Comment: Oh man we didn't learn about the zeta stuff yet. Is there a link you can provide me to read up on this? Despite your comment, I can't list the different $\sigma$ elements, since our professor wants a product table and then show what group this is isomorphic too.. If you can't, regardless, thank you very much for your help.
Comment: $\zeta_9 = a = e^{2 i \pi / 9}$ and $\sigma$ is a ring morphism $\mathbb{Q}[a] \to \mathbb{Q}[a]$, so $\sigma(a) = a^k$ means $\sigma(\sum_{n=0}^5 c_n a^n) =\sum_{n=0}^5 c_n \sigma(a^n)= \sum_{n=0}^5 c_n a^{nk}$
Answer: Your finding of the minimal polynomial and the basis are fine, it proves that you have well understood the setup. A trick to retrieve the Galois group is to find another root for $x^6-x^3+1$. Some trial and error gives you that $-a^2$ is such a root. So there is an element $\sigma$ of the Galois group that maps $a \mapsto -a^2$, so we can then ask what is the image $\sigma(-a^2)$? It's $--a^4$ and we verify that it is indeed another root! we can go on and find the three other roots: $\sigma(-a^4) = -a^8 = a^2-a^5$, $\sigma(a^2-a^5) = \sigma(a^2)-\sigma(a^5) = -a^4 + a^{10} = -a^4 -a$ and $\sigma(-a^4 -a) = \sigma(-a^4) - \sigma(a) = a^2 + a^5 + a^2$. If we change basis to these roots
$$
\{a, -a^2,-a^4,a^2-a^5,a^4-a, a^5\}
$$
we have an easy expression for $\sigma$ as a matrix.
When we revert this matrix to the original basis $\{1,a,a^2,a^3,a^4,a^5\}$ this yields the matrix
$$
\sigma = \begin{pmatrix}1&0&0&1&0 &0\\
                        0&0&0&0&0 &1\\
                        0&-1&0&0&-1&0\\
                        0&0&0&-1 & 0&0\\
                        0&0&1&0&0&0\\
                        0&0&0&0&1&0
                        \end{pmatrix}
$$
This matrix generates the Galois group, a cyclic group of order $6$.


Prevent Azure Cloud Service from uninstalling software automatically

Question: We are running an Azure cloud service. We have an instance of Scalyr agent installed on the box to capture the logs. Every few days/weeks, the scalyr agent gets automatically removed from the instances. We believe this happens when windows automatically patches the boxes. Is there a way to prevent this from happening?
Comment: Which type of cloud service? What do you mean exactly by "box"?
Comment: Yes, we need to know what service you are using. If it's plain VM's then this should not be happening, if your using actual legacy cloud services, scale sets etc. then this may be by design
Comment: as @SamCogan said, this is the 'legacy' cloud service. The box is the instance that is launched by the cloud service.
Answer: Cloud Services are the old, legacy solution , I would recommend you move away from that.
The issue you are having is due to you using cloud services, this is a PaaS solution where whatever you want to run on the VM is supposed to be part of your application bundle you deploy with the cloud service. Manually installing things on the cloud service VM's is not supported and you will see the issue you have observed.
You can see this from the docs here:

Unlike VMs created with Virtual Machines, writes made to Azure Cloud
Services VMs aren't persistent. There's nothing like a Virtual
Machines data disk

If you want a VM you can manually updated then you want to look at using IaaS virtual machines (and use the ARM version, not classic).
Comment: Thanks. It is true that MS is no longer developing Azure cloud services but they are not being deprecated AFAIK. It will require significant development effort to move away from Azure cloud services and this is not an option at the moment. Are you aware of any document which states that software can't be installed independently on the instances of the Azure cloud services?
Comment: You are correct, I had missed the exclusion for cloud services, however I would bet that we will see them retired eventually. I have updated the answer with details from the docs.
Comment: Many thanks. This clarifies the mystery :)


Can an electric field be there without a charged partical?

Question: How does a photon have an electric field around itself without any charge particle inside it.
Comment: "Photon *is* the electric field". More exactly, photon is the gauge boson mediating electromagnetic interaction.
Answer: At the risk of phrasing this rather loosely, a charge is needed to create an electric field. If you draw field lines representing your electric field then they must start and end on a charge. More precisely, the divergence of the electric field must be zero unless a charge is present.
However in an infinite plane electromagnetic wave the field lines do not begin or end anywhere, so no charge is required for the field to exist.
This is of course a somewhat artificial model since no electromagnetic wave can be infinite. In practice charge is needed to create the wave, and charge is needed to absorb the wave. The field lines for the wave will begin on the charge that creates it and end on the charge that absorbs it.
Answer: Let's start one step behind. We need to look at electric but also at magnetic fields, we can't just explain with one.
As you wanted, we assume there is no charge "making" the field. If there is no charge, the charge density is (obviously) 0. Then the current density is 0, too.
$\rho(\vec{r},t)=\vec{j}(\vec{r},t)=0$.
Now, as usual in electromagnetism, lets look at the maxwell equations for this problem:
$\vec\nabla\cdot\vec{E} = 0$
$\vec\nabla \times \vec{B} - \frac{1}{c^2}\frac{\partial \vec{E}}{\partial t}=0$
$\vec\nabla\cdot \vec{B} = 0$
$\vec\nabla \times \vec{E} + \frac{\partial \vec{B}}{\partial t}=0$.
I wont solve them here (look the calculus up in your em-book of favour) but special solutions to these eq. are (of course polarisation plays another role here, I'll assume the simplest case):
$\vec{E}(\vec{r},t)=E_0\vec{e}_x\exp{i(kz-\omega t)}$
$\vec{B}(\vec{r},t)=\frac{1}{c}E_0\vec{e}_y\exp{i(kz-\omega t)}$.
So, to answer your question: Yes, there can be an electric field without a charged particle, it directly follows from the maxwell equations.
Then you were talking about "photons". Until know in the calculus there were no photons. It may be problematic to introduce it this way (better look up in a book on quantum mechanics) but let me try.
When "seeing" light, we basically talk of waves. Although, when measuring vveerryy low fields we notice, that we actually dont observe a continuus field but particles, photons. And I guess now it should be clear:
The em waves are the light, but as the photons are the light, the photons are the em fields (for a shorter "explanation", look at Mikael Kuismas comment).