问:
Add content to every cell (not a event) using view resourceTimeGridWeek
I have the view resourceTimeGridWeek. I set datesAboveResources: true. I have about 10 ressources. So if a scroll to the right side, I have NO time info on screen (time info only at the left side before first ressource)

I want to put time information to every cell like navLinks for dayGridView.

Is there a solution? Or maybe show timeline after each day?


来源: stackexchange

问:
How add field to latest.yml generated by electron-builder
Due electron 23 stopped support windows 7, how can i prevent autoupdate my app on win7 if new version based on electron >23?
Only way i see, on event update-available get info from latest.yml, but how add this info to generated latest.yml file?
Can i add custom field, or something else?

ContentLicense: CC BY-SA 4.0


问:
how can i do that telethon event new message disconnect() more than 2s
i send a message to bot but i don't known bot give me how many message, what can i do let's telethon disconnect() when wait time more than 2s

code:

```<code>@client.on(events.NewMessage(from_users='some_bot'))
async def my_event_handler(event):
    if type(event.message.media) is telethon.tl.types.MessageMediaPhoto:
        await event.message.download_media(file="./%s"%path)
    elif event.message.message:
        print('message',event.message.text,event.message.id)
</code>```

the bot give me a result with freedom num message ,  i want revice last message then disconnect(), what can i do

Body:
i send a message to bot but i don't known bot give me how many message, what can i do let's telethon disconnect() when wait time more than 2s

code:

@client.on(events.NewMessage(from_users='some_bot'))
async def my_event_handler(event):
    if type(event.message.media) is telethon.tl.types.MessageMediaPhoto:
        await event.message.download_media(file="./%s"%path)
    elif event.message.message:
        print('message',event.message.text,event.message.id)

the bot give me a result with freedom num message ,  i want revice last message then disconnect(), what can i do


问:
Issue with options of the marked library for React
I use Marked library in a React project and would like to set the option "gfm: true" and "breaks: true".

Based on example provided on the official website I think I am doing the right thing but the changes do not appear on my project.

I have put the two solutions below but none of them works.

```<code>
React.useEffect(() => {
    [textToMarkdown(), markdownText]
})

    const [markdowned, setMarkdowned] = React.useState("")

    const handleChange = (e) => {
        setMarkdownText(e.target.value)
        textToMarkdown()
    }

    // https://marked.js.org/using_advanced
    marked.setOptions({
        gfm: true,
        breaks: true,
        xhtml: true
      });

    const textToMarkdown = () => {
        setMarkdowned(marked.parse(markdownText, {breaks: true, gfm: true}));
    }

</code>```

Body:
I use Marked library in a React project and would like to set the option "gfm: true" and "breaks: true".

Based on example provided on the official website I think I am doing the right thing but the changes do not appear on my project.

I have put the two solutions below but none of them works.

React.useEffect(() => {
    [textToMarkdown(), markdownText]
})

    const [markdowned, setMarkdowned] = React.useState("")

    const handleChange = (e) => {
        setMarkdownText(e.target.value)
        textToMarkdown()
    }

    // https://marked.js.org/using_advanced
    marked.setOptions({
        gfm: true,
        breaks: true,
        xhtml: true
      });

    const textToMarkdown = () => {
        setMarkdowned(marked.parse(markdownText, {breaks: true, gfm: true}));
    }


问:
How to implement the EF Core IDbContextFactory in a WPF application?
I'm developing a WPF application. I'm new at using the IDbContextFactory and I am struggling to implement it. I've spent a few hours on Google, but couldn't find any solution. The DbFactory is, in all examples, already injected. But how to initialize it?

I've added the services AddDbContextFactory in my App.xaml.cs

```<code>public partial class App : Application
    {
        public static IHost? AppHost { get; private set; }

        public App()
        {
            // HostBuilder
            AppHost = Host.CreateDefaultBuilder()
                .ConfigureServices((hostContext, services) =>
                {
                    services.AddSingleton<MainWindow>();
                    services.AddDbContextFactory<AppDbContext>(options => options.UseMySQL("server=localhost;port=3306;user=user;password='password';database=db;"));
                })
                .Build();
        }
    }
}
</code>```

My AppDbContext

```<code>public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }

    public DbSet<>...
}
</code>```

My MainWindow.xaml has a ViewModel as DataContext

```<code><Window x:Class="SeeUs.WPF.MainWindow"
        ...
        Title="Appli" Height="1080" Width="1920">
    <Window.DataContext>
        <viewmodels:MainWindowViewModel/>
    </Window.DataContext>
    <Window.Resources>
</Window>
</code>```

And my MainWindowViewModel.cs

```<code>public class MainWindowViewModel
{
    private readonly IDbContextFactory<AppDbContext> _dbContextFactory; // <-- as per the .net documentation
    private readonly AppDbContext _dbContext;

    public MainWindowViewModel()
    {
        _dbContext = _dbContextFactory.CreateDbContext(); // <-- when running, _dbContextFactory is null, not assigned
    }
}
</code>```

When I build (no error) and start my app, I've a NullReferenceException on '_dbContext = _dbContextFactory.CreateDbContext();'.

What am I missing, please? The MainWindowViewModel is the first one, so does not get any previous factory injected. How can I initialize the first IDbContextFactory?

Thank you.

Body:
I'm developing a WPF application. I'm new at using the IDbContextFactory and I am struggling to implement it. I've spent a few hours on Google, but couldn't find any solution. The DbFactory is, in all examples, already injected. But how to initialize it?

I've added the services AddDbContextFactory in my App.xaml.cs

public partial class App : Application
    {
        public static IHost? AppHost { get; private set; }

        public App()
        {
            // HostBuilder
            AppHost = Host.CreateDefaultBuilder()
                .ConfigureServices((hostContext, services) =>
                {
                    services.AddSingleton<MainWindow>();
                    services.AddDbContextFactory<AppDbContext>(options => options.UseMySQL("server=localhost;port=3306;user=user;password='password';database=db;"));
                })
                .Build();
        }
    }
}

My AppDbContext

public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }

    public DbSet<>...
}

My MainWindow.xaml has a ViewModel as DataContext

<Window x:Class="SeeUs.WPF.MainWindow"
        ...
        Title="Appli" Height="1080" Width="1920">
    <Window.DataContext>
        <viewmodels:MainWindowViewModel/>
    </Window.DataContext>
    <Window.Resources>
</Window>

And my MainWindowViewModel.cs

public class MainWindowViewModel
{
    private readonly IDbContextFactory<AppDbContext> _dbContextFactory; // <-- as per the .net documentation
    private readonly AppDbContext _dbContext;

    public MainWindowViewModel()
    {
        _dbContext = _dbContextFactory.CreateDbContext(); // <-- when running, _dbContextFactory is null, not assigned
    }
}

When I build (no error) and start my app, I've a NullReferenceException on '_dbContext = _dbContextFactory.CreateDbContext();'.

What am I missing, please? The MainWindowViewModel is the first one, so does not get any previous factory injected. How can I initialize the first IDbContextFactory?

Thank you.


问:
Can a ASP.NET Core MVC web app receive a new Azure AD access token during an Axios Request?
Based on this reading the AuthorizeForScope tag in a controller will handle getting a new access token if there is an issue with the previous access token. This could be if the access token expires or the cache of the server is cleared and and the token was stored in cache similar to the implementations shown in the default Azure AD sample codes on github for calling MS Graph. This does exactly what it should if you are doing full page redirects using the browser URL by accessing a GET controller in my MVC web app. However, if you are using a SPA like VueJS we are not doing full page reloads but instead Axios requests. So if the controller has the AuthorizeForScope tag and the access token was cleared from cache then the tag does what it is suppose to it and creates a redirect for the new challenge to get the new access token. This redirect is returned to Axios as a redirect 302 error. I am able to intercept this event and convert this error to a 401 error and handle it on the front end by pushing the user to a custom login page with a button to do a new challenge manually. However, can this all be done without effecting the flow of the user experience? For example can a new token be obtained without a full page redirect and handled on the web server despite having delegated permissions for my app?

OR is this not possible and since the methods in my controllers do other stuff and not just use this token, should I just run a simple MS Graph function at the beginning of all of my methods in every controller to trip the error early to send that 401 error so they can hit the challenge button and get a new access token with a actual page redirect.


问:
while i put "/" in blogs/create i stick on a error. Cast to ObjectId failed for value "createses" (type string) at path "_id" for model "blogs"
while i put "/" between blogs,create .The server stoped

```<code>app.get("/blogs/create", (req, res) => {
  res.render("create.ejs", { title: "About" });
});
</code>```

while i remove the"/" it work properly

```<code>app.get("/blogs/createses", (req, res) => {
  res.render("create.ejs", { title: "About" });
});
</code>```

Is it possible to make url as "http://localhost:3000/blogs/create" ?How?

Body:
while i put "/" between blogs,create .The server stoped

app.get("/blogs/create", (req, res) => {
  res.render("create.ejs", { title: "About" });
});

while i remove the"/" it work properly

app.get("/blogs/createses", (req, res) => {
  res.render("create.ejs", { title: "About" });
});

Is it possible to make url as "http://localhost:3000/blogs/create" ?How?


问:
How to create a line chart with filter option and Data table for a R shiny dashboard?
I'm trying to create a line chart which is based on filter option along with data table. If I click the filter option it only changed in data table. But I want to set the filters for both Line chart and data table. Kindly help me.

My server.r code is:

```<code>output$grp_stacked_bar <- renderPlotly({
  data <- ex
    agg_sum <- aggregate(data$Result,by=list(Category = data$Donor_ID),FUN=sum, na.rm=TRUE)
    p <- plot_ly(
      data = agg_sum,
      x = ~Category,
      y = ~x,
      type = "scatter",
      mode = "lines+markers"
    ) %>% layout(title = "Functional  Outlier Details", xaxis = list(title = "Donor_ID"),
                 yaxis = list(title = "Result"))
    p
  })
</code>```

ui.r:

