问:
Style a v-autocomplete dropdown [vuetify]
I have a dropdown menu that I would like to style.
When it's up, the dropdown looks like this.

And when it's down, it looks like this.

This yellow border is just a border-bottom style that I added to the dropdown component. The big problem is that, depending on where the user is on the page, the dropdown may appear on top of the input, in the middle or below it (as it always should).
So this is what it looks like when the user clicks on the input when it's not on the "right position".

As you can see, it just looks ridiculous.. What I'd like is a way to change the input's border-bottom: I'd like it light-grey when the dropdown is up and yellow when it's down.
Does anyone know how to do this ? I already tried using this link : https://vuetifyjs.com/en/components/selects/#icons
But it turns out the v-select component doesn't work with the "Select All" feature (that I really need).
Here's what my code looks like :

```<code><!-- CATEGORY -->
  <template>
    <v-autocomplete
      loading="true"
      :menu-props="{ maxWidth: 313}"
      v-model="valuesType"
      :items="typeArray"
      label="Category"
      :search-input.sync="searchType"
      filled
      append-icon="mdi-chevron-down"
      clear-icon="mdi-close-circle"
      background-color=#313131
      clearable
      multiple
      :item-color="yellow"
      item-text="color:var(--yellow)"
      color="var(--yellow)"
    >
      <template v-slot:prepend-item>
        <v-list-item
          ripple
          @mousedown.prevent
          @click="toggleType"
          height="48px"
        >
          <v-list-item-action>
            <v-icon :color="valuesType.length > 0 ? 'var(--yellow)' : ''">
              {{ iconType }}
            </v-icon>
          </v-list-item-action>
          <v-list-item-content>
            <v-list-item-title>
              Select All
            </v-list-item-title>
          </v-list-item-content>
        </v-list-item>
        <v-divider></v-divider>
      </template>
      <template v-slot:selection="{ item, index }">
        <div v-if="valuesType.length === 1">
          <span v-if="index === 0 && valuesType[0].length > 16">{{ valuesType[0].slice(0,16) }}...  </span>
          <span v-if="index === 0 && valuesType[0].length <= 16">{{ valuesType[0] }},  </span>
        </div>
        <div v-if="valuesType.length === 2 ">
            <span v-if="index === 0 && valuesType[0].length <= 8">{{ valuesType[0] }},  </span>
            <span v-if="index === 0 && valuesType[0].length > 8">{{ valuesType[0].slice(0,8) }}...  </span>
            <span v-if="index === 1  && valuesType[1].length <= 8">{{ valuesType[1] }},  </span>
            <!--<span v-if="index === 1 && valuesType[1].length > 8">{{ valuesType[1].slice(0,8) }}... </span>-->
            <span v-if="index === 1 && valuesType[1].length > 8"
                  class="grey--text text-caption spanFilters"
            >
              +1 other
            </span>
        </div>
        <div v-if="valuesType.length > 2">
          <span v-if="index === 0 && valuesType[0].length <= 10">{{ valuesType[0].slice(0,10) }} </span>
          <span v-if="index === 0 && valuesType[0].length > 10">{{ valuesType[0].slice(0,8) }}... </span>
          <span
            v-if="index === 1"
            class="grey--text text-caption spanFilters"
          >
           +{{ valuesType.length - 1 }} other(s)
          </span>
        </div>
      </template>
    </v-autocomplete>
  </template>
</code>```

Any suggestion or help would be appreciated ! :)

Body:
I have a dropdown menu that I would like to style.
When it's up, the dropdown looks like this.

And when it's down, it looks like this.

This yellow border is just a border-bottom style that I added to the dropdown component. The big problem is that, depending on where the user is on the page, the dropdown may appear on top of the input, in the middle or below it (as it always should).
So this is what it looks like when the user clicks on the input when it's not on the "right position".

As you can see, it just looks ridiculous.. What I'd like is a way to change the input's border-bottom: I'd like it light-grey when the dropdown is up and yellow when it's down.
Does anyone know how to do this ? I already tried using this link : https://vuetifyjs.com/en/components/selects/#icons
But it turns out the v-select component doesn't work with the "Select All" feature (that I really need).
Here's what my code looks like :

  <template>
    <v-autocomplete
      loading="true"
      :menu-props="{ maxWidth: 313}"
      v-model="valuesType"
      :items="typeArray"
      label="Category"
      :search-input.sync="searchType"
      filled
      append-icon="mdi-chevron-down"
      clear-icon="mdi-close-circle"
      background-color=#313131
      clearable
      multiple
      :item-color="yellow"
      item-text="color:var(--yellow)"
      color="var(--yellow)"
    >
      <template v-slot:prepend-item>
        <v-list-item
          ripple
          @mousedown.prevent
          @click="toggleType"
          height="48px"
        >
          <v-list-item-action>
            <v-icon :color="valuesType.length > 0 ? 'var(--yellow)' : ''">
              {{ iconType }}
            </v-icon>
          </v-list-item-action>
          <v-list-item-content>
            <v-list-item-title>
              Select All
            </v-list-item-title>
          </v-list-item-content>
        </v-list-item>
        <v-divider></v-divider>
      </template>
      <template v-slot:selection="{ item, index }">

           16">{{ valuesType[0].slice(0,16) }}...
          <span v-if="index === 0 && valuesType[0].length <= 16">{{ valuesType[0] }},

            <span v-if="index === 0 && valuesType[0].length <= 8">{{ valuesType[0] }},
             8">{{ valuesType[0].slice(0,8) }}...
            <span v-if="index === 1  && valuesType[1].length <= 8">{{ valuesType[1] }},

             8"
                  class="grey--text text-caption spanFilters"
            >
              +1 other

 2">
          <span v-if="index === 0 && valuesType[0].length <= 10">{{ valuesType[0].slice(0,10) }}
           10">{{ valuesType[0].slice(0,8) }}...

           +{{ valuesType.length - 1 }} other(s)

      </template>
    </v-autocomplete>
  </template>

Any suggestion or help would be appreciated ! :)


来源: stackexchange

问:
How to recreate a query for different version of mariadb (currently: 10.4.27, recreate to: 10.1.38)
```<code>ALTER TABLE table ADD COLUMN IF NOT EXISTS col2_int INT GENERATED ALWAYS AS (IF(col1_date IS NULL,0,UNIX_TIMESTAMP(col1_date))) STORED;
</code>```

How do i recreate this for it to work with version 10.1.38 in mariadb

I'm getting this error

ContentLicense: CC BY-SA 4.0

Body:
ALTER TABLE table ADD COLUMN IF NOT EXISTS col2_int INT GENERATED ALWAYS AS (IF(col1_date IS NULL,0,UNIX_TIMESTAMP(col1_date))) STORED;

How do i recreate this for it to work with version 10.1.38 in mariadb

I'm getting this error


问:
Could I upgrade my java project to java version 17 if I couldn't upgrade the Elasticsearch from <6?
I have an Elasticsearch dependency with version 5.1.2 and I would like to upgrade my java version to 17 from 11 without increasing the version of Elasticsearch because of the API changes.

Could I do it somehow?

I didn't find any solution so far.


问:
How not to ignore blank lines in a web browser control?
I want to display an HTML document in a web browser control but all blank lines are ignored. The blank lines are present in the document and are also displayed by other browsers such as Chrome (see screenshot).

I read the document via File.ReadAllText() into a string and pass it to the control:

```<code>public void SetWebBrowserContent(string html)
{
    webBrowser1.Navigate("about:blank");
    if (webBrowser1.Document != null)
    {
        webBrowser1.Document.Write(string.Empty);
    }
    webBrowser1.DocumentText = html;
}
</code>```

However, all blank lines are ignored by the web browser control (see screenshots). How can I display them?

Webbrowser control Screenshot

Chrome Screenshot

HTML Snippet:

<!DOCTYPE html ><meta charset="UTF-8" /><title></title><meta name="Generator" content="PowerTools for Open XML" />

Heading

Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Sed vulputate sed neque eget faucibus. Orci varius natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere porttitor elementum. Donec sem
tellus, condimentum non congue vel, fermentum nec velit. Donec vestibulum malesuada placerat. Duis
rhoncus lorem ligula, quis molestie lectus laoreet eget. Vivamus finibus lacinia elit, ut sagittis magna
dignissim id. Praesent nisi lorem, pharetra non feugiat a, elementum sit amet urna. Nulla est velit,
pharetra quis lacus vestibulum, faucibus laoreet elit. Praesent dignissim gravida urna sed tempor.
Suspendisse fringilla, purus eget ullamcorper pharetra, dui turpis maximus mauris, eu aliquet orci felis
a elit. Vestibulum tempus ipsum eros, nec semper nulla lobortis quis.

Nam ultricies ultrices dolor non
viverra. Nam ante odio, porttitor vel cursus a, pellentesque eu turpis. Suspendisse congue sed lacus id
fermentum. Duis lobortis, leo eu blandit egestas, lectus orci aliquet enim, in mattis mauris nibh
vestibulum ipsum. Phasellus lacinia lectus eget libero iaculis euismod. Nunc placerat non mauris eget
sagittis. Fusce rutrum dolor vel leo suscipit iaculis. Aliquam lacinia quam non nisi iaculis
maximus.

Nam ultricies ultrices dolor non
viverra. Nam ante odio, porttitor vel cursus a, pellentesque eu turpis. Suspendisse congue sed lacus id
fermentum. Duis lobortis, leo eu blandit egestas, lectus orci aliquet enim, in mattis mauris nibh
vestibulum ipsum. Phasellus lacinia lectus eget libero iaculis euismod. Nunc placerat non mauris eget
sagittis. Fusce rutrum dolor vel leo suscipit iaculis. Aliquam lacinia quam non nisi iaculis
maximus.

Nam ultricies ultrices dolor non
viverra. Nam ante odio, porttitor vel cursus a, pellentesque eu turpis. Suspendisse congue sed lacus id
fermentum. Duis lobortis, leo eu blandit egestas, lectus orci aliquet enim, in mattis mauris nibh
vestibulum ipsum. Phasellus lacinia lectus eget libero iaculis euismod. Nunc placerat non mauris eget
sagittis. Fusce rutrum dolor vel leo suscipit iaculis. Aliquam lacinia quam non nisi iaculis
maximus.

