Thread Breakpoint at an array assignment

Question: im trying to make an array that is (n x n) large depending on what value you enter, and then populate that array with random integers. Could you guys please help me with two problems?

Any values of n greater than 4 give "error at display" in the last rows, if i display what value it would have been if it wasn't an error it is the same across, and something huge like 20019238394
Why does it create the same number all the way across? Is it not generating new random numbers?
#include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <time.h>
using namespace std;

int arrayCreate(int);

int main(int argc, const char * argv[]) {

int n;
cout << "enter how big your array is (n) , it will be shown as (n x   n)" << endl;

cin >> n;
cout << "------------------------------" << endl;

arrayCreate(n);

return 0;
}

int arrayCreate(int n){

    srand (time(NULL));

    int y=0, x=0;
    int original[x][y];
//putting in random values

  for (int y=0; y< n; y++){

  for (int x=0; x< n; x++){
    int check = (rand() % 9 + 1);
        if (check < 10)
        original[x][y] = check;
        else
        cout << "error";
}

}
//displaying those values
    for (y=0; y<n; y++){
    for (x=0; x<n; x++){
        if (original[x][y] < 10)
    cout << original[x][y] << " ";
        else
        cout << "error at display";
}

    cout << "            y is " << y << endl;}

return original[x][y];
}

Answer: You're declaring your array with size [0][0]. What you wanted was size [n][n].
As a result, you're writing to unallocated memory. To correct:
int original[n][n];

should work for you.
Answer: when creating a new array you should allocate it on the heap, so it would be:
int** original = new int* [n]; // creates column
for(int i=0; i<n; i++)
    original[i] = new int [n]; // creates rows

then when it's no longer needed, have to free memory
for(int i=0; i<n; i++)
    delete original[i];

delete original;


Masses connected to ropes through pulleys

Question: How to know in which direction tension acts on pulleys where multiple masses are connected through multiple pulleys?
Comment: Can you show a diagram for example
Answer: The direction of tension in a rope or string is always parallel to the direction of the rope/string itself, and acts in the direction that would lengthen the rope/string. If the internal force acted in the opposite direction then it would be called compression, not tension - and ropes/strings cannot support a compressive load.
If the rope/ string goes round a pulley then it exerts two tangential forces on the pulley; one along the tangent where it enters the pulley and one along the tangent where it leaves. If the rope/string is light (effectively massless) and there is no friction between it and the pulley then these two forces will be equal in magnitude, although they may act in different directions, depending on the geometry of the scenario.
In general, if you are unsure whether a force acts in one of two opposite directions (to the right or the left, say) , make an assumption (so pick right, for example) and solve the problem. If the magnitude of the force turns out to be negative then it acts in the opposite direction to the one you picked.


Long data is not posting using ASIFormDataRequest

Question: I am using ASIFormDataRequest to send data to server. I am posting a string to server. This string contains encoded image in base64 format. When string length is approx 70,000 character or 70 kb approx, request works fine but when length goes to 130,000 characters or approx. 125 kb, string is not posted to server.
Initially, I supposed this is an server issue so I increased the length in config file too high. But I designed an aspx page where I put a textfield and submit button. I entered same string (approx. 130,000 characters) and submit it and it saved in database successfully. Which suggests that there is no issue on server side and problem occurs in mobile end.
I am not able to find any solution. Please help me to out of this problem. I am also posting the source code:
<code>NSString *string = @"fdfd..."; // very long string. Approx. 130,000 characters long

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

[request setPostValue:string forKey:@"encryptedJson"];

[request setDelegate:self];

[request setDidFinishSelector:@selector(sendFormRequestDone:)];

[request setDidFailSelector:@selector(sendFormRequestWentWrong:)];

[request startSynchronous];
</code>
Comment: What of the two specified selectors is called?
Comment: sendFormRequestDone is called
Answer: Please do this
<code>  ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
   [request retain];
</code>


Probability that polynomial $f(m)$ is prime for $m < n$, as $n$ goes to infinity?

Question: Say we have a polynomial $f(n)$ with integer coefficients, and we want to know the probability that $f(m)$ is prime for $m<n$, as $n$ goes to infinity. The prime number theorem treats the case $f(n) = n$. Has any work been done on this question for more general polynomials, for example quadratics?
Comment: Your `<` was probably being interpreted as an escape character for an html code.  What sort of result are you expecting to find?  This will depend very heavily on what the specific polynomial is.  For example $f(n)=n^2+n+2$ is *never* prime.
Comment: I'm not expecting any kind of general theory-- obviously this question is very sensitive to individual polynomials.
Comment: As an aside, $f(x)=x^2-x+41$ has the property that $f(1),f(2),\dots,f(40)$ are all prime numbers.
Answer: There are no proven results of strength comparable to the Prime Number Theorem, except for degree $1$ polynomials which are covered by PNT-AP.  For instance, we don't know a single polynomial of degree $>1$ which provably takes infinitely many prime values, even though we believe this should be true as long as the polynomial is irreducible and doesn't have any obvious reason to not be prime (i.e. being divisible by a fixed prime).  But there is a heuristic expectation for what the correct probability should be, which is given precisely by the Bateman-Horn conjecture:
https://en.wikipedia.org/wiki/Bateman%2DHorn_conjecture
For linear polynomials, the situation is pretty well understood.  If $(a,b)>1$, then the polynomial $an+b$ obviously takes only finitely many prime values (at most one, in fact), so the probability is either $0$ or $1/n$.  Otherwise, $a$ and $b$ are relatively prime, and the asymptotic probability of $an+b$ being prime is
$$P(am+b \text{ prime} \mid m \le n) \sim \frac{a}{\phi(a) \log n}.$$
(Here $a$ and $b$ are assumed to be fixed so the rate of convergence is allowed to depend on $a$ and $b$.)
Comment: Really? Not even a single higher degree polynomial is known to be prime infinitely many times? Wow. It would be quite surprising if every higher degree polynomial was only prime a finite number of times over the positive integers.
Comment: Do you know of any results on the asymptotic probability that a linear polynomial takes on a prime value?
Comment: @Vik78 Yes, linear polynomials are classical and proved essentially at the same time as the Prime Number Theorem itself.
Comment: Okay, I know that they take on prime values an infinite number of times, but what is the probability a given linear polynomial will be prime?
Comment: @Vik78 See my updated answer.


Does the centrifugal force of a rotating object acts at this same rotating object?

Question: when rotating an object by a string a centripetal force from the string will act at the object towards the center and by Newton's 3rd law an opposite force will act at the string by the object . Then why it's said that the centrifugal force acts on the rotating object rather than saying it's acting on the string?
Answer: You need to show where did you see this so we know the context. Without this, I could guess that the mention of "centrifugal force" you saw may be refering to the analysis of the motion in a noninertial frame. In this case a "fictitious force" is introduced, in the direction opposite to the acceleration (centripetal in this case).
This type of "centrifugal force" is not the third law pair of anything as it is not due to the interaction between two objects. It acts on all the objects, when analysed in a rotating frame. The force on the string is a rel force, due to the interaction between the object and the string. And indeed it has a centifugal direction. Hovewer, it is not very common to see it described as the centrifugal force.
Answer: The issue you have found here with Newton's 3rd law seemingly not being fulfilled happens because the centrifugal force is not a force. In reality no such force exists.
A force that does exist is a centripetal force pulling inwards in the rotational circle. And the string does feel pulled outwards while it exerts this force inwards. This is why weak strings will break when you swing something heavy from them.


Publishing a paper that cites my previous work

Question: How should one cite previous work of his own? If one paper relies on previous work that author already did I suppose that paper should be cited. Given that one paper is a continuation of the one before should the papers that are cited there as previous work be cited as-well?
Comment: I am a bit uncertain on why this should be different just because it is work of the author himself. What to cite and when should not depends on who wrote the cited text.
Comment: _How should one cite previous work of his own?_ — Exactly the same way anyone else should cite his previous work.
Comment: I don't know. That's why i'm asking. Given that one paper is a continuation of the other what clarifies as previous work? The paper before or the previous work of that paper?
Comment: I am still not sure what you mean. Everything done previously is "previous work", regardless of who the author is.
Comment: Let me try to be more specific. To all of the researching stuff in Computer Science, the creation of the computer is also previous work. So more or less my question is, how far should the previous work should go? If the new paper is only dealing with stuff noted in the previous one (both of the same author) should it also cited the previous one's previous work?
Answer: If I take your question literally, then this would be my answer:
I citation serves two purposes:

You avoid that you take credit for work by others, and thus avoid plagiarism. This point also applies to your own work published somewhere else.
It can act like an "external appendix" (e.g. the interested reader can read the proof in...).

So, if you make a statement in your current article that relies on findings in your previous articles, then you should cite yourself. If your previous articles contain information you would otherwise have put in an (web)appendix, then you can cite yourself. Otherwise, you should not cite yourself.
However, I suspect you want to know how far back you should go when writing the section "previous research". Here the answer is it depends on what is considered normal in your (sub-)discipline. At the very least I would look at that section from the perspective of a reader: Can they understand how you want to place your article within the research that has been done in this area? Discussing the creation of the computer is typically not necessary to achieve that goal...
Answer: A paper should be largely self-contained in its citations.  Cite everything that is directly needed to understand the context of the current paper.  This will typically mean that there are many citations shared between papers, but that is OK.
Let me illustrate by means of three examples.  Let's say that you have already written paper A, which presents a method for making widgets.  A year later, you write paper B, building on the work.

Case 1: Paper B is about a better method for making widgets: In this case, you need to give the context for addressing the widget-making problem.  You should not assume that the reader has read paper A, so the citations of paper B should likely be nearly identical, with the addition of paper A.  The only missing will be citations that were supporting the method in paper A but that do not apply to paper B (e.g., an analytical technique used for one but not the other).
Case 2: Paper B is about applications of widgets: In this case, you need to keep the citations supporting why anybody should care about widgets, but can drop all of the citations on alternate ways of making widgets.  It is enough to say, "we make the widgets using the method in [cite]", if the paper isn't about making them.
Case 3: Paper B is about using the same method to make gizmos instead of widgets: In this case, you can drop all of the citations motivating care about widgets, since this is about gizmos instead.  You will still need citations to compare this method to alternate methods of making gizmos (which might be the same citations as for widgets, depending).

