挖鼻大婶

文章 评论 浏览 28

挖鼻大婶 2025-02-01 11:40:15

岩石+纸+剪刀是字符串串联。

使用 rps_list = [岩石,纸,剪刀]

rock+paper+scissors is string concatenation.

Use rps_list = [rock, paper, scissors]

Python -print()没有给出包含ASCII艺术的列表的任何输出

挖鼻大婶 2025-02-01 11:21:23

swiper v9.1.1 具有类似的事情,具有卡片效果。只需添加:

grid={{rows: 1, fill: "row"}}

Something similar can happen in the Swiper v9.1.1 with the Cards effect. Just add:

grid={{rows: 1, fill: "row"}}

Swiper网格模块无法正常工作

挖鼻大婶 2025-02-01 10:31:41

波形中的音频录制是一系列声音能量水平,基本上应该有多少瞬间。根据比特率,您可以将整个记录视为能量图与时间的图。

声音是由波浪制成的,它们具有频率和振幅。除非您的录音是纯正弦波,否则它将有许多不同的声音浪潮即将来临,这总结在一起创造了您随着时间的流逝所经历的总声音。在任何一个时间的瞬间,您都会从加在一起的许多不同的波浪中获得能量。其中一些波浪可能处于其峰值,有些波浪处于其山谷,或者之间的任何地方。

FFT是将能量VS.时间数据转换为振幅VS.频率数据的一种方法。 FFT的输入是波形的块。您不能仅从一维时间点给它一个单个能级,因为那时无法确定所有加在一起以弥补当时幅度的波浪。因此,您在一段有限的时间内给它提供了一系列振幅。

然后,FFT进行数学,并返回一系列代表时间段的声波的复数范围,当加在一起时,将在该块时间内创建一系列能量水平。这就是为什么返回值为数组的原因。它代表了一堆频率范围。阵列的总数据共同表示输入阵列中相同的能量。

您可以根据返回数组中表示的每个频率范围的相移和振幅来计算。

最终,我不明白为什么执行FFT会使您更接近同步录音。诚然,这不是我以前尝试过的任务。但是我认为波形数据已经是比较数据和查找匹配模式的理想形式。如果您将歌曲分成块以进行FFT,那么您可以尝试找到匹配的FFT,但是只有在与原始录音的开始相对于相同的分区点完全分配时,它们才能完美匹配。即使您可以保证并找到与FFT匹配的匹配,您的精度也只能与块的大小一样多。

但是,当我想到Shazam之类的应用程序时,我意识到他们必须对音频进行某种操纵,从而将其分解为更简单的东西,以进行快速比较。这可能涉及一些FFT操纵和过滤。

也许您可以使用一些算法比较FFT,以找到类似于缩小到时间范围的fft,然后在该范围内比较波形数据以找到同步的确切点。

An audio recording in waveform is a series of sound energy levels, basically how much sound energy there should be at any one instant. Based on the bit rate, you can think of the whole recording as a graph of energy versus time.

Sound is made of waves, which have frequencies and amplitudes. Unless your recording is of a pure sine wave, it will have many different waves of sound coming and going, which summed together create the total sound that you experience over time. At any one instant of time, you have energy from many different waves added together. Some of those waves may be at their peaks, and some at their valleys, or anywhere in between.

An FFT is a way to convert energy-vs.-time data into amplitude-vs.-frequency data. The input to an FFT is a block of waveform. You can't just give it a single energy level from a one-dimensional point in time, because then there is no way to determine all the waves that add together to make up the amplitude at that point of time. So, you give it a series of amplitudes over some finite period of time.

The FFT then does its math and returns a range of complex numbers that represent the waves of sound over that chunk of time, that when added together would create the series of energy levels over that block of time. That's why the return value is an array. It represents a bunch of frequency ranges. Together the total data of the array represents the same energy from the input array.

You can calculate from the complex numbers both phase shift and amplitude for each frequency range represented in the return array.

Ultimately, I don’t see why performing an FFT would get you any closer to syncing your recordings. Admittedly it’s not a task I’ve tried before. But I would think waveform data is already the perfect form for comparing the data and finding matching patterns. If you break your songs up into chunks to perform FFTs on, then you can try to find matching FFTs but they will only match perfectly if your chunks are divided exactly along the same division points relative to the beginning of the original recording. And even if you could guarantee that and found matching FFT’s, you will only have as much precision as the size of your chunks.

But when I think of apps like Shazam, I realize they must be doing some sort of manipulation of the audio that breaks it down into something simpler for rapid comparison. That possibly involves some FFT manipulation and filtering.

Maybe you could compare FFTs using some algorithm to just find ones that are pretty similar to narrow down to a time range and then compare wave form data in that range to find the exact point of synchronization.

使用FFT从音频文件中获取频率和振幅 - 如此接近但缺少一些重要的见解,Eli5?

