淤浪

文章 评论 浏览 30

淤浪 2025-02-21 01:04:27

您可以首先尝试另一种方式;使用

Data source =“serverName”;initial catalog=“dbname”; integrated security=true”

如果有效,则问题可能在您的凭据(用户名,密码)中。

You can first try the other way; use

Data source =“serverName”;initial catalog=“dbname”; integrated security=true”

If it works, then the problem is probably in your credentials (username, password).

试图从我的应用程序建立连接时的SQL错误

淤浪 2025-02-20 20:42:01

您需要从 .card-annuaire 直接删除保证金:

.card-annuaire {
      background:green;
            border:0;
            border-radius: 0;
            .card-body {
                text-align: center;
            }

更新

如果双方的边距

.card-annuaire {
      background:green;
            border:0;
            border-radius: 0;
            margin:0 1rem;
            .card-body {
                text-align: center;
            }

,则可以这样做:

.azer {
  background: red;
}

.card-annuaire {
  background:green;
        border:0;
        border-radius: 0;
        margin:0 1rem;
        .card-body {
            text-align: center;
        }
    }
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
  <div class="row justify-content-center my-5">
    <div class="col-12">
      <div class="qsdf" >
        <div class="azer">
          <div class="col-md-12">
            <div class="row g-0">
              <div class="col-md-3 grid-item-annuaire letter-<?= $first_letter; ?>">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
              <div class="col-md-3 grid-item-annuaire letter">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" alt="pic" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
              <div class="col-md-3 grid-item-annuaire letter-<?= $first_letter; ?>">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
              <div class="col-md-3 grid-item-annuaire letter-<?= $first_letter; ?>">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

You need to remove margin right from .card-annuaire Like this:

.card-annuaire {
      background:green;
            border:0;
            border-radius: 0;
            .card-body {
                text-align: center;
            }

Update

If you margin on both sides then you can do:

.card-annuaire {
      background:green;
            border:0;
            border-radius: 0;
            margin:0 1rem;
            .card-body {
                text-align: center;
            }

.azer {
  background: red;
}

.card-annuaire {
  background:green;
        border:0;
        border-radius: 0;
        margin:0 1rem;
        .card-body {
            text-align: center;
        }
    }
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
  <div class="row justify-content-center my-5">
    <div class="col-12">
      <div class="qsdf" >
        <div class="azer">
          <div class="col-md-12">
            <div class="row g-0">
              <div class="col-md-3 grid-item-annuaire letter-<?= $first_letter; ?>">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
              <div class="col-md-3 grid-item-annuaire letter">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" alt="pic" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
              <div class="col-md-3 grid-item-annuaire letter-<?= $first_letter; ?>">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
              <div class="col-md-3 grid-item-annuaire letter-<?= $first_letter; ?>">
                <div class="card card-annuaire mb-4">
                  <div class="card-body">
                    <div class="card-text entry-content"><img src="https://picsum.photos/100" />
                    </div><!-- /.card-text -->
                  </div><!-- /.card-body -->
                </div><!-- /.card  -->
              </div><!-- /.col  -->
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

带有bootstrap的卡之间的边距

淤浪 2025-02-20 17:36:30

那个JSON无效。
我刚刚将其粘贴到JSON验证器中,并且其中有错误。

检查此链接:

json lint

在那里粘贴您的JSON,它会引发以下错误:

Error: Parse error on line 30:
..._mode": "replace",   }}
----------------------^
Expecting 'STRING', got '}'

如果您使用的是Python,它通常会投掷它由于字符串引号引起的错误。
尝试将脚本源字段包装在单引号而不是双人物中。那可能是另一个问题。

最后但并非最不重要的一点是,功能得分查询非常慢,我建议不要使用它们!

That json is invalid.
I just pasted it into a json validator and it has errors in it.

CHeck this link:

json lint

Paste your json there, it throws the following errors:

Error: Parse error on line 30:
..._mode": "replace",   }}
----------------------^
Expecting 'STRING', got '}'

If you are using python it often throws errors due to string quotation as well.
Try to enclose the script source field in single quotes instead of doubles. That could be another problem.

Last but not the least, function score queries are extremely slow, and I would recommend not using them!

如何更改JSON文件以可读?

淤浪 2025-02-20 16:23:35

您应该考虑更复杂的样式规则的优先级。您想更改的文本元素可能具有自己的类,您需要在规则中使用它。

我分叉了一个示例,添加了自定义类 .test ,我的规则奏效了。

就我而言,要更改多行工具提示文本的颜色,我必须使用这样的规则:

.test .multi-line { color: ...; }

请参阅fork

You should consider the priority of more complex style rules. Probably the text element you want to change has an own class, and you need to use it in your rule.

I forked an example, added custom class .test and my rules worked.

In my case, to change the color of multi-line tooltip text I had to use such rule:

.test .multi-line { color: ...; }

See the fork

无法设计自定义的React-Tooltip类

淤浪 2025-02-20 12:48:56
steps:
- powershell: |
   #get token
   $TENANTID="xxx"
   $APPID="xxx"
   $PASSWORD="xxx"
   $result=Invoke-RestMethod -Uri https://login.microsoftonline.com/$TENANTID/oauth2/token?api-version=1.0 -Method Post -Body @{"grant_type" = "client_credentials"; "resource" = "https://management.core.windows.net/"; "client_id" = "$APPID"; "client_secret" = "$PASSWORD" }
   $token=$result.access_token
   
   ##set Header
   $Headers=@{
       'authorization'="Bearer $token"
       'host'="management.azure.com"
   }
   
   $functions = Invoke-RestMethod  -Uri "https://management.azure.com/subscriptions/<subcription id>/resourceGroups/<resource group name>/providers/Microsoft.Web/sites/<function app name>/functions?api-version=2015-08-01"  -Headers $Headers -ContentType "application/json" -Method GET
   
   
   if($functions.value.Count -eq 4) {
       # make pipeline to succeed
       Write-Host 'Function deployment success.'
       exit 0
   }
   else {
       Write-Host 'Function deployment failed.'
       exit 1
   }
   
   
  displayName: 'Check whether the function app deployment completed.'

如果您有担忧,请告诉我。

steps:
- powershell: |
   #get token
   $TENANTID="xxx"
   $APPID="xxx"
   $PASSWORD="xxx"
   $result=Invoke-RestMethod -Uri https://login.microsoftonline.com/$TENANTID/oauth2/token?api-version=1.0 -Method Post -Body @{"grant_type" = "client_credentials"; "resource" = "https://management.core.windows.net/"; "client_id" = "$APPID"; "client_secret" = "$PASSWORD" }
   $token=$result.access_token
   
   ##set Header
   $Headers=@{
       'authorization'="Bearer $token"
       'host'="management.azure.com"
   }
   
   $functions = Invoke-RestMethod  -Uri "https://management.azure.com/subscriptions/<subcription id>/resourceGroups/<resource group name>/providers/Microsoft.Web/sites/<function app name>/functions?api-version=2015-08-01"  -Headers $Headers -ContentType "application/json" -Method GET
   
   
   if($functions.value.Count -eq 4) {
       # make pipeline to succeed
       Write-Host 'Function deployment success.'
       exit 0
   }
   else {
       Write-Host 'Function deployment failed.'
       exit 1
   }
   
   
  displayName: 'Check whether the function app deployment completed.'

If you have concerns, let me know.

通过DevOps Pipeline在Azure中的功能APP上检查功能

淤浪 2025-02-20 11:35:39

您的代码中还有很多关键错误(除了错误的凹痕 - 我认为这是一个格式化问题):

  • 根据 [python.docs]:ctypes-结构和工会强调是我的):

    结构和工会必须源自结构 href =“ https://docs.python.org/library/ctypes.html#ctypes.union” rel =“ nofollow noreferrer”> Union> Union> Union 在 ctypes 模块。 每个子类都必须定义A _Fields _ 属性 _fields _ 必须是 2-tuples 的列表>

    所以,它是 _fields _ lundscores ))

  • 始终定义 argtypes Restype 用于通过 ctypes 调用的功能。检查 [so]:c函数从python通过ctypes返回不正确的值(@cristifati的答案)有关更多详细信息

    >

  • 不是重要的详细信息

    ,但是在使用 winapi 时,请使用定义某些类型的 wintypes 模块(实际上是别名)

我对您的代码进行了一些改进:

  • 移动了 cbsize 成员在初始化器中设置了,因此每次班级都会实例化

    时,不再需要

  • cbsize 构件设置在初始化器中,因此每次 ence 按下 时,

code00.py

#!/usr/bin/env python

import ctypes as ct
import msvcrt
import sys
import time
from ctypes import wintypes as wt


class LASTINPUTINFO(ct.Structure):
    _fields_ = (
        ("cbSize", wt.UINT),
        ("dwTime", wt.DWORD),
    )

    def __init__(self, dwTime=0):
        super().__init__(ct.sizeof(self.__class__), dwTime)


PLASTINPUTINFO = ct.POINTER(LASTINPUTINFO)


kernel32 = ct.WinDLL("Kernel32")
user32 = ct.WinDLL("User32")

GetTickCount = kernel32.GetTickCount
GetTickCount.argtypes = ()
GetTickCount.restype = wt.DWORD

GetLastInputInfo = user32.GetLastInputInfo
GetLastInputInfo.argtypes = (PLASTINPUTINFO,)
GetLastInputInfo.restype = wt.BOOL


def get_last_input():
    lii = LASTINPUTINFO()
    GetLastInputInfo(ct.byref(lii))
    run_time = GetTickCount()
    print("\nLast input time: {:d}\nTick count: {:d}\nElapsed: {:d}".format(lii.dwTime, run_time, run_time - lii.dwTime))


def main(*argv):
    while True:
        get_last_input()
        time.sleep(1)
        if msvcrt.kbhit():
            if ord(msvcrt.getch()) == 0x1B:
                break


if __name__ == "__main__":
    print("Python {:s} {:03d}bit on {:s}\n".format(" ".join(elem.strip() for elem in sys.version.split("\n")),
                                                   64 if sys.maxsize > 0x100000000 else 32, sys.platform))
    rc = main(*sys.argv[1:])
    print("\nDone.")
    sys.exit(rc)

输出(在移动鼠标和按键时运行程序):

  [cfati@cfati-5510-0:e:\ work \ dev \ stackoverflow \ q072887838]&gt; ”
Python 3.9.9(标签/v3.9.9:CCB0E6A,2021,18:08:50)[MSC V.1929 64 BIT(AMD64)] 064BIT


最后输入时间:392676796
刻度计数:392676921
过去:125

最后输入时间:392676921
刻度计数:392677937
过去:1016

最后输入时间:392676921
刻度计数:392678953
过去:2032

最后输入时间:392676921
刻度计数:392679968
过去:3047

最后输入时间:392676921
刻度计数:392680968
过去:4047

最后输入时间:392681421
刻度计数:392681984
过去:563

最后输入时间:392682812
刻度计数:392682984
过去:172

最后输入时间:392683937
刻度计数:392684000
过去:63

最后输入时间:392684078
刻度计数:392685000
过去:922

最后输入时间:392685687
刻度计数:392686015
经过:328

最后输入时间:392686828
刻度计数:392687031
过去:203

最后输入时间:392688046
刻度计数:392688046
过去:0

最后输入时间:392688484
刻度计数:392689062
过去:578

完毕。
 

There are a bunch of critical errors in your code (besides the wrong indentation - which I consider a formatting issue):

I modified your code with some improvements:

  • Moved the cbSize member set in the initializer, so it is no longer necessary every time the class gets instantiated

  • Exit when Esc is pressed

code00.py:

#!/usr/bin/env python

import ctypes as ct
import msvcrt
import sys
import time
from ctypes import wintypes as wt


class LASTINPUTINFO(ct.Structure):
    _fields_ = (
        ("cbSize", wt.UINT),
        ("dwTime", wt.DWORD),
    )

    def __init__(self, dwTime=0):
        super().__init__(ct.sizeof(self.__class__), dwTime)


PLASTINPUTINFO = ct.POINTER(LASTINPUTINFO)


kernel32 = ct.WinDLL("Kernel32")
user32 = ct.WinDLL("User32")

GetTickCount = kernel32.GetTickCount
GetTickCount.argtypes = ()
GetTickCount.restype = wt.DWORD

GetLastInputInfo = user32.GetLastInputInfo
GetLastInputInfo.argtypes = (PLASTINPUTINFO,)
GetLastInputInfo.restype = wt.BOOL


def get_last_input():
    lii = LASTINPUTINFO()
    GetLastInputInfo(ct.byref(lii))
    run_time = GetTickCount()
    print("\nLast input time: {:d}\nTick count: {:d}\nElapsed: {:d}".format(lii.dwTime, run_time, run_time - lii.dwTime))


def main(*argv):
    while True:
        get_last_input()
        time.sleep(1)
        if msvcrt.kbhit():
            if ord(msvcrt.getch()) == 0x1B:
                break


if __name__ == "__main__":
    print("Python {:s} {:03d}bit on {:s}\n".format(" ".join(elem.strip() for elem in sys.version.split("\n")),
                                                   64 if sys.maxsize > 0x100000000 else 32, sys.platform))
    rc = main(*sys.argv[1:])
    print("\nDone.")
    sys.exit(rc)

Output (run the program while moving mouse and pressing keys):

[cfati@CFATI-5510-0:e:\Work\Dev\StackOverflow\q072887838]> "e:\Work\Dev\VEnvs\py_pc064_03.09_test0\Scripts\python.exe" ./code00.py
Python 3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)] 064bit on win32


