Gradle Notes

运行

  1. 配置
1
2
3
  apply plugin: 'application'

  mainClassName = 'hello.HelloWorld'
  1. gradlew run

打包

  • 配置

    1
    2
    3
    4
    
      jar {
    baseName = 'gs-gradle'
    version =  '0.1.0'
      }
  • gradlw build

依赖

1
2
3
4
  dependencies {
compile "joda-time:joda-time:2.2"
testCompile "junit:junit:4.12"
  }

版本

1
2
  sourceCompatibility = 1.8
  targetCompatibility = 1.8

命令

gradlew tasks

gradlew build

  • 配置

Java IO

文件与路径

File 类

  • 用于文件本身属性和操作(增删改查)

Java 7 新包

java.nio.file https://blog.csdn.net/qq877728715/article/details/104499687/

Files 类

  • 文件复制,linux 属性 rwx 等高级功能

Path 类

  • 新工具,用来取代 java.io.file.File 类

Java Collections Notes

map

使用

  • 使用 Map<KeyType, ValueType> 声明引用变量
  • 使用实现类(如:new HashMap<>()),创建被引用对象

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    
      @RestController
      public class ProductServiceController {
    private static Map<String, Product> productRepo = new HashMap<>();
    static {
     Product honey = new Product();
     honey.setId("1");
     honey.setName("Honey");
     productRepo.put(honey.getId(), honey);
     
     Product almond = new Product();
     almond.setId("2");
     almond.setName("Almond");
     productRepo.put(almond.getId(), almond);
    }
      }

实现类

  • HashMap

pyautogui Notes

获取位置 position()

屏幕尺寸 size()

给定位置是否在屏幕内 onScreen(x, y)

初始配置

调用延时 pyautogui.PAUSE = 2.5

  • 设置调用延时

    • 每一次调用 pyautogui 之后, 会被延时多久

中止方式 pyautogui.FAILSAFE = True

  • 鼠标移动到左上角,中止执行

移动操作

绝对移动 moveTo(x, y, duration=num_seconds)

  • 即,相对于原点(左上角)的位置
  • 参数