尾戒

文章 评论 浏览 31

尾戒 2025-02-20 19:28:39

要解决此问题,您可以更改.ENV文件中的mail_port。

允许的端口为:

25、465、587和2525

因此,更改mail_port = 587,例如,您的邮件将被发送。

To solve this problem, you can change the MAIL_PORT in your .env file.

The allowed ports are:

25, 465, 587 and 2525

So, change MAIL_PORT=587 for example, your mail will be sent.

我遇到的错误,“最大执行时间为60秒”。当我在Laravel使用邮件时

尾戒 2025-02-20 16:32:36

编译器中有时有非标准功能,可以帮助您打印当前的位置。这些是高度编译器的特定于编译器的,仅应用于调试。

在Gfortran中,您可以使用subroutine backtrace 。从手册中:

backtrace在用户代码中的任意位置显示回溯。
程序执行正常继续。

输出看起来像一条错误消息,但可能会有所帮助。

There are sometimes non-standard features in compilers to help you to print where you currently are. These are highly compiler specific and should be used only for debugging.

In gfortran you can use subroutine BACKTRACE. From the manual:

BACKTRACE shows a backtrace at an arbitrary place in user code.
Program execution continues normally afterwards.

The output will look like an error message, but it may be helpful.

fortran查询并打印出功能或子例程名称

尾戒 2025-02-20 02:48:16

我得到了它。
它在那里,但首先需要激活:

”在此处输入图像描述

这里是德语...我只是找不到它在德语中,我不得不首先将语言切换到英语才能找到它。

这里是德语:

I got it.
It's there, but it needs to be activated first:

enter image description here

And here it is German... I just couldn't find it in German language, so I had to switch language to English first in order to find it LOL.

Here it is in German:
enter image description here

VS2022 17.3中缺少彩色标签(不预览)

尾戒 2025-02-19 20:50:02

错误在行之内:

----> 1 wd.get(all_profile_url[2])

大概您已经在列表中存储了所有URL all_profile_url

因此,我在问题中没有看到任何错误:

for product_URL in all_profile_url:
    wd.get(product_URL)

INCASE您想使用index迭代列表,您可以使用以下替代代码块:

for i in range(len(all_profile_url)):
    wd.get(all_profile_url[i])

The error is within the line:

----> 1 wd.get(all_profile_url[2])

Presumably you have got all the urls stored in the list all_profile_url.

So I don't see any error in code trial within the question:

for product_URL in all_profile_url:
    wd.get(product_URL)

Incase you want to iterate the list using an index you can use the following alternative code block:

for i in range(len(all_profile_url)):
    wd.get(all_profile_url[i])

如何防止Web Driver在前几个循环后破裂?

尾戒 2025-02-19 18:54:21

只是为了结束答案...
搜索后,我发现此问题可以通过函数conditdital_change_event()解决,这并非在所有SQL lenguages中实现,而是可以被解释的。检查有关更多信息。

Just for close the answer...
After some searching I found this problem can ve solve with the function CONDITIONAL_CHANGE_EVENT(), this is not implemented in all SQL lenguages, but can be explicited. Check Is there any alternative to Vertica's conditional_true_event in RedShift? for more information.

行号/排名“特定分区”

尾戒 2025-02-19 03:04:42

为了消除任何疑问,我的解决方案是对切片的深层副本,而不是常规副本。
这可能不适用,具体取决于您的上下文(切片的内存约束 /大小,可能会降级的潜力 - 尤其是当副本像我这样的循环中发生在循环中,等等...)

要明确,这是警告我收到了:

/opt/anaconda3/lib/python3.6/site-packages/ipykernel/__main__.py:54:
SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

插图,

我怀疑警告是因为我放在片的副本上的一列而发出了警告。虽然从技术上讲,但在切片的副本中没有试图设置一个值,但这仍然是对切片副本的修改。

以下是我为确认怀疑所采取的(简化的)步骤,我希望这将帮助我们这些试图理解警告的人。

示例1:放在原件上的列会影响

我们已经知道的副本,但这是一个健康的提醒。这是不是警告是什么。

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

    A    B
0    111    121
1    112    122
2    113    123


>> df2 = df1
>> df2

A    B
0    111    121
1    112    122
2    113    123

# Dropping a column on df1 affects df2
>> df1.drop('A', axis=1, inplace=True)
>> df2
    B
0    121
1    122
2    123

