Let $p ∈ \mathbb N, p ≥ 2$, show that :   $$(p − 1)!= −1 [p] \iff p \text{ is prime.}$$    Hint : For one direction, use the fact that $\mathbb F$ is a field and pair each element with its inverse.   I'm not sure where to start with this problem. Any help appreciated. Thanks!
How can I show that $(n-1)!\equiv-1 \pmod{n}$ if and only if $n$ is prime? Thanks.
I have a bash script that makes a cURL request and writes the output to a file called resp.txt.  I need to create an exclusive lock so that I can write to that file and not worry about multiple users running the script and editing the text file at the same time. Here is the code that I expect to lock the file, perform the request, and write to the text file: ( flock -e 200 curl 'someurl' -H 'someHeader' &gt; resp.txt ) 200&gt;/home/user/ITS/resp.txt  Is this the correct way to go about this?  My actual script is a bit longer than this, but it seems to break when I add the flock syntax to the bash script. If someone could explain how these file descriptors work and let me know if I am locking the file correctly that would be awesome! Original sentence:     Prince Andrew, looking again at that genealogical tree, shook his head, laughing as a man laughs who looks at a portrait so characteristic of the original as to be amusing.    (War and Peace, Tolstoy, English translation)     In the sentence above, shouldn't the comma before laughing be omitted if this is about the participle clause denoting "an action that happens at the same time in the past"?  I mean it should be      Prince Andrew…shook his head laughing as a man…   Plus, shouldn't the verb laugh after a man be in the past tense in order to be in accordance (agreement) with shook his head?   You know, the whole sentence should be consistent…. I was about to reconfigure some of my code to use the newer Schema.describeSObjects(types) method that I had heard was faster than using a globalDescribe.   I made some code to quickly check this and I was dismayed to find that the newer technique is not only not faster, it's about twice as slow as using a global describe. Here's the code I used :  New DescribeSObjects() method  //each block was run separately for timing purposes String obj = 'Account'; String[] types = new String[]{obj}; System.debug('START DESCRIBE SOBJECTS');  for (Integer i = 0; i &lt; 50; i++) {   List&lt;Schema.DescribeSobjectResult&gt; results = Schema.describeSObjects(types);  } System.debug('FINISH DESCRIBE SOBJECTS');   Old getGlobalDescribe() method  String obj1 = 'Account'; System.debug('START DESCRIBE GLOBAL');  for (Integer i = 0; i &lt; 50; i++) {    Map&lt;String,Schema.SObjectType&gt; gd = Schema.getGlobalDescribe();    Schema.SObjectType sobjType = gd.get(obj1);    Schema.DescribeSObjectResult describeResult = sobjType.getDescribe();  } System.debug('FINISH DESCRIBE GLOBAL');   Over 5 runs of each, the getGlobalDescribe() method took an average of 337ms for 50 describes and the describeSObjects() method took and average of 658ms. This is basically twice as long.  Does anyone have any insight as to why this would be? Any improvements that will significantly improve the accuracy of the resulting data?  As this data stands, I'm sticking with the old method.  One final note: the old technique uses 3 times a much heap (67kb vs 27kb) I am wondering if we should use  or  for buttons and headings in websites and web/mobile apps? Title Case: Manage my Account Delete my Account  Sentence case: Manage my account Delete my account  In  I found the recommendation 'choose your style and be consistent'. This is it? Aren't there any other (additional) recommendations or sources. Like for specific use cases or apps where the one style would be preferred over the other? Edit: The question refers primarily to English, but differences in other languages are also good to know. Is there a difference between "" and {} in BibTeX? Can I use Named Credential merge fields as URL parameters on the endpoint? I have a named credential as follows:  Name   Test_Credential URL    https://www.somesite.com Identity Type    Named Principal Authentication Protocol    Password Authentication Username   foobar Password   mySomeSiteDeveloperKey Generate Authorization Header   FALSE Allow Merge Fields in HTTP Header    TRUE Allow Merge Fields in HTTP Body     TRUE   The service that I am trying to authenticate against uses URL parameters to pass in the developer key and username. Is there any way to use  to pass those in to the URL?   The Named Credential attributes seem not to get decoded until the request is actually sent, as debugging the endpoint, or headers if I set them per the linked doc, show the un-merged data. I can get the callout to go to the right place, and return the expected error because the auth information is not provided. Anybody know of a "show me my HTTP request" site that I could point to to get a better idea of how this works?  I've tried both of these:  req.setEndpoint('callout:Test_Credential/api/action?id={!$Credential.Password}&amp;account={!$Credential.UserName}');  req.setEndpoint('callout:Test_Credential/api/action' + '?id=' + '{!$Credential.Password}' + '&amp;account=' + '{!$Credential.UserName}');   (Edited to remove the part about $Credential vs. $Test_Credential as I was able to determine that it is the former, and see the merged creds by calling out to .) Does the series $\sum \limits _{n=0}^{\infty} \cos(n\pi)$ converge or diverge? Does the series $\sum \limits _{n=0}^{\infty} \cos(n\pi)$ converge or diverge?   On substituting values I get alternate $1$ and $-1$.    So taking sum of infinite GP, I get $\dfrac 1 2$. So it looks like it converges. How to prove $a^2 + b^2 + c^2 \ge ab + bc + ca$? How can the following inequation be proven?  $$a^2 + b^2 + c^2 \ge ab + bc + ca$$ What is the connection between special and general relativity? What is the connection between  and ? As I understand general relativity does not need the assumption on speed of light constant. It is about the relation between mass and spacetime and gravity. Can general relativity be valid without special relativity? Let $X$ be a beta distributed variable with parameters $a$, $b$. Let $Y$ be a beta distributed variable with parameters $c$, $d$. Let $Z = \max(X, Y)$.  Does anybody know of a fast way to compute the mean and variance of $Z$ given $(a, b, c, d)$?  $X$, $Y$ don't necessarily need to have beta distributions, but they should be similar -- in $[0, 1]$.  What I really want to find is a way to quickly approximate the distribution of the sample max of a bunch of random variables. Let $Z = \max(\{X_1, X_2,\dots , X_n\})$. If I know parameters (not necessarily beta-distribution) for $X_1, X_2,\dots, X_n$, can I quickly compute a set of parameters (same distribution as $X_i$) to form a distribution that closely approximates $Z$?    EDIT: To clarify, the purpose of this has to do with programming AI for board games. If we are evaluating a position in a chess game and we determine one move leads to a 60% chance of winning while all others have a 20% chance of winning, then we value the position as a 60% win. This is the minimax algorithm... However, what I'm curious about is whether this can be improved upon. In the simple case, we approximate: $$ \mu_c = \max(\{\mu_1, \mu_2,\dots, \mu_n\}) $$ where $\mu_c$ is the expectation from the current position and $\mu_i$ is the expectation from each of the sub-trees.  It seems like we should be able to do better than this. Can we find a function f that replaces max and closely approximates parameters for the distribution of the sample maximum? $$ (\mu_c, \sigma_c) = f\left(\{(\mu_1,\sigma_1), (\mu_2,\sigma_2), \dots, (\mu_n, \sigma_n)\}\right) $$ In this case, we still want $\mu_i$ to be the expectation from each of the nodes. However, $\sigma_i$ does not necessarily need to be variance/standard deviation; just a parameter that represents uncertainty.  Just as: $$ \max(\{a, b, c\}) = \max\left(\{\max(\{a, b\}), c\}\right) $$ We should expect: $$ f\left(\{a, b, c\}\right) \approx f\left(\{f(\{a, b\}), c\}\right) $$ So $f$ does not necessarily need to take parameters for more than two nodes.  One thing, however, is that $f$ should be relatively fast to compute. If the integrals must be calculated, I think doing double exponential integration might work well, but I'm not sure -- terminator: permission denied for sudo I have to try to add a field called 'Name' to a bunch of different feature classes using python, and then access the name of the feature class to fill in the field. I have no idea how to even start this! I know I need a loop but that's all I know. I have created a model which requires some faces to be dual sided.  I intend to import this model into Unity. Reading about this, it seems that the recommendation is to duplicate the polygons and then flip the normals.  What I have done so far is simply to duplicate the all of the relevant faces using Shift+D and then flip the normals. I don't like this method though as it hampers any future alterations to the model itself.  What is the best way of doing this? While I am familiar with Descartes and the oft-quoted idea, I think therefore I am, I am not familiar with any philosophy that actively sought to rationalize that anybody else exists.  Are there philosophers who analyzed this question? Or is it taken for granted that it is (im)possible for anybody to validate their own existence to somebody else? (clickable)  Mainad has a valid height and width, however it isn't shown like subad1/subad2. Which are in essence exactly the same! (just a different background image).  Firebug shows my div as greyed out for some weird reason. Replacing the contents of mainad with just some text doesn't solve the problem (problem isn't related to inner elements)..   What's going on?! :( How do I make a 3 dimensional character out of flat picture? I have a cartoon character (a lion) that is part of my business logo that I want to put into Blender and animate it somehow. Is there any way I can take a flat picture (JPEG) and transform it into a 3D image and then animate it in Blender? How can I recover a game center account where I forgot ID and password? A long time ago, I made a game center account to which I attached my CoC village. This account hasn't been used anymore, and I have forgotten the ID and the password.  Now I want to transfer that game to my new phone which has a new game center ID, but need a transfer code from the old account to do so. Is there a way to recover my old game center account details? I am a US Green card holder with an Indian passport expiring in 4 months planning a short weekend trip by road to Canada next month.  Will I be allowed to enter Canada considering my passport won't meet the "valid passport" criteria of 6 months? How do I write content to another browser window using Javascript? I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window.  I've tried copying HTML from the old window to the new window by using myWindow.document.body.innerHTML = oldWindowDiv.innerHTML; but that's doesn't work.  Any ideas? Should searching by default be AND or OR? On my website I have a search bar.  It's powered by Lucene.net.  I have a requirement to make search be a substring case insensitive search, with direct hits appearing before substrings.  What I don't know, however, is when a user searches for a multi-word item--say "Chocolate Milk"--should that be treated under the hood as an AND or OR search?  As an example:  *chocolate* AND *milk*   vs  *chocolate* OR *milk*   The requirement right now is to treat this as an AND, but I'm not sure if that's the right way to go about it.  What would be the best in terms of UX?  I would think the best thing to do would be an OR search, with items containing both keywords appearing before items containing only one of the keywords.  Thoughts?  EDIT: The types of items being searched are medical supplies, with very cryptic names.