花开浅夏

文章 评论 浏览 28

花开浅夏 2025-02-20 21:27:52

您可以使用jQuery更改“获取按钮元素”并更改标签,当内容准备就绪或打开下拉列表时,这可以使用,请检查事件。

实现自己的按钮:

$('...').dxTagBox({
   items: [...],
   showSelectionControls: true,
   applyValueMode: 'useButtons',

   dropDownOptions: {

       toolbarItems: [
       {
           location: "center",
           options: {
               text: 'CUSTOM OK', 
               onClick: function() {
                  // Check documentation
                  // Get selected items
                  // Apply to the tagBox instance
                  }, 
            
              },
           shortcut: "done",
           toolbar: "bottom" 
       }
           ...
       ]

   }
});

You could change get the button elements with jquery and change the label, this works when the content is ready or when the dropdown is open, check the events.

Or

Implement your own buttons:

$('...').dxTagBox({
   items: [...],
   showSelectionControls: true,
   applyValueMode: 'useButtons',

   dropDownOptions: {

       toolbarItems: [
       {
           location: "center",
           options: {
               text: 'CUSTOM OK', 
               onClick: function() {
                  // Check documentation
                  // Get selected items
                  // Apply to the tagBox instance
                  }, 
            
              },
           shortcut: "done",
           toolbar: "bottom" 
       }
           ...
       ]

   }
});

使用DeVexTreme Vue组件,是否有任何方法可以自定义默认按钮'标签,就像“确定”和“取消”

花开浅夏 2025-02-20 18:27:51

实际上,这要简单得多。

您不必定义字符串,绝对不使用exec。只需使用功能指针:

class a:
    def one():
        return "one"
    
    def two():
        return "two"

b = [a.one, a.two]

c = []
for i in b:
    c.append(i())

print(c)
# output: [one, two]

It's actually much simpler than that.

You don't have to define strings, and definitely don't use exec. Just use function pointers:

class a:
    def one():
        return "one"
    
    def two():
        return "two"

b = [a.one, a.two]

c = []
for i in b:
    c.append(i())

print(c)
# output: [one, two]

使用循环动态运行功能

花开浅夏 2025-02-20 14:34:22

有选项,文件名可能会被打破。当您在不同系统之间复制filepath时,您可能会遇到编码问题。请参阅此处的表 filesystem编码和php

在那里,做到了。

当您迭代文件并将名称转换为可以看到字节差异的内容时,您可以确定这些问题。这很重要,因为MD5将对其存储方式而不是打印的方式来看。

There is the option, that filenames can be broken. When you copied filepaths between different systems you can have encoding issues. See the table here Filesystem encoding and PHP.

table comparing different encoded filenames and its behaviour on different os

been there, done that.

You can identify these issues when you iterate over files and convert the names to something where you can see byte differences. This is important as md5 will look onto the texts how it is stored rather how it is printed.

Shopware 6媒体文件路径来自数据库/MySQL

花开浅夏 2025-02-20 08:52:21
#container-txt>ul>li {
  display: flex;
  align-items: center;
  color: var(--terciary-color);
  font-weight: 700;
  list-style-position: inside;
  list-style-type: none;
  margin-bottom: 0.3rem;
}

#container-txt>ul>li svg {
  height: 12px;
  margin-right: 5px;
}
<main class="intro">
  <div id="container-txt">
    <h1>Share your unfiltered<br>thoughts. Get paid.</h1>
    <p class="paragraph">Spense is an open platform for individuals to share their unfiltered thougths.<br>Discuss the topics you love, and get paid for doing <em>just</em> that.</p>

    <ul>
      <li> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https: //fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/></svg>Receive
        99% off the earnings.</li>
      <li> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https: //fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/></svg>Get
        paid via Debit Card, ACH or PayPal.</li>
      <li> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https: //fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/></svg>Withdraw
        your earnings anytime.</li>
    </ul>
  </div>
</main>

- #容器&gt; ul&gt; li set <代码>显示:flex 和align-items:中心

#container-txt>ul>li {
  display: flex;
  align-items: center;
  color: var(--terciary-color);
  font-weight: 700;
  list-style-position: inside;
  list-style-type: none;
  margin-bottom: 0.3rem;
}

