雪落纷纷

文章 评论 浏览 30

雪落纷纷 2025-02-20 18:29:24

您可以以两种不同的方式进行操作,例如您可以创建自己的功能,在其中可以根据屏幕像素来维护分页,并且需要根据该函数维护一个Bool变量,以决定新页面是否负载。只是您需要在ListView Builder中提供控制器。

第二个选项是使用软件包 infinite_scroll_pagination 您无需维护任何varibale或screen screat将页面请求侦听器添加到分页控制器中在PageController属性中,您只需要通过PaginationController即可。其他所有内容将由您的分页控制器管理。

You can do in two different ways like in first way you can create your own function where you can maintain pagination based on your screen pixels and you need to maintain one bool variable based on that decide that new page will be load or not. Just you need to give controller in listview builder.

Second option is using package which is infinite_scroll_pagination where you don't need to maintain any varibale or screen pixels just add your page request listener in pagination controller but you need to create pageview or different view where you can pass your list view and in pagecontroller property you just need to pass paginationcontroller that's it. Other all the things will be managed by your pagination controller.

如何通过从API获取数据的列表分页?

雪落纷纷 2025-02-20 14:50:56

尝试:

values = driver.find_elements(By.CLASS_NAME, "roulette-history-item__value-textsiwxWvFlm3ohr_UMS23f")
for value in values:
    v = value.get_attribute("innerHTML")

Try:

values = driver.find_elements(By.CLASS_NAME, "roulette-history-item__value-textsiwxWvFlm3ohr_UMS23f")
for value in values:
    v = value.get_attribute("innerHTML")

find_elements with get_atributes('innerhtml&quort;)

雪落纷纷 2025-02-20 13:13:21

由于VITE,我们不能使用要求语句。因此,在分离数据和存储的同时更加复杂。我无法在Alpinejs网站上找到任何官方信息。我还经历了相同的问题,并以这种方式解决了这种类型的问题。

Alpine-data

export default () => ({ 
    active: false,
    id: null,
    open(id) {
        this.active = true
        this.id = id
        document.body.classList.add('overflow-hidden')
        window.dispatchEvent(new CustomEvent('modalopened'))
    },
    close() {
        this.active = false
        this.id = null
        document.body.classList.remove('overflow-hidden')
        window.dispatchEvent(new CustomEvent('modalclosed'))
    }
})

资源/app.js

import Alpine from 'alpinejs'
window.Alpine = Alpine

// Stores need to be defined before Alpine.start()
import modal from './alpine-stores/modal.js'
Alpine.data('modal', modal)

Alpine.start()

高山商店不要使用箭头功能

export default ({
    .....
})

Due to vite we cannot use require statement. So while separating file for data and store is more complicated. I cannot found any official information on alpinejs website. I also pass through same problem and solve this type of problem in this way.

alpine-data

export default () => ({ 
    active: false,
    id: null,
    open(id) {
        this.active = true
        this.id = id
        document.body.classList.add('overflow-hidden')
        window.dispatchEvent(new CustomEvent('modalopened'))
    },
    close() {
        this.active = false
        this.id = null
        document.body.classList.remove('overflow-hidden')
        window.dispatchEvent(new CustomEvent('modalclosed'))
    }
})

resources/app.js

import Alpine from 'alpinejs'
window.Alpine = Alpine

// Stores need to be defined before Alpine.start()
import modal from './alpine-stores/modal.js'
Alpine.data('modal', modal)

Alpine.start()

For alpine store don't use arrow function

export default ({
    .....
})

Vite(在Laravel)和Alpinejs不起作用

雪落纷纷 2025-02-20 08:21:26

简单地说,

当从现有对象创建新对象作为现有对象的副本时,调用复制构造函数。
当从另一个现有对象分配一个已经初始化的对象时,分配运算符被调用。

例子-

t2 = t1;  // calls assignment operator, same as "t2.operator=(t1);"
Test t3 = t1;  // calls copy constructor, same as "Test t3(t1);"

In a simple words,

Copy constructor is called when a new object is created from an existing object, as a copy of the existing object.
And assignment operator is called when an already initialized object is assigned a new value from another existing object.

Example-

t2 = t1;  // calls assignment operator, same as "t2.operator=(t1);"
Test t3 = t1;  // calls copy constructor, same as "Test t3(t1);"

分配运算符和复制构造函数之间的区别是什么?

雪落纷纷 2025-02-20 06:22:58

根据 documentation url应该看起来像这样:

https://graph.facebook.com/v13.0/PHONE_NUMBER_ID/messages

您似乎在正确的位置缺少 phone_number_id WAMID ... 在这里似乎不需要。我还注意到您的请求主体缺少所需的数据:

"messaging_product": "whatsapp",
"status": "read",  <- you only seem to have this
"message_id": "MESSAGE_ID"

另外,文档在您似乎使用PUT请求时显示了邮政请求。如果您解决了所有这些问题,则应该开始工作。

According to the documentation the url is supposed to look like this:

https://graph.facebook.com/v13.0/PHONE_NUMBER_ID/messages

You seem to be missing PHONE_NUMBER_ID in its correct place, and seem to have wamid... which doesn't seem to be needed here. I also notice that your request body is missing the required data:

"messaging_product": "whatsapp",
"status": "read",  <- you only seem to have this
"message_id": "MESSAGE_ID"

Also, the docs show a POST request while you seem to be using a PUT request. If you solve all these problems it should start working.

无法标记为使用WhatsApp Business API阅读我传入的WhatsApp消息

雪落纷纷 2025-02-19 10:09:43

应该是网络侧问题检查您的安全组,请检查安全组入口规则,并允许lambda函数SG到Oracle数据库SG的流量。 chek这个问题将解决这个问题

It should be Network side Problem check your security group please check the security group inbound rule and allow traffic from lambda function sg to oracle database sg. chek this it will be solve this issue

将AWS Lambda连接到Oracle RD

雪落纷纷 2025-02-18 22:14:26

我建议您找到一个代码pla窃工具像这样的人检查相似性。

我知道有些人发现我们的Java 2教授的工具可以处理更改的变量名称,但我不知道他使用了什么。

I would recommend finding a code plagiarism tool like this one to check for similarity.

I know some people who found out that our Java 2 professor's tool could handle changing variable names, but I don't know what he used....

比较两个在结构上类似的JS文件中的等效功能?

雪落纷纷 2025-02-18 08:08:22

请查看此示例:

var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope,$http) {

    var getJoke = function(){
        return $http.get('http://api.icndb.com/jokes/random').then(function(res){
            return res.data.value;  
        });
    }

    getJoke().then(function(res) {
        console.log(res.joke);
    });
});

