问:
PsReadLine: execute selection
I would like to be able to select some part of the text in my command (e.g. a path) and start it, so that explorer opens the directory, or file.

So far i have come up with the code at the end of the post, which works, but has some issues:

it only works when text is selected using keyboard navigation while holding shift, not when dragging with the mouse (apparently in the latter case, psreadline doesn't recognize it as a selection?)

It doesn't work for expressions that should be expanded, such as when selecting $PROFILE.
How do i solve these issues?

```<code># if there is a selection, attempt to start it (that will, for instance, open a directory or file with default explorer action)
Set-PSReadlineKeyHandler -Chord Ctrl+Shift+r `
                         -BriefDescription RunSelection `
                         -LongDescription "Run (start) the current selection" `
                         -ScriptBlock {
    param($key, $arg)

    $selectionStart = $null
    $selectionLength = $null
    [Microsoft.PowerShell.PSConsoleReadLine]::GetSelectionState([ref]$selectionStart, [ref]$selectionLength)
    if ($selectionStart -eq -1)
    {
        # no selection, nothing to do
        return
    }

    # get selected text, with quotes
    $quote = '"'
    $line = $null
    $cursor = $null
    [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
    $selection = $quote + $line.SubString($selectionStart, $selectionLength) + $quote

    # start it
    &"start" $selection
}
</code>```

I add quotes so that things still work when a path with spaces is selected. With or without quotes, trying to open $PROFILE gives an error.

This is Powershell 7.3.1, PSReadLine 2.2.6 and Windows Terminal 1.15.3466.0.

Title: PsReadLine: execute selection

Body:
I would like to be able to select some part of the text in my command (e.g. a path) and start it, so that explorer opens the directory, or file.

So far i have come up with the code at the end of the post, which works, but has some issues:

it only works when text is selected using keyboard navigation while holding shift, not when dragging with the mouse (apparently in the latter case, psreadline doesn't recognize it as a selection?)

It doesn't work for expressions that should be expanded, such as when selecting $PROFILE.
How do i solve these issues?

# if there is a selection, attempt to start it (that will, for instance, open a directory or file with default explorer action)
Set-PSReadlineKeyHandler -Chord Ctrl+Shift+r `
                         -BriefDescription RunSelection `
                         -LongDescription "Run (start) the current selection" `
                         -ScriptBlock {
    param($key, $arg)

    $selectionStart = $null
    $selectionLength = $null
    [Microsoft.PowerShell.PSConsoleReadLine]::GetSelectionState([ref]$selectionStart, [ref]$selectionLength)
    if ($selectionStart -eq -1)
    {
        # no selection, nothing to do
        return
    }

    # get selected text, with quotes
    $quote = '"'
    $line = $null
    $cursor = $null
    [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
    $selection = $quote + $line.SubString($selectionStart, $selectionLength) + $quote

    # start it
    &"start" $selection
}

I add quotes so that things still work when a path with spaces is selected. With or without quotes, trying to open $PROFILE gives an error.

This is Powershell 7.3.1, PSReadLine 2.2.6 and Windows Terminal 1.15.3466.0.


来源: stackexchange

问:
InstallShield Hash on files to be installed
I have an InstallShield project and I want to implement a hash / crc check like Microsoft has relating to MSICHECKCRCS. Is there someway in InstallShield to set some option that the file is hashed/checked before installation then hash/checked after installation to make sure the installation file was corrupted?
And if there is such an option what will InstallShield do if the file is corrupted?

Thank you

ContentLicense: CC BY-SA 4.0


问:
Localhost refused to connect when using YouTube Data API
I've done all the steps on this site, but in step 4 when I run "node server.js" (same thing as node quickstart.js, but I am using the name server), I run into a problem. First, I am given a link in the terminal (works like it is supposed to), and am able to log into Google when I copy that link into my browser. However, when I click continue (which is supposed to lead me to a page where I get a code), it leads me to a page that says "localhost not found." How do I fix this? I've attached a step-by-step description of my problem with screenshots.

YouTube Data API –> localhost refused to connect


问:
Error using pygame wiki outline for 'spritesheets'
for quick reference the code I am referencing is found here

https://www.pygame.org/wiki/Spritesheet

I keep trying to run a test code using the outline specified in the link above but I keep running into errors. The main error I am encountering is;

AttributeError: type object 'spritesheet' has no attribute 'spriteshee'

I will admit my limited understanding of coding(on-and-off with python/html for about 3-6 months)but I think this link contains typos? namely 'spriteshee' but again, with my limited understanding, I can't tell if I am right or wrong.

ANYWAYS.

I have tried variously renaming some things to see if maybe that works. Other than that I have just been following the wiki outline to absolutely no avail.

What am I doing wrong or misunderstanding? Any and all help will be greatly appreciated!! Thank you for your time!

EDIT: unsure of relevance but I am operating on Mac OS Ventura 13.1 and am using Sublime Text for coding


问:
Appwrite return 500 error when trying to add custom domain
I get a 500 internal error when i try to add a custom domain to appwrite 1.2.0 server.

I have changed .env variable _APP_ENV and _APP_DOMAIN_TARGET to "api.example.com"

I have also followed manual ssl generation method here

When i navigate to my domain "api.example.com" i can access the console with no other issues and certificate in toolbar show connection secure certificate is valid.

However when i try to login to my app i get an error in console: Access to XMLHttpRequest at ... from origin 'https://www.mydomain.0r' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost' that is not equal to the supplied origin.

I assume this is because i am unable to set the custom domain in appwrite console but cant figure out what is causing the 500 error


问:
Unable to deploy firebase function due to eslint errors in node_modules
As the title says, I am not able to deploy firebase functions due to eslint errors from node_modules. This was not happening before but I think it's due to one of the library I adde recently?

Can anyone help me resolve this or direct me if there is a way to ignore eslint related error when deploying?


问:
Fetch POST request console.log not working correctly
While I can post data to my server, and the server console.log works, I cannot for the life figure out why the client side console.log isn't working. What am I missing here?

The Error: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Status: 200 OK

Request: {"hotSauceId":32,"presentation":5,"viscosityId":3,"spiciness":10,"Flavor_Notes":["Constituent Peppers"],"overall_rating":5,"lovedit":true,"taster_notes":"test"}

Looks json to me?

Submit Handler:

```<code>const handleSubmit = (e) => {
    e.preventDefault();
    fetch('http://jyh:3000', {
      method: 'POST',
      headers: {'Content-Type':'application/json'},
      body: JSON.stringify({
          "hotSauceId": sauce,
          "presentation": presentation,
          "viscosityId": viscosity,
          "spiciness": spiciness,
          "Flavor_Notes": flavor,
          "overall_rating": overall,
          "lovedit": loved,
          "taster_notes": notes
      }),
      }).then(res => {
          return res.json();
      }).then(data => {
          console.log(data);
      }).catch(err => {
          console.log(err);
      });
  };
</code>```

Server Code:

```<code>app.post('/', async (req, res) => {
    await Jyh.create({  // .create is a Sequelize method
        hotSauceId: req.body.hotSauceId,
        presentation: req.body.presentation,
        viscosityId: req.body.viscosityId,
        spiciness: req.body.spiciness,
        Flavor_Notes: req.body.Flavor_Notes,
        overall_rating: req.body.overall_rating,
        lovedit: req.body.lovedit,
        taster_notes: req.body.taster_notes
    }).then(() => {
        console.log('req.body: ', req.body);
    }).catch((err) => {
        console.log(err);
    });
});
</code>```

It should console.log the response in the client console, but instead I receive an error.

Github repository for the client and server app.

Body:
While I can post data to my server, and the server console.log works, I cannot for the life figure out why the client side console.log isn't working. What am I missing here?

The Error: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Status: 200 OK

Request: {"hotSauceId":32,"presentation":5,"viscosityId":3,"spiciness":10,"Flavor_Notes":["Constituent Peppers"],"overall_rating":5,"lovedit":true,"taster_notes":"test"}

Looks json to me?

Submit Handler:

const handleSubmit = (e) => {
    e.preventDefault();
    fetch('http://jyh:3000', {
      method: 'POST',
      headers: {'Content-Type':'application/json'},
      body: JSON.stringify({
          "hotSauceId": sauce,
          "presentation": presentation,
          "viscosityId": viscosity,
          "spiciness": spiciness,
          "Flavor_Notes": flavor,
          "overall_rating": overall,
          "lovedit": loved,
          "taster_notes": notes
      }),
      }).then(res => {
          return res.json();
      }).then(data => {
          console.log(data);
      }).catch(err => {
          console.log(err);
      });
  };

Server Code:

app.post('/', async (req, res) => {
    await Jyh.create({  // .create is a Sequelize method
        hotSauceId: req.body.hotSauceId,
        presentation: req.body.presentation,
        viscosityId: req.body.viscosityId,
        spiciness: req.body.spiciness,
        Flavor_Notes: req.body.Flavor_Notes,
        overall_rating: req.body.overall_rating,
        lovedit: req.body.lovedit,
        taster_notes: req.body.taster_notes
    }).then(() => {
        console.log('req.body: ', req.body);
    }).catch((err) => {
        console.log(err);
    });
});

It should console.log the response in the client console, but instead I receive an error.

Github repository for the client and server app.


问:
Rotating GC Log files with qos Logback
I am trying to rotate my gc.log file every time my application starts up.

I am using this file appender in my logback.xml file.

```<code>...

<appender name="GCFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${log.directory}/gc.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>${log.directory}/gc.log.%d{yyyyMMdd}_%d{HHmmss,aux}.gz</fileNamePattern>
        <TimeBasedFileNamingAndTriggeringPolicy class="com.ga.omni.utility.StartupTriggeringPolicy" />
        <maxHistory>50</maxHistory>
    </rollingPolicy>
    <encoder>
        <pattern>%msg%n</pattern>
    </encoder>
</appender>

...

<root level="INFO">
    <appender-ref ref="FILE" />
    <appender-ref ref="GCFILE" />
</root>
</code>```

(the "FILE" ref is a reference to our default logging file for the app.)

The appender references a TimeBasedFileNamingAndTriggeringPolicy named StartupTriggeringPolicy:

```<code>@NoAutoStart //won't be autostarted by Joran at config time
public class StartupTriggeringPolicy<E> extends DefaultTimeBasedFileNamingAndTriggeringPolicy<E> {

    Logger log = LoggerFactory.getLogger(StartupTriggeringPolicy.class);

    public StartupTriggeringPolicy() {
        log.info("StartupTriggeringPolicy constructor called");
    }

    @Override
    public void start() {
        log.info("StartupTriggeringPolicy start() called... initialting gc.log rollover");
        super.start();
        //only check this once, on startup.
        nextCheck = 0L;
        isTriggeringEvent(null, null);
        try {
            tbrp.rollover();
            log.info("StartupTriggeringPolicy start() called... gc.log successfully rolled over.");
        } catch (RolloverFailure e) {
            log.warn("Error rolling over gc.log file in StartupTriggeringPolicy.start()");
            //Do nothing
        }
    }
}
</code>```

The trouble that I'm facing is that the app starts up, but the StartupTriggeringPolicy never seems to get instantiated.  None of the logs from the constructor or start() method are written, and if I put breakpoints in those methods, the breakpoints don't get hit.

Any suggestions would be greatly apperciated!

Title: Rotating GC Log files with qos Logback

Body:
I am trying to rotate my gc.log file every time my application starts up.

I am using this file appender in my logback.xml file.

...

<appender name="GCFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${log.directory}/gc.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>${log.directory}/gc.log.%d{yyyyMMdd}_%d{HHmmss,aux}.gz</fileNamePattern>
        <TimeBasedFileNamingAndTriggeringPolicy class="com.ga.omni.utility.StartupTriggeringPolicy" />
        <maxHistory>50</maxHistory>
    </rollingPolicy>
    <encoder>
        <pattern>%msg%n</pattern>
    </encoder>
</appender>

...

<root level="INFO">
    <appender-ref ref="FILE" />
    <appender-ref ref="GCFILE" />
</root>

(the "FILE" ref is a reference to our default logging file for the app.)

The appender references a TimeBasedFileNamingAndTriggeringPolicy named StartupTriggeringPolicy:

@NoAutoStart //won't be autostarted by Joran at config time
public class StartupTriggeringPolicy<E> extends DefaultTimeBasedFileNamingAndTriggeringPolicy<E> {

    Logger log = LoggerFactory.getLogger(StartupTriggeringPolicy.class);

    public StartupTriggeringPolicy() {
        log.info("StartupTriggeringPolicy constructor called");
    }

    @Override
    public void start() {
        log.info("StartupTriggeringPolicy start() called... initialting gc.log rollover");
        super.start();
        //only check this once, on startup.
        nextCheck = 0L;
        isTriggeringEvent(null, null);
        try {
            tbrp.rollover();
            log.info("StartupTriggeringPolicy start() called... gc.log successfully rolled over.");
        } catch (RolloverFailure e) {
            log.warn("Error rolling over gc.log file in StartupTriggeringPolicy.start()");
            //Do nothing
        }
    }
}

The trouble that I'm facing is that the app starts up, but the StartupTriggeringPolicy never seems to get instantiated.  None of the logs from the constructor or start() method are written, and if I put breakpoints in those methods, the breakpoints don't get hit.

Any suggestions would be greatly apperciated!


问:
Issue supplying git credentials to docker alpine/git
I'm trying to create a docker image with multi-stage build:

First stage pulls a private git repo

Second stage builds that repo and runs a script

I have my git credentials stored in /Users/kabc/.config/git/credentials file on my host machine.

I'm mounting this in docker-compose like so:

```<code>  joke-generator:
    build:
      context: ./
      dockerfile: Dockerfile.joke-gen
    volumes:
      - ${HOME}/.config:/etc/.config:ro
      - ${HOME}/.gitconfig:/etc/.gitconfig:ro
</code>```

Here's the dockerfile:

```<code>FROM alpine/git:2.36.3 as repository

WORKDIR /code

RUN git config --global credential.helper 'store --file /etc/.config/git/credentials'
RUN git -c http.sslVerify=false clone https://github.com/private-company/joke.git

FROM openjdk:19-jdk-alpine3.16

WORKDIR /code

COPY --from=repository /code/joke/ /code

RUN cd joke-generator
RUN mvn clean install -DskipTests

CMD ["./generate-joke.sh"]
</code>```

But I'm getting this error in the git clone step:

fatal: could not read Username for 'https://github.com': No such
device or address

Can I get some help with this please?

Body:
I'm trying to create a docker image with multi-stage build:

First stage pulls a private git repo

Second stage builds that repo and runs a script

I have my git credentials stored in /Users/kabc/.config/git/credentials file on my host machine.

I'm mounting this in docker-compose like so:

  joke-generator:
    build:
      context: ./
      dockerfile: Dockerfile.joke-gen
    volumes:
      - ${HOME}/.config:/etc/.config:ro
      - ${HOME}/.gitconfig:/etc/.gitconfig:ro

Here's the dockerfile:

FROM alpine/git:2.36.3 as repository

WORKDIR /code

RUN git config --global credential.helper 'store --file /etc/.config/git/credentials'
RUN git -c http.sslVerify=false clone https://github.com/private-company/joke.git

FROM openjdk:19-jdk-alpine3.16

WORKDIR /code

COPY --from=repository /code/joke/ /code

RUN cd joke-generator
RUN mvn clean install -DskipTests

CMD ["./generate-joke.sh"]

But I'm getting this error in the git clone step:

fatal: could not read Username for 'https://github.com': No such
device or address

Can I get some help with this please?


问:
What does dqAIC mean in r?
i am using the IC.test formula to compare models but don't know how to interpret it

```<code>    dqAIC df
DM7  0.0  20
DM1 65.7  17
DM2 65.7  17
DM3 65.7  17
DM4 67.8  7
DM5 88.2  11
DM6   NA  23
</code>```

This is the formula i used

```<code>testIC.D <- ICtab(DM1, DM2, DM3, DM4, DM5, DM6, DM7, type="qAIC")
testIC.D
</code>```

Title: What does dqAIC mean in r?

Body:
i am using the IC.test formula to compare models but don't know how to interpret it

    dqAIC df
DM7  0.0  20
DM1 65.7  17
DM2 65.7  17
DM3 65.7  17
DM4 67.8  7
DM5 88.2  11
DM6   NA  23

This is the formula i used

testIC.D <- ICtab(DM1, DM2, DM3, DM4, DM5, DM6, DM7, type="qAIC")
testIC.D


问:
Renaming string value
I'm trying to run a filter but it's failing due to the '/' symbol that's not recognised. I would like to rename the text in R by removing the' /'. I know I can rename it in excel before picking up file but I would rather learn how to rename it in R.

This is the command:

Pfizervaccine <- Covidvaccine %>% filter(grepl('PFIZER\BIONTECH', VAX_MANU))

I've tried the command for other vaccines and it works fine, so I know it's to do with the '/' symbol. e.g. Janssenvaccine <- Covidvaccine %>% filter(grepl('JANSSEN', VAX_MANU))

I've attached a screenshot showing the structure of the data.

Title: Renaming string value


问:
CSS Specificity about MUI
I want to build WordPress plugin admin manager screen by MUI, but I find a problem about CSS specificity.
Here it is normal:

enter image description here

But the fact is that:

enter image description here

My code:

```<code>import React from 'react';
import ReactDOM from 'react-dom/client';
import Paper from '@mui/material/Paper';
import FormGroup from "@mui/material/FormGroup";
import TextField from '@mui/material/TextField';
import Typography from '@mui/material/Typography';
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import StyledEngineProvider from "@mui/material/StyledEngineProvider";

const root = ReactDOM.createRoot(document.getElementById('wpbody'));
root.render(
    <Paper sx={{padding: 3}}>
        <Typography sx={{padding: 1}}>基础设置</Typography>
        <FormGroup sx={{maxWidth: 300}}>
            <TextField id="standard-basic" label="App ID" variant={"filled"} sx={{margin: 1}}/>
            <TextField id="standard-basic" label="App Secret" variant={"filled"} sx={{margin: 1}}/>
            <Box>
                <Button variant={"contained"} sx={{margin: 1}}>保存</Button>
            </Box>
        </FormGroup>
    </Paper>
);
</code>```

Title: CSS Specificity about MUI

Body:
I want to build WordPress plugin admin manager screen by MUI, but I find a problem about CSS specificity.
Here it is normal:

enter image description here

But the fact is that:

enter image description here

My code:

import React from 'react';
import ReactDOM from 'react-dom/client';
import Paper from '@mui/material/Paper';
import FormGroup from "@mui/material/FormGroup";
import TextField from '@mui/material/TextField';
import Typography from '@mui/material/Typography';
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import StyledEngineProvider from "@mui/material/StyledEngineProvider";

const root = ReactDOM.createRoot(document.getElementById('wpbody'));
root.render(
    <Paper sx={{padding: 3}}>
        <Typography sx={{padding: 1}}>基础设置</Typography>
        <FormGroup sx={{maxWidth: 300}}>
            <TextField id="standard-basic" label="App ID" variant={"filled"} sx={{margin: 1}}/>
            <TextField id="standard-basic" label="App Secret" variant={"filled"} sx={{margin: 1}}/>
            <Box>
                <Button variant={"contained"} sx={{margin: 1}}>保存</Button>
            </Box>
        </FormGroup>
    </Paper>
);


问:
How do I generate a polychoric correlation matrix in R-psych
I am trying to generate a polychoric correlation matrix in R-psych for a 227 x 6 data table which I have called nepr. Importing the data from an excel spreadsheet and entering the code:

```<code>nepr=as.data.frame(nepr)
attach(nepr)
library(psych)
out=polychoric(nepr)
neprpoly=out$rho
print(neprpoly,digits=2)
</code>```

generates the following error message:

```<code>>Error in if (any(lower > upper)) stop("lower>upper integration
limits"): missing value where   TRUE/FALSE needed
>In addition: warning messages:
>1. In polychoric(nepr): The items do not have an equal number
of response alternatives, global set to FALSE.
>2. In qnorm(cumsum(rsum)[-length(rsum)]): NaNs produced
</code>```

I was expecting the code which I entered to produce a polychoric correlation matrix based on the dataframe nepr and don't know how to interpret/ act on the error messages which I have received.

Can anyone suggest what changes I need to make to the code to address the error messages?

A sample of the dataset is as follows:

```<code>structure(list(Balance = c(4, 4, 5, 5, 3, 4, 3, 4, 2, 2, 2, 5,
2, 2, 2, 2, 1, 2, 4, 1), Earth = c(4, 5, 5, 5, 5, 5, 5, 4, 4,
4, 4, 5, 3, 4, 4, 2, 5, 4, 5, 5), Plants = c(2, 2, 2, 3, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 4), Modify = c(2, 2, 1,
1, 2, 2, 2, 2, 4, 2, 4, 2, 4, 2, 2, 2, 2, 2, 2, 2), Growth =
c(2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 1, 4, 2, 2, 4, 4, 4, 1, 2),
Mankind = c(2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1,
1, 1, 2)), row.names = c(NA,20L), class = "data.frame")
</code>```

The data consists of inputs of Likert scale rankings (ranked 1-5) to the items 'Balance', 'Earth', 'Plants', 'Modify', 'Growth', and 'Mankind'. There are no missing values in any cells of the 227 row x 6 item matrix; Balance, Plants, & Growth all contain the values 1-5; Earth contains the values 2-5 (no ranking of 1 recorded); Mankind contains the values 1-4 (no ranking of 5 recorded). When I ran the original data set (before reversing the valence of the last 3 columns) I was able to get a polychoric matrix with no problems even though the data contained the Earth data as it appears in the nepr data set. I assume that it is not uncommon to have similar data sets from surveys where variables do not necessarily contain the full range of response values.

Body:
I am trying to generate a polychoric correlation matrix in R-psych for a 227 x 6 data table which I have called nepr. Importing the data from an excel spreadsheet and entering the code:

nepr=as.data.frame(nepr)
attach(nepr)
library(psych)
out=polychoric(nepr)
neprpoly=out$rho
print(neprpoly,digits=2)

generates the following error message:

>Error in if (any(lower > upper)) stop("lower>upper integration
limits"): missing value where   TRUE/FALSE needed
>In addition: warning messages:
>1. In polychoric(nepr): The items do not have an equal number
of response alternatives, global set to FALSE.
>2. In qnorm(cumsum(rsum)[-length(rsum)]): NaNs produced

I was expecting the code which I entered to produce a polychoric correlation matrix based on the dataframe nepr and don't know how to interpret/ act on the error messages which I have received.

Can anyone suggest what changes I need to make to the code to address the error messages?

A sample of the dataset is as follows:

structure(list(Balance = c(4, 4, 5, 5, 3, 4, 3, 4, 2, 2, 2, 5,
2, 2, 2, 2, 1, 2, 4, 1), Earth = c(4, 5, 5, 5, 5, 5, 5, 4, 4,
4, 4, 5, 3, 4, 4, 2, 5, 4, 5, 5), Plants = c(2, 2, 2, 3, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 4), Modify = c(2, 2, 1,
1, 2, 2, 2, 2, 4, 2, 4, 2, 4, 2, 2, 2, 2, 2, 2, 2), Growth =
c(2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 1, 4, 2, 2, 4, 4, 4, 1, 2),
Mankind = c(2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1,
1, 1, 2)), row.names = c(NA,20L), class = "data.frame")

The data consists of inputs of Likert scale rankings (ranked 1-5) to the items 'Balance', 'Earth', 'Plants', 'Modify', 'Growth', and 'Mankind'. There are no missing values in any cells of the 227 row x 6 item matrix; Balance, Plants, & Growth all contain the values 1-5; Earth contains the values 2-5 (no ranking of 1 recorded); Mankind contains the values 1-4 (no ranking of 5 recorded). When I ran the original data set (before reversing the valence of the last 3 columns) I was able to get a polychoric matrix with no problems even though the data contained the Earth data as it appears in the nepr data set. I assume that it is not uncommon to have similar data sets from surveys where variables do not necessarily contain the full range of response values.


问:
How to find the third-party libraries which use Jira as bug tracking systems?
I want to find some third party libraries which use jira as bug tracking system. I need to analyse the bug reports. But I can not find the propor projects in jira now.</p>


问:
Change the undefined value to an empty string in a React App using AntD Form
I am looking at a friends React website someone dod for him. As I look through the code and run it, the 2 fields that have a rule for required: false, which works; however, the data for the input is then undefined...

I been searching around and trying a few rules and other ways to get the value of undefined for that input to be an empty string but have not had any success as I console.log() my values out.

How can one take the that one Input value that was purposely left blank since not required and have a rule change to empty string or in the onFinish() have the value changed there. I tried that too, getting the obj values and iterating over them and can change there but then the data is still undefined.

It has no useEffect(), not using useState() for the variables, they have it AntD Form and FireStore as the database. That is what keeps erroring on the Form since FireStore does not except undefined

Here is the snippet of the form for that input:

```<code>        <Form.Item
          name={[ "additionalServiceDescription" ]}
          label="Company's Additional Service Fees (not required)"

          // **** Added this rule as per the documentation but no luck....
          rules={[
            {
              required: false,

              validator: (_, value) =>
                value === undefined
                  ? Promise.resolve()
                  : Promise.reject('Please enter a value or leave blank')
            }
          ]}
        >
          <Input
            value={("additionalServiceDescription".value === undefined) ? '' : ''}
          />
        </Form.Item>
</code>```

else here it is as is

```<code>        <Form.Item
          name={[ "additionalServiceDescription" ]}
          label="Company's Additional Service Fees (not required)"

          rules={[ { required: false } ]}
        >
          <Input
          />
        </Form.Item>
</code>```

Body:
I am looking at a friends React website someone dod for him. As I look through the code and run it, the 2 fields that have a rule for required: false, which works; however, the data for the input is then undefined...

I been searching around and trying a few rules and other ways to get the value of undefined for that input to be an empty string but have not had any success as I console.log() my values out.

How can one take the that one Input value that was purposely left blank since not required and have a rule change to empty string or in the onFinish() have the value changed there. I tried that too, getting the obj values and iterating over them and can change there but then the data is still undefined.

It has no useEffect(), not using useState() for the variables, they have it AntD Form and FireStore as the database. That is what keeps erroring on the Form since FireStore does not except undefined

Here is the snippet of the form for that input:

        <Form.Item
          name={[ "additionalServiceDescription" ]}
          label="Company's Additional Service Fees (not required)"

          // **** Added this rule as per the documentation but no luck....
          rules={[
            {
              required: false,

              validator: (_, value) =>
                value === undefined
                  ? Promise.resolve()
                  : Promise.reject('Please enter a value or leave blank')
            }
          ]}
        >
          <Input
            value={("additionalServiceDescription".value === undefined) ? '' : ''}
          />
        </Form.Item>

else here it is as is

        <Form.Item
          name={[ "additionalServiceDescription" ]}
          label="Company's Additional Service Fees (not required)"

          rules={[ { required: false } ]}
        >
          <Input
          />
        </Form.Item>


问:
Getting query String parameters from iframe
My parent window URL and iframe URls are different applications.

So whenever I am using any property of iframe to access src or current URL , I am getting CORS error.

```<code>document.getElementById("myframe").contentWindow.location.href
</code>```

How can I read the query string parameters from the current URL in iframe?

```<code>     $scope.callCPQFunction = function () {

        document.querySelector('#iframeForm').submit();

        setTimeout(function() {

            var cc= document.getElementById("abcd");

            var ifm = document.querySelector("abcd");

            console.log('cc'+iframeElement.getAttribute("src"));

            console.log(new XMLSerializer().serializeToString(cc))

            }, 9000);

    }
</code>```

Body:
My parent window URL and iframe URls are different applications.

So whenever I am using any property of iframe to access src or current URL , I am getting CORS error.

document.getElementById("myframe").contentWindow.location.href

How can I read the query string parameters from the current URL in iframe?

     $scope.callCPQFunction = function () {

        document.querySelector('#iframeForm').submit();

        setTimeout(function() {

            var cc= document.getElementById("abcd");

            var ifm = document.querySelector("abcd");

            console.log('cc'+iframeElement.getAttribute("src"));

            console.log(new XMLSerializer().serializeToString(cc))

            }, 9000);

    }


问:
Implementation of lexical analysis program in TEST language
This is the program I have:

```<code>#include <stdio.h>
#include <string.h>

int main()
{

    char Scanin[300],Scanout[300];
    extern FILE *fin,*fout;

    printf("Please enter the source program file name (including the path): ");
    scanf("%s",Scanin);
    printf("Please enter the lexical analysis output file name (including the path):");
    scanf("%s",Scanout);
    if((fin=fopen(Scanin,"r"))==NULL)
             //Judge whether the input file name is correct
    {
        printf("\nError opening lexical analysis input file!\n");
        return 1;
                //Error in input file returned error code 1
    }

    if((fout=fopen(Scanout,"w"))==NULL)
        //Judge whether the output file name is correct
    {
        printf("\nError creating lexical analysis output file!\n");
        return 2;
                //Error in output file returned error code 2
    }
}
</code>```

and this is the error I get:

Undefined reference to 'fout'
Undefined reference to 'fin'
error: 1d returned 1 exit status

This code was sent by my teacher and all she told me was to copy the code and give her an executable .exe file. And i am trying to ask help from her but she isn't responding to any of my messages, I am currently still having online classes.

Body:
This is the program I have:

#include <stdio.h>
#include <string.h>

int main()
{

    char Scanin[300],Scanout[300];
    extern FILE *fin,*fout;

    printf("Please enter the source program file name (including the path): ");
    scanf("%s",Scanin);
    printf("Please enter the lexical analysis output file name (including the path):");
    scanf("%s",Scanout);
    if((fin=fopen(Scanin,"r"))==NULL)
             //Judge whether the input file name is correct
    {
        printf("\nError opening lexical analysis input file!\n");
        return 1;
                //Error in input file returned error code 1
    }

    if((fout=fopen(Scanout,"w"))==NULL)
        //Judge whether the output file name is correct
    {
        printf("\nError creating lexical analysis output file!\n");
        return 2;
                //Error in output file returned error code 2
    }
}

and this is the error I get:

Undefined reference to 'fout'
Undefined reference to 'fin'
error: 1d returned 1 exit status

This code was sent by my teacher and all she told me was to copy the code and give her an executable .exe file. And i am trying to ask help from her but she isn't responding to any of my messages, I am currently still having online classes.


问:
Creating a 3D surface with interp2d / RBFInterpolator / griddata
After long time of interested reading, it´s now time for my first question here.

I try to create a 3D volatility surface out of single data points. The basic structure looks like this:

Strike
42
77
133
224
315
406
595

7.2
NaN
NaN
NaN
NaN
NaN
NaN
54

13.0
NaN
NaN
66
46
60
NaN
NaN

14.0
NaN
NaN
61
60
58
54
51

15.0
NaN
65
58
57
56
NaN
NaN

15.5
74
62
NaN
NaN
NaN
NaN
NaN

18.0
62
55
53
51
50
46
45

18.5
59
53
NaN
NaN
NaN
NaN
NaN

19.0
57
52
51
50
48
NaN
NaN

19.5
56
51
NaN
NaN
NaN
NaN
NaN

20.0
54
50
49
48
47
45
42

21.0
51
48
NaN
NaN
NaN
NaN
NaN

22.0
49
46
46
45
43
NaN
NaN

27.0
46
43
NaN
NaN
NaN
NaN
NaN

28.0
46
43
42
41
39
38
37

44.0
NaN
NaN
NaN
NaN
NaN
NaN
33

48.0
NaN
NaN
NaN
NaN
NaN
NaN
34

This is a table with random data, but pretty close to my data (my values are all float numbers), to show the basic traits. The column names is the time to maturity in days, the index is the strike price, the corresponding values are the volatilities. I identified two problems (for me, maybe they are no problems):

Randomly distributed NaN values in between the data.

Uneven lenght of index and columns.

In the end I want to be in the situation, that I can assign a volatility value to each random pair of days to maturity and strike. In a 2 dimensional space this was possible by using interp1d (for each maturity band). But with this I have a function for each maturity band. If a value is in between two maturity bands, I don´t know how to calculate it. So, I tried the following on the 3D calculation:

Griddata:

```<code>df_test = df2_0.iloc[9:16,0:7]
X=df_test.columns.values
Y=df_test.index.values
Z=df_test.values

test = np.ma.masked_invalid(df_test)

XX,YY = np.meshgrid(np.linspace(min(X),max(X),10),np.linspace(min(Y),max(Y),10))

x1=XX[~test.mask]
y1=YY[~test.mask]
df_test1=test[~test.mask]

d = interpolate.griddata((x1,y1), df_test1.ravel(),(XX,YY),method="cubic")

</code>```

Griddata was one of the most promising attempts because of the easy set up. It worked when I used iloc to use only extracts of the dataframe above. Without iloc I get the error message:
"IndexError: boolean index did not match indexed array along dimension 1; dimension is 34 but corresponding boolean dimension is 7".

Another attempt was to leave out the masking, but then it gives me also the error message "ValueError: invalid number of dimensions in xi":

```<code>m= ((int(max(Y))-int(min(Y)))*10)-1
XX,YY = np.meshgrid(np.linspace(min(X),max(X),(max(X)-min(X)+1)),np.linspace(min(Y),max(Y),m))
ZZ = griddata(np.array([X,Y]).T,np.array(Z),(XX,YY), method='linear')
</code>```

Is there a possibility to use griddata on my dataset? And does it also compute values which are not present in the dataframe above (for example Strike "30" with maturity "100")?interesting

Interp2d and RBFInterpolator:

I also took a look into these commands and they were especially intresting because of the possibility to extrapolate the data. I tried this:

```<code>X=df_test.columns.values
Y=df_test.index.values
Z=df_test.values

XX, YY = np.meshgrid(X,Y)

rbf = interp.RBFInterpolator(np.array([X,Y]).T,Z,
                             smoothing=0, kernel='cubic')
</code>```

There was no error, but when I try to put in numbers into rbf, it only gives me "nan" values. Have i used this one right?
Or should I give interp2d a try?

Thank you very much in advance.

Body:
After long time of interested reading, it´s now time for my first question here.

I try to create a 3D volatility surface out of single data points. The basic structure looks like this:

Strike
42
77
133
224
315
406
595

7.2
NaN
NaN
NaN
NaN
NaN
NaN
54

13.0
NaN
NaN
66
46
60
NaN
NaN

14.0
NaN
NaN
61
60
58
54
51

15.0
NaN
65
58
57
56
NaN
NaN

15.5
74
62
NaN
NaN
NaN
NaN
NaN

18.0
62
55
53
51
50
46
45

18.5
59
53
NaN
NaN
NaN
NaN
NaN

19.0
57
52
51
50
48
NaN
NaN

19.5
56
51
NaN
NaN
NaN
NaN
NaN

20.0
54
50
49
48
47
45
42

21.0
51
48
NaN
NaN
NaN
NaN
NaN

22.0
49
46
46
45
43
NaN
NaN

27.0
46
43
NaN
NaN
NaN
NaN
NaN

28.0
46
43
42
41
39
38
37

44.0
NaN
NaN
NaN
NaN
NaN
NaN
33

48.0
NaN
NaN
NaN
NaN
NaN
NaN
34

This is a table with random data, but pretty close to my data (my values are all float numbers), to show the basic traits. The column names is the time to maturity in days, the index is the strike price, the corresponding values are the volatilities. I identified two problems (for me, maybe they are no problems):

Randomly distributed NaN values in between the data.

Uneven lenght of index and columns.

In the end I want to be in the situation, that I can assign a volatility value to each random pair of days to maturity and strike. In a 2 dimensional space this was possible by using interp1d (for each maturity band). But with this I have a function for each maturity band. If a value is in between two maturity bands, I don´t know how to calculate it. So, I tried the following on the 3D calculation:

Griddata:

df_test = df2_0.iloc[9:16,0:7]
X=df_test.columns.values
Y=df_test.index.values
Z=df_test.values

test = np.ma.masked_invalid(df_test)

XX,YY = np.meshgrid(np.linspace(min(X),max(X),10),np.linspace(min(Y),max(Y),10))

x1=XX[~test.mask]
y1=YY[~test.mask]
df_test1=test[~test.mask]

d = interpolate.griddata((x1,y1), df_test1.ravel(),(XX,YY),method="cubic")

Griddata was one of the most promising attempts because of the easy set up. It worked when I used iloc to use only extracts of the dataframe above. Without iloc I get the error message:
"IndexError: boolean index did not match indexed array along dimension 1; dimension is 34 but corresponding boolean dimension is 7".

Another attempt was to leave out the masking, but then it gives me also the error message "ValueError: invalid number of dimensions in xi":

m= ((int(max(Y))-int(min(Y)))*10)-1
XX,YY = np.meshgrid(np.linspace(min(X),max(X),(max(X)-min(X)+1)),np.linspace(min(Y),max(Y),m))
ZZ = griddata(np.array([X,Y]).T,np.array(Z),(XX,YY), method='linear')

Is there a possibility to use griddata on my dataset? And does it also compute values which are not present in the dataframe above (for example Strike "30" with maturity "100")?interesting

Interp2d and RBFInterpolator:

I also took a look into these commands and they were especially intresting because of the possibility to extrapolate the data. I tried this:

X=df_test.columns.values
Y=df_test.index.values
Z=df_test.values

XX, YY = np.meshgrid(X,Y)

rbf = interp.RBFInterpolator(np.array([X,Y]).T,Z,
                             smoothing=0, kernel='cubic')

There was no error, but when I try to put in numbers into rbf, it only gives me "nan" values. Have i used this one right?
Or should I give interp2d a try?

Thank you very much in advance.


问:
How to fix newline in input causing Swift AWS lambda to fail in localhost testing
I have a  Swift AWS Lambda project that I'm running into issues with when testing on localhost

Here is what my main.swift in my Lambda project looks like:

import AWSLambdaEvents
import AWSLambdaRuntime
import Foundation

Lambda.run { (context, payload: String, completion: @escaping (Result<[String], Error>) -> Void) in
    completion(.success(interpret(payload)))
}
```
<p>The input to my Swift Lambda is a String and the output is an Array of Strings.</p>
<p>I am testing this by running locally and using Postman to send a POST request to 127.0.0.1:7000/invoke</p>
<p>I am sending my inputs as text/plain with the following headers (see image)</p>
<p>Headers in Postman</p>
<p>When I send the following input:</p>
```"3 print|"
```
<p>everything is fine and I get back my expected output in the http response</p>
```["3","exited with code: 0"]
```
<p>However, when I change my input to have a newline like so:</p>
```"3
print|"
```
<p>I get the following error in the http response</p>
```{"errorType":"FunctionError",
"errorMessage":
"requestDecoding(Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [],
debugDescription: \"The given data was not valid JSON.\",
underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840
\"Unescaped control character around line 1, column 2.\"
UserInfo={NSDebugDescription=Unescaped control character around line 1, column 2.,
NSJSONSerializationErrorIndex=2}))))"}
```

It seems like somewhere between my request getting to 127.0.0.1:7000/invoke and the Lambda.run in my code, the Swift AWS Lambda code is trying to convert my input string to JSON and failing because my input contains a newline character

How can I setup my Swift Lambda so that it works with HTTP POST requests with a payload that contain a newline?

Body:
I have a  Swift AWS Lambda project that I'm running into issues with when testing on localhost

Here is what my main.swift in my Lambda project looks like:

import AWSLambdaEvents
import AWSLambdaRuntime
import Foundation

Lambda.run { (context, payload: String, completion: @escaping (Result<[String], Error>) -> Void) in
    completion(.success(interpret(payload)))
}

The input to my Swift Lambda is a String and the output is an Array of Strings.

I am testing this by running locally and using Postman to send a POST request to 127.0.0.1:7000/invoke

I am sending my inputs as text/plain with the following headers (see image)

Headers in Postman

When I send the following input:

"3 print|"

everything is fine and I get back my expected output in the http response

["3","exited with code: 0"]

However, when I change my input to have a newline like so:

"3
print|"

I get the following error in the http response

{"errorType":"FunctionError",
"errorMessage":
"requestDecoding(Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [],
debugDescription: \"The given data was not valid JSON.\",
underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840
\"Unescaped control character around line 1, column 2.\"
UserInfo={NSDebugDescription=Unescaped control character around line 1, column 2.,
NSJSONSerializationErrorIndex=2}))))"}

It seems like somewhere between my request getting to 127.0.0.1:7000/invoke and the Lambda.run in my code, the Swift AWS Lambda code is trying to convert my input string to JSON and failing because my input contains a newline character

How can I setup my Swift Lambda so that it works with HTTP POST requests with a payload that contain a newline?


问:
Trouble Migrating a Java JSONJAXB Context Resolver to Jakarata
I have an older Java-EE JSON Context resolver that I am struggling to migrate to Jakarta. The JAXBContext object is instantiated using a HashMap of properties. The code was updated to use JAXBContext; however, the properties previously used to instantiate the object in Java are not supported by Jakarta.

```<code>public JAXBContextResolver() throws Exception
{
    //the objects below are not compatible with Jakarta and need to be updated
    Map props = new HashMap<String, Object>();
    //JSONJAXBContext.JSON_NOTATION         = "com.sun.jersey.impl.json.notation" (Deprecated See JSONConfiguration)
    //JSONJAXBContext.JSON_ROOT_UNWRAPPING  = "com.sun.jersey.impl.json.root.unwrapping"
    //JSONJAXBContext.JSON_ARRAYS           = "com.sun.jersey.impl.json.arrays"
    props.put(JSONJAXBContext.JSON_NOTATION, "MAPPED");
    props.put(JSONJAXBContext.JSON_ROOT_UNWRAPPING, Boolean.TRUE);
    props.put(JSONJAXBContext.JSON_ARRAYS,new HashSet<String>(types.length){{add("ourData");}});

    this.context = JAXBContext.newInstance(types, props);
}

</code>```

The code results in the runtime error "Allocate exception for servlet jersey jakarta.xml.bind.JAXBException: property "com.sun.jersey.impl.json.notation" is not supported. Researching this issue, it appears a different method, such as setting the properties through a marshaller is required, but I haven't determined how to set similar properties using this method.

Body:
I have an older Java-EE JSON Context resolver that I am struggling to migrate to Jakarta. The JAXBContext object is instantiated using a HashMap of properties. The code was updated to use JAXBContext; however, the properties previously used to instantiate the object in Java are not supported by Jakarta.

public JAXBContextResolver() throws Exception
{
    //the objects below are not compatible with Jakarta and need to be updated
    Map props = new HashMap<String, Object>();
    //JSONJAXBContext.JSON_NOTATION         = "com.sun.jersey.impl.json.notation" (Deprecated See JSONConfiguration)
    //JSONJAXBContext.JSON_ROOT_UNWRAPPING  = "com.sun.jersey.impl.json.root.unwrapping"
    //JSONJAXBContext.JSON_ARRAYS           = "com.sun.jersey.impl.json.arrays"
    props.put(JSONJAXBContext.JSON_NOTATION, "MAPPED");
    props.put(JSONJAXBContext.JSON_ROOT_UNWRAPPING, Boolean.TRUE);
    props.put(JSONJAXBContext.JSON_ARRAYS,new HashSet<String>(types.length){{add("ourData");}});

    this.context = JAXBContext.newInstance(types, props);
}

The code results in the runtime error "Allocate exception for servlet jersey jakarta.xml.bind.JAXBException: property "com.sun.jersey.impl.json.notation" is not supported. Researching this issue, it appears a different method, such as setting the properties through a marshaller is required, but I haven't determined how to set similar properties using this method.


问:
How to enable reading input using *open(0)
reading input using integer file descriptor on almost all interpreters
not show any output neither the program returned 0 or ended using *open(0) approach :

for s in[*open(0)]:
  n, k = map(int, s.split())
```

I've tried running this code on online judges like Codeforces and it ran perfectly

why it does not work on almost all interpreters and how/where can I enable or use this approach on my local machine ?

Body:
reading input using integer file descriptor on almost all interpreters
not show any output neither the program returned 0 or ended using *open(0) approach :

for s in[*open(0)]:
  n, k = map(int, s.split())

I've tried running this code on online judges like Codeforces and it ran perfectly

why it does not work on almost all interpreters and how/where can I enable or use this approach on my local machine ?


问:
Usage Information Access
I'm using app_usage package to see the usage details of the apps installed inside my flutter app, but it requires me to grant it access to usage information and the app is not even there. how do I show my flutter app inside the Usage Information Access menu?

I tried to follow the package documentation, but it didn't work

Title: Usage Information Access


问:
Class Leet Code - Add two Numbers - Why can't I get the value of the first recursion?
Here is the class ListNode:

```<code> class ListNode:
     def __init__(self, val=0, next=None):
         self.val = val
         self.next = next
</code>```

and here is the solution class:

```<code>class Solution:
    def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
        print(l1.next.val)
</code>```

For the case where L1 is = ListNode(2, ListNode(4, ListNode(3))),why do I get the error: AttributeError: 'NoneType' object has no attribute 'val'
print(l1.next.val)

I was thinking about getting 4. But the output seems to give me 4 plus the error...

I was thinking about getting 4. But the output seems to give me 4 plus the error...

Body:
Here is the class ListNode:

 class ListNode:
     def __init__(self, val=0, next=None):
         self.val = val
         self.next = next

and here is the solution class:

class Solution:
    def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
        print(l1.next.val)

For the case where L1 is = ListNode(2, ListNode(4, ListNode(3))),why do I get the error: AttributeError: 'NoneType' object has no attribute 'val'
print(l1.next.val)

I was thinking about getting 4. But the output seems to give me 4 plus the error...

I was thinking about getting 4. But the output seems to give me 4 plus the error...


问:
How to get Product Last Update DateTime from Facebook API?
In Facebook API using this endpoint:
https://developers.facebook.com/docs/marketing-api/reference/product-catalog/products/

I would like to get the date of last edit available in Facebook Business Manager in the extra information:

Using the graphql explorer https://developers.facebook.com/tools/explorer/, I'm able to get most of the information I need but not this one:

/{CATALOG_ID}/products?fields=additional_variant_attributes,ar_data,age_group,commerce_insights,condition,currency,custom_data,custom_label_0,fb_product_category,expiration_date,errors,description,custom_number_4,custom_number_3,custom_number_2,custom_number_1,custom_number_0,custom_label_4,custom_label_3,custom_label_2,name,mobile_link,material,ordering_index,origin_country,parent_product_id,pattern,post_conversion_signal_based_enforcement_appeal_eligibility,product_catalog,product_feed,product_group,product_type,quantity_to_sell_on_facebook,retailer_id,retailer_product_group_id,review_rejection_reasons,review_status,price,marked_for_product_launch,manufacturer_part_number,manufacturer_info,inventory,invalidation_errors,importer_name,importer_address,images,image_url,image_fetch_status,image_cdn_urls,id,gtin,gender,custom_label_1,color,category_specific_fields,category,sale_price,sale_price_end_date,sale_price_start_date,shipping_weight_unit,shipping_weight_value,short_description,size,start_date,url,additional_image_cdn_urls,additional_image_urls,applinks,availability,brand,capability_to_review_status,visibility,wa_compliance_category,channels_to_integrity_status,product_sets&limit=10

Is there a specific field not available in the graphql explorer that I need to add? Or another endpoint to get last update time?

Thanks


问:
How to quick use of refresh button in SSMS 19
Is there a way to use this button quickly? Such as shortcut or command?


问:
is there IntelliJ extension guidelines? around navigations (ex. explorer, search, menu, etc) so that a custom extension can be discovered intuitively
There would be more than 10 different ways a developer can leverage a functionality on the IDE (explorer, menu, submenu, shortcut, search, etc)
is there any guidelines on IDE extensions such that custom extensions can follow? such that custom extension capabilities can be discovered and consumed easily.

tried with couple of navigational elements but i think i am missing larger context when designing the IDE navigational aspects


问:
How to download video file using axios
I have a download button on the client side and I want to download the video file when I click the button but when I downloaded it is not coming as an mp4 file.</p>
```<code><a id="a1" download="https://cocktail-user-videos.s3.amazonaws.com/058e132ae4e29abc5c75f11ebdeac3be8ac4de84dc8662544158647435781b23">download</a>
</code>```
```<code>const a1 = document.getElementById("a1");
const blob1 = new Blob(["download"], { type: "video/mp4"});
a1.href = URL.createObjectURL(blob1);
</code>```

Title: How to download video file using axios

Body:
I have a download button on the client side and I want to download the video file when I click the button but when I downloaded it is not coming as an mp4 file.

download

const a1 = document.getElementById("a1");
const blob1 = new Blob(["download"], { type: "video/mp4"});
a1.href = URL.createObjectURL(blob1);


问:
math_errhandling undeclared in C (Windows 10 OS)
I am trying to understand the inner workings of errno, and tried the following example file from cppreference, but got errors during compiling:

```<code>$ gcc errno_ex.c
errno_ex.c: In function 'main':
errno_ex.c:33:10: error: 'math_errhandling' undeclared (first use in this function)
     puts(math_errhandling & MATH_ERRNO ? "set" : "not set");
          ^~~~~~~~~~~~~~~~
errno_ex.c:33:10: note: each undeclared identifier is reported only once for each function it appears in
errno_ex.c:33:29: error: 'MATH_ERRNO' undeclared (first use in this function)
     puts(math_errhandling & MATH_ERRNO ? "set" : "not set");
                             ^~~~~~~~~~
</code>```

The (untouched) example code is:

```<code>#include <stdio.h>
#include <math.h>
#include <errno.h>

void show_errno(void)
{
    const char *err_info = "unknown error";
    switch (errno) {
    case EDOM:
        err_info = "domain error";
        break;
    case EILSEQ:
        err_info = "illegal sequence";
        break;
    case ERANGE:
        err_info = "pole or range error";
        break;
    case 0:
        err_info = "no error";
    }
    fputs(err_info, stdout);
    puts(" occurred");
}

int main(void)
{
    fputs("MATH_ERRNO is ", stdout);
    puts(math_errhandling & MATH_ERRNO ? "set" : "not set");

    errno = 0;
    1.0/0.0;
    show_errno();

    errno = 0;
    acos(+1.1);
    show_errno();

    errno = 0;
    log(0.0);
    show_errno();

    errno = 0;
    sin(0.0);
    show_errno();
}
</code>```

I am not sure what is happening. These errors happen when I compile in VS code in Windows ( C complier set to C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx86/x86/cl.exe by default, and using C17 standard).

When I try to duplicate this on my Macbook VS code, it compiled without error. So I am not sure where is the problem: is my compiler too old to recognize these macros?

Edit:
I think the macro definition of math_errhandling is platform-specific, thus not quite portable across different OS platforms. errno macro still works in my Windows-based VS Code IDE, which I am happy with. It is just that the math_errhandling thing is a bit non-portable and mysterious.

Body:
I am trying to understand the inner workings of errno, and tried the following example file from cppreference, but got errors during compiling:

$ gcc errno_ex.c
errno_ex.c: In function 'main':
errno_ex.c:33:10: error: 'math_errhandling' undeclared (first use in this function)
     puts(math_errhandling & MATH_ERRNO ? "set" : "not set");
          ^~~~~~~~~~~~~~~~
errno_ex.c:33:10: note: each undeclared identifier is reported only once for each function it appears in
errno_ex.c:33:29: error: 'MATH_ERRNO' undeclared (first use in this function)
     puts(math_errhandling & MATH_ERRNO ? "set" : "not set");
                             ^~~~~~~~~~

The (untouched) example code is:

#include <stdio.h>
#include <math.h>
#include <errno.h>

void show_errno(void)
{
    const char *err_info = "unknown error";
    switch (errno) {
    case EDOM:
        err_info = "domain error";
        break;
    case EILSEQ:
        err_info = "illegal sequence";
        break;
    case ERANGE:
        err_info = "pole or range error";
        break;
    case 0:
        err_info = "no error";
    }
    fputs(err_info, stdout);
    puts(" occurred");
}

int main(void)
{
    fputs("MATH_ERRNO is ", stdout);
    puts(math_errhandling & MATH_ERRNO ? "set" : "not set");

    errno = 0;
    1.0/0.0;
    show_errno();

    errno = 0;
    acos(+1.1);
    show_errno();

    errno = 0;
    log(0.0);
    show_errno();

    errno = 0;
    sin(0.0);
    show_errno();
}

I am not sure what is happening. These errors happen when I compile in VS code in Windows ( C complier set to C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx86/x86/cl.exe by default, and using C17 standard).

When I try to duplicate this on my Macbook VS code, it compiled without error. So I am not sure where is the problem: is my compiler too old to recognize these macros?

Edit:
I think the macro definition of math_errhandling is platform-specific, thus not quite portable across different OS platforms. errno macro still works in my Windows-based VS Code IDE, which I am happy with. It is just that the math_errhandling thing is a bit non-portable and mysterious.


问:
How to display MySQL data using tkinter in Python?
I am new to tkinter and trying to make an invoice application using this library. The app will read an Excel file using the Browse button and then save the Excel data into MySQL database which is working fine. However, when I press the Report button, it's not displaying the record on new window and getting halt all the time. Even a new window won't open, it should display the record on the current window. Here is my code:</p>
```<code># Import the required Libraries
from tkinter import *
from tkinter import ttk, filedialog
from tkinter.filedialog import askopenfilename
import mysql.connector
import xlrd

import tkinter as tk
from tkinter import filedialog

def browse_button():
    # Allow user to select a directory and store it in global var
    # called folder_path
    global folder_path
    filename = filedialog.askopenfilename()
    folder_path.set(filename)
    print(filename)

def show_new_window():
    print("Show new window called")
    # Create the new window
    new_window = tk.Toplevel(app)
    new_window.title("Report")

    # Create a label in the new window
    label = tk.Label(new_window, text="Delivery Report")
    label.pack()

    # Connect to the database
    conn = mysql.connector.connect(user='root',
                                password='',
                                host='localhost',
                                database='magnetico')

    mycursor = conn.cursor()
    mycursor.execute("SELECT id_user, Vendor, KM FROM perorder")
    # Get the results
    result = mycursor.fetchall()

    # Close the cursor and connection
    mycursor.close()
    conn.close()

    # Create a button for each row in the result
    for row in result:
        button = tk.Button(new_window, text=str(row))
        button.pack()

# Set the geometry of tkinter frame
app = tk.Tk()
app.geometry("900x800")

folder_path = tk.StringVar()

# Add a heading
heading = tk.Label(app, text="Click the Button to browse the Files", font=("Helvetica", 16))
heading.grid(row=0, column=1, columnspan=2)

lbl1 = tk.Label(app, textvariable=folder_path)
lbl1.grid(row=1, column=1, padx=10, pady=10, sticky=tk.NSEW)

# Center the button
button2 = tk.Button(app, text="Browse", command=browse_button)
button2.grid(row=1, column=2, padx=10, pady=10, sticky=tk.NSEW)

button = tk.Button(app, text="Report", command=show_new_window)
button.grid(row=2, column=2, padx=10, pady=10, sticky=tk.NSEW)

# Set the row and column weights
app.columnconfigure(1, weight=1)
app.columnconfigure(2, weight=1)
app.rowconfigure(1, weight=1)

app.mainloop()

# Connect to the database
conn = mysql.connector.connect(user='root',
                               password='',
                               host='localhost',
                               database='magnetico')

# Open the workbook
book = xlrd.open_workbook("mpo1.xls")

# Get the sheet you want
sheet = book.sheet_by_name("Order Details")

# Iterate through the rows of the sheet
for row_idx in range(sheet.nrows):
    # Get the values in the row
    row = sheet.row_values(row_idx)
    # Insert the row into the database
    cursor = conn.cursor()
    cursor.execute("INSERT INTO perorder (mp_task_nr, batch_id, dropoff_sequence, id_user_payout_type, task_status, city, fleet, id_user, Name, Vendor, order_date, UID, KM, total_amount, Remarks) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", row)
    conn.commit()
</code>```

Body:
I am new to tkinter and trying to make an invoice application using this library. The app will read an Excel file using the Browse button and then save the Excel data into MySQL database which is working fine. However, when I press the Report button, it's not displaying the record on new window and getting halt all the time. Even a new window won't open, it should display the record on the current window. Here is my code:

# Import the required Libraries
from tkinter import *
from tkinter import ttk, filedialog
from tkinter.filedialog import askopenfilename
import mysql.connector
import xlrd

import tkinter as tk
from tkinter import filedialog

def browse_button():
    # Allow user to select a directory and store it in global var
    # called folder_path
    global folder_path
    filename = filedialog.askopenfilename()
    folder_path.set(filename)
    print(filename)

def show_new_window():
    print("Show new window called")
    # Create the new window
    new_window = tk.Toplevel(app)
    new_window.title("Report")

    # Create a label in the new window
    label = tk.Label(new_window, text="Delivery Report")
    label.pack()

    # Connect to the database
    conn = mysql.connector.connect(user='root',
                                password='',
                                host='localhost',
                                database='magnetico')

    mycursor = conn.cursor()
    mycursor.execute("SELECT id_user, Vendor, KM FROM perorder")
    # Get the results
    result = mycursor.fetchall()

    # Close the cursor and connection
    mycursor.close()
    conn.close()

    # Create a button for each row in the result
    for row in result:
        button = tk.Button(new_window, text=str(row))
        button.pack()

# Set the geometry of tkinter frame
app = tk.Tk()
app.geometry("900x800")

folder_path = tk.StringVar()

# Add a heading
heading = tk.Label(app, text="Click the Button to browse the Files", font=("Helvetica", 16))
heading.grid(row=0, column=1, columnspan=2)

lbl1 = tk.Label(app, textvariable=folder_path)
lbl1.grid(row=1, column=1, padx=10, pady=10, sticky=tk.NSEW)

# Center the button
button2 = tk.Button(app, text="Browse", command=browse_button)
button2.grid(row=1, column=2, padx=10, pady=10, sticky=tk.NSEW)

button = tk.Button(app, text="Report", command=show_new_window)
button.grid(row=2, column=2, padx=10, pady=10, sticky=tk.NSEW)

# Set the row and column weights
app.columnconfigure(1, weight=1)
app.columnconfigure(2, weight=1)
app.rowconfigure(1, weight=1)

app.mainloop()

# Connect to the database
conn = mysql.connector.connect(user='root',
                               password='',
                               host='localhost',
                               database='magnetico')

# Open the workbook
book = xlrd.open_workbook("mpo1.xls")

# Get the sheet you want
sheet = book.sheet_by_name("Order Details")

# Iterate through the rows of the sheet
for row_idx in range(sheet.nrows):
    # Get the values in the row
    row = sheet.row_values(row_idx)
    # Insert the row into the database
    cursor = conn.cursor()
    cursor.execute("INSERT INTO perorder (mp_task_nr, batch_id, dropoff_sequence, id_user_payout_type, task_status, city, fleet, id_user, Name, Vendor, order_date, UID, KM, total_amount, Remarks) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", row)
    conn.commit()


问:
Make addEventListener to take a global variable
I have this script

```<code>var x = 0;

document.addEventListener('DOMContentLoaded', function() {

  const button = document.getElementById('my-button')
  button.addEventListener('click', () => myFunction(x));

});

function myFunction(x) {
  console.log(x)
  x++
}
</code>```

I need that when I click the button, myFunction receives the current value of x and not the value that was assigned when the function was added (0 in this case), the thing is that I have another function that is constantly updating the value of x, but if console.log the value of x within myFunction I always get 0. Probably there is a straightforward solution but I'm really struggling with this and my skills with JS are very limited.

Body:
I have this script

var x = 0;

document.addEventListener('DOMContentLoaded', function() {

  const button = document.getElementById('my-button')
  button.addEventListener('click', () => myFunction(x));

});

function myFunction(x) {
  console.log(x)
  x++
}

I need that when I click the button, myFunction receives the current value of x and not the value that was assigned when the function was added (0 in this case), the thing is that I have another function that is constantly updating the value of x, but if console.log the value of x within myFunction I always get 0. Probably there is a straightforward solution but I'm really struggling with this and my skills with JS are very limited.


问:
UITextView within custom table view cell responds to some messages, not others
I have a custom subclass of UITableViewCell that, in its initializer, loads a nib with itself as the File's Owner, and has outlets to the nib's objects (one of which is a UITextView). But when I set the following property, it doesn't seem to be receiving the message because the textView is still editable at runtime.

self.textView.isEditable = false

However, it does seem to be receiving other messages. In a subclass I set the attributed text for the textView and here I set the tintColor, both of which affect the behavior. I have attached the subclass and the nib below.

```<code>class BannerCell: UITableViewCell, NonHighlightableCell, UITextViewDelegate {

    @IBOutlet var view: UIView!
    @IBOutlet var closeButton: UIButton!
    @IBOutlet var textView: UITextView!
    var delegate: BannerCellDelegate!
    var destination: BannerCell.Destination?

    // Paragraph styling
    // I'm assuming this will be the same for all banners in our new design system, but if not we can change to an instance variable
    static var paragraphAttributes: [NSAttributedString.Key: Any] {
        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.lineHeightMultiple = 1.5
        return [
            .foregroundColor: UIColor.black,
            .font: UIFont(name: "Proxima Nova", size: 16.0)!,
            .paragraphStyle: paragraphStyle
        ]
    }

    // Link text styling
    // Same assumption as above
    static let linkTextAttributes: [NSAttributedString.Key: Any] = [
        .underlineStyle: NSUnderlineStyle.single.rawValue,
        .foregroundColor: BSCConstants.bscLinkColor()!,
        .link: "https://www.dummy.com" // This is a dummy URL - it just makes the link text tappable. The action itself is handled by the UITextViewDelegate method textView(_:shouldInteractWith:in:interaction:)
    ]

    //MARK: Initializers

    //Designated Initializer
    required init(delegate: BannerCellDelegate, style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)

        //Set the delegate for this banner
        self.delegate = delegate

        // Instantiate Nib
        let nib = UINib(nibName: "BannerCell", bundle: Bundle.main)

        // Load outlets to self
        nib.instantiate(withOwner: self, options: nil)

        // Add view (from Nib) as subview of self's contentView
        self.contentView.addSubview(self.view)

        // Disable auto-resizing
        self.view.translatesAutoresizingMaskIntoConstraints = false

        // Set constraints within cell's contentView
        self.view.topAnchor.constraint(equalTo: self.contentView.topAnchor).isActive = true
        self.view.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor).isActive = true
        self.view.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor).isActive = true
        self.view.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor).isActive = true

        // Sets the textView delegate
        self.textView.delegate = self

        // Allows the link to be tapped, configures appearance
        self.textView.isEditable = false
        self.textView.isSelectable = false
        self.textView.isScrollEnabled = false
        self.textView.tintColor = UIColor.clear

        // Removes default padding and sets text container inset
        self.textView.textContainer.lineFragmentPadding = 0.0
        self.textView.textContainerInset = UIEdgeInsets(top: -4.0, left: 0, bottom: 4, right: 0)

        // Removes highlight when cell is selected
        noSelectionStyle()

        // Accessibility traits
        self.closeButton.accessibilityIdentifier = "closeButton"
        self.closeButton.accessibilityLabel = "Close"

    }

    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }

    //MARK: Actions

    @IBAction func closeButtonPressed(_ sender: UIButton) {
        self.delegate.dismissBanner(self.tag)
    }

    //MARK: NonHighlightableCell

    func noSelectionStyle() {
        self.selectionStyle = .none
    }

    //MARK: UITextViewDelegate

    override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
        return false
    }

    func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
        guard let destination = self.destination else { return false }
        self.delegate.navigateTo(destination: destination)
        return false
    }

}
</code>```

nib file

At first I thought this could be an issue with the UIResponder chain, but I checked the view hierarchy debugger and everything seems to be in the right order (with the nib's view being nested within the cell's contentView). I suppose it still could be but I can't seem to find anyone else with this same issue. I saw someone with a similar issue (but not the same one) mention that setting UITableViewCell.isUserInteractionEnabled to false worked for them, but for me it simply disabled all user interaction within the cell, which is not what I want (I have a button and a link in there).

I'm anticipating being asked why I need this design of loading the nib to self and configuring the outlets within self as opposed to setting file's owner to some retaining class (the view controller I suppose) and configuring this object there instead. Well, there is never going to be more than one instance of this cell. So it doesn't need to be configured by some datasource or anything.

Anyways, any guidance would be much appreciated.

UPDATE:

I tried a different design where I set the File's Owner to be the view controller with the table view, not the cell subclass itself. I put the initialization code in awakeFromNib() but it still didn't receive the message with regards to the property above. Then, I set the property in tableview(_:cellForRowAt:) and it worked. Now my question becomes: Why does it only work when you set this property there and not any of the other places I've tried?

Body:
I have a custom subclass of UITableViewCell that, in its initializer, loads a nib with itself as the File's Owner, and has outlets to the nib's objects (one of which is a UITextView). But when I set the following property, it doesn't seem to be receiving the message because the textView is still editable at runtime.

self.textView.isEditable = false

However, it does seem to be receiving other messages. In a subclass I set the attributed text for the textView and here I set the tintColor, both of which affect the behavior. I have attached the subclass and the nib below.

class BannerCell: UITableViewCell, NonHighlightableCell, UITextViewDelegate {

    @IBOutlet var view: UIView!
    @IBOutlet var closeButton: UIButton!
    @IBOutlet var textView: UITextView!
    var delegate: BannerCellDelegate!
    var destination: BannerCell.Destination?

    // Paragraph styling
    // I'm assuming this will be the same for all banners in our new design system, but if not we can change to an instance variable
    static var paragraphAttributes: [NSAttributedString.Key: Any] {
        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.lineHeightMultiple = 1.5
        return [
            .foregroundColor: UIColor.black,
            .font: UIFont(name: "Proxima Nova", size: 16.0)!,
            .paragraphStyle: paragraphStyle
        ]
    }

    // Link text styling
    // Same assumption as above
    static let linkTextAttributes: [NSAttributedString.Key: Any] = [
        .underlineStyle: NSUnderlineStyle.single.rawValue,
        .foregroundColor: BSCConstants.bscLinkColor()!,
        .link: "https://www.dummy.com" // This is a dummy URL - it just makes the link text tappable. The action itself is handled by the UITextViewDelegate method textView(_:shouldInteractWith:in:interaction:)
    ]

    //MARK: Initializers

    //Designated Initializer
    required init(delegate: BannerCellDelegate, style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)

        //Set the delegate for this banner
        self.delegate = delegate

        // Instantiate Nib
        let nib = UINib(nibName: "BannerCell", bundle: Bundle.main)

        // Load outlets to self
        nib.instantiate(withOwner: self, options: nil)

        // Add view (from Nib) as subview of self's contentView
        self.contentView.addSubview(self.view)

        // Disable auto-resizing
        self.view.translatesAutoresizingMaskIntoConstraints = false

        // Set constraints within cell's contentView
        self.view.topAnchor.constraint(equalTo: self.contentView.topAnchor).isActive = true
        self.view.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor).isActive = true
        self.view.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor).isActive = true
        self.view.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor).isActive = true

        // Sets the textView delegate
        self.textView.delegate = self

        // Allows the link to be tapped, configures appearance
        self.textView.isEditable = false
        self.textView.isSelectable = false
        self.textView.isScrollEnabled = false
        self.textView.tintColor = UIColor.clear

        // Removes default padding and sets text container inset
        self.textView.textContainer.lineFragmentPadding = 0.0
        self.textView.textContainerInset = UIEdgeInsets(top: -4.0, left: 0, bottom: 4, right: 0)

        // Removes highlight when cell is selected
        noSelectionStyle()

        // Accessibility traits
        self.closeButton.accessibilityIdentifier = "closeButton"
        self.closeButton.accessibilityLabel = "Close"

    }

    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }

    //MARK: Actions

    @IBAction func closeButtonPressed(_ sender: UIButton) {
        self.delegate.dismissBanner(self.tag)
    }

    //MARK: NonHighlightableCell

    func noSelectionStyle() {
        self.selectionStyle = .none
    }

    //MARK: UITextViewDelegate

    override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
        return false
    }

    func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
        guard let destination = self.destination else { return false }
        self.delegate.navigateTo(destination: destination)
        return false
    }

}