#container-txt>ul>li svg {
  height: 12px;
  margin-right: 5px;
}
<main class="intro">
  <div id="container-txt">
    <h1>Share your unfiltered<br>thoughts. Get paid.</h1>
    <p class="paragraph">Spense is an open platform for individuals to share their unfiltered thougths.<br>Discuss the topics you love, and get paid for doing <em>just</em> that.</p>

    <ul>
      <li> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https: //fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/></svg>Receive
        99% off the earnings.</li>
      <li> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https: //fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/></svg>Get
        paid via Debit Card, ACH or PayPal.</li>
      <li> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https: //fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/></svg>Withdraw
        your earnings anytime.</li>
    </ul>
  </div>
</main>

-#container>ul>li set display:flex and align-items:center.

如何将列表图标及其内容集中?

花开浅夏 2025-02-19 12:00:34

您可以将问题分为两个步骤:

  • join_date ”的“ join_date ”值过滤
  • 使用本月更改
  • 您的“ join_date ”值em> join_date “以及该日期的最后一天(&gt;&gt;这将处理leap Yeles Kinda 有效地wrt其他解决方案,这些解决方案试图每次检查特定年份)
WITH cte AS (
    SELECT emp_no,
           join_date,
           STR_TO_DATE(CONCAT_WS('-',
                                 YEAR (CURRENT_DATE()),
                                 MONTH(join_date     ),
                                 DAY  (join_date     )),
                       '%Y-%m-%d') AS join_date_now
    FROM tab 
    WHERE MONTH(join_date) = MONTH(CURRENT_DATE())
      AND YEAR(join_date)  < YEAR(CURRENT_DATE())
)
SELECT emp_no,
       join_date,
       LEAST(join_date_now, LAST_DAY(join_date_now)) AS anniversary_date
FROM cte

在这里

检查演示 ,由于您想查看2月的几个月,而我们在7月,因此条款将包含一个额外的-5在检查月份的同时。

You can split your problem into two steps:

  • filtering your "join_date" values using the current month
  • changing the year to your "join_date"
  • getting the minimum value between your updated "join_date" and the last day for that date (>> this will handle leap years kinda efficiently wrt other solutions that attempt to check for specific years every time)
WITH cte AS (
    SELECT emp_no,
           join_date,
           STR_TO_DATE(CONCAT_WS('-',
                                 YEAR (CURRENT_DATE()),
                                 MONTH(join_date     ),
                                 DAY  (join_date     )),
                       '%Y-%m-%d') AS join_date_now
    FROM tab 
    WHERE MONTH(join_date) = MONTH(CURRENT_DATE())
      AND YEAR(join_date)  < YEAR(CURRENT_DATE())
)
SELECT emp_no,
       join_date,
       LEAST(join_date_now, LAST_DAY(join_date_now)) AS anniversary_date
FROM cte

Check the demo here

Note: in the demo, since you want to look at February months and we are in July, the WHERE clause will contain an additional -5 while checking the month.

如何在MySQL中在周年纪念日处理LEAP年纪念日

花开浅夏 2025-02-18 09:33:23

您可以用指定的值替换生成序列的中间:

seq(min(variable), max(variable), length.out = 5) -> x        
x[which(x == median(x))] <- 0

#-73.00 -25.75   0.00  68.75 116.00

如果length(x)是奇数,则可以使用。

You can replace the median of the generated sequence with a specified value:

seq(min(variable), max(variable), length.out = 5) -> x        
x[which(x == median(x))] <- 0

#-73.00 -25.75   0.00  68.75 116.00

This would work if the length(x) is odd.

如何以零作为中点创建一个从min到最大的数字序列?

花开浅夏 2025-02-18 05:38:21

您可以使用列表理解。

import json

json_string = """{
  "total": 4,
  "page": 0,
  "page_size": 100,
  "result": [
    {
      "address": "0xd2",
      "id": "632",
      "amount": "1",
      "name": "Avengers",
      "group": "Marvel",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    },
    {
      "address": "0xd2",
      "id": "315",
      "amount": "1",
      "name": "Avengers",
      "group": "Marvel",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    },
    {
      "address": "0xd2",
      "id": "432",
      "amount": "1",
      "name": "Avengers",
      "group": "Marvel",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    },
{
      "address": "0x44",
      "id": "100",
      "amount": "1",
      "name": "Suicide Squad",
      "group": "DC",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    }
  ],
  "status": "SYNCED"
}"""