挖鼻大婶 2025-02-01 04:40:37

Ionic + Cordova应用程序和Cordova网络插件 htttps:htttps:// ionicframework.com/docs/native/network

这似乎干扰了Android平台。如果没有插件,则不会发生错误,但是在线和离线窗口事件也永远不会在Android上开火。所以我想这与NGRX无关。

It looks like this was a super specific problem with an Ionic + Cordova App and the Cordova Network Plugin https://ionicframework.com/docs/native/network

This seems to interfere with the Android Platform. Without the Plugins the Error does not occur but the online and offline window events also never fire on Android. So I guess this has nothing to do with NgRx.

NGRX商店运行时检查NGZONE在Android上失败

挖鼻大婶 2025-02-01 00:02:05

您可以使用django forloop.counter0 forloop.counter 变量。第一个以索引0开头跟踪循环内部迭代的第一个,第二个从1开始索引迭代(请参见本节的底部,请参见本节的底部

    {% for field in form %}     
      {% if forloop.counter0 == 5 %}
        <h2>Section 2</h2>
        <p>Some text about section 2</p>
      {% elif forloop.counter0 == 8 %}
        <h2>Section 3</h2>
        <p>Some text about section 3</p>
      {% endif %}
      <div class="field">
        <label class="label" for="{{field.id_for_label}}">
          {{field.label}}
        </label>
        <div class="control">{{field}}</div>
        {% if field.help_text %}
        <p class="help">{{field.help_text}}</p>
        {% endif %}
        <ul class="errorlist">
          {% for error in field.errors %}
          <li class="is-danger help">{{error}}</li>
          {% endfor %}
        </ul>
      </div>
    {% endfor %}

您仍然必须手动检查值。例如,如果您想以某种方式添加截面内容,则可以每5个字段迭代内容,您可以利用 divisible django-mathfilters divide:

    {% for field in form %}     
      {% if forloop.counter0|divisibleby:5 %}
        <h2>Section {{ forloop.counter0|div:5}}</h2>
        <p>Some text about section {{ forloop.counter0|div:5}}</p>
      {% endif %}
      <div class="field">
        <label class="label" for="{{field.id_for_label}}">
          {{field.label}}
        </label>
        <div class="control">{{field}}</div>
        {% if field.help_text %}
        <p class="help">{{field.help_text}}</p>
        {% endif %}
        <ul class="errorlist">
          {% for error in field.errors %}
          <li class="is-danger help">{{error}}</li>
          {% endfor %}
        </ul>
      </div>
    {% endfor %}

有关更多参考,您可以看到要知道 divisible 是否有Django模板的过滤器?获得有关如何在Django模板中划分数字的其他方法!

You can make use of Django forloop.counter0 or forloop.counter variables. The first one which keeps track of the iteration inside the loop starting with index 0 and the second one indexes iterations starting with 1 (see the bottom of this section see the bottom of this section https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#for for more):

    {% for field in form %}     
      {% if forloop.counter0 == 5 %}
        <h2>Section 2</h2>
        <p>Some text about section 2</p>
      {% elif forloop.counter0 == 8 %}
        <h2>Section 3</h2>
        <p>Some text about section 3</p>
      {% endif %}
      <div class="field">
        <label class="label" for="{{field.id_for_label}}">
          {{field.label}}
        </label>
        <div class="control">{{field}}</div>
        {% if field.help_text %}
        <p class="help">{{field.help_text}}</p>
        {% endif %}
        <ul class="errorlist">
          {% for error in field.errors %}
          <li class="is-danger help">{{error}}</li>
          {% endfor %}
        </ul>
      </div>
    {% endfor %}

You would still have to manually check for the values. If you want for example to add section content in a way you can iterate the content every 5 fields you can take advantage of divisibleby and Django-Mathfilters to divide:

    {% for field in form %}     
      {% if forloop.counter0|divisibleby:5 %}
        <h2>Section {{ forloop.counter0|div:5}}</h2>
        <p>Some text about section {{ forloop.counter0|div:5}}</p>
      {% endif %}
      <div class="field">
        <label class="label" for="{{field.id_for_label}}">
          {{field.label}}
        </label>
        <div class="control">{{field}}</div>
        {% if field.help_text %}
        <p class="help">{{field.help_text}}</p>
        {% endif %}
        <ul class="errorlist">
          {% for error in field.errors %}
          <li class="is-danger help">{{error}}</li>
          {% endfor %}
        </ul>
      </div>
    {% endfor %}

For more references you can see Modulus % in Django template to know about divisibleby and Is there a filter for divide for Django Template? to get some other methods on how to divide numbers in your Django template!

如何以django形式迭代渲染第一个X字段

挖鼻大婶 2025-01-31 22:40:24

尝试使用disk_node而不是disk_path,这对我有用:

data "aws_storagegateway_local_disk" "ld_sg_tf {
    disk_node = "${aws_volume_attachment.ebs_att_tf.device_name}"
    gateway_arn = "${aws_storagegateway_gateway.sg_tf.arn}"
}

try using disk_node instead of disk_path, that worked for me :

data "aws_storagegateway_local_disk" "ld_sg_tf {
    disk_node = "${aws_volume_attachment.ebs_att_tf.device_name}"
    gateway_arn = "${aws_storagegateway_gateway.sg_tf.arn}"
}