Last input time: 392676796
Tick count: 392676921
Elapsed: 125

Last input time: 392676921
Tick count: 392677937
Elapsed: 1016

Last input time: 392676921
Tick count: 392678953
Elapsed: 2032

Last input time: 392676921
Tick count: 392679968
Elapsed: 3047

Last input time: 392676921
Tick count: 392680968
Elapsed: 4047

Last input time: 392681421
Tick count: 392681984
Elapsed: 563

Last input time: 392682812
Tick count: 392682984
Elapsed: 172

Last input time: 392683937
Tick count: 392684000
Elapsed: 63

Last input time: 392684078
Tick count: 392685000
Elapsed: 922

Last input time: 392685687
Tick count: 392686015
Elapsed: 328

Last input time: 392686828
Tick count: 392687031
Elapsed: 203

Last input time: 392688046
Tick count: 392688046
Elapsed: 0

Last input time: 392688484
Tick count: 392689062
Elapsed: 578

Done.

Python找不到结构类的DWTime属性

淤浪 2025-02-19 20:10:58

请尝试此(简单的内部加入)

SELECT e.EmployeeID, e.firstName, p.ProjectName
FROM Employee e
JOIN ProjectDetail p
ON e.EmployeeID = p.EmployeeDetailID

如果您只想要超过1个项目的员工,