```<code>column(width = 10,
                   fluidRow(h2("Function Outlier Details",class="box-title",align="center"),
                            plotlyOutput(height="48vh",width ="82vw",outputId = "grp_stacked_bar")%>%withSpinner(color="#0dc5c1",hide.ui = FALSE,image.height = "73px",image.width = "145px",image= ".\\logo_gif2.gif"))

            )
</code>```

My sample dataset is:
enter image description here

Body:
I'm trying to create a line chart which is based on filter option along with data table. If I click the filter option it only changed in data table. But I want to set the filters for both Line chart and data table. Kindly help me.

My server.r code is:

output$grp_stacked_bar <- renderPlotly({
  data <- ex
    agg_sum <- aggregate(data$Result,by=list(Category = data$Donor_ID),FUN=sum, na.rm=TRUE)
    p <- plot_ly(
      data = agg_sum,
      x = ~Category,
      y = ~x,
      type = "scatter",
      mode = "lines+markers"
    ) %>% layout(title = "Functional  Outlier Details", xaxis = list(title = "Donor_ID"),
                 yaxis = list(title = "Result"))
    p
  })

ui.r:

column(width = 10,
                   fluidRow(h2("Function Outlier Details",class="box-title",align="center"),
                            plotlyOutput(height="48vh",width ="82vw",outputId = "grp_stacked_bar")%>%withSpinner(color="#0dc5c1",hide.ui = FALSE,image.height = "73px",image.width = "145px",image= ".\\logo_gif2.gif"))

            )

My sample dataset is:
enter image description here


问:
Consuming from a Kafka topic that requires authentication using reactor kafka
I have a micro-service that consumes from a Kafka topic that requires authentication. Below is the code I wrote for that. I am fetching the username and password from environment variables that I am sure is working as expected.

```<code>val receiverOptions = ReceiverOptions.create<ByteBuffer, ByteBuffer(defaultKafkaBrokerConfig.getAsProperties())
val kafkaJaasConfig = String.format(
    "org.apache.kafka.common.security.scram.ScramLoginModule required username='%s' password='%s';",
    kafkaUsername,
    kafkaPassword
)
val schedulerKafkaConsumer = Schedulers.newSingle("consumer")
val options = receiverOptions
    .subscription(topicConfig.topics)
    .pollTimeout(Duration.ofMillis(topicConfig.pollWaitTimeoutMs.toLong()))
    .consumerProperty(SaslConfigs.SASL_MECHANISM, "SCRAM-SHA-512")
    .consumerProperty(SaslConfigs.SASL_JAAS_CONFIG, kafkaJaasConfig)
    .consumerProperty(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_PLAINTEXT")

    return KafkaReceiver.create(options)
        .receive()
        .subscribeOn(schedulerKafkaConsumer)
        .map { record: ReceiverRecord<ByteBuffer, ByteBuffer> -> handleConsumerRecord(record) }
        .onErrorContinue { throwable: Throwable?, _: Any? ->
            log.error(
                "Error consuming and deserializing messages",
                throwable
            )
        }
</code>```

The code works fine when I run it locally. However, on GCP development environment, i get the following error:

```<code>Bootstrap broker <<some_ip>>:9093 (id: -2 rack: null) disconnected
org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-service_gcp-edge_6ef14fcc-3443-4782-aa38-0910a5aea9b9-2, groupId=service_gcp-edge_6ef14fcc-3443-4782-aa38-0910a5aea9b9] Connection to node -1 (kafka0-data-europe-west4-kafka.internal/<<some_ip>>:9093) terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue.
</code>```

Upon bashing into the cluster, I could connect to the topic and consume messages with a command line tool and so it removes the possibility of any infra related issue.

Can someone please help me figure out what am I doing wrong here and how can I fix this?

Body:
I have a micro-service that consumes from a Kafka topic that requires authentication. Below is the code I wrote for that. I am fetching the username and password from environment variables that I am sure is working as expected.

val receiverOptions = ReceiverOptions.create<ByteBuffer, ByteBuffer(defaultKafkaBrokerConfig.getAsProperties())
val kafkaJaasConfig = String.format(
    "org.apache.kafka.common.security.scram.ScramLoginModule required username='%s' password='%s';",
    kafkaUsername,
    kafkaPassword
)
val schedulerKafkaConsumer = Schedulers.newSingle("consumer")
val options = receiverOptions
    .subscription(topicConfig.topics)
    .pollTimeout(Duration.ofMillis(topicConfig.pollWaitTimeoutMs.toLong()))
    .consumerProperty(SaslConfigs.SASL_MECHANISM, "SCRAM-SHA-512")
    .consumerProperty(SaslConfigs.SASL_JAAS_CONFIG, kafkaJaasConfig)
    .consumerProperty(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_PLAINTEXT")

    return KafkaReceiver.create(options)
        .receive()
        .subscribeOn(schedulerKafkaConsumer)
        .map { record: ReceiverRecord<ByteBuffer, ByteBuffer> -> handleConsumerRecord(record) }
        .onErrorContinue { throwable: Throwable?, _: Any? ->
            log.error(
                "Error consuming and deserializing messages",
                throwable
            )
        }

The code works fine when I run it locally. However, on GCP development environment, i get the following error:

Bootstrap broker <<some_ip>>:9093 (id: -2 rack: null) disconnected
org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-service_gcp-edge_6ef14fcc-3443-4782-aa38-0910a5aea9b9-2, groupId=service_gcp-edge_6ef14fcc-3443-4782-aa38-0910a5aea9b9] Connection to node -1 (kafka0-data-europe-west4-kafka.internal/<<some_ip>>:9093) terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue.

Upon bashing into the cluster, I could connect to the topic and consume messages with a command line tool and so it removes the possibility of any infra related issue.

Can someone please help me figure out what am I doing wrong here and how can I fix this?


问:
X-Mouse Button Control - Open folder in a new window
I'd like to create a macro on my mouse middle button that will open a folder in a new window using the Ctrl+ENTER combination.

I've tryed the following: {LMB}{HOLD:1}{CTRL}{ENTER}
but it doesn't seem to work.
Does anyone know what I'm doing wrong?


问:
How to I install protobufs C++/Python extension?
I'm looking to upgrade to the new protobuf version 4.21.0. I am sharing messages between python and c++, on the release page they mention that this capability breaks, unless I set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp, and ensure that the Python/C++ extension is installed.
How do I ensure that the Python/C++ extension is installed? Where do I find it? What is meant by this Python/C++ extension?
Also does the env var need to be set when generating *_pb2.py out of *.proto files or also when running python/c++ programs which are using protobuf?


问:
Multiple regression analysis Split result concern
I currently have a study on my thesis and as I ran the MRA in the SPSS and split the main sample into 2 the result for the predictors of the Split 1 and 2 are not the same. How should this be interpreted?

I tried to ran through again the data set but same results. My problem is how should this be interpreted?


问:
How to convert document file into PDF file
Want to know the procedure to convert doc file into pdf file.

Want to know the procedure to convert doc file into pdf file.


问:
How ?SPEVX LAPACK calculates eigenvectors?
I'm trying to use ?SPEVX to calculate eigenvalues and eigenvectors. Does anyone have a explanation to how ?SPEVX calculates eigenvectors? Because whenever I try to compare it to the analytical results, it doesn't match. My understanding is it ALWAYS generates real valued function, the question is HOW?
My understanding is linear combination of two eigenvectors (corresponding to this eigenvalue) will be a valid eigenvector! but how does this work? What is the linear combination.
Please help.

Thank you

I compared the eigenvectors to analytical function for such as exp(ix). The eigenvectors didn't match.


问:
Zoom on mouse position on an object without plugin
I am coding a pipeline game, I want to be able to zoom the grid on every blocks on it with on the mouse position because for the moment the zoom is on position (0,0) of the grid

Here is the code :

```<code> let gridSize = parseInt(
  getComputedStyle(document.querySelector('.blockimage')).height.match(
    /\d+/
  )[0] / 2
);
let zoomIn;
let zoomRate = 3;
document.getElementById('dropzone').addEventListener('wheel', function (event) {
  zoomIn = event.deltaY < 0;
  if (zoomIn && gridSize < 70) {
    gridSize += zoomRate;
    blocksArray.forEach(block => {
      block.blockWidth = parseInt(
        (block.blockWidth * gridSize) / (gridSize - zoomRate)
      );
      block.blockHeight = parseInt(
        (block.blockHeight * gridSize) / (gridSize - zoomRate)
      );
      block.cloneBlock[0].children[0].style.width =
        block.blockWidth - 1 + wordpress + 'px';
      block.cloneBlock[0].children[0].style.height =
        block.blockHeight - 1 + wordpress + 'px';

      block.cloneBlock[0].style.width = block.blockWidth + 1 + 'px';
      block.cloneBlock[0].style.height = block.blockHeight + 1 + 'px';
      // block.position[0][0] += zoomRate;
      // block.position[0][1] += zoomRate;
      correctPosition(block, 'in');
      // block.updatePosition();
      // block.whereToLook();
    });
  }
  if (!zoomIn && gridSize > 30) {
    gridSize -= zoomRate;
    blocksArray.forEach(block => {
      block.blockWidth = parseInt(
        (block.blockWidth * gridSize) / (gridSize + zoomRate)
      );
      block.blockHeight = parseInt(
        (block.blockHeight * gridSize) / (gridSize + zoomRate)
      );
      block.cloneBlock[0].children[0].style.width =
        block.blockWidth - 1 + wordpress + 'px';
      block.cloneBlock[0].children[0].style.height =
        block.blockHeight - 1 + wordpress + 'px';

      block.cloneBlock[0].style.width = block.blockWidth + 1 + 'px';
      block.cloneBlock[0].style.height = block.blockHeight + 1 + 'px';

      // block.position[0][0] -= zoomRate;
      // block.position[0][1] -= zoomRate;
      correctPosition(block, 'out');
      // block.updatePosition();
      // block.whereToLook();
    });
  }

  document
    .querySelectorAll('.elemblock')
    .forEach(elem => (elem.width = elem.height = `${gridSize * 2}px`));

  document
    .querySelectorAll('.blockimage')
    .forEach(elem => (elem.width = elem.height = `${gridSize * 2}px`));

  document.getElementById(
    'dropzone'
  ).style.backgroundSize = `${gridSize}px ${gridSize}px`;
});
</code>```

