我按照本教程将应用程序设置为设备所有者.在该教程中,有一节"使用adb设置设备所有者".这里的教程说明在安装Kiosk模式演示应用程序后,运行以下命令:
adb shell dpm set-device-owner sdg.example.kiosk_mode/.AdminReceiver
Run Code Online (Sandbox Code Playgroud)
这给了我错误:
adb server is out of date. killing...
* daemon started successfully *
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
at android.os.Parcel.readException(Parcel.java:1629)
at android.os.Parcel.readException(Parcel.java:1574)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:5146)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:257)
Run Code Online (Sandbox Code Playgroud)
我按照这个SO链接,Diego Plascencia Lara的答案帮助我摆脱了
adb server is out of date. killing...
* daemon started successfully *
Run Code Online (Sandbox Code Playgroud)
但运行adb shell dpm set-device-owner sdg.example.kiosk_mode/.AdminReceiver …
我有一个小java文件给出如下.
class abc{
public static void main(String args[]){
Object a= 9;
int b= (int)a;
System.out.print(b);
}
}
Run Code Online (Sandbox Code Playgroud)
它在cmd中编译时出错,但在Netbeans中没有.此外,当我用'(整数)a'替换'(int)a'时,它在cmd和Netbeans上编译并运行正常.
class abc{
public static void main(String args[]){
Object a= 9;
int b= (Integer)a;
System.out.print(b);
}
}
Run Code Online (Sandbox Code Playgroud)
这是什么原因,我该如何解决这个问题?
编辑:编译第一个代码时出现的错误是:
C:\Users\ANKIT.ANKITSHUBHAM-PC>javac abc.java
abc.java:4: inconvertible types
found : java.lang.Object
required: int
int b= (int)a;
^
1 error
Run Code Online (Sandbox Code Playgroud)
编辑:这个问题不是关于铸造.这是为什么当我使用'(int)'将对象转换为int时cmd和Netbeans的行为不同,但在使用'(Integer)'进行转换时表现相同.
我试图在macOS Sierra上安装valgrind(版本10.12.6).运行./configure.sh时,出现此错误:
检查支持的gcc版本...配置: - prefix =/Library/Developer/CommandLineTools/usr --with-gxx-include-dir =/usr/include/c ++/4.2.1配置: - prefix =/Library/Developer/CommandLineTools/usr --with-gxx-include-dir =/usr/include/c ++/4.2.1 no(applellvm-8.1.0)configure:错误:请使用gcc> = 3.0或clang > = 2.9或icc> = 13.0
所以,我检查了我的gcc和clang版本.答复如下:
Ankits-MacBook-Air:valgrind ankitshubham$gcc --version配置为: - prefix =/Library/Developer/CommandLineTools/usr --with-gxx-include-dir =/usr/include/c ++/4.2.1 Apple LLVM版本8.1.0(clang-802.0.42)目标: x86_64-apple-darwin16.7.0线程模型:posix InstalledDir:/ Library/Developer/CommandLineTools/usr/bin
Ankits-MacBook-Air:valgrind ankitshubham$clang --versionApple LLVM版本8.1.0(clang-802.0.42)目标:x86_64-apple-darwin16.7.0线程模型:posix InstalledDir:/ Library/Developer/CommandLineTools/usr/bin
我不知道如何检查icc> = 13.0
这有什么不对?
我正在尝试使用Int.fromString函数从字符串中提取整数值,但正如我们所知,它的规范是 : String -> int option。所以应用的结果Int.fromString是类型int option。但我需要 type 的结果int。另外我确定提取的部分是整数。如何才能做到这一点?
是否可以使用 sympy 散点图?我有2个数组;称它们为 A 和 B。我可以使用 matplotlib 绘制散点图,如下所示:
plt.plot(A,B)
Run Code Online (Sandbox Code Playgroud)
我想使用 sympy 来做到这一点
我想org.ajoberstar.grgit.Grgit在 gradle 文件中导入第三方类version.gradle。但是它给了我一个错误,它无法解析类 org.ajoberstar.grgit.Grgit(我apply from: "version.gradle"在 build.gradle 中使用)。但是如果我将它导入build.gradle,它就可以正常工作。这是我在做什么:
构建.gradle:
plugins {
id "org.ajoberstar.grgit" version "1.5.0"
}
apply from: "version.gradle"
// Version of jar file.
version = 1.0
jar
{
destinationDir = file(JAR_DIR)
from {
(configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'com.awesomeness.Main'
}
}
jar.dependsOn versionTxt
// Artifact dependecies.
dependencies {
compile files("$TOOLS/lib/grgit-1.5.0.jar")
compile files("$TOOLS/lib/groovy-all-2.4.7.jar")
compile files("$TOOLS/lib/org.eclipse.jgit-4.2.0.201601211800-r.jar")
}
Run Code Online (Sandbox Code Playgroud)
这是 version.gradle 文件:
import org.ajoberstar.grgit.Grgit
//
import java.text.DateFormat …Run Code Online (Sandbox Code Playgroud) 1.13.1
我正在使用Java 8构建可执行jar。以下是Java版本:
$ /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-2~14.04-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
Run Code Online (Sandbox Code Playgroud)
我正在使用gradle 3.4.1生成jar,如下所示:
/opt/gradle-3.4.1/bin/gradle jar -Dorg.gradle.java.home=/usr/lib/jvm/java-1.8.0-openjdk-amd64/
下面是模块级build.gradle文件中定义的依赖项:
dependencies {
compile files("$TOOLCHAIN_VERSION_DIR/lib/commons-io-2.6.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/grpc-all.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/java-protobuf.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/jetty.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/log4j-core-2.8.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/log4j-slf4j-impl-2.8.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/netty-tcnative-boringssl-static-2.0.20.Final.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/netty-tcnative-2.0.20.Final.jar")
compile files("$TOOLCHAIN_VERSION_DIR/lib/picocli-3.8.2.jar")
compile group: 'com.google.guava', name: 'guava', version: '20.0'
compile files("$TOOLCHAIN_VERSION_DIR/lib/javassist-3.19.0-GA.jar")
compile project(':annotation')
}
Run Code Online (Sandbox Code Playgroud)
构建后,我在AIX7.2机器上运行jar,如下所示:
/usr/java8_64/jre/bin/java -jar agent-1.0.jar
AIX机器上的Java版本如下:
$ /usr/java8_64/jre/bin/java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 8.0.5.26 - pap6480sr5fp26-20181115_03(SR5 …Run Code Online (Sandbox Code Playgroud) 让我说我有一个这样的词是"I shoot someone using ak47 and m4s 32 times"
什么是删除纯号码的最佳方法,这样我才会得到"I shoot someone using ak47 and m4s times"
如果有人能教我怎么做,我会很高兴.
我有一个变量,例如 myVar,在 build.gradle 中定义。我想在某个 .java 文件中访问此变量,该文件是同一项目的一部分。我知道我们可以在 android 中使用buildTypesblock 来做到这一点。但我在IntelliJ IDEA中有一个非android项目,所以无法使用它。我确实遇到了一个插件https://github.com/mfuerstenau/gradle-buildconfig-plugin它可以让我做到这一点。但我不想依赖第三方插件。我还了解了如何通过将值设置为系统属性然后使用 .java 在 .java 中访问它来实现此目的System.getenv()。但是,我不想改变系统级的东西。知道如何做到这一点吗?
java ×4
gradle ×2
adb ×1
aix ×1
android ×1
build.gradle ×1
device-owner ×1
dfa ×1
gcc ×1
grpc ×1
ibm-jdk ×1
int ×1
kleene-star ×1
macos ×1
matplotlib ×1
netbeans ×1
netty ×1
php ×1
python ×1
regex ×1
sml ×1
smlnj ×1
str-replace ×1
sympy ×1
valgrind ×1