Thus, you may see that the number of shared citations depends on the type of relationship between the papers, because ultimately it boils down to making sure the reader doesn't have to look up another paper in order to find the critical pieces of related work for the one that they are currently reading.
Answer: Your previous work already cites the papers it's based on, so just citing your own paper is implicitly citing the other ones.
I think NO, you don't need to cite them all, just the last.
Comment: Up to a point. Any given paper should be readable on its own. I think it's fine to _summarize_ previous work in the new paper and point to the old paper for more details, but leaving it out entirely is definitely a no-no. (And no, just citing the previous paper is not a summary.)


Server 2012 R2 Essentials Search not working on "Shared Folders"

Question: On Windows Server 2012 R2 Essentials, the built in shared folder named "Shared Folders"(located in "C:\\DFSRoot\Shared Folders") that contains a virtual folder(Not sure what the proper name is as it is not a shortcut) folders to the actual shared folders. This works fine with one exception, when the search server feature is installed and the indexing options include the actual shared folder there is a problem in how the indexing works with the client computers.
Example:

In dashboard we create a new share folder called "Company Files"

this creates a shared folder at "D:\\Shared Folders" and a virtual folder at "C:\\DFSRoot\Shared Folder\" named "Company Files"

There are now two ways to access this folder over the network

"\\Server\Shared Folders\Company Files"
"\\Server\Company Files"

Open "Indexing Options" and add the "D:\\Shared Folders\" to the indexing list and select "Index Properties and File Contents"
[problem] The users rely on the navigation tree in the navigation pane to traverse the folder structures and speed up there work flow. This is supported using the "Shared Folders" on client computers but not if they go directly to "\Server\Company Files".

If you login in to a client computer and go to the "Shared Folders" (the address that it uses is "\\Server\Shared Folders\Company Files") shortcut that was added to the client computer by the essentials installer then open the "Company Files" folder and search for a document it will not utilize the index on the server and will take a long time.
If you go directly to "\\Server\Company Files" and search in there it uses the index on the server and results are displayed very fast as it should.

[Work around] The only way I have been able to make it work is to make a group policy that maps a drive to "\Server\Company Files" and they get both the navigation tree and the server indexed search but the client computers that are laptops get the drive disconnected message when remote and it is confusing them and causing issues.

The question is how can I have the client computers search using the server index using the "Shared Folders" virtual folders?
[notes]
- I have tried to include the "C:\\DFSRoot\Shared Folders" in the index as well but no luck.
- Client computers are running Windows 10 Pro
Answer: I know that indexing services are not supported on DFS shares, which makes me wonder if the "Shared Folders" virtual folders you are talking about are somehow served via DFS "under the hood". It would make some sort of sense due to the nature of those directories


Pink Flower Identification

Question: Do you recognize this spring blooming pink flower with delicate foliage planted in the fall as a small corm? Tuber?
Comment: Welcome! Could you please add where in the world this little darling is growing? And for all new users I recommend you take a moment to take the [tour] and browse through the [help], to learn more about how the site works.
Comment: Rose Valley, PA
Comment: https://mywildflowers.com/identify.asp  Does it help?
Comment: I got Geranium molle as a possibility, but the petals are arranged wrong and more importantly the leaves are very wrong. I do recognize it but can't remember its name (It's considered a weed where I live, IIRC). Not a bad key, but a database is limited to only the data in it.
Answer: It's probably Cutlead Geranium, Geranium dissectum, which is an introduced plant from Europe. We find it in lawns sometimes in Wisconsin. It's relatively identical to Carolina Geranium (Geranium carolinianum, a native species), but that one's petals seem wrong to me. Both are found in Pennsylvania.
A good source for you to look at:
Virginia Tech's Weed Identification site (be sure to click the arrows next to the photos on the top of the page to scroll through samples; some will match what you have). This site also gives identifying characteristics that you can use to verify my ID.
Once you've made a tentative ID, an excellent source for determining whether a plant is native or not and where in the US it has been reported is the US Dept of Agriculture's Plant Finder site. You can enter either the scientific name or the common name.

Pink Flower Identification


Get Raspi's CPU temperature within Docker container

Question: I've build a little ASP.NET Core application for my Raspberry Pi 4 which lets me control a fan (see here). The app is deployed as a small self-contained Linux application running on bare metal of my Raspi.
For measuring the temperature, I'm calling vcgencmd measure_temp on the Raspi which gives me the actual temperature.
For various reasons, I'd prefer to run this app within a Docker container:

No more manual service registration within Linux, Docker feature --restart-always handles this.
No more downloading the latest release from GitHub, extracting and marking the app as executable.

But I have no clue how I can retrieve the Raspi's temperature from within a container.
I already tried to map the Raspi's directory /usr/bin/ and /opt/vc/bin/ into a Docker container and call vcgencmd from inside - but that simply fails due to missing dependencies.
And I already found an answer on Stack Overflow suggesting to create a named pipe on the Raspi and then consume this pipe from within the container. But this removes the beauty of a container if I have to setup something like a named pipe.
So long story short: is there any way to get the Raspi's current CPU temperature from within a Docker container?
Thx!
Answer: If we just mount /opt/vc inside a container...
docker run -it --rm -v /opt/vc:/opt/vc debian:stretch /opt/vc/bin/vcgencmd measure_temp

...it fails with:
/opt/vc/bin/vcgencmd: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory

Where do we find libvchiq_arm.so? We can use ldd to find out:
$ ldd /opt/vc/bin/vcgencmd
        linux-vdso.so.1 (0x7efe7000)
        /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76f79000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x76f52000)
        libvcos.so => /opt/vc/lib/libvcos.so (0x76f39000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76f0f000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76efc000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76ee5000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76d97000)
        /lib/ld-linux-armhf.so.3 (0x76f8e000)

This shows us that vcgencmd wants two libraries that can be found in /opt/vc/lib. These are available in the container, but the container environment doesn't know to look for them in /opt/vc/lib. We can fix that by setting LD_LIBRARY_PATH:
docker run -it --rm -v /opt/vc:/opt/vc -e LD_LIBRARY_PATH=/opt/vc/lib debian:stretch /opt/vc/bin/vcgencmd measure_temp

Which fails with:
VCHI initialization failed

Great, we've solved the missing library problem! I suspect that vcgencmd is looking for a device that isn't available in the container. We can figure out what that is by running vcgencmd on the host under the control of strace:
strace -o /tmp/trace  -f -s 80 /opt/vc/bin/vcgencmd measure_temp

Now we look for /dev in /tmp/trace, and we find:
6868  openat(AT_FDCWD, "/dev/vchiq", O_RDWR|O_LARGEFILE) = 3

So we need to expose /dev/vchiq inside the container. We can do that with the --device option:
docker run -it --rm -v /opt:/opt -e LD_LIBRARY_PATH=/opt/vc/lib --device /dev/vchiq debian:stretch /opt/vc/bin/vcgencmd measure_temp

Which now reports:
temp=69.3'C

We have successfully run vcgencmd inside a container.
Comment: WOW! If possible, I'd give you two upvotes for this answer. Super explanation, I learned so much. Thanks a lot.
Answer: The answer by @larsks, is great. However, now in the RaspberryPI 4 with Debian 11 (bulleye) aarch64, they have placed vcgencmd from /opt/vc/bin/vcgencmd to /usr/bin/vcgencmd. In consequence, here is the updated version of mu88 solution:
docker run -it --rm -v /usr:/usr -e LD_LIBRARY_PATH=/usr/lib --device /dev/vchiq debian:stretch /usr/bin/vcgencmd measure_temp


3 square theorem

Question: Does anyone know a proof of  the 3 square theorem which uses Cassels' Lemma: n can be expressed in 3 squares of rationals iff n can be expressed in 3 squares of integers.
Comment: Assuming you mean the standard classification of which integers are the sum of three integer squares, the only other thing you need is the local-global principle, which is true in this situation (Hasse-Minkowski). See for example Serre's book "A course in arithmetic". The reason you get the funny $4^m(8n+7)$ business is the local condition at 2; all other local conditions are satisfied.
Comment: Google does. Here is a concrete application towards the 3-square theorem: to prove that $M\equiv 3\pmod{8}$ is a sum of three integer squares, apply the Hasse principle to the form $x^2 + y^2 + z^2 - Mw^2$ and thereby show that this form represents 0 over $\mathbb{Q}$ (it does so over all completions). Using Cassels's (sic) lemma completes the proof of the theorem for $M\equiv 3\pmod{8}$.
Comment: Do you know a proof which _doesn't_?  (Not rhetorical; I only know one proof.)
Answer: Probably worth pointing out a certain distinction. The quoted property is Pete L. Clark's ADC property, see:
Must a ring which admits a Euclidean quadratic form be Euclidean?
For positive forms in three variables with integer coefficients, this is stronger than L. E. Dickson's "regularity," which means that the form integrally represents any number represented by some form in the same genus. The ADC property is not implied by  class number one here, nor does ADC guarantee class number one. I sent Pete the 103 positive ternary ADC forms; there are 794 positive ternaries alone in their genera. Also, thanks to Pete for actually checking something I foolishly assumed, there are several ADC forms not alone in their genera, such as $\langle 1,1,3,0,1,0 \rangle$ or $g(x,y,z) =  x^2 +  y^2 + 3 z^2 +  z x,$ of discriminant 11.
  I also gave an example for the 810 failures, each such regular form (including 14 not proved yet, after B-K Oh proved 8) represented some $p^2 n$ without representing $n,$ where the prime $p$ divides the Brandt-Intrau-Watson discriminant.