nib file

At first I thought this could be an issue with the UIResponder chain, but I checked the view hierarchy debugger and everything seems to be in the right order (with the nib's view being nested within the cell's contentView). I suppose it still could be but I can't seem to find anyone else with this same issue. I saw someone with a similar issue (but not the same one) mention that setting UITableViewCell.isUserInteractionEnabled to false worked for them, but for me it simply disabled all user interaction within the cell, which is not what I want (I have a button and a link in there).

I'm anticipating being asked why I need this design of loading the nib to self and configuring the outlets within self as opposed to setting file's owner to some retaining class (the view controller I suppose) and configuring this object there instead. Well, there is never going to be more than one instance of this cell. So it doesn't need to be configured by some datasource or anything.

Anyways, any guidance would be much appreciated.

UPDATE:

I tried a different design where I set the File's Owner to be the view controller with the table view, not the cell subclass itself. I put the initialization code in awakeFromNib() but it still didn't receive the message with regards to the property above. Then, I set the property in tableview(_:cellForRowAt:) and it worked. Now my question becomes: Why does it only work when you set this property there and not any of the other places I've tried?


问:
Python Selenium Framework - How to click all the buttons associated with a row in a table
Consider the following table:

```<code><tr class="company-table-row" data-id="jimmy@company.com">
    <td class="table-body-cell-email">
        <span class="table-body__cell-content">jimmy@company.com</span>
    </td>
    <td class="table-body-cell-ssh-actions" width="280">
        <div class="bumper" style="padding: 16px;">
            <button type="button" class="ant-btn ant-btn-default ant-btn-sm company-dialog-button test__upload-ssh-key-button">
                <span>Upload</span>
            </button>
            <button type="button" class="ant-btn ant-btn-default ant-btn-sm company-dialog-button view-ssh-key-button">
                <span>View</span>
            </button>
            <button type="button" class="ant-btn ant-btn-primary ant-btn-sm ant-btn-dangerous company-confirm-button company-delete-button">
                <span>Delete</span>
            </button>
        </div>
    </td>
    <td class="table-body-cell-reset-pass" width="130">
        <button type="button" class="ant-btn ant-btn-default ant-btn-sm company-confirm-button company-reset-password-button">
            <span>Reset password</span>
        </button>
    </td>
    <td class="table-body-cell-actions" width="100">
        <button type="button" class="ant-btn ant-btn-primary ant-btn-sm ant-btn-dangerous company-confirm-button company-delete-button">
            <span>Delete</span>
        </button>
    </td>
</tr>
</code>```