如何使用Terraform自动创建用于存储网关的CACHE磁盘?

挖鼻大婶 2025-01-31 21:09:00

如果要访问它们,您只需要在更具体的t中添加约束,

public interface IGenericInterface<T> where T: _Base
    {
        RepoResult<T> Insert(T obj);
        RepoResult<T> Update(T obj);
        RepoResult<T> Delete(long id);
        RepoResult<T> Restore(long id);
        T GetSingle(long id);
    }

因为_base已经是类本身,因此您无需担心该额外的类约束即可。

If you want to access them, you just need to add a constraint to the generic interface that is a more specific T like this:

public interface IGenericInterface<T> where T: _Base
    {
        RepoResult<T> Insert(T obj);
        RepoResult<T> Update(T obj);
        RepoResult<T> Delete(long id);
        RepoResult<T> Restore(long id);
        T GetSingle(long id);
    }

Since _Base is already a class itself, you don't need to worry about that extra class constraint.

想要在基本实体类中使用genericpository,以下详细信息

挖鼻大婶 2025-01-31 18:53:13

写终端

sudo strong textnpm install -g ganache-cli

Write terminal

sudo strong textnpm install -g ganache-cli

问题布朗尼设置,不确定Ganache是​​否正确安装了-Chainlink Hackathon

挖鼻大婶 2025-01-31 16:39:49

与本文档一样,关系是通过@embedded标签完成的。在
不需要设置外国钥匙的情况吗?如何进行拆除
级联如果需要?

这种方法是为了检索数据,以使房间为您生成查询。要进行拆除的级联,您需要一个外国人。

userWithPlayLists是否需要 @entity标签?

在这种情况下,不需要创建一个新类加入两者
实体?另外,我不明白为什么外国人,parentcolumns和
托儿所必须是类型数组。在这种情况下不应该
parentcolumns阵列和托儿所(我们有一个阵列)
许多关系)?

每个查询结果都需要一些类,因此,如果您想从两个表中查询某些内容,则需要创建一个。也有许多与人的关系支持,因此您可能需要多个密钥。

通常使用两种方法,它们不排除,而是相互补充。

As in this documentation, the relation is done via @Embedded tag. In
this scenario is not needed to set a ForeignKey? How to do a ondelete
cascade if needed?

This approach is for retrieving data, to make Room generate queries for you. To do onDelete Cascade etc you need a ForeignKey.

Does the UserWithPlaylists needs the @Entity tag?

No

In this scenario is not needed to create a new Class joining both
Entities? Also, I don't understand why ForeignKey, parentColumns and
childColumns must be of type array. Shouldn't in this case be
parentColumns an array and childColumns a Long (as we have one - to
many relation)?

You need some class for every query result, so if you want to query something from both tables, you will need to create one. There is also many-to-many relations support, so you might need multiple keys.

Both approaches are usually used, they do not exclude, but complement each other.

在Android房间内进行一对多关系的方式

挖鼻大婶 2025-01-31 16:00:17

您必须在响应HTML中提供 HX-SWAP-OOB =“ true” 属性。此外,由于您使用的是OuterHTML交换方法,因此您还必须包括所有其他属性,否则,在第一个周期之后,轮询将停止。响应中的一个DIV(此处为第一个)不需要 HX-SWAP-OOB =“ true” 属性,因为它将是正常的交换内容。

<div id="udp"
  hx-target="#udp"
  hx-get="{% url 'result' %}" 
  hx-trigger="every 5s" 
  hx-swap="outerHTML"
  style="text-align: center;">
    {% if add_result1 %}
    <p>{{ add_result1.result }}</p>
    {% else %}
    <p>Retrieving results...</p>
    {% endif %}
</div>

<div id="uep" hx-swap-oob="true">
    {% if add_result2 %}
    <p>{{ add_result2.result }}</p>
    {% else %}
    <p>Retrieving results...</p>
    {% endif %}
</div>

<div id="ujp" hx-swap-oob="true">
    {% if add_result3 %}
    <p>{{ add_result3.result }}</p>
    {% else %}
    <p>Retrieving results...</p>
    {% endif %}
</div>

You must provide the hx-swap-oob="true" attribute in the response HTML. Furthermore since you are using outerHTML swapping method, you also have to include all the other attributes as well, otherwise the polling will stop after the first cycle. One of the divs in the response (here the first one) does not need a hx-swap-oob="true" attribute because it will be the normal swapped content.

