考虑代码:
public static void main(String[] args) {
System.out.println(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH")));
}
Run Code Online (Sandbox Code Playgroud)
输出为2022-05-04-17UTC 时间2022-05-04-10。文档说这LocalDateTime是没有区域偏移的 - 那么为什么会有 7 小时轮班呢?(我当地的时区是+7UTC)
我正在尝试在命令提示符下运行:
sc create mynewservice binpath="C:\Program Files\Arelle\arelleCmdLine.exe" --webserver localhost:10100
这不会成功,因为:optionname中有.
我似乎无法找到正确的合成语
我搜索了以下受欢迎的库:
所有方法都将整个文件作为String集合读入内存.但这对于拥有数千行的大型文件没有用处?是否有一个简单的方法调用来读取n任何这些库中的文件的第一行?
这是演员代码:
import akka.actor.Actor
class OneActor extends Actor {
def receive = {
//what I should call here to get ?
case _ => println(physicalPaht)
}
}
Run Code Online (Sandbox Code Playgroud)
我可以使用一些"内置"变量:
有任何想法吗?
更新
也是一个self.path.address但它只返回root actor的路径.
我已经开始配置工作站这个步骤(OS redhat 6.5).我已经启动了一个节点.我修改了这样的食谱:
myCookbook/metadata.rb
name 'myCookbook'
maintainer 'YOUR_COMPANY_NAME'
maintainer_email 'YOUR_EMAIL'
license 'All rights reserved'
description 'Installs/Configures myCookbook'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
depends 'maven'
Run Code Online (Sandbox Code Playgroud)
例如,执行depends 'maven'后只添加了字符串knife cookbook create myCookbook.
myCookbook /食谱/ default.rb
maven 'spring-context' do
group_id 'org.springframework'
version '4.0.4.RELEASE'
dest '/root/chef-repo/'
repositories ['http://repo.maven.apache.org/maven2/']
end
Run Code Online (Sandbox Code Playgroud)
然后我跑:
knife cookbook upload myCookbook
Run Code Online (Sandbox Code Playgroud)
现在我想:
knife bootstrap 192.168.1.37 --ssh-user root --ssh-password '123456' --sudo --use-sudo-password --node-name node-with-maven-run --run-list 'recipe[myCookbook]'
Run Code Online (Sandbox Code Playgroud)
得到:
ERROR: Cookbook myCookbook depends on cookbooks which are not currently …Run Code Online (Sandbox Code Playgroud) 在scala中,你可以将未来的集合"映射"到集合的未来:
val l: List[Future[String]] = List(Future {"1"}, Future {"2"})
val x: Future[List[String]] = Future.sequence(l)
Run Code Online (Sandbox Code Playgroud)
如何用kotlin同样的事情?
对于pojo课程:
//java
MyClass.getClass();
//kotlin
MyClass::class.java
Run Code Online (Sandbox Code Playgroud)
但是如何从数组中获取getClass?
//java
MyClass[].class;
//kotlin
???
Run Code Online (Sandbox Code Playgroud)
MyClass[]::class.java - 不起作用:(
我已经实现了Long字段和@PastOrPresent验证的验证
public class PastOrPresentValidator implements ConstraintValidator<PastOrPresent, Long>{
@Override
public boolean isValid(Long value, ConstraintValidatorContext context) {
if (value == null) {
return false;
}
return value <= System.currentTimeMillis();
}
}
public class MyDto {
@PastOrPresent
Long timestamp;
}
Run Code Online (Sandbox Code Playgroud)
并得到错误:
HV000030: No validator could be found for constraint 'javax.validation.constraints.PastOrPresent' validating type 'java.lang.Long'. Check configuration for 'push.dto.timestamp'
Run Code Online (Sandbox Code Playgroud)
但是当我创建自定义注释@PastOrPresentLong并使用相同的验证器代码时,一切正常。
有没有办法为javax.validation.constraints注释添加自定义验证器?
考虑示例(来源)
# State machine for testing Athena Runner
AthenaRunnerTestETLOrchestrator:
Type: "AWS::StepFunctions::StateMachine"
Properties:
StateMachineName: AthenaRunnerTestETLOrchestrator
DefinitionString:
Fn::Sub:
- |-
{
"StartAt": "Configure Athena Query",
"States": {
"Configure Athena Query":{
"Type": "Pass",
"Result": "{ \"AthenaQueryString\" : \"SELECT * FROM ${GlueTableName} limit 10;\", \"AthenaDatabase\": \"${GlueDatabaseName}\", \"AthenaResultOutputLocation\": \"${AthenaResultOutputLocation}\", \"AthenaResultEncryptionOption\": \"${AthenaResultEncryptionOption}\"}",
"Next": "Execute Athena Query"
},
"Execute Athena Query":{
"Type": "Task",
"Resource": "${AthenaRunnerActivityArn}",
"End": true
}
}
}
- {
GlueDatabaseName: !Ref MarketingAndSalesDatabaseName,
GlueTableName: !Ref MarketingTableName,
AthenaRunnerActivityArn: !Ref AthenaRunnerActivity,
AthenaResultOutputLocation: !Sub "s3://${SourceDataBucketName}/athena-runner-output/",
AthenaResultEncryptionOption: …Run Code Online (Sandbox Code Playgroud)