```

Body:
I want to display an HTML document in a web browser control but all blank lines are ignored. The blank lines are present in the document and are also displayed by other browsers such as Chrome (see screenshot).

I read the document via File.ReadAllText() into a string and pass it to the control:

public void SetWebBrowserContent(string html)
{
    webBrowser1.Navigate("about:blank");
    if (webBrowser1.Document != null)
    {
        webBrowser1.Document.Write(string.Empty);
    }
    webBrowser1.DocumentText = html;
}

However, all blank lines are ignored by the web browser control (see screenshots). How can I display them?

Webbrowser control Screenshot

Chrome Screenshot

HTML Snippet:

<!DOCTYPE html ><meta charset="UTF-8" /><title></title><meta name="Generator" content="PowerTools for Open XML" />

Heading

Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Sed vulputate sed neque eget faucibus. Orci varius natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere porttitor elementum. Donec sem
tellus, condimentum non congue vel, fermentum nec velit. Donec vestibulum malesuada placerat. Duis
rhoncus lorem ligula, quis molestie lectus laoreet eget. Vivamus finibus lacinia elit, ut sagittis magna
dignissim id. Praesent nisi lorem, pharetra non feugiat a, elementum sit amet urna. Nulla est velit,
pharetra quis lacus vestibulum, faucibus laoreet elit. Praesent dignissim gravida urna sed tempor.
Suspendisse fringilla, purus eget ullamcorper pharetra, dui turpis maximus mauris, eu aliquet orci felis
a elit. Vestibulum tempus ipsum eros, nec semper nulla lobortis quis.

Nam ultricies ultrices dolor non
viverra. Nam ante odio, porttitor vel cursus a, pellentesque eu turpis. Suspendisse congue sed lacus id
fermentum. Duis lobortis, leo eu blandit egestas, lectus orci aliquet enim, in mattis mauris nibh
vestibulum ipsum. Phasellus lacinia lectus eget libero iaculis euismod. Nunc placerat non mauris eget
sagittis. Fusce rutrum dolor vel leo suscipit iaculis. Aliquam lacinia quam non nisi iaculis
maximus.

Nam ultricies ultrices dolor non
viverra. Nam ante odio, porttitor vel cursus a, pellentesque eu turpis. Suspendisse congue sed lacus id
fermentum. Duis lobortis, leo eu blandit egestas, lectus orci aliquet enim, in mattis mauris nibh
vestibulum ipsum. Phasellus lacinia lectus eget libero iaculis euismod. Nunc placerat non mauris eget
sagittis. Fusce rutrum dolor vel leo suscipit iaculis. Aliquam lacinia quam non nisi iaculis
maximus.

Nam ultricies ultrices dolor non
viverra. Nam ante odio, porttitor vel cursus a, pellentesque eu turpis. Suspendisse congue sed lacus id
fermentum. Duis lobortis, leo eu blandit egestas, lectus orci aliquet enim, in mattis mauris nibh
vestibulum ipsum. Phasellus lacinia lectus eget libero iaculis euismod. Nunc placerat non mauris eget
sagittis. Fusce rutrum dolor vel leo suscipit iaculis. Aliquam lacinia quam non nisi iaculis
maximus.


问:
Track drag & drop actions with Google Tag Manager
I'm used to track clicks on elements on my web app using Google Tag Manager (a trigger to detect a click on an element with a specific ID, and a tag to send an event to GA4 when that trigger is detected).

Now I have an element that can be dragged and dropped. What's the easiest way to track drag and drop actions on elements?

Thanks!


问:
Solr Cloud with more than 4 nodes
I want to configure solr cloud with more than 4 nodes, mostly 6-8 nodes so that my data gets distributed among all the nodes evenly. But I am not able to configure more than 4 nodes. Can anyone guide me on how I can configure more than 4 nodes in solr cloud with zookeeper being used externally?</p>

Title: Solr Cloud with more than 4 nodes


问:
How can I add a Mui Icon to my toast without it throwing an error/not aligning with the text?
I tried including a Info Icon from mui in md toast, but it didn't work.
This is what I tried:

```<code>import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
toast("Information Toast", {
icon: <InfoOutlinedIcon />,
autoClose: false,
});
</code>```

And it throws me an error for not being able to read properties of undefined. I saw that you can include it inside the message, but if I write a longer message it no longer aligns with the icon. That's why I wanted to try it this way.

Does someone know another way, I can use a custom Icon from mui in my toast?

Body:
I tried including a Info Icon from mui in md toast, but it didn't work.
This is what I tried:

import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
toast("Information Toast", {
icon: <InfoOutlinedIcon />,
autoClose: false,
});

And it throws me an error for not being able to read properties of undefined. I saw that you can include it inside the message, but if I write a longer message it no longer aligns with the icon. That's why I wanted to try it this way.

Does someone know another way, I can use a custom Icon from mui in my toast?


问:
MSSQL getting Argument data type datetime is invalid for argument 1 of substring function even IF EXISTS is false
I am trying to write SQL to convert a varchar to datetime if the column exists and it is a varchar but I keep getting this error:

Argument data type datetime is invalid for argument 1 of substring function.

My update and alter should only run if the column exists and is a varchar.

```<code>IF EXISTS (
select 1 from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = 'LZS'
AND TABLE_NAME='TBDLZL2760_FOAB369I_RAT_TYP_OPL'
AND COLUMN_NAME ='SENEST_OPDAT'
AND lower(DATA_TYPE)='varchar')
BEGIN

UPDATE LZS.TBDLZL2760_FOAB369I_RAT_TYP_OPL
SET SENEST_OPDAT =
   CASE WHEN SUBSTRING(SENEST_OPDAT,1,4) >= '1753' THEN
        SUBSTRING(SENEST_OPDAT,1,10)+' '+REPLACE(SUBSTRING(SENEST_OPDAT,12,8),'.',':')+'.'+
        CASE WHEN SUBSTRING(SENEST_OPDAT,21,3) = '999' THEN '998' ELSE SUBSTRING(SENEST_OPDAT,21,3) END
   ELSE '1753-01-01 '+REPLACE(SUBSTRING(SENEST_OPDAT,12,8),'.',':')+'.'+
        CASE WHEN SUBSTRING(SENEST_OPDAT,21,3) = '999' THEN '998' ELSE SUBSTRING(SENEST_OPDAT,21,3) END
    END

    ALTER TABLE LZS.TBDLZL2760_FOAB369I_RAT_TYP_OPL
   ALTER COLUMN SENEST_OPDAT DATETIME NOT NULL;
END;
</code>```

Does anyone have a solution for this?

Body:
I am trying to write SQL to convert a varchar to datetime if the column exists and it is a varchar but I keep getting this error:

Argument data type datetime is invalid for argument 1 of substring function.

My update and alter should only run if the column exists and is a varchar.

IF EXISTS (
select 1 from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = 'LZS'
AND TABLE_NAME='TBDLZL2760_FOAB369I_RAT_TYP_OPL'
AND COLUMN_NAME ='SENEST_OPDAT'
AND lower(DATA_TYPE)='varchar')
BEGIN

UPDATE LZS.TBDLZL2760_FOAB369I_RAT_TYP_OPL
SET SENEST_OPDAT =
   CASE WHEN SUBSTRING(SENEST_OPDAT,1,4) >= '1753' THEN
        SUBSTRING(SENEST_OPDAT,1,10)+' '+REPLACE(SUBSTRING(SENEST_OPDAT,12,8),'.',':')+'.'+
        CASE WHEN SUBSTRING(SENEST_OPDAT,21,3) = '999' THEN '998' ELSE SUBSTRING(SENEST_OPDAT,21,3) END
   ELSE '1753-01-01 '+REPLACE(SUBSTRING(SENEST_OPDAT,12,8),'.',':')+'.'+
        CASE WHEN SUBSTRING(SENEST_OPDAT,21,3) = '999' THEN '998' ELSE SUBSTRING(SENEST_OPDAT,21,3) END
    END

    ALTER TABLE LZS.TBDLZL2760_FOAB369I_RAT_TYP_OPL
   ALTER COLUMN SENEST_OPDAT DATETIME NOT NULL;
END;

Does anyone have a solution for this?


问:
How to pass a file to docker container and get output from the container into node app using dockerode
I am writing a simple script in nodejs that will pass a file to a docker container, the container will process the file and generate a json output. I am using Dockerode to connect to the docker container. the input file is in the same folder as the script.

Here is the code I have written so far.

```<code>const docker = new Docker()
const container = await docker.createContainer({
Image:"imageId",
AttachStdin: true,
AttachStdout: true,
AttachStderr: true,
Tty: true,
Cmd: ['bash']
})
</code>```

I am unsure how to pass the file as a stream to this container i have created and then get the output stream from the docker container.

Body:
I am writing a simple script in nodejs that will pass a file to a docker container, the container will process the file and generate a json output. I am using Dockerode to connect to the docker container. the input file is in the same folder as the script.

Here is the code I have written so far.

const docker = new Docker()
const container = await docker.createContainer({
Image:"imageId",
AttachStdin: true,
AttachStdout: true,
AttachStderr: true,
Tty: true,
Cmd: ['bash']
})

I am unsure how to pass the file as a stream to this container i have created and then get the output stream from the docker container.


问:
Nginx proxy_pass to change root domain only behind ALB
I need to make a domain migration for an app hosted on ElasticBeanstalk behind ALB. This app uses various subdomains so I need to keep the subdomain and the request and change only the domain... I tried to setup a Nginx proxy_pass directive but I might have made mistakes as it does not work:

Practically what I want to achieve is a proxy for every type of request (post, get, put, delete...) that would redirect requests like anySubdomain.potato.net/anything/else  to anySubdomain.carrot.io/anything/else

On the DNS side both wildcard subdomains *.potato.net and *.carrot.io are pointing to the same ElasticBeanstalk environment. So far I added this instruction into my Nginx configuration files, but it does not work as the potato.net domain is not redirected and lands directly on the hosted app without beeing proxied:

```<code>location ~ ^/(?<subdomain>\.potato\.net)/(?<path>.*)?$ {

    # this is the desired directive at the end:
    # proxy_pass https://$subdomain.carrot.io/$path;

    # for test purposes I add the debug path below to output
    # some info and make sure it was proxied:
    proxy_pass https://$subdomain.carrot.io/proxydebug/$path;

}
</code>```

Is there something wrong in that directive?

Body:
I need to make a domain migration for an app hosted on ElasticBeanstalk behind ALB. This app uses various subdomains so I need to keep the subdomain and the request and change only the domain... I tried to setup a Nginx proxy_pass directive but I might have made mistakes as it does not work:

Practically what I want to achieve is a proxy for every type of request (post, get, put, delete...) that would redirect requests like anySubdomain.potato.net/anything/else  to anySubdomain.carrot.io/anything/else

On the DNS side both wildcard subdomains *.potato.net and *.carrot.io are pointing to the same ElasticBeanstalk environment. So far I added this instruction into my Nginx configuration files, but it does not work as the potato.net domain is not redirected and lands directly on the hosted app without beeing proxied:

location ~ ^/(?<subdomain>\.potato\.net)/(?<path>.*)?$ {

    # this is the desired directive at the end:
    # proxy_pass https://$subdomain.carrot.io/$path;

    # for test purposes I add the debug path below to output
    # some info and make sure it was proxied:
    proxy_pass https://$subdomain.carrot.io/proxydebug/$path;

}

Is there something wrong in that directive?


问:
Flutter image.network not show some images in safari browser
i am adding a link image in my flutter web app in "image-network" widget".it runs in chrome and it shows all the images but some images are not showing in safari??

i am expecting this enter image description here.but I got this enter image description here


问:
How to insert empty row at the top of data table in csv with C#?
I'm making a desktop application using the windows form with C#, I stored uploaded csv data with data grid view, then I make a transpose feature in the application, but did not work well, because the row of index or row 0 does not included in transpose output file.
Picture 1

So, I decided to add a empty row inside csv file at the top of data with this code

```<code>DataRow dr1 = dt.NewRow();
dt.Rows.InsertAt(dr1, 0);
</code>```

I tried manually by insert empty row in csv and the application look like this
Picture 2

How should I code to make application insert an empty data row at 0 and store it in data grid view looks like a picture above? so my transpose feature works well

here I wrote to store the data in data grid

```<code>        public DataSet ConnectCSV()
        {
            DataSet ds = new DataSet();

            string fileName = openFileDialogCSVFilePath.FileName;

            CsvReader reader = new CsvReader(fileName);

            ds = reader.RowEnumerator;
            dGridCSVdata.DataSource = ds;
            dGridCSVdata.DataMember = "TheData";
            return ds;
        }

 private void dGridCSVdata_Navigate(object sender, NavigateEventArgs ne)
        {

        }

