罪#恶を代价

文章 评论 浏览 32

罪#恶を代价 2025-02-20 22:54:50

使用PIP降级Protobuf

pip install protobuf==3.20.*

注意:上面的*从字面上进行,它称为“通配符”。 根据需要将自己的号码放在其中,例如3.20.13.20.5等。

您可以 .com/esporate/72441758/typeError-descriptors-cannot-not-be-be-be-be-be-be-be-typeErlor:typeError:无法直接创建描述符

Downgrade protobuf using pip

pip install protobuf==3.20.*

Note: the * above is not to be taken literally, it's called a "wildcard". You put your own number in there as needed, as in 3.20.1, 3.20.5, etc.

This is similar to TypeError: Descriptors cannot not be created directly

如何降级Protobuf

罪#恶を代价 2025-02-20 17:30:23

我在您的代码中看不到问题。错误可能是由于错误设置的密码造成的。好吧,授权程序可能是不正确的。当我遇到相同的错误时,我确定这是问题并解决了。您可以尝试通过观看此视频。足以解决您的问题。)

I don't see a problem in your code. The error may be due to the incorrectly set password. Well, authorization procedures may be incorrect. When I got the same error, I determined that this was the problem and solved it. Can you try to fix the problem by watching this video. (Watching until 5:20 will be enough for your problem.)

php邮件无法正常工作。消息没有错误日志,消息说它已发送,但从未收到

罪#恶を代价 2025-02-19 22:33:41

get方法仅适用于文件,因此您的路径应为文件,而不是目录,

因此请

filepath = '/root/.aptos/myremotefile'
localpath = r'C:\Users\Tokyo\PycharmProjects\servers\mydirectory\myfile'

尝试

The get method is only for files, so your paths should be the to the files, not the directories

So try

filepath = '/root/.aptos/myremotefile'
localpath = r'C:\Users\Tokyo\PycharmProjects\servers\mydirectory\myfile'

instead

我试图通过SSH从服务器下载目录并出现错误,该如何解决?

罪#恶を代价 2025-02-19 21:43:22

我会说最好在大多数情况下使用 var

局部变量总是比全局范围中的变量快。

如果您不使用 var 声明变量,则该变量将在全局范围中。

有关更多信息,您可以在Google中搜索“范围链JavaScript”。

I would say it's better to use var in most situations.

Local variables are always faster than the variables in global scope.

If you do not use var to declare a variable, the variable will be in global scope.

For more information, you can search "scope chain JavaScript" in Google.

var关键字的目的是什么?我什么时候应该使用它(或省略)?

罪#恶を代价 2025-02-19 20:25:04

使用changeTectionsTrategy.default在您的所有组件上或使用不变的数据方法,例如