The table has four columns with Headings of Email, SSH keys, Password and Actions.
A single record has an email address in the Email column.
Three buttons in the SSH keys column: 'Upload', 'View' and 'Delete'.
One button in the Password Column: 'Reset password'.
One button in the Actions Column: 'Delete'.

I need to click each of the buttons in this single row to test that they are working. The position of this record in the table is unpredictable but is supposedly easily found searching for text or possibly by data-id.

I was successful in finding the first two buttons, 'Upload' and 'View' via XPath with the following:

```<code>uploadButton = "//tr[.//span[text()='jimmy@company.com']]//span[contains(.,'Upload')]"

viewButton = "//tr[.//span[text()='jimmy@company.com']]//span[contains(.,'View')]"
</code>```

I ran into trouble when I realized that there are two 'Delete' buttons and differentiating them with my current selection method won't work. The button types are identical as well as the button text.
What is a better way to click all of the buttons associated with this single record?

This is how I am executing the button click:

```<code>from selenium import webdriver
driver = webdriver.Chrome()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, viewButton))).click()
</code>```

Thanks!

Body:
Consider the following table:

        jimmy@company.com

            <button type="button" class="ant-btn ant-btn-default ant-btn-sm company-dialog-button test__upload-ssh-key-button">
                Upload
            </button>
            <button type="button" class="ant-btn ant-btn-default ant-btn-sm company-dialog-button view-ssh-key-button">
                View
            </button>
            <button type="button" class="ant-btn ant-btn-primary ant-btn-sm ant-btn-dangerous company-confirm-button company-delete-button">
                Delete
            </button>

        <button type="button" class="ant-btn ant-btn-default ant-btn-sm company-confirm-button company-reset-password-button">
            Reset password
        </button>

        <button type="button" class="ant-btn ant-btn-primary ant-btn-sm ant-btn-dangerous company-confirm-button company-delete-button">
            Delete
        </button>