SELECT e.EmployeeID, e.firstName, p.ProjectName
FROM Employee e
JOIN ProjectDetail p
ON e.EmployeeID = p.EmployeeDetailID
WHERE 
    (SELECT COUNT(1) FROM ProjectDetail p2
    WHERE p2.EmployeeDetailID = p.EmployeeDetailID) > 1

Try this (a simple INNER JOIN)

SELECT e.EmployeeID, e.firstName, p.ProjectName
FROM Employee e
JOIN ProjectDetail p
ON e.EmployeeID = p.EmployeeDetailID

If you want only employees with more than 1 project

SELECT e.EmployeeID, e.firstName, p.ProjectName
FROM Employee e
JOIN ProjectDetail p
ON e.EmployeeID = p.EmployeeDetailID
WHERE 
    (SELECT COUNT(1) FROM ProjectDetail p2
    WHERE p2.EmployeeDetailID = p.EmployeeDetailID) > 1

从有条件的2个表中选择值

淤浪 2025-02-19 02:41:56

首先设置了React中的状态是异步操作,因此

    setList(response)
    console.log(response)
    console.log(ListVille)

控制台将显示 Listville 的旧值,

如果您想要当前值,则可以在SET状态的Prev值中看到它。

setList(response)
console.log(response)
setList(prev => {
  console.log(prev)
  return prev;
})