</code>```

here I wrote to read the data

```<code>public DataSet RowEnumerator
    {
        get
        {
            if (null == __reader)
                throw new System.ApplicationException("I can't start reading without CSV input.");

            __rowno = 0;
            string sLine;
            string sNextLine;
            DataSet ds = new DataSet();
            DataTable dt = ds.Tables.Add("TheData");
            DataRow dr1 = dt.NewRow();
            dt.Rows.InsertAt(dr1, 0);

            while (null != (sLine = __reader.ReadLine()))
            {
                while (rexRunOnLine.IsMatch(sLine) && null != (sNextLine = __reader.ReadLine()))
                    sLine += "\n" + sNextLine;

                __rowno++;
                DataRow dr = dt.NewRow();
                string[] values = rexCsvSplitter.Split(sLine);

                for (int i = 0; i < values.Length; i++)
                {
                    values[i] = Csv.Unescape(values[i]);
                    if (__rowno == 1)
                    {
                        dt.Columns.Add(values[i].Trim());
                    }
                    else
                    {
                        if (Csv.CharNotAllowes(values[i]))
                        {
                            dr[i] = values[i].Trim();
                        }

                    }
                }
                if (__rowno != 1)
                {
                    dt.Rows.Add(dr);
                }

                ds.Tables.Add(Transposer.Transpose(dt));
                // transpose code
                StringBuilder sb = new StringBuilder();

                for (int u = 0; u < dt.Columns.Count; u++)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        sb.Append(dt.Rows[i][u].ToString());

                        if (i < dt.Rows.Count - 1)
                        {
                            sb.Append(',');
                        }
                    }
                    sb.AppendLine();
                }

                File.WriteAllText("C:\\Users\\Desktop\\Output.csv", sb.ToString());
            }
            __reader.Close();

            return ds;
        }
    }
</code>```

Body:
I'm making a desktop application using the windows form with C#, I stored uploaded csv data with data grid view, then I make a transpose feature in the application, but did not work well, because the row of index or row 0 does not included in transpose output file.
Picture 1

So, I decided to add a empty row inside csv file at the top of data with this code

DataRow dr1 = dt.NewRow();
dt.Rows.InsertAt(dr1, 0);

I tried manually by insert empty row in csv and the application look like this
Picture 2

How should I code to make application insert an empty data row at 0 and store it in data grid view looks like a picture above? so my transpose feature works well

here I wrote to store the data in data grid

        public DataSet ConnectCSV()
        {
            DataSet ds = new DataSet();

            string fileName = openFileDialogCSVFilePath.FileName;

            CsvReader reader = new CsvReader(fileName);

            ds = reader.RowEnumerator;
            dGridCSVdata.DataSource = ds;
            dGridCSVdata.DataMember = "TheData";
            return ds;
        }

 private void dGridCSVdata_Navigate(object sender, NavigateEventArgs ne)
        {

        }

here I wrote to read the data

public DataSet RowEnumerator
    {
        get
        {
            if (null == __reader)
                throw new System.ApplicationException("I can't start reading without CSV input.");

            __rowno = 0;
            string sLine;
            string sNextLine;
            DataSet ds = new DataSet();
            DataTable dt = ds.Tables.Add("TheData");
            DataRow dr1 = dt.NewRow();
            dt.Rows.InsertAt(dr1, 0);

            while (null != (sLine = __reader.ReadLine()))
            {
                while (rexRunOnLine.IsMatch(sLine) && null != (sNextLine = __reader.ReadLine()))
                    sLine += "\n" + sNextLine;

                __rowno++;
                DataRow dr = dt.NewRow();
                string[] values = rexCsvSplitter.Split(sLine);

                for (int i = 0; i < values.Length; i++)
                {
                    values[i] = Csv.Unescape(values[i]);
                    if (__rowno == 1)
                    {
                        dt.Columns.Add(values[i].Trim());
                    }
                    else
                    {
                        if (Csv.CharNotAllowes(values[i]))
                        {
                            dr[i] = values[i].Trim();
                        }

                    }
                }
                if (__rowno != 1)
                {
                    dt.Rows.Add(dr);
                }

                ds.Tables.Add(Transposer.Transpose(dt));
                // transpose code
                StringBuilder sb = new StringBuilder();

                for (int u = 0; u < dt.Columns.Count; u++)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        sb.Append(dt.Rows[i][u].ToString());

                        if (i < dt.Rows.Count - 1)
                        {
                            sb.Append(',');
                        }
                    }
                    sb.AppendLine();
                }

                File.WriteAllText("C:\\Users\\Desktop\\Output.csv", sb.ToString());
            }
            __reader.Close();

            return ds;
        }
    }


问:
Unmanaged memory consumption very high after creating a snapshot - why?
I am trying to find ways to reduce the memory footprint of our application. As soon as I manage to reduce the "managed memory" usage, the "unmanaged memory usage" always goes up by more than what I saved in managed memory usage.

Also I noticed that the composition of memory usage (managed vs native) always seems to change when I create a snapshot (see screenshot).

Why is this happening? Is there any significance to it? Does that mean that the process of creating a snapshot itself is changing the composition of memory consumption?


问:
Asp.net core API authentication with Azure Bearer token
I have now spent weeks on this, including reading everything I can possibly find on the subject, so please don't shoot me down saying I should do my research or to post what I've already written - I have really, really done my research but cannot find the answer that works for my brain and what I have written all works, it's the concept I'm struggling with.

What I'm struggling with is the concept of how I secure an asp.net Core API endpoint using a Beaer token obtained from Azure (via Teams Toolkit) when the two systems are separate and potentially don't know about each other's installations or shared keys used to create the bearer token.

This is the scenario:

There is a Teams "Tab App" which customers will install on their local instances of M365.  This Teams Tab app will acquire the token from Azure.  From this token we would like to get their email address and name but we have to first validate that token has not been altered in transit (we can get the token from Teams, no problem - good so far).

What we would then like to do is pass that token in the authorization header when the call is made to the API.  The API knows nothing about the Teams Tab app install as it was done on a customer's M365 tenancy, and their install of the Tab App knows nothing about the API apart from the URL to call and the requirement to pass the bearer token.

Unless I have misunderstood (which hopefully I have), everything I have read on this seems to require a shared secret shared between the "client" and is required at API instantiation within the program.cs class -- this won't be possible as multiple customers will be calling the API from lots of Teams Tab App installs (all separate organisations), and in any case, it's Azure providing the token not us creating it.

This seems to rule-out the "built in" authentication model we can add to the pipeline in program.cs.  Therefore, are we only left with the option to manually validate each request containing the bearer token coming into the API as (I believe) we know the public key used to sign the token in the first place because Microsoft obv publish this address for common use?

Hopefully that makes sense to someone out there and will kick my arse for getting it all wrong, and help guide me into the light - help me Obi-Wan Kenobi, you're my only hope!


Title: Decode request from API call


问:
How to integrate outlook event calendar & teams API into the React JS & React Native Applications?
Actually when I login into the Microsoft online login with this API.

https://login.microsoftonline.com/{taentId}/oauth2/v2.0/token API to get access token and I got the response of token but when I try to use that token into this API to create the event https://graph.microsoft.com/v1.0/me/events. I got this error **Resource could not be discovered.
**

Also Sharing a response of the login api

```<code>{
    "token_type": "Bearer",
    "scope": "email openid profile Calendars.Read Calendars.Read.Shared Calendars.ReadBasic Calendars.ReadWrite Calendars.ReadWrite.Shared User.Read User.Read.All",
    "expires_in": 5***,
    "ext_expires_in": 5***,
    "access_token": "eyJ0*************",
    "id_token": "eyJ0********"
}
</code>```

How Can I Solve This Error ?

Body:
Actually when I login into the Microsoft online login with this API.

https://login.microsoftonline.com/{taentId}/oauth2/v2.0/token API to get access token and I got the response of token but when I try to use that token into this API to create the event https://graph.microsoft.com/v1.0/me/events. I got this error **Resource could not be discovered.
**

Also Sharing a response of the login api

{
    "token_type": "Bearer",
    "scope": "email openid profile Calendars.Read Calendars.Read.Shared Calendars.ReadBasic Calendars.ReadWrite Calendars.ReadWrite.Shared User.Read User.Read.All",
    "expires_in": 5***,
    "ext_expires_in": 5***,
    "access_token": "eyJ0*************",
    "id_token": "eyJ0********"
}

How Can I Solve This Error ?


Title: Daily Aggregation by date in New column name dailySum for each group

Body:
I have data frame

** I have Input data frame  **

ID
Date
Amount

A
2021-08-01
100

A
2021-08-01
100

A
2021-08-02
20

A
2021-08-02
100

A
2021-08-03
300

A
2021-08-03
100

B
2021-08-03
100

B
2021-08-03
10

B
2021-08-04
10

B
2021-08-04
10

B
2021-08-04
10

B
2021-08-04
10

desired Output data frame

ID
Date
DailySum

A
2021-08-01
200

A
2021-08-02
120

A
2021-08-03
400

B
2021-08-03
120

B
2021-08-04
40

How Can I get daily sum for each group Like output  Table.
Thankyou


问:
google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef'
I have a yolov4 pre-trained model, which has been extracted in '.pb' and tflite format, while i am testing it  SOM (system on module) which is ubuntu 18, i am getting following error:-

graph_def.ParseFromString(file_handle.read())
google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef'

code is following-

```<code>with tf.gfile.GFile(checkpoint_filename, "rb") as file_handle:
    graph_def = tf.GraphDef()
    graph_def.ParseFromString(file_handle.read())
</code>```

P.s. This is working fine on my local computer.

python 3.7.15
tensorflow  2.5.0
protobuf 3.19.1

Any help would be appreciated. Thanks!

Body:
I have a yolov4 pre-trained model, which has been extracted in '.pb' and tflite format, while i am testing it  SOM (system on module) which is ubuntu 18, i am getting following error:-

graph_def.ParseFromString(file_handle.read())
google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef'

code is following-

with tf.gfile.GFile(checkpoint_filename, "rb") as file_handle:
    graph_def = tf.GraphDef()
    graph_def.ParseFromString(file_handle.read())

P.s. This is working fine on my local computer.

python 3.7.15
tensorflow  2.5.0
protobuf 3.19.1

Any help would be appreciated. Thanks!


问:
I want to return count of albumid
total count of album id is 11 based on current year(2022)

I want to return that 11 number and showing 11 in chart

see my function

```<code>see my function

CREATE OR REPLACE FUNCTION public.getmonthfromdatetest(
    orderdate date)
    RETURNS SETOF record
    LANGUAGE 'sql'
    COST 100
    VOLATILE PARALLEL UNSAFE
    ROWS 1000

AS $BODY$
SELECT  albumid as albumid,extract(month FROM orderdate) AS yr_month
    FROM public.orderalbum
    WHERE
        extract(year FROM orderdate)::int = 2022
        --GROUP BY albumid,orderdate
        --select extract(month from orderdate)::int;
