慢慢从新开始

文章 评论 浏览 29

慢慢从新开始 2025-02-21 01:57:16

在您的情况下,它可能使用的良好做法

err := b.DataTo(&u)
if err != nil {
   fmt.Println(err)
}

,在struct中有类型数据与Firestore中的模式不匹配。
如果我可以猜测StartDate字段。如果在Firestore模式中,则是timestamp字段,因此您必须在Golang结构中设置time

its good practice for using

err := b.DataTo(&u)
if err != nil {
   fmt.Println(err)
}

maybe in your case, there is type data in the struct that didn't match with the schema in firestore.
if I could guess the StartDate field. if in the firestore schema it is a timestamp field, so you must set time.Time in your golang struct.

Firestore Golang问题与原型类型

慢慢从新开始 2025-02-21 01:39:01

关于您试图处理异步/等待元素的事情有一些疑问,但是一件事要用两件事来使用助手方法:

listOrders(a, b));

可以变成

DoWork(a,b);

助手

ClearedOrdersReport DoWork(int a, int b)
{
 ...
 return listOrders(a, b); 
} 

There are some questions about what you are trying to do with the async/await elements, but one to call two many things where there was one is to use a helper method:

listOrders(a, b));

can become

DoWork(a,b);

and then

ClearedOrdersReport DoWork(int a, int b)
{
 ...
 return listOrders(a, b); 
} 

C#任务。run语法

慢慢从新开始 2025-02-20 22:50:10

正如CBROE所说,您可以添加一个计数器,该计数器每次循环时都会增加。

$result1 = mysqli_query($con,"SELECT * FROM tbl_ou group by reference  order by sum(quantite) desc LIMIT 10;");
$i = 1; //This is the counter variable
while($row1 = mysqli_fetch_array($result1)){
    echo "Label ".$i.": ".$row1[5];
    $i++;
}
//Excpected Output for first loop:
//Label 1: Mandarin

As CBroe said, you can add a counter that increments with each while loop.

$result1 = mysqli_query($con,"SELECT * FROM tbl_ou group by reference  order by sum(quantite) desc LIMIT 10;");
$i = 1; //This is the counter variable
while($row1 = mysqli_fetch_array($result1)){
    echo "Label ".$i.": ".$row1[5];
    $i++;
}
//Excpected Output for first loop:
//Label 1: Mandarin

如何显示Y列的X行?

慢慢从新开始 2025-02-20 10:04:32

在Linux上运行时,我使用Firefox(Geckodriver)使其正常工作:

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
      {
        FirefoxOptions optionsFF = new FirefoxOptions();
        optionsFF.AddArgument("--headless");

        using (var driverff = new FirefoxDriver("/usr/bin", optionsFF))
        {
          driverff.Manage().Window.Size = new System.Drawing.Size(1920, 1080);
          driverff.Navigate().GoToUrl(url);
          driverff.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
          Int64 pageHeight = (Int64)driverff.ExecuteScript("return document.body.scrollHeight");

          for (int i = 0; i < pageHeight; i += 100)
          {
            driverff.ExecuteScript($"window.scrollBy(0, 100)");
          }
          driverff.ExecuteScript(@"document.querySelectorAll(""div[role='alert']"")[0].remove();");

          result = driverff.PageSource;
        }

在Windows Chromedriver上运行时工作正常。

现在唯一的问题是WKHTMLTOPDF似乎在HTTPS图像中不起作用。我仍然没有解决方案。

I made it working using Firefox (GeckoDriver) when running on Linux:

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
      {
        FirefoxOptions optionsFF = new FirefoxOptions();
        optionsFF.AddArgument("--headless");

        using (var driverff = new FirefoxDriver("/usr/bin", optionsFF))
        {
          driverff.Manage().Window.Size = new System.Drawing.Size(1920, 1080);
          driverff.Navigate().GoToUrl(url);
          driverff.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
          Int64 pageHeight = (Int64)driverff.ExecuteScript("return document.body.scrollHeight");

          for (int i = 0; i < pageHeight; i += 100)
          {
            driverff.ExecuteScript(
quot;window.scrollBy(0, 100)");
          }
          driverff.ExecuteScript(@"document.querySelectorAll(""div[role='alert']"")[0].remove();");

          result = driverff.PageSource;
        }

When running on Windows ChromeDriver works fine.

The only problem now is wkhtmltopdf seems to be NOT working for HTTPS images. I still don't have a solution for this.

Selenium web driverexception:未知错误:Chrome无法启动:异常退出

慢慢从新开始 2025-02-19 20:55:54

您应该使用tk.text。它具有-height-width选项。您可以为窗口的宽度使用root.width() root.height()用于窗口的高度。

text = tk.Text(root, width = root.width(), height = root.height())
text.pack(pady=20)

编辑:要集中条目/文本,您应该使用entry1.focus()

You should use tk.Text. It has -height and -width options. You can use root.width() for the window's width and root.height() for the window's height.

text = tk.Text(root, width = root.width(), height = root.height())
text.pack(pady=20)

EDIT: To focus the entry/text you should use entry1.focus().

如何使用Tkinter Python设置完整大小的文本框(例如记事本)?

慢慢从新开始 2025-02-19 20:01:23

Sagemaker中的模型无法通过搜索API搜索。

您可以使用标签API基于标签值来找到资源 - https://docs.aws.amazon.com/cli/latest/reference/Resourcegroupstaggingapi/get-resources.html

Models in SageMaker are not searchable through the Search API.

You can use the Tags API to find your resources based on Tag values - https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html

如何使用标签搜索Amazon Sagemaker模型?

慢慢从新开始 2025-02-18 23:58:25

如果不整理它们的位置,您将始终获得不同的位置。

This are always different strings:

ab3567cd 123 789012

789012 ab3567cd 123

123 ab3567cd 789012

什么是哈希算法?它如何工作?

文件如何工作?

更新:

有两种解决方案,但是如果这是正确的方法,我现在不现在。

这只是一个逻辑示例,

  1. 则可能不是正确的函数/计数方式!解决方案

如果我用正确的函数计算集合的值,

set1 = [“ ab3567cd”,“ 123”,“ 789012”]

计数:

 "ab3567cd" (+ or *) "123" (+ or *) "789012" = RESULT_VALUE

比哈希相比,result_value的set1,set2,set2和set3始终将获得相同的哈希值。

RESULT_HASH = HASH(RESULT_VALUE)
  1. 解决方案

set1 = [“ AB3567CD”,“ 123”,“ 789012”]

create hash1 from "ab3567cd"

create hash2 from "123"

create hash3 from "789012"

计数:

hash1 (+ or *) hash2 (+ or *) hash3 = RESULT_VALUE

比HASH result_value始终获得SET1,SET1,SET2和SET3的HASH值。

RESULT_HASH = HASH(RESULT_VALUE)

这个逻辑示例与所有可以哈希的语言一起使用。

Without sorting them to have the same position you will get always different hashes.

This are always different strings:

ab3567cd 123 789012

789012 ab3567cd 123

123 ab3567cd 789012

Do identical strings always have the same SHA-256 value?

What is a Hashing Algorithm and How Does it Work?

How does file hashing works?

UPDATE:

There are two solutions, but i don't now if this is the right way.

This is only an logical example, it maybe not the right function/count way!

  1. Solution

If i count the values of the set, with the right function.

set1 = [ "ab3567cd", "123", "789012" ]

count:

 "ab3567cd" (+ or *) "123" (+ or *) "789012" = RESULT_VALUE

Than you hash the RESULT_VALUE you will get always the same hash value for set1, set2 and set3.

RESULT_HASH = HASH(RESULT_VALUE)
  1. Solution

set1 = [ "ab3567cd", "123", "789012" ]

create hash1 from "ab3567cd"

create hash2 from "123"

create hash3 from "789012"

Count:

hash1 (+ or *) hash2 (+ or *) hash3 = RESULT_VALUE

Than you hash the RESULT_VALUE you will get always the same hash value for set1, set2 and set3.

RESULT_HASH = HASH(RESULT_VALUE)

This logical example works with all languages that can hash.

无序的字符串集良好的哈希功能?

慢慢从新开始 2025-02-18 17:29:31

这也发生在我身上。我读了一些线程,说如果您安装了SQL Server数据工具,则向导和SQL作业属性窗口完全停止工作。在Visual Studio中启动向导的工作正常。

It happened to me, too. I read some threads saying that if you install SQL Server Data Tool, the wizard and SQL Job property window stop working altogether. Launching the wizard within Visual Studio works fine.

SQL Server导入和导出向导已停止工作

慢慢从新开始 2025-02-18 07:41:48

如果我正确理解Blazor Server,则您的_HOST.CSHTML需要保持在“/”页面路径上,因为它是扎根于加载剃须刀组件的实际页面,也是URL导航的参考,但是您也可以给它多个@page属性,因此它将从多个URL响应/显示。

至于为什么直接通过URL访问404,而在使用navmenu时返回404,则首先点击“/blazor”时,所有的剃须刀组件(带有或没有的Razor Files(Razor Files) @page属性)被发现,您的应用程序'session'开始,并且每当您浏览navmenu或内置的C#组件时,例如navigationmanager'sessig 。但是,每当您直接击中URL时,您的浏览器都会直接询问该特定路径,然后跳过实际上执行@page S Discovery的“/blazor”路径中的页面,然后加载内部导航机制。

If i understand Blazor Server correctly, your _Host.cshtml needs to stay on "/" page path, as it is the actual page rooted to load your razor components, as also reference for URL navigation, but you can also gives it multiple @page attribute, so it would respond/shown from multiple URL.

As for why it is returns 404 when accessed directly via URL but not when with NavMenu, when you hit "/blazor" first, all of your razor components (.razor files with or with without @page attribute) get discovered, your app 'session' start and whenever you navigate through NavMenu or built-in C# component like NavigationManager the 'session' persist. But whenever you hit the URL directly, your browser ask directly for that specific path, skipping the page in "/blazor" path that actually do the @pages discovery then load the internal navigation mechanism.

Blazor-直接访问页面URL不起作用,点击通过Navmenu Works单击

慢慢从新开始 2025-02-18 04:57:56

我只是为了找到与队友的解决方案。

这是将数组放入WSDL定义中的一种方法。在这种情况下,我理解,对于更好的类型定义,使用XSD而不是XML是必要的。

这里的示例和网站提供了更好的解释:
https://www.tutorialworks.com/wsdl/”

<wsdl:types>
<xsd:schema targetNamespace="https://spot-b.edgelogistics.com/AutoRateService/">
  <xsd:element name="Stops">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="sequence_number" type="xsd:string"/>
        <xsd:element name="stop_type" type="xsd:string"/>
        <xsd:element name="city" type="xsd:string"/>
        <xsd:element name="state_id" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="StopsArray">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:Stops" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="GetLoadAutorate">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:Stops" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="AddBookResponse">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:Stops" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>

I just to find a solution with a teammate.

This one way to put arrays in your wsdl definition. In this case I understood that to a better types definition is neccesary to use XSD instead of XML.

Here the example and the web site with a better explanation:
https://www.tutorialworks.com/wsdl/

<wsdl:types>
<xsd:schema targetNamespace="https://spot-b.edgelogistics.com/AutoRateService/">
  <xsd:element name="Stops">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="sequence_number" type="xsd:string"/>
        <xsd:element name="stop_type" type="xsd:string"/>
        <xsd:element name="city" type="xsd:string"/>
        <xsd:element name="state_id" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="StopsArray">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:Stops" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="GetLoadAutorate">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:Stops" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="AddBookResponse">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:Stops" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>

</wsdl:types>

如何将数组类型放入WSDL定义-Node JS中

慢慢从新开始 2025-02-16 21:37:31

使用窗口的最大值:

SELECT *, UpdatedDate = MAX(UpdatedDate) OVER(PARTITION BY ClientId) AS Outdated
FROM tab

Using windowed MAX:

SELECT *, UpdatedDate = MAX(UpdatedDate) OVER(PARTITION BY ClientId) AS Outdated
FROM tab

如何获得最新的日期价值

慢慢从新开始 2025-02-16 06:33:11

非常感谢@theicebear!
对于我的用例,即使X合并X与MASTER合并时,即使X具有这些文件的原始版本,B,C和D中的文件也不会被覆盖。

现在我的摘要:
对于我的用例,有不同的方法可以做到这一点。

有3个选项:

1。将功能重列到主人(另请参见TheIceBear的答案)
这是Git Histroy的最清晰方法。
命令:
#首先从上游存储库中获取新的主人,然后在其中重新列出您的功能分支:(

更新Origin/Master)

Git Fetch Origin

(将当前分支重现到Origin/Master上)

git rebase oince oinct/master

2。将主体合并到功能中,

从上游分支合并到功能分支中会导致一个不是“不错”的历史记录,因为然后始终创建另一个合并对象

git neckout master

git git git git git git

git git git git git a/x

git pull

git git git合并大师

git推动

3。 在Bitbucket中直接合并

,与“快进”合并合并将不起作用,但是与“ Squel”和“ Merge Commit”合并将起作用,B,C和D中的文件在合并x时不会被覆盖即使X具有这些文件的原始版本,也要掌握。

如果功能和主体工作在不同的文件上,这意味着没有冲突,您也可以考虑不进行重新构想。合并后的结果当然是相同的。

但是,您将在历史上有“交叉”的分支线,这也不是特别好。

总而

Thank you very much to @TheIceBear!
For my use-case, "merge directly" the files in B, C and D will not be overwritten when merging x to master even though the x has the original version of those files.

And now my summary:
There are different ways to do it for my use cases.

There are 3 Options:

1. rebase feature onto master (see also answer from TheIceBear)
It is the most clear way for git histroy.
Command:
#First fetch the new master from the upstream repository, then rebase your feature branch on top of that:

(Updates origin/master)

git fetch origin

(Rebases current branch onto origin/master)

git rebase origin/master

2. merge master into feature

a merge from the upstream branch into the feature branch leads to an not "nice" history, since another merge object is then always created

Command:

git checkout master

git pull

git checkout feature/x

git pull

git merge master

git push

3. merge directly

In bitbucket, Merge with "fast-forward" Merge will not work, but Merge with "squash" and "merge commit" will work, the files in B, C and D will not be overwritten when merging x to master even though the x has the original version of those files.

If feature and master work on different files, which means no conflicts, you can also consider not do the rebase. The result after the merge would of course be the same.

But then you would have "crossing" branch lines in the history, which isn't particularly nice either.

in summary: it is NOT a MUST-DO, but the feature branch is better always be from the current status of master to which it is then also merged

功能分支是主人,功能和主人不会在同一文件上更改的后面,在合并PR之前,必须将Master合并到功能中吗?

慢慢从新开始 2025-02-16 02:40:50

您必须检查为此的价值的存在。

await expect(page.locator(element)).toHaveValue('99')

You have to check the presence of value for this.

await expect(page.locator(element)).toHaveValue('99')

元素是否在DOM中没有内部文本,如何获得该值?

慢慢从新开始 2025-02-15 19:25:04

这也许是一种更干净的方法:

const pickSome = (xs) =>
  Array .isArray (xs)
    ? xs .every (x => Array .isArray (x))
      ? xs .flatMap (pickSome)
      : pickSome (xs [~~ (Math .random () * xs .length)]) 
    : [xs]

const arry = [["A"], ["B", "C"], ["D", "E"], [[["F1", "F2"], ["G1", "G2"], ["H1", "H2", [["I1", "I2", "I3"], ["J1", "J2"], ["K1", "K2", "K3"]]]]]]

for (let n = 0; n < 10; n ++) console .log (`['${pickSome (arry) .join ("', '")}'']`)
.as-console-wrapper {max-height: 100% !important; top: 0}

我们测试我们的输入是否是数组。如果不是这样,我们只需将其包裹在数组中并将其返回。因此,选择('g1')返回['g1']。如果是数组,那么我们检查所有孩子是否都是阵列。如果它们是,我们返回递归将函数置于其元素上的结果。如果不是,那么我们随机选择一个元素,然后在其中调用选择。 您的['H1','H2',[['i1','i2'...],...]]案例。

(这将处理 /code>充当整数截断操作员,MATH .Floor的替代方案。

This is perhaps a cleaner approach:

const pickSome = (xs) =>
  Array .isArray (xs)
    ? xs .every (x => Array .isArray (x))
      ? xs .flatMap (pickSome)
      : pickSome (xs [~~ (Math .random () * xs .length)]) 
    : [xs]

const arry = [["A"], ["B", "C"], ["D", "E"], [[["F1", "F2"], ["G1", "G2"], ["H1", "H2", [["I1", "I2", "I3"], ["J1", "J2"], ["K1", "K2", "K3"]]]]]]

for (let n = 0; n < 10; n ++) console .log (`['${pickSome (arry) .join ("', '")}'']`)
.as-console-wrapper {max-height: 100% !important; top: 0}

We test if our input is an array. If it's not, we simply wrap it in an array and return it. So pickSome ('G1') return ['G1']. If it is an array, then we check whether all its children are arrays. If they are we return the result of recursively flatMapping our function over its elements. If they are not, then we randomly choose one element and call pickSome on that. (This handles your ['H1', 'H2', [['I1', 'I2'...], ...]] case.)

Note that ~~ acts as an integer truncation operator, an alternative to Math .floor for positive numbers.

如何在递归JavaScript函数中返回整个数组?

慢慢从新开始 2025-02-15 18:54:38

当我在Vite + React设置中使用Tailwind CSS时,我也遇到了相同的错误。但是我通过

方法1修复了它)
更改以下命名约定
班级 - &gt; className
for - &gt; htmlfor

方法2)
从VS代码中卸载ESLINT扩展程序,并且代码正常。

我希望它有助于更​​清晰地阅读以上答案该线程的答案

I also encountered the same error when i used the tailwind CSS in the vite + react setup. But I fixed it by

METHOD 1)
CHANGING THE FOLLOWING NAMING CONVENTIONS
class --> className
for --> htmlFor

METHOD 2)
uninstalling the ESLint Extension from the vs code and the code works fine.

I hope it helps for more clearity read above answers of this thread

警告:未知的DOM属性类。你是说classname吗?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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