其次,在每个组件渲染上使用使用效果而无需一系列依赖关系,因此,如果要在组件安装座上调用此功能,则需要设置一个空的依赖项数组。

First set a state in react is an asynchronous operation, so

    setList(response)
    console.log(response)
    console.log(ListVille)

console will show the old value of ListVille

If you want the current value, you can see it inside the prev value of set state.

setList(response)
console.log(response)
setList(prev => {
  console.log(prev)
  return prev;
})

Second, using useEffect without an array of dependencies will run on each component render, so if you want to call this function on the component mount, you need to set an empty array of dependencies.

setState在提取API方法之后不停地设置

淤浪 2025-02-19 01:34:07

您应该在列表中使用 zip ,如下所示:

list1 = ['a', 'b', 'c']
list2 = ['d', 'e', 'f']

list3 = [a+b for a, b in zip(list1, list2)]

print(list3)

输出:

['ad', 'be', 'cf']

You should use zip in conjunction with a list comprehension as follows:

list1 = ['a', 'b', 'c']
list2 = ['d', 'e', 'f']

list3 = [a+b for a, b in zip(list1, list2)]

print(list3)

Output:

['ad', 'be', 'cf']

如何将列表中的单词结合在一起?

淤浪 2025-02-18 08:07:24

最后,我找到了解决方案。
仅将依赖项添加到 build.sbt 内置连接器

