小编Dan*_*dio的帖子

有什么方法可以提高PostgreSQL 8中正则表达式查询的性能?

我正在character varying(256)PostgreSQL 8.3.3中的类型列上执行正则表达式匹配.该列目前没有索引.如果可以的话,我想提高这个查询的性能.

添加索引会有帮助吗?还有其他我可以尝试帮助提高性能的东西吗?

regex sql postgresql performance

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

使用rpm --scripts -qp查看RPM脚本

运行时,rpm -qlp我将获得RPM的文件内容,如下所示,但是运行时,我将rpm --scripts -qp CBS0.0.0_10.0.i386.rpm获取脚本的内容,而不是脚本的文件名。

我的问题是为什么我不能在RPM内容中看到脚本名称(即,脚本来自何处?)

$ rpm -qlp CS0.0.0_10.0.i386.rpm

/home/thy_diff/rt
/home/thy_diff/rt/Cerse-zip
/home/thy_diff/rt/Configure_rht.properties
/home/thy_diff/rt/UFE_Install.sh
/home/thy_diff/M_client
/home/thy_diff/M_client/Crse-CLIENT.zip
/home/thy_diff/M_client/Configure_client.properties
/home/thy_diff/M_client/UF_Install.sh
Run Code Online (Sandbox Code Playgroud)

linux

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

Hibernate JPA 如何在persistence.xml 中配置动态更新

我不想在我的 java 源代码中进行配置,可以这样做:

@org.hibernate.annotations.Entity(
        dynamicUpdate = true) 
Run Code Online (Sandbox Code Playgroud)

因为我希望它是可配置的。

我不使用 hibernate.properties,只使用 persistence.xml,因为我使用的是 JPA。我怎样才能使dynamicUpdate作为true使用的所有实体persistence.xml只?

hibernate jpa persistence.xml

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

当我执行git push/git pull时,是否可以让git自动更新远程服务器上的注释

目前,如果我在git中向对象添加注释,我必须明确地将此信息推送/拉到远程服务器.

是否可以配置git,这样当我执行git push它时,它会推送我的本地笔记更改以及任何本地源更改?

同样对于git pull.

git git-notes

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

JRE 7 SSL异常UnsupportedOperationException

我有一个小程序试图从特定的HTTPS URL获取内容.我使用了以下示例代码:

URL url = new URL(urlLink);

URLConnection urlConn = (URLConnection)url.openConnection(); //https:link
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);

urlConn.setRequestProperty("Accept-Language","en");
urlConn.setAllowUserInteraction(false);
urlConn.setRequestProperty("Content-length",String.valueOf(data.length()));
urlConn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");

DataOutputStream out=new DataOutputStream(urlConn.getOutputStream());
out.writeBytes(data);
out.flush();
out.close();
Run Code Online (Sandbox Code Playgroud)

我间歇性地收到以下异常:

*** ServerHelloDone
[read] MD5 and SHA1 hashes:  len = 4
0000: 0E 00 00 00                                        ....
AWT-EventQueue-2, handling exception: java.lang.UnsupportedOperationException
%% Invalidated:  [Session-6, SSL_RSA_WITH_RC4_128_MD5]
AWT-EventQueue-2, SEND TLSv1 ALERT:  fatal, description = internal_error
AWT-EventQueue-2, WRITE: TLSv1 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 01 00 02 02 50                               ......P
AWT-EventQueue-2, …
Run Code Online (Sandbox Code Playgroud)

ssl sslexception

5
推荐指数
0
解决办法
1204
查看次数

Django + Boto + Python 3

如何在 EC2 Amazon Linux 上使用 Python 3 在 S3 上存储我的 Django 上传文件?如果不能,如果我使用 ELB,如何在 2 个 EC2 实例之间共享上传的文件?

我尝试使用 django-storages-py3 + boto#py3kport 但它不起作用,当我尝试上传文件时,出现异常: string expected bytes given

更新:

这就是我如何使用 django-storages-py3 + boto#py3kport

from django.core.files.storage import default_storage

fd = default_storage.open('%s/%s' % ('uploadstg', str(filename)), 'wb')
for chunk in file.chunks():
    fd.write(chunk)
fd.close()
Run Code Online (Sandbox Code Playgroud)

fd - S3BotoStorageFile:uploadstg/a6d2532d-34c9-4793-9d43-e9a3e475fc6f.png

文件 - InMemoryUploadedFile: 1.png (image/png)

追溯

Environment:


Request Method: POST
Request URL: http://---/items/Tpp/create/

Django Version: 1.6.1
Python Version: 3.3.3
Installed Applications:
('django.contrib.admin',
 'haystack',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites', …
Run Code Online (Sandbox Code Playgroud)

python django amazon-s3 boto amazon-web-services

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

如何配置Sonar和Maven多级模块?

我遇到了为Sonar Analysis配置多级maven模块的问题.

它具有以下结构:

parent module
  |- level 1
       |- module with code to analyze
Run Code Online (Sandbox Code Playgroud)

但是,如果我使用要分析的代码向模块添加深度,我将无法对其进行配置.

parent module
  |- level 1
       |- level 2
           |- module with code to analyze
Run Code Online (Sandbox Code Playgroud)

我尝试了几种配置:

  1. 没有特殊配置:我收到Can not execute SonarQube analysis: The project 'level 2' is already defined in SonarQube but not as a module of project 'level 1'. If you really want to stop directly analysing project 'level 2', please first delete it from SonarQube and then relaunch the analysis of project 'level 1'. …

sonarqube

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

Gitlab API:如何在root/namespace上创建项目?

我们在我们的办公室有一个gitlab设置,我希望能够通过命令行在其上创建项目我一直在使用http curl这样做,但它总是使我的名字上的项目,而不是在root上[ /]命名空间

curl --header "PRIVATE-TOKEN: 5xgss2ZZNcaWp4Hd" --data "name=testcurl9" http://192.168.1.91/gitlab/api/v3/projects
Run Code Online (Sandbox Code Playgroud)

我真的没有线索,因为gitlabhq api似乎没有任何选择

git gitlab

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

如何在 `aws-cli ec2` 命令中使用通配符?

我有一些 EC2 实例。我想使用该ec2 describe-instances命令根据标签的特定值获取实例列表。

该表显示了我的用例。

Instance  | Value (key:Purpose)     | Outcome
----------+-------------------------+------------
InstanceA | Going                   | Filter
InstanceB | Shopping,Going          | Filter
InstanceC | Going,Shoping           | Filter
InstanceD | Shopping,Going,Chatting | Filter
InstanceE | GoingGreat              | DONT Filter
InstanceF | NotGoing                | DONT Filter
Run Code Online (Sandbox Code Playgroud)

所以我想以某种方式在 ec2-describe-instances 命令中使用通配符,以便获得预期的结果。

amazon-ec2 amazon-web-services aws-cli

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

AWS RDS过滤器的语法describe-db-instances

当我们使用过滤器运行命令时,出现错误:

$ aws rds describe-db-instances --filters Name=instance-state-name,Values=running

An error occurred (InvalidParameterValue) when calling the
DescribeDBInstances operation: Unrecognized filter name: instance-state-name.
Run Code Online (Sandbox Code Playgroud)

使用过滤器的正确语法是什么aws rds describe-db-instances

amazon-web-services amazon-rds aws-cli

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