━╋う一瞬間旳綻放

文章 评论 浏览 31

━╋う一瞬間旳綻放 2025-02-20 07:02:45

有问题的代码行包含多个属性和方法调用:

Set olFolder = olFolder.Folders("MY TEAM'S FOLDER").Folders("THE FOLDER I WANT")

我建议通过在单独的代码行上声明它们中的每一个来破坏属性和方法调用。因此,您会发现有问题的电话。

无论如何,要找到是否存在共享商店中的此类文件夹,我建议您在所有子文件夹中迭代并获取其名称,因此您可能会以这种方式找到所需的文件夹。

For Each uFolder In olFolder.Folders
      If uFolder.Name = "MY TEAM'S FOLDER" Then
        MsgBox "MY TEAM'S FOLDER is found!"
      End If
Next uFolder

The problematic line of code contains multiple property and method calls:

Set olFolder = olFolder.Folders("MY TEAM'S FOLDER").Folders("THE FOLDER I WANT")

I'd recommend breaking the chain of property and method calls by declaring each of them on a separate line of code. Thus, you will find the problematic call.

Anyway, to find whether such folder exists in a shared store I'd suggest iterating over all subfolders and getting their names, so you may find the required folder following that way.

For Each uFolder In olFolder.Folders
      If uFolder.Name = "MY TEAM'S FOLDER" Then
        MsgBox "MY TEAM'S FOLDER is found!"
      End If
Next uFolder

共享收件箱子文件文件未找到错误

━╋う一瞬間旳綻放 2025-02-20 03:19:02

使用 sed

$ sed -E 's#.*/([[:digit:]]+).*#\1#' input_file
15

Using sed

$ sed -E 's#.*/([[:digit:]]+).*#\1#' input_file
15

该SED命令有什么作用,如何为我的用例修改它?

━╋う一瞬間旳綻放 2025-02-19 20:14:52

代码中的第一个问题是您的第一行

从电子邮件导入消息

您从电子邮件导入消息,还将参数传递给具有相同名称的data_validation函数,然后在data_validation函数中返回false。如果返回false,则该功能将永远不会执行。

首先给出您导入的第一行的别名

尝试此


from email import message as msg
import os
import re
import html
import json
import telebot
import requests
import http.client
from pytube import *
from dotenv import load_dotenv

load_dotenv()

# Creating hiding, and using API Keys
API_KEY = os.getenv("API_KEY")
RAPID_KEY = os.getenv("RAPID_API")
bot = telebot.TeleBot(API_KEY)


# Creating a help message for guidance on how to use bot.
@bot.message_handler(commands=["start"])
def help(message):

    # Trying to send help message, if unable to send, throw an error message for the user.
    try:
        bot.send_message(message.chat.id, "Use \"Youtube\" and the video name to search for a video.\n")
    except:
        bot.send_message(message.chat.id, "There was an error fetching help, the bot may be offline.\n")

# Checking data and seeing if the word "YouTube" was used in order to start the search
def data_validation(message):
    query = message.text.split() 
    print(query)
    if("youtube" not in query[0].lower()):  # Set flag false if regular text
        return False # if you return false, the function never will be executed
    else:
        return True


# Searching for youtube videos
# using RAPID API
@bot.message_handler(func=data_validation)
def search(message):
    query = message.text.split()
    print(query) # if function executed you see the query result
    # Check if data is valid, and change variable to be lowercase for easy use.
    if(data_validation(message) == True and query[0].lower() == "youtube"):
        try:
            if(data_validation(message) == True and query[1].lower() != "-d"):

                # Removing the word "YouTube" and sending the results to the YouTube search engine.
                for item in query[:]:
                    if(item.lower() == "youtube"):
                        query.remove(item)
                        search_query = ' '.join(query)
                    else:
                        pass #If it's not term we're looking to convert, ignore it.

                # RAPID API for Youtube
                try:

                    url = "https://youtube-search-results.p.rapidapi.com/youtube-search/"
                    querystring = {"q":search_query}

                    headers = {
                        "X-RapidAPI-Key": RAPID_KEY,
                        "X-RapidAPI-Host": "youtube-search-results.p.rapidapi.com"
                    }

                    response = requests.request("GET", url, headers=headers, params=querystring) # Grabbing response information from URL
                    request = json.loads(response.text) # Parsing json string for python use

                    # Testing to see if the RAPID API service responds and is online.
                    if(response.status_code == 503):

                        # If the service is not online, let the user know.
                        bot.send_message(message.chat.id, f"The RAPID API service appears to be offline try back later.\n") 

                    if(response.status_code == 429):

                        # If the service has reached max quota for the day, let the user know.
                        bot.send_message(message.chat.id, f"Max quota reached, try back in 24 hours.\n")

                    # Grabbing first link from json text and sending direct url and title.
                    first_link = str((request["items"][0]["url"]))

                    bot.send_message(message.chat.id, f"{first_link}\n") # Sending first link that was queried.

                # If there are no results found for the requested video, sending an error message to alert the user.
                except:
                    bot.send_message(message.chat.id, "Unable to load video.\n")
        except:
                pass #ignoring if not the phrase we're looking for.

