小编Jar*_*děk的帖子

Git 错误未找到匹配的主机密钥类型。他们的报价:ssh-rsa

使用时出现以下错误git

$ git pull
Unable to negotiate with 172.16.42.42 port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

git ssh rsa ssh-keys

221
推荐指数
8
解决办法
37万
查看次数

评论Bash脚本

如何从脚本中评论以下几行的每一行?

cat ${MYSQLDUMP} | \
sed '1d' | \
tr ",;" "\n" | \
sed -e 's/[asbi]:[0-9]*[:]*//g' -e '/^[{}]/d' -e 's/""//g' -e '/^"{/d' | \
sed -n -e '/^"/p' -e '/^print_value$/,/^option_id$/p' | \
sed -e '/^option_id/d' -e '/^print_value/d' -e 's/^"\(.*\)"$/\1/' | \
tr "\n" "," | \
sed -e 's/,\([0-9]*-[0-9]*-[0-9]*\)/\n\1/g' -e 's/,$//' | \
sed -e 's/^/"/g' -e 's/$/"/g' -e 's/,/","/g' >> ${CSV}
Run Code Online (Sandbox Code Playgroud)

如果我尝试添加评论说" cat $ {MYSQLDUMP} |\#Output MYSQLDUMP File ",我得到:

删除:未找到

是否有可能在这里发表评论,因为" __CODE__"?

syntax bash comments

152
推荐指数
6
解决办法
32万
查看次数

Python:如何在 MediaPipe 中获取 Face Mesh 地标坐标?

我正在尝试使用MediaPipe的 Face Mesh获取包含地标坐标的列表。例如:Landmark[6]: (0.36116672, 0.93204623, 0.0019629495)

我找不到方法来做到这一点,非常感谢您的帮助。

python facial-landmark-alignment mediapipe

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

类型错误:类型元组无法实例化;使用 tuple() 代替

我用以下代码编写了一个程序:

import pandas as pd
import numpy as np
from typing import Tuple

def split_data(self, df: pd.DataFrame, split_quantile: float) -> Tuple(pd.DataFrame, pd.DataFrame):
    '''Split data sets into two parts - train and test data sets.'''
    df = df.sort_values(by='datein').reset_index(drop=True)
    quantile = int(np.quantile(df.index, split_quantile))
    return (
        df[df.index <= quantile].reset_index(drop=True),
        df[df.index > quantile].reset_index(drop=True)
    )
Run Code Online (Sandbox Code Playgroud)

程序返回以下错误:TypeError: Type Tuple cannot be instantiated; use tuple() instead. 我明白了,我可以通过更换解决我的代码Tuple(pd.DataFrame, pd.DataFrame)tuple(),但我失去的信息的一部分,我的元组将包括两只大熊猫的数据帧。

请您帮帮我,如何解决错误并同时不丢失信息?

python typing python-3.x

14
推荐指数
1
解决办法
5095
查看次数

R 中是否有相当于 Python 中 range 的函数?

我希望将一个字符串拆分为 3 个字符的 ngram - 例如 HelloWorld 将变为“Hel”、“ell”、“llo”、“loW”等 我如何使用 R 来实现这一点?

在Python中,它需要使用范围函数进行循环 - 例如[myString[i:] for i in range(3)]

有没有一种巧妙的方法可以使用循环遍历字符串的字母stringr将单词标记为向量?

例如

dfWords <- c("HelloWorld", "GoodbyeMoon", "HolaSun") %>% 
              data.frame()
names(dfWords)[1] = "Text"
Run Code Online (Sandbox Code Playgroud)

我想生成一个新列,其中包含标记化文本变量的向量(最好使用dplyr)。然后可以稍后将其拆分为新的列。

string r stringr

13
推荐指数
2
解决办法
7789
查看次数

jquery表单没有按预期工作.ajaxForm不是一个函数

我试图使用jquery形式,但它在concole ajaxForm不是一个函数.正确包含了jquery.form.js,代码在文档就绪函数中...

这是脚本:

$("#apply-form").ajaxForm({

                beforeSend: function()
                {
                    $("#progress").show();
                    //clear everything
                    $("#bar").width('0%');
                    $("#message").html("");
                    $("#percent").html("0%");
                },
                uploadProgress: function(event, position, total, percentComplete)
                {
                    $("#bar").width(percentComplete+'%');
                    $("#percent").html(percentComplete+'%');

                },
                success: function()
                {
                    $("#bar").width('100%');
                    $("#percent").html('100%');

                },
                complete: function(response)
                {
                    $("#message").html("<font color='green'>"+response.responseText+"</font>");
                },
                error: function()
                {
                    $("#message").html("<font color='red'> ERROR: unable to upload files</font>");

                }
            });
