小编use*_*883的帖子

Show the build duration time in Makefile

within in Make file, i can printed the time before the build start and finished.

myitem:
    printf 'start time is %s\n' "$$(date --iso-seconds)"
    #other build command, i.e. g++ xxxx.cpp
    printf 'end time is %s\n' "$$(data --iso-seconds)"

Is there any other way that implemented like below in Make file?

myitem:
    starttime = $$(date)
    #start my build
    printf "The build took time:" NowTime - startTime

makefile

6
推荐指数
2
解决办法
7548
查看次数

golang如何创建一个缓冲区来传递给C dll函数?

我需要从golang调用一个C API,它来自一个dll.问题是C函数需要一个缓冲区,如何在golang中创建缓冲区,那么我可以将缓冲区传递给C函数吗?

void fooGetString(char* buffer, int buffer length)
Run Code Online (Sandbox Code Playgroud)

go

5
推荐指数
2
解决办法
2964
查看次数

Spring 响应式的 Spring Security 会话超时

我有一个集成了 Spring Security 的反应式应用程序,它是由 spring initilizer 创建的,主要包含 3 个包(spring boot、spring security 和 webflux)。

我试图通过以下配置来配置会话超时application.properties

spring.session.timeout=1m
Run Code Online (Sandbox Code Playgroud)

使用 启动应用程序后mvn spring-boot:run,可以通过它访问它http://localhost:8080并要求我登录(默认安全设置)。我可以使用控制台上生成的用户名user和密码登录。

根据我的配置,我预计在 1 分钟空闲时间后,当我再次刷新页面时http://localhost:8080,它会要求我重新登录。但实际上并没有,直到30分钟后

所以我怀疑上面的配置不起作用

我使用了错误的配置吗?

重现存储库可以在这里找到: https: //github.com/ZhuBicen/ReactiveSpringSecurity.git

spring-security spring-boot spring-webflux

4
推荐指数
1
解决办法
7701
查看次数

如何使用Java泛型方法?

我正在从C ++迁移到Java。现在,我正在尝试泛型方法。但是编译器总是抱怨以下错误

对于类型T HelloTemplate.java / helloTemplate / src / helloTemplate,未定义方法getValue()

错误指向t.getValue()行据我了解,T是类MyValue,它具有方法getValue

怎么了?我该如何解决。我正在使用Java1.8

public class MyValue {

    public int getValue() {
       return 0;
    }
}

public class HelloTemplate {

    static <T> int getValue(T t) {
        return t.getValue();
    }
    public static void main(String[] args) {
       MyValue mv = new MyValue();
       System.out.println(getValue(mv));
   }

}
Run Code Online (Sandbox Code Playgroud)

java generics

2
推荐指数
1
解决办法
74
查看次数

在makefile中打印时间戳

我想测量make文件中每个构建项目的时间,我只是在下面尝试,为什么它不起作用?

mytest:
    $(info 'Now time is $(date --iso=seconds)')

日期不打印,只打印

'Now time is '
.有什么不对?

make --version GNU Make 3.81

makefile gnu-make

0
推荐指数
1
解决办法
4790
查看次数