我希望我的脚本只下载文本/ html内容,而不是二进制文件或可能需要更多时间下载的图像.我知道max_size参数,但我想在Content-Type标题上添加一个检查.这可行吗?
我正在尝试为 Android 编写 kotlin 库,但不能包含木材。我总是收到以下错误:
Error:error: unresolved reference: timber
Run Code Online (Sandbox Code Playgroud)
我的 build.gradle 中有这个:
apply plugin: 'java-library'
apply plugin: 'kotlin'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
maven {url "https://maven.google.com"}
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
compile 'com.jakewharton.timber:timber:4.5.1'
testCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)
我的源文件目前非常简单:
package net.mbonnin.test
import timber.log.Timber
class Main() {
fun main() {
Timber.d("hello world")
}
} …Run Code Online (Sandbox Code Playgroud) 这两个注释之间有什么区别?
org.jetbrains.annotations.NonNullandroid.support.annotation.NonNull 是的科特林编译器的IntelliJ要荣誉android.support.annotation.NonNull,并添加断言检查,如果我传递一个空参数对应的Java功能?
org.jetbrains.annotations.NonNull如果我检查了已经为NonNull的变量,Android皮棉是否会兑现并向我显示警告?
我什么时候应该使用另一个?
我无法获得http://www.gnu.org/software/bash/manual/bashref.html#Pattern-Matching中所述的复合模式来匹配我的 case 语句:
i=33; case $i in *([A-Za-z0-9]) ) echo "alphanumeric";; * ) echo "bah";; esac;
Run Code Online (Sandbox Code Playgroud)
我希望上面的脚本显示“字母数字”,但它失败了:
bash: syntax error near unexpected token `('
Run Code Online (Sandbox Code Playgroud)
知道出了什么问题吗?