Run Code Online (Sandbox Code Playgroud)

这是HTML表单

<form id="apply-form" enctype="multipart/form-data" method="post" action="">


    <table>
                <tr><td>CV:</td>
                    <td>
                        <input type="file" name="cover">
                    </td>
                </tr>
                <tr><td>Cover Letter:</td>
                    <td>
                        <input type="file" name="curriculum">
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <div id="progress">
                            <div id="bar"></div>
                            <div id="percent">0%</div >
                        </div> …
Run Code Online (Sandbox Code Playgroud)

forms ajax jquery jquery-forms-plugin ajaxform

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

Pandas groupby分位数值

我试图从数据帧计算特定的分位数值,如下面的代码所示.在单独的行中计算它没有问题.

当试图运行最后2行时,我收到错误"AttributeError:'SeriesGroupBy'对象没有属性'分位数(0.25)'".我怎样才能解决这个问题?

AttributeError: 'SeriesGroupBy' object has no attribute 'quantile(0.25)'
Run Code Online (Sandbox Code Playgroud)

python pandas

10
推荐指数
2
解决办法
9528
查看次数

aws cdk 将映像推送到 ecr

我正在尝试做一些看起来相当合乎逻辑且直接的事情。

我正在使用 AWS CDK 来配置 ecr 存储库:

repository = ecr.Repository(
    self, 
    id="Repo", 
    repository_name=ecr_repo_name,
    removal_policy=core.RemovalPolicy.DESTROY
)
Run Code Online (Sandbox Code Playgroud)

然后,我有一个 Dockerfile,它位于我的项目的根目录中,我试图将其推送到部署中的同一个 ECR 存储库。

我在相同的服务代码中执行此操作:

assets = DockerImageAsset(
    self, 
    "S3_text_image", 
    directory=str(Path(__file__).parent.parent),
    repository_name=ecr_repo_name
)
Run Code Online (Sandbox Code Playgroud)

部署正常并继续进行,并创建了 ECR 存储库,但映像被推送到默认位置aws-cdk/assets

如何让部署将我的 Dockerfile 发送到我希望它驻留的确切 ECR 存储库?

amazon-web-services docker amazon-ecr aws-cdk

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

类型错误:仅对 DatetimeIndex、TimedeltaIndex 或 PeriodIndex 有效,但得到了“RangeIndex”的实例,我不知道为什么

我在熊猫中有这个数据框

        key                              date  story_point  Story point
0   SOF-158  2019-06-04 09:51:01.143000+02:00          3.0          3.0
1   SOF-152  2019-05-24 09:10:23.483000+02:00          3.0          3.0
2   SOF-151  2019-05-24 09:10:14.978000+02:00          3.0          3.0
3   SOF-150  2019-05-24 09:10:23.346000+02:00          3.0          3.0
4   SOF-149  2019-05-24 09:10:23.024000+02:00          3.0          3.0
5   SOF-148  2019-05-24 09:10:23.190000+02:00          3.0          3.0
6   SOF-146  2019-05-24 09:10:22.840000+02:00          5.0          5.0
7   SOF-142  2019-04-15 10:50:03.946000+02:00          2.0          2.0
8   SOF-141  2019-03-29 10:54:08.677000+01:00          2.0          2.0
9   SOF-139  2019-04-15 10:44:56.033000+02:00          3.0          3.0
10  SOF-138  2019-04-15 10:48:53.874000+02:00          3.0          3.0
11  SOF-129  2019-03-28 11:56:17.221000+01:00          5.0          5.0
12  SOF-128 …
Run Code Online (Sandbox Code Playgroud)

python python-3.x pandas

8
推荐指数
1
解决办法
8359
查看次数

ModuleNotFoundError:没有名为“rest_framework_simplejwt.token_blacklistauthentication”的模块

我遇到了由 simplejwt 框架引起的错误。

ModuleNotFoundError: No module named 'rest_framework_simplejwt.token_blacklistauthentication'
Run Code Online (Sandbox Code Playgroud)

我想将使用过的刷新令牌列入黑名单(刷新后)。simplejwt 工作完美,但似乎存在一个由以下原因引起的问题'rest_framework_simplejwt.token_blacklist'

这是我的rest_framework配置:

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAuthenticated', 
     ],
      'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework_simplejwt.authentication.JWTAuthentication',
    ]
}
Run Code Online (Sandbox Code Playgroud)

django-rest-framework django-rest-framework-simplejwt

8
推荐指数
2
解决办法
2万
查看次数