可以避免在DF1上进行更改以影响DF2。注意:您可以通过执行df.copy()而避免导入copy.deepcopy

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

A    B
0    111    121
1    112    122
2    113    123

>> import copy
>> df2 = copy.deepcopy(df1)
>> df2
A    B
0    111    121
1    112    122
2    113    123

# Dropping a column on df1 does not affect df2
>> df1.drop('A', axis=1, inplace=True)
>> df2
    A    B
0    111    121
1    112    122
2    113    123

示例2:在副本上放置一列可能会影响原件,

这实际上说明了警告。

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

    A    B
0    111    121
1    112    122
2    113    123

>> df2 = df1
>> df2

    A    B
0    111    121
1    112    122
2    113    123

# Dropping a column on df2 can affect df1
# No slice involved here, but I believe the principle remains the same?
# Let me know if not
>> df2.drop('A', axis=1, inplace=True)
>> df1

B
0    121
1    122
2    123

有可能避免对DF2进行更改以影响DF1

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

    A    B
0    111    121
1    112    122
2    113    123

>> import copy
>> df2 = copy.deepcopy(df1)
>> df2

A    B
0    111    121
1    112    122
2    113    123

>> df2.drop('A', axis=1, inplace=True)
>> df1

A    B
0    111    121
1    112    122
2    113    123

To remove any doubt, my solution was to make a deep copy of the slice instead of a regular copy.
This may not be applicable depending on your context (Memory constraints / size of the slice, potential for performance degradation - especially if the copy occurs in a loop like it did for me, etc...)

To be clear, here is the warning I received:

/opt/anaconda3/lib/python3.6/site-packages/ipykernel/__main__.py:54:
SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

Illustration

I had doubts that the warning was thrown because of a column I was dropping on a copy of the slice. While not technically trying to set a value in the copy of the slice, that was still a modification of the copy of the slice.

Below are the (simplified) steps I have taken to confirm the suspicion, I hope it will help those of us who are trying to understand the warning.

Example 1: dropping a column on the original affects the copy

We knew that already but this is a healthy reminder. This is NOT what the warning is about.

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

    A    B
0    111    121
1    112    122
2    113    123


>> df2 = df1
>> df2

A    B
0    111    121
1    112    122
2    113    123

# Dropping a column on df1 affects df2
>> df1.drop('A', axis=1, inplace=True)
>> df2
    B
0    121
1    122
2    123

It is possible to avoid changes made on df1 to affect df2. Note: you can avoid importing copy.deepcopy by doing df.copy() instead.

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

A    B
0    111    121
1    112    122
2    113    123

>> import copy
>> df2 = copy.deepcopy(df1)
>> df2
A    B
0    111    121
1    112    122
2    113    123

# Dropping a column on df1 does not affect df2
>> df1.drop('A', axis=1, inplace=True)
>> df2
    A    B
0    111    121
1    112    122
2    113    123

Example 2: dropping a column on the copy may affect the original

This actually illustrates the warning.

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

    A    B
0    111    121
1    112    122
2    113    123

>> df2 = df1
>> df2

    A    B
0    111    121
1    112    122
2    113    123

# Dropping a column on df2 can affect df1
# No slice involved here, but I believe the principle remains the same?
# Let me know if not
>> df2.drop('A', axis=1, inplace=True)
>> df1

B
0    121
1    122
2    123

It is possible to avoid changes made on df2 to affect df1

>> data1 = {'A': [111, 112, 113], 'B':[121, 122, 123]}
>> df1 = pd.DataFrame(data1)
>> df1

    A    B
0    111    121
1    112    122
2    113    123

>> import copy
>> df2 = copy.deepcopy(df1)
>> df2

A    B
0    111    121
1    112    122
2    113    123

>> df2.drop('A', axis=1, inplace=True)
>> df1

A    B
0    111    121
1    112    122
2    113    123

如何处理熊猫的withcopywarning

尾戒 2025-02-19 01:34:25

尝试$ draws.getType()它不仅是您的字符串,还可以[pscustomObject]
随着

$drawing | Get-Member -MemberType NoteProperty 

您获得可以使用的属性。它们与CSV的标题相同。
如果您的CSV中的第一行不应该是标题,则可以自己定义

Import-Csv $importfile -Header 'YourHeader','NextColumn'

它整个$ drawing对象:

... -Include "$($drawing.FileName)*"  ...

Try $drawing.GetType() it isn't just your string but a [PSCustomObject].
With

$drawing | Get-Member -MemberType NoteProperty 