$BODY$;

ALTER FUNCTION public.getmonthfromdatetest(date)
    OWNER TO cpupdate;
</code>```

and see my function output

https://imgur.com/UQowfs4

and see my table

https://imgur.com/wCcloW1

controller

```<code>        [HttpGet]
        public ActionResult getmonthSales()
        {
            string query = @"SELECT getmonthfromdateTest(orderdate) as y FROM public.orderAlbum";
            //NpgsqlCommand cmd = new NpgsqlCommand("SELECT getmonthfromdateTest(orderdate) as y FROM public.orderAlbum GROUP BY getmonthfromdateTest(orderdate)", conn);

            NpgsqlCommand cmd = new NpgsqlCommand(query, conn);
            conn.Open();
            object cursorVal = cmd.ExecuteScalar();
            DataSet ds = FetchAll(conn, cursorVal);
            cmd.Dispose();
            conn.Close();

            List<OrderData> lst = new List<OrderData>();
            DataTable dt = new DataTable();

            NpgsqlDataAdapter adp = new NpgsqlDataAdapter(cmd);
            adp.Fill(dt);

            foreach (DataRow dr in dt.Rows)
            {
                lst.Add(new OrderData
                {
                    aid = Convert.ToInt32(dr[0]),
                    ordermonth = Convert.ToInt32(dr[1])
                });
            }
            return Json(lst, JsonRequestBehavior.AllowGet);

        }

        private DataSet FetchAll(NpgsqlConnection _connection, object cursorVal)
        {
            try
            {
                DataSet actualData = new DataSet();

                string strSql = "fetch all from \"" + cursorVal + "\";"; ;
                //string strSql = "fetch all from \"" + ((object[])cursorVal)[0] + "\" + \"" + ((object[])cursorVal)[1] + "\";";
                NpgsqlCommand cmd = new NpgsqlCommand(strSql, _connection);
                NpgsqlDataAdapter ada = new NpgsqlDataAdapter(cmd);
                ada.Fill(actualData);

                return actualData;

            }
            catch (Exception Exp)
            {
                throw new Exception(Exp.Message);
            }
        }
</code>```

Models

```<code>        public int aid { get; set; }
        public int ordermonth { get; set; }
</code>```

I want to return 11 total count of albumid and showing in chart

I am trying and trying but not work

I am facing below error

ERROR:  syntax error at or near "as"
LINE 3: as
^
SQL state: 42601
Character: 70

need help

Title: I want to return count of albumid

Body:
total count of album id is 11 based on current year(2022)

I want to return that 11 number and showing 11 in chart

see my function

see my function

CREATE OR REPLACE FUNCTION public.getmonthfromdatetest(
    orderdate date)
    RETURNS SETOF record
    LANGUAGE 'sql'
    COST 100
    VOLATILE PARALLEL UNSAFE
    ROWS 1000

AS $BODY$
SELECT  albumid as albumid,extract(month FROM orderdate) AS yr_month
    FROM public.orderalbum
    WHERE
        extract(year FROM orderdate)::int = 2022
        --GROUP BY albumid,orderdate
        --select extract(month from orderdate)::int;
$BODY$;

ALTER FUNCTION public.getmonthfromdatetest(date)
    OWNER TO cpupdate;

and see my function output

https://imgur.com/UQowfs4

and see my table

https://imgur.com/wCcloW1

controller

        [HttpGet]
        public ActionResult getmonthSales()
        {
            string query = @"SELECT getmonthfromdateTest(orderdate) as y FROM public.orderAlbum";
            //NpgsqlCommand cmd = new NpgsqlCommand("SELECT getmonthfromdateTest(orderdate) as y FROM public.orderAlbum GROUP BY getmonthfromdateTest(orderdate)", conn);

            NpgsqlCommand cmd = new NpgsqlCommand(query, conn);
            conn.Open();
            object cursorVal = cmd.ExecuteScalar();
            DataSet ds = FetchAll(conn, cursorVal);
            cmd.Dispose();
            conn.Close();

            List<OrderData> lst = new List<OrderData>();
            DataTable dt = new DataTable();

            NpgsqlDataAdapter adp = new NpgsqlDataAdapter(cmd);
            adp.Fill(dt);

            foreach (DataRow dr in dt.Rows)
            {
                lst.Add(new OrderData
                {
                    aid = Convert.ToInt32(dr[0]),
                    ordermonth = Convert.ToInt32(dr[1])
                });
            }
            return Json(lst, JsonRequestBehavior.AllowGet);

        }

        private DataSet FetchAll(NpgsqlConnection _connection, object cursorVal)
        {
            try
            {
                DataSet actualData = new DataSet();

                string strSql = "fetch all from \"" + cursorVal + "\";"; ;
                //string strSql = "fetch all from \"" + ((object[])cursorVal)[0] + "\" + \"" + ((object[])cursorVal)[1] + "\";";
                NpgsqlCommand cmd = new NpgsqlCommand(strSql, _connection);
                NpgsqlDataAdapter ada = new NpgsqlDataAdapter(cmd);
                ada.Fill(actualData);

                return actualData;

            }
            catch (Exception Exp)
            {
                throw new Exception(Exp.Message);
            }
        }

Models

        public int aid { get; set; }
        public int ordermonth { get; set; }

I want to return 11 total count of albumid and showing in chart

I am trying and trying but not work

I am facing below error

ERROR:  syntax error at or near "as"
LINE 3: as
^
SQL state: 42601
Character: 70

need help


问:
Pushing empty DataTable into SQL Query as structured parameter
I recently bumped into an issue of raising an exception "Type structured needs to have at least one field" when pushing empty DataTable to an SQL query as structured parameter.

I basically have something like this (MyTestType is defined on the SQL server):

```<code>DataTable dt = new DataTable("test")
dt.Columns.Add("id", typeof(int));

try {

    using(SQLConnection conn = new SQLConnection("{ConnectionString}"))
    {
        conn.Open();

        using(SQLCommand comm = new SQLCommand("SELECT * FROM @TestDataTable", conn))
        {
            comm.Parameters.Add(new SQLParameter("@TestDataTable", SqlDbType.Structured){ Value = dt, TypeName = "dbo.MyTestType" });

            using(SQLDataReader reader = comm.ExecuteReader())
            {
                while(reader.Read())
                {
                    ...
                }
            }
        }
    }
}

catch(Exception(ex))
{
    throw(ex)
}

finally
{
   conn.Close()
}
</code>```

The thing is, I might end up with or without any data in my DataTable that I pass as a parameter into the query and the query really doesn't mind if the provided DataTable is empty, it just does some joins and if they equal to nothing, then nothing happens. Problem is that C# won't let it pass into the query and I really don't want to provide some "blank" DataRow in case it's empty just so it gets over it. That is not a clean solution.

Anyone any idea? Thanks in advance. PS: if the code has some issue, just quick fix it, I typed it from the top of my head.

Body:
I recently bumped into an issue of raising an exception "Type structured needs to have at least one field" when pushing empty DataTable to an SQL query as structured parameter.

I basically have something like this (MyTestType is defined on the SQL server):

DataTable dt = new DataTable("test")
dt.Columns.Add("id", typeof(int));

try {

    using(SQLConnection conn = new SQLConnection("{ConnectionString}"))
    {
        conn.Open();

        using(SQLCommand comm = new SQLCommand("SELECT * FROM @TestDataTable", conn))
        {
            comm.Parameters.Add(new SQLParameter("@TestDataTable", SqlDbType.Structured){ Value = dt, TypeName = "dbo.MyTestType" });

            using(SQLDataReader reader = comm.ExecuteReader())
            {
                while(reader.Read())
                {
                    ...
                }
            }
        }
    }
}

catch(Exception(ex))
{
    throw(ex)
}

finally
{
   conn.Close()
}

The thing is, I might end up with or without any data in my DataTable that I pass as a parameter into the query and the query really doesn't mind if the provided DataTable is empty, it just does some joins and if they equal to nothing, then nothing happens. Problem is that C# won't let it pass into the query and I really don't want to provide some "blank" DataRow in case it's empty just so it gets over it. That is not a clean solution.

Anyone any idea? Thanks in advance. PS: if the code has some issue, just quick fix it, I typed it from the top of my head.


问:
OOP and GUI combined to create Rock Paper Scissor game
Is it possible to use OOP in python and tkinter to write a Rock Paper Scissor game? if yes, an example please.

Could someone help create a Rock Paper Scissor game in Python with tkinter and OOP as just one game? The game must use classes and also employ the GUI (tkinter).


问:
Find top N highest values in a pandas dataframe, and return column name
I have a dataframe which looks like this:

I need to find the top 20 columns with the highest values in their row like so:

Value: 8.684, Column: REPRPAPAP (row doesnt matter)

Value: 8.487, Column: IRRSSNYR

Value: 8.134, Column: MADGSSDAA

How would I go about doing this? Ive tried df.idxmax, df.nlargest, etc. but nothing works. The closest I got was using

```<code>-np.sort(-df.max())
</code>```

Which returns the following array of values where each value is the max of a row (I think - it could also be columns, which is wrong).

This is very close but it does not give me the corresponding column name for those values. The code also has to be general because I generate a different table about 1000 times and they will have different sizes and row/column names each time.

Body:
I have a dataframe which looks like this:

I need to find the top 20 columns with the highest values in their row like so:

Value: 8.684, Column: REPRPAPAP (row doesnt matter)

Value: 8.487, Column: IRRSSNYR

Value: 8.134, Column: MADGSSDAA

How would I go about doing this? Ive tried df.idxmax, df.nlargest, etc. but nothing works. The closest I got was using

-np.sort(-df.max())

Which returns the following array of values where each value is the max of a row (I think - it could also be columns, which is wrong).

This is very close but it does not give me the corresponding column name for those values. The code also has to be general because I generate a different table about 1000 times and they will have different sizes and row/column names each time.


问:
SWRL Rules with data property values and range
I am writing a SWRL rule in OWL which can infer if a person is of driving age or not.
Person(?p), xsd:int[>= "18"^^xsd:int  <= "65"^^xsd:int](?age), hasAge(?p, ?age) -> isDriverAge(?p, "True"xsd:Boolean)
It gives me Unexpected Character '[' error

I saw similar syntax for Object Property (found here: https://dior.ics.muni.cz/~makub/owl/ ) but that is also not working when I tweaked my ontology as per this code:
Person(?p), int[>= 18 , <= 65](?age), hasAge(?p, ?age) -> hasDriverAge(?p, True)

If you know the answer, could you please also provide me a resource which I can refer to write these rules. I don't want to keep coming back to stack and eat up other dev's time. Thanks


问:
Rabbitmq_management plugin is enabled but cant access to web interface
im trying to work with rabbitmq server and i have a problem. In CLI by a command

rabbitmqctl status

i got something like this

the rabbitmq_management is runnin. and whenever i try to open localhost:15672 browser is showing me a white screen.

when i try to do command telnet localhost 15672 the result is

no fails, actually no fails just cant screenshot it properly, there just an underscore

Tried to work with docker image aswell, same results. Maybe i have issues with localhost? dont know what to do at this point

how to do the magic solving? anyone faced that?

UPDATE:

i figured out how to connect to management rabbitmq not by localhost, im doing it by 192.168.0.156:15672 witch is me ipv4 adress and the result is


问:
Problems with async nodejs function
Thought I make myself a module (yesno) to get a users confirmation. Used the node module prompt for that purpose.

```<code>const prompt = require('prompt');