libraryDependencies ++= Seq(
    "org.apache.spark" %% "spark-core" % "3.3.0",
    "org.apache.spark" %% "spark-sql" % "3.3.0",
    "joda-time" % "joda-time" % "2.10.14",
    "com.typesafe" % "config" % "1.4.1",
    // "org.mongodb.spark" % "mongo-spark-connector" % "10.0.2",
    "com.microsoft.sqlserver" % "mssql-jdbc" % "10.2.1.jre11",
    "mysql" % "mysql-connector-java" % "8.0.29",
    "org.postgresql" % "postgresql" % "42.4.0",
    "com.oracle.database.jdbc" % "ojdbc8" % "21.6.0.0.1",
    "org.mariadb.jdbc" % "mariadb-java-client" % "3.0.5",
)

Finally, I found the solution for this.
Only add dependencies to build.sbt for the built-in connector

libraryDependencies ++= Seq(
    "org.apache.spark" %% "spark-core" % "3.3.0",
    "org.apache.spark" %% "spark-sql" % "3.3.0",
    "joda-time" % "joda-time" % "2.10.14",
    "com.typesafe" % "config" % "1.4.1",
    // "org.mongodb.spark" % "mongo-spark-connector" % "10.0.2",
    "com.microsoft.sqlserver" % "mssql-jdbc" % "10.2.1.jre11",
    "mysql" % "mysql-connector-java" % "8.0.29",
    "org.postgresql" % "postgresql" % "42.4.0",
    "com.oracle.database.jdbc" % "ojdbc8" % "21.6.0.0.1",
    "org.mariadb.jdbc" % "mariadb-java-client" % "3.0.5",
)

Spark Can可以使用内置连接提供商连接到DB

淤浪 2025-02-18 01:27:47

数据类型在电源查询中很重要。

当您从另一个日期中减去一个日期时,结果是持续时间数据类型。

为了在持续时间内添加一个数字,您可以首先将持续时间转换为数字。

将您的公式段修改为以下内容: duration.days([数据日期] - [plan_actual_start_date])+1

Datatypes are important in Power Query.

When you subtract one date from another, the result is a duration data type.

In order to add a number to a duration, you can first convert the duration to a number.

Modify your formula segments to something like: Duration.Days([Data Date]-[Plan_Actual_Start_Date]) +1

Expression.Error:我们不能应用操作员&#x2B;到类型持续时间和数字

淤浪 2025-02-17 14:03:43

image.open() 期望有一个文件名, pathlib.path 或类似io的对象,但是您将其传递给 St.Image(IMG)的输出,哪个将是一个简化的Deltagenerator对象(本质上是简化元素)。由于 St.Image(IMG)的输出不是文件名(IE字符串),也不是 pathlib.path.path 对象, image.open()< /code>假设它是类似IO的对象,因此为什么它试图调用 .seek()方法(Deltagenerator对象不提供该方法,这会导致错误)。