The table has four columns with Headings of Email, SSH keys, Password and Actions.
A single record has an email address in the Email column.
Three buttons in the SSH keys column: 'Upload', 'View' and 'Delete'.
One button in the Password Column: 'Reset password'.
One button in the Actions Column: 'Delete'.

I need to click each of the buttons in this single row to test that they are working. The position of this record in the table is unpredictable but is supposedly easily found searching for text or possibly by data-id.

I was successful in finding the first two buttons, 'Upload' and 'View' via XPath with the following:

uploadButton = "//tr[.//span[text()='jimmy@company.com']]//span[contains(.,'Upload')]"

viewButton = "//tr[.//span[text()='jimmy@company.com']]//span[contains(.,'View')]"

I ran into trouble when I realized that there are two 'Delete' buttons and differentiating them with my current selection method won't work. The button types are identical as well as the button text.
What is a better way to click all of the buttons associated with this single record?

This is how I am executing the button click:

from selenium import webdriver
driver = webdriver.Chrome()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, viewButton))).click()

Thanks!


问:
Undefined is not a function (react-native-cli)
I have a problem where I wanted to add a stack screen as a login page in app.js. However, the problem pops up like this screenshot. The tab view works well, but when I change it with stackScreen, it shows the problem.

What can be a solution?


问:
Extracting substring in python dataframe
I am working on a project that requires using machine learning to extract text from an article column, to categories possible areas the subjects might fall into