So the subtle point is that the ADC property in "Cassels's lemma" includes primes that divide the discriminant, which in the case of three squares is $-4,$ or taken as 4 by me and J. L. Lehman. The fact that the sum of three squares represents $n$ if and only if it represents $4n$ is, well, among regular forms, an artifact of a fortunate arrangement of local conditions, in this case the single "congruence obstruction" $4^k(8 m + 7).$
For example, the regular form $\langle 1,     1,          3,      1,    1,    1 \rangle$ or $g(x,y,z) = x^2 + y^2 + 3 z^2 +  y z + z x + x y,$ integrally represents 8 but not 2. Oh, the discriminant of this form is 8, so the only prime available to distinguish between regularity and the stronger ADC property is 2.
Here is an easier one: $x^2 + y^2 + 4 z^2$ is regular, related in an evident way to the sum of three squares, and is not ADC as it integrally represents 12 but not 3.
Comment: Indeed, the three squares form over $\mathbb{Z}$ is the one I focus on in the introduction of (the latest draft) of this paper: http://www.math.uga.edu/~pete/ADCformsPart1b.pdf.  In particular, I do give the argument as to why Cassels-Davenport + Hasse-Minkowski implies Gauss-Legendre (three squares theorem).  But this is not news: see Serre's *Couse in Arithmetic* or Weil's *Number Theory: an approach through history...* or many other standard texts.
Comment: @Will: by the way, the ADC property does not imply class number one, not even for positive definite ternary forms, as I learned from the list you sent me.  It was probably just a typo: the *Euclidean property* implies class number one in this case and, we think, more generally.
Comment: Hi, Pete, you are generous. I just assumed without any thought involved that ADC implied class number one for positive ternaries. As I fell asleep last night I briefly wondered if that were really true, but I never checked. About your Euclidean property implying class number one for positive integral forms, as I have been unable to prove that (perhaps the same with your local colleague), I think sometimes about writing to Europe and saying "here is our list, what do you think." But it is your project. Note that Serre's trick does not seem to show that Euclidean implies 2-regular (A. Earnest).
Answer: As others have said, the proof of Three Squares using the ((Aubry-)Davenport-)Cassels Lemma is a very prominent one nowadays.  But this was not the original proof, and if you look in a number theory text written before 1980 or so that is not Serre's Course in Arithmetic, if they give a proof at all (and some do!) it will not be this one.  In fact when I first taught an elementary number theory course in early 2007 I suggested a proof of 3ST as a (rather challenging) final project, and one student, Ben Wyser, did so and wrote up an elementary proof.  I would have some trouble finding his paper now (he is completing his PhD this year; maybe I should ask him for another copy soon), but for instance he might have used the text Sums of squares of integers by Moreno and Wagstaff as a reference.  These types of proofs unfortunately have the character of many elementary proofs in number theory that it took me a long time to realize that I found discouraging: almost any given step in the argument follows easily enough, but when you look back at the entire argument and ask "What is really going on here?" it is far from clear.
(If you happen to be in possession of more advanced number theoretic knowledge and tools, it can be an interesting challenge to "unrewrite" these elementary proofs using language and concepts that makes more sense to you.  But if you are an undergraduate student who is any less brilliant than the handful of students who are prominent on this site, I say good luck with that!)
The reason that I am writing this answer now though is that I recently read a very nice paper:

MR0304334 (46 #3469)
Wójcik, Jan
On sums of three squares.
Colloq. Math. 24 (1971/72), 117–119.
The author gives a short proof of Gauss's theorem that a positive integer $n$, not of the form $4^a(8b+7)$, is expressible as a sum (1) $n=x^2+y^2+z^2$ of three squares. As did N. C. Ankeny [Proc. Amer. Math. Soc. 8 (1957), 316--319; MR0085275 (19,15d)] and L. J. Mordell [Rev. Math. Pures Appl. 3 (1958), 25--27; MR0122778 (23 #A117)] the author uses Minkowski's convex body theorem, in this case (together with the corresponding results for two squares) to show that it is sufficient to solve (1) for square free n in rationals $x,y,z$. He does this by choosing $\beta$ and (by "Dirichlet's theorem'') a prime $q \equiv 1 \pmod 4$ such that Lagrange's conditions for the solubility of $nu^2−v^2−2^\beta q w^2=0$ can be satisfied.  (review by G. Greaves)

Some comments:

I had to (grumble) actually go into my university library to read the print copy of this paper: I wish I had an electronic copy...

I'm not sure why there are quotation marks around Dirichlet's Theorem: this is the theorem on primes in arithmetic progressions, due indeed to P.G.L. Dirichlet!  But anyway, "Dirichlet's Theorem" is certainly a deep theorem in number theory which has "elementary" proofs in the weird technical sense of our field but no proof really easier than the usual character theory / Dirichlet L-function argument, so far as I know.  It also uses Fermat's Two Squares Theorem and Legendre's Theorem.  What it does not use is:

(i) the Hasse-Minkowski theory (it never mentions $p$-adic anything!), or
(ii) the ADC proof of the fact that an integer which is a sum of three rational squares is also a sum of three integral squares (i.e., the one which observes that $x^2+y^2+z^2$ satisfies a Euclidean property and shows that this suffices). Instead Wojcik gives a very classical geometry of numbers proof, which superficially at least looks different.  (I am currently leading a graduate research group in geometry of numbers and applications to quadratic forms, and I have a student looking at Wojcik's argument to see whether it generalizes to other "ADC forms".)
The fact that the proof uses Two Squares, Legendre's Theorem on Conics and Dirichlet's Theorem but not $p$-adic methods was a small miracle to me, because it happens that in my elementary number theory course I do indeed cover the first three topics but not the last.  So I recently stitched together a proof of the Three Squares Theorem that uses first the ADC argument to establish that $x^2+y^2+z^2$ is an ADC form and then Wojcik's argument to show exactly which integers it represents.  You can find this argument in $\S 2$ of these notes.

3 square theorem


Facebook Registration Plugin and Name Field

Question: I am trying to use FaceBook Registration Plugin (http://developers.facebook.com/docs/plugins/registration/). It already has name field which I dont want to use instead i want to use my own First Name and Last Name fields Is there a way to do so ?
Answer: In the iframe url of the registration plugin, you pass in a json object listing the fields you would like on the form.
You can specify named fields (ie ones that exist within Facebook and so can be pre-populated) and also custom fields (anything that facebook doesn't know, but you might want). For example:
<code>[
 {'name':'name'},
 {'name':'email'},
 {'name':'location'},
 {'name':'gender'},
 {'name':'birthday'},
 {'name':'password'},
 {'name':'like', 'description':'Do you like this plugin?', 'type':'checkbox',  'default':'checked'},
 {'name':'phone', 'description':'Phone Number', 'type':'text'},
 {'name':'anniversary','description':'Anniversary', 'type':'date'},
 {'name':'captain', 'description':'Best Captain', 'type':'select',    'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}},
 {'name':'force', 'description':'Which side?', 'type':'select',    'options':{'jedi':'Jedi','sith':'Sith'}, 'default':'sith'},
 {'name':'live', 'description':'Best Place to Live', 'type':'typeahead', 'categories':['city','country','state_province']},
 {'name':'captcha'}
]
</code>
It's worth noting that facebook already has named fields for firstname and lastname - you can ask for these and facebook will pre-populate the fields, but allow the user to change them.
All this is documented at https://developers.facebook.com/docs/plugins/registration/
Answer: If a user is registering to your site using the plugin, they are trying to connect via Facebook and therefore would like to have their information auto-filled. If they do not, then that Name field can work for a First Name and Last Name by allowing them to enter their full name.
The problem is, that plugin is optimized for use by Facebook users AND non-facebook users, shown here:

The plugin also allows users who do
  not have a Facebook account, or do not
  wish to sign up for your site using
  Facebook to use the same form as those
  who are connecting with Facebook. This
  eliminates the need to provide two
  separate login experiences

With that said, they intend for this form to work for non-Facebook signups as well. I don't believe you can edit the forms since it uses an iframe and calls those fields through it with no user-allowed editing of the plugin. However, this doesn't mean that you could use the Facebook API to create your own plugin, or maybe a CMS you would use would have its own as well...
Another option is to have your own form, but have a "Sign In with Facebook!" link.
To answer your question directly: No, it does not look like it is editable in any way, but there are alternatives if you do not appreciate the way that the form already works.


Column names and apostrophes

Question: I'm quite new to MySQL and I'm confused with one problem: I have one table on which I cannot perform queries without apostrophes surrounding column names, but for the rest of tables it is possible. I need to do queries without apostrophes to be able to do the same on parrarel HSQL database. On what is it dependent? All tables in MySQL are InnoDB.
Answer: Your table/column name(s) has a reserved keyword.
http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
Answer: You need apostrophes if a column name is a reserved word or if it contains blanks or special characters. Same is true for the table name.
Answer: Use table names which are not included in reserve words then you didnot need apostrophes(`).

Column names and apostrophes


Would a Weather and Climate Change class be helpful to peruse a career in environmental economics

Question: I'm an undergraduate student and want to become an environmental economist. Would it be beneficial to take a class on weather and climate change or should I stick with economics courses geared towards the environment?
Answer: It wouldn't be detrimental by any means, but I would regard it as non-essential.

non-essential, because you'll likely use quite a simplified (as opposed to simple) framework for thinking about interactions between the economy and the environment. See for example Golosov et al. (2011) https://www.nber.org/papers/w17348

and non-essential because the larger models with more complex interactions between the economy and the climate/weather systems, would normally be conducted alongside some climate scientists. The division of labour here is arguably preferable, given that climate scientists and economists bring their own respective strengths to the table. I believe this to be the case in some of the integrated assessment models (IAMs) such as RICE/DICE etc.

But overall, if you believe it to be beneficial to your cause; I don't think it would be detrimental. Certainly it would enrich any modelling you'd consider doing.
Answer: [Seldom] give unguarded advice, for advice is a dangerous gift, even from the wise to the wise, and all courses may run ill. (Tolkien, the Fellowship of the Ring)
Let me offer a slightly different perspective than EB3112.
First of all you talk about "economics courses geared towards the environment" as your other option. As we don't know how much environment these courses contain it is hard for us to judge how useful the weather and climate course is relative to the other courses.
Second it depends on what kind of environmental economist you hope to become. Although many environmental economists work on climate change, by no means all of them do. For renewable resources a course in ecology may be far more useful, if you intend to work on pollution environmental science may be the way to go. Moreover, if climate change is your interest a course that focuses on climate science is probably more useful as weather and climate are very different beasts. Then again we don't know what your options are.
Although EB3112 is right that many EE models have either a very simplified version of the environment or you work with environmental scientists that do their part of the model, it is very helpful if you speak each other's language. This is especially true when setting up joint projects.  For that such introduction to.... courses are very helpful. Also it prevents you from making mistakes in assumptions about the environment and how to correctly measure things in there.


Solving non-negative least squares in Matlab (by analogy with least squares)

Question: There is a least-squares problem. It can be solved using backslash in Matlab.
If Ax = b, then x = A \ b.
Let's assume that I have the same problem, but all x must be non-negative (>=0). How can I solve this problem in Matlab by analogy with the previous one (without non-negativity constraints)? I think it can be somehow connected with the active set method.
I know that the non-negative least squares problem can be easily solved with Matlab Optimization toolbox or CVX or in many other ways. But still I'm curious about solving it by analogy with a straight-forward least-squares method (with backslash).
Could anyone help me please?
Answer: MATLAB has a built-in function lsqnonneg() which is an implementation of the active set method described in the book "Solving Least Squares Problems" by Lawson and Hanson (1974)
The \ solution of linear least squares problems in MATLAB is done by a variety of different algorithms depending on the exact structure of the problem.  None of them are particularly similar to the active set method used in lsqnonneg().
Answer: Not sure if this helps, but the trick is that Lawson & Hanson's algorithm selects a special subset of columns from A such that when you perform regression x = A(:,subset) \ b resulting coefficients are all non-negative.


Effect of resistance (distance) on the voltage of a galvanic cell

Question: I'm doing an experiment at school on the rate of reaction in galvanic cell so I wanted to question how the length of wires and the addition of different resistors could affect the rate of reaction. I'm a little confused with the fact that if I increase the resistance, according to the equation $$V=IR$$ current will increase. Theoretically does this mean that no matter how much resistance I provide, the voltage will be almost constant? Also, how does this explain the rate of reaction, since current isn't proportional to voltage because resistance is not consistent?
Comment: Do you mean the current will decrease if the resistance increases? @Jess
Answer:
Theoretically does this mean that no matter how much resistance I
  provide, the voltage will be almost constant?

Mostly, yes, though the current will decrease as the resistance increase. The voltage of an ideal cell at the terminals is determined by the chemical species in the cell and their concentrations, according to the Nernst equation. The current that flows in response to this voltage is determined by the load (ie. resistor), up until the point that the cell becomes rate limited. The current directly describes the reaction rate because each mole of reaction results in 1 Coulomb of charge (or 2, 3, n, depending on the balanced equation). So if you have n amps of current, that's n coulombs/sec and 1 mol/sec.
In a real battery, there is some (small) resistance in the parts, such as the electrode. This means there will be a V=IR drop between the surface of the electrode, and the place you connect the volt-meter. So the measured voltage at high currents will be slightly lower.
At high rates, there comes a point where the battery cannot react fast enough to supply the current. One example is when the interface between the electrolyte and the electrode consumes ions faster than they can diffuse from the bulk. When this happens, the surface becomes depleted of ions and their effective concentration goes down, so the potential changes. Ultimately it's the concentration at the interface that matters.
Also, many (most) cells do not have a constant voltage over their entire charge states. If the concentrations (activities) change at all as the reaction happens, the potential will change as the cell discharges.


msbuild -p option

Question: We could use msbuild to build project from command line. My question is about -p option. This option is used to specify property key/value pairs. My question is, besides the key/value pair assigned by -p option from command line, any other already existing defined options? If there are such existing defined options, where are the existing options defined and how such key/value pairs are used during build process?
For example, command like msbuild foo.sln /p:Configuration=Debug, besides option Configuration (whose value is Debug), are there any already defined existing options?
thanks in advance,
George
Answer: See MSBuild Reserved Properties and How To: Use Environment Variables in a Build, since these are kinda properties too.
Comment: @Anton, I take some time to learn from your recomended documents. Two more questions, 1. how to list all the current property key/value pairs? 2. (about your recommended 2nd document) my question is about how to use property, but how to use environment variable in msbuild. 3. Could you recommend me some dedicated books for msbuild or similar topics?
Answer: The properties will vary from project type to project type but here a list of typical ones for .NET projects with example values:

Configuration: Debug, Release
Platform: x86, x64, Any CPU
Optimize: true, false
OutputPath: bin\Debug\, bin\Release\
NoWarn: 1591 (suppress missing XML documentation warning)

To see all the other properties used during a build you can open up the common MSBuild targets located in the Framework directory: C:\Windows\Microsoft.NET\Framework\v4.0.30319.  Check out Microsoft.Common.targets and Microsoft.CSharp.targets for C# project build properties.
If you want in-depth coverage of MSBuild I recommend reading Inside the Microsoft Build Engine or MSBuild Trickery.  If you already know the basics though I would skip the first book.  You can get basic tutorials for MSBuild online.

msbuild -p option


Certifications and requirements

Question: I am developing a portable device embedding sensors, Bluetooth, MCUs etc.. At present I'm at a prototype stage and I'm starting thinking about production.
What kind of certification steps do I need to follow in order to produce and sell it?
Comment: I'm no expert on this so I'm just going to make a short comment.  While you might need to follow the ISO 9000 family of standards, you also have to think about the market that your device is targeting.  For example, if it's a medical device, you could be required to get FDA certification.
Answer: The more I learn about regulatory compliance, the more I'm convinced that I don't know anything.  This is a giant maze of international laws that is difficult to navigate.  What I wrote below is just a rough guide, to be taken with a grain of salt.  But my last paragraph is very important:  You need professional help (not mental help, that I know of anyway).
There are a variety of regulatory standards that you must adhere to.  Most of them are going to center around EMI, Electrical Safety, and Materials Safety.
EMI, or Electro-Magnetic-Interference, is concerned with what interference your box is spitting out and receiving either through the air or through the AC power cable.  Spitting out would be EMI Emissions, and receiving would be EMI Susceptibility.  Emissions is how your box effects other boxes, and susceptibility is more like will your box work when someone is on their cell phone near by.  A somewhat related aspect of this is your boxes tolerance to static electricity zaps.  In the USA, this falls under the domain of FCC compliance testing.  In the EU, it's part of the "CE" approval process.
Electrical Safety is concerned with things like:  will your box burst into flames or electrocute the user.  In the USA, this is normally certified by an independent lab, like UL or TUV-- I'm not sure about other countries.
Materials Safety is mostly about the use of lead, but does involve a whole list of bad things.  In the USA, I'm not even sure there is anyone who cares what's in the device (as long as it isn't medical or food related).  In other countries it's referred to as RoHS or other names, but I'm not sure if that falls under "CE approval" or not.
The important thing to know is this:  In the practical sense, you cannot self-certify.  Doing this compliance testing involves lots of expensive equipment and knowledge and it's simply not practical to do it yourself.  Fortunately, there are companies that specialize in this.
Find such a company, and use their expertise to not only perform the tests, but to give you solid information on the whole regulatory compliance testing/reporting process.  In many cases these companies will also file all the paperwork with the various government groups, etc.  These companies are often well versed in not only your countries regulations, but also international regulations.  I'll warn you that this process is not cheap, and not fast.  But that's the cost of doing business.
Comment: +1. I was going to put more in my own answer but the more I thought about it, the more I lost the will to live. It's a horrible minefield of a subject that could well do with simplification and international standardization.
Answer: It depends where in the world you are trying to sell your device. In Europe for example, there are numerous EEC directives affecting the sale of electronic goods, the most well known being :-

Electromagnetic Compatability Directive (EMC)
Low Voltage Directive (LVD)
Waste Electrical and Electronic Equipment (WEEE)
Restriction of Hazardous Substances Directive (RoHS)
Comment: First item abbreviation is EMC, not CE. The CE mark implies that the item meets all the relevant directives.
Comment: @Martin - Well spotted & duly corrected!
Answer: If you establish that the device is going to have sufficient sales to cover costs, you should approach a certification agency (UL, CSA, TUV, ETL, MET...) and get a quotation for certification. Certification could easily run into the tens of thousands of dollars.
The Bluetooth part of the circuit will need FCC approval for the USA, Industry Canada approval for Canada (obviously), etc.
Pretty well everything sold (officially) in the China market needs a CCC mark.
If you are including some sort of power supply in the design, you will need it approved by UL or an NRTL for the USA, CSA or a recognized equivalent for Canada, TUV or a recognized equivalent for Europe, etc. - it may be best to require use of an agency-recognized off-the-shelf power supply with the design.
Stuff for sale in Europe and China (and other areas) must be RoHS compliant. This is another external approval.
Answer: There are also the ETSI requirements. I think they are required for Bluetooth in the EU.
Comment: In addition to fulfilling the ETSI EN 300 328 standard, you need to also fulfill the Bluetooth Sertificate in order to use the trademark Bluetooth (logos, mentioning Bluetooth in manuals, etc) in your product.

Certifications and requirements


On music games like Osu! (mania), why are the inputs arrow shaped?

Question: In many rhythm games (like step mania, Osu! mania, etc.), the inputs are arrow shaped.  Where does this "standard" of rythm/music games come from ?
Comment: @kangalioo Please don't answer in comments. If a question is closed, then not being able to answer is pretty much the whole point.
Answer: I can't speak for Osu!mania directly, but Stepmania was based on Dance Dance Revolution (DDR), which had a pad below the player with the 4 directional arrows, which the player had to step on in time with the music.  Stepmania was meant to be an open sourced clone of DDR, so many of it's original mechanics and design would come from the DDR franchise mechanics.
The "step" in stepmania is a reference to how Dance Dance Revolution (and clones like Stepmania) are supposed to be played.  By stepping on the corresponding arrows at the right time to the beat.
As far as I'm aware, with Osu!mania there are just some maps which have this arrow layout.  Wikipedia's page on Osu!mania says:

osu!mania is a game mode which consists of a piano-like style of clicking notes to the beat, similar to the Beatmania IIDX series. The number of keys ranges from 1 to 9, with 4 keys and 7 keys being more popular among players.

So Osu!mania is more of a direct clone of the Beatmania series, which doesn't use the dance pads like DDR was designed for.  I assume that some Osu!mania tracks that only have 4 keys (which it says is a popular format) often map those keys to arrows, so that it resembles the traditional beat games like DDR and Stepmania.
As far as I can tell, the standard of using 4 arrow keys to represent the inputs is because Stepmania is directly based off Dance Dance revolution, and because 4-key Osu!mania levels sometimes pay homage to DDR and Stepmania, as the gameplay is similar.
Comment: Your answer is good and I don't think what I want to add would warrant another answer so consider adding that the arrows are not the de facto standard for rhythm games.  Many ps4 games have the controller buttons, there are games like guitar hero that have the guitar frets, and there is also the popular Japanese arcade game Taiko no Tatsujin which has little drums.  I agree with your general statement that the arrows come from DDR.
Comment: @Cloudzzz. I don't really see anywhere in my answer where I imply that they are de facto standard.  I just point to the fact that Stepmania is based off a game that does have that layout, and that Osu!mania references it as well.
Comment: I'm not accusing you or anything but it was part of OP's question that could be made more clear to them in your already good answer.


Can Mirio's quirk come back on it's own?

Question: The bullet made by Chisaki reverses a human back to the time when they were Quirkless. In theory, then, shouldn't Mirio's Quirk come back on its own as time goes by, just like when one's Quirk first appears?
Answer: No, it was mentioned the the bullet that hit Mirio was a permanent one. That means his quirk is gone for good unless someone reverses his body to the state before the quirk was lost. That is why they are helping Eri control her power so that she can help Mirio get back his quirk.
Comment: Please include relevant sources/references.


Questions derived from trying to prove Plancherel's Theorem

Question: I'm going to try to derive it here and illustrate any questions I have about it in the process. I tried to understand it from here, and it's where my confusions are based off of. If you wonder why I write something down and then proceed to ask about what I wrote it down, it's because I'm trying to read off from the link above and I don't know why it is the way it is.
$$f(x)= (1/2\pi) \int_{-\infty}^{\infty}\bar f(k) \ e^{ikx} \ dk \tag{1}\label{eq1}$$
Where $f(x)$ and $\bar f(k)$ are Fourier Transform pairs. Define a function, $f(x)^*$, which is the complex conjugate of $f(x)$.
$$\implies f(x)^* = (1/2\pi) \int_{-\infty}^{\infty}\bar f(k')^* \ e^{-ik'x} \ dk' $$
The reason for this, as far as my understanding is concerned, is we're essentially taking the complex conjugate of the RHS of $\eqref{eq1}$. However, I don't see why $k$ is now $k'$. If we're saying $f(x)^*$ is the complex conjugate of $f(x)$, I don't see why we're now using a different dummy variable $k'$, I don't see why this is strictly necessary (Question $1$).
The next confusing part for me is a bit further along. Hopefully you don't mind if I skip a few steps:
$$\int_{-\infty}^{\infty} \lvert f(x) \rvert^2 \ dx = 1/2\pi)\int_{-\infty}^{\infty}\left(\int_{-\infty}^{\infty}\bar f(k)e^{-ikx}\ dk \  \int_{-\infty}^{\infty}\bar f(k)^* e^{ik'x} dk'\right)  dx \tag{2} \label{2}$$
$$\int_{-\infty}^{\infty} \lvert f(x) \rvert^2 \ dx = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} \bar {f(k}) \bar
f(k')^* e^{ix(k'-k)}\ dx \ dk' \ dk \tag{3} \label{3}$$
I know how it works from here, but I have a question on going from $\eqref{2}$ to $\eqref{3}$. I'm confused as to how the liberal use of moving around integrals and differentials can be done so liberally. Perhaps I'm rusty from my multivariable calculus class, but it looks like integrands had to have been picked up and moved around, yet I thought anything in the integral that depends on the differential cannot be moved outside it. I know that order of integration is a thing for triple integrals, and that we treat none differential-dependent variables per integral as constant, but still getting to $\eqref{3}$ seems very unnatural to me (Question 2). I suppose in multivariable calculus I'm more used to integrals looking like $\eqref{2}$ since the order is more apparent to me.
Answer: I answer your second question first since this is more general:
Your second question: When the author writes, for example, $g(w)^*$ what he really means is $(g(w))^*$. Likewise at other occasions of the $^*$. I.e. we take whatever value $g(w)$ has (for a given $w$) and take the complex conjugate of that value. This also  means there is no variable $w^*$ or $(w)^*$ introduced.
Your first question: in line (3), the author missed to say that he will introduce the Inverse Fourier Transformations of $f(t)$ AND $g(t)$. Since the Inverse Fourier Transformations require a different integration variable each, the author cannot use $w$ twice but has to introduce for $g(t)$ a second variable which he calls $w'$. He then has to complex conjugate the full expression for $g(t)$, ie.
$$
(g(t))^* = ( \int \bar g(w') e^{i w' t} dw' )^* =  \int (\bar g(w'))^* e^{-i w' t} dw'
$$


Which test to find out best concentration (the one having maximum effect)?

Question: Hi my apologies first, I'm a biologist and not so good in statistics. In my study I'm studying the effect of concentration of feed on growth of a certain specimen. I have with me the different concentrations and the growth data for each concentration. What do you suggest is the best statistical test to find out the best concentration (i.e the one having maximum growth). Thanks in advance.
Answer: It sounds like an ANOVA (analysis of variance) setting, except that usually ANOVA is used to ask the question whether there are differences in growth between the concentrations. If you used ANOVA and found that there is a difference, then it wouldn't indicate which is the "best" one, just that they are different. There are post-hoc tests to look at all the different pairs.
I'd take a different approach though:
Can the different concentration be considered as gradually increasing? (rather than just "different" from each other). What kind of relationship do you anticipate between the feed concentration and the growth? How many concentrations to you have? how many records per concentration? If you have more than 2-3 concentrations and sufficient data on each concentration level you could fit a parametric or nonparametric growth curve (x-axis is concentration, y-axis is growth). This would give you a clearer idea of what is going on, with less assumptions.
Answer: Are you not looking after method for studying dose-response relationship? From the description you gave, I guess your growth curves are highly non-linear. Moreover, the problem of using simple ANOVA to compare two growth curve (i.e., equivalent to a time course curve) is that it would be blind to the fact that the different doses are administered in a sequential order, though it should give a reasonable first idea of some kind of differences between the two, if any. However, multiple comparisons are likely not to answer the question you really want to ask since we often expect very few differences at baseline and larger ones at intermediate concentration levels, whereas what you generally want to assess is what's the lowest concentration level that yields a significant difference between the two products.
If you are using R, the drc package (see also www.bioassay.dk) allows to fit various models to DR data, and plot the resulting DR curve like the one shown below. It was generated from the on-line help with data secalonic whose description is:

Data stem from an experiment assessing
  the inhibitory effect of secalonic
  acids on plant growth.
Gong, X. and Zeng, R. and Luo, S. and
  Yong, C. and Zheng, Q. (2004) Two new
  secalonic acids from Aspergillus
  Japonicus and their allelopathic
  effects on higher plants, Proceedings
  of International Symposium on
  Allelopathy Research and Application,
  27-29 April, Shanshui, Guangdong,
  China (Editors: R. Zeng and S. Luo),
  209-217.
Ritz, C (2009) Towards a unified
  approach to dose-response modeling in
  ecotoxicology To appear in Environ
  Toxicol Chem.
Answer: If you have growth curves from each feed concentration, with time on the x-axis, you'll first want to estimate the growth from each curve. % change at the end points may be sufficient for your purposes, but to use all of your data consider looking to fitting some kind of model to each growth curve with a regression. Then you can estimate the parameters of the model and do a statistical comparison on those. Your institution might have access to graph pad, (can't link b/c not enough rep but google), and it is very intuitive.
This approach has some benefits. For example, one concentration might lead to faster growth initially but not peak as high, for whatever reason--maybe it becomes slightly toxic with time. This analysis could potentially detect that.
For more help we'd need to know the type of growth you expect from your specimen. If it's bacteria there are a ton of ways to do growth curves, see e.g. the classic paper by Zwietering et al here: http://aem.asm.org/cgi/reprint/56/6/1875.pdf.


Mask failure message in GeoPosition?

Question: I am trying to construct a variable in a dataset that calculates the distance from a point to a city/country listed in another variable. I hoped to use GeoPosition to get the approximate location of the city or country. Sometimes these are "locations" that GeoPosition cannot find, and I'm happy to accept a blank or missing value as the location, but GeoPosition gives a failure message:

The failure message seems to cause the dataset variable processing to halt. I cannot seem to suppress or mask the failure message (Quiet doesn't work). Any suggestions on how to gracefully handle a GeoPosition failure by returning a blank and continuing on to process the remaining rows in the dataset?
Thanks!
Answer: Using FailureQ:
If[FailureQ[#], {}, #] &@Interpreter["Location"]["Paris"]

GeoPosition[{48.86, 2.34}]

If[FailureQ[#], {}, #] &@Interpreter["Location"]["ParisBerlin"]

{}

Mask failure message in GeoPosition?


Employer could not pass a patent examination or requested a withdrawal

Question: I was working for a company in 2019 and I presented an idea that I had been working on since I was a student, and I developed it before my graduation. The company filed a patent application and I was its inventor. in 2020, I changed my job and no longer work for that company. The patent was published in 2021. Now the status of the invention has changed to "APPLICATION DEEMED TO BE WITHDRAWN". As its inventor, can I reapply for the patent?
What is my right in this situation when the employer wasted my idea and efforts?
I greatly appreciate your advice.
Comment: Bottom line, consult a lawyer.
Comment: It was probably the application that was published. No patent may have issued. You can use the publication number to look up the history in Public PAIR. The entire back-and-forth with the examiner can be seen in the file wrapper tab. You might get done insight as to why it was withdraw.   Not responding to an office action will usually result in abandonment. Withdrawn is unusual. Actually the USPTO patentcenter is easier to use than Public PAIR
Comment: If  you provide the application publication number we can look over the file history.
Comment: Thank you all for your responses. I really appreciate it.
Answer: I am not a lawyer. What you can do is probably determined by the specifics of your case. I will address a few things that jump out at me. First, if you created and developed the invention before working for the company I don't see where the company should have any rights to it at all. Therefore, I assume you must have assigned them rights to the invention. I also assume you wouldn't have do so without getting something in return. The specifics of the contract assigning rights are important and you haven't detailed those. If your research, while a student, was sponsored and paid for by the college, university or other funding institution, then it is possible you didn't have sole rights to the invention anyway.
As George White points out, if you know the application publication number, you can look it up on the USPTO Public PAIR or Patent Center sites and read the communications between your old employer and the examiner. These might help you understand the history of the application. You also could reach out to your previous employer and ask them why the application was withdrawn. Ultimately, you probably should ask an actual patent attorney for guidance.
Comment: Thank you for your responses. I really appreciate it.
Answer: The likely bottom line is they paid you for your efforts, you signed over all rights to them and they can do what they think is in their best interests.
As to intangibles, since the application was published with you listed as an inventor, it is available for all to see and learn from your creation.
By the way, the order of inventors is often meaningful to the inventors and others but has no legal consequence.
Comment: Thank you for your responses. I really appreciate it.


Displaying app release date in iPhone App.

Question: I want to show the app release date in info view of iphone app. My app is in under development and we want others to know when the app was released.
The app released date is displayed on iTunes App Store.
Thanks in Advance
Aamir Mansuri
Answer: I am not sure about other methods, but you can first submit the app onto the app store and have the release date set by you. In your code you can set the release date to this date and submit the app. Even after the app is approved it won't be released till the release date and you can go into itunes and control it.


Protect overwriting folder content

Question: Is there a way (with acl's) to protect the contents of a folder? Users should create files inside a folder but not overwrite/edit/delete them. Is this possible?
Comment: Also not allowed to edit/delete own files ? I don't think that is possible. The owner of a file could always change its permissions.
Answer: One might use inotifywait to watch the directory and make changes, such as changing ownership of each new file copied into the directory. In a Debian-based distribution, install the software as follows: apt-get install inotify-tools.
Create a script, perhaps /usr/local/sbin/inbox.sh, as follows.
#!/usr/bin/env bash
inotifywait -m -e create "/path/to/directory" |
while read path event file; do
    if [ "$event" = "CREATE" ]; then
        chown root:root "$path$file"
    fi
done

Give the script permission to execute (chmod 0700 /usr/local/sbin/inbox.sh). Then run it at boot time from, say, /etc/rc.local or whichever RC file is appropriate: /usr/local/sbin/inbox.sh &.
According to the manual, -m monitors indefinitely, and -e watches for a specific event. Within the while loop, it could be possible to receive an event such as CREATE,ISDIR, which indicates the creation of a directory, of course. Directories are not the target of the question; thus the if statement contains a command to respond only to new files, which are represented with the event, CREATE. The path variable from inotifywait has a trailing slash character, so $path and $file can be concatenated without specifying a slash between the two.

Protect overwriting folder content


Help with winform treeview isSelected weirdness

Question: In the NodeMouseClick event I'm trying to load some objects from the Node.Tag.  Before I do so I check e.Node.IsSelected.  When run regularly IsSelected is false....if I stick a break point around there and check e.node.Isselected, the value changes on me and becomes true.  Why?
Answer: The NodeMouseClick event is raised before the selection actually changes. (When you click on the same node twice, the second time e.Node.IsSelected will certainly have been true.)
You could try handling the AfterSelect event, although that will also be raised when using the keyboard to navigate the treeview, which may even be better for your purposes.
Answer: I tried to recreate your problem but could not. When I click on a node for the first time this value is always false, whether I set a break point or not. If I click a node the second time the value is true.
If the node is selected by default the value will be true, but otherwise it will always return false on the first click.
Comment: I'll admit what I'm doing is very messing and very poor UI design.  But yes I check once and the value is false, a 2nd time, without stepping and it turns to true.  I found that odd.


I wanna know the meaning of 'lonely me'

Question: In the lyrics of the song by Big Bang. The great k pop boy band.
"loser, lonely me, faking tough, and cowardly."
I wanna know the meaning of lonely me and faking tough.
please tell me. I wanna sing this song in English.
Is there any verb form of fake?
Comment: These aren't special phrases and mean what the words say literally.
Answer: "Lonely me" is a way of stating your loneliness. It is often said as a lament, along the lines of "poor you". There is nothing unusual about the phrase at all, but I can see how an English learner would find it unusual - we wouldn't say "Lonely I".
That's just the difference between the personal pronouns 'I' and 'me' - the former is used as the subject and the latter is used as the object.
"Lonely me" says more than "I am lonely". It suggests that the adjective describes the person, that they are perhaps perpetually lonely, whereas "I am lonely" could just be a statement of your current feelings.

"Faking tough" means that someone is pretending to be tough (physically or mentally strong).
"Tough" is normally an adjective - you would say someone is tough. A more verbose way of saying this would be "faking being tough". However, an adjective can sometimes be a noun representing the state or quality of that it describes. The actual noun would be 'toughness', so you could also say "faking toughness", but "faking tough" works just as well.

I wanna know the meaning of 'lonely me'


Usual term for "back part of the tongue"

Question: As English (oddly) uses "back of the tongue" to refer to its top surface, how can I refer to the back part of the tongue, opposite to the front part of the tongue where its tip is? "back part of the tongue" ?
Answer: The top surface of the tongue has a front, a middle, and a back. You will find this terminology used, for example, in oral medicine and discussion of flavours.

Excess bitterness in your beer is usually perceived on the back of the
  tongue
Median rhomboid glossitis is a condition that can affect your tongue
  if you have oral thrush. It causes a red, smooth patch or lump to
  develop in the middle of the top part of your tongue, which can be
  sore.
The front two-thirds of the tongue that you can stick out is called
  the oral tongue
Answer: Generally speaking, referring to the surface or the top of the tongue means the part of the tongue with the tastebuds on it.
The back of the tongue refers to the surface of the tongue near the throat, while the front of the tongue refers to the surface of the tongue near the lips.
The underside of the tongue is the part without tastebuds.


Difference between 谈 and 讲

Question: What's the difference between 谈 and 讲, and when do I use them? Or are they interchangeably used? They both seem to mean "talk".
Answer: 谈 - to talk, to converse, to chat.
讲 - speech, to speak, to tell, to explain.
"谈" is a talk/conversation that happened between two or a group of people to exchange ideas/messages on a specific, or random, topic; "讲" is a talk that is delivered by a person to pass on ideas or messages, usually on a specific/select topic, to the listeners, similar to "teach", "impart".
In general, the two words are not interchangeable, but, occasionally they both can be replaced by "說" - 我和他說(谈/讲)過了.
Answer:
讲 - 是对某一个人或者一群人单方面的说话。
谈 - 双方2个人或者多人讨论。

Source
So basically 讲 can be for talking to one person or a group of people, but 谈 is for 2 or more people discussing.
Comment: 或者 means "or" So, both alternatives are feasible.

Difference between 谈 and 讲


Movie in which kid with a leg problem falls in a sewer accident and goes to a parallel universe

Question: I am looking for a movie in which a kid fell in a sewer accident/challenge and ends up in a different universe. I remember the kid having a problem with one of his legs some sort of iron staff was surrounding his leg from the knee down.
Comment: How is this a duplicate of a question that was asked 5 months ago and not vice versa?
Comment: Age of a question doesn't really play into it when closing as a duplicate. Instead we look for the quality and the answer on the duplicate is better.
Answer: Warriors of Virtue (1997).

Ryan Jeffers suffers a disability to his leg, preventing him from
  trying out for sports and is instead a waterboy to the school's
  football team. He has a crush on a girl at school, but it happens to
  be quarterback Brad's girlfriend, which earns him ire from the popular
  kids. Ryan is an avid comic book reader and dreams of adventure,
  hiding his depression over his leg from his mother. One day, Ryan
  meets with Ming, the owner of his favorite restaurant, who gives him a
  manuscript of Tao, representing the five elements; Earth, Fire, Water,
  Metal and Wood, and advises him to live no matter what his physical
  limits are. That night, Ryan and his best friend Chucky are met by
  Brad and his friends who want to initiate them with their group. They
  are led to a water plant where Ryan must cross a narrow pipe to sign
  his name on a wall on the other side. Ignoring Chucky's warnings, Ryan
  attempts to do it. But a water pipe opens up, throwing Ryan into the
  water.
Ryan wakens in a forest and is attacked by strange creatures, he is
  rescued by a strange creature from the lake and runs, realizing that
  his leg now works. He meets Mudlap, a diminutive creature who leads
  him to Elysia.


Magento 2: Custom Payment Module with Credit Card Form

Question: I created a custom Payment Module from http://cedcommerce.com/magento-2-module-creator/payment-module .
But this payment module has a simple Place Order button. I need a Credit Card form in payment module. Can someone help me? All the answers will be appreciated.
Comment: Did you found anything on this.?
I have same requirement. can you please help me?
Answer: If you want to process Credit Card numbers, you have to comply to the PCI-DSS (Payment Card Industry - Data Security Standard). Even when you don't store the card numbers, you have to comply to PCI-DSS level 4.
You probably want to use a payment service provider which will process the credit card transactions for you. Most payment service providers offer a Magento module for free.
Comment: All payment service modules are not available for Magento. Paytrace is one of the payment service provider, but it doesn't provide module for Magento. It process the payment in Magento using Api. That's why I want to make a custom payment module with credit card form in which I will implement paytrace Api.


Is there a file container that can store GSM-EFR speech data?

Question: Is there a file container that can store GSM-EFR speech data?
Just now I have such an file that contains a lot of RTP packages, the payload type of RTP package is GSM-EFR. I want to convert this file to a file that store the GSM-EFR data.
And then I need a audio player to decode the file and play the voice.
I have try the .amr file format,but encounter that .amr format can not distinguish the full rate and enhance full rate when they are both 12.2kbps.
I have try the ffmpeg, but this player can not decode GSM-EFR data.
So I need a file format and a audio player.Is there anyone can help me?
Thanks very much!
Answer: GSM-EFR is same like AMR mode 7. Try packet your RTP payloads to AMR storage file with amr header mode 7. And be carefully, because in RTP payload can be signature 4 bit (0xC) in beginning, if have, you need delete at beginning 4 bit befor packing to AMR file


Non-exchangeable unimodular graph

Question: Let $G=(V,E)$ be an countably infinite, locally finite transitive graph. Say that $G$ is exchangeable if for every two vertices $v,w \in V$ there exists a graph homomorphism that maps $v$ to $w$ and $w$ to $v$. Certainly such a graph has a unimodular automorphism group. Is there an example of a graph $G$ that is not exchangeable but is unimodular?
Comment: how is exchangeable different than vertex transitive?
Comment: You are absolutely right - I left out the main point. Now edited to make sense.
Comment: There was a mistake in the initial phrasing of the problem. This mistake is now fixed.
Answer: The standard Cayley graph $\Gamma$ of the Baumslag-Solitar group $BS(1,2) = \langle a,b \mid bab^{-1} = a^2 \rangle$ is non-exchangable and unimodular (as is any Cayley graph). See http://en.wikipedia.org/wiki/Baumslag-Solitar_group for a picture of $\Gamma$. To see non-exchangability, observe the following:

an edge is labeled by $a$ iff it is contained in three distinct $5$-cycles, and by $b$ iff it is contained in two distinct $5$-cycles. Hence $\mathrm{Aut}(\Gamma)$ preserves the labeling of the (unoriented) edges by $a$ or $b$.
any $5$-cycles contains two $a$-labeled components, one with two edges and one with a single edge. Given any $5$-cycle, an oriented edge in the cycle is of the form $(g, gb)$ iff it points towards the $a$-labeled component with a single edge. It follows that $\mathrm{Aut}(\Gamma)$ preserves the oriented labeling of the $b$-labeled edges.

Consequently, there is no automorphism of $\Gamma$ which exchanges the vertices $1$ and $b$.

Non-exchangeable unimodular graph


Where can one find exceptions thrown by Spark's Executors

Question: We have been getting ExecutorLostExceptions, but have been unable to determine the root cause.
Here is a simplified script that can create the error
filenames = "hdfs://myfile1,hdfs://myfile2"
sc.textFile(filenames).first()

As an experiment, when I intentionally run a spark job on 1GB of data with only 1mb of spark.executor.memory, the driver prints the following error message
16/04/28 17:28:54 INFO TaskSetManager: Starting task 0.0 in stage 0.0 (TID 0,
host.addr, partition 0,ANY, 2257 bytes)
16/04/28 17:29:28 INFO MesosSchedulerBackend: Executor lost: 4e199be7-a0bc-407d-ba70-4147e08d6c39-S5, marking slave 4e199be7-a0bc-407d-ba70-4147e08d6c39-S5 as lost
16/04/28 17:29:28 INFO MesosSchedulerBackend: Mesos slave lost: 4e199be7-a0bc-407d-ba70-4147e08d6c39-S5
16/04/28 17:29:28 ERROR TaskSchedulerImpl: Lost executor 4e199be7-a0bc-407d-ba70-4147e08d6c39-S5 on host.addr: Unknown executor exit code (256) (died from signal 128?)
16/04/28 17:29:28 WARN TaskSetManager: Lost task 0.0 in stage 0.0 (TID 0, host.addr): ExecutorLostFailure (executor 4e199be7-a0bc-407d-ba70-4147e08d6c39-S5 exited caused by one of the running tasks) Reason: Unknown executor exit code (256) (died from signal 128?)

and after a few automated retries, the entire job fails. This happens in both Pyspark and Scala-spark.
What are the appropriate logs I can look at to determine exactly why this executor failed?
For this controlled case I know that running out of memory was the cause. However these and other failures with different exit codes occur on a regular basis, and then I don't know where to look or what to fix.
The places I have looked so far include

The spark UI running on port 4040
/tmp/mesos/slaves/[slaveid]/frameworks/[frameworkid]/executors/[executorid]/runs/latest/{stderr,stdout} on the node whose executor was "lost"
/var/logs/mesos/mesos-slaves.{INFO,WARN,ERROR,FATAL} on the failed node
/tmp/spark-events/[executorid] on the driver node

Those places have helped address some issues, but not e.g. OOM errors, and now I'm not sure where else to look.
Answer: You can check under
$HADOOP_HOME/logs/userlogs
there you can find your logs by app id. app id can be found in hadoop cluster web ui:
<your_cluster_master_ip>:8088


Where is the proton mass coming from?

Question: I always thought that the mass of a proton would simply be the mass of the three separated quarks plus their binding energies. Nevertheless, I was once discussing with one of the developers of RICH detectors at LHC and he told me that this addition (quarks+binding) could account only for 30% of this energy (cannot remember what was the experiment performed to determine that), so where is the other 70% coming from?
Comment: This is more subtle than it appears. Because of confinement, there is no such thing as a 'separated quark'.  We can only consider quarks in mesons or baryons or the QGP, where their behaviour depends on the colour-force field they're experiencing. That's why the 'mass of the quark' is not a generally defined concept and the tables of properties always show masses as 'of the order of', especially for light quarks. The analogy with nuclear masses (where there are no problems with considering free protons and free neutrons) is not helpful.
Comment: @Sean The resolution of the difficulty that Roger discusses is "asymptotic freedom": the observation that as you increase interaction energies, the kinematics of hadronic final states become increasingly similar to those expected if the quarks were free, and because increasing energy implies shorter distance we assign the zero of strong interaction energy to zero separation instead of infinite separation as with other forces. But the system is still bound which means energy grows with separation so the potential energy must be positive.
Comment: "plus their binding energies"

That should be minus. 2 protons and 2 neutrons weigh more than a Helium-4 nucleus, for example.
Comment: @SeanE.Lake The nuclear force (AKA residual strong force) has negative binding energies. The underlying strong force has positive binding energies—part and parcel of confinement.
Comment: @dmckee This doesn't even make sense to me "negative binding energies," because it only makes sense to refer to negative interaction energies as binding energies. Do you mean positive interaction energies (i.e. a repulsive interaction)?
Answer: There is this article which discusses the problem.

As a  quantum mechanical entity, the proton has to be described by the summed four vectors of its constituents. What is binding the constituents within a nucleon (hadron) is the strong force which exchanges innumerable gluons and generates quark antiquark pairs among them. The binding of nucleons in contrast is a spill over force from the strong force, called the strong nuclear force in contrast, and it is  similar to the van der Waals forces that bind atoms with the electromagnetic force.
The strong nuclear force can be modeled similar to the electromagnetic in the atoms, and energy levels can be defined for the protons and neutrons within the nucleus.  This is not true for the proton and its innumerable constituents in addition to the valence quarks.
A theory has been developed, QCD on the lattice, which does aim at  computing  fairly well the masses of hadrons, i.e. strong interacting resonances . Here is a review.
Comment: It is the sum of all the fourvectors  within the bag of proton which gives the invariant  mass of the proton . Lattice QCD tries to apporximate this instantaneous picture and has a fairly good success, if you read the link, of establishing resonance masses  . This is similar  success to the shell model establishing nuclear masses in the periodic table. for the relativistic mathematics look up http://hyperphysics.phy-astr.gsu.edu/hbase/Relativ/vec4.html
Comment: "The strong nuclear force can be modeled similar to the electromagnetic in the atoms, and energy levels can be defined for the protons and neutrons within the nucleus. This is not true for the proton and its innumerable constituents in addition to the valence quarks." Are you saying we cannot predict them or that they do not exist? If the latter, what disqualifies the [p and n resonances](http://pdg.lbl.gov/2017/tables/contents_tables_baryons.html) listed by the PDG?
Comment: Is there any experimental proof that virtual quarks and gluons moving inside the proton are the ones providing the proton with mass or is it all just theoretical?
Comment: @Juanjo In the big picture this is an experimental fact—we measure the mass fraction and spin fraction attributable to sea partons. (I was even briefly and very loosely involved in one of these experiments NuSea/E866.) Getting the measured values and theoretical values to agree in detail, however, is still an open issue.
Comment: so where is the mass coming from, all the virtual quarks/gluons that are moving inside the proton?
Comment: It is a consequence of the theoretical model of QCD, which model has been validated with the scattering experiments, gluon jets etc. also the plot i copied is a type of validation that the theory fits the data.
Answer:
this addition (quarks+binding) could account only for 30% of this energy ..., so where is the other 70% coming from?

Kinetic energy of quarks and gluons.

Where is the proton mass coming from?


Why are Fourier analysis and transform only applicable for LTI systems?

Question:
Why are Fourier analysis and transform only applicable for LTI systems?
What if the system is not LTI, won't Fourier analysis or transform be possible?
Comment: Thanks guys ! I'm just doing my best to make sure people in the years to come find the answers to their DSP questions presented neatly and clearly on this awesome site. :)
Comment: @Gilles I use this opportunity to thank you for your efficient edits in general
Comment: @Gilles: excellent edit; should have thought of making this as clear as you did.
Comment: @Gilles and yes seconding mr. Duval, you can't imagine how many times a day I wish you were around to deal with the mess of Latex I'm strugling in ! :)
Answer: The family of Fourier Transforms are specificaly developed for analysing frequency contents of the signals for which there is no definition of linearity or time invariance. Hence we can define the Fourier transform of any signal, as long as it's integrable (i.e. stable).
On the other hand we can also define a Frequency Response $H(\omega)$ for a particular class of systems (those being LTI) when they are characterised by a unique signal denoted by $h(t)$ which is called as the impulse response of the LTI system.
The Fourier transform $H(\omega)$ of the impulse response $h(t)$ is important because the complex exponentials $e^{j\omega t}$ are eigenfunctions of such LTI systems and when the input is decomposed into a sum of such complex exponentials, via a Fourier transform, so will be the output, multiplied with a complex gain given by the Frequency Response $H(\omega)$ applied for each particular frequency. This gives a considerable ease for the development of the mathematical theory of signals and systems.
On the other hand consider the following nonlinear system defined as:
$$y(t) = x(t)^2$$
For which you can apply CTFT to both sides to derive the result in frequency:
$$Y(\omega) = \frac{1}{2\pi} X(\omega) \star X(\omega)$$
Also consider the following linear but Time-Varying system defined by:
$$y(t) = g(t)x(t)$$
For which you can also express the relation in Frequency domain via CTFT as:
$$Y(\omega) = \frac{1}{2\pi} G(\omega) \star X(\omega)$$
Which I hope convinces you about the scope of Fourier Transforms and their applications to systems other than LTI.
Answer:
Why are Fourier Analysis & Transform only applicable for LTI systems?

That's simply not true.

Won't Fourier analysis or Transform be possible?

They are. The question is just whether they are meaningful.
The point is that the continuous Fourier Transform (FT) is defined to integrate over all times from $t=-\infty$ to $t=\infty$; that works excellently if the thing you're looking at doesn't change over time (ie. a signal is periodic, or a system being LTI).
Now, the reason why we do FT on LTI systems is that we usually represent their effect on a time signal $s(t)$ by the convolution with that system, e.g. the receive signal $r$ after a channel $h$ is
$$r(\tau) = s(\tau)*h(\tau)$$
$*$ being the convolution here; thanks to the properties of the FT, we can directly tell that $R(f)$, the FT of $r(t)$, is
$$\mathcal F\left\{r(f)\right\} =R(f)= \mathcal F\left\{s(f)\right\}\,\mathcal F\left\{h(f)\right\}$$
That falls apart if $h$ doesn't only depend on the relative time $\tau$, but also on an absolute time $t$. So that simply makes analysis harder, and you'd typically have to fix either of the parameters of $h(t,\tau)$ to make statements.
Comment: I would have the same. Perhaps a little mention of ways to stationarize signals using (overlapping) windows would be a plus??
Comment: @LaurentDuval agreed; but I really don't know where to start for OP. I'd be required to explain Gibb's phenomenon – which is *very* linked to the problem we're looking at. That would require understanding of the FT that directly incorporates what I've explained here. So: Yes, I do fully agree with you, this answer could use a lot of explanation on stationarity, windowing, linearity of the FT, but that's just too much for one answer.
Comment: You are so d*** right on this
Comment: @LaurentDuval :D


How do you correct inclination at launch to ISS?

Question: Launching from Florida 28.5 degree inclination to rendezvous with ISS at 400km to 51 degree inclination  of ISS
Comment: Question could be made more clear and specific. As there are many aspects and details depending on exact nature of answers desired.
Comment: If you have KSP try launching from the Woomerang launch site to either LEO or an LEO rendezvous ;).
Answer: The latitude of a launch site determines the minimum inclination that can be directly reached; launching from 28.5º latitude in the due-East direction achieves a 28.5º orbital inclination. Launching to any higher inclination is straightforward, simply by steering continuously North-of-East during the ascent. In the extreme case, if you fly due North, you enter a near-polar orbit (the rotation velocity you receive from Earth before you leave skews things a bit).
Answer: In the case of the space shuttle:
These two images show that the flame trenches at KSC point due south, and that the Orbiter's tail when installed on the pad also points due south.

(source: Google Maps)

(source: NASA)
Therefore if the shuttle launched and went into a gravity turn in the desired heads-down attitude without rolling at all, it would have flown due south.
As explained in this answer, a launcher gains the maximum benefit from the Earth's rotational speed if it launches due east. This will place the vehicle into an orbit with an inclination equal to the launch site's latitude - in the case of Kennedy Space Center, 28.5º.
To fly due east and obtain this benefit while maintaining the desired heads-down attitude, it is clear that the shuttle had to roll 90º since it was mounted on the launch pad with the tail pointing south.
However, with the inclusion of Russia in the International Space Station (ISS) project, an orbit inclined 51.6º was chosen to allow the use of Russian launch sites.
For the shuttle to reach this 51.6º inclination, it had to roll even further north to align with this flight azimuth.  Therefore, the vehicle performs a single axis rotation (SAR) maneuver, often called the "roll program", after clearing the launch pad, to align its direction of flight with the desired azimuth.  This SAR both aligns the flight path with the desired azimuth, turns the vehicle heads-down, and starts the gravity turn.
To minimize the amount of delta-v required to change orbital planes, the launch time for an Shuttle mission to the ISS was set, if possible, to the time at which the ISS orbit passed over the launch site.  However, choosing this launch time did not preclude the necessity of rolling to the proper azimuth.  If the shuttle had launched at the exact time of ISS orbital plane passage with the desired heads-down attitude and not rolled, it would have flown due south.
In this video taken from a camera on the right-hand Solid Rocket Booster of STS-127, you can clearly see the vehicle roll from tail-south to tail-east.  In the video, liftoff occurs at ~0:50 seconds, the roll starts at ~1:00, and at ~1:17 you can clearly see the coastline under the tail.
Comment: This answer is wrong and then steals from my answer, and answers because of my answer. You've deleted my comments, which I have right to, I was explaining why I down voted as is suggested in s.e.  To leave comments.
Comment: All because you said the vehicle rolls north but is not necessarily true the vehicle can launch southerly with no delta v cost and further has to for one of the launch windows to the ISS which occur twice a day, which of course you did not mention, which of course my answer did, and which of course is the negative "wrong answer" nice pictures of the shuttle pad, that should really help visialize how Florida vehicle matches inclination.


El Nino in the Middle East

Question: According to reports and charts meteorological phenomenon El Niño is close to Iran, but the question is, El Niño phenomenon in Iran is likely to achieve?
What are the consequences?
Comment: @Mohsen_Kh.: It would be helpful if you could post links to the reports & charts you mention in your question.
Answer: A very quick and general answer, if anyone wants to get more specific, feel free:

the question is, El Niño phenomenon in Iran is likely to achieve? What
  are the consequences?

Iran's been through several El Nino's, so its not like this year you'll see things you've never seen before.   I mean, you could.  There's always a chance of record breaking weather, but have a look at El Nino's and how often they occur, here and more numerical and monthly specifics here.
If we assume this year will be a strong El Nino, then look back at weather in Iran in winter 97-98 through Summer 1998, and Winter 82-83 into 1983.  Those were the 2 most recent big El Ninos.
I found this article from last month.  You probably have better access to local updates than I do, but it seems that frost and flooding are the primary concerns.    As Gordon Stranger points out, that's not a guarantee, only an increased chance that it happens.

El Niño is close to Iran

El Nino is in the Pacific Ocean.   The El Nino effect is all over the globe, so it's, in a sense, close to everywhere on earth.  Here's a kind of cool picture of the effects of the 1982-83 El Nino.  Those were just the effects for that one year, and no two El Nino's will affect the globe in the same way, though they can have some similar patterns.

Source

However, you should be afraid of the possible occurrence of El Niño in
  Iran?

When I first read this, I thought you were suggesting that he be afraid, but reading it again, I think what you're asking is whether you should be afraid.
El Nino probably isn't something to be afraid of cause there's no guarantee the effects will be bad where you are.   It's silly to worry about a 30% increased chance of something happening - which is basically what this is.
If you live in a flood prone area try to prepare for flood.  Have food and drinking water on hand, maybe sandbags to put in-front of your doorway - which might help for a smaller flood.  If you're a farmer, as much as possible, try to prepare for Frost.   Fear isn't helpful, but planning ahead for possible bad weather events is always a good idea.
Answer: Although the El Nino phenomenon is primarily a Pacific Ocean phenomenon, affecting circum-Pacific countries the most, it occurs on such an enormous scale that it has knock-on affects around the world. These are difficult to generalize, but a rough idea can be gleaned from the map of global El Nino effects in such pages as:
http://www.circleofblue.org/waternews/2015/world/el-nino-droughts-take-toll-in-africa-asia-and-the-pacific/
Bear in mind that there are other co-variables of ocean and atmospheric circulation that operate upon time scales varying from years to decades. These can either amplify or negate the extra-Pacific El Nino effects. Therefore the specific effects for any given year require modelling with atmosphere-Ocean-coupled global climatic models. Also consider that the outputs from all AOGCMs don't all agree, so it is necessary to consider a consensus from several outputs before drawing firm conclusions. Yet another consideration is that computer simulations do not give equal weighting to different parameters. So, as far as Iran is concerned, the modelled El Nino effects are likely to be very reliable for temperature, but wildly unreliable for rainfall. If you are concerned about rainfall in Iran my advice is to run a correlation analysis between the two variables: historic El-Nino-Southern Oscillation (ENSO) signal index (available on internet), and historic rainfall. Try this for monthly, seasonal and/or annual data. If the correlation coefficient is high, say >0.70, use this relationship to adjust the normal expected rainfall in Iran. Attach as much credence to this as to any forward projections from any AOGCM. Rainfall analysis is not what AOGCMs were designed for.
Comment: However, you should be afraid of the possible occurrence of El Niño in Iran?
Answer: In addition to the other two answers this article Relation between Rainfall and El Nino in Iran evaluates the relation between quantum of rainfall in Iran during El Nino years. The study concludes that an increase of rainfall is seen across the Iranian plateau during El Nino years and a decrease of rainfall is seen across coastal areas. On the whole El Nino years are beneficial for Iran. The author does perform a correlation study using Pearson's method and conclude a meaningful relationship does exist at the 0.01 significance level. Considering Iran's geography and arid lands this would suggest a more careful management of water resources and ensure the rainfall is harvested through  watershed management.
The following study confirms the above findings  On the relationship between ENSO and autumn rainfall in Iran  and reports that El Nino episodes produce greater rainfall than La Nina episodes. The regions that benefited the most are the southern foothills of Alborz mountains, northwestern districts and central areas. Sources of moisture appear to be the Mediterranean Sea, Black Sea, Persian Gulf and the Red Sea. There is no evidence to suggest that the Pacific Ocean and Indian Ocean are sources of moisture.
In addition the following study Effects of El Nino Southern Oscillation on the Discharge of Kor River in Iran conclude that efforts need to be directed at flood and drought predictability.

In average, El Nino caused increased discharge by 15% at Chamriz station and 20% at Dehkadeh-Sefid station. The time of maximum impact was found in the months of February and March of the El Nino year. It can be expected that the results obtained in the present study will help to understand the variations of river discharge due to El Nino which in turn will help water managers, dam operators, and policy makers in water resources planning and management as well as flood and drought forecasting and mitigation.

In Synoptic Climatology of Precipitation in Iran  authors conclude that upper level disturbances are responsible for over fifty percent of rainfall.
If it is indeed the case rainfall maxima during El Nino years are experienced in February and March in Iran then these maybe due to Western Disturbances Western Disturbances. These are basically upper level systems (500 hPa and above) and the following study describes the dynamics of  winter precipitation  episodes over Iran as well Numerical study of western disturbances over western Himalayas using mesoscale model
Here is a recent review of Winter Western Disturbances and their multi annual variations. Multi-annual variations in winter westerly disturbance activity affecting the Himalaya. These authors confirm the same sources of moisture.
Comment: I wouldn't regard a correlation coefficient of 0.01 as 'meaningful'!
Comment: The 0.01 is the significance level - http://www.numberwatch.co.uk/significance.htm

El Nino in the Middle East