猥琐帝

文章 评论 浏览 27

猥琐帝 2025-02-13 16:20:55

您可以使用TextInput的选择道具,

<TextInput 
  value={'aaaa'}
  onFocus={onFocus}
  selection={{
    start: 0,
    end: 4,
  }}
/>

可以修改启动和最终值的焦点。
参考: https://reaectnative.dev/docs/textinput#selection

You can use the selection prop of TextInput

<TextInput 
  value={'aaaa'}
  onFocus={onFocus}
  selection={{
    start: 0,
    end: 4,
  }}
/>

You can modify the start and end value onFocus.
Reference: https://reactnative.dev/docs/textinput#selection

如何在Andorid中的React Nation中选择文本中的文本?

猥琐帝 2025-02-13 15:23:09

我建议使用 chai-conted 库来避免复杂性和错误。

安装

npm install chai-sorted

or

yarn add -D chai-sorted

测试是

chai.use(require("chai-sorted"))

cy.get('.MuiAutocomplete-option')                
  .should('have.length.gt', 1)                 
  .then($options => [...$options].map(option => option.innerText))
  .should('be.sorted')

I recommend using chai-sorted library to avoid complexity and errors.

Install

npm install chai-sorted

or

yarn add -D chai-sorted

The test is

chai.use(require("chai-sorted"))

cy.get('.MuiAutocomplete-option')                
  .should('have.length.gt', 1)                 
  .then($options => [...$options].map(option => option.innerText))
  .should('be.sorted')

在柏树10中,我们如何检查下拉中的元素是按字母或数字分类的?

猥琐帝 2025-02-13 03:07:56

一切都在那里: https:///www.php.net/手动/fr/function.http-build-query.php (函数 http_build_query()是您需要的)。

All is there : https://www.php.net/manual/fr/function.http-build-query.php (the function http_build_query() is what you need).

如何设置与Guzzle同名的查询参数?

猥琐帝 2025-02-13 01:05:12

由于行为不确定 - 使用空间计算,您的输出具有奇怪的输出。

移动您出席的具有完全相同的 usage 和相同的大小 - 通常将其按照“原样”进行,通常不会通过某些魔法转换后线空间,因此, WS转换输入最终以 10 。正如标准所说的那样:

脱编辑仅在发送操作数是数字编辑的数据项时才进行,并且接收项是数字或数字编辑的数据项。

如果它是编辑的字段,那么它仍然应该在移动上提出一个例外:

当数字编辑的数据项是编辑移动语句的发送操作数,并且该数据项的内容是该数据项中任何编辑操作的可能结果,这是移动的结果操作是未定义的, ec-data compatible 异常条件已设置为

当使用空间计算时,您通常会引起致命错误,但是您的编译似乎没有被激活(并且因为您没有共享编译命令甚至编译器,所以我们无能为力)。

不同的COBOL方言经常使用(仅在未激活检查时部分使用,这将导致中止)对于无效的数据零,至少对于空格而言(但是它们 can 使用所有内容。 > WS转换输入“被视为“ 10000000 - 因此,您的计算将包括这些大数字,

因此如果您输入输入中必要的领先零数量,则可以使用。

  • “永不信任输入数据 - 验证”(以及必要的错误或转换),
  • 如果某些东西看起来可疑 - 激活所有运行时检查,请重新尝试。

常规

至少 - 接收到)到WS转换输入,这将剥离周围的空间,然后从左到右转换,直到找到无效的数据,也将使用功能测试 - numval ,否则,如果某人进入“二十”,则使用零计算。

You have that strange output because of undefined behavior - computing with spaces.

The MOVE you present has the exact same USAGE and same size - it will commonly be taken over "as is", it normally does not convert the trailing spaces by some magic, so WS-CONVERTED-INPUT ends up with 10 . As the standard says for the move:

De-editing takes place only when the sending operand is a numeric-edited data item and the receiving item is a numeric or a numeric-edited data item.

and if it would be an edited field then it still should raise an exception on the MOVE:

When a numeric-edited data item is the sending operand of a de-editing MOVE statement and the content of that data item is not a possible result for any editing operation in that data item, the result of the MOVE operation is undefined and an EC-DATA-INCOMPATIBLE exception condition is set to exist.

When computing with spaces you commonly would raise a fatal error, but it seems your compile does not have that activated (and because you didn't share your compile command or even your compiler, we can't help with that).

Different COBOL dialects often use (partial only when checks are not activated which would lead to an abort) zero for invalid data, at least for spaces (but they can use everything. This will then lead to WS-CONVERTED-INPUT "seen as" 10000000 - so your computation will then include those big numbers.

So your program should work if you enter the necessary amount of leading zeroes on input.

General:

  • "never trust input data - validate" (and error or convert as necessary)
  • at least if something looks suspicious - activate all runtime checks available, re-try.

Solution - Do an explicit conversion:

MOVE FUNCTION NUMVAL(WS-NEXT-INPUT) TO WS-CONVERTED-INPUT, this will strip surrounding spaces and then convert from left to right until invalid data is found. A good coder would also check up-front using FUNCTION TEST-NUMVAL, otherwise you compute with zero if someone enters "TWENTY".

为什么我的COBOL工作存储变量具有尾声零?

猥琐帝 2025-02-12 20:57:05

信用额为@Not机器人!

(如果您将您的评论变成答案 - 我真的认为应该成为一个 - 我将删除我的并投票!)< em>

的使用所有

df.replace('[^ -~]+', '', regex=True)
ASCII REGEX
字符
有用 有趣 使用
方法 /
非常 18

Credit goes to @not a robot!

(If you turn your comment into an answer - and I really think it deserves to be one -, I'll delete mine and upvote yours!)

Very interesting and useful approach to get rid of all the ASCII characters with the use of regex:

df.replace('[^ -~]+', '', regex=True)
index Name Age
0 Tom 20
1 nick 21
2 krish 19
3 jack 18

从完整的数据框中删除随机特殊字符

猥琐帝 2025-02-12 19:15:00

我不确定您要执行哪种代码,但是方法是这样:

如果字符串包含'\ n'
检查字符串是否以'\ n'结束,如果不是,则用''替换\ n。

I'm not sure in what kind of code you're trying to do this but the approach would be like this:

if string contains '\n'
check if string ends with '\n' if not then you replace \n with ''.

如何仅在新行之后删除新行,没有字符

猥琐帝 2025-02-12 06:26:07

您可以使用 nthave

https://laravel.com/docs/9.x/eloquent-relationships#querying-realationship-absence

User::doesntHave('orders')->get();

You can have use doesntHave for this

https://laravel.com/docs/9.x/eloquent-relationships#querying-relationship-absence

User::doesntHave('orders')->get();

忽略记录Hasmany

猥琐帝 2025-02-12 05:51:28

默认的Docker容器从您的项目根到构建过程中的容器。例如,如果您将其从项目根中删除,则无法将其复制并以后运行。因此,修复它的步骤是:

  1. start-container 脚本还原到您的项目root,您可以找到它

​我怀疑步骤2甚至是可选的,如项目被安装为音量

The default docker container should copy a bash script called start-container from your project root to the container during build. If you for example removed it from your project root, it can not copy it and run it later. So the steps to fix it are:

  1. Restore the start-container script to your project root, you can find it here
  2. Rebuild the image with docker-compose build

And everything should work again. I suspect step 2 is even optional as the entire project gets mounted as a volume.

如何用帆索引“ start-container”:找不到可执行文件

猥琐帝 2025-02-11 19:49:12

减去没有指向(或一个past)相同对象或(或一past)相同阵列的非效中指针会导致不确定的行为。

同样,只要您停留在数组的范围内(或一个厚度),将整数添加到指针中。

&amp; k 是变量 k &amp; i 的指针,是变量 i 的指针。这些是完全自变量的变量,而不是共享数组的一部分,也不是以任何其他连接的方式。

因此,您的程序具有不确定的行为。不可能以这种方式检索无关变量的地址之间的差异,即使您使用了法律方法,结果也将完全未指定,并且无法通过指针算术来检索其他变量的指针。


另一方面,更明显的问题是,您在类型 char 中提取指针,但将结果添加到 int 指针中。指针算术量度根据相应阵列的元素数量而不是字节中的量度。 char 的大小为 1 字节,因此 delta 将以字节为单位(如果不是UB,则可以使用)。但是&amp; i + delta 的指针算术期望 delta 测量 int s的数量,含义 delta 应该应该通过 sizeof(int)缩放。

Subtracting non-null pointers which do not point to (or one-past) the same object or into (or one-past) the same array causes undefined behavior.

Similarly, adding integers to pointers is only allowed as long as you stay within the bounds of an array (or one-past it).

&k is a pointer to the variable k and &i is a pointer to the variable i. These are completely independent variables, not part of a shared array or in any other way connected.

Therefore your program has undefined behavior. It is impossible to retrieve the difference between addresses of unrelated variables in this way and even if you used a legal approach, the result would be completely unspecified and cannot be used to retrieve a pointer to the other variable via pointer arithmetic.


As a further, more obvious issue, you are substracting the pointers in type char, but adding the result to a int pointer. Pointer arithmetic measures in terms of the number of elements of the corresponding array, not in bytes. The size of a char is 1 byte and so delta will be in units of bytes (if it wasn't UB to begin with). But pointer arithmetic in &i + delta expects delta to measure in number of ints, meaning delta should be scaled by sizeof(int).

我对C&#x2B;&#x2B;有疑问内存地址差异类型计算内存地址偏移&#xff1f;

猥琐帝 2025-02-11 19:31:19

Heroku动态分配您的应用程序一个端口,因此您无法将端口设置为固定的数字。 Heroku将端口添加到Env中,因此您可以将其从那里拉出。切换您的收听:

.listen(process.env.PORT || 5000)

这样,当您在本地测试时,它仍然会收听端口5000,但也可以在Heroku上使用。 重要说明 - 端口词必须是资本。

您可以在node.js

Heroku dynamically assigns your app a port, so you can't set the port to a fixed number. Heroku adds the port to the env, so you can pull it from there. Switch your listen to this:

.listen(process.env.PORT || 5000)

That way it'll still listen to port 5000 when you test locally, but it will also work on Heroku. Important note - PORT word must be capital.

You can check out the Heroku docs on Node.js here.

Heroku&#x2B; Node.js错误(Web进程无法在启动的60秒内绑定到$端口)

猥琐帝 2025-02-11 12:46:15

您可以为自定义错误消息使用:日期

示例:

    public function rules()
    {
        return [
            'end_time' => ['after_or_equal:start_time', 'after_or_equal:5:00'],
        ];
    }

    public function messages()
    {
        return [
            'end_time.after_or_equal' => 'the :attribute time must be after :date',
        ];
    }

替换值是验证器的第一个输入的实际值

You can use :date for your custom error messages.

Example:

    public function rules()
    {
        return [
            'end_time' => ['after_or_equal:start_time', 'after_or_equal:5:00'],
        ];
    }

    public function messages()
    {
        return [
            'end_time.after_or_equal' => 'the :attribute time must be after :date',
        ];
    }

The replaced value is actual value of first input of the validator

为同一属性创建两个分开的验证消息

猥琐帝 2025-02-11 05:27:19

Boost Json在版本1.75.0中引入。它在版本1.71.0中不可用。您需要在系统上安装最新版本的Boost。

来自 boost版本历史页面(重点是我的):

版本1.75.0
2020年12月11日19:50 GMT

新库:json ,叶,pfr。更新的库:ASIO,ATOMIC,野兽,容器,ENDIAN,FILESSYSTEM,GIL,直方图,分解,分解,侵入性,日志,移动,MP11,可选,结果,Polygon,Polygon,Pread Procationor,Rication2 /p>

Boost JSON was introduced in version 1.75.0. It's not available in version 1.71.0. You need to install a more recent version of boost on your system.

From the boost version history page (emphasis mine):

Version 1.75.0
December 11th, 2020 19:50 GMT

New Libraries: JSON, LEAF, PFR. Updated Libraries: Asio, Atomic, Beast, Container, Endian, Filesystem, GIL, Histogram, Interprocess, Intrusive, Log, Move, Mp11, Optional, Outcome, Polygon, Preprocessor, Rational, Signal2, System, uBLAS, VMD, Wave.

找不到“ boost_json”提供的软件包配置文件。

猥琐帝 2025-02-11 02:02:44

只需在适当的日期和时间中添加此行:

FREEBUSY;FBTYPE=FREE:[date start format Ymd]T[time start format Gis]Z/[date end format Ymd]T[time end format Gis]Z

例如: freeBusy; fbtype =忙:19980415T133000Z/19980415T170000Z

or,如果是for Outlook:

X-MICROSOFT-CDO-BUSYSTATUS:FREE

sources:sources:source:

  1. https://icalendar.org/icalendar.org/icalendar-rfc-5545/3-2 -9-free-busy time-type.html
  2. https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/cd68eae7-ed65-4dd3-8ea7-ad585c76c736

Just add this line in your ical with the right date and time :

FREEBUSY;FBTYPE=FREE:[date start format Ymd]T[time start format Gis]Z/[date end format Ymd]T[time end format Gis]Z

e.g. : FREEBUSY;FBTYPE=BUSY:19980415T133000Z/19980415T170000Z

Or, if it's for Outlook :

X-MICROSOFT-CDO-BUSYSTATUS:FREE

sources :

  1. https://icalendar.org/iCalendar-RFC-5545/3-2-9-free-busy-time-type.html
  2. https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/cd68eae7-ed65-4dd3-8ea7-ad585c76c736

php-将事件发送到日历为闲暇时间

猥琐帝 2025-02-10 10:54:33

感谢@funthomas的建议。根据您的建议,我尝试将简单的按钮和 gonaction 命令添加到它,并且它也简化了我的代码(我不再需要为此创建新的子),

我将共享代码i i修改后,

   For i = 1 To UBound(arrFile)
    strtRow = 29
    Set ParamWS = ThisWorkbook.Worksheets("Sheet1")
    ' My other code is here to print data starting from Row 29(each row in each loop)

    Set rng = ParamWS.Range("C" & strtRow)
    p = strtRow - 28
    Set ShButton = ParamWS.Buttons.Add(Left:=43.5, Top:=rng.Top + 10, Width:=92, Height:=46)

    With ShButton
      .OnAction = "Module3.create_sheetFromButton"
      .Caption = "Single Button" & p
      .Name = strtRow
    End With

    strtRow = strtRow + 1

   Next i

我在主代码末尾删除了所有按钮,也没有为按钮创建任何新的子(得益于 oncation 的建议),所以我不知道需要检查重复的子。

Thanks @funthomas for your suggestion. As per your suggestion, I've tried adding simple button and OnAction Command to it, and it simplified my code also (I no longer needed to create new sub for this)

I'll share the code I've modified

   For i = 1 To UBound(arrFile)
    strtRow = 29
    Set ParamWS = ThisWorkbook.Worksheets("Sheet1")
    ' My other code is here to print data starting from Row 29(each row in each loop)

    Set rng = ParamWS.Range("C" & strtRow)
    p = strtRow - 28
    Set ShButton = ParamWS.Buttons.Add(Left:=43.5, Top:=rng.Top + 10, Width:=92, Height:=46)

    With ShButton
      .OnAction = "Module3.create_sheetFromButton"
      .Caption = "Single Button" & p
      .Name = strtRow
    End With

    strtRow = strtRow + 1

   Next i

I'm deleting all the buttons at the end of my main code, also I'm not creating any new sub for buttons (Thanks to the suggestion of OnAction), so I don't need to check for duplicate sub.

在VBA中生成ActiveX命令按钮并将代码分配给它们

猥琐帝 2025-02-10 08:43:02

您创建的任务类型称为MSBUILD文档中的“内线任务”。使用内联任务以删除构建脚本中的依赖关系是有意义的。

不幸的是,内联任务不支持Nuget。对于内联任务,没有 packageReference 。您可以有一个恢复给定软件包的Nuget步骤,并且可以在您的内线任务中添加参考到已知的软件包位置我认为您正在尝试避免的问题。

如果您无法避免使用Nuget软件包依赖关系,并且拥有私有和/或内部Nuget服务器,则可以考虑使用自己的构建和Nuget软件包将自定义任务移动到自己的DLL中。

The type of task you are creating is called an 'inline task' in the MSBuild documentation. It makes sense to use inline tasks to remove dependencies in the build script.

Unfortunately inline tasks don't support NuGet. There is no PackageReference for inline tasks. You could have a NuGet step that restores a given package and you could add a Reference in your inline task to a known location for the package but that starts getting messy and creates some of the dependency and chicken/egg issues that I think you are trying to avoid.

If you can't avoid the NuGet package dependency and you have a private and/or internal NuGet server, you might consider moving the custom task into its own DLL with its own build and NuGet package.

是否可以编写取决于Nuget软件包的嵌入式C#自定义MSBUILD任务?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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