it should still fix some issue navigator.onLine is the only built-in property which can be checked (and not reliable btw). You could create a XHR request to a reliable server, and check whether any response is being received.
quickest way in R to check that all columns are identical
seems to work fine There are a great many prime testers out there, many of them on this site. For checking a single number I use a faster variant of your Code2 with a little extra checking. Here is the pseudocode:
boolean function isPrime(num)
//1, 0 and negatives cannot be prime.
if (num < 2) then
// 2 is the only even prime.
if (num MOD 2 = 0) then
return (num = 2)
// Check for odd factors.
limit <- sqrt(num)
for (factor <- 3; factor <= limit; factor <- factor + 2) do
if (num MOD factor = 0) then
// If we reach this point then the number is prime.