<div id="udp"
  hx-target="#udp"
  hx-get="{% url 'result' %}" 
  hx-trigger="every 5s" 
  hx-swap="outerHTML"
  style="text-align: center;">
    {% if add_result1 %}
    <p>{{ add_result1.result }}</p>
    {% else %}
    <p>Retrieving results...</p>
    {% endif %}
</div>

<div id="uep" hx-swap-oob="true">
    {% if add_result2 %}
    <p>{{ add_result2.result }}</p>
    {% else %}
    <p>Retrieving results...</p>
    {% endif %}
</div>

<div id="ujp" hx-swap-oob="true">
    {% if add_result3 %}
    <p>{{ add_result3.result }}</p>
    {% else %}
    <p>Retrieving results...</p>
    {% endif %}
</div>

每次我对服务器进行轮询时,替换多个不同元素的值-htmx

挖鼻大婶 2025-01-31 15:48:46

您可以尝试此

添加 muichip-Label CSS中的类

.MuiChip-label
{
   color:#fff !important;
}

you can try this

add MuiChip-label class in css

.MuiChip-label
{
   color:#fff !important;
}

MUI Reactj中的自动完成芯片上色的方法是什么

挖鼻大婶 2025-01-31 11:44:01

有两个选项,解决问题或检测到问题。第一个是简单的,因为如果没有发生,请尝试通过。第二个将检测NAN

第一个解决方案

# change date format
def dmy_to_dmy(d):
    try:
        return datetime.strptime(d, '%d %B %Y').strftime('%d/%m/%Y')
    except TypeError:
        return d
    
dates2['Dates_Reins'] = dates2['Dates_Reins'].apply(dmy_to_dmy)

第二解决方案

# change date format
def dmy_to_dmy(d):
    if d == np.nan:
        return d
    else:
        return datetime.strptime(d, '%d %B %Y').strftime('%d/%m/%Y')
    
dates2['Dates_Reins'] = dates2['Dates_Reins'].apply(dmy_to_dmy)

,因为您尚未提供数据 d == np.nan 您必须自己找到

There are two options, ingoring the problem or detecting the problem. The first one is the easy one since you try and pass if it doesn't happen. The second one will detect the NaN

First solution

# change date format
def dmy_to_dmy(d):
    try:
        return datetime.strptime(d, '%d %B %Y').strftime('%d/%m/%Y')
    except TypeError:
        return d
    
dates2['Dates_Reins'] = dates2['Dates_Reins'].apply(dmy_to_dmy)

Second solution

# change date format
def dmy_to_dmy(d):
    if d == np.nan:
        return d
    else:
        return datetime.strptime(d, '%d %B %Y').strftime('%d/%m/%Y')
    
dates2['Dates_Reins'] = dates2['Dates_Reins'].apply(dmy_to_dmy)

Since you haven't provided the data d==np.nan you have to find for yourself

可以应用功能,因为我有nan

挖鼻大婶 2025-01-31 08:43:49

这听起来像是一种商业逻辑,需要在调度程序中完成。

使用调度程序,您可以做到这一点:

db.collection.updateMany(query, {$pull: {count: { type: 30DaysAgoDate}}});

This sounds like a business logic, which needs to be done in a scheduler.

With a scheduler, you can do this:

db.collection.updateMany(query, {$pull: {count: { type: 30DaysAgoDate}}});

只有几天的商店&#x27;关于mongodb的数据

挖鼻大婶 2025-01-31 03:24:00

我认为您不应该在这里添加任何图像。
无论如何,尝试在 pd.read_csv 的参数中添加 encoding =“ utf-8” 。或尝试其他一些编码。

I think you should not add any images in here.
Anyway try to add encoding="UTF-8" in the parameter of pd.read_csv. or try some other encodings.

Visual Studio(Python)Unicode解码误差x

挖鼻大婶 2025-01-30 12:25:03

将SetState添加到您的闭合

onPressed: () async {
        if (UserOnline! =true) {
        UserOnline = true;
        await UserSimplePrefences.setButtonStatus(true);
        displayToastMessage("You are Online now", context);
        setState(() {});
    } else {
        UserOnline =false;
        await UserSimplePrefences.setButtonStatus(false);
        displayToastMessage("You are Offline now", context);
        setState(() {});
    }}

add setState to your onPressed

onPressed: () async {
        if (UserOnline! =true) {
        UserOnline = true;
        await UserSimplePrefences.setButtonStatus(true);
        displayToastMessage("You are Online now", context);
        setState(() {});
    } else {
        UserOnline =false;
        await UserSimplePrefences.setButtonStatus(false);
        displayToastMessage("You are Offline now", context);
        setState(() {});
    }}

如何与布尔人一起使用共享流?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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