I already have the feature x = e.pageX y= e.pageY for on other part but I do not manage to use it here.

Body:
I am coding a pipeline game, I want to be able to zoom the grid on every blocks on it with on the mouse position because for the moment the zoom is on position (0,0) of the grid

Here is the code :

 let gridSize = parseInt(
  getComputedStyle(document.querySelector('.blockimage')).height.match(
    /\d+/
  )[0] / 2
);
let zoomIn;
let zoomRate = 3;
document.getElementById('dropzone').addEventListener('wheel', function (event) {
  zoomIn = event.deltaY < 0;
  if (zoomIn && gridSize < 70) {
    gridSize += zoomRate;
    blocksArray.forEach(block => {
      block.blockWidth = parseInt(
        (block.blockWidth * gridSize) / (gridSize - zoomRate)
      );
      block.blockHeight = parseInt(
        (block.blockHeight * gridSize) / (gridSize - zoomRate)
      );
      block.cloneBlock[0].children[0].style.width =
        block.blockWidth - 1 + wordpress + 'px';
      block.cloneBlock[0].children[0].style.height =
        block.blockHeight - 1 + wordpress + 'px';

      block.cloneBlock[0].style.width = block.blockWidth + 1 + 'px';
      block.cloneBlock[0].style.height = block.blockHeight + 1 + 'px';
      // block.position[0][0] += zoomRate;
      // block.position[0][1] += zoomRate;
      correctPosition(block, 'in');
      // block.updatePosition();
      // block.whereToLook();
    });
  }
  if (!zoomIn && gridSize > 30) {
    gridSize -= zoomRate;
    blocksArray.forEach(block => {
      block.blockWidth = parseInt(
        (block.blockWidth * gridSize) / (gridSize + zoomRate)
      );
      block.blockHeight = parseInt(
        (block.blockHeight * gridSize) / (gridSize + zoomRate)
      );
      block.cloneBlock[0].children[0].style.width =
        block.blockWidth - 1 + wordpress + 'px';
      block.cloneBlock[0].children[0].style.height =
        block.blockHeight - 1 + wordpress + 'px';

      block.cloneBlock[0].style.width = block.blockWidth + 1 + 'px';
      block.cloneBlock[0].style.height = block.blockHeight + 1 + 'px';

      // block.position[0][0] -= zoomRate;
      // block.position[0][1] -= zoomRate;
      correctPosition(block, 'out');
      // block.updatePosition();
      // block.whereToLook();
    });
  }

  document
    .querySelectorAll('.elemblock')
    .forEach(elem => (elem.width = elem.height = `${gridSize * 2}px`));

  document
    .querySelectorAll('.blockimage')
    .forEach(elem => (elem.width = elem.height = `${gridSize * 2}px`));

  document.getElementById(
    'dropzone'
  ).style.backgroundSize = `${gridSize}px ${gridSize}px`;
});

I already have the feature x = e.pageX y= e.pageY for on other part but I do not manage to use it here.


问:
Set condition to active resister button using ant design
```<code>        <Form.Item
          name="agreement"
          valuePropName="checked"
          rules={[
            {
              validator: (_, value) =>
                value
                  ? Promise.resolve()
                  : Promise.reject(new Error("Should accept agreement")),
            },
          ]}
        >
          <Checkbox>
            I have read the <a href="">agreement</a>
          </Checkbox>
        </Form.Item>

        <Form.Item>
          <Button
            type="primary"
            htmlType="submit"
            disabled={!validName || !validPwd || !validMatch ? true : false}
          >
            Register
          </Button>
        </Form.Item>

</code>```

This code is used to build a registration form. Here I use a checkbox to take agreement from the user. If All other conditions are true, the Register button will be displayed. But I can not understand how to add the condition of the check box to the active Register button. That means I want to enable Register button If all other conditions are true and the checkbox is checked. How can I add that condition to  disabled={!validName || !validPwd || !validMatch ? true : false} line?

Body:
        <Form.Item
          name="agreement"
          valuePropName="checked"
          rules={[
            {
              validator: (_, value) =>
                value
                  ? Promise.resolve()
                  : Promise.reject(new Error("Should accept agreement")),
            },
          ]}
        >
          <Checkbox>
            I have read the agreement
          </Checkbox>
        </Form.Item>

        <Form.Item>
          <Button
            type="primary"
            htmlType="submit"
            disabled={!validName || !validPwd || !validMatch ? true : false}
          >
            Register
          </Button>
        </Form.Item>

This code is used to build a registration form. Here I use a checkbox to take agreement from the user. If All other conditions are true, the Register button will be displayed. But I can not understand how to add the condition of the check box to the active Register button. That means I want to enable Register button If all other conditions are true and the checkbox is checked. How can I add that condition to  disabled={!validName || !validPwd || !validMatch ? true : false} line?


问:
LsaLogonUser in a WCP context to sign in into windows is not working
When I boot my computer, I am attempting to have sign in into Windows without having to enter credentials. These credentials are available and entered from other means (which excludes the solution of using the winlogon default registry values), in a "single sign-on" kind of deal. Anyways, I am therefore attempting to go about it by creating a Windows Credential Provider (WCP). I got this to run. In this WCP I am applying the LsaLogonUser function with MSV1_0_INTERACTIVE_LOGON. Everything returns the result of success but it does not make the computer to actually log on. I might've misunderstood how it all works so I was wondering if anyone know why it doesn't work. My thoughts is that the issue potentially is that the session only lasts as long as the scope does. That is, as long as the token exists. So when the LogonUI (by Winlogon) process finishes it's execution, it is automatically signed out or something. What am I missing?

Here is a big chunk of code of how it executes:

```<code>void login(std::wstring domain, std::wstring username, std::wstring secret)
{
    //Get a handle to LSA
    HANDLE hLSA = nullptr;
    NTSTATUS status = LsaConnectUntrusted(&hLSA);
    if (status != 0)
    {
        int winError = LsaNtStatusToWinError(status);
        LLLOG(L"Error calling LsaConnectUntrusted. Error code: " + std::to_wstring(winError) );
        return;
    }
    if (!hLSA)
    {
        LLLOG(L"hLSA is NULL");
        return;
    }

    //Build LsaLogonUser parameters
    LSA_STRING originName = {};
    char originNameStr[] = "WCP";
    originName.Buffer = originNameStr;
    originName.Length = (USHORT)strlen(originNameStr);
    originName.MaximumLength = originName.Length;

    ULONG authPackage = 0;
    PLSA_STRING authPackageName = new LSA_STRING();
    char authPackageBuf[] = MSV1_0_PACKAGE_NAME;
    authPackageName->Buffer = authPackageBuf;
    authPackageName->Length = (USHORT)strlen(authPackageBuf);
    authPackageName->MaximumLength = (USHORT)strlen(authPackageBuf);
    status = LsaLookupAuthenticationPackage(hLSA, authPackageName, &authPackage);
    if (status != 0)
    {
        int winError = LsaNtStatusToWinError(status);
        LLLOG(L"Call to LsaLookupAuthenticationPackage failed. Error code: " + std::to_wstring(winError));
        return;
    }

    DWORD authBufferSize = 0;
    PVOID authBuffer = CreateNtlmLogonStructure(domain, username, secret, &authBufferSize);
    LLLOG(L"authBufferSize: " + std::to_wstring(authBufferSize));

    //Get TokenSource
    HANDLE hProcess = GetCurrentProcess();
    HANDLE procToken = nullptr;
    BOOL success = OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &procToken);
    if (!success)
    {
        DWORD errorCode = GetLastError();
        LLLOG(L"Call to OpenProcessToken failed. Errorcode: " + std::to_wstring(errorCode));
        return;
    }

    TOKEN_SOURCE tokenSource = {};
    DWORD realSize = 0;
    success = GetTokenInformation(procToken, TokenSource, &tokenSource, sizeof(tokenSource), &realSize);
    if (!success)
    {
        LLLOG(L"Call to GetTokenInformation failed.");
        return;
    }

    //
    PVOID profileBuffer = NULL;
    ULONG profileBufferSize = 0;
    LUID loginId;
    HANDLE token = NULL;
    QUOTA_LIMITS quotaLimits;
    NTSTATUS subStatus = 0;

    status = LsaLogonUser(
        hLSA,
        &originName,
        Interactive,
        authPackage,
        authBuffer,
        authBufferSize,
        0,
        &tokenSource,
        &profileBuffer,
        &profileBufferSize,
        &loginId,
        &token,
        &quotaLimits,
        &subStatus);

    if (status != 0)
    {
        NTSTATUS winError = LsaNtStatusToWinError(status);
        LLLOG(L"Error calling LsaLogonUser. Error code: " + std::to_wstring(winError));
        return;
    }

    LLLOG(L"Success!");

    LsaFreeReturnBuffer(profileBuffer);
    CloseHandle(token);
    HeapFree(GetProcessHeap(), 0, authBuffer);
    LLLOG(L"Cleanup complete.");

    return;
}

//size will be set to the size of the structure created
PVOID CreateNtlmLogonStructure(std::wstring domain, std::wstring username, std::wstring password, DWORD* size)
{
    size_t wcharSize = sizeof(wchar_t);
    size_t totalSize = sizeof(MSV1_0_INTERACTIVE_LOGON) + ((domain.length() + username.length() + password.length()) * wcharSize);
    MSV1_0_INTERACTIVE_LOGON* ntlmLogon = (PMSV1_0_INTERACTIVE_LOGON)(new BYTE[totalSize]);
    size_t offset = sizeof(MSV1_0_INTERACTIVE_LOGON);

    ntlmLogon->MessageType = MsV1_0InteractiveLogon;
    offset += WriteUnicodeString(domain, &(ntlmLogon->LogonDomainName), ntlmLogon, offset);
    offset += WriteUnicodeString(username, &(ntlmLogon->UserName), ntlmLogon, offset);
    offset += WriteUnicodeString(password, &(ntlmLogon->Password), ntlmLogon, offset);

    *size = (DWORD)totalSize;
    return ntlmLogon;
}

size_t WriteUnicodeString(std::wstring str, UNICODE_STRING* uniStr, PVOID baseAddress, size_t offset)
{
    const wchar_t* buffer = str.c_str();
    size_t size = str.length() * sizeof(wchar_t);
    uniStr->Length = (USHORT)size;
    uniStr->MaximumLength = (USHORT)size;
    uniStr->Buffer = (PWSTR)((UINT_PTR)baseAddress + offset);
    memcpy((PVOID)((UINT_PTR)baseAddress + offset), str.c_str(), size);
    return size;
}
</code>```