Input data frame:

The following rules are to be applied to produce the output:

Expected output:


问:
Mocking nested Unirest requests in Java
We use Junit5, but I need to mock Unirest calls. The examples found show:

```<code>@Before
public void setup() {
    PowerMockito.mockStatic(Unirest.class);
}
</code>```

However PowerMockito only supports Junit4.

Does anyone know of any alternatives?

Title: Mocking nested Unirest requests in Java

Body:
We use Junit5, but I need to mock Unirest calls. The examples found show:

@Before
public void setup() {
    PowerMockito.mockStatic(Unirest.class);
}

However PowerMockito only supports Junit4.

Does anyone know of any alternatives?


问:
How to export Oracle Apex Application dynamically?
I'm trying to export an Oracle Apex app

```<code>    variable AppId number
    begin
        select application_id into :AppId FROM apex_applications where alias = 'SOMEALIAS';
    end;
    /

    print AppId

    apex export -applicationid AppId;
</code>```

This script shows a valid app id in the line print AppId however the export statement returns the following error :

```<code>    Invalid Workspace ID null
</code>```

If I do manually :

```<code>    apex export -applicationid 1116;
</code>```

It works.

How can I solve that?

Body:
I'm trying to export an Oracle Apex app

    variable AppId number
    begin
        select application_id into :AppId FROM apex_applications where alias = 'SOMEALIAS';
    end;
    /

    print AppId

    apex export -applicationid AppId;