this.data = [...this.data, {//item}];

可以在 docs ,以及Angular ngoninit工作

Use ChangeDetectionStrategy.Default on all your components or use immutable data approach e.g

this.data = [...this.data, {//item}];

Can read up on it in the docs, along with how Angular ngOnInit works

当新数据来自父母时,如何重新渲染子组件

罪#恶を代价 2025-02-19 15:15:17

您可以通过上传保存的对象来创建新的可视化,而无需UI。但是,使用这种方法可能会限制结构和可能性。
iframe代码通常是指特定的Kibana端点 /可视化或仪表板URL。
使用保存的对象上传创建新的可视化后,您还知道将其放入iFrame所需的ID。
没有自己测试,但这应该起作用。

You can create new visualizations without the UI by uploading saved objects. However the structure and possibilities might be limited using this approach.
The iframe code usually refers a specific Kibana Endpoint / Visualization or Dashboard URL.
After creating a new visualization using the Saved Objects upload you also know the ID that is necessary to put it into the iframe.
Didn't test it myself but this should work.

是否可以通过API调用来动态创建基巴纳可视化?

罪#恶を代价 2025-02-19 07:44:23

您需要调整config \ database.php如下:

'mysql' => [
    ...
    ....
    'strict' => true,
    'modes' => [
        //'ONLY_FULL_GROUP_BY', // Disable this to allow grouping by one column
        'STRICT_TRANS_TABLES',
        'NO_ZERO_IN_DATE',
        'NO_ZERO_DATE',
        'ERROR_FOR_DIVISION_BY_ZERO',
        'NO_AUTO_CREATE_USER',
        'NO_ENGINE_SUBSTITUTION'
    ],
]

You need to adjust config\database.php as below:

'mysql' => [
    ...
    ....
    'strict' => true,
    'modes' => [
        //'ONLY_FULL_GROUP_BY', // Disable this to allow grouping by one column
        'STRICT_TRANS_TABLES',
        'NO_ZERO_IN_DATE',
        'NO_ZERO_DATE',
        'ERROR_FOR_DIVISION_BY_ZERO',
        'NO_AUTO_CREATE_USER',
        'NO_ENGINE_SUBSTITUTION'
    ],
]

MariaDB服务器版本,用于合适的语法,可用于近距离使用

罪#恶を代价 2025-02-18 16:34:36

您想要此结果:

GET house/_search
{
  "aggs": {
    "people": {
      "nested": {
        "path": "people"
      },
      "aggs": {
        "people.name": {
          "terms": {
            "script": "doc['people.forename'].value + ' ' +  doc['people.surname'].value"
          }
        }
      }
    }
  },
  "size": 0
}

结果:

"aggregations" : {
    "people" : {
      "doc_count" : 4,
      "people.name" : {
        "doc_count_error_upper_bound" : 0,
        "sum_other_doc_count" : 0,
        "buckets" : [
          {
            "key" : "Dave Daveson",
            "doc_count" : 2
          },
          {
            "key" : "Jeff Jeffson",
            "doc_count" : 1
          },
          {
            "key" : "Jeffs Jeffsons",
            "doc_count" : 1
          }
        ]
      }
    }
  }

You want this results:

GET house/_search
{
  "aggs": {
    "people": {
      "nested": {
        "path": "people"
      },
      "aggs": {
        "people.name": {
          "terms": {
            "script": "doc['people.forename'].value + ' ' +  doc['people.surname'].value"
          }
        }
      }
    }
  },
  "size": 0
}

Results:

"aggregations" : {
    "people" : {
      "doc_count" : 4,
      "people.name" : {
        "doc_count_error_upper_bound" : 0,
        "sum_other_doc_count" : 0,
        "buckets" : [
          {
            "key" : "Dave Daveson",
            "doc_count" : 2
          },
          {
            "key" : "Jeff Jeffson",
            "doc_count" : 1
          },
          {
            "key" : "Jeffs Jeffsons",
            "doc_count" : 1
          }
        ]
      }
    }
  }

OpenSearch / Elasticsearch聚合中的串联字段

罪#恶を代价 2025-02-18 12:35:25

演出!

IIUC,您想要这个吗?

import matplotlib.pyplot as plt

x = [1, 2, 3, 4]
y = [10, 9, 8, 7]

y_lower = [6, 5, 3, 6.5]
y_upper = [12, 10.5, 9, 7]

errors = [y_lower, y_upper]

plt.errorbar(x, y, yerr=errors, fmt='o', ecolor = 'red')
plt.show()

输出:

在此处输入图像说明“


更新下面的注释下面的

import matplotlib.pyplot as plt
import numpy as np

x = [1, 2, 3, 4]
y = [10, 9, 8, 7]

y_lower = [6, 5, 3, 6.5]
y_upper = [12, 10.5, 9, 7]
y_l = np.array(y) - np.array(y_lower)
y_u =np.array(y_upper) - np.array(y)

errors = [y_l, y_u]

plt.errorbar(x, y, yerr=errors, fmt='o', ecolor = 'red')
ax = plt.gca()
ax.set_ylim(0,15)
plt.show()

更新:

”在此处输入图像描述”

Gig 'em!

IIUC, do you want this?

import matplotlib.pyplot as plt

x = [1, 2, 3, 4]
y = [10, 9, 8, 7]

y_lower = [6, 5, 3, 6.5]
y_upper = [12, 10.5, 9, 7]

errors = [y_lower, y_upper]

plt.errorbar(x, y, yerr=errors, fmt='o', ecolor = 'red')
plt.show()

Output:

enter image description here


Update per comment below:

import matplotlib.pyplot as plt
import numpy as np

x = [1, 2, 3, 4]
y = [10, 9, 8, 7]

y_lower = [6, 5, 3, 6.5]
y_upper = [12, 10.5, 9, 7]
y_l = np.array(y) - np.array(y_lower)
y_u =np.array(y_upper) - np.array(y)

errors = [y_l, y_u]

plt.errorbar(x, y, yerr=errors, fmt='o', ecolor = 'red')
ax = plt.gca()
ax.set_ylim(0,15)
plt.show()

Output:

enter image description here

如何按错误的上和下限绘制matplotlib误差键,而不是错误栏的长度?

罪#恶を代价 2025-02-18 11:04:39

对于仍在寻找的任何人,答案是肯定的。

就我而言,我有一个.NET 9.0应用程序和.NET 9.0 Xunit测试项目,并且我在Docker中运行了两个。
为了能够在TeamCity中看到测试,我必须安装一个TeamCity插件根据此链接

并稍微修改我的Dockerfile(同样,这是Xunit的特定)。
我必须在最后将其添加到线上:

ENV TEAMCITY_PROJECT_NAME = <YourProjectName>
CMD ["dotnet", "test", "--logger:console;verbosity=detailed", "--results-directory=/app/TestResults"]

最后,团队合理应该看起来与此相似: < img src =“ https://i.sstatic.net/ojzrduxa.png” alt =“”>

我使用Teamcity Professional 2024.12(Build 174331),我在Docker中运行Teamcity和Teamcity Agent。

For anyone still looking, the answer is yes.

In my case, I have a .NET 9.0 application and a .NET 9.0 xUnit test project and I run both of them in Docker.
In order to be able to see the tests in TeamCity, I had to install a TeamCity plugin as per this link :

And modify my Dockerfile a little ( again, this is specific to xUnit ).
I had to add this to lines at the end:

ENV TEAMCITY_PROJECT_NAME = <YourProjectName>
CMD ["dotnet", "test", "--logger:console;verbosity=detailed", "--results-directory=/app/TestResults"]

In the end, in TeamCity should look similar to this :

I use TeamCity Professional 2024.12 (build 174331) and I run both TeamCity and the TeamCity Agent in docker.

TeamCity可以从Docker容器中的DotNet测试中获取测试结果,以在“测试”选项卡上显示?

罪#恶を代价 2025-02-18 08:52:49

当我们试图访问空对象的属性或字符串值变为空并且我们正在尝试访问字符串方法时,nullReferenceException是抛出的。

例如:

  1. 访问空字符串的字符串方法:

     字符串str = string.empty;
    str.tolower(); //投掷null参考异常
     
  2. 当访问空对象的属性时:

     公共班级人{
        公共字符串名称{get;放; }
    }
    人objperson;
    objperson.name /// fort null refernce异常 
     

A NullReferenceException is thrown when we are trying to access Properties of a null object or when a string value becomes empty and we are trying to access string methods.

For example:

  1. When a string method of an empty string accessed:

    string str = string.Empty;
    str.ToLower(); // throw null reference exception
    
  2. When a property of a null object accessed:

    Public Class Person {
        public string Name { get; set; }
    }
    Person objPerson;
    objPerson.Name  /// throw Null refernce Exception 
    

什么是NullReferenceException,我该如何修复?

罪#恶を代价 2025-02-18 05:08:07

如果语句,没有意义。您有pdo :: errmode_exception已启用,因此,如果查询中存在错误,它将引发异常,而不是返回false

在PDO中获取行的语法是$ result-&gt; fetch(pdo :: fetch_assoc)

$result = $conn->query($query);
echo "<td><tr>got result</tr></td>";

while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
    $field1name = $row["judgeName"];
    $field2name = $row["PC"];
    $field3name = $row["TD"];
    $field4name = $row["EX"];
    $field5name = $row["ID"]; 
    $field6name = $row["comment"];
 
    echo '<tr> 
             <td>'.$field1name.'</td> 
             <td>'.$field2name.'</td> 
             <td>'.$field3name.'</td> 
             <td>'.$field4name.'</td> 
             <td>'.$field5name.'</td> 
             <td>'.$field6name.'</td> 
         </tr>';
} 

There's no point in the if statement. You have PDO::ERRMODE_EXCEPTION enabled, so if there's an error in the query it will throw an exception, not return false.

The syntax to fetch a row in PDO is $result->fetch(PDO::FETCH_ASSOC).

$result = $conn->query($query);
echo "<td><tr>got result</tr></td>";

while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
    $field1name = $row["judgeName"];
    $field2name = $row["PC"];
    $field3name = $row["TD"];
    $field4name = $row["EX"];
    $field5name = $row["ID"]; 
    $field6name = $row["comment"];
 
    echo '<tr> 
             <td>'.$field1name.'</td> 
             <td>'.$field2name.'</td> 
             <td>'.$field3name.'</td> 
             <td>'.$field4name.'</td> 
             <td>'.$field5name.'</td> 
             <td>'.$field6name.'</td> 
         </tr>';
} 

在HTML中使用PHP显示表的内容

罪#恶を代价 2025-02-17 03:23:43

如果最后一个n行都在最后一个分区中,则可以使用 dask.dataframe.tail 。如果没有,您可以使用 dask.dataframe.partitions属性。这不是特别聪明,如果您要求太多行,它将炸毁您的内存,但是它应该可以解决问题:

def get_last_n(n, df):
    read = []
    lines_read = 0
    for i in range(df.npartitions - 1, -1, -1):
        p = df.partitions[i].tail(n - lines_read)

        read.insert(0, p)
        lines_read += len(p)
        if lines_read >= n:
            break

    return pd.concat(read, axis=0)

例如,这里有一个带有20行和5个分区的数据框架:

import dask.dataframe, pandas as pd, numpy as np, dask

df = dask.dataframe.from_pandas(pd.DataFrame({'A': np.arange(20)}), npartitions=5)

您可以将上述功能调用任何数量的行要在尾部中获得那么多行:

In [4]: get_last_n(4, df)
Out[4]:
     A
16  16
17  17
18  18
19  19

In [5]: get_last_n(10, df)
Out[5]:
     A
10  10
11  11
12  12
13  13
14  14
15  15
16  16
17  17
18  18
19  19

请求比数据框中的行更多的行要计算整个数据框架:

In [6]: get_last_n(1000, df)
Out[6]:
     A
0    0
1    1
2    2
3    3
4    4
5    5
6    6
7    7
8    8
9    9
10  10
11  11
12  12
13  13
14  14
15  15
16  16
17  17
18  18
19  19

请注意,这会迭代地请求数据,因此,如果您的图形很复杂并且涉及很多混音,则可能非常效率。

If the last N rows are all in the last partition, you can use dask.dataframe.tail. If not, you can iterate backwards using the dask.dataframe.partitions attribute. This isn't particularly smart and will blow up your memory if you request too many rows, but it should do the trick:

def get_last_n(n, df):
    read = []
    lines_read = 0
    for i in range(df.npartitions - 1, -1, -1):
        p = df.partitions[i].tail(n - lines_read)

        read.insert(0, p)
        lines_read += len(p)
        if lines_read >= n:
            break

    return pd.concat(read, axis=0)

For example, here's a dataframe with 20 rows and 5 partitions:

import dask.dataframe, pandas as pd, numpy as np, dask

df = dask.dataframe.from_pandas(pd.DataFrame({'A': np.arange(20)}), npartitions=5)

You can call the above function with any number of rows to get that many rows in the tail:

In [4]: get_last_n(4, df)
Out[4]:
     A
16  16
17  17
18  18
19  19

In [5]: get_last_n(10, df)
Out[5]:
     A
10  10
11  11
12  12
13  13
14  14
15  15
16  16
17  17
18  18
19  19

Requesting more rows than are in the dataframe just computes the whole dataframe:

In [6]: get_last_n(1000, df)
Out[6]:
     A
0    0
1    1
2    2
3    3
4    4
5    5
6    6
7    7
8    8
9    9
10  10
11  11
12  12
13  13
14  14
15  15
16  16
17  17
18  18
19  19

Note that this requests the data iteratively, so may be very inefficient if your graph is complex and involves lots of shuffles.

有没有一种方法可以向后穿过DASK数据框架?

罪#恶を代价 2025-02-17 01:32:11

您可以使用filter仅应用于“ col”列(您也可以使用列表使用切片,请参阅替代方案),然后mask更改匹配值,最后更新要更新到位的数据框:

df.update(df.filter(like='Col').mask(df.eq(df['Main'], axis=0), 'EQUAL'))

替代:

cols = ['Col1', 'Col2', 'Col3']
df.update(df[cols].mask(df.eq(df['Main'], axis=0), 'EQUAL'))

输出:

   Main  Col1   Col2   Col3
0   100    50     50      0
1   200     0  EQUAL      0
2    30    20      5      5
3   500     0      0  EQUAL

You can use filter to apply only on the "Col" columns (you could also use slicing with a list, see alternative), then mask to change the matching values, finally update to update the DataFrame in place:

df.update(df.filter(like='Col').mask(df.eq(df['Main'], axis=0), 'EQUAL'))

Alternative:

cols = ['Col1', 'Col2', 'Col3']
df.update(df[cols].mask(df.eq(df['Main'], axis=0), 'EQUAL'))

Output:

   Main  Col1   Col2   Col3
0   100    50     50      0
1   200     0  EQUAL      0
2    30    20      5      5
3   500     0      0  EQUAL

如何根据其他列的值更改熊猫数据框中的值

罪#恶を代价 2025-02-16 08:19:37

禁用工作正常。

我放置了2个组件,一个组件没有禁用属性,另一个带有disabled属性,结果是所需的。

  <NumberFormat
    value={111}
    thousandSeparator={true}
    prefix="$"
    className="some"
    inputmode="numeric"
  />
  <NumberFormat
    value={222}
    thousandSeparator={true}
    prefix="$"
    className="some"
    inputmode="numeric"
    disabled
  />

检查 sandbox

disabled is working fine.

I have placed 2 components, one without the disabled attribute and the other one with the disabled attribute and the result is the desired one.

  <NumberFormat
    value={111}
    thousandSeparator={true}
    prefix="
quot;
    className="some"
    inputmode="numeric"
  />
  <NumberFormat
    value={222}
    thousandSeparator={true}
    prefix="
quot;
    className="some"
    inputmode="numeric"
    disabled
  />

Check this sandbox

我如何禁用反应数字输入

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文