Body:
When I boot my computer, I am attempting to have sign in into Windows without having to enter credentials. These credentials are available and entered from other means (which excludes the solution of using the winlogon default registry values), in a "single sign-on" kind of deal. Anyways, I am therefore attempting to go about it by creating a Windows Credential Provider (WCP). I got this to run. In this WCP I am applying the LsaLogonUser function with MSV1_0_INTERACTIVE_LOGON. Everything returns the result of success but it does not make the computer to actually log on. I might've misunderstood how it all works so I was wondering if anyone know why it doesn't work. My thoughts is that the issue potentially is that the session only lasts as long as the scope does. That is, as long as the token exists. So when the LogonUI (by Winlogon) process finishes it's execution, it is automatically signed out or something. What am I missing?

Here is a big chunk of code of how it executes:

void login(std::wstring domain, std::wstring username, std::wstring secret)
{
    //Get a handle to LSA
    HANDLE hLSA = nullptr;
    NTSTATUS status = LsaConnectUntrusted(&hLSA);
    if (status != 0)
    {
        int winError = LsaNtStatusToWinError(status);
        LLLOG(L"Error calling LsaConnectUntrusted. Error code: " + std::to_wstring(winError) );
        return;
    }
    if (!hLSA)
    {
        LLLOG(L"hLSA is NULL");
        return;
    }

    //Build LsaLogonUser parameters
    LSA_STRING originName = {};
    char originNameStr[] = "WCP";
    originName.Buffer = originNameStr;
    originName.Length = (USHORT)strlen(originNameStr);
    originName.MaximumLength = originName.Length;

    ULONG authPackage = 0;
    PLSA_STRING authPackageName = new LSA_STRING();
    char authPackageBuf[] = MSV1_0_PACKAGE_NAME;
    authPackageName->Buffer = authPackageBuf;
    authPackageName->Length = (USHORT)strlen(authPackageBuf);
    authPackageName->MaximumLength = (USHORT)strlen(authPackageBuf);
    status = LsaLookupAuthenticationPackage(hLSA, authPackageName, &authPackage);
    if (status != 0)
    {
        int winError = LsaNtStatusToWinError(status);
        LLLOG(L"Call to LsaLookupAuthenticationPackage failed. Error code: " + std::to_wstring(winError));
        return;
    }

    DWORD authBufferSize = 0;
    PVOID authBuffer = CreateNtlmLogonStructure(domain, username, secret, &authBufferSize);
    LLLOG(L"authBufferSize: " + std::to_wstring(authBufferSize));

    //Get TokenSource
    HANDLE hProcess = GetCurrentProcess();
    HANDLE procToken = nullptr;
    BOOL success = OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &procToken);
    if (!success)
    {
        DWORD errorCode = GetLastError();
        LLLOG(L"Call to OpenProcessToken failed. Errorcode: " + std::to_wstring(errorCode));
        return;
    }

    TOKEN_SOURCE tokenSource = {};
    DWORD realSize = 0;
    success = GetTokenInformation(procToken, TokenSource, &tokenSource, sizeof(tokenSource), &realSize);
    if (!success)
    {
        LLLOG(L"Call to GetTokenInformation failed.");
        return;
    }

    //
    PVOID profileBuffer = NULL;
    ULONG profileBufferSize = 0;
    LUID loginId;
    HANDLE token = NULL;
    QUOTA_LIMITS quotaLimits;
    NTSTATUS subStatus = 0;

    status = LsaLogonUser(
        hLSA,
        &originName,
        Interactive,
        authPackage,
        authBuffer,
        authBufferSize,
        0,
        &tokenSource,
        &profileBuffer,
        &profileBufferSize,
        &loginId,
        &token,
        &quotaLimits,
        &subStatus);

    if (status != 0)
    {
        NTSTATUS winError = LsaNtStatusToWinError(status);
        LLLOG(L"Error calling LsaLogonUser. Error code: " + std::to_wstring(winError));
        return;
    }

    LLLOG(L"Success!");

    LsaFreeReturnBuffer(profileBuffer);
    CloseHandle(token);
    HeapFree(GetProcessHeap(), 0, authBuffer);
    LLLOG(L"Cleanup complete.");

    return;
}

//size will be set to the size of the structure created
PVOID CreateNtlmLogonStructure(std::wstring domain, std::wstring username, std::wstring password, DWORD* size)
{
    size_t wcharSize = sizeof(wchar_t);
    size_t totalSize = sizeof(MSV1_0_INTERACTIVE_LOGON) + ((domain.length() + username.length() + password.length()) * wcharSize);
    MSV1_0_INTERACTIVE_LOGON* ntlmLogon = (PMSV1_0_INTERACTIVE_LOGON)(new BYTE[totalSize]);
    size_t offset = sizeof(MSV1_0_INTERACTIVE_LOGON);

    ntlmLogon->MessageType = MsV1_0InteractiveLogon;
    offset += WriteUnicodeString(domain, &(ntlmLogon->LogonDomainName), ntlmLogon, offset);
    offset += WriteUnicodeString(username, &(ntlmLogon->UserName), ntlmLogon, offset);
    offset += WriteUnicodeString(password, &(ntlmLogon->Password), ntlmLogon, offset);

    *size = (DWORD)totalSize;
    return ntlmLogon;
}

size_t WriteUnicodeString(std::wstring str, UNICODE_STRING* uniStr, PVOID baseAddress, size_t offset)
{
    const wchar_t* buffer = str.c_str();
    size_t size = str.length() * sizeof(wchar_t);
    uniStr->Length = (USHORT)size;
    uniStr->MaximumLength = (USHORT)size;
    uniStr->Buffer = (PWSTR)((UINT_PTR)baseAddress + offset);
    memcpy((PVOID)((UINT_PTR)baseAddress + offset), str.c_str(), size);
    return size;
}


问:
Leaflet map crashes on recoloring after translation (Shiny, Leaflet, shiny.i18n)
I'm currently trying to make a Shiny app for Leaflet cards with simple translations. Each leaflet card has several base groups that are linked to different variables. To avoid re-rendering the leaflet maps every time the base group changes, I have adopted a function I found here which only changes the fill of the polygons.

As long as I only use one language, the app works without problems, but when multiple translations options are implemented, the app crashes. The problem seems to occur when I try to link input$map_groups to variables needed for colouring.

My code looks like this:

```<code>library(shiny)
library(shinyWidgets)
library(leaflet)
library(sf)
library(dplyr)
library(shiny.i18n)

#--- Loading Generic Shape File For Demonstration
shape <- st_read(system.file("shape/nc.shp", package = "sf"),
                 stringsAsFactors = FALSE) %>%
  #--- Mutating Two Variables To Factors As My Map Uses Factors
  mutate(One = as.factor(SID74), Two = as.factor(SID79)) %>%
  #--- Keep Just This Three Variables
  select(c(CNTY_ID, One, Two))

#--- Color Palette For Filling Polygons
scale.color <- colorFactor(palette = "RdYlBu", levels = seq(1:60))

#--- Loading And Rgistering Translation File
lang <- Translator$new(translation_json_path = "./translations.json")
lang$set_translation_language("gb")
language <- c("English", "Deutsch", "Français" , "Español")

#--- Naming Vector For Base Groups And Related Variables
layer_calls <- setNames(c('One', 'Two'), c("First", "Second"))

#--- A Function For Recoloring An Existing Polygon And Related JS-Code
#----- Source: https://github.com/rstudio/leaflet/issues/496#issuecomment-650122985
setShapeStyle <- function(map, data = getMapData(map), layerId, stroke = NULL, color = NULL, weight = NULL,
                          opacity = NULL, fill = NULL, fillColor = NULL, fillOpacity = NULL, dashArray = NULL,
                          smoothFactor = NULL, noClip = NULL, options = NULL){
  options <- c(list(layerId = layerId),
               options,
               filterNULL(list(stroke = stroke, color = color, weight = weight, opacity = opacity,
                               fill = fill, fillColor = fillColor, fillOpacity = fillOpacity,
                               dashArray = dashArray, smoothFactor = smoothFactor, noClip = noClip)))
  # Evaluate All Options
  options <- evalFormula(options, data = data)
  options <- do.call(data.frame, c(options, list(stringsAsFactors = FALSE)))

  layerId <- options[[1]]
  style <- options[-1] # drop layer column

  leaflet::invokeMethod(map, data, "setStyle", "shape", layerId, style);
}

leafletjs <-  tags$head(
  tags$script(HTML(
    '
window.LeafletWidget.methods.setStyle = function(category, layerId, style){
  var map = this;
  if (!layerId){
    return;
  } else if (!(typeof(layerId) === "object" && layerId.length)){ // in case a single layerid is given
    layerId = [layerId];
  }

  //convert columnstore to row store
  style = HTMLWidgets.dataframeToD3(style);
  //console.log(style);

  layerId.forEach(function(d,i){
    var layer = map.layerManager.getLayer(category, d);
    if (layer){ // or should this raise an error?
      layer.setStyle(style[i]);
    }
  });
};
'
  )))

#--- Defining UI
ui <- fluidPage(
  leafletjs,
  usei18n(lang),
  pickerInput(inputId = 'selected_language', width = 125,
              choices = c("gb", "de", "fr", "es"),
              selected = lang$get_key_translation()),
  leafletOutput("map")
)

#--- Defining Server Logic
server <- function(input, output, session){

  output$map <- renderLeaflet({
    leaflet(data = shape) %>%
      #--- Initial Unfilled Polygon Map
      addPolygons(layerId = ~CNTY_ID, stroke = TRUE, color = "white", weight = 1.25,
                  highlightOptions = highlightOptions(stroke = 5, weight = 10)) %>%
      #--- Initial Layer Controls
      addLayersControl(baseGroups = lang$t(names(layer_calls)))
  })

  #--- Filling Polygons Based On Base Layer-Variable After Translation
  observe({
    req(input$selected_language)
    update_lang(session, input$selected_language)

    leafletProxy("map", data = shape) %>%
      #--- This Part Always Crashes Shiny!!!
      setShapeStyle(layerId = ~CNTY_ID, fillOpacity = 1)#, fillColor = ~scale.color(get(layer_calls[lang$t(input$map_groups)])))
  })
}

# Run the application
shinyApp(ui = ui, server = server)
</code>```

