This problem is from "An Introduction to Number Theory" by Ivan Niven. Define a to be a cubic residue if $x^3 \equiv a \mod p$ has solutions. Prove that if $p=3k+2 ,$ then every number that is in reduced residue system is a cubic residue. And if $p=3k+1$, only one-third of the reduced residues are cubic residues.I did find a solution . But, I've not covered the portion in the book after section 2.5(self-study). I attempted the question in the following way and would appreciate any hints to reach to conclusion:  As $B=\{1,2,\dots ,p-1\}$ is a reduced residue system, it should be enough to prove that $i^3 \equiv j^3\mod p \Rightarrow i\equiv j\mod p$. So, one part of it boils down to  If $p=3k+2$, then show that $p \nmid i^2+j^2+ij $, if $i\neq j \wedge i,j \in B$. I have no idea how to use the $p=3k+2$ part for proving this.
If $p$ is congruent to $2 \pmod 3$, how can I prove that all $a$, $1 \le a \le p-1$ are cubic residues $\mod p$?  Here's what I've done:  $1^3$ congruent to $1 \pmod p$ thus, 1 is a cubic residue, Also $(p-1)^3=(p-1) \pmod p$ implies  $$(p-1)^3 - (p-1) = (p-1)[(p-1)^2 -1] = (p-1)(p^2 -2p) = p(p-1)(p-2) $$ implies $$p|(p-1)^3 -(p-1)$$ Thus  $p-1$ is a cubic residue $\mod p$. Now I don't know how to show for $1\lt a \lt p-1$ are all cubic residues when $p$ is congruent to $2\pmod 3$.
How can I install on a non-PAE CPU? (error "Kernel requires features not present on the CPU: PAE") After burning Ubuntu 12.04 to a CD, I tried booting and got the message:  This kernel requires the following features not present on the CPU: pae  Unable to boot - please use a kernel appropriate for your CPU.   What does this mean? Is there a way to recover files from a storage device partially overwritten with dd? I'm an idiot, I was writing an image to a USB drive using dd when instead of typing /dev/sdb I typed /dev/sdd and wrote the 135mb image to my 750gb External Hardrive full of files. Is there ANY possibility of recovering the files or did dd completely zero out the drive? Please help, as this is one of the lowest points of my life EVER.  dd finished writing the 135mb image in 5 seconds, so I didn't have a chance to stop it. By the time I knew what happened to was too late. The command was as follows:   sudo dd if=generic.img of=/dev/sdd bs=1M   EDIT2: The External Harddrive's filesystem was FAT32(I've had the drive for awhile and FAT32 was the most Universal FS at the time). I also have a 2TB drive I just got which I was planning on moving most of the files to from the 750gb, If needed I can use it to transfer the Recovered files to. How to resolve a hostname to an IP address in Metro/WinRT? Homework question on whether two quotient spaces are homeomorphic I'm having trouble restarting a 2D game when the user presses the "New Game" button.  Structure of my game:  The game has several 'screens': Opening screen, instructions screen, main game screen, and a game-over screen.  Each screen is an instance of a class: OpeningScreen class, GameScreen class, etc.  There is a class named Main. This class has three roles.   It's the JFrame (the window) of the program. It has the main method - first class to run. It has a method that change's screens.   When the program starts, this class runs. When it first runs:   Creates a new instance of itself (it's a JFrame-type class). Creates an instance of every 'screen-class'. The constructor of each 'screen-class' takes the instance of Main as an argument: (aka: GameOverScreen gameOverScreen = new GameOver(this)). Creates a new JPanel named mainPanel, and adds it to the JFrame. Any screen to be displayed will be contained in this JPanel (The screens are also JPanel-type classes).   How the changeScreen() method works:  The signature of changeScreen() is this: changeScreen(JPanel from, JPanel to).  Whenever a screen needs to be changed, the current screen that is displayed calls this method, like so: main.changeScreen(this, main.InstructionsScreen). It removes the previous screen from mainPanel and adds the new screen to mainPanel. As said, these screens are created when the program launches.  This is the method that changes screens:   public void changeScreen(JPanel from, JPanel to){      mainPanel.remove(from);     mainPanel.add(to);      mainPanel.revalidate();     mainPanel.repaint();  }   My problem:  After a game is finished, the Game class calls the changeScreen method: main.changeScreen(this, main.GameOverScreen) .  This replaces the game screen with a game over screen. Pressing the "New Game" button in the game-over screen, calls main.changeScreen(this, main.GameScreen) .  The problem: Pressing the "New Game" button in the game-over screen, indeed displays once again the instance of the Game class. But this is the old instance, so the game is not restarted. It's already finished.  I tried to do the following changes in changeScreen():  public void changeScreen(JPanel from, JPanel to){      mainPanel.remove(from);      if(to.equals(gameScreen)){         gameScreen = null;         gameScreen = new GameScreen(this);     }     mainPanel.add(gameScreen);      mainPanel.revalidate();     mainPanel.repaint();  }   This should reset the gameScreen object. But this creates a delay of about 10 seconds when pressing the "New Game" button.  What would be a good way of restarting the game?  Thank you What's the difference between using black and white mode in-camera, and converting in post? For black and white photography, will there be any quality difference between using the built-in black and white mode, or shooting in color initially and then removing the color later using Photoshop (or similar application)?  I have a high-end compact camera, the . What is the promotion rate of professors in United States? I'm writing an essay, and want to know the promotion rate and average duration from assistant professor to associate professor and associate professor to professor in recent years. Sadly I don't know the data for the US. Could anyone tell me? Constructing the reciprocal of a segment How can one construct the reciprocal length of a line segment? For example, given any line segment a, how can $\frac{1}{a}$ be constructed?  I was told that it can be solved by creating similar triangles, but I do not get it. Seeking English term for relationship between two members of extended family? Why the switch statement cannot be applied on strings? Compiling the following code and got the error of type illegal.  int main() {     // Compilation error - switch expression of type illegal     switch(std::string("raj"))     {     case"sda":     } }   You cannot use string in either switch or case. Why? Is there any solution that works nicely to support logic similar to switch on strings? LaTeXiT is cropping the pdf I am using LaTeXiT (pierre chachatelier, www.chachatelier.fr) - latex equation editor for Powerpoint for mac.  It's producing pdf that appear to be "cropped" on top (see attached) - I've tried already with changing the "margins" option (Preferences>General) but unsuccessfully - don't think that's the problem.   Any hint?   Thanks Mapping ManyToMany with composite Primary key and Annotation: I have a dataset for which I have multiple sets of binary labels. For each set of labels, I train a classifier, evaluating it by cross-validation. I want to reduce dimensionality using principal component analysis (PCA). My question is:  Is it possible to do the PCA once for the whole dataset and then use the new dataset of lower dimensionality for cross-validation as described above? Or do I need to do a separate PCA for every training set (which would mean doing a separate PCA for every classifier and for every cross-validation fold)?  On one hand, the PCA does not make any use of the labels. On the other hand, it does use the test data to do the transformation, so I am afraid it could bias the results.  I should mention that in addition to saving me some work, doing the PCA once on the whole dataset would allow me to visualize the dataset for all label sets at once. If I have a different PCA for each label set, I would need to visualize each label set separately. How to understand intuitively the Stolz-Cesaro Theorem for sequences? I have to give a presentation on the theorem in Real Analysis with a fellow student. While I've looked over the  and verified that, yes, step B does indeed follow logically from step A, etc. and have internalized the proof to the extent that I can replicate it myself on paper, I still feel that I have made little progress as to why this theorem works the way it does, i.e. what is the intuition behind the theorem, such that it should make sense that it follows the way it does. Therefore I ask: what kind of intuition is there about this theorem? It would also be helpful to understand how the theorem can be used effectively in analysis.  I have seen it referred to as a sort of L'Hopital's rule for sequences, which certainly seems to make sense, but I similarly have little intuitive understanding of how that rule works, either.  I am asking this question not only for my personal understanding, but also for the sake of being able to present it in an illuminating manner, such that the rest of the class can also come away with the same sort of intuition of how the theorem works and how it is useful. Any help would be greatly appreciated.  EDIT: I should point out that the formulation of the theorem we are being tasked to prove is the following:  Let $\lbrace a_n \rbrace$, $\lbrace b_n \rbrace$ be sequences, ${b_n}$ strictly increasing and unbounded. Then if $\lim\limits_{n \to \infty} \frac {a_{n+1} - a_n}{b_{n+1} - b_n} = l$ for some $l \in \mathbb R$, then $\lim\limits_{n \to \infty} \frac{a_n}{b_n} = l$ also. How to use notify-send to notify users as root? #!/bin/bash export DISPLAY=:0 state=$(upower -i $(upower -e | grep BAT) | grep --color=never -E "state" ) stat=${state:25:32} batperct=$(upower -i $(upower -e | grep '/battery') | grep  -E "percentage:") bat=${batperct:24:26} intbat=$(echo $bat | cut -d'%' -f1) if [ "$intbat" -lt "15" -a "$stat" == "discharging" ]; then     notify-send 'battery low..! please plugin charger..... charge is only' "$intbat"     fi     The script runs fine when run as a normal user (bash script.sh). The desktop notification is displayed.  If I run it as root with sudo bash script.sh, the desktop notification is not displayed.  How can I use notify-send to notify users as root?  I am using Arch Linux. How to Retrieve the Wi-Fi Password of a Connected Network on a Mac I need to find the password for a Wi-Fi network that I am already connected to. I'm using a MacBook Pro that's running OS X Lion. Any guidance is appreciated. When a spaceship is experiencing a constant acceleration of $10m/s^2$, the astronauts will be moving at nearly the speed of light after about a year in the earth's reference frame. This means the spaceship's energy will start to diverge as a function of the speed $v$ so there will be a huge amount of energy necessary to increase the speed of the ship any further. This way, the speed of light can never be crossed.  All of this is clear to me, but all of this is also formulated in earth's reference frame. But from the astronaut's reference frame: the spaceship is simply accelerating at $10m/s^2$ and so the force on the spaceship is constant. Then why would we need huge amounts of energy to accelerate the spaceship?  For example, I read somewhere that the amount of energy that would be needed to accelerate a large spaceship to half the speed of light is more than 2000 times the current world annual energy consumption. How does this make sense in the astronaut's (non-inertial) frame? I dropped my camera while on holiday last summer. Thankfully, my camera wasn't damaged but the kit lens has lost the ability to autofocus and the UV filter and 58mm to 52mm filter step-down (I use it to attach a fisheye filter to the lens) I had on its end are stuck and won't come off.  I've replaced the lens with an 18-200 zoom lens so I don't especially need it. I was wondering if it was worth getting the lens looked at and possibly repaired?  I've heard many places will charge you £50 or so just to look at the lens and given the cost of the kit lens I'm not sure it's worth it. Footnote citations in biblatex ignore spacing before the citation command; how can I have the same behavior for all footnotes in a document?  Here's a MWE demonstrating the issue:  \documentclass{article} \usepackage[style=verbose-trad2]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} Spacing is fine before citations     \autocite{kant:kpv}  but not before footnotes    \footnote{A footnote \autocite{kant:ku}}. \end{document} How are Stormtroopers uniquely identified in the field? Multiple times in Star Wars: The Force Awakens, people refer to trooper FN-2187 by that specific correct name, while he is in armor.  But the armor is largely identical (some have little accessories like shoulder pads, or different weapon loadouts, but FN-2187 lacks these), which makes me wonder how do First Order (or even the old Imperials) identify who they're talking to?  How are Stormtroopers correctly identified while they're in armor?