This script shows a valid app id in the line print AppId however the export statement returns the following error :

    Invalid Workspace ID null

If I do manually :

    apex export -applicationid 1116;

It works.

How can I solve that?


问:
Why bucket policy is used?
I have a question about s3 bucket access, it's so complecated for me.

my configuration for s3 bucket is "public access is denied"

when I don't specify any policy in s3 bucket policy and give a user predefined S3 readonly permission, I can bring list of buckets and list of object in buckets.

But when I only make bucket policy for the user who has no iam policy attached to list buckets and object. the user are not able to list buckets and objects.

If it is true, why bucket policy is necessary to use?

bucket policy I made is like this.

```<code>{
    "Version": "2012-10-17",
    "Id": "Policy1672363253371",
    "Statement": [
        {
            "Sid": "Stmt16",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::2040:user/viewer"
            },
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::test-bucket"
        }
        {
            "Sid": "Stmt17",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::2040:user/viewer"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::test-bucket/*"
        }
    ]
}
</code>```

Title: Why bucket policy is used?

Body:
I have a question about s3 bucket access, it's so complecated for me.

my configuration for s3 bucket is "public access is denied"

when I don't specify any policy in s3 bucket policy and give a user predefined S3 readonly permission, I can bring list of buckets and list of object in buckets.