My basic translation scheme would be provided by a JSON file which looks like this:

```<code>{
  "languages": [
    "gb",
    "de",
    "fr",
    "es"
  ],
  "translation": [
    {
      "gb": "First",
      "de": "Erste",
      "fr": "Premier",
      "es": "Primera"
    },
    {
      "gb": "Second",
      "de": "Zweite",
      "fr": "Deuxième",
      "es": "Segundo"
    }
  ]
}
</code>```

In my One-Langue-App I can simply use , fillColor = ~scale.color(get(layer_calls[[input$map_groups]])) to trigger a recoloring after the base group has been changed. Unfortunately, I have no idea how to connect the selected base group to a call of the needed variable to trigger the recoloring. Any kind of help is greatly appreciated!

```<code></code>```

Body:
I'm currently trying to make a Shiny app for Leaflet cards with simple translations. Each leaflet card has several base groups that are linked to different variables. To avoid re-rendering the leaflet maps every time the base group changes, I have adopted a function I found here which only changes the fill of the polygons.

As long as I only use one language, the app works without problems, but when multiple translations options are implemented, the app crashes. The problem seems to occur when I try to link input$map_groups to variables needed for colouring.

My code looks like this:

library(shiny)
library(shinyWidgets)
library(leaflet)
library(sf)
library(dplyr)
library(shiny.i18n)

#--- Loading Generic Shape File For Demonstration
shape <- st_read(system.file("shape/nc.shp", package = "sf"),
                 stringsAsFactors = FALSE) %>%
  #--- Mutating Two Variables To Factors As My Map Uses Factors
  mutate(One = as.factor(SID74), Two = as.factor(SID79)) %>%
  #--- Keep Just This Three Variables
  select(c(CNTY_ID, One, Two))

#--- Color Palette For Filling Polygons
scale.color <- colorFactor(palette = "RdYlBu", levels = seq(1:60))

#--- Loading And Rgistering Translation File
lang <- Translator$new(translation_json_path = "./translations.json")
lang$set_translation_language("gb")
language <- c("English", "Deutsch", "Français" , "Español")

#--- Naming Vector For Base Groups And Related Variables
layer_calls <- setNames(c('One', 'Two'), c("First", "Second"))

#--- A Function For Recoloring An Existing Polygon And Related JS-Code
#----- Source: https://github.com/rstudio/leaflet/issues/496#issuecomment-650122985
setShapeStyle <- function(map, data = getMapData(map), layerId, stroke = NULL, color = NULL, weight = NULL,
                          opacity = NULL, fill = NULL, fillColor = NULL, fillOpacity = NULL, dashArray = NULL,
                          smoothFactor = NULL, noClip = NULL, options = NULL){
  options <- c(list(layerId = layerId),
               options,
               filterNULL(list(stroke = stroke, color = color, weight = weight, opacity = opacity,
                               fill = fill, fillColor = fillColor, fillOpacity = fillOpacity,
                               dashArray = dashArray, smoothFactor = smoothFactor, noClip = noClip)))
  # Evaluate All Options
  options <- evalFormula(options, data = data)
  options <- do.call(data.frame, c(options, list(stringsAsFactors = FALSE)))

  layerId <- options[[1]]
  style <- options[-1] # drop layer column

  leaflet::invokeMethod(map, data, "setStyle", "shape", layerId, style);
}

leafletjs <-  tags$head(
  tags$script(HTML(
    '
window.LeafletWidget.methods.setStyle = function(category, layerId, style){
  var map = this;
  if (!layerId){
    return;
  } else if (!(typeof(layerId) === "object" && layerId.length)){ // in case a single layerid is given
    layerId = [layerId];
  }

  //convert columnstore to row store
  style = HTMLWidgets.dataframeToD3(style);
  //console.log(style);

  layerId.forEach(function(d,i){
    var layer = map.layerManager.getLayer(category, d);
    if (layer){ // or should this raise an error?
      layer.setStyle(style[i]);
    }
  });
};
'
  )))

#--- Defining UI
ui <- fluidPage(
  leafletjs,
  usei18n(lang),
  pickerInput(inputId = 'selected_language', width = 125,
              choices = c("gb", "de", "fr", "es"),
              selected = lang$get_key_translation()),
  leafletOutput("map")
)

#--- Defining Server Logic
server <- function(input, output, session){

  output$map <- renderLeaflet({
    leaflet(data = shape) %>%
      #--- Initial Unfilled Polygon Map
      addPolygons(layerId = ~CNTY_ID, stroke = TRUE, color = "white", weight = 1.25,
                  highlightOptions = highlightOptions(stroke = 5, weight = 10)) %>%
      #--- Initial Layer Controls
      addLayersControl(baseGroups = lang$t(names(layer_calls)))
  })

  #--- Filling Polygons Based On Base Layer-Variable After Translation
  observe({
    req(input$selected_language)
    update_lang(session, input$selected_language)

    leafletProxy("map", data = shape) %>%
      #--- This Part Always Crashes Shiny!!!
      setShapeStyle(layerId = ~CNTY_ID, fillOpacity = 1)#, fillColor = ~scale.color(get(layer_calls[lang$t(input$map_groups)])))
  })
}

# Run the application
shinyApp(ui = ui, server = server)

My basic translation scheme would be provided by a JSON file which looks like this:

{
  "languages": [
    "gb",
    "de",
    "fr",
    "es"
  ],
  "translation": [
    {
      "gb": "First",
      "de": "Erste",
      "fr": "Premier",
      "es": "Primera"
    },
    {
      "gb": "Second",
      "de": "Zweite",
      "fr": "Deuxième",
      "es": "Segundo"
    }
  ]
}

In my One-Langue-App I can simply use , fillColor = ~scale.color(get(layer_calls[[input$map_groups]])) to trigger a recoloring after the base group has been changed. Unfortunately, I have no idea how to connect the selected base group to a call of the needed variable to trigger the recoloring. Any kind of help is greatly appreciated!


问:
Error with my finished react-native typescript program
I get a strange error when want to test my program in the terminal. First of all i'm using android studio to see how i'm progressing. So when i type 'npm start' in the terminal i get no problems. So then i press 'a' so it will try to open the program in Android. After that i get this message: Android Bundling complete 4133ms. So all fine now. But then 5 seconds later i get this error:  ERROR  Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.

Here is the photo of the problem.

My code is pretty simple. I have an app.tsx, homepage and detailpage. I can type the code here but i think i'll get banned.

I tried this:

Run react-native link @react-native-community/async-storage in the project root.

Restarting the app.


问:
Color code rows of SharePoint 2019 list with multiple pages in classic view
I have a long status list in SharePoint 2019 that has the following CSS for color coding rows:

how do I get this to work on all the multiple pages vs just the first page of the list.

Can the code be modified to work with a grouped view as well?

```<code><script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
    $(document.ready(function(){
      $Text=$("td.ms-cellstyle.ms-vb2:contains('High')");
      $Text.css("background-color", #FFAA99");
      $Text=$("td.ms-cellstyle.ms-vb2:contains('Medium')");
      $Text.css("background-color", #FFFF99");
      $Text=$("td.ms-cellstyle.ms-vb2:contains('Low')");
      $Text.css("background-color", #EEFFE6");
    });
</script>

<script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
    $(document.ready(function(){
      $Text=$("td.ms-cellstyle.ms-vb2:contains('Not Started')");
      $Text.css("background-color", #F0F0F0");
      $Text=$("td.ms-cellstyle.ms-vb2:contains('In Progress')");
      $Text.css("background-color", #D9E5F0");
      $Text=$("td.ms-cellstyle.ms-vb2:contains('Completed')");
      $Text.css("background-color", #99CC66");
    });
</script>

<script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-1.10.2.js"></script>
<script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-ui.js"></script>
<script type="text/javascript">
(function($){
    function doCollapseTaskList(){
        $(.ms-commentcollapse-iconouter>img">.each(function(){
            $(this).click();
        });
    }

    $(function(){
         ExecuteOrDelayUntilScriptLoaded(function(){
         if(typeofasyncDeltaManager !="undefined")
            asyncDeltaManager.add_endRequest(doCollapseTaskList);
         else doCollapseTaskList();
    },"init.js");
});
</script>
</code>```

Thanks for the help in advance!

Body:
I have a long status list in SharePoint 2019 that has the following CSS for color coding rows:

how do I get this to work on all the multiple pages vs just the first page of the list.

Can the code be modified to work with a grouped view as well?

Thanks for the help in advance!


问:
Excel - NETWORKDAYS
I'm trying to create a formula to give me the NETWORKDAYS between the day 1 of a month and a specific day of the same month.
It works great for the all months of current year but for other years is not working.

Formula used: =NETWORKDAYS(("01/"&MONTH(G2));G2;Holidays!C2:C6)

Title: Excel - NETWORKDAYS


问:
verify SGX quote attestation with DCAP
I am new in SGX,In DCAP attestation a SGX quote is generated which is going to be used by the client to make sure the code or request is executed inside SGX so my question are:

when attestations occurs, how the client car verify the quote?

where the SGX quote is saved? how client can access it?

Title: verify SGX quote attestation with DCAP


问:
If I want to make my Web page global so that I can display it on to the other devices what can I do for it?
The main problem is that I don't know how to display my page in the form of website

I am trying to get answer to my question.


