Jow Forums humor thread please

To clarify from last thread, this method works for determining primes that are less than 10.
11 is prime and would output as non-prime because it is not a product of 2, 3, 5, or 7.

The function will, however, determine an infinite number of non-prime numbers, so long as those numbers are a product of either 2, 3, 5, or 7, or some combination thereof.

The method is comically bad because it can only find 4 primes, and its ability to find non-prime numbers is not exhaustive.

>t. university math major.

Attached: is prime.jpg (1080x384, 76K)

Other urls found in this thread:

iluxonchik.github.io/regular-expression-check-if-number-is-prime/
youtu.be/uNjxe8ShM-8
twitter.com/AnonBabble

public static boolean isPrime(int n) {
return !new String(new char[n]).matches(".?|(..+?)\\1+");
}

print op is a fag

This is still non-exhaustive.

bool isPrime(int num)
{
return maybe;
}

checkmate

book isPrime(int n) {
return curl("google.com/q=is {n} prime?");
}

The alternative being, loop through squared root numbers for long enough to find if it's not a prime.

Why do you give a fucking book when asked if a number is prime?

hehe

Attached: random_number.png (400x144, 7K)

hold up let me calculate every prime number just to ensure my list is complete

WTF? this can't possibly work, the language { 1^n | n is prime } can't possibly be regular!

True, but modern pattern matching implementation ("regex") allows for any language.
Explanation of this trick:
iluxonchik.github.io/regular-expression-check-if-number-is-prime/

Or use the sieve of Eratosthene and stop being a brainlet.

Thanks for the link, I'll give it a read. super interesting

Holy fucking shit this guy can't get to the fucking point

Attached: sadcsarray.png (3007x2668, 338K)

will this work? i've always just used for loops for arrays.

in a strongly typed language this abomination wouldn't even compile.
Fuck JS

What's wrong with that?

> t. web "developer"

If the value in the array is ever falsey, it will stop printing. If the values in the array are never falsey, it will keep printing out forever and go out of bounds until it finds something falsey.

>t. OpenSSL developer

%

Attached: 1527221122281.png (890x670, 88K)

Attached: wincucks.jpg (540x359, 23K)

>t. javascript artisan

Attached: 1522528288998.png (586x509, 33K)

hearty kek

savage!

loop condition lelllllll

ES6 :)
arr.forEach(el => console.log(el));

>SeaGay

Attached: 1524078949362.jpg (500x449, 46K)

Does anyone have the long greentext cap about the guy talking about how windows is a big cluster fuck of an operating system?

niggers

Wrong, you fucking brainlet. An out of bounds array value will be falsey, hence the loop ends as soon as it reaches the end of the array.

The real answer for what is wrong with this is the fact that the programmer reimplemented the for loop as a while loop. It's not even inherently bad, it's just not common as the for loop typically gives you more flexibility than a while loop.

>>An out of bounds array value will be falsey
>arbitrary memory is always 0

Differentfag here, but look at the syntax

>var
>function

It's javascript which means that out-of-bounds access will be `undefined` which is falsy.

>For example, let’s say we have the string The Documentary (2005) and the regular expression .
Stopped reading right there.

>le stack overflow may-may
turns out regular expressions can parse irregular strings, go figure.

from the supposed Microsoft employee?

explain, i'm an yoomer.

fuck back off to tumblr and stop posting the same inane shite in threads all over the place

It's not a matter of whether it can or can't do something. It's just not intended to do these things. It's a language used for simple text parsing, things like detecting emails and filtering swear words. When you use it for anything more complicated it quickly starts becoming a giant mess (no comments, variable names, symbols everywhere).
A lot of languages, libraries and tools that are commonly used and expanded can be used to do unexpected things and I got used to it after seeing a lot of examples like this. I'm far more impressed when someone can make a clean interface for his library or a code base that is both effective and readable.
Anyways have another stack overflow may-may (good for you if you're using Jow Forums more often than stack overflow)
youtu.be/uNjxe8ShM-8

>this needs an in-depth explanation
>nu-Jow Forums

Attached: mayyyyy.jpg (362x360, 18K)

Attached: mayou.jpg (640x498, 24K)

I have color blindness and this is very difficult to see.

install gentoo

Sex leads to side effects and should be avoided anyway.

Java was just a prank, bro.

Attached: Jteqd.png (519x396, 89K)

urxvt btfo

Attached: based.png (883x495, 16K)

>side effects
you mean children

Attached: 5A79707B220848A0BF627A5C214FC504.jpg (700x571, 66K)

Why would you have to create a list of numbers and then compare each to the argument? Just use a for loop that tries 'num%(num-1) ==0' until num-1 == 2

>

Attached: 1533685073588.png (300x250, 36K)

>It's okay when k&r and apple do the exact same thing with cstrings

>yesterday
>"need to restart to install update" message pops up with no fuck off option
>whatever, it'll be quick
>5 hours later it's at 27%

oh my godddd im losing 25 whole ms when inputting something in my terminal emulator

based konsole

That's unironically how Sony did their ps3 crypto and why what should have been a fucking nightmare to hack was so easy. Go watch the CCC talk from failoverflow. It's worth it for a laugh

See, this man has accepted a-sexuality into his heart.

ES5 :^)
arr.map(console.log)

Or you know, just
console.log(arr)

From the last thread

Attached: bloblems.jpg (614x461, 52K)

Attached: 1495068148387s.jpg (250x250, 5K)