Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

No captcha?

Name: Brian Brixman 2021-02-01 16:33

Hello,
I am learning programming and just discovered this website. But I am curious, how does it protect its users from spammers (people who post illegal or annoying things) without a reCaptcha? I thought clicking this blue box is required to prove that you are not a robot, can you please share any javascript that you use for this purpose?
Thank you and have a nice day,
Brian

Name: Anonymous 2021-03-22 0:56

posts some more code in /prog/

$ java NextPermutation 1 2 3
[1, 3, 2]
$ java NextPermutation 3 2 1
[1, 2, 3]
$ java NextPermutation 1 1 5
[1, 5, 1]
$ java NextPermutation 1
[1]
$ java NextPermutation 4 5 6 1 7 8 9 2
[4, 5, 6, 1, 7, 9, 2, 8]

$ cat NextPermutation.java
import java.util.Arrays;

public class NextPermutation {
static int minover (int data [], int pos) {
int n = data.length, atpos = data [pos], sofar = -1, atsofar = 0, now;
for (int k = pos + 1; k < n; k++) {
now = data [k];
if ((now > atpos) && ((sofar < 0) || (now < atsofar))) {
sofar = k;
atsofar = now;
}
}
return sofar;
}

public static void next (int data []) {
int n = data.length;
if (n < 2) { return; }
int pos = n - 2, over, swap;
boolean more = true;

while (more) {
over = minover (data, pos);
if (over < 0) {
pos--;
more = pos >= 0;
} else {
swap = data [pos];
data [pos] = data [over];
data [over] = swap;
if (pos + 1 < n) {
Arrays.sort (data, pos + 1, n);
}
return;
}
}

Arrays.sort (data);
}

public static void main (String args []) {
int have = args.length;
if (have < 1) { return; }
int data [] = new int [have];
for (int k = 0; k < have; k++) {
data [k] = Integer.parseInt (args [k]);
}
next (data);
System.out.println (Arrays.toString (data));
}
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List