小编Min*_*sha的帖子

docker 中的 pgadmin-4 因 Gunicorn 服务器启动错误而失败

我正在尝试在 docker 中运行 pgadmin,如下所示,并在启动 Gunicorn 20.0.4 错误时出现异常。有解决这个问题的指示吗?

docker run -p 80:80  -e "PGADMIN_DEFAULT_EMAIL=email@domain.com" -e "PGADMIN_DEFAULT_PASSWORD=postgres" -d dpage/pgadmin4
Run Code Online (Sandbox Code Playgroud)

Docker 日志

NOTE: Configuring authentication for SERVER mode.
[2021-08-13 03:03:04 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2021-08-13 03:03:04 +0000] [1] [ERROR] Retrying in 1 second.
[2021-08-13 03:03:05 +0000] [1] [ERROR] Retrying in 1 second.
[2021-08-13 03:03:06 +0000] [1] [ERROR] Retrying in 1 second.
[2021-08-13 03:03:07 +0000] [1] [ERROR] Retrying in 1 second.
[2021-08-13 03:03:08 +0000] [1] [ERROR] Retrying in 1 second.
[2021-08-13 03:03:09 …
Run Code Online (Sandbox Code Playgroud)

docker pgadmin-4

11
推荐指数
1
解决办法
3923
查看次数

私有区块链与Hashgraph,Ripple,BigChainDb

我一直在调查一些用例的不同区块链.最后,我得出的结论是,设置私有区块链相当于拥有一个分布式数据库,其中包含不可变性,数字签名等区块链概念.例如:Bigchaindb.(好吧,如果我们确实需要智能合约功能,那么分布式数据库可能无效)

从理论上讲,哈希图一致性算法对于公共链来说看起来不够安全.它看起来像是Ripple的紧密替代版本.

综上所述,

  1. Hashgraph,Ripple适合私人连锁店.
  2. 专用链等同于设置分布式数据库

在这里,我分享我的观点,了解私有链以何种方式优于分布式数据库?

ripple blockchain ethereum bigchaindb

7
推荐指数
1
解决办法
490
查看次数

Python 3:ResourceWarning:未关闭的文件<_io.TextIOWrapper name ='PATH_OF_FILE'

当我使用“ python normalizer / setup.py test”在python中运行测试用例 时,出现以下异常

 ResourceWarning: unclosed file <_io.TextIOWrapper name='/Users/workspace/aiworkspace/skillset-normalization-engine/normalizer/lib/resources/skills.taxonomy' mode='r' encoding='utf-8'>
Run Code Online (Sandbox Code Playgroud)

在代码中,我正在读取一个大文件,如下所示:

def read_data_from_file(input_file):
    current_dir = os.path.realpath(
        os.path.join(os.getcwd(), os.path.dirname(__file__)))
    file_full_path = current_dir+input_file
    data = open(file_full_path,encoding="utf-8")
    return data
Run Code Online (Sandbox Code Playgroud)

我想念什么?

python io file python-3.x

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

自定义ClassLoader,如何使用?

我正在尝试使用自定义类加载器来加载应用程序所需的所有依赖项。我已经在网站上实现了 customerClassLoader:https : //www.javacodegeeks.com/2013/03/java-handmade-classloader-isolation.html

但是,我不明白如何告诉我的应用程序在需要时使用自定义 classLoader。

例如:让我们说,我有一种方法来发出 http 请求,如下所示。如何告诉应用程序使用自定义 classLoader 加载所需的 jars?

private HttpResponse get() {
    HttpClient client = HttpClientBuilder.create().build();
    HttpGet request = new HttpGet(url);
    HttpResponse response = client.execute(request);
    return response;
}
Run Code Online (Sandbox Code Playgroud)

java classloader dynamic-class-loaders

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

Fortify 无法识别 lambda

死代码:未使用的方法

Fortify 正在检测 lambda 方法是否未使用。例如:我有以下方法:getCountryCode,尽管它在很多地方使用,但 fortify 将其报告为未使用的方法。

private List<String> getCountryCodeAsList(Map<Long, String> countryData, List<String> nationalityRestriction) {
    return nationalityRestriction.parallelStream().filter(r -> !org.apache.commons.lang3.StringUtils.isBlank(r))
            .map(r -> getCountryCode(countryData, r)).collect(Collectors.toList());
}

private String getCountryCode(Map<Long, String> countryData, String r) {
    return !org.apache.commons.lang3.StringUtils.isBlank(r) ? countryData.get(Long.parseLong(r)): null;
}
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?有什么指点吗?

java java-8 fortify

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

在 swagger-ui docker 中更改试用网址

我试图用 docker 为我的应用程序连接 swagger-ui,“try-it-out” url 指向 localhost:8080,有没有办法指定 try url?下面是我的 docker-compose 配置。

swagger:
    image: "swaggerapi/swagger-ui"
    depends_on:
      - application-xxx
    deploy:
      replicas: 1
      restart_policy:
        condition: always
    ports:
      - "8080:8080"
    environment:
      - API_URL= http://0.0.0.0:52204/swagger.json
Run Code Online (Sandbox Code Playgroud)

这是我一直在使用的 docker 镜像:https : //hub.docker.com/r/swaggerapi/swagger-ui/

java swagger swagger-ui

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

在 Azure 中,如何更改服务器的身份验证?

在启动 linux 虚拟机时,我选择了身份验证类型作为密码。现在我想更改为 ssh。如何实现这一目标?

谢谢

azure

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

Apache Commons CSV 解析器:无法读取值

我正在使用 apache commons CSV 解析器将 CSV 转换为地图。在地图中,我无法通过 intellij 调试器读取某些值。如果我手动输入map.get(“key”),则该值为空。但是,如果我从地图上复制粘贴密钥,我就会获取数据。无法理解出了什么问题。任何指示都会有所帮助。谢谢

这是我的 CSV 解析器代码:

 private CSVParser parseCSV(InputStream inputStream) {
        System.out.println("What is the encoding "+ new InputStreamReader(inputStream).getEncoding());
        try {
            return new CSVParser(new InputStreamReader(inputStream), CSVFormat.DEFAULT
                    .withFirstRecordAsHeader()
                    .withIgnoreHeaderCase()
                    .withSkipHeaderRecord()
                    .withTrim());
        } catch (IOException e) {
            throw new IPRSException(e);
        }
    }
Run Code Online (Sandbox Code Playgroud)

java-8 apache-commons-csv

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