But when I only make bucket policy for the user who has no iam policy attached to list buckets and object. the user are not able to list buckets and objects.

If it is true, why bucket policy is necessary to use?

bucket policy I made is like this.

{
    "Version": "2012-10-17",
    "Id": "Policy1672363253371",
    "Statement": [
        {
            "Sid": "Stmt16",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::2040:user/viewer"
            },
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::test-bucket"
        }
        {
            "Sid": "Stmt17",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::2040:user/viewer"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::test-bucket/*"
        }
    ]
}


问:
'SizedImageInstance' object has no attribute 'open'
I'm attempting to open a thumbnail of an image that was saved with django-versatileimagefield

https://django-versatileimagefield.readthedocs.io/en/latest/

```<code>file = instance.image.thumbnail['1920x1080'].open(mode='rb')
</code>```

I'm getting the following error:

```<code>'SizedImageInstance' object has no attribute 'open'
</code>```

I have success with the following line of code, but I want to open the smaller version as opposed to the original version

```<code>file = instance.image.open(mode='rb')
</code>```

If it helps, the url of the image is instance.image.thumbnail['1920x1080'].url

Thanks!

Body:
I'm attempting to open a thumbnail of an image that was saved with django-versatileimagefield

https://django-versatileimagefield.readthedocs.io/en/latest/