json_dict = json.loads(json_string)

result = [elem['id'] for elem in json_dict['result'] if elem['address'] == '0xd2']

print(result)

输出:

['632', '315', '432']

You can use a list comprehension.

import json

json_string = """{
  "total": 4,
  "page": 0,
  "page_size": 100,
  "result": [
    {
      "address": "0xd2",
      "id": "632",
      "amount": "1",
      "name": "Avengers",
      "group": "Marvel",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    },
    {
      "address": "0xd2",
      "id": "315",
      "amount": "1",
      "name": "Avengers",
      "group": "Marvel",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    },
    {
      "address": "0xd2",
      "id": "432",
      "amount": "1",
      "name": "Avengers",
      "group": "Marvel",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    },
{
      "address": "0x44",
      "id": "100",
      "amount": "1",
      "name": "Suicide Squad",
      "group": "DC",
      "uri": "https://google.com/",
      "metadata": null,
      "synced_at": "2022-05-26T22:52:34.113Z",
      "last_sync": "2022-05-26T22:52:34.113Z"
    }
  ],
  "status": "SYNCED"
}"""

json_dict = json.loads(json_string)

result = [elem['id'] for elem in json_dict['result'] if elem['address'] == '0xd2']

print(result)

Output:

['632', '315', '432']

如果我匹配单独的键,则在此数据集上迭代该数据集的所有匹配值是什么?

花开浅夏 2025-02-17 20:13:18

如上所述,解决方案是在导入其他任何内容之前简单地导入msal.ps模块。在我的代码主页的顶部,我只是添加了import -module -name msal.ps -force,然后才能正常工作。即使该模块已经安装和导入,也需要在其他任何内容之前进行导入。

希望将来对其他人解决这个问题。

As NiMux stated above, the solution is to simply import the MSAL.PS module before importing anything else. At the top of the main page of my code I simply added Import-Module -Name MSAL.PS -Force and I got it to work properly. Even though the module was already installed and imported, it needs to be imported before anything else.

Hopefully this helps somebody else with this issue in the future.

Get-Msaltoken:属性&#x27;权威&#x27;在这个对象上找不到

花开浅夏 2025-02-17 06:54:05

嘿,您可以在行儿童中使用图标和点之间的垫片()。 额外宽度 -

Row(
  children: [
     Icon(),   
     Icon(),   
     Icon(),  
     Spacer(),
     DotsIndicator(),
     Spacer(), 
  ],
),

这是展开 widget and row的另一个示例

Row(
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
         Icon(),   
         Icon(),   
         Icon(),  
         Expanded(
           child: Center(
             child: DotsIndicator(),
           )
         ),
      ],
    ),

Row(
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
         Icon(),   
         Icon(),   
         Icon(),  
         Expanded(
           child: Center(
             child: DotsIndicator(),
           )
         ),
        Icon(),  
      ],
    ),
 

垫片窗口小部件自动在下面的 href =“ https://api.flutter.dev/flutter/widgets/spacer-class.html” rel =“ nofollow noreferrer”> spacer 和
展开

Hey you can use Spacer() between icons and dot in row children . Spacer widget auto take extra width like below -

Row(
  children: [
     Icon(),   
     Icon(),   
     Icon(),  
     Spacer(),
     DotsIndicator(),
     Spacer(), 
  ],
),

Here is another example with Expanded widget and row, Expanded will automatically take rest of width other then icons

Row(
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
         Icon(),   
         Icon(),   
         Icon(),  
         Expanded(
           child: Center(
             child: DotsIndicator(),
           )
         ),
      ],
    ),

// UI with left and right icons

Row(
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
         Icon(),   
         Icon(),   
         Icon(),  
         Expanded(
           child: Center(
             child: DotsIndicator(),
           )
         ),
        Icon(),  
      ],
    ),
 

For you reference - Spacer and
Expanded

颤音:对齐中心一个特定的孩子窗口小部件

花开浅夏 2025-02-16 19:48:17