you get the properties that you can use. They are the same as the header of the CSV.
If the first row in your csv is not supposed to be a header, you can define it yourself with

Import-Csv $importfile -Header 'YourHeader','NextColumn'

You need to use the property of $drawing in the Copy-Item instead of the whole $drawing object:

... -Include "$($drawing.FileName)*"  ...

试图将复制项目与通配符一起使用的问题

尾戒 2025-02-18 15:37:14

您可以绕过所有额外的操作,并使用np.repeat

>>> np.repeat(['20', '35', '40', '10', '15'], [3, 2, 4, 2, 3])
array(['20', '20', '20', '35', '35', '40', '40', '40', '40',
       '10', '10', '15', '15', '15'], dtype='<U2')

如果您需要dtype = object,请首先将第一个参数放入数组:

arr1 = np.array(['20', '35', '40', '10', '15'], dtype=object)
np.repeat(arr1, [3, 2, 4, 2, 3])

You can bypass all the extra operations and use np.repeat:

>>> np.repeat(['20', '35', '40', '10', '15'], [3, 2, 4, 2, 3])
array(['20', '20', '20', '35', '35', '40', '40', '40', '40',
       '10', '10', '15', '15', '15'], dtype='<U2')

If you need dtype=object, make the first argument into an array first:

arr1 = np.array(['20', '35', '40', '10', '15'], dtype=object)
np.repeat(arr1, [3, 2, 4, 2, 3])

numpy /弄平列表

尾戒 2025-02-18 12:09:01

我做了这项工作。主要问题是在Micropython方面 - 我正在使用v1.19.1,但是我需要的更改实际上是在过去的5天中进行的。在此更新之前,我认为在设置它之后,在RTC_CNTL_WAKEUP_STATE_REG中清除了ULP标志。我无法弄清楚原因;我将源代码跟踪到一些ESP-IDF代码,并带有此评论:

// TODO: move timer wakeup configuration into a similar function
// once rtc_sleep is opensourced.

不过,每晚使用最新的Micropython,您只需致电:

ESP32.Wake_On_Ulp(true)

,并且一切都按预期工作。现在,在ULP中的唤醒指令之后,我将重置一个正确的标志集:

rst:0x5(deepsleep_reset)

这为即使在Micropopython World中即使在Micropython World中也打开了许多有趣的,非常低的功率可能性。

我不确定我是否能够解决这个问题,但是Micropython团队为我弄清楚了。对他们表示敬意。

I made this work. The main issue was on the micropython side - I was using v1.19.1 but the changes I needed were actually made in the last 5 days. Before this update I think that something would wipe out the ULP flag in RTC_CNTL_WAKEUP_STATE_REG after I set it. I wasn't able to figure out why; I traced the source code up to some ESP-IDF code with this comment:

// TODO: move timer wakeup configuration into a similar function
// once rtc_sleep is opensourced.

With the latest micropython nightly, though, you can just call:

esp32.wake_on_ulp(True)

and everything works as expected. Now, after a WAKE instruction in the ULP, I get a reset with the right flag set:

rst:0x5 (DEEPSLEEP_RESET)

This opens up a lot of interesting, very low power possibilities even within the micropython world.

I wasn't sure I was going to be able to figure this out, but the micropython team figured it out for me. Kudos to them.

是否可以使用ULP唤醒ESP-Woom32?考虑替代方案

尾戒 2025-02-18 11:00:51

您可以单击终端上的加号以打开新终端。

运行文件时,您可以在另一个终端中手动输入代码执行文件。

例如,

from time import sleep


def a():
sleep(10)
print("sleep")

a()

对于一个人,我们可以使用运行Python文件

”在此处输入图像说明“

对于另一个终端中,我们可以使用命令python testa.py

enter image description here

You can click the plus sign on the terminal to open a new terminal.

While running a file, you can manually enter the code execution file in the other terminal.

For example,

from time import sleep


def a():
sleep(10)
print("sleep")

a()

For one, we can use Run Python File

enter image description here

For another, we can use command python testA.py in another terminal.
enter image description here

如何在Python(VSCODE)中创建多个终端

尾戒 2025-02-18 08:47:45

您需要先用结构类型分配PTR。
现在,ptr = null,您需要它指向带有结构大小的内存位置,然后才能分配ptr-&gt; arr。

尝试以下操作:

#include <stdio.h>
#include <stdlib.h>

#define N 10