从您的代码来看,我假设 img 表示您要显示的某些图像的文件名。如果是这种情况,您可能需要更改代码,以便先将图像加载到Numpy阵列中,然后在简化中渲染已加载的图像,然后从中进行预测:

def loadImage(image):
    np_image = Image.open(image)
    np_image = np.array(np_image).astype('float32') / 255
    np_image = transform.resize(np_image, (224, 224, 3))
    #  np_image = np.expand_dims(np_image, axis=0)
    return np_image

def predictions(model, breed_list, image):
    probabilities = model.predict(loadImage(image))
    return probabilities

loaded_img = loadImage(img)
st.image(img)
list = predictions(model=model, breed_list=breed_list, image=loaded_img)

另外,以及一边:减少困惑,我强烈建议重命名 list in list = listions(...)对与python内置不冲突的东西 list ,也许是预测之类的东西。

Image.open() is expecting a filename, pathlib.Path, or IO-like object, but you're passing it the output of st.image(img), which is going to be a Streamlit DeltaGenerator object (essentially a Streamlit element). As the output of st.image(img) is not a filename (i.e. string) and is not a pathlib.Path object, Image.open() is assuming it to be an IO-like object, hence why it's trying to call the .seek() method (which DeltaGenerator objects don't provide, which then caused the error).

Judging by your code, I assume img represents the filename of some image you want to display. If this is this case, you might want to change your code so as to load the image into a numpy array first, then render the loaded image in Streamlit, then make your predictions from it:

def loadImage(image):
    np_image = Image.open(image)
    np_image = np.array(np_image).astype('float32') / 255
    np_image = transform.resize(np_image, (224, 224, 3))
    #  np_image = np.expand_dims(np_image, axis=0)
    return np_image

def predictions(model, breed_list, image):
    probabilities = model.predict(loadImage(image))
    return probabilities

loaded_img = loadImage(img)
st.image(img)
list = predictions(model=model, breed_list=breed_list, image=loaded_img)

Additionally, and as an aside: to reduce confusion, I would strongly recommend renaming list in list = predictions(...) to something that doesn't conflict with the Python built-in list, perhaps to something like predicted.

shartlit.errors.streamlitapiexception:`seek()`不是有效的spainlit命令

淤浪 2025-02-17 09:29:33

您明确要求在此行中调用 add_size

size_command = add_size(size_combobox, display_size)

您需要将其更改以使用lambda或functools.partial:partial:

size_command = lambda: add_size(size_combobox, display_size)

You're explicitly asking for add_size to be called in this line:

size_command = add_size(size_combobox, display_size)

You need to change it to use lambda or functools.partial:

size_command = lambda: add_size(size_combobox, display_size)

tkinter函数来自课堂外部,立即称为

淤浪 2025-02-17 07:49:20

如果您使用正则表达式,则需要将字符串逃脱为 preg_quote() a>会这样做,因为一个点属于模式。

但是,在您的简单情况下,我不会使用正则表达式,而只是从字符串末端搜索三个点。

注意:Elipsis来自浏览器时,无法在PHP中检测到

$title = 'The phrase... (author).';
echo getPlainTitle($title);

function getPlainTitle(string $title) {
    $rpos = strrpos($title, '...');
    return ($rpos === false) ? $title : substr($title, 0, $rpos);
}

将输出

The phrase

If you use regex you need to escape the string as preg_quote() would do, because a dot belongs to the pattern.

But in your simple case, I would not use a regex and just search for the three dots from the end of the string.

Note: When the elipsis come from the browser, there's no way to detect in PHP.

$title = 'The phrase... (author).';
echo getPlainTitle($title);

function getPlainTitle(string $title) {
    $rpos = strrpos($title, '...');
    return ($rpos === false) ? $title : substr($title, 0, $rpos);
}

will output

The phrase

创建一个函数以在标题中找到特定单词

淤浪 2025-02-16 21:59:02

您的代码应该起作用。
您怎么知道它会返回?
的末尾,将行放在您的代码末尾

   Debug.Print children.Count

如果返回代码

Your code should work.
How do you know that it returns nothhing?
put the row in the end of your code

   Debug.Print children.Count

if it returns >0 then all ok and children is the range object with data

vba sub不选择特定工作表的范围

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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