问:
pywinauto.findwindows.ElementNotFoundError:
I am trying to open a program (working fine) and then on its start select the 'File' dropdown so I can save it etc and manipulate it further. However, I am getting this error:

pywinauto.findwindows.ElementNotFoundError: {'title': 'Untitled - Notepad',
'backend': 'win32', 'visible_only': False}

The full error list is:

```<code>Traceback (most recent call last):
  File "C:\Users\{real_name}\PycharmProjects\texture-gen\main.py", line 203, in <module>
    app = pywinauto.Application().connect(title='Untitled - Notepad')
  File "C:\Users\{real_name}\PycharmProjects\texture-gen\venv\lib\site-packages\pywinauto\application.py", line 997, in connect
    self.process = findwindows.find_element(**kwargs).process_id
  File "C:\Users\{real_name}\PycharmProjects\texture-gen\venv\lib\site-packages\pywinauto\findwindows.py", line 87, in find_element
    raise ElementNotFoundError(kwargs)
pywinauto.findwindows.ElementNotFoundError: {'title': 'Untitled - Notepad', 'backend': 'win32', 'visible_only': False}
</code>```

This is my code:

```<code># Wait for Notepad to open
time.sleep(15)

hwnd = pyautogui.getWindowsWithTitle('Untitled - Notepad')

# Connect to the application
app = pywinauto.Application().connect(title='Untitled - Notepad')

# Get the main window of the application
window = app.window(title='Untitled - Notepad')

# Get the dropdown menu
dropdown = window.ComboBox

# Get the names of the items in the dropdown menu
items = dropdown.texts()

# Print the names of the items
print(items)
</code>```

Body:
I am trying to open a program (working fine) and then on its start select the 'File' dropdown so I can save it etc and manipulate it further. However, I am getting this error:

pywinauto.findwindows.ElementNotFoundError: {'title': 'Untitled - Notepad',
'backend': 'win32', 'visible_only': False}

The full error list is:

Traceback (most recent call last):
  File "C:\Users\{real_name}\PycharmProjects\texture-gen\main.py", line 203, in <module>
    app = pywinauto.Application().connect(title='Untitled - Notepad')
  File "C:\Users\{real_name}\PycharmProjects\texture-gen\venv\lib\site-packages\pywinauto\application.py", line 997, in connect
    self.process = findwindows.find_element(**kwargs).process_id
  File "C:\Users\{real_name}\PycharmProjects\texture-gen\venv\lib\site-packages\pywinauto\findwindows.py", line 87, in find_element
    raise ElementNotFoundError(kwargs)
pywinauto.findwindows.ElementNotFoundError: {'title': 'Untitled - Notepad', 'backend': 'win32', 'visible_only': False}

This is my code:

# Wait for Notepad to open
time.sleep(15)

hwnd = pyautogui.getWindowsWithTitle('Untitled - Notepad')

# Connect to the application
app = pywinauto.Application().connect(title='Untitled - Notepad')

# Get the main window of the application
window = app.window(title='Untitled - Notepad')

# Get the dropdown menu
dropdown = window.ComboBox

# Get the names of the items in the dropdown menu
items = dropdown.texts()

# Print the names of the items
print(items)


问:
Using WSL v2 Ubuntu, VS code ssh configuration keep saying my identityfile's permission is too open
Using WSL v2 Ubuntu, VS code ssh configuration keeps saying my IdentityFile's permissions are too open even though it has 600 permission.

This is the configuration file.

```<code>Host 11
  HostName xxx.xxx.xxx.11
  User kk
  Port 22
  IdentityFile \\wsl$\Ubuntu\home\jj\.ssh\id_ed25519
</code>```

And I tried to connect to host 11 using VScode, and it shouldn't ask me for the password since I already copied my public key file in the server's authorized_keys file.

So, if I just tried to connect to host 11 in the WSL terminal, it just connected right away, without asking for the password.
However, using this same setting, VS code keeps asking for the password, so I looked up the output in the vscode, and it was like the below. (I modified the IP address to xxx)

```<code>[23:04:16.978] Using SSH config file "\\wsl$\Ubuntu\home\jj\.ssh\vsc_config"
[23:04:16.978] Running script with connection command: ssh -T -D 64135 -F "\\wsl$\Ubuntu\home\jj\.ssh\vsc_config" 11 bash
[23:04:16.981] Terminal shell path: C:\Windows\System32\cmd.exe
[23:04:17.588] > ]0;C:\Windows\System32\cmd.exe
[23:04:17.589] Got some output, clearing connection timeout
[23:04:17.665] > The authenticity of host '[xxx.xxx.xxx.11]:22 ([xxx.xxx.xxx.11]:22)' can't be
> established.
> ECDSA key fingerprint is SHA256:X+*******xk.
> Are you sure you want to continue connecting (yes/no/[fingerprint])?
[23:04:17.666] Detected fingerprint confirmation message
[23:04:17.666] Showing fingerprint confirmation dialog
[23:04:18.736] Got fingerprint response: yes
[23:04:18.737] "install" wrote data to terminal: "yes"
[23:04:18.750] > y
[23:04:18.761] > Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
> Failed to add the host to the list of known hosts (C:\\Users\\jj/.ssh/known_h
> osts).
[23:04:19.109] > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[23:04:19.123] > @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> Permissions for '\\\\wsl$\\Ubuntu\\home\\jj\\.ssh\\id_ed25519' ar
> e too open.
> It is required that your private key files are NOT accessible by others.
> This private key will be ignored.
> Load key "\\\\wsl$\\Ubuntu\\home\\jj\\.ssh\\id_ed25519": bad perm
> issions
> kk@xxx.xxx.xxx.11's password:
[23:04:19.123] Showing password prompt
[23:04:21.244] Password dialog canceled
</code>```

In wsl, the .ssh directory has 700 permission, and the id_ed25519, and id_ed25519.pub also has 600 permission. I checked and checked more than 10 times.

So I don't understand why it keeps saying the file's permissions are too open.

And I also tried the making symlink to Window directory and tried with it in the config file like this below. Because I thought maybe it was not working since the path is a network path.

```<code>IdentityFile C:\Users\jj\wsl-ubuntu\home\jj\.ssh\id_ed25519
</code>```

But the result was the same except for the path I changed.

It's not kind of a critical problem, but still too annoying while using remote development environments. So I hope I can figure it out with help.

Body:
Using WSL v2 Ubuntu, VS code ssh configuration keeps saying my IdentityFile's permissions are too open even though it has 600 permission.

This is the configuration file.

Host 11
  HostName xxx.xxx.xxx.11
  User kk
  Port 22
  IdentityFile \\wsl$\Ubuntu\home\jj\.ssh\id_ed25519

And I tried to connect to host 11 using VScode, and it shouldn't ask me for the password since I already copied my public key file in the server's authorized_keys file.

So, if I just tried to connect to host 11 in the WSL terminal, it just connected right away, without asking for the password.
However, using this same setting, VS code keeps asking for the password, so I looked up the output in the vscode, and it was like the below. (I modified the IP address to xxx)

[23:04:16.978] Using SSH config file "\\wsl$\Ubuntu\home\jj\.ssh\vsc_config"
[23:04:16.978] Running script with connection command: ssh -T -D 64135 -F "\\wsl$\Ubuntu\home\jj\.ssh\vsc_config" 11 bash
[23:04:16.981] Terminal shell path: C:\Windows\System32\cmd.exe
[23:04:17.588] > ]0;C:\Windows\System32\cmd.exe
[23:04:17.589] Got some output, clearing connection timeout
[23:04:17.665] > The authenticity of host '[xxx.xxx.xxx.11]:22 ([xxx.xxx.xxx.11]:22)' can't be
> established.
> ECDSA key fingerprint is SHA256:X+*******xk.
> Are you sure you want to continue connecting (yes/no/[fingerprint])?
[23:04:17.666] Detected fingerprint confirmation message
[23:04:17.666] Showing fingerprint confirmation dialog
[23:04:18.736] Got fingerprint response: yes
[23:04:18.737] "install" wrote data to terminal: "yes"
[23:04:18.750] > y
[23:04:18.761] > Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
> Failed to add the host to the list of known hosts (C:\\Users\\jj/.ssh/known_h
> osts).
[23:04:19.109] > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[23:04:19.123] > @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> Permissions for '\\\\wsl$\\Ubuntu\\home\\jj\\.ssh\\id_ed25519' ar
> e too open.
> It is required that your private key files are NOT accessible by others.
> This private key will be ignored.
> Load key "\\\\wsl$\\Ubuntu\\home\\jj\\.ssh\\id_ed25519": bad perm
> issions
> kk@xxx.xxx.xxx.11's password:
[23:04:19.123] Showing password prompt
[23:04:21.244] Password dialog canceled

In wsl, the .ssh directory has 700 permission, and the id_ed25519, and id_ed25519.pub also has 600 permission. I checked and checked more than 10 times.

So I don't understand why it keeps saying the file's permissions are too open.

And I also tried the making symlink to Window directory and tried with it in the config file like this below. Because I thought maybe it was not working since the path is a network path.

IdentityFile C:\Users\jj\wsl-ubuntu\home\jj\.ssh\id_ed25519

But the result was the same except for the path I changed.

It's not kind of a critical problem, but still too annoying while using remote development environments. So I hope I can figure it out with help.


问:
Python requests.exceptions.SSLError
I need to parse a lot of pages and at some point I get an error:

```<code>requests.exceptions.SSLError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /catalog/product-category/channels/videos/121 (Caused by SSLError(SSLEOFError(8
, 'EOF occurred in violation of protocol (_ssl.c:997)')))
</code>```

I tried adding the following, but still the same error:

```<code>import urllib3

requests.packages.urllib3.disable_warnings()
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL:@SECLEVEL=1'
</code>```

my code example:

```<code>for page in range(1, pages):
    response = requests.get(category + f"/{page}", headers={"User-Agent": ua.random}, verify=False)
    soup = BeautifulSoup(response.text, "lxml")
    ...
</code>```

log error:

```<code>During handling of the above exception, another exception occurred:
 Traceback (most recent call last):
   File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
     self.run()
   File "/usr/local/lib/python3.10/threading.py", line 953, in run
     self._target(*self._args, **self._kwargs)
   File "/parser/main.py", line 44, in start
     self.parse_urls()
   File "/parser/main.py", line 35, in parse_urls
     response = requests.get(category + f"/{page}", headers={"User-Agent": ua.random})
   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
     return request("get", url, params=params, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
     return session.request(method=method, url=url, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
     resp = self.send(prep, **send_kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
     r = adapter.send(request, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 563, in send
     raise SSLError(e, request=request)
 requests.exceptions.SSLError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /catalog/product-category/channels/videos/116 (Caused by SSLError(SSLEOFError(8
, 'EOF occurred in violation of protocol (_ssl.c:997)')))
</code>```

Title: Python requests.exceptions.SSLError

Body:
I need to parse a lot of pages and at some point I get an error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /catalog/product-category/channels/videos/121 (Caused by SSLError(SSLEOFError(8
, 'EOF occurred in violation of protocol (_ssl.c:997)')))

I tried adding the following, but still the same error:

import urllib3

requests.packages.urllib3.disable_warnings()
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL:@SECLEVEL=1'

my code example:

for page in range(1, pages):
    response = requests.get(category + f"/{page}", headers={"User-Agent": ua.random}, verify=False)
    soup = BeautifulSoup(response.text, "lxml")
    ...

log error:

During handling of the above exception, another exception occurred:
 Traceback (most recent call last):
   File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
     self.run()
   File "/usr/local/lib/python3.10/threading.py", line 953, in run
     self._target(*self._args, **self._kwargs)
   File "/parser/main.py", line 44, in start
     self.parse_urls()
   File "/parser/main.py", line 35, in parse_urls
     response = requests.get(category + f"/{page}", headers={"User-Agent": ua.random})
   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
     return request("get", url, params=params, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
     return session.request(method=method, url=url, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
     resp = self.send(prep, **send_kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
     r = adapter.send(request, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 563, in send
     raise SSLError(e, request=request)
 requests.exceptions.SSLError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /catalog/product-category/channels/videos/116 (Caused by SSLError(SSLEOFError(8
, 'EOF occurred in violation of protocol (_ssl.c:997)')))


问:
SwiftUI NavigationTitle not collapsing automatically
I have the following BaseView which is used across all my tabbed view:

```<code>struct BaseView<Content: View, T: BaseViewModel>: View {
  @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
  @StateObject var viewModel: T

  let title: String
  let displayMode: NavigationBarItem.TitleDisplayMode
  let content: (ViewHelper) -> Content

  init(title: String, viewModel: T, displayMode: NavigationBarItem.TitleDisplayMode = .inline, @ViewBuilder content: @escaping (ViewHelper) -> Content) {
      self.title = title
      self.displayMode = displayMode
      self._viewModel = StateObject(wrappedValue: viewModel)
      self.content = content
  }

  var body: some View {
      ScrollViewReader { scroll in
          ScrollView(.vertical) {
              content(ViewHelper(scrollProxy: scroll, presentationMode: presentationMode))
          }
      }
      .modifier(ViewLoadingModifier(loading: $viewModel.loading))
      .onAppear {
          viewModel.load()
      }
      .padding()
      .navigationBarTitle(NSLocalizedString(title, comment: ""), displayMode: displayMode)
      .background(Color("Background"))
  }
}
</code>```

Then I have screens that use this BaseView as follows:

```<code>struct TestScreen: View {

    @StateObject var viewModel = TestViewModel()

    var body: some View {
        BaseView(title: "test.title", viewModel: viewModel, displayMode: .large, content: { helper in
        View1()
        View2()
        //...
    }
}
</code>```

These screens are navigated to from a set of root screens that conform a TabView:

```<code>TabView(selection: $navObj.selectionRoot) {
    NavigationView {
        Screen1()
            .navigationBarTitle("FIRST")
            .background(NavigationConfigurator { nc in
                nc.navigationBar.barTintColor = UIColor(Color("Action"))
                nc.navigationBar.titleTextAttributes = [.foregroundColor : UIColor.black]
                nc.navigationBar.prefersLargeTitles = true
            })
    }
    .navigationViewStyle(.stack)
    .environmentObject(navObj)
    .tabItem {
        VStack(alignment: .center, spacing: 2) {
            Image("img1")
                .resizable()
                .frame(width: 16, height: 16, alignment: .center)
            Text("first")
        }.onTapGesture {
            navObj.selectionRoot = .search
            navObj.reset(fromLevel: 1)
        }
    }
    .tag(Screens.first)

    // Other navigation views (tabs)
}
</code>```

And lastly, the "FIRST" tab screen is a view that performs a navigation to the "TestScreen" with a simple:

```<code>Button(action: {
    navigatedDeeper = true
    navObj.selectionLvl2 = .test
}) {
    Text(NSLocalizedString("test", comment: ""))
        .font(.system(size: 21))
}.background(NavigationLink(destination: TestScreen(), tag: Screens.test, selection: $navObj.selectionLvl2) {
    EmptyView()
})
</code>```

With this setup, why isn't the large navigation title collapsed when scrolling down the TestScreen? I've tried putting all the ScrollView's content inside a single VStack (no success, and also it seems to broken the scrollTo() (I'm using the latest iOS 15), and changing the location of the .navigationBarTitle(NSLocalizedString(title, comment: ""), displayMode: displayMode) but it doesn't want to collapse :( I'm lost now. It's very difficult to keep reusability on SwiftUI without breaking random functionalities.

So the view hierarchy is more or less:

```<code>TabView
  |
  FirstView
   |
   TestView
     |
     BaseView
      |
      ScrollViewReader
        |
        ScrollView
</code>```

Body:
I have the following BaseView which is used across all my tabbed view:

struct BaseView<Content: View, T: BaseViewModel>: View {
  @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
  @StateObject var viewModel: T

  let title: String
  let displayMode: NavigationBarItem.TitleDisplayMode
  let content: (ViewHelper) -> Content

  init(title: String, viewModel: T, displayMode: NavigationBarItem.TitleDisplayMode = .inline, @ViewBuilder content: @escaping (ViewHelper) -> Content) {
      self.title = title
      self.displayMode = displayMode
      self._viewModel = StateObject(wrappedValue: viewModel)
      self.content = content
  }

  var body: some View {
      ScrollViewReader { scroll in
          ScrollView(.vertical) {
              content(ViewHelper(scrollProxy: scroll, presentationMode: presentationMode))
          }
      }
      .modifier(ViewLoadingModifier(loading: $viewModel.loading))
      .onAppear {
          viewModel.load()
      }
      .padding()
      .navigationBarTitle(NSLocalizedString(title, comment: ""), displayMode: displayMode)
      .background(Color("Background"))
  }
}

Then I have screens that use this BaseView as follows:

struct TestScreen: View {

    @StateObject var viewModel = TestViewModel()

    var body: some View {
        BaseView(title: "test.title", viewModel: viewModel, displayMode: .large, content: { helper in
        View1()
        View2()
        //...
    }
}

These screens are navigated to from a set of root screens that conform a TabView:

TabView(selection: $navObj.selectionRoot) {
    NavigationView {
        Screen1()
            .navigationBarTitle("FIRST")
            .background(NavigationConfigurator { nc in
                nc.navigationBar.barTintColor = UIColor(Color("Action"))
                nc.navigationBar.titleTextAttributes = [.foregroundColor : UIColor.black]
                nc.navigationBar.prefersLargeTitles = true
            })
    }
    .navigationViewStyle(.stack)
    .environmentObject(navObj)
    .tabItem {
        VStack(alignment: .center, spacing: 2) {
            Image("img1")
                .resizable()
                .frame(width: 16, height: 16, alignment: .center)
            Text("first")
        }.onTapGesture {
            navObj.selectionRoot = .search
            navObj.reset(fromLevel: 1)
        }
    }
    .tag(Screens.first)

    // Other navigation views (tabs)
}

And lastly, the "FIRST" tab screen is a view that performs a navigation to the "TestScreen" with a simple:

Button(action: {
    navigatedDeeper = true
    navObj.selectionLvl2 = .test
}) {
    Text(NSLocalizedString("test", comment: ""))
        .font(.system(size: 21))
}.background(NavigationLink(destination: TestScreen(), tag: Screens.test, selection: $navObj.selectionLvl2) {
    EmptyView()
})

With this setup, why isn't the large navigation title collapsed when scrolling down the TestScreen? I've tried putting all the ScrollView's content inside a single VStack (no success, and also it seems to broken the scrollTo() (I'm using the latest iOS 15), and changing the location of the .navigationBarTitle(NSLocalizedString(title, comment: ""), displayMode: displayMode) but it doesn't want to collapse :( I'm lost now. It's very difficult to keep reusability on SwiftUI without breaking random functionalities.

So the view hierarchy is more or less:

TabView
  |
  FirstView
   |
   TestView
     |
     BaseView
      |
      ScrollViewReader
        |
        ScrollView


问:
Assembler casting char differently as int
why does an int 0x80 change value of rsi register as integer but not as char?

My code, it should read line and it does, if I want to print the whole line than there is no problem:

```<code>lp:
save
mov rax, 3
mov rbx, 2
mov rcx, rsi
mov rdx, 1
int 80h
load

cmp [rsi], byte 0xa
je done
inc rsi
jmp lp
done:
</code>```

save and load are macros which push and pop rax, rbx, rcx and rdx.

First iteration is everything ok, but second one the integer value of [rsi] changes but cahr value still the same as seen in gdb:

```<code>13: $rdi = 4206592
14: $rsi = 4206593
15: *(int*)($rdi) = 14391
16: *(int*)($rdi+1) = 56
17: *(char*)($rdi) = 55 '7'
18: *(char*)($rdi+1) = 56 '8'
</code>```

In gdb I am looking at rdi because it should be the same values as rsi.

I tried to create static variable of size db and fill that variable instead of rsi. But I am learning how to allocate memory so this is not the purpose why I am doing that.

Body:
why does an int 0x80 change value of rsi register as integer but not as char?

My code, it should read line and it does, if I want to print the whole line than there is no problem:

lp:
save
mov rax, 3
mov rbx, 2
mov rcx, rsi
mov rdx, 1
int 80h
load

cmp [rsi], byte 0xa
je done
inc rsi
jmp lp
done:

save and load are macros which push and pop rax, rbx, rcx and rdx.

First iteration is everything ok, but second one the integer value of [rsi] changes but cahr value still the same as seen in gdb:

13: $rdi = 4206592
14: $rsi = 4206593
15: *(int*)($rdi) = 14391
16: *(int*)($rdi+1) = 56
17: *(char*)($rdi) = 55 '7'
18: *(char*)($rdi+1) = 56 '8'

In gdb I am looking at rdi because it should be the same values as rsi.

I tried to create static variable of size db and fill that variable instead of rsi. But I am learning how to allocate memory so this is not the purpose why I am doing that.


问:
Visual studio 2022 not showing color marks on scroll
Since I have installed VS2022, it doesnt show me marks on scroll bar like "changed", "breakpoint" or "error". Does it have a configuration that I can turn it on?


问:
Override WordPress core function
I'm trying to find a way to override / redeclare wp_timezone_choice function in order to remove unnecessary time-zones, but I can not find any filters or hooks to be able to customize the function from the theme functions.php file.

For example:

```<code>function my_timezone_choice( $selected_zone, $locale = null ) {
   // customized code from wp-includes/functions.php
   // function wp_timezone_choice( $selected_zone, $locale = null )
}
add_filter ('???', 'my_timezone_choice');
</code>```

I know the function is not plugable, I spent hours searching for a solution, any help would be much appreciated.

Thanks in advance!

Title: Override WordPress core function

Body:
I'm trying to find a way to override / redeclare wp_timezone_choice function in order to remove unnecessary time-zones, but I can not find any filters or hooks to be able to customize the function from the theme functions.php file.

For example:

function my_timezone_choice( $selected_zone, $locale = null ) {
   // customized code from wp-includes/functions.php
   // function wp_timezone_choice( $selected_zone, $locale = null )
}
add_filter ('???', 'my_timezone_choice');

I know the function is not plugable, I spent hours searching for a solution, any help would be much appreciated.

Thanks in advance!


问:
How to dynamically adjust positioning of a VerticalStackLayout inside a Grid?
I'm creating an app using MAUI and I'm trying to make it so an ImageButton and SearchBar nested in a VerticalStackLayout move positioning based on the dynamically created CollectionView.

This is the code for the UI:

```<code>    <Grid>
    <FlexLayout VerticalOptions="Center" HorizontalOptions="Center">
        <StackLayout>
            <CollectionView x:Name="taskList">
                <CollectionView.ItemTemplate>
                    <DataTemplate x:DataType="models:Task">
                        <VerticalStackLayout Margin="15">
                            <Entry Text="{Binding name}" IsReadOnly="True" />
                            <Entry Text="{Binding departmentsString}" IsReadOnly="True"/>
                            <HorizontalStackLayout>
                                <Entry Text="{Binding status}" IsReadOnly="True"/>
                                <Entry Text="{Binding deadline}" IsReadOnly="True" />
                                <Entry Text="{Binding author.fullName}" IsReadOnly="True"/>
                            </HorizontalStackLayout>
                            <Entry Text="{Binding description}" IsReadOnly="True" />
                        </VerticalStackLayout>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>
        </StackLayout>
        <VerticalStackLayout Margin="15">
            <Entry Placeholder="Name" x:Name="nameTxt"/>
            <Entry Placeholder="Department" x:Name="departTxt"/>
            <HorizontalStackLayout>
                <inputs:SfComboBox x:Name="statusTxt" Placeholder="Status" BackgroundColor="Black" TextColor="Green" DropDownIconColor="Green"/>
                <Entry Placeholder="deadline" x:Name="deadlineTxt"/>
                <Entry Placeholder="Author" x:Name="authorTxt"/>
            </HorizontalStackLayout>
            <Entry Placeholder="Description" x:Name="descTxt"/>
        </VerticalStackLayout>
    </FlexLayout>
    <VerticalStackLayout VerticalOptions="Center" >
        <SearchBar Placeholder="Search" x:Name="searchBar" TextChanged="searchBar_TextChanged" MaxLength="30" MaximumWidthRequest="200"/>
        <ImageButton Aspect="AspectFill" x:Name="addBtn" Source="plus.png" BackgroundColor="Black" Clicked="addBtn_Clicked" HeightRequest="64" WidthRequest="64"/>
    </VerticalStackLayout>
</Grid>
</code>```

I have tried every different type of Layout but nothing works.
What should I do?

Body:
I'm creating an app using MAUI and I'm trying to make it so an ImageButton and SearchBar nested in a VerticalStackLayout move positioning based on the dynamically created CollectionView.

This is the code for the UI:

    <Grid>
    <FlexLayout VerticalOptions="Center" HorizontalOptions="Center">
        <StackLayout>
            <CollectionView x:Name="taskList">
                <CollectionView.ItemTemplate>
                    <DataTemplate x:DataType="models:Task">
                        <VerticalStackLayout Margin="15">
                            <Entry Text="{Binding name}" IsReadOnly="True" />
                            <Entry Text="{Binding departmentsString}" IsReadOnly="True"/>
                            <HorizontalStackLayout>
                                <Entry Text="{Binding status}" IsReadOnly="True"/>
                                <Entry Text="{Binding deadline}" IsReadOnly="True" />
                                <Entry Text="{Binding author.fullName}" IsReadOnly="True"/>
                            </HorizontalStackLayout>
                            <Entry Text="{Binding description}" IsReadOnly="True" />
                        </VerticalStackLayout>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>
        </StackLayout>
        <VerticalStackLayout Margin="15">
            <Entry Placeholder="Name" x:Name="nameTxt"/>
            <Entry Placeholder="Department" x:Name="departTxt"/>
            <HorizontalStackLayout>
                <inputs:SfComboBox x:Name="statusTxt" Placeholder="Status" BackgroundColor="Black" TextColor="Green" DropDownIconColor="Green"/>
                <Entry Placeholder="deadline" x:Name="deadlineTxt"/>
                <Entry Placeholder="Author" x:Name="authorTxt"/>
            </HorizontalStackLayout>
            <Entry Placeholder="Description" x:Name="descTxt"/>
        </VerticalStackLayout>
    </FlexLayout>
    <VerticalStackLayout VerticalOptions="Center" >
        <SearchBar Placeholder="Search" x:Name="searchBar" TextChanged="searchBar_TextChanged" MaxLength="30" MaximumWidthRequest="200"/>
        <ImageButton Aspect="AspectFill" x:Name="addBtn" Source="plus.png" BackgroundColor="Black" Clicked="addBtn_Clicked" HeightRequest="64" WidthRequest="64"/>
    </VerticalStackLayout>
</Grid>

I have tried every different type of Layout but nothing works.
What should I do?


问:
Want to change background colors of correct and incorrect answers in quiz app on submitting in ReactJS project
I have just completed quiz app in react. However, I have one issue. Whenever I click on check answers button, all the correct answers should have green background color and the incorrect pressed answers should be red(as shown in attached image). I am not able to find a way to accomplish this and I have tried everything - google, Stackoverflow, YouTube and so on but I am not able to find the solution.
Please someone help me. My project will be completed after adding this issue.
Here is my code - https://github.com/Vee339/quizzical
Live project - https://vee339.github.io/quizzical/[![I want this look after submission]1]1</p>


问:
how to align headertext in center while using MaterialTable
im using materialtable for my application and i need to style my column header text to center....the data being displayed is getting aligned but not the header.....i used headerStyle...im able to change the text color but not the text alignment....i dnt want to use "TableHeader" from materialtable as im using sorting on my columns and when im using the TableHeader the sorting functionality is not working...i looked into TableSortLabel and the sorting implemenation looked very complicated...can anyone help with this</p>
```<code>            <MaterialTable
              className="-striped -highlight"
              title="Settlements"
              columns={[

                { title: 'Code', field: 'eCode', sortable: true,wrap: true,align:'left'},
                { title: 'Name', field: 'eName', sortable: true, wrap: true,align:'left'},
                { title: 'Amount', field: 'pAmount', sortable: true, wrap: true,align:'center',
              customSort:(a,b)=>(a.pAmount)-(b.pAmount) },

              options={{
                headerStyle:{color:'red',textAlign:'center'},
                exportButton: true,
                exportAllData: true,
                thirdSortClick: false,
                actionsColumnIndex: -1,
                pageSize: (this.state.data.length > 50) ? 50 : this.state.data.length,
                pageSizeOptions: [10, 25, 50, 100],
                rowStyle: rowData => ({
                  backgroundColor: (rowData.tableData.id % 2 === 0) ? '#FFF' : '#E5EEF6'
                })
              }}
</code>```

Body:
im using materialtable for my application and i need to style my column header text to center....the data being displayed is getting aligned but not the header.....i used headerStyle...im able to change the text color but not the text alignment....i dnt want to use "TableHeader" from materialtable as im using sorting on my columns and when im using the TableHeader the sorting functionality is not working...i looked into TableSortLabel and the sorting implemenation looked very complicated...can anyone help with this

            <MaterialTable
              className="-striped -highlight"
              title="Settlements"
              columns={[

                { title: 'Code', field: 'eCode', sortable: true,wrap: true,align:'left'},
                { title: 'Name', field: 'eName', sortable: true, wrap: true,align:'left'},
                { title: 'Amount', field: 'pAmount', sortable: true, wrap: true,align:'center',
              customSort:(a,b)=>(a.pAmount)-(b.pAmount) },

              options={{
                headerStyle:{color:'red',textAlign:'center'},
                exportButton: true,
                exportAllData: true,
                thirdSortClick: false,
                actionsColumnIndex: -1,
                pageSize: (this.state.data.length > 50) ? 50 : this.state.data.length,
                pageSizeOptions: [10, 25, 50, 100],
                rowStyle: rowData => ({
                  backgroundColor: (rowData.tableData.id % 2 === 0) ? '#FFF' : '#E5EEF6'
                })
              }}