file = instance.image.thumbnail['1920x1080'].open(mode='rb')

I'm getting the following error:

'SizedImageInstance' object has no attribute 'open'

I have success with the following line of code, but I want to open the smaller version as opposed to the original version

file = instance.image.open(mode='rb')

If it helps, the url of the image is instance.image.thumbnail['1920x1080'].url

Thanks!


问:
Python output insists I need "tkinter", yet none of the modules I have called use it
Being very new to Python, any help at all is greatly appreciated.

I'm trying to make a spammer thing to mess with my friends, and the output keeps insisting that I need "tkinter".

The modules that I'm using are pyautogui, time, and subprocess and some Googling has told me that none of those have to use tkinter for anything.

When I try to actually install tkinter it won't install (apt-get or pacman) What can I do?

Here is my code:

```<code>import pyautogui
import time
import subprocess

def sendNotif(title, message):
    subprocess.run(['notify-send', title, message])

message = input("Enter message (leave blank to paste clipboard")
repeats = int(input("Number of times to send the message:"))
delay = int(input("Number of ms between each message (seconds x 1000): "))
isLoaded = input("Open your messaging application and press Enter when it's ready")

print("You have 5 seconds to refocus the message entering area of your chat application.")
time.sleep(5)

for i in range(0,repeats):
    if message != "":
        pyautogui.typewrite(message)
        pyautogui.press("enter")
    else:
        pyautogui.hotkey('ctrl', 'v')
        pyautogui.press("enter")

    time.sleep(delay/1000)

sendNotif('Finished Sending Flood', 'Now we play the waiting game......')
print("Done")
</code>```

Body:
Being very new to Python, any help at all is greatly appreciated.

I'm trying to make a spammer thing to mess with my friends, and the output keeps insisting that I need "tkinter".

The modules that I'm using are pyautogui, time, and subprocess and some Googling has told me that none of those have to use tkinter for anything.

When I try to actually install tkinter it won't install (apt-get or pacman) What can I do?

Here is my code:

import pyautogui
import time
import subprocess

def sendNotif(title, message):
    subprocess.run(['notify-send', title, message])

message = input("Enter message (leave blank to paste clipboard")
repeats = int(input("Number of times to send the message:"))
delay = int(input("Number of ms between each message (seconds x 1000): "))
isLoaded = input("Open your messaging application and press Enter when it's ready")

print("You have 5 seconds to refocus the message entering area of your chat application.")
time.sleep(5)

for i in range(0,repeats):
    if message != "":
        pyautogui.typewrite(message)
        pyautogui.press("enter")
    else:
        pyautogui.hotkey('ctrl', 'v')
        pyautogui.press("enter")

    time.sleep(delay/1000)

sendNotif('Finished Sending Flood', 'Now we play the waiting game......')
print("Done")


问:
How to hide the navigation tab bar on a specific screen in react-navigation
I have succeeded in hiding the navigation tab bar on certain screens.

```<code>useLayoutEffect(() => {
    const routeName = getFocusedRouteNameFromRoute(route);
    if (routeName === 'memberModify') {
      navigation.setOptions({
        tabBarStyle: {display: 'none'},
      });
    }

    return () => {
      navigation.setOptions({tabBarStyle: {display: 'flex'}});
    };
  }, [navigation, route]);
</code>```

However, there is a delay when the tab bar is drawn when returning to the home screen.

mypage(tabBarStyle:{display:'flex'}) -> mypageDetail(tabBarStyle:{display:'none'}) -> mypage(tabBarStyle:{display:'flex'}) <= A tab bar will appear after about a second.

Great developers around the world would appreciate it if you could help a novice developer in Korea.

This is my app stack structure.

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Body:
I have succeeded in hiding the navigation tab bar on certain screens.

useLayoutEffect(() => {
    const routeName = getFocusedRouteNameFromRoute(route);
    if (routeName === 'memberModify') {
      navigation.setOptions({
        tabBarStyle: {display: 'none'},
      });
    }

    return () => {
      navigation.setOptions({tabBarStyle: {display: 'flex'}});
    };
  }, [navigation, route]);

However, there is a delay when the tab bar is drawn when returning to the home screen.

mypage(tabBarStyle:{display:'flex'}) -> mypageDetail(tabBarStyle:{display:'none'}) -> mypage(tabBarStyle:{display:'flex'}) <= A tab bar will appear after about a second.

Great developers around the world would appreciate it if you could help a novice developer in Korea.

This is my app stack structure.

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens

Tab
-Stack
-screens


问:
How to add days to string formatted date in javascript
I have date in this format below.

2022-12-30 (string format)

I need to add days to the date. For example, if I add 1, the output should be 2022-12-31. And if I add 3, the output should be 2023-01-02.
Is there any functions/algorithm in javascript that helps resolve this question?

Thanks


问:
Issue creating Docker image - error /node_modules/dotenv-checker: Command failed
I am getting the following error when building a docker image for nodejs project

```<code>\#11 160.7 \[5/5\] Building fresh packages...
\#11 162.5 error /node_modules/dotenv-checker: Command failed.
\#11 162.5 Exit code: 1
\#11 162.5 Command: node ./src/scripts/add-script-to-package.js
\#11 162.5 Arguments:
\#11 162.5 Directory: /node_modules/dotenv-checker
\#11 162.5 Output:
\#11 162.5 internal/modules/cjs/loader.js:905
\#11 162.5   throw err;
\#11 162.5   ^
\#11 162.5
\#11 162.5 Error: Cannot find module 'package.json'
\#11 162.5 Require stack:
\#11 162.5 - /node_modules/dotenv-checker/src/scripts/add-script-to-package.js
\#11 162.5     at Function.Module.\_resolveFilename (internal/modules/cjs/loader.js:902:15)
\#11 162.5     at Function.Module.\_load (internal/modules/cjs/loader.js:746:27)
\#11 162.5     at Module.require (internal/modules/cjs/loader.js:974:19)
\#11 162.5     at require (internal/modules/cjs/helpers.js:101:18)
\#11 162.5     at Object.\<anonymous\> (/node_modules/dotenv-checker/src/scripts/add-script-to-package.js:23:21)
\#11 162.5     at Module.\_compile (internal/modules/cjs/loader.js:1085:14)
\#11 162.5     at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
\#11 162.5     at Module.load (internal/modules/cjs/loader.js:950:32)
\#11 162.5     at Function.Module.\_load (internal/modules/cjs/loader.js:790:12)
\#11 162.5     at Function.executeUserEntryPoint \[as runMain\] (internal/modules/run_main.js:75:12) {
\#11 162.5   code: 'MODULE_NOT_FOUND',
\#11 162.5   requireStack: \[
\#11 162.5     '/node_modules/dotenv-checker/src/scripts/add-script-to-package.js'
\#11 162.5   \]
\#11 162.5 }
</code>```

dockerfile

```<code>FROM node:14 as builder

COPY ./package.json ./yarn.lock ./turbo.json ./

RUN yarn install
</code>```

It is throwing the above error at yarn install

Does it have anything to do with node version? my project has dependency on node 14 so can't use 16.

Please let me know if I am missing anything or if I need to try anything specific.

Thank you

Body:
I am getting the following error when building a docker image for nodejs project

\#11 160.7 \[5/5\] Building fresh packages...
\#11 162.5 error /node_modules/dotenv-checker: Command failed.
\#11 162.5 Exit code: 1
\#11 162.5 Command: node ./src/scripts/add-script-to-package.js
\#11 162.5 Arguments:
\#11 162.5 Directory: /node_modules/dotenv-checker
\#11 162.5 Output:
\#11 162.5 internal/modules/cjs/loader.js:905
\#11 162.5   throw err;
\#11 162.5   ^
\#11 162.5
\#11 162.5 Error: Cannot find module 'package.json'
\#11 162.5 Require stack:
\#11 162.5 - /node_modules/dotenv-checker/src/scripts/add-script-to-package.js
\#11 162.5     at Function.Module.\_resolveFilename (internal/modules/cjs/loader.js:902:15)
\#11 162.5     at Function.Module.\_load (internal/modules/cjs/loader.js:746:27)
\#11 162.5     at Module.require (internal/modules/cjs/loader.js:974:19)
\#11 162.5     at require (internal/modules/cjs/helpers.js:101:18)
\#11 162.5     at Object.\<anonymous\> (/node_modules/dotenv-checker/src/scripts/add-script-to-package.js:23:21)
\#11 162.5     at Module.\_compile (internal/modules/cjs/loader.js:1085:14)
\#11 162.5     at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
\#11 162.5     at Module.load (internal/modules/cjs/loader.js:950:32)
\#11 162.5     at Function.Module.\_load (internal/modules/cjs/loader.js:790:12)
\#11 162.5     at Function.executeUserEntryPoint \[as runMain\] (internal/modules/run_main.js:75:12) {
\#11 162.5   code: 'MODULE_NOT_FOUND',
\#11 162.5   requireStack: \[
\#11 162.5     '/node_modules/dotenv-checker/src/scripts/add-script-to-package.js'
\#11 162.5   \]
\#11 162.5 }

dockerfile

FROM node:14 as builder

COPY ./package.json ./yarn.lock ./turbo.json ./

RUN yarn install

It is throwing the above error at yarn install

Does it have anything to do with node version? my project has dependency on node 14 so can't use 16.

Please let me know if I am missing anything or if I need to try anything specific.

Thank you