小编Rya*_*yan的帖子

如何在Linux或Macos中为Windows编译静态.lib库

我正在寻找方式编译静态库for Windows中的Linux或者MacOS,似乎有交叉编译器生成类似的Windows .A库这一块,但是这不是我想要的,我要的是一个静态的.LIB库文件适用于Windows,最好适用于Visual Studio.我知道我可以运行Windows虚拟机并使用Visual Studio,但这太重了,无法在命令行中完成.

c linux windows macos static-libraries

6
推荐指数
1
解决办法
4074
查看次数

Nginx 位置正则表达式捕获变量

我有这个 REST API URL:

http://localhost:4000/api/v2/stocks/accounts/1162/tradings
Run Code Online (Sandbox Code Playgroud)

我希望它 proxy_pass 到 URL:

http://localhost:4001/api/v2/stocks/accounts/1162/tradings
Run Code Online (Sandbox Code Playgroud)

其中1162是URL参数,可以是其他值。

我有以下内容:

location ^~ /api/v2/stocks/accounts/([^/]+)/tradings {
      proxy_pass http://localhost:4001/api/v2/stocks/accounts/$1/tradings;
}
Run Code Online (Sandbox Code Playgroud)

但它不起作用(404 Not Found),我用谷歌搜索了类似的问题,但没有太多帮助:

像这个:获取参数 Nginx 和 proxy_pass 的路径或这个:trouble with location regex and redirection in nginx。

有什么办法可以使用 nginx 来实现我想要的吗?

预先感谢您的任何帮助。

添加:

我还添加了参数捕获:

location ~ /api/v2/stocks/accounts/([^/]+)/tradings/(.*) {
    proxy_pass http://localhost:4001/api/v2/stocks/accounts/$1/tradings/$2$is_args$args;
}
Run Code Online (Sandbox Code Playgroud)

regex nginx http-proxy

5
推荐指数
1
解决办法
1万
查看次数

如何在C语言中将浮点变量初始化为无穷大?

我想用C语言将一个变量初始化为正无穷大或负无穷大,我该怎么做?以下失败:

浮动 plus_inf = 0.0/0.0;

c floating-point initialization

3
推荐指数
1
解决办法
2753
查看次数