Refer to next element of list when iterating using Map
How to Map a subset of list elements to a function?
Why can't I run two mysqli queries? The second one fails I have a Win/Ubuntu 11.10 dual-boot setup, where I am running the OSes on separate partitions of my laptop HDD. I assume the best method of uninstalling is 'simply' a matter of deleting the Ubuntu partitions -once I've made sure control is given to the Windows bootloader instead of grub after POST.  The question is: How do I do that?  Stuff I've tried:  I tried the boot-repair CD (), but that was a bit beyond my abilities to figure out if I could do it with that tool :/.  I also tried EasyBCD (). It couldn't identify my ext3 partitions, let alone change the bootloader.  Lastly, I tried installing startup-manager in Ubuntu, and using that to set the Win7 bootloader as default. But upon restart, it still loads grub. Why is $1$ not considered a prime number?  Or, why is the definition of prime numbers given for integers greater than $1$? That car is way better than any car any of us have/has ever driven.      None of us know/knows which direction Ron's house is (in).    I have two questions here.   In both the cases, are we to use the singular verb, or the plural? In the end of the second sentence, is using the preposition where it's been used, necessary? Would it be okay if it had no prepositions in it? Relevance of cycle detection in Pollard's rho integer factorization algorithm I've recently learned about Pollard's rho factorization algorithm, and the way I understand it, it works by using a pseudorandom sequence of integers $x_{k}$ ranging from $0$ to $n-1$, where $n$ is the number to be factored, to find repetitions in an unknown sequence $y_{k} = x_{k} \bmod p$, where $p$ is an unknown, non-trivial factor of $n$. Such a repetition $y_{i}=y_{j}$ occurs when $x_{i}\equiv x_{j} \bmod p$, which can be detected by checking whether $\gcd(x_{i}-x_{j}, n)\gt 1$.  From what I could find on the Internet, Floyd's cycle detection algorithm or a variant thereof is used to find such repetitions. And the reason for this is what I don't understand.   First, Floyd's algorithm requires that each element in the sequence depends solely on the element before it, which, even if it is the case for $x_{k}$, is not necessarily the case for $y_{k}=x_{k}\bmod p$. For example, assuming we want to factorize $6$, let's take the sequence $5, 3, 2, 4, 1, 0, 5, 3, 2, 4, 1, 0,\ldots$. The cycle period is $5, 3, 2, 4, 1, 0$, where every element is contained only once. However, if we take this sequence $\bmod 2$, we get $1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0,\ldots$. Floyd's algorithm cannot be applied here to find the cycle period $1, 1, 0, 0, 1, 0$. Besides, we are not even interested in a cycle, only in repetitions. Whether we find the congruence $\bmod 2$ between $5$ and $3$, $5$ and $1$, or $4$ and $2$ in the first sequence is irrelevant.   Please correct me if my understanding of Pollard's rho algorithm as described above is wrong. But if it is not, it seems to me that one could just as well try out some random numbers between $2$ and $n-1$ and see if they share a divisor with $n$ other than $1$. So what is the benefit of using a cycle detection method like Floyd's algorithm?  I also found , but it is not answered, and the comment on the question does not really answer the question either. Remotely uninstall apps? I have tried through the Google Play store and it does not seem possible from there, but does anyone know if it is possible to remove an application remotely?   In other words, if I do not have direct access to my phone, can I make use of some website, app or service to uninstall an app without being able to interact with the phone directly. I've read a lot about PCA, including various tutorials and questions (such as , , , and ).   The geometric problem that PCA is trying to optimize is clear to me: PCA tries to find the first principal component by minimizing the reconstruction (projection) error, which simultaneously maximizes the variance of the projected data.    When I first read that, I immediately thought of something like linear regression; maybe you can solve it using gradient descent if needed.  However, then my mind was blown when I read that the optimization problem is solved by using linear algebra and finding eigenvectors and eigenvalues. I simply do not understand how this use of linear algebra comes into play.  So my question is: How can PCA turn from a geometric optimization problem to a linear algebra problem? Can someone provide an intuitive explanation?  I am not looking for an answer like  that says "When you solve the mathematical problem of PCA, it ends up being equivalent to finding the eigenvalues and eigenvectors of the covariance matrix." Please explain why eigenvectors come out to be the principal components and why the eigenvalues come out to be variance of the data projected onto them  I am a software engineer and not a mathematician, by the way.  Note: the figure above was taken and modified from . Sending a message to nil in Objective-C As a Java developer who is reading Apple's Objective-C 2.0 documentation: I wonder what "sending a message to nil" means - let alone how it is actually useful.  Taking an excerpt from the documentation:     There are several patterns in Cocoa   that take advantage of this fact. The   value returned from a message to nil   may also be valid:         If the method returns an object, any pointer type, any integer scalar   of size less than or equal to   sizeof(void*), a float, a double, a   long double, or a long long, then a   message sent to nil returns 0.   If the method returns a struct, as defined by the Mac OS X ABI Function   Call Guide to be returned in   registers, then a message sent to nil   returns 0.0 for every field in the   data structure. Other struct data   types will not be filled with zeros.   If the method returns anything other than the aforementioned value   types the return value of a message   sent to nil is undefined.      Has Java rendered my brain incapable of grokking the explanation above?  Or is there something that I am missing that would make this as clear as glass?  I do get the idea of messages/receivers in Objective-C, I am simply confused about a receiver that happens to be nil. Problems with Curve Modifier Every time I think I have the curve modifier mastered, it throws me a another curve ball (no pun intended).  Why in  can I not get the lights to follow the spiral curve? When the modifier is activated, the lights are stretched and distorted along the curve.  I created the curve by converting it from a mesh (string of verts). Why does it not display like a normal Bezier? Is that related to my problem?  I am following all the "rules" that I am aware of, as detailed here: . The curve seems to run in the correct direction. The origin point is at the first point of the curve. The curve modifier on the lights is set to -Y which is the local orientation of the curve's direction.  What am I missing? Can regular expressions be used to match nested patterns? Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times? For example, can a regular expression match an opening and closing brace when there are an unknown number of open/close braces nested within the outer braces?  For example:  public MyMethod() {   if (test)   {     // More { }   }    // More { } } // End   Should match:  {   if (test)   {     // More { }   }    // More { } } How to make 'python' program command execute Python 3? Number of labeled trees which have one vertex of degree 4 How many labeled trees which have one vertex of degree 4 can we have? A tree with $10$ vertices has $9$ edges, so the sum of the degrees of the vertices is $2\cdot 9=18$. If there is one vertex of degree $4$, the sum of the degrees of the other $9$ vertices must be $14$. I don't know what to do next. Should I count all possible vertex degrees? Which part of speech is "Be assured"? Which of the spans in 1.1 is the stronger? Be assured, you are in numerous company if you pick the left one at first glance, where the struts and wires are doing nothing useful at all.   Could you please tell me what is "Be assured" here?  I mean whether it is an adverb, adjective, so on?  And, would you please show me some examples exactly like such the following, considering my original sentence?     Be assured, ... Can't access my home directory "Encrypted private directory is not setup properly" Hi I'm trying to access my home directory on my laptop hard drive through a live usb. I cannot boot into the OS on the hard drive and the home and root directory is encrypted. I have the encryption key but when I try to run the tool to gain access it pops up for a second then disappears and when I run the command in Terminal it says "Encrypted private directory is not setup properly". What are my options on getting into the directory? I really need to get the data off my laptop. Compound Adjectives and -ed A colleague asked me this question, and I couldn't come up with an answer that satisfied him, so I'm wondering if anyone can help:  Why does a man with a short temper become a short-tempered man? In other words, why do you need the -ed at the end?  Are there any special rules for this? How To Get Command Blocks Talking in Chat I need a way for a command block to say things in chat when it is powered, or more preferably whenever someone spawns into the world. Another layman blackhole question, pulling one end of a string out from behind the event horizon No long explanation is needed,  What would happen if I were to allow one end of a rope to fall past the event horizon of a black hole while I held the other end?  Would I be able to pull it out? Would the rope feel extremely (infinitely?) heavy? How to Send Html Emails in Google Spreadsheet Here's an example of a Google Docs Spreadsheet script that sends emails using Google spreadsheets. I want the email Sent in HTML not plain text. Can someone help me out?  function sendEmails() {   var sheet = SpreadsheetApp.getActiveSheet();   var startRow = 2;  // First row of data to process   var numRows = 2;   // Number of rows to process   // Fetch the range of cells A2:B3   var dataRange = sheet.getRange(startRow, 1, numRows, 2)   // Fetch values for each row in the Range.   var data = dataRange.getValues();   for (i in data) {     var row = data[i];     var emailAddress = row[0];  // First column     var message = row[1];       // Second column     var subject = "Sending emails from a Spreadsheet";     MailApp.sendEmail(emailAddress, subject, message);   } } "is" vs "are" when followed by a number I read the following sentence on YouTube and initially thought it was grammatically incorrect:     Here are 10 minutes of the movie Black Hawk Down!   I thought "are" should have been "is" but then I realized minutes is plural so the plural form, are, is used correctly. I also thought how most people would naturally say "Here is ten dollars in change" but is the use of the singular form, is, correct since dollars is plural?   Am I misunderstanding a rule? Showing that $\int\limits_{-a}^a \frac{f(x)}{1+e^{x}} \mathrm dx = \int\limits_0^a f(x) \mathrm dx$, when $f$ is even I have a question:     Suppose $f$ is continuous and even on $[-a,a]$, $a&gt;0$ then prove that   $$\int\limits_{-a}^a \frac{f(x)}{1+e^{x}} \mathrm dx = \int\limits_0^a f(x) \mathrm dx$$   How can I do this? Don't know how to start.