const yesnoOptions = {
    properties: {
        confirm: {
            pattern: /^yes|no|ja|nee$/i,
            message: 'Antwoord met ja of nee.',
            required: true

        }
    }
};

async function confirm(){
    prompt.start();
    prompt.get(yesnoOptions, function(err, result){
        if (err){
            return err;
        }
        if ( String(result.confirm).match(/^yes|ja$/i) ){
            return 1;
        } else{
            return 0;
        }
    });
}

module.exports = {
    confirm: confirm,
}
</code>```

Whenever I use the function it continues with the next line before the user input is received.

```<code>            let reply = await yesno.confirm();
            console.log(`reply ${reply}`);
</code>```

The console.log prints "reply undefined" and I'm left at an empty line prompt waiting for input.

Tried without the await: in that case the console.log wil print "reply [object Promise]"

Tried chaining the result (not at all familiar with that technique) but the .then() is executed immediatelly.

Did use await and async functions at other moment. Worked as expected.

I'm at a loss... could use a pointer on what I'm doing wrong.

Regards

Peter

Title: Problems with async nodejs function

Body:
Thought I make myself a module (yesno) to get a users confirmation. Used the node module prompt for that purpose.

const prompt = require('prompt');

const yesnoOptions = {
    properties: {
        confirm: {
            pattern: /^yes|no|ja|nee$/i,
            message: 'Antwoord met ja of nee.',
            required: true

        }
    }
};

async function confirm(){
    prompt.start();
    prompt.get(yesnoOptions, function(err, result){
        if (err){
            return err;
        }
        if ( String(result.confirm).match(/^yes|ja$/i) ){
            return 1;
        } else{
            return 0;
        }
    });
}

module.exports = {
    confirm: confirm,
}

Whenever I use the function it continues with the next line before the user input is received.

            let reply = await yesno.confirm();
            console.log(`reply ${reply}`);

The console.log prints "reply undefined" and I'm left at an empty line prompt waiting for input.

Tried without the await: in that case the console.log wil print "reply [object Promise]"

Tried chaining the result (not at all familiar with that technique) but the .then() is executed immediatelly.

Did use await and async functions at other moment. Worked as expected.

I'm at a loss... could use a pointer on what I'm doing wrong.

Regards

Peter


问:
toggle tabs with vue props not working - Quasar
I have quasar tabs that are being rendered in v-for loop.
Problem is that when I provide array as prop from parent, then my tabs stop working to toggle whereas it works with local array.

```<code><div v-for="test in tests">
  <q-tabs
    v-model="test.status"
    align="justify"
      >
        <q-tab
          v-for="(tab, tabIndex) in tabs"
          :key="tabIndex"
          :name="tab.value"
        >
          {{ tab.name }}
        </q-tab>
      </q-tabs>