,您可以看到 getJoke 返回解决解决 Promise 返回 res.data.value )。因此,您要等到 $ http.get 请求完成,然后执行 console.log(res.joke)(作为正常的异步流)。

这是Plnkr:

es6方法(异步 - 等待)

(function(){
  async function getJoke(){
    let response = await fetch('http://api.icndb.com/jokes/random');
    let data = await response.json();
    return data.value;
  }

  getJoke().then((joke) => {
    console.log(joke);
  });
})();

Have a look at this example:

var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope,$http) {

    var getJoke = function(){
        return $http.get('http://api.icndb.com/jokes/random').then(function(res){
            return res.data.value;  
        });
    }

    getJoke().then(function(res) {
        console.log(res.joke);
    });
});

As you can see getJoke is returning a resolved promise (it is resolved when returning res.data.value). So you wait until the $http.get request is completed and then console.log(res.joke) is executed (as a normal asynchronous flow).

This is the plnkr:

http://embed.plnkr.co/XlNR7HpCaIhJxskMJfSg/

ES6 way (async - await)

(function(){
  async function getJoke(){
    let response = await fetch('http://api.icndb.com/jokes/random');
    let data = await response.json();
    return data.value;
  }

  getJoke().then((joke) => {
    console.log(joke);
  });
})();

如何从异步电话中返回响应?

雪落纷纷 2025-02-18 06:55:22

您可以使用格式选项将值格式化为货币:

series: [{
    type: 'map',
    name: 'Purchases 

您无法直接从查询中访问数据。您需要使用快照侦听器获取数据。

您可以使用查询方法从查询中获取数据。

查询(collectionRef,where(... q),orderby(... ob),limit(... lmt))

您可以使用onSnapshot方法从快照侦听器获取数据。

onSnapshot(collectionRef, snapshot => {
    let results = []
    snapshot.docs.forEach(doc => {
        results.push({ ...doc.data(), id: doc.id })
    })
    // update values
    documents.value = results        
})

快照侦听器将从查询中返回数据。

One potential issue could be that your CSV file has an extra line at the end. Try removing that extra line and see if that fixes the issue.

, states: { hover: { color: '#BADA55', }, }, dataLabels: { enabled: true, format: '{point.name}', formatter: function() { return '

您无法直接从查询中访问数据。您需要使用快照侦听器获取数据。

您可以使用查询方法从查询中获取数据。

查询(collectionRef,where(... q),orderby(... ob),limit(... lmt))

您可以使用onSnapshot方法从快照侦听器获取数据。


快照侦听器将从查询中返回数据。

One potential issue could be that your CSV file has an extra line at the end. Try removing that extra line and see if that fixes the issue.

+ this.y; } }, allAreas: true, data: this.model, }],

