This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 题目 | |
| 有5个罐子,有一个精灵可能存在这些罐子里的某一个,每天精灵会从当前罐子跳到旁边的罐子里,要求给你6天时间,每天猜一个罐子,求出肯定能猜到精灵的罐子编号组合。 | |
| ### 答案 | |
| [2, 3, 4, 2, 3, 4] | |
| [2, 3, 4, 4, 3, 2] | |
| [4, 3, 2, 2, 3, 4] | |
| [4, 3, 2, 4, 3, 2] | |
| ### 暴力破解代码 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Arrays; | |
| import java.util.Random; | |
| public class CSort { | |
| private static Random random = new Random(); | |
| public static void main(String[] args) { | |
| int[] arrays = fill(100000); | |
| isort(arrays); | |
| shellsort(arrays); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ | |
| /** | |
| * This program will demonstrate how to use "aes128-cbc". | |
| * | |
| */ | |
| import com.jcraft.jsch.*; | |
| import java.awt.*; | |
| import javax.swing.*; | |
| public class AES{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DIR_PATH=$1 | |
| KEY_WORD=$2 | |
| REPLACE_WORD=$3 | |
| if [[ -z ${DIR_PATH} ]] | |
| then | |
| echo "请输入要替换的目录路径(绝对路径)" | |
| exit 0; | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "authorization-plugins": [], | |
| "data-root": "", | |
| "dns": [], | |
| "dns-opts": [], | |
| "dns-search": [], | |
| "exec-opts": [], | |
| "exec-root": "", | |
| "experimental": false, | |
| "features": {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| project_name=abc | |
| tomcat_path=/root/tomcat/tomcat-8080-abc | |
| work_path=/share/tmp/abc | |
| if [[ !(-f ${work_path}/war/${project_name}.war) ]] | |
| then | |
| echo "工作目录中,未检测到war包" | |
| exit 1; | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ################################################## JAVA SETUP ################################################## | |
| JAVA_VERSION=8 | |
| JAVA_UPDATE=202 | |
| JAVA_BUILD=08 | |
| JAVA_PATH=1961070e4c9b4e26a04e7f5a083f551e | |
| JAVA_HOME=/etc/java | |
| echo "-------------------------------------------开始下载JDK-------------------------------------------" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.xdja.demo.springbootdemo.algorize; | |
| import java.util.Arrays; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| /** | |
| * description | |
| * | |
| * @author zk | |
| * @since 2019/2/25 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| public void testPrintTest() throws InterruptedException { | |
| final boolean[] finish1 = {false}; | |
| final boolean[] finish2 = {false}; | |
| StringBuilder str1 = new StringBuilder(); | |
| StringBuilder str2 = new StringBuilder(); | |
| Thread t1 = null; | |
| Thread t2 = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| eval $(ps --no-heading -f -C java|awk '{print "kill " $2}') | |
| 或者 | |
| eval $(ps --no-heading -aux |grep java | grep -v "grep"|awk '{print "kill " $2}') |