typedef struct vector {
   int size;
   int *arr;
   int length;
}vector_t;

void main(void)
{  
    int w[N]={1,2,3,4,5,6,7,8,9};
    vector_t *ptr=(vector_t *)malloc(sizeof(vector_t));

    ptr->arr=(int *) malloc( sizeof(int)*N );
    /* ---- the rest of your code--- */
    free(ptr->arr);
    free(ptr);


}

you need to allocate the ptr first with your structure type.
right now ptr=Null, and you need it to point to a memory location with the size of your structure before you can allocate ptr->arr.

try this:

#include <stdio.h>
#include <stdlib.h>

#define N 10

typedef struct vector {
   int size;
   int *arr;
   int length;
}vector_t;

void main(void)
{  
    int w[N]={1,2,3,4,5,6,7,8,9};
    vector_t *ptr=(vector_t *)malloc(sizeof(vector_t));

    ptr->arr=(int *) malloc( sizeof(int)*N );
    /* ---- the rest of your code--- */
    free(ptr->arr);
    free(ptr);


}

如何从struct进行绿色的阵列

尾戒 2025-02-17 19:31:43

您可以用减少

arr.reduce((acc,curr,index) => {
    if(index % 2) { 
        acc[acc.length-1].y = curr
        return acc
    }
    return acc.concat({x:curr})
}, [])

You can do this with reduce

arr.reduce((acc,curr,index) => {
    if(index % 2) { 
        acc[acc.length-1].y = curr
        return acc
    }
    return acc.concat({x:curr})
}, [])

如何将[X:X1,Y:Y1]的数组转换为数字数组,其中数字被存储在JavaScript中,例如[X1,Y1,X2,Y2 ....]?

尾戒 2025-02-17 10:05:29

解决了无效的负载密钥问题:它是烧瓶 - 碰到版本,1.11.1引发错误,通过降级至1.10.1

pip install Flask-Caching==1.10.1

原始答案

Resolved the invalid load key issue: it was the Flask-Caching version, 1.11.1 throws the error, resolved by downgrading to 1.10.1

pip install Flask-Caching==1.10.1

Original Answer

Pickle.load()给出无效的加载密钥,&#x27; \ x9c&#x27;错误

尾戒 2025-02-16 19:45:54

您可以通过从pandas dataframe加载huggingface数据集,如下所示,如下所示, dataset.from_pandas ds = dataset.from_pandas(df)应该起作用。这将使您能够使用数据集映射功能。

You can use a Huggingface dataset by loading it from a pandas dataframe, as shown here Dataset.from_pandas. ds = Dataset.from_pandas(df) should work. This will let you be able to use the dataset map feature.

如何更改拥抱面数据集的功能到自定义数据集

尾戒 2025-02-16 11:25:03

iOS中似乎没有办法 获得HTML5音频元素控件以包括下载选项。苹果根本不支持它,无论您的浏览器是Safari,Chrome还是Brave都没关系。如果您在iOS上,则必须提供简单的下载链接,或者添加自己的下载按钮。

  1. 简单链接:
    <audio id="myAudio" src="path/to/audiofile.mp3"></audio>
    <a href="path/to/audiofile.mp3" download>Download</a>
  1. 下载按钮:
    <audio id="myAudio" src="path/to/audiofile.mp3"></audio>
    <button onclick="downloadAudio()">Download</button>
    
    <script>
      function downloadAudio() {
        var audio = document.getElementById('myAudio');
        var url = audio.src;
        var a = document.createElement('a');
        a.href = url;
        a.download = 'audiofile.mp3';
        a.click();
      }
    </script>

There appears to be no way in iOS to get the HTML5 Audio element controls to include a download option. Apple simply doesn't support it, and it doesn't matter if your browser is Safari, Chrome, or Brave; if you're on iOS, you're going have to either supply a simple download link, or add your own Download button.

  1. Simple link:
    <audio id="myAudio" src="path/to/audiofile.mp3"></audio>
    <a href="path/to/audiofile.mp3" download>Download</a>
  1. Download button:
    <audio id="myAudio" src="path/to/audiofile.mp3"></audio>
    <button onclick="downloadAudio()">Download</button>
    
    <script>
      function downloadAudio() {
        var audio = document.getElementById('myAudio');
        var url = audio.src;
        var a = document.createElement('a');
        a.href = url;
        a.download = 'audiofile.mp3';
        a.click();
      }
    </script>

HTML音频组件控件未显示Safari中的下载

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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