不要将返回的值从 input()传递给可能导致异常的任何函数,而无需处理这种可能性。该答案包括用于处理输入的通用功能。

该代码假定指定的范围是包容性的。

def getInput(prompt, t=str):
    while True:
        v = input(f'{prompt}: ')
        try:
            return t(v)
        except ValueError:
            print('Invalid input')

start = getInput('From', int)
step = getInput('Step', int)
to  = getInput('To', int)

total = list(range(start, to+1, step)) or [0]

sum_ = sum(total)

print(f'The sum is: {sum_}')
print(f'The average is: {sum_/len(total)}')

示例:

From: 1
Step: 5
To: 100
The sum is: 970
The average is: 48.5

Don't pass a value returned from input() to any function that might result in an exception without handling such a possibility. This answer includes a general-purpose function for handling input.

This code assumes that the specified range is inclusive.

def getInput(prompt, t=str):
    while True:
        v = input(f'{prompt}: ')
        try:
            return t(v)
        except ValueError:
            print('Invalid input')

start = getInput('From', int)
step = getInput('Step', int)
to  = getInput('To', int)

total = list(range(start, to+1, step)) or [0]

sum_ = sum(total)

print(f'The sum is: {sum_}')
print(f'The average is: {sum_/len(total)}')

Example:

From: 1
Step: 5
To: 100
The sum is: 970
The average is: 48.5

计算平均水平

花开浅夏 2025-02-16 19:32:49

你可以这样做

Person youngestPerson = listOfPersons.stream()
.reduce((p1, p2) -> LocalDateTime.parse(p1.getStringDateofBirth()).isAfter(LocalDateTime.parse(p2.getStringDateofBirth()))?p1:p2)
.orElse(null)

You can do like this

Person youngestPerson = listOfPersons.stream()
.reduce((p1, p2) -> LocalDateTime.parse(p1.getStringDateofBirth()).isAfter(LocalDateTime.parse(p2.getStringDateofBirth()))?p1:p2)
.orElse(null)

从List&Lt; Phore&Gt;获得最年轻的人;在弦乐中,人在弦乐中有出生日期

花开浅夏 2025-02-16 18:57:31

您可以利用FuzzyWuzzy Python库,

from fuzzywuzzy import fuzz

TotalTags = ["citrus", "orange", "vitamin-C", "sweet", "yellow", "vitamin-A"] #etc
LikedTags = ["citrus", "orange", "vitamin-D"]


per = fuzz.ratio(TotalTags,LikedTags)
per

 65

此方法如果您只想匹配项目,则可以直接匹配两个列表的字符,然后可以使用Jaccard相似方法。

you can utilizes fuzzywuzzy python library

from fuzzywuzzy import fuzz

TotalTags = ["citrus", "orange", "vitamin-C", "sweet", "yellow", "vitamin-A"] #etc
LikedTags = ["citrus", "orange", "vitamin-D"]


per = fuzz.ratio(TotalTags,LikedTags)
per

 65

This method directly match the characters of the two list if you want to just match the items then you can used Jaccard similarity method.

如何查看两个字符串列表的匹配百分比?

花开浅夏 2025-02-16 05:38:26

这是因为您将名称 prop传递给问题组件,而不是问题
问题的解决方案。

It is because you passing down a name prop to Question component and not a question.
Solution in Questions.js: return <Question key={question.id} question={question} />

为什么要“问题”不明确的? [反应]

花开浅夏 2025-02-15 23:16:29

您可以右键单击架构,然后单击从文件中单击导入数据。您将看到一个窗口弹出,并在其中指定分隔符,标头等以及预览。

You can right click on the schema and click on import data from file like below. You will see a window pop up where you specify separators, headers, etc along with a preview.
enter image description here

如何在DataGrip中使用本地驱动器文件夹作为数据源?

花开浅夏 2025-02-15 12:12:59

使用Persistent_bottom_nav_bar将底部导航栏保持到所有屏幕。

https://pub.dev/packages/persistent_bottom_bottom_nav_bar

Use persistent_bottom_nav_bar for keep bottom navigation bar to all the screens.

https://pub.dev/packages/persistent_bottom_nav_bar

GetX转到新的布局/屏幕,然后隐藏底部导航栏。当我得到时,底部的导航仍然出现。

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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