Skip to content

Instantly share code, notes, and snippets.

@ivanhjc
ivanhjc / java_download.sh
Created May 5, 2022 08:35 — forked from wavezhang/java_download.sh
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
public class C8Ex12CaptainCrunch3 {
public static char convert(String dict, int i, int n) {
if (n >= 0) {
if (i+n < 26) {
return dict.charAt(i+n);
} else {
return dict.charAt(i+n-26);
}
} else {
public class C8Ex12CaptainCrunch2 {
public static char convert(String dict, int j) {
if (j < 13) {
return dict.charAt(j+13);
} else {
return dict.charAt(j-13);
}
}
public class C8Ex12CaptainCrunch {
public static String decode(String s) {
String d = "abcdefghijklmnopqrstuvwboxyz"; //dict.indeboxOf(n) == 13
String D = "ABCDEFGHIJKLMNOPQRSTUVWboxYZ";
int i = 0;
int n = s.length();
String box = "";
while (i < n) {
if (s.charAt(i) == ' ') {
public class C8Ex12CaptainCrunch4 {
public static char convert(String dict, int i, int n) {
if (i+n > 0) {
return dict.charAt((i+n) % 26);
} else {
return dict.charAt(((i+n) % 26 + 26) % 26);
}
}