</div>
<script>
export default {
props: ['tests']
data (){
return {
  tabs: [
          {
            name: 'Required',
            value: 'required'
          },
          {
            name: 'Not Required',
            value: 'not-required'
          }
        ]
 }
}
</code>```

Tests Data

```<code>[
  {
    id: "test 1"
    name: 'TEST 1'
    status: 'required'
  },
  {
    id: "test 2"
    name: 'TEST 2'
    status: 'not-required'
  }
]
</code>```

Expected result
Toggle of tabs must work when component is provided with props data to iterate.

Body:
I have quasar tabs that are being rendered in v-for loop.
Problem is that when I provide array as prop from parent, then my tabs stop working to toggle whereas it works with local array.

  <q-tabs
    v-model="test.status"
    align="justify"
      >
        <q-tab
          v-for="(tab, tabIndex) in tabs"
          :key="tabIndex"
          :name="tab.value"
        >
          {{ tab.name }}
        </q-tab>
      </q-tabs>


问:
Browser loads response from cache although no-cache header is set
I'm working on a web app and I'm having the following problem:

When I go on some page my server sends a response with cache-control: no-cache header.

Then I do some changes (graphql mutations) on that page.

When I go to an other page and then click browser back then my browser reads the outdated "response" from the disk cache instead of sending a request to the server to get the change data.

browser loads response from cache although no-cache header is set

I wondering if there is something missing in my headers telling the browser to not use the disk cache?

Some info:
The browser does not send a request to my server. (So it is not cached somewhere else.)
It is not the back-forward cache. (There is already some logic handling the bfcache.)
I can reproduce it in all my browsers. (e.g. Firefox, Chrome, ...)
When I disable the disk cache in the Firefox settings then it is working correctly. (Now, the bfcache kicks in.)

I also found the following thread. Is there a better solution?
Chrome is caching even with HTTP no-cache headers


问:
How to integrate bubble.io features into react application?
I want to use https://bubble.io/ features in my react application. I haven't found any library in npmjs or github. Is it possible to integrate bubble.io with react?</p>


问:
Problems using ReadDirectoryChanges in Rad Studio
I am trying to load a file into a stream in BASS via ReadDirectoryChanges.
When I use a testfunction using FileOpenDialog I get a working result, but when I use RDC it craps out on me all the time. I must be doing something wrong, but for the life of me I can't figure it out. Maybe someone here can point me in the right direction.
Below is a snippet of the code I use:

```<code>void __fastcall TForm9::ToWav(FILE_NOTIFY_INFORMATION* File)
{
    String FullFileName = OpokaClient.ImportLocation + copyfname(File);
    int BassResult = 0;

    LogLine("File added to: " + FullFileName, apSYSTEM);
    HSTREAM convert = NULL;

    convert = MyBASS_StreamCreateFile(false, FullFileName.c_str(), 0, 0, BASS_STREAM_DECODE | BASS_UNICODE);
    BassResult = MyBASS_ErrorGetCode();

    LogLine("Bass Result: " + IntToStr(BassResult), apSYSTEM);

}
//---------------------------------------------------------------------------

void __fastcall TForm9::Button2Click(TObject *Sender)
{
    String FileName;
    int BassResult = 0;

    if(FileOpenDialog1->Execute()) {
        FileName = FileOpenDialog1->FileName;
    } else {
        LogLine("No file selected. FileName empty", apWARNING);
        return;
    }

    HSTREAM convert = NULL;

    LogLine("ConverterMain: ToWav: FileName: " + FileName, apSYSTEM);

    convert = MyBASS_StreamCreateFile(false, FileName.c_str(), 0, 0, BASS_STREAM_DECODE | BASS_UNICODE);
    BassResult = MyBASS_ErrorGetCode();

    LogLine("chan ErrorCode: " + IntToStr(BassResult), apSYSTEM);

}
//---------------------------------------------------------------------------
</code>```

copyfname is in a different unit..

```<code>wchar_t* copyfname(FILE_NOTIFY_INFORMATION* pfi)
{

    wchar_t* pfn;

    pfn = new wchar_t[pfi->FileNameLength+1];

    ZeroMemory(pfn, sizeof(wchar_t)*(pfi->FileNameLength+1));
    memcpy(pfn, pfi->FileName, pfi->FileNameLength);
    return pfn;
}
</code>```

Body:
I am trying to load a file into a stream in BASS via ReadDirectoryChanges.
When I use a testfunction using FileOpenDialog I get a working result, but when I use RDC it craps out on me all the time. I must be doing something wrong, but for the life of me I can't figure it out. Maybe someone here can point me in the right direction.
Below is a snippet of the code I use:

void __fastcall TForm9::ToWav(FILE_NOTIFY_INFORMATION* File)
{
    String FullFileName = OpokaClient.ImportLocation + copyfname(File);
    int BassResult = 0;

    LogLine("File added to: " + FullFileName, apSYSTEM);
    HSTREAM convert = NULL;

    convert = MyBASS_StreamCreateFile(false, FullFileName.c_str(), 0, 0, BASS_STREAM_DECODE | BASS_UNICODE);
    BassResult = MyBASS_ErrorGetCode();

    LogLine("Bass Result: " + IntToStr(BassResult), apSYSTEM);

}
//---------------------------------------------------------------------------

void __fastcall TForm9::Button2Click(TObject *Sender)
{
    String FileName;
    int BassResult = 0;

    if(FileOpenDialog1->Execute()) {
        FileName = FileOpenDialog1->FileName;
    } else {
        LogLine("No file selected. FileName empty", apWARNING);
        return;
    }

    HSTREAM convert = NULL;

    LogLine("ConverterMain: ToWav: FileName: " + FileName, apSYSTEM);

    convert = MyBASS_StreamCreateFile(false, FileName.c_str(), 0, 0, BASS_STREAM_DECODE | BASS_UNICODE);
    BassResult = MyBASS_ErrorGetCode();

    LogLine("chan ErrorCode: " + IntToStr(BassResult), apSYSTEM);

}
//---------------------------------------------------------------------------

copyfname is in a different unit..

wchar_t* copyfname(FILE_NOTIFY_INFORMATION* pfi)
{

    wchar_t* pfn;

    pfn = new wchar_t[pfi->FileNameLength+1];

    ZeroMemory(pfn, sizeof(wchar_t)*(pfi->FileNameLength+1));
    memcpy(pfn, pfi->FileName, pfi->FileNameLength);
    return pfn;
}


问:
How do I get root certificate sent along with intermediate and client certificates using HttpClient net-core-3-1
I have the following certificate chain
Client -> Intermediate -> root

I don't have any control over the server, I'm required to sent the full chain but HttpClient is only sending the client and intermediate certificates during mtls handshake. Without the full chain, the connection is being refused.

Windows deem it unnecessary to send the root certificate because it should be on the server CA trust Store. Is there any work around?

I can achieve the above functionality with curlthin, currently our codebase is heavily based on HttpClient.


问:
Sonarqube User Wise Report
I have been trying to create a CI CD using GitLab, Jenkins, and sonarqube for the last week. I have a project with multiple people working on it. and the pipeline is working fine. now I have a doubt about sonar scanning. Can we get user-wise scanning results if we create user logins in sonarqube? If possible, how?

Now sonar gives an overall report. one does not need to see others' bugs. That is why I am trying to separate it.

Title: Sonarqube User Wise Report


问:
How to upload icon to GraphCms / GraphQl from react-icon and then render to nextJS?
I want to have the option to upload icon to graphcms and then use the icon in Next.js.

I tried to add the "Multi line text" function in graphcms and inside provide the name of the icon like this "AiFillHome".

However unfortunately it looks like this:
Bad result

this is what I need:
Required result

```<code>import React, { useState, useEffect } from "react";
import Link from "next/link";

import { getCategories } from "../services";

import { AiFillHome } from "react-icons/ai";
import { MdTravelExplore } from "react-icons/md";
import { MdFastfood } from "react-icons/md";
import { HiTrendingUp } from "react-icons/hi";
import { SiAnydesk } from "react-icons/si";

const Sidebar = () => {
  const [categories, setCategories] = useState([]);

  useEffect(() => {
    getCategories().then((newCategories) => {
      setCategories(newCategories);
    });
  }, []);

  console.log(categories);

  return (
    <div className="px-8 pt-2 -mt-10">
      <div className="py-10">
        <ul>
          <span className="tracking-widest text-gray-500 uppercase text-xxs">
            category
          </span>

          <div className="flex flex-col pt-5 space-y-8">
            <div className="flex items-center space-x-4 group">
              <span className="p-2 text-gray-500 bg-gray-800 rounded-xl group-hover:text-white group-hover:bg-gray-500">
                <AiFillHome />
              </span>
              <Link
                href="/"
                className="text-sm text-gray-500 group-hover:text-white group-hover:font-semibold"
              >
                Discover
              </Link>
            </div>
          </div>

          {categories?.map((category, index) => (
            <li>
              <ul className="flex flex-col pt-5 space-y-8">
                <li className="flex items-center space-x-4 group">
                  <span className="p-2 text-gray-500 bg-gray-800 rounded-xl group-hover:text-white group-hover:bg-gray-500">
                    {`<${category.icon} />`}
                    {/*<img src={category?.icon?.url} alt="" className="" /> */}
                  </span>
                  <Link
                    key={index}
                    href={`/category/${category.slug}`}
                    className="text-sm text-gray-500 group-hover:text-white group-hover:font-semibold"
                  >
                    {category.name}
                  </Link>
                </li>
              </ul>
            </li>
          ))}
        </ul>
      </div>
    </div>
  );
};

export default Sidebar;

</code>```

The graphql:

```<code>export const getCategories = async () => {
  const query = gql`
    query GetGategories {
      categories {
        icon
        name
        slug
      }
    }
  `;

  const result = await request(graphqlAPI, query);

  return result.categories;
};
</code>```

Body:
I want to have the option to upload icon to graphcms and then use the icon in Next.js.

I tried to add the "Multi line text" function in graphcms and inside provide the name of the icon like this "AiFillHome".

However unfortunately it looks like this:
Bad result

this is what I need:
Required result

import React, { useState, useEffect } from "react";
import Link from "next/link";

import { getCategories } from "../services";

import { AiFillHome } from "react-icons/ai";
import { MdTravelExplore } from "react-icons/md";
import { MdFastfood } from "react-icons/md";
import { HiTrendingUp } from "react-icons/hi";
import { SiAnydesk } from "react-icons/si";

const Sidebar = () => {
  const [categories, setCategories] = useState([]);

  useEffect(() => {
    getCategories().then((newCategories) => {
      setCategories(newCategories);
    });
  }, []);

  console.log(categories);

  return (

            category

                <AiFillHome />

              <Link
                href="/"
                className="text-sm text-gray-500 group-hover:text-white group-hover:font-semibold"
              >
                Discover
              </Link>

          {categories?.map((category, index) => (

                    {`<${category.icon} />`}
                    {/* */}

                  <Link
                    key={index}
                    href={`/category/${category.slug}`}
                    className="text-sm text-gray-500 group-hover:text-white group-hover:font-semibold"
                  >
                    {category.name}
                  </Link>

          ))}

  );
};

export default Sidebar;

The graphql:

export const getCategories = async () => {
  const query = gql`
    query GetGategories {
      categories {
        icon
        name
        slug
      }
    }
  `;

  const result = await request(graphqlAPI, query);

  return result.categories;
};


问:
Select option value returns '[object Object]'
I would like to ask for your help. I have mapped a list of data patientOptions to select field, each option has a value of

```<code>  value: {
    id: patient.id,
    firstName: patient.firstName,
    middleName: patient.middleName,
    lastName: patient.lastName,
  },
</code>```

I need to store this information when I submit the form. If I console.log(patientOptions) this will appear

What I am trying to achieve is to get all values

```<code>  value: {
    id: 13412341234,
    firstName: John,
    middleName: Made,
    lastName: Doe,
  },
</code>```

But if I will try to submit the form and log it to the console this will show up.

I have also tried just getting the value of 1 object it works but trying to get the value of multiple objects still returns the same error

Here is the rest of the code I hope anyone can help me.

```<code>const patientOptions = patient.map((patient) => ({
  key: `${patient.firstName} ${patient.middleName} ${patient.lastName},
  value: {
    id: patient.id,
    firstName: patient.firstName,
    middleName: patient.middleName,
    lastName: patient.lastName,
  },
}));

onSubmit = (values) =>
  console.log("form data", {
    patient: values.patient,
  });

<Formik
  initialValues={{
    patient: "",
  }}
  onSubmit={onSubmit}
>
  <Form>
    <FormikControl
      control="select"
      name="patient"
      label="Patient"
      options={patientOptions}
    />
  </Form>
</Formik>;
</code>```

Body:
I would like to ask for your help. I have mapped a list of data patientOptions to select field, each option has a value of

  value: {
    id: patient.id,
    firstName: patient.firstName,
    middleName: patient.middleName,
    lastName: patient.lastName,
  },

I need to store this information when I submit the form. If I console.log(patientOptions) this will appear

What I am trying to achieve is to get all values

  value: {
    id: 13412341234,
    firstName: John,
    middleName: Made,
    lastName: Doe,
  },

But if I will try to submit the form and log it to the console this will show up.

I have also tried just getting the value of 1 object it works but trying to get the value of multiple objects still returns the same error

Here is the rest of the code I hope anyone can help me.

const patientOptions = patient.map((patient) => ({
  key: `${patient.firstName} ${patient.middleName} ${patient.lastName},
  value: {
    id: patient.id,
    firstName: patient.firstName,
    middleName: patient.middleName,
    lastName: patient.lastName,
  },
}));

onSubmit = (values) =>
  console.log("form data", {
    patient: values.patient,
  });

<Formik
  initialValues={{
    patient: "",
  }}
  onSubmit={onSubmit}
>
  <Form>
    <FormikControl
      control="select"
      name="patient"
      label="Patient"
      options={patientOptions}
    />
  </Form>
</Formik>;


问:
Is there an API that can query an artifact from different repositories?
I am writing a gradle plugin. One of the functions is to query dependencies details. But I have to intergrate different APIs from different repositories.
For example, I can find details for org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 with sonatype sonatype maven REST API. But I can find androidx.compose.compiler with that it because it is from Google maven. And there are others from gradle portal.

What I want to know is, is there a single API that can query from different repositories without needing myself to implement it?


问:
How can I get MAMP to update the local files automatically?
We're running a local server for database management, it's old software, but works. A replacement is incoming, but not ready yet.
I've had to learn to manage it all in pretty quick time, so I'm very much a beginner.

Overview:
The database is running in Sequel Pro 1.0.2 (MySQL 5.5.34).
The main interface is via a custom site in PHP.
The server is run via MAMP 3.0.5.
The system is Mac OS 10.10.5 as this is the last version of Mac Server with the VPN that we can use for remote access to the site.
I also have a cloned version of the system off-site for when the main office internet goes down and we still need access to the site/database, and the entire MAMP folder is being automatically backed up.

Problem
I've found all the database files in MAMP>db>mysql, however I've noticed that the .MYI and .MYD files are only modified when MAMP is stopped.
This means the backup files are always out of date.
If I manually create a new view directly within Sequel Pro, then the files get updated.

For example, in the Sequel Pro database, I can see the latest item created was on the 15th (today) at 09:13, but the .MYI/.MYD files show last modified yesterday at 08:47.

Is there a way I can get the database files to update automatically without needing to manually stop the MAMP server so that the backup is current?

Again, very much a beginner with this so any advice is appreciated.

Thanks!


问:
Rich Table printed in a loop multiple times, why?
I have found this code on the internet and modified it with RICH table-output:
I have removed all the code that is not neccessary to understand (all the imports and so on).
My PROBLEM is, that the Table repeats itself. But there is NO loop for building the table. Is it because of the asyncio ? Maybe I should use an other method of printing the table ?

[![enter image description here][1]][1]

```<code>
table = Table(title="Unconfirmed Transactions", show_header=True)
table.add_column("Counter", justify="right", style="cyan")
#more columns added here

class ZMQHandler():
    def __init__(self):
        self.loop = asyncio.get_event_loop()
        self.zmqContext = zmq.asyncio.Context()
        self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
        self.zmqSubSocket.setsockopt(zmq.RCVHWM, 0)
        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "sequence")
        self.zmqSubSocket.connect("tcp://127.0.0.1:%i" % port)

    async def handle(self) :

        #code stripped

        table.add_row(str(counter), str(dataset[i][0]), str(a), str(b), amount_string, c)
        asyncio.ensure_future(self.handle())

    def start(self):
        self.loop.add_signal_handler(signal.SIGINT, self.stop)
        self.loop.create_task(self.handle())
        self.loop.run_forever()

    def stop(self):
        self.loop.stop()
        self.zmqContext.destroy()

daemon = ZMQHandler()
daemon.start()

  [1]: https://i.stack.imgur.com/uAPVM.png
</code>```

Body:
I have found this code on the internet and modified it with RICH table-output:
I have removed all the code that is not neccessary to understand (all the imports and so on).
My PROBLEM is, that the Table repeats itself. But there is NO loop for building the table. Is it because of the asyncio ? Maybe I should use an other method of printing the table ?

[![enter image description here][1]][1]

table = Table(title="Unconfirmed Transactions", show_header=True)
table.add_column("Counter", justify="right", style="cyan")
#more columns added here

class ZMQHandler():
    def __init__(self):
        self.loop = asyncio.get_event_loop()
        self.zmqContext = zmq.asyncio.Context()
        self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
        self.zmqSubSocket.setsockopt(zmq.RCVHWM, 0)
        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "sequence")
        self.zmqSubSocket.connect("tcp://127.0.0.1:%i" % port)

    async def handle(self) :

        #code stripped

        table.add_row(str(counter), str(dataset[i][0]), str(a), str(b), amount_string, c)
        asyncio.ensure_future(self.handle())

    def start(self):
        self.loop.add_signal_handler(signal.SIGINT, self.stop)
        self.loop.create_task(self.handle())
        self.loop.run_forever()

    def stop(self):
        self.loop.stop()
        self.zmqContext.destroy()

daemon = ZMQHandler()
daemon.start()

  [1]: https://i.stack.imgur.com/uAPVM.png


问:
Deleting a Managed Table Without Deleting Underlying Data in Databricks
I am looking for a way to delete a Managed table without deleting the underlying data in Databricks.

I accidentally created a Managed table on top of the data stored in my mounted storage account when I was actually looking to create an External (Unmanaged) table.

Is there a way to do this? Maybe 'delete' is actually not the correct term here and what I am looking for is a way to de-register the table from the hive metastore?


问:
How to modify grid-area of the element in javascript?
I am trying to do carousel in testimonials section. I have used grid to create the layout. So I would want to decrease each element position in the grid colums by -1 each time the item disappears and new one is being displayed.

My site:
https://wandawix.github.io/online-zoo-js/index.html

My full code:
https://github.com/WandaWix/online-zoo-js

`

```<code>/ Testimonials carousel ----------------------------------------------------------
// every testimonial is a slide, 1 2 3 4 -> click 2 3 4 5 -> click 3 4 5 6 -> 4 5 6 7 -> 5 6 7 8 -> 6 7 8 1

const sliders = document.querySelector('#testiInput'); //input name?

const p = document.querySelector('#valueTestimonials');

// console.log(p.innerHTML = 'lul');
const showNumber = () => {

    let testi1 = document.querySelector('.testi1');
    let testi2 = document.querySelector('.testi2');
    let testi3 = document.querySelector('.testi3');
    let testi4 = document.querySelector('.testi4');
    let testi5 = document.querySelector('.testi5');
    let testi6 = document.querySelector('.testi6');
    let testi7 = document.querySelector('.testi7');
    let testi8 = document.querySelector('.testi8');
    // console.log(testi1);

    let slide2 = document.querySelectorAll('.slide2');
    // console.log(slide2);
    let testimonials = [testi1, testi2, testi3, testi4, testi5, testi6, testi7, testi8];
    // console.log(testimonials);

    p.innerText = sliders.value;
    // console.log(sliders);
    let testiIndex = sliders.value;
    console.log(testiIndex);
    for(let i=0; i < testiIndex; i++) {
      slide2[i].style.display = 'none';

    }

    let lastSlide = testiIndex + 4;
    for(let i=testiIndex; i < lastSlide&& i < slide2.length; i++){
        slide2[i].style.display = 'block';

    }
    for(let i = lastSlide; i < 8; i++) {
        slide2[i].style.display = 'none';
    }
}

sliders.addEventListener('change', showNumber);

</code>```

`

I know this code isn't supposed to work but I want something like this
`

```<code> // slide 2 should be decreased by 1 column

    slide2[i].style.gridArea = ' x / x-1 / x / x-1';
</code>```

`

Body:
I am trying to do carousel in testimonials section. I have used grid to create the layout. So I would want to decrease each element position in the grid colums by -1 each time the item disappears and new one is being displayed.

My site:
https://wandawix.github.io/online-zoo-js/index.html

My full code:
https://github.com/WandaWix/online-zoo-js

`

/ Testimonials carousel ----------------------------------------------------------
// every testimonial is a slide, 1 2 3 4 -> click 2 3 4 5 -> click 3 4 5 6 -> 4 5 6 7 -> 5 6 7 8 -> 6 7 8 1

const sliders = document.querySelector('#testiInput'); //input name?

const p = document.querySelector('#valueTestimonials');

// console.log(p.innerHTML = 'lul');
const showNumber = () => {

    let testi1 = document.querySelector('.testi1');
    let testi2 = document.querySelector('.testi2');
    let testi3 = document.querySelector('.testi3');
    let testi4 = document.querySelector('.testi4');
    let testi5 = document.querySelector('.testi5');
    let testi6 = document.querySelector('.testi6');
    let testi7 = document.querySelector('.testi7');
    let testi8 = document.querySelector('.testi8');
    // console.log(testi1);

    let slide2 = document.querySelectorAll('.slide2');
    // console.log(slide2);
    let testimonials = [testi1, testi2, testi3, testi4, testi5, testi6, testi7, testi8];
    // console.log(testimonials);

    p.innerText = sliders.value;
    // console.log(sliders);
    let testiIndex = sliders.value;
    console.log(testiIndex);
    for(let i=0; i < testiIndex; i++) {
      slide2[i].style.display = 'none';

    }

    let lastSlide = testiIndex + 4;
    for(let i=testiIndex; i < lastSlide&& i < slide2.length; i++){
        slide2[i].style.display = 'block';

    }
    for(let i = lastSlide; i < 8; i++) {
        slide2[i].style.display = 'none';
    }
}

sliders.addEventListener('change', showNumber);

`

I know this code isn't supposed to work but I want something like this
`

 // slide 2 should be decreased by 1 column

    slide2[i].style.gridArea = ' x / x-1 / x / x-1';

`


问:
How to run Python files with Airflow using Samba connection
I have the following problem. I have a data pipeline at work that transforms raw data and loads it to a cloud database, for various projects. There are Python scripts for the project-based transformations, but everything must be done manually (defining the transformer's project-based inputs, run the transformer, load the data).

I want to automate this process with Airflow. I created the above steps as tasks in Python. The Airflow instance is running on some computer, which must reach a network drive, where the raw data and the transformer scripts are located. The required connection type is Samba.

I managed to connect to the drive and create a SambaHook object:

```<code>samba_file_share: Final[object] = SambaHook(connection_id, file_share_name)
</code>```

In one task, I need to call and run the transformer script. With a former solution (without Samba) I used Popen, which worked fine. However, I must use Samba now, and I face the following problem.

I have the path of the transformer script by reading out the root folder of the file share from the Samba object, and join the path of the transformer  to it:

```<code>samba_file_share._join_path(transformer_path)
</code>```

If I print this out, the path is correct, and the network is available. If I fed it as a string to Popen (or byte string or path-like object) I got the error "No such file or directory".

Can anyone help with it? How can I fed it to Popen to run the script; or should I use something else, not Popen, to run it? The Samba documentation is totally incomplete, I could not found anything there so far.

Thanks,
Marci

This automated Airflow solution works perfectly if I connect from a machine that easily access the network drive.

However, that is only for development, and in production it must run in some other machine which has no direct access to the drive. I must use Samba to connect to it, and it breaks everything.

Body:
I have the following problem. I have a data pipeline at work that transforms raw data and loads it to a cloud database, for various projects. There are Python scripts for the project-based transformations, but everything must be done manually (defining the transformer's project-based inputs, run the transformer, load the data).

I want to automate this process with Airflow. I created the above steps as tasks in Python. The Airflow instance is running on some computer, which must reach a network drive, where the raw data and the transformer scripts are located. The required connection type is Samba.

I managed to connect to the drive and create a SambaHook object:

samba_file_share: Final[object] = SambaHook(connection_id, file_share_name)

In one task, I need to call and run the transformer script. With a former solution (without Samba) I used Popen, which worked fine. However, I must use Samba now, and I face the following problem.

I have the path of the transformer script by reading out the root folder of the file share from the Samba object, and join the path of the transformer  to it:

samba_file_share._join_path(transformer_path)

If I print this out, the path is correct, and the network is available. If I fed it as a string to Popen (or byte string or path-like object) I got the error "No such file or directory".

Can anyone help with it? How can I fed it to Popen to run the script; or should I use something else, not Popen, to run it? The Samba documentation is totally incomplete, I could not found anything there so far.

Thanks,
Marci

This automated Airflow solution works perfectly if I connect from a machine that easily access the network drive.

However, that is only for development, and in production it must run in some other machine which has no direct access to the drive. I must use Samba to connect to it, and it breaks everything.


问:
How to send defined parameter with pug
How do I send indhotel parameters to /hotels?

```<code>
html
    head
    body
    each indhotell in hotell
        .row
            .col.s12.m7
                .card
                    .card-action
                        a(href='hotel?#{indhotell}') This is a link

</code>```
```<code>
app.get('/hotel', (req, res) => {
    res.render('hotel');
});

</code>```

hotel parameters:

```<code>
  {
    hotell_id: 30,
    rating: 7,
    address: '3270 Bennie Freeway',
    image: 'https://media.istockphoto.com/photos=',
    description: 'The hotel is easily accessible with different types of
 transportation.'
  }

</code>```

I tried ending separate values like indhotell.rating but result was same https:link.port/hotel?#indhotell.rating :(

Title: How to send defined parameter with pug

Body:
How do I send indhotel parameters to /hotels?

html
    head
    body
    each indhotell in hotell
        .row
            .col.s12.m7
                .card
                    .card-action
                        a(href='hotel?#{indhotell}') This is a link

app.get('/hotel', (req, res) => {
    res.render('hotel');
});

hotel parameters:

  {
    hotell_id: 30,
    rating: 7,
    address: '3270 Bennie Freeway',
    image: 'https://media.istockphoto.com/photos=',
    description: 'The hotel is easily accessible with different types of
 transportation.'
  }

I tried ending separate values like indhotell.rating but result was same https:link.port/hotel?#indhotell.rating :(


问:
superset api using tokens get via oauth
i have setup superset with oauth in keycloak sso
in web is is woking ok using cookies
but for superset api we need to use a token
superset is a flask based app
using configs we setup:

```<code>    JWT_ALGORITHM = 'RS256'
    JWT_PUBLIC_KEY = """
    -----BEGIN PUBLIC KEY-----
    public_key_was_here
    -----END PUBLIC KEY-----
    """

</code>```

get token using command :

```<code>export TOKEN=`curl --request POST "$SSO_URL/auth/realms/$SSO_REALM/protocol/openid-connect/token?redirect_uri=$SUPERSET_URL/oauth-authorized/ozon_sso" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "username=$USERNAME" \
--data-urlencode "password=$PASSWORD" \
--data-urlencode 'scope=email profile roles' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=k8s.superset' \
--data-urlencode "client_secret=$SSO_CLIENT_SECRET" | jq -r .access_token`
</code>```

and then try to use it on superset:

```<code>curl -L --request GET $SUPERSET_URL/api/v1/dashboard/ --header "Authorization: Bearer $TOKEN" > ./dashboard_list.txt

</code>```

and get a error in applications
seems like it unable to decode a token or key is incorrect

```<code>2022-12-15 07:24:00,487:ERROR:superset.views.base:invalid literal for int() with base 10: '674792eb-e01e-45b6-ad2e-75979db3d601'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 94, in wraps
    verify_jwt_in_request()
  File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/view_decorators.py", line 83, in verify_jwt_in_request
    _request_ctx_stack.top.jwt_user = _load_user(jwt_header, jwt_data)
  File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/view_decorators.py", line 141, in _load_user
    user = user_lookup(jwt_header, jwt_data)
  File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/internal_utils.py", line 25, in user_lookup
    return jwt_manager._user_lookup_callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/manager.py", line 2042, in load_user_jwt
    user = self.load_user(identity)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/manager.py", line 2038, in load_user
    return self.get_user_by_id(int(pk))
ValueError: invalid literal for int() with base 10: '674792eb-e01e-45b6-ad2e-75979db3d601'
10.220.74.237 - - [15/Dec/2022:07:24:00 +0000] "GET /api/v1/dashboard/ HTTP/1.1" 500 2337 "-" "curl/7.29.0"
</code>```

and i don't know where to dig

Title: superset api using tokens get via oauth

Body:
i have setup superset with oauth in keycloak sso
in web is is woking ok using cookies
but for superset api we need to use a token
superset is a flask based app
using configs we setup:

    JWT_ALGORITHM = 'RS256'
    JWT_PUBLIC_KEY = """
    -----BEGIN PUBLIC KEY-----
    public_key_was_here
    -----END PUBLIC KEY-----
    """

get token using command :

export TOKEN=`curl --request POST "$SSO_URL/auth/realms/$SSO_REALM/protocol/openid-connect/token?redirect_uri=$SUPERSET_URL/oauth-authorized/ozon_sso" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "username=$USERNAME" \
--data-urlencode "password=$PASSWORD" \
--data-urlencode 'scope=email profile roles' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=k8s.superset' \
--data-urlencode "client_secret=$SSO_CLIENT_SECRET" | jq -r .access_token`

and then try to use it on superset:

curl -L --request GET $SUPERSET_URL/api/v1/dashboard/ --header "Authorization: Bearer $TOKEN" > ./dashboard_list.txt

and get a error in applications
seems like it unable to decode a token or key is incorrect

2022-12-15 07:24:00,487:ERROR:superset.views.base:invalid literal for int() with base 10: '674792eb-e01e-45b6-ad2e-75979db3d601'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 94, in wraps
    verify_jwt_in_request()
  File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/view_decorators.py", line 83, in verify_jwt_in_request
    _request_ctx_stack.top.jwt_user = _load_user(jwt_header, jwt_data)
  File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/view_decorators.py", line 141, in _load_user
    user = user_lookup(jwt_header, jwt_data)
  File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/internal_utils.py", line 25, in user_lookup
    return jwt_manager._user_lookup_callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/manager.py", line 2042, in load_user_jwt
    user = self.load_user(identity)
  File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/manager.py", line 2038, in load_user
    return self.get_user_by_id(int(pk))
ValueError: invalid literal for int() with base 10: '674792eb-e01e-45b6-ad2e-75979db3d601'
10.220.74.237 - - [15/Dec/2022:07:24:00 +0000] "GET /api/v1/dashboard/ HTTP/1.1" 500 2337 "-" "curl/7.29.0"

and i don't know where to dig


问:
Downloading a file using curl or wget whose link is not given?
Here is the link of the file

```<code>https://rec.ustc.edu.cn/share/031c0580-0366-11ed-bb15-47281881a56b
</code>```

it there is a zip file which can be downloaded when clicked on download option
one cant copy that link to download using wget or curl

I tried

```<code>wget https://rec.ustc.edu.cn/share/031c0580-0366-11ed-bb15-47281881a56b
</code>```

and it wont download the file

is it doable in this case?
if so , how

Thanks

Body:
Here is the link of the file

https://rec.ustc.edu.cn/share/031c0580-0366-11ed-bb15-47281881a56b

it there is a zip file which can be downloaded when clicked on download option
one cant copy that link to download using wget or curl

I tried

wget https://rec.ustc.edu.cn/share/031c0580-0366-11ed-bb15-47281881a56b

and it wont download the file

is it doable in this case?
if so , how

Thanks


问:
Laravel storage with dynamic folder
I store my post media files in default Laravel store, like that:

storage/app/public/attachments/post/{post_id}/

How can I create a link to media content so that it looks like this:

http://127.0.0.1/post

but led to my post storage/app/public/attachments/post/{post_id}/ ?

Title: Laravel storage with dynamic folder


问:
Tuckey library for specific url pattern
I'm facing a problem.my company's website like http://localhost:8080/Product/Pages/Home.jsp
but when tried like http://localhost:8080/Product/Pa/ges/Home.jsp  website tries to direct our 404 error page but not a proper way(comes a lot of errors and cant load the page) I guess It is about an apache tomcat bug ---> https://bz.apache.org/bugzilla/show_bug.cgi?id=61634
so, i am trying to implement tuckey library but I cant find a proper way to just let /Product/Pages/foo.jsp pattern.here is tuckey lib explanation --> http://tuckey.org/urlrewrite/manual/3.0/

I hope somebody can help me

I tried this rule and it redirect for old page.I am saying this, I can use this lib.But I cant figure out to which rule is proper for me.

            /some/old/page.html
            /very/new/page.html

Title: Tuckey library for specific url pattern


问:
Why do I get "Integrity constraint violation" error, even though my tables are empty and constraint is set to "NO ACTION"?
I have an empty table amasty_audit_log_details with the following constraint:

(The table in the screenshot is "amasty_audit_log_entry")

I also tried to change "On Update" and "On Delete" to NO UPDATE but I get the same error.

Error:

```<code>SQLSTATE[23000]: Integrity constraint violation:
1452 Cannot add or update a child row: a foreign key constraint fails

    `xxxxxxx_28072022`.`amasty_audit_log_details`,
    CONSTRAINT `AMASTY_AUDIT_LOG_DETAILS_LOG_ID_AMASTY_AUDIT_LOG_ENTRY_ID`
    FOREIGN KEY (`log_id`)
    REFERENCES `amasty_audit_log_entry`

query was:

    INSERT INTO `amasty_audit_log_details` (`log_id`, `name`, `old_value`, `new_value`, `model`) VALUES (?, ?, ?, ?, ?)
</code>```

The table amasty_audit_log_entry is also empty.

What might be the cause?

More Details:

amasty_audit_log_details:

```<code>CREATE TABLE IF NOT EXISTS `amasty_audit_log_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log Detail ID',
  `log_id` int(10) unsigned NOT NULL COMMENT 'Log Entry ID',
  `name` text DEFAULT NULL COMMENT 'Name',
  `old_value` text DEFAULT NULL COMMENT 'Old Value',
  `new_value` text DEFAULT NULL COMMENT 'New Value',
  `model` text DEFAULT NULL COMMENT 'Model',
  PRIMARY KEY (`id`),
  KEY `idx_amasty_amaudit_details_log_id` (`log_id`),
  KEY `AMASTY_AUDIT_LOG_DETAILS_LOG_ID` (`log_id`),
  CONSTRAINT `AMASTY_AUDIT_LOG_DETAILS_LOG_ID_AMASTY_AUDIT_LOG_ENTRY_ID` FOREIGN KEY (`log_id`) REFERENCES `amasty_audit_log_entry` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='Amasty Admin Actions Log Log Detail Table';
</code>```

amasty_audit_log_entry:

```<code>CREATE TABLE IF NOT EXISTS `amasty_audit_log_entry` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log Entry ID',
  `date` datetime DEFAULT NULL COMMENT 'Log Entry Date',
  `username` varchar(40) DEFAULT NULL COMMENT 'Log Entry Username',
  `type` varchar(70) DEFAULT NULL COMMENT 'Log Entry Type',
  `category` varchar(255) DEFAULT NULL COMMENT 'Log Entry Category',
  `category_name` varchar(255) DEFAULT NULL COMMENT 'Log Entry Category Name',
  `parameter_name` varchar(255) DEFAULT NULL COMMENT 'Log Entry Parameter Name',
  `element_id` int(10) unsigned NOT NULL COMMENT 'Log Entry Element ID',
  `item` text DEFAULT NULL COMMENT 'Log Entry Item',
  `ip` varchar(30) DEFAULT NULL COMMENT 'Log Entry Item',
  `store_id` int(10) unsigned DEFAULT NULL COMMENT 'Log Entry Store ID',
  `additional_data` blob DEFAULT NULL COMMENT 'Additional serialized data',
  PRIMARY KEY (`id`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_USERNAME` (`username`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_CATEGORY` (`category`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_ELEMENT_ID` (`element_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Amasty Admin Actions Log Entry Table';
</code>```

Body:
I have an empty table amasty_audit_log_details with the following constraint:

(The table in the screenshot is "amasty_audit_log_entry")

I also tried to change "On Update" and "On Delete" to NO UPDATE but I get the same error.

Error:

SQLSTATE[23000]: Integrity constraint violation:
1452 Cannot add or update a child row: a foreign key constraint fails

    `xxxxxxx_28072022`.`amasty_audit_log_details`,
    CONSTRAINT `AMASTY_AUDIT_LOG_DETAILS_LOG_ID_AMASTY_AUDIT_LOG_ENTRY_ID`
    FOREIGN KEY (`log_id`)
    REFERENCES `amasty_audit_log_entry`

query was:

    INSERT INTO `amasty_audit_log_details` (`log_id`, `name`, `old_value`, `new_value`, `model`) VALUES (?, ?, ?, ?, ?)

The table amasty_audit_log_entry is also empty.

What might be the cause?

More Details:

amasty_audit_log_details:

CREATE TABLE IF NOT EXISTS `amasty_audit_log_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log Detail ID',
  `log_id` int(10) unsigned NOT NULL COMMENT 'Log Entry ID',
  `name` text DEFAULT NULL COMMENT 'Name',
  `old_value` text DEFAULT NULL COMMENT 'Old Value',
  `new_value` text DEFAULT NULL COMMENT 'New Value',
  `model` text DEFAULT NULL COMMENT 'Model',
  PRIMARY KEY (`id`),
  KEY `idx_amasty_amaudit_details_log_id` (`log_id`),
  KEY `AMASTY_AUDIT_LOG_DETAILS_LOG_ID` (`log_id`),
  CONSTRAINT `AMASTY_AUDIT_LOG_DETAILS_LOG_ID_AMASTY_AUDIT_LOG_ENTRY_ID` FOREIGN KEY (`log_id`) REFERENCES `amasty_audit_log_entry` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='Amasty Admin Actions Log Log Detail Table';

amasty_audit_log_entry:

CREATE TABLE IF NOT EXISTS `amasty_audit_log_entry` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log Entry ID',
  `date` datetime DEFAULT NULL COMMENT 'Log Entry Date',
  `username` varchar(40) DEFAULT NULL COMMENT 'Log Entry Username',
  `type` varchar(70) DEFAULT NULL COMMENT 'Log Entry Type',
  `category` varchar(255) DEFAULT NULL COMMENT 'Log Entry Category',
  `category_name` varchar(255) DEFAULT NULL COMMENT 'Log Entry Category Name',
  `parameter_name` varchar(255) DEFAULT NULL COMMENT 'Log Entry Parameter Name',
  `element_id` int(10) unsigned NOT NULL COMMENT 'Log Entry Element ID',
  `item` text DEFAULT NULL COMMENT 'Log Entry Item',
  `ip` varchar(30) DEFAULT NULL COMMENT 'Log Entry Item',
  `store_id` int(10) unsigned DEFAULT NULL COMMENT 'Log Entry Store ID',
  `additional_data` blob DEFAULT NULL COMMENT 'Additional serialized data',
  PRIMARY KEY (`id`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_USERNAME` (`username`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_CATEGORY` (`category`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_ELEMENT_ID` (`element_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Amasty Admin Actions Log Entry Table';


问:
macOS and podman, port 53 issue
I am trying to run Pi-hole in a podman container on macOS:

```<code>podman machine init
podman machine set --rootful=true
podman machine start
podman run -d --name=pihole --restart always -e TZ=Europe/Zurich -e WEBPASSWORD=admin -e FTLCONF_LOCAL_IPV4=192.168.1.4 -e ServerIP=192.168.1.4 -e PIHOLE_DNS_=1.1.1.1 --cap-add=NET_ADMIN -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 pihole/pihole:latest
</code>```

fails with:

```<code>Error: cannot listen on the TCP port: listen tcp4 :53: bind: address already in use
</code>```

using lsof I cannot see anything listening on my port 53

Title: macOS and podman, port 53 issue

Body:
I am trying to run Pi-hole in a podman container on macOS:

podman machine init
podman machine set --rootful=true
podman machine start
podman run -d --name=pihole --restart always -e TZ=Europe/Zurich -e WEBPASSWORD=admin -e FTLCONF_LOCAL_IPV4=192.168.1.4 -e ServerIP=192.168.1.4 -e PIHOLE_DNS_=1.1.1.1 --cap-add=NET_ADMIN -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 pihole/pihole:latest

fails with:

Error: cannot listen on the TCP port: listen tcp4 :53: bind: address already in use

using lsof I cannot see anything listening on my port 53


问:
VS2022 [C# , .NET 6] reference third party .dll with path, instead of including in build
We are working on a project that uses image/object detection. The third party .dlls are huge. We are talking 2-3 GB in total.
I would like to reference these .dlls in a way that the application at runtime uses a path e.g. C:\externalLibs to look for the referenced .dlls and load them into memory.

I know about the properties to not copy it locally "Copy local - false" but that doesn't seem to work. Also I can't even find all of the mentioned dlls in the properties.

I can provide more information if needed, just ask ahead! :)