我正在尝试解析DNA蛋白文件.我想提取一定数量的信息.我想解析只有当行以"ATOM"开头并且在第四列的末尾有G,A,T,C时才解析.例如,在下面的片段中,DG将被解析,因为它最后有一个G. 然后将该行保存在文件中.我正在使用bash.你会用什么来做这个?grep,find,sed,awk或某种正则表达式?
谢谢你的帮助!
HETATM 103 HG22 MVA A 8 4.999 -1.260 2.090 1.00 0.00 H
HETATM 104 HG23 MVA A 8 5.639 -2.810 2.604 1.00 0.00 H
TER 105 MVA A 8
ATOM 106 O5' DG C 11 -12.710 1.571 -11.945 1.00 0.00 O
ATOM 107 C5' DG C 11 -13.491 2.438 -11.111 1.00 0.00 C
Run Code Online (Sandbox Code Playgroud)
除了原始问题:
计算总数和个别G,A,T,C?将计算的总数输出到文件中,作为总行数,总计G,总计T,总计A,总计C.
在文件上工作需要使用H:MM:SS格式的时间戳来grep该行.我尝试了以下egrep '[0-9]\:[0-9]\:[0-9]'.不适合我.我在正则表达式中做错了什么?
我是弹性搜索的新手.我的用例是在一些XML文件集中搜索文本.所以我的问题是.
我尝试了以下方法:
安装了Elastic搜索,应用了附件插件
创建了一个映射:
curl -XPUT 'http://localhost:9200/second/?pretty=1' -d '
{
"mapping" : {
"xmlfile" : {
"properties" : {
"attachment": { "type" : "attachment" }
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
索引XML文件:
curl -XPOST "http://localhost:9200/second/xmlfile?pretty=1" -d '
{
"file" : "'`base64 D:\\games.xml | perl -pe 's/\n/\\n/g'`'"
}
Run Code Online (Sandbox Code Playgroud)
试过搜索:
curl -XGET 'http://localhost:9200/second/xmlfile/_search?pretty=1' -d '
{
"query" : {
"text" : {
"file" : "curField" //currField is a string inside my xml
}
}
}
Run Code Online (Sandbox Code Playgroud)
上面的搜索给了我SearchNotFound Exception所以id
curl -XGET 'http://localhost:9200/second/xmlfile/_search?pretty=1' -d '
{ …Run Code Online (Sandbox Code Playgroud) 如果我在IMAP服务器上轮询一个Envelope结构SELECT INBOX, FETCH UID ALL- 我会得到一个信封结构作为回报.
对于信封结构中的所有字段,如电子邮件地址,发件人,回复等,我注意到这是电子邮件地址的表示方式:
(("Name on Email Account" NIL "emailaddress" "domain.com"))
Run Code Online (Sandbox Code Playgroud)
或者没有设置电子邮件名称的帐户 -
((NIL NIL "emailaddressnoname" "domain.com"))
Run Code Online (Sandbox Code Playgroud)
我可以看到第一个值是名称,第三个值是电子邮件地址名称,第四个值是域名 - 但第二个值是什么?我已经对来自许多不同IMAP服务器的数百封电子邮件进行了调查,这个值总是为NIL而且我担心有一天它不会是NIL而且会破坏我的解析代码.
在定义Envelope结构的RFC部分(https://tools.ietf.org/html/rfc822)中没有提到这一点.
谁知道发生了什么事?
我正在http://wiki.alpinelinux.org/wiki/Setting_Up_Lighttpd_With_FastCGI上关注Alpine linux上的文件,但我在复制第一个命令时遇到问题:
apk add lighttpd php-common php-iconv php-json php-gd php-curl php-xml php-pgsql php-imap php-cgi fcgi
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
ERROR: unsatisfiable constraints:
lighttpd (missing):
required by: world[lighttpd]
php-cgi (missing):
required by: world[php-cgi]
php-common (missing):
required by: world[php-common]
php-curl (missing):
required by: world[php-curl]
php-gd (missing):
required by: world[php-gd]
php-iconv (missing):
required by: world[php-iconv]
php-imap (missing):
required by: world[php-imap]
php-json (missing):
required by: world[php-json]
php-pgsql (missing):
required by: world[php-pgsql]
php-xml (missing):
required by: world[php-xml]
scw-f9c40f:~# apk add lighttpd
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我有一个具有以下结构的 dynamodb 表:
{
accountId: string,//PRIMARY KEY
userId: string,//SORT KEY
email: string,
dateCreated: number // timestamp
}
Run Code Online (Sandbox Code Playgroud)
我想执行一项操作,从表中删除具有重复电子邮件的所有项目,但具有最旧 dateCreated 属性的项目除外。
在 DynamoDB 中可以执行此操作吗?
谢谢
因此,我有一个用户,其 IAM 权限设置为以下内容。它意味着只允许他们创建/删除/列表/等。存储桶的“Target_Folder/”中的对象。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt123456789",
"Effect": "Allow",
"Action": [
"s3:CreateBucket",
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::bucket/Target_Folder/*"
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
使用 boto3,我将相关的 aws_access_key_id 和 aws_secret_access_key 嵌入到配置中。执行此操作后,我发现我无法在“/Target_Folder/”中执行任何操作,例如:
import boto3
import boto.s3.transfer
#Need to manually import S3Transfer() for some reason.
from boto.s3.transfer import S3Transfer
bucket = 'bucket'
prefix = 'Test_Folder/'
client = boto3.client(s3)
#Attempt to print objects under the Target_Folder
response = client.list_objects(Bucket = bucket, Prefix = prefix)
for file in response['Contents']:
print(file['key'])
#Attempt …Run Code Online (Sandbox Code Playgroud) 错误:“cognito_identity_providers.0.client_id 必须仅包含字母数字字符和下划线”
此问题来自 aws_cognito_identity_pool 资源上的 client_id 和 provider_name。我们从哪里得到这些值。Terraform 不遵循 AWS 命名。我已经尝试过 Pool id 和 Pool ARN。但那些不起作用我也试过应用程序客户端ID
下面文档中提供的示例不清楚
cognito_identity_providers {
client_id = "6lhlkkfbfb4q5kpp90urffae"
provider_name = "cognito-idp.us-east-1.amazonaws.com/us-east-1_Tv0493apJ"
server_side_token_check = false
}
Run Code Online (Sandbox Code Playgroud) 有可能在Azure功能测试版中,计时器有错误或我做错了什么?
我在应用程序设置中的cron计时器是这样的:
59 23 * * * *
Run Code Online (Sandbox Code Playgroud)
最后一次运行是在2018-02-21T17:23:59.0307645 + 00:00
如果我想在23:59每天都要设置cron计时器怎么办?
我试图测试运行我公司的 terraform 模块。
\n然后运行 terraform apply 出现以下错误。
\n\xe2\x95\xb7\n\xe2\x94\x82 Error: Missing required argument\n\xe2\x94\x82\n\xe2\x94\x82 The argument "domain" is required, but was not set.\n\nRun Code Online (Sandbox Code Playgroud)\n我搜索了所有项目文件夹,包括文件夹中的文件.terraform,但找不到该变量。
我如何知道哪个 terraform 脚本给出了该错误?
\n我试图在一行脚本中克隆和安装依赖项.git clone https://github.com/Study-Master/Java-WebSocket.git /tmp/socket && cd /tmp/socket && mvn install -Dmaven.test.skip=true这就是我输入的内容.但是这个命令将离开当前目录并/tmp/socket在执行后转到.有什么方法可以让我留在当前目录中.
我需要帮助以“递归”方式获取s3中的文件:
例如,我的s3结构如下:
My-bucket/2018/06/05/10/file1.json
My-bucket/2018/06/05/11/file2.json
My-bucket/2018/06/05/12/file3.json
My-bucket/2018/06/05/13/file5.json
My-bucket/2018/06/05/14/file4.json
My-bucket/2018/06/05/15/file6.json
Run Code Online (Sandbox Code Playgroud)
我需要获取给定存储桶的所有文件名的文件路径:
我尝试了以下方法,但对我没有用(返回的不是完整路径):
public List<String> getObjectsListFromFolder4(String bucketName, String keyPrefix) {
List<String> paths = new ArrayList<String>();
String delimiter = "/";
if (keyPrefix != null && !keyPrefix.isEmpty() && !keyPrefix.endsWith(delimiter)) {
keyPrefix += delimiter;
}
ListObjectsRequest listObjectRequest = new ListObjectsRequest().withBucketName(bucketName)
.withPrefix(keyPrefix).withDelimiter(delimiter);
ObjectListing objectListing;
do {
objectListing = s3Client.listObjects(listObjectRequest);
paths.addAll(objectListing.getCommonPrefixes());
listObjectRequest.setMarker(objectListing.getNextMarker());
} while (objectListing.isTruncated());
return paths;
}
Run Code Online (Sandbox Code Playgroud) 我已经多次见过,例如在UNIX上,在MySQL时间戳等中:Epoch从1970-1-1开始,但最大可记录年份是2038年.现在让我算一下:
2^32/60/60/24/365+1970
2106
Run Code Online (Sandbox Code Playgroud)
因此,如果我们使用完整的32位,我们自然会得到2106年没有任何问题.但显然,2038年仅对应31位.那么为什么我们抛出一点呢?通过使用完整的32位,我们可以希望我们不必解决问题,因为我们可能首先破坏地球......
对评论的反应:当然是因为它已签名,但为什么时间戳必须签名?这就是这个问题的重点.