您无法直接从查询中访问数据。您需要使用快照侦听器获取数据。

您可以使用查询方法从查询中获取数据。

查询(collectionRef,where(... q),orderby(... ob),limit(... lmt))

您可以使用onSnapshot方法从快照侦听器获取数据。


快照侦听器将从查询中返回数据。

One potential issue could be that your CSV file has an extra line at the end. Try removing that extra line and see if that fixes the issue.

You can use the formatter option to format the value as currency:

series: [{
    type: 'map',
    name: 'Purchases 

You can't access the data directly from the query. You need to use the snapshot listener to get the data.

You can use the query method to get the data from the query.

query(collectionRef, where(...q), orderBy(...ob), limit(...lmt))

You can use the onSnapshot method to get the data from the snapshot listener.

onSnapshot(collectionRef, snapshot => {
    let results = []
    snapshot.docs.forEach(doc => {
        results.push({ ...doc.data(), id: doc.id })
    })
    // update values
    documents.value = results        
})

The snapshot listener will return the data from the query.

One potential issue could be that your CSV file has an extra line at the end. Try removing that extra line and see if that fixes the issue.

, states: { hover: { color: '#BADA55', }, }, dataLabels: { enabled: true, format: '{point.name}', formatter: function() { return '

You can't access the data directly from the query. You need to use the snapshot listener to get the data.

You can use the query method to get the data from the query.

query(collectionRef, where(...q), orderBy(...ob), limit(...lmt))

You can use the onSnapshot method to get the data from the snapshot listener.


The snapshot listener will return the data from the query.

One potential issue could be that your CSV file has an extra line at the end. Try removing that extra line and see if that fixes the issue.

+ this.y; } }, allAreas: true, data: this.model, }],

You can't access the data directly from the query. You need to use the snapshot listener to get the data.

You can use the query method to get the data from the query.

query(collectionRef, where(...q), orderBy(...ob), limit(...lmt))

You can use the onSnapshot method to get the data from the snapshot listener.


The snapshot listener will return the data from the query.

One potential issue could be that your CSV file has an extra line at the end. Try removing that extra line and see if that fixes the issue.

输出额外的线路

雪落纷纷 2025-02-18 06:26:02

我设法使用GT软件包找到了解决方案。这是代码:

MA %>% pivot_longer(
  cols = !Study,
  names_to = c(".value", ".value"),
  names_pattern = "(.)(.)",
  values_drop_na = TRUE
  ) %>%
  rename(Intervention = In) %>% 
  rename(Number = Nu) %>% 
  gt(groupname_col = "Study") %>% 
  tab_stubhead(label = "Study") %>% 
  tab_options(row_group.as_column = TRUE)

提供以下输出表:

谢谢,

I've managed to find a solution using the gt package. Here is the code:

MA %>% pivot_longer(
  cols = !Study,
  names_to = c(".value", ".value"),
  names_pattern = "(.)(.)",
  values_drop_na = TRUE
  ) %>%
  rename(Intervention = In) %>% 
  rename(Number = Nu) %>% 
  gt(groupname_col = "Study") %>% 
  tab_stubhead(label = "Study") %>% 
  tab_options(row_group.as_column = TRUE)

This gives the following output table:

enter image description here

If anyone has any solutions using the gtsummary package, that'd be great.

Thanks,

Ben

gtsummary tbl_merge具有多个可变长度的列

雪落纷纷 2025-02-18 05:25:52

经过数小时试图找到这个问题,我很讨厌解决这个问题,我感到很愚蠢。我定义的事件挂钩的文件未作为COG添加到机器人中。因此,我无法使用命令/侦听器。感谢大家的帮助。我想没有人有答案的原因是因为这是一个愚蠢的错误。

async def setup():
  #register the class with the bot
  await bot.add_cog(help_cog(bot))
  await bot.add_cog(music_cog(bot))

我将活动钩子更改为音乐齿轮,它效果很好。

我猜故事的寓意是1。如果没有将文件添加到机器人中,则命令不起作用。 2。无论您多长时间调试问题。这仍然可能是您犯的一些愚蠢的错误。

After hours of trying to find the issue, I finialy figured out the issue and I feel so dumb. The file that I defined the event hook was not added to the bot as a Cog. So I could not use commands/listeners. Thanks to everyone for the help. I guess the reason no one had the answer is because it is a dumb mistake.

async def setup():
  #register the class with the bot
  await bot.add_cog(help_cog(bot))
  await bot.add_cog(music_cog(bot))

I changed the event hook to the music cog and it worked just fine.

I guess the moral of the story is 1. commands do not work if the file is not added to the bot as a cog. 2. no matter how long you have been debuging an issue. It still can be some stupid mistake you made.

bot.dispatch()未正确瞄准cog.listener(),discord.py

雪落纷纷 2025-02-18 01:19:48

您可以尝试 mod

def newnumber(num1,num2):
    numbers = num1+num2+75
    numbers = numbers % 275
    return numbers 

如果要在数字 275 之间选择较小的,则可以使用 min

def newnumber(num1,num2):
    numbers = num1+num2+75
    numbers = min(numbers, 275)
    return numbers 

You can try mod

def newnumber(num1,num2):
    numbers = num1+num2+75
    numbers = numbers % 275
    return numbers 

If you want to select the smaller one between numbers or 275, you can use min

def newnumber(num1,num2):
    numbers = num1+num2+75
    numbers = min(numbers, 275)
    return numbers 

功能使数字低于一定数量

雪落纷纷 2025-02-18 00:37:31

这个问题围绕着您使用已定义(而不是本机类型)的资源的使用以及这些类型实例的属性的覆盖。

当Puppet构建目录时,它需要评估每个已定义类型的每个声明实例的正文中的木偶代码,并且必须根据该实例的参数来做到这一点。 Puppet试图将这些评估尽可能延迟推迟,以允许资源属性覆盖,但由于评估定义的型资源通常会产生其他资源声明,因此不一定有明确定义的总订单。

因此,可能会发生在Puppet评估特定资源实例的主体之后的一段时间,它评估了该实例属性的覆盖。在这种情况下,木偶没有特别好的选择。它不能重新评估受影响的资源,因此必须使用与预期的不同参数评估的资源或保释。它保释而不是冒着错误配置目标机器的风险。

为了使这些情况不太可能,请最大程度地减少您对资源替代的使用,尤其是在模块边界之间。在这种追求中,通常有助于

  • 使用Hiera和您的数据层次结构进行灵活的自定义,而不是程序清单代码;
  • 使您定义的型资源精细粒子;并且,与此相结合的
  • 使用多个资源可以一起使用,而不是大型单片资源

,替代问题仅适用于定义的类型,因此您可以考虑将某些定义类型转换为自定义(本机)类型。

关于特别是从多个来源对同一配置文件的贡献,您可能会发现您感兴趣的模块。至少,它可以使您更好地了解我对精细的粒度资源和资源共同努力的意义。


分开但相关,与您的班级命名相关,我带您打算执行角色&amp;轮廓模式。在这种情况下,您的个人资料中的个人资料中的逻辑过多。配置文件应汇总组件类,等等。特别是,很少有个人资料声明资源本身 - 这就是组件类的作用。同样,个人资料通常不应从事压倒资源属性的业务,这是您的特殊麻烦。

取而代之的是,将组件类参数提供他们需要首先声明正确资源属性的类参数,因此无需覆盖。我的个人实践和通常的建议是,需要自定义类参数值的地方,这是通过基于HIERA的数据绑定来完成的。但是,如果您愿意,可以使用类似资源的类声明从个人资料类中驱动它(尽管这意味着同一目录中没有其他类别的类别应声明相同的组件类)。

This issue revolves around your use of resources having defined (as opposed to native) types, and your overrides of the properties of instances of those types.

When Puppet is building a catalog, it needs to evaluate the Puppet code in the body of each declared instance of each defined type, and it must do that in light of that instance's parameters. Puppet tries to defer those evaluations as late as possible to allow resource property overrides to be processed, but there is not necessarily a well-defined total order, on account of evaluation of defined-type resources generally producing declarations of additional resources.

It may happen, therefore, that some time after Puppet has evaluated the body of a particular resource instance, it evaluates an override of that instance's properties. Puppet has no particularly good alternative in that case. It cannot re-evaluate the affected resource, so it must either go forward with a resource that was evaluated with different parameters than was intended, or bails. It bails rather than risk misconfiguring the target machine.

To make these situations unlikely, minimize your use of resource overrides, especially across module boundaries. In that pursuit, it often helps to

  • use Hiera and your data hierarchy for flexible customization, instead of procedural manifest code;
  • make your defined-type resources fine grained; and in conjunction with that
  • use multiple resources that work together instead of large monolithic resources

Alternatively, the override issue applies only to defined types, so you could consider converting some of your defined types to custom (native) types.

With respect specifically to having contributions to the same config file from multiple sources, you might find the puppetlabs/concat module to be of interest to you. At minimum, it may give you a better understanding of what I mean about fine grained resources and resources working together.


Separately but related, from your class naming, I take you to be intending to implement the Roles & Profiles pattern. In that case, your profile has far too much logic in it. Profiles should aggregate component classes, and little more. In particular, it is rarely appropriate for profiles to declare resources themselves -- that's the role of component classes. In the same vein, profiles generally should not be in the business of overriding resource properties, which is where your particular trouble is arising.

Instead, give your component classes the class parameters they need to declare the right resource properties in the first place, so that no override is required. My personal practice and usual recommendation is that where class parameter values need to be customized, that is done via Hiera-based data binding. If you wish, however, you can drive it from your profile class by using resource-like class declarations there (though this means that no other class included in the same catalog should declare those same component classes).

Puppet 7。如何让几个配置文件订阅一些服务,该服务由Puppet生成单个配置文件

雪落纷纷 2025-02-17 23:48:52

是的,我的模型是:

<?php

namespace App\Models;

use Backpack\CRUD\app\Models\Traits\CrudTrait;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;
//use Laravel\Sanctum\HasApiTokens;
//use Illuminate\Contracts\Auth\MustVerifyEmail;
//use Illuminate\Database\Eloquent\Factories\HasFactory;


class User extends Authenticatable
{
    use CrudTrait;
    use HasRoles;
    use Notifiable;

    //use HasApiTokens, HasFactory, Notifiable ;

   // protected $guard = 'web';

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'name',
        'email',
        'password',
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array<int, string>
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array<string, string>
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

我检查我的配置文件并与官方文档进行比较,但是对我来说还可以...

例外是:
[1]: https://i.sstatic.net.net/ypsj6.png

06-27 15:29:20] local.error:未定义的索引:型号{“异常”:“ [object](errorexception(code:0):Undefined Index:e:\ laragon \ laragar \ www \ lara_boltr \ vendor \ vendor \ vendor \ vendor \ vendor \ vendor \ vendor \ vendor backpack \ crud \ src \ app \ library \ crudpanel \ traits \ fakefields.php:42)
[stacktrace]

我已经检查了所有文件,但是我会理解一个错误
我的背包版本是5.0

Yes, my model is :

<?php

namespace App\Models;

use Backpack\CRUD\app\Models\Traits\CrudTrait;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;
//use Laravel\Sanctum\HasApiTokens;
//use Illuminate\Contracts\Auth\MustVerifyEmail;
//use Illuminate\Database\Eloquent\Factories\HasFactory;


class User extends Authenticatable
{
    use CrudTrait;
    use HasRoles;
    use Notifiable;

    //use HasApiTokens, HasFactory, Notifiable ;

   // protected $guard = 'web';

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'name',
        'email',
        'password',
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array<int, string>
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array<string, string>
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

I check my configuration files and compare with official documentation, but for me it's OK...

The exception is :
[1]: https://i.sstatic.net/ypSJ6.png

[2022-06-27 15:29:20] local.ERROR: Undefined index: model {"exception":"[object] (ErrorException(code: 0): Undefined index: model at E:\laragon\www\lara_boltr\vendor\backpack\crud\src\app\Library\CrudPanel\Traits\FakeFields.php:42)
[stacktrace]

I've checked all files, but i'dont understand where is a mistake
My Backpack version is 5.0

Laravel背包权限管理器错误:未定义的索引:模型

雪落纷纷 2025-02-17 09:47:13

我会这样编码:

//@version=5
x = input.int(11)
red = close < open                       //red bar condition
count = ta.barssince(red)                //count of bars since red

if barstate.isconfirmed and count == x   //evaluates whether barstate is confirmed and count is equal to the given x
    strategy.entry("Long", strategy.long) //Enter Long

I'd code it that way:

//@version=5
x = input.int(11)
red = close < open                       //red bar condition
count = ta.barssince(red)                //count of bars since red

if barstate.isconfirmed and count == x   //evaluates whether barstate is confirmed and count is equal to the given x
    strategy.entry("Long", strategy.long) //Enter Long

松文脚本:连续绿色条 /蜡烛进入X之后

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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