def test(message):
    string = message.text.split()
    print(string)

    if(string[0] == "test" and data_validation(message) == True):
        print("This is a test and i should be printed")
        bot.send_message(message.chat.id, "Test message")

# Stay alive function for bot pinging / communication
bot.infinity_polling(1440)

The first problem in your code is your first line

from email import message

You import the message from email and also pass a parameter to the data_validation function with the same name, then return False in the data_validation function. If you return false, the function never will be executed.

first give an alias to first line you imported

Try This


from email import message as msg
import os
import re
import html
import json
import telebot
import requests
import http.client
from pytube import *
from dotenv import load_dotenv

load_dotenv()

# Creating hiding, and using API Keys
API_KEY = os.getenv("API_KEY")
RAPID_KEY = os.getenv("RAPID_API")
bot = telebot.TeleBot(API_KEY)


# Creating a help message for guidance on how to use bot.
@bot.message_handler(commands=["start"])
def help(message):

    # Trying to send help message, if unable to send, throw an error message for the user.
    try:
        bot.send_message(message.chat.id, "Use \"Youtube\" and the video name to search for a video.\n")
    except:
        bot.send_message(message.chat.id, "There was an error fetching help, the bot may be offline.\n")

# Checking data and seeing if the word "YouTube" was used in order to start the search
def data_validation(message):
    query = message.text.split() 
    print(query)
    if("youtube" not in query[0].lower()):  # Set flag false if regular text
        return False # if you return false, the function never will be executed
    else:
        return True


# Searching for youtube videos
# using RAPID API
@bot.message_handler(func=data_validation)
def search(message):
    query = message.text.split()
    print(query) # if function executed you see the query result
    # Check if data is valid, and change variable to be lowercase for easy use.
    if(data_validation(message) == True and query[0].lower() == "youtube"):
        try:
            if(data_validation(message) == True and query[1].lower() != "-d"):

                # Removing the word "YouTube" and sending the results to the YouTube search engine.
                for item in query[:]:
                    if(item.lower() == "youtube"):
                        query.remove(item)
                        search_query = ' '.join(query)
                    else:
                        pass #If it's not term we're looking to convert, ignore it.

                # RAPID API for Youtube
                try:

                    url = "https://youtube-search-results.p.rapidapi.com/youtube-search/"
                    querystring = {"q":search_query}

                    headers = {
                        "X-RapidAPI-Key": RAPID_KEY,
                        "X-RapidAPI-Host": "youtube-search-results.p.rapidapi.com"
                    }

                    response = requests.request("GET", url, headers=headers, params=querystring) # Grabbing response information from URL
                    request = json.loads(response.text) # Parsing json string for python use

                    # Testing to see if the RAPID API service responds and is online.
                    if(response.status_code == 503):

                        # If the service is not online, let the user know.
                        bot.send_message(message.chat.id, f"The RAPID API service appears to be offline try back later.\n") 

                    if(response.status_code == 429):

                        # If the service has reached max quota for the day, let the user know.
                        bot.send_message(message.chat.id, f"Max quota reached, try back in 24 hours.\n")

                    # Grabbing first link from json text and sending direct url and title.
                    first_link = str((request["items"][0]["url"]))

                    bot.send_message(message.chat.id, f"{first_link}\n") # Sending first link that was queried.

                # If there are no results found for the requested video, sending an error message to alert the user.
                except:
                    bot.send_message(message.chat.id, "Unable to load video.\n")
        except:
                pass #ignoring if not the phrase we're looking for.

def test(message):
    string = message.text.split()
    print(string)

    if(string[0] == "test" and data_validation(message) == True):
        print("This is a test and i should be printed")
        bot.send_message(message.chat.id, "Test message")

# Stay alive function for bot pinging / communication
bot.infinity_polling(1440)

电报机器人在第三次功能后不响应

━╋う一瞬間旳綻放 2025-02-19 08:24:58

pd.timestamp()是Python的DateTime等效的熊猫,在大多数情况下可以与之互换。 DateTime库接受ISO 8601日期格式。

在Python ISO 8601中,日期以 yyyy-mm-ddthh:mm:ss.mmmmmm 格式表示。例如,2022年5月18日,表示为 2022-05-18T11:40:22.519222

  • yyyy :四位数格式的一年
  • mm :1-12 DD的月份:从1到31到31
  • t :这是分隔符字符那是在
    日期和时间字段。这是一个可选参数,默认
    “ t”的价值。
  • HH :对于分钟的值
  • mm :对于分钟的指定值
  • ss :对于秒的指定值
  • mmmmmmm :对于指定的微秒

source

直接从pandas文档(在这里 ):

基本上有三个针对构造函数的召集约定。主要形式接受四个参数。它们可以通过位置或关键字传递。

其他两种形式模仿了datetime.datetime的参数。他们
可以通过位置或关键字传递,但不会混合
一起。

示例

使用主要呼叫惯例:
这将转换一个类似日期的字符串的字符串,

>>> pd.Timestamp('2017-01-01T12')
Timestamp('2017-01-01 12:00:00')

的浮点

>>> pd.Timestamp(1513393355.5, unit='s')
Timestamp('2017-12-16 03:02:35.500000')

几秒钟的单位转换代表Unix epoch

>>> pd.Timestamp(1513393355, unit='s', tz='US/Pacific')
Timestamp('2017-12-15 19:02:35-0800', tz='US/Pacific')

以 :

>>> pd.Timestamp(2017, 1, 1, 12)
Timestamp('2017-01-01 12:00:00')

>>> pd.Timestamp(year=2017, month=1, day=1, hour=12)
Timestamp('2017-01-01 12:00:00')

pd.timestamp() is the pandas equivalent of python’s Datetime and is interchangeable with it in most cases. Datetime library accepts ISO 8601 date formats.

In Python ISO 8601 date is represented in YYYY-MM-DDTHH:MM:SS.mmmmmm format. For example, May 18, 2022, is represented as 2022-05-18T11:40:22.519222.

  • YYYY: Year in four-digit format
  • MM: Months from 1-12 DD: Days from 1 to 31
  • T: It is the separator character that is to be printed between the
    date and time fields. It is an optional parameter having a default
    value of “T”.
  • HH: For the value of minutes
  • MM: For the specified value of minutes
  • SS: For the specified value of seconds
  • mmmmmm: For the specified microseconds

Source

Directly from the Pandas documentation (here):

There are essentially three calling conventions for the constructor. The primary form accepts four parameters. They can be passed by position or keyword.

The other two forms mimic the parameters from datetime.datetime. They
can be passed by either position or keyword, but not both mixed
together.

Examples

Using the primary calling convention:
This converts a datetime-like string

>>> pd.Timestamp('2017-01-01T12')
Timestamp('2017-01-01 12:00:00')

This converts a float representing a Unix epoch in units of seconds

>>> pd.Timestamp(1513393355.5, unit='s')
Timestamp('2017-12-16 03:02:35.500000')

This converts an int representing a Unix-epoch in units of seconds and for a particular timezone

>>> pd.Timestamp(1513393355, unit='s', tz='US/Pacific')
Timestamp('2017-12-15 19:02:35-0800', tz='US/Pacific')

Using the other two forms that mimic the API for datetime.datetime:

>>> pd.Timestamp(2017, 1, 1, 12)
Timestamp('2017-01-01 12:00:00')

>>> pd.Timestamp(year=2017, month=1, day=1, hour=12)
Timestamp('2017-01-01 12:00:00')

在哪里可以找到可接受的pandas.timestamp格式的完整列表?

━╋う一瞬間旳綻放 2025-02-19 01:32:37

我们还在应用程序上遇到了这个问题,在a 真正的长期调试会话之后,我们发现它是由 apapter.sethasstableids(true)

>问题终于消失了。

希望它有帮助。

We also had this issue on our application, and after a really long debugging session we found out that it was caused by adapter.setHasStableIds(true)

We removed the offending line and the issue is finally gone.

Hope it helps.

当使用可运行的可运行的notifyEmchangemchange时,recyclerview崩溃了[IllegalArgumentException]

━╋う一瞬間旳綻放 2025-02-18 20:59:34

尝试

df['%increase_24'] = df.groupby('slug')['price_usd'].pct_change(1)
df['%increase_48'] = df.groupby('slug')['price_usd'].pct_change(2)

[出去]

        slug                   datetime     price_usd  %increase_24  %increase_48
0    bitcoin  2022-06-01 00:00:00+00:00  29799.079714           NaN           NaN
1   ethereum  2022-06-01 00:00:00+00:00   1823.569357           NaN           NaN
2    bitcoin  2022-06-02 00:00:00+00:00  30467.487741      0.022430           NaN
3   ethereum  2022-06-02 00:00:00+00:00   1775.078620     -0.026591           NaN
4    bitcoin  2022-06-03 00:00:00+00:00  29704.391357     -0.025046     -0.003178
5   ethereum  2022-06-03 00:00:00+00:00   1834.150570      0.033278      0.005802
6    bitcoin  2022-06-04 00:00:00+00:00  29832.914225      0.004327     -0.020828
7   ethereum  2022-06-04 00:00:00+00:00   1801.609446     -0.017742      0.014946
8    bitcoin  2022-06-05 00:00:00+00:00  29906.661748      0.002472      0.006809
9   ethereum  2022-06-05 00:00:00+00:00   1805.204989      0.001996     -0.015781
10   bitcoin  2022-06-06 00:00:00+00:00  31364.535502      0.048747      0.051340
11  ethereum  2022-06-06 00:00:00+00:00   1858.546508      0.029549      0.031603

Try groupby first with pct_change:

df['%increase_24'] = df.groupby('slug')['price_usd'].pct_change(1)
df['%increase_48'] = df.groupby('slug')['price_usd'].pct_change(2)

[out]

        slug                   datetime     price_usd  %increase_24  %increase_48
0    bitcoin  2022-06-01 00:00:00+00:00  29799.079714           NaN           NaN
1   ethereum  2022-06-01 00:00:00+00:00   1823.569357           NaN           NaN
2    bitcoin  2022-06-02 00:00:00+00:00  30467.487741      0.022430           NaN
3   ethereum  2022-06-02 00:00:00+00:00   1775.078620     -0.026591           NaN
4    bitcoin  2022-06-03 00:00:00+00:00  29704.391357     -0.025046     -0.003178
5   ethereum  2022-06-03 00:00:00+00:00   1834.150570      0.033278      0.005802
6    bitcoin  2022-06-04 00:00:00+00:00  29832.914225      0.004327     -0.020828
7   ethereum  2022-06-04 00:00:00+00:00   1801.609446     -0.017742      0.014946
8    bitcoin  2022-06-05 00:00:00+00:00  29906.661748      0.002472      0.006809
9   ethereum  2022-06-05 00:00:00+00:00   1805.204989      0.001996     -0.015781
10   bitcoin  2022-06-06 00:00:00+00:00  31364.535502      0.048747      0.051340
11  ethereum  2022-06-06 00:00:00+00:00   1858.546508      0.029549      0.031603

Python根据前几天的日期列获得百分比增加

━╋う一瞬間旳綻放 2025-02-18 15:15:10

我希望我能理解您的问题。我试图修复程序,就像它将读取文件并列出文件中的数据列表。

我解决了一些问题;

  1. 对于横向函数,我添加了一个for循环,并使用%c

    打印了数据。

      while(temp!= null){
        for(i = 0; temp-> data [i]!='\ 0'; i ++){
        printf(“%c \ n”,temp-> data [i]);
       }
        temp = temp-> next;
    }
     
  2. 我更改了 intertatend 这样的功能;

      void intertatend(文件* f,char* data)
     

自然而然,在主要功能中,称此函数的变化如;

    insertAtEnd(ifp, result[i]);

顺便说一句,我的合格者希望我将 temp char 的形式表示,它说这是第一次使用。似乎您在& 之后进入了一个空间。

    insertAtEnd(ofp, &temp);
  1. 我将以下语句添加到 main 函数;

      argc- = optind;
    argv += optind;
     
  2. 我还更改了此 ifp = fopen(ifilename,“ r”); 使用此 ifp = fopen(“ ifilename.txt”,“ r”); >陈述。我打开了一个名为 ifilename.txt 的文本文件,并在那里写了一些数据。

编辑:
好的,因此,如果要将字符串打印到输出文件,并且要单独打印单词,您将更改执行以下操作的代码:

  1. 我用数组更改了结构的数据,预期的最大线长度,尖锐定义 max_len ;

     结构节点
    {
      char* data [max_len];
      结构节点 *prev;
      struct node *next;
    };
     
  2. 我再次更改了 interatend 函数,因为我在主函数中扫描了该文件,制作了字符串数组,将其发送到此功能并将其添加到列表的末尾。我在主要金属中使用了这件代码:

      char* result [count];
    char* temp =(char*)malloc(sizeof(char));
    while(fgets(temp,sizeof(temp),ifp))
    {
        结果[count] =(char*)malloc(sizeof(char)*20);
        strcpy(结果[count],temp);
        插入(结果,计数);
        计数++;
    }
     

count 是文件中的字符串数。我还将此数字发送到 intertatend 函数;

void insertAtEnd(char* data[], int size)
{
  //Create a new node
  struct node *newnode = (struct node*)malloc(sizeof(struct node));
  newnode->data[size] = data[size];
      if (newnode->data[size] != NULL) {
...
  1. 我想使用您在 main 函数中打开的输出文件,因此我发送了此文件并发送了 count -number of Strings--到打印功能<代码>横向像这样;

      void traverse(file *,int size)
    {
      int i;
      //列表为空
      if(head == null){
        printf(“ \ nlist为空\ n”);
        返回;
      };
      // else打印数据
      struct节点* temp;
      temp = head;
      while(temp!= null){
        for(i = 0; i&lt; size; i ++){
          fputs(temp-&gt; data [i],of);
          temp = temp-&gt; next;
        }
      fprintf(of,“ \ n”);
      }
    }
     

同样在 main 函数中,调用此函数将更改为;

traverse(ofp, count);

I hope I understood right your question. I tried to fix the program like it will read a file and make a list of the data in the file.

I fixed some issues;

  1. For the transverse function, i added a for loop and printed the data using %c.

    while (temp != NULL) {
        for(i=0; temp->data[i]!='\0'; i++) {
        printf("%c\n", temp->data[i]);
       }
        temp = temp->next;
    }
    
  2. I changed the insertAtEnd function like this;

    void insertAtEnd(FILE* f, char* data)
    

And naturally, in main function, calling this function changed like;

    insertAtEnd(ifp, result[i]);

By the way for the following statement, my complier wanted me to express the temp as char, it said it was the first use of this. It also seems like you entered a space after &.

    insertAtEnd(ofp, &temp);
  1. I added the following statements to the main function;

    argc -= optind;
    argv += optind;
    
  2. I also changed this ifp= fopen(ifilename, "r"); statement with this ifp= fopen("ifilename.txt", "r");statement. I opened a text file named ifilename.txt and wrote some data there.

EDIT:
Ok so if you want to print the strings to an output file and you want to print the words in the lines individually, you will change the code doing the following things:

  1. I changed the struct's data with an array, gave it an expected maximum line length with a sharp defined MAX_LEN;

    struct node
    {
      char* data[MAX_LEN];
      struct node *prev;
      struct node *next;
    };
    
  2. I changed the insertAtEnd function again because I scanned the file in main function, made an array of the strings, sent it to this function and added it to the end of the list. I used this piece of code in main fuction:

    char* result[count];
    char* temp = (char*)malloc(sizeof(char));
    while (fgets(temp, sizeof(temp), ifp))
    {
        result[count] = (char*)malloc(sizeof(char)*20);
        strcpy(result[count], temp);
        insertAtEnd(result, count);
        count++;
    }
    

count is the number of strings in the file. I also sent this number to insertAtEnd function;

void insertAtEnd(char* data[], int size)
{
  //Create a new node
  struct node *newnode = (struct node*)malloc(sizeof(struct node));
  newnode->data[size] = data[size];
      if (newnode->data[size] != NULL) {
...
  1. I wanted to use the output file you opened in the main function, so I sent this file and sent the count -number of strings- to the printing function transverse like this;

    void traverse(FILE *of, int size)
    {
      int i;
      // List is empty
      if (head == NULL) {
        printf("\nList is empty\n");
        return;
      };
      // Else print the Data
      struct node* temp;
      temp = head;
      while (temp != NULL) {
        for(i=0; i<size; i++) {
          fputs(temp->data[i], of);
          temp = temp->next;
        }
      fprintf(of, "\n");
      }
    }
    

Also in main function, calling this function will be changing like;

traverse(ofp, count);

如何将C代码打印到输出文件?

━╋う一瞬間旳綻放 2025-02-18 14:39:31

相关ID仅在GitLab日志中或GitLab的HTTP 响应中找到。这也仅适用于GitLab的服务,并且是内部机械师。您无需做任何事情即可获得与日志或响应中出现的相关ID。如果您的工作或其他代码写入使用 curl 与Gitlab通信,则您(不能)自己不提供相关ID。

例如,当Gitlab Runner向协调员(GitLab服务器)上的Jobs API提出后请求时,您将使用类似于GitLab日志中的以下日志:

{"content_type":"","correlation_id":"01234ABCDEFGHIJKLMNOPQRSTU","duration_ms":1,"host":"gitlab.example.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"127.0.0.1:0","remote_ip":"127.0.0.1","route":"^/api/v4/jobs/request\\z","status":204,"system":"http","time":"2022-06-30T00:17:40Z","ttfb_ms":1,"uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 15.1.1 (15-1-stable; go1.17.7; linux/amd64)","written_bytes":0}

如果您是自载gitlab,则只需查看Gitlab的日志并可以访问其日志(通常是系统管理员可以通过在磁盘上查找它们)。如果您使用的是gitlab.com,则无法访问这些日志。

作为客户端,您可以在gitlab的HTTP 响应中的响应标头中看到相关ID。使用 curl 作为示例,您可以添加 - 冗长标志以查看响应标头。

在这里,我们将 grep x-request-id 使其更容易看到。

$ curl --verbose https://gitlab.com/api/v4/projects/278964 2> >(grep x-request-id)
< x-request-id: 01G6S0168KKRNVNM5610DRXVPW

查看libcurl文档,有一个看起来很有希望的变量(curl_trace) - 将其设置为1个工作中的1个似乎没有产生任何不同/附加的输出

在您的工作中产生任何不同/附加的输出设置变量,例如 curl_trace 不会影响跑步者和GitLab(1)之间的相互作用,因为跑步者环境/配置是从其运行的作业中隔离的,并且(2)跑步者不使用卷发; Gitlab Runner

还有其他方法可以哄骗跑步者提供相关ID?

tl; no。跑步者未从其向GitLab提出的请求记录HTTP响应标头。除非您修改跑步者的源代码来记录响应标头并将跑步者从修改后的源代码重新编译,否则这是不可能的。

Correlation IDs are only found in the GitLab logs or in HTTP responses from GitLab. This also only applies to GitLab's services and is an internal mechanic. You do not need to do anything to get correlation IDs to appear in logs or responses. If your jobs or other code you write use curl to communicate with GitLab, you do not (cannot) provide the correlation ID yourself.

For example, when the gitlab runner makes a POST request to the jobs API on the coordinator (the gitlab server) you will a log similar to the following in GitLab's logs:

{"content_type":"","correlation_id":"01234ABCDEFGHIJKLMNOPQRSTU","duration_ms":1,"host":"gitlab.example.com","level":"info","method":"POST","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"127.0.0.1:0","remote_ip":"127.0.0.1","route":"^/api/v4/jobs/request\\z","status":204,"system":"http","time":"2022-06-30T00:17:40Z","ttfb_ms":1,"uri":"/api/v4/jobs/request","user_agent":"gitlab-runner 15.1.1 (15-1-stable; go1.17.7; linux/amd64)","written_bytes":0}

You will only be to see GitLab's logs if you are self-hosting GitLab and have access to its logs (typically a system administrator would be able to see these by looking for them on disk). If you are using gitlab.com you do not have access to these logs.

As a client, you can see the correlation ID in the response headers in the HTTP responses from GitLab. Using curl as an example, you can add the --verbose flag to see the response headers.

Here we'll grep for the x-request-id to make it easier to see.

$ curl --verbose https://gitlab.com/api/v4/projects/278964 2> >(grep x-request-id)
< x-request-id: 01G6S0168KKRNVNM5610DRXVPW

Looking at the libcurl docs, there is a variable that looked promising (CURL_TRACE) -- setting that to 1 in the job didn't seem to produce any different/additional output

Setting variables like CURL_TRACE in your job will not impact the interactions between the runner and GitLab (1) because the runner environment/configuration is isolated from the jobs it runs and (2) the runner does not use curl; GitLab runner communicates to GitLab using golang http libraries.

Is there some other way to coax the runner to provide correlation IDs?

TL;DR no. The runner does not log HTTP response headers from requests it makes to GitLab. This is not possible unless you modify the source code of the runner to log response headers and recompile the runner yourself from your modified source code.

您如何获得gitlab ci工作的相关性ID?

━╋う一瞬間旳綻放 2025-02-18 14:38:30

您可以使用类似的内容:

SELECT * FROM
(
SELECT cdc.type,     Switch(
        type = "APPEND", 2,
        type = "UPDATE", 3,
        type = "DELETE", 4
        ) AS typeid, cdc.id, cdc.timestamp, cdc.product, cdc.price
FROM cdc 
UNION 
SELECT "Current" AS type, 1 AS typeid, sales.id, sales.timestamp, sales.product, sales.price
FROM sales
)
ORDER BY id, typeid

您可以在子征服和外部查询上都有其他查询子句,

您可以在内部查询中使用案例语句为每个事务类型设置typeID,然后通过TypeId

note 订购外部查询。 :查询写在MS访问中

You can use something like this:

SELECT * FROM
(
SELECT cdc.type,     Switch(
        type = "APPEND", 2,
        type = "UPDATE", 3,
        type = "DELETE", 4
        ) AS typeid, cdc.id, cdc.timestamp, cdc.product, cdc.price
FROM cdc 
UNION 
SELECT "Current" AS type, 1 AS typeid, sales.id, sales.timestamp, sales.product, sales.price
FROM sales
)
ORDER BY id, typeid

You may have WHERE and other query clauses on both sub-queries and outer query

You can use a CASE statement for setting typeid for each transaction type in inner queries and then order outer query by typeid

Note: The query is written in MS Access

查询以模拟事务日志

━╋う一瞬間旳綻放 2025-02-18 13:14:01

似乎SDL2板条箱的文档是为已经知道SDL如何工作并且只想在Rust中使用它的人编写的。您可能想先完成几个教程……
再说一次,只有 point 带领我到正确的功能

快速示例带有一些闪烁的点:

use rand::Rng;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::pixels::Color;
use sdl2::rect::Point;
use std::time::Duration;

pub fn main() {
    let sdl_context = sdl2::init().unwrap();
    let video_subsystem = sdl_context.video().unwrap();

    let window = video_subsystem
        .window("rust-sdl2 demo", 800, 600)
        .position_centered()
        .build()
        .unwrap();

    let mut canvas = window.into_canvas().build().unwrap();

    let mut event_pump = sdl_context.event_pump().unwrap();
    let mut i = 0;
    let mut rng = rand::thread_rng();
    'running: loop {
        for event in event_pump.poll_iter() {
            match event {
                Event::Quit { .. }
                | Event::KeyDown {
                    ..
                } => break 'running,
                _ => {}
            }
        }
        canvas.set_draw_color(Color::RGB(0, 0, 0));
        canvas.clear();
        i = (i + 1) % 255;
        canvas.set_draw_color(Color::RGB(i, 64, 255 - i));
        let (w, h) = canvas.output_size().unwrap();
        let mut points = [Point::new(0, 0); 256];
        points.fill_with(|| Point::new(rng.gen_range(0..w as i32), rng.gen_range(0..h as i32)));
        // For performance, it's probably better to draw a whole bunch of points at once
        canvas.draw_points(points.as_slice()).unwrap();

        canvas.present();
        ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 60)); // sloppy FPS limit
    }
}

It seems the documentation for the sdl2 crate is written for someone who already knows how sdl works and just wants to use it in Rust. You may want to run through a few tutorials first…
Then again, just string-searching for point led me to the right function.

Quick example with some flickering points:

use rand::Rng;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::pixels::Color;
use sdl2::rect::Point;
use std::time::Duration;

pub fn main() {
    let sdl_context = sdl2::init().unwrap();
    let video_subsystem = sdl_context.video().unwrap();

    let window = video_subsystem
        .window("rust-sdl2 demo", 800, 600)
        .position_centered()
        .build()
        .unwrap();

    let mut canvas = window.into_canvas().build().unwrap();

    let mut event_pump = sdl_context.event_pump().unwrap();
    let mut i = 0;
    let mut rng = rand::thread_rng();
    'running: loop {
        for event in event_pump.poll_iter() {
            match event {
                Event::Quit { .. }
                | Event::KeyDown {
                    ..
                } => break 'running,
                _ => {}
            }
        }
        canvas.set_draw_color(Color::RGB(0, 0, 0));
        canvas.clear();
        i = (i + 1) % 255;
        canvas.set_draw_color(Color::RGB(i, 64, 255 - i));
        let (w, h) = canvas.output_size().unwrap();
        let mut points = [Point::new(0, 0); 256];
        points.fill_with(|| Point::new(rng.gen_range(0..w as i32), rng.gen_range(0..h as i32)));
        // For performance, it's probably better to draw a whole bunch of points at once
        canvas.draw_points(points.as_slice()).unwrap();

        canvas.present();
        ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 60)); // sloppy FPS limit
    }
}

RUST-SDL2:有没有办法绘制一个单数像素到屏幕?

━╋う一瞬間旳綻放 2025-02-18 05:56:18

(由于解决了OP的问题,因此将其添加为正式答案)。

该错误在 getInitialQuestionList()函数中,该功能当前包含一个无限环路 - 数组的长度永远不会增加。正如您所确定的那样,您在问题上使用错误的 .text 属性,而不是正确的 .questiontext

我如何发现

我复制并将您的代码粘贴到一个新的React Codesandbox中的问题,这向我展示了一条不错的错误消息,说明可能有无限的循环和功能中的确切行。不过,我只是没有足够长时间的时间来挖掘它,以弄清为什么无限循环会发生。

PS如果您在此处使用Typescript,则TS编译器可能会遇到此错误,并为您节省了很多麻烦。只是思考的食物。

(Adding this as a formal answer since it solved the OP's issue).

The bug is in the getInitialQuestionList() function, which currently contains an infinite loop - the length of the array never increases. As you yourself identified, you were using the wrong .text property on the question instead of the correct .questionText.

How I found out the problem

I copied and pasted your code into a new React CodeSandbox, which showed me a nice error message saying there was a likely infinite loop and the exact line in the function. I just didn't dig into it long enough after that to figure out why the infinite loop was happening, though.

P.S. If you were using TypeScript here, the TS Compiler likely would have caught this error and saved you a lot of bother. Just food for thought.

功能性反应组件冻结网页

━╋う一瞬間旳綻放 2025-02-18 00:30:28

因此,经过大量的研究,似乎班级库必须成为消费解决方案的一部分。否则,在类库中安装的软件包也必须安装在消费应用程序中。添加这些软件包后,该应用程序可以正常工作。希望这对别人有帮助。

So after a lot of research, it appears the class library must a made a part of the consuming solution. Otherwise, packages installed in the class library, must also be installed within the consuming application. Once I added these packages, the application worked correctly. Hope this helps someone else.

我如何求解无法加载文件或汇编类库,“ Microsoft.entityframeworkcore版本= 6.0 in Class Library

━╋う一瞬間旳綻放 2025-02-17 22:17:04

无法将 java.lang.integer转换为java.lang.string []

请参阅此问题

为了做同样的事情,您可以将字符串作为每种情况的值传递。然后比较活动中的情况。分配活动中数组的值。

It is not possible to convert java.lang.Integer cannot be cast to java.lang.String[].

Refer to this question.

For doing the same thing you can pass the string as a value for each case. Then compare that case in the activity. Assign the values of the arrays in the activity.

如何将字符串阵列从函数传递到Android Kotlin的活动?

━╋う一瞬間旳綻放 2025-02-17 19:59:13

您需要为每个文件夹创建新的存储提供商实例。像:

string contentContainer = "container1";

        // Creates a new StorageProvider instance
        var coreStorageProvider = new StorageProvider("Azure", "CMS.AzureStorage")
        {
            // Specifies the target container which should represent the site/codebase
           
            CustomRootPath = contentContainer
        };

        // Maps a directory to the provider
        StorageHelper.MapStoragePath("~/foo1", coreStorageProvider);

string contentContainer = "container2";

        // Creates a new StorageProvider instance
        var coreStorageProvider = new StorageProvider("Azure", "CMS.AzureStorage")
        {
            // Specifies the target container which should represent the site/codebase
           
            CustomRootPath = contentContainer
        };

        // Maps a directory to the provider
        StorageHelper.MapStoragePath("~/foo2", coreStorageProvider);

You need to create new storage provider instance for each folder. Something like:

string contentContainer = "container1";

        // Creates a new StorageProvider instance
        var coreStorageProvider = new StorageProvider("Azure", "CMS.AzureStorage")
        {
            // Specifies the target container which should represent the site/codebase
           
            CustomRootPath = contentContainer
        };

        // Maps a directory to the provider
        StorageHelper.MapStoragePath("~/foo1", coreStorageProvider);

string contentContainer = "container2";

        // Creates a new StorageProvider instance
        var coreStorageProvider = new StorageProvider("Azure", "CMS.AzureStorage")
        {
            // Specifies the target container which should represent the site/codebase
           
            CustomRootPath = contentContainer
        };

        // Maps a directory to the provider
        StorageHelper.MapStoragePath("~/foo2", coreStorageProvider);

Kentico多个媒体库链接到多个Azure容器

━╋う一瞬間旳綻放 2025-02-17 13:48:16

我使用 lt prof 过去,我的C ++应用程序快速运行。它的工作非常简单,并且使用编译程序,不需要和源代码挂钩或调整。我相信有一个试用版。

I used lt prof in the past for a quick run down of my C++ app. It works pretty easy and runs with a compiled program, does not need and source code hooks or tweaks. There is a trial version available I believe.

什么非常简单的C&#x2B;&#x2B; Profiler(vc&#x2b;&#x2b;)?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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