问:
How to drop values in nested struct if data type is null
I have data structure like below shown. What I want is to drop certain values within field3(struct) if the data type is null, and also drop field3.ZZZ completely if ZZZ data type is null.

```<code> root
 |-- field1: string (nullable = true)
 |-- field2: struct (nullable = true)
 |-- field3: struct (nullable = true)
 |    |-- XXX: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- s: array (nullable = true)
 |    |    |    |    |-- element: struct (containsNull = true)
 |    |    |    |    |    |-- v: string (nullable = true)
 |    |    |    |-- v: long (nullable = true)
 |    |-- YYY: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- s: array (nullable = true)
 |    |    |    |    |-- element: struct (containsNull = true)
 |    |    |    |    |    |-- v: string (nullable = true)
 |    |    |    |-- v: long (nullable = true)
 |    |-- ZZZ: array (nullable = true)
 |    |    |-- element: null (containsNull = true)
</code>```

I did lots of research, but haven't found a clear way to solve this requirement. Can anyone help me on this?

Body:
I have data structure like below shown. What I want is to drop certain values within field3(struct) if the data type is null, and also drop field3.ZZZ completely if ZZZ data type is null.

 root
 |-- field1: string (nullable = true)
 |-- field2: struct (nullable = true)
 |-- field3: struct (nullable = true)
 |    |-- XXX: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- s: array (nullable = true)
 |    |    |    |    |-- element: struct (containsNull = true)
 |    |    |    |    |    |-- v: string (nullable = true)
 |    |    |    |-- v: long (nullable = true)
 |    |-- YYY: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- s: array (nullable = true)
 |    |    |    |    |-- element: struct (containsNull = true)
 |    |    |    |    |    |-- v: string (nullable = true)
 |    |    |    |-- v: long (nullable = true)
 |    |-- ZZZ: array (nullable = true)
 |    |    |-- element: null (containsNull = true)

I did lots of research, but haven't found a clear way to solve this requirement. Can anyone help me on this?


来源: stackexchange

问:
ASP.NET and jQuery and CSS - Image Upload with Dynamic Responsive Column Layout with Flex
Could someone please assist me in making this jQuery script work with the CSS to create the columns like what is seen here?
w3schools - Responsive Four Column Layout with Flex

This is the script for the columns.

```<code>   dvPreview.append('<div class="row">' +
    '<div class="column">' +
    '<div class="Sizes">' + theSize + '</div>' +
    '<div class="ImageList"><img src="' + strImage + '" style="height:100px;"></div>' +
     '</div > ' +
    '</div > ');
</code>```

Now, while looking at the above code, I got to thinking that the

```<code><div class="row">
</code>```

Did not need to be in that area but would instead need to be in the HTML.

```<code><div class="row">
    <div id="dvPreview">ss</div>
</div>
</code>```

But this also does not produce the columns as it is supposed to.

Here is an example of the code.
How to use

Run the page, and load images.

```<code>    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Load.aspx.vb" Inherits="Load" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("[id*=fuUpload]").change(function () {
                if (typeof (FileReader) != "undefined") {
                    var dvPreview = $("#dvPreview");
                    dvPreview.html("");
                    var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.jpg|.jpeg|.gif|.png|.bmp)$/;

                    $($(this)[0].files).each(function () {
                        var file = $(this);
                        // Here is where we check for the file size. This demo is set to 1mb.
                        // Change it to whatever size you need for your project.
                        // Change 1000 / 1000 -- to 5000 / 5000 = 5 in maxSize
                        const size = (file[0].size / 5000 / 5000).toFixed(2);
                        const theSize = size + (size > 1 ? "mb" : "kb");
                        var maxSize = 20 // Change this to the max allowed to upload. 1 = 1mb / 5 = 5mb / 10 = 10mb / 20 = 20mb

                        if (regex.test(file[0].name.toLowerCase())) {
                            var reader = new FileReader();
                            reader.onload = function (e) {
                                var strImage = e.target.result
                                if (size > maxSize) {
                                    dvPreview.append('File size is larger than the allowed size. (Fize Size =' + theSize + ') ' +
                                        '<br />Please upload less than ' + maxSize + 'mb per image.< br /> Upload button has been diabled.' +
                                        '<br />Please change file size to meet the requirements, <br />Refresh and Re - Upload files.')
                                    $("#btnUpload").prop('disabled', true);
                                } else {
                                    dvPreview.append('<div class="row">' +
                                        '<div class="column">' +
                                        '<div class="Sizes">' + theSize + '</div>' +
                                        '<div class="ImageList"><img src="' + strImage + '" style="height:100px;"></div>' +
                                        '</div > ' +
                                        '</div > ');
                                }
                            }
                            reader.readAsDataURL(file[0]);
                        } else {
                            dvPreview.html(file[0].name + " is not a valid image file.");
                            return false;
                        }
                    });
                } else {
                    alert("This browser does not support HTML5 FileReader.");
                }
                var maxWidth = 300;
                if ($('Upload').width() > maxWidth) $('Upload').width(maxWidth);
            });
        });
    </script>
    <style type="text/css">
    * {
      box-sizing: border-box;
    }

    /* Container for flexboxes */
    .row {
      display: flex;
      flex-wrap: wrap;
      padding-bottom:10px;
      width: 250px;
    }

    /* Create four equal columns */
    .column {

      padding: 5px;
      border:1px double #000;
    }
    div.column:nth-of-type(1){
         flex: 0.5;
    }
    div.column:nth-of-type(2){
         flex: 1;

    }
    div.column:nth-of-type(3){
         flex: 2;

    }
    /*Add in additional columns, uncomment the below, and add more. Numbering accordingly.*/
    /* div.column:nth-of-type(4){
          flex: 3;
    }*/
    /* On screens that are 992px wide or less, go from four columns to two columns */
    @media screen and (max-width: 992px) {
      .column {
        flex: 50%;
      }
    }

    /* On screens that are 600px wide or less, make the columns stack on top of each other instead of next to each other */
    @media screen and (max-width: 600px) {
      .row {
        flex-direction: column;
      }
    }
        </style>
        </head>
        <body>
            <div id="Upload">
            <%=Environment.MachineName%>
        <form id="form1" runat="server">1 mb file upload only!<br />
    <asp:FileUpload ID="fuUpload" runat="server" multiple="multiple" />
 <br />
            <asp:Label ID="IDLabel2" runat="server" Text="Label"></asp:Label>
            <asp:Label ID="IDLabel" runat="server" Text="Label"></asp:Label>
    <hr />
    <div id="dvPreview">
    </div>
        </form>
                </div>
    </body>
    </html>
</code>```

The only thing I can do is get them in a row, not columns.

Thanks.

Wayne

ContentLicense: CC BY-SA 4.0

Body:
Could someone please assist me in making this jQuery script work with the CSS to create the columns like what is seen here?
w3schools - Responsive Four Column Layout with Flex

This is the script for the columns.

   dvPreview.append('
' +
    '
' +
    '
' + theSize + '
' +
    '

' +
     '
 ' +
    '
 ');

Now, while looking at the above code, I got to thinking that the

Did not need to be in that area but would instead need to be in the HTML.

ss

But this also does not produce the columns as it is supposed to.

Here is an example of the code.
How to use

Run the page, and load images.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Load.aspx.vb" Inherits="Load" %>
    <!DOCTYPE html>

    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />

            <%=Environment.MachineName%>
        <form id="form1" runat="server">1 mb file upload only!

    <asp:FileUpload ID="fuUpload" runat="server" multiple="multiple" />

            <asp:Label ID="IDLabel2" runat="server" Text="Label"></asp:Label>
            <asp:Label ID="IDLabel" runat="server" Text="Label"></asp:Label>

        </form>

The only thing I can do is get them in a row, not columns.

Thanks.

Wayne


问:
Removing/filtering out an item from an array using the key
I have an array of images that i set in a state.

```<code>  const [imagesArray, setImagesArray] = useState(["base64code1","base64code2","base64code3" etc etc);

</code>```

I am then mapping through this array and showing the images. I want to be able to click on the image, which then calls a function - imageDelete.

```<code><View style={{display: 'flex', flexDirection: 'row'}}>
  {imagesArray.map((title, key) => (
    <TouchableOpacity
      onPress={() => {
        imageDelete(key);
      }}>
      <Image
        source={{
          uri: `data:image/jpeg;base64,${title}`,
        }}
        style={{height: 100, width: 100, margin: 5}}
      />
    </TouchableOpacity>
  ))}
</View>
</code>```

I want imageDelete to setImagesArray with a new array that doesn't include the record in the array with the key that was sent into imageDelete(key).

This is what i have, but it's not working..

```<code>  function imageDelete(key) {

    setImagesArray(imagesArray => imagesArray.filter(image => image.key !== key))

  }
</code>```

Body:
I have an array of images that i set in a state.

  const [imagesArray, setImagesArray] = useState(["base64code1","base64code2","base64code3" etc etc);

I am then mapping through this array and showing the images. I want to be able to click on the image, which then calls a function - imageDelete.

<View style={{display: 'flex', flexDirection: 'row'}}>
  {imagesArray.map((title, key) => (
    <TouchableOpacity
      onPress={() => {
        imageDelete(key);
      }}>
      <Image
        source={{
          uri: `data:image/jpeg;base64,${title}`,
        }}
        style={{height: 100, width: 100, margin: 5}}
      />
    </TouchableOpacity>
  ))}
</View>

I want imageDelete to setImagesArray with a new array that doesn't include the record in the array with the key that was sent into imageDelete(key).

This is what i have, but it's not working..

  function imageDelete(key) {

    setImagesArray(imagesArray => imagesArray.filter(image => image.key !== key))

  }


问:
Why is material icons CSS a higher priority than my Tailwind CSS only in my Vercel deployment?
In local dev, everything is great because my Tailwind CSS is taking priority on styling my icons:

However, once I've deployed my app (Vite on Vercel), for some reason the Material Icons style takes priority:

This is my index.html:

```<code><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/png+xml" href="/favicon.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Come on now!</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.jsx"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
    <script>
      WebFont.load({
        google: {
          families: ['Roboto:400,700', 'Material+Icons']
        }
      });
    </script>
  </body>
</html>
</code>```

I think I could probably apply !important to my Tailwind config but that's clearly not the right answer.

Body:
In local dev, everything is great because my Tailwind CSS is taking priority on styling my icons:

However, once I've deployed my app (Vite on Vercel), for some reason the Material Icons style takes priority:

This is my index.html:

<!DOCTYPE html>

    <meta charset="UTF-8" />
    <link rel="icon" type="image/png+xml" href="/favicon.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Come on now!</title>

I think I could probably apply !important to my Tailwind config but that's clearly not the right answer.


问:
override multiple properties defined in multiple files at once, including @Qualifier Properties properties
So, I got a very chaotic legacy project to work on, it is stuck in spring-boot.version 2.5.13.

The main has the import resource tag, similar to this

```<code>@Configuration
@ImportResource("classpath:app-context.xml")
@EnableAutoConfiguration(exclude = {SpringDataWebAutoConfiguration.class, ValidationAutoConfiguration.class})
public class Main {

    public static void main(String[] args) {
        SpringApplication.run(Main.class, args);
    }
}
</code>```

the app-context.xml has the property-placeholder imports

```<code><context:property-placeholder
        location="classpath:application.properties,file:ext/application.properties,classpath:somemodule.properties" />
<import resource="classpath:app-scope.xml" />
<import resource="classpath:app-this.xml" />
<import resource="classpath:app-that.xml" />
</code>```

and each file has its on import like

```<code>moduleX.properties.location=etc/morepropertiesX.properties
moduleY.properties.location=config/morepropertiesY.properties
moduleZ.properties.location=morepropertiesZ.properties
</code>```

so, it is bleeding configuration all over the place, some .yaml, some .properties, some .xml...

So, I couldn't find a way to just have one file, maybe a profile or something, that I could change all properties needed at once, something that I can just add to the ignore list on git, or maybe have an external arg on the IDE runner.

I tried making use of the the default properties like this

```<code>@Configuration
@ImportResource("classpath:appl-context.xml")
@EnableAutoConfiguration(exclude = {SpringDataWebAutoConfiguration.class, ValidationAutoConfiguration.class})
public class Main {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Main.class);

        java.util.Map<String, Object> localProperties = new java.util.HashMap<>();
        localProperties.put("someProperty.A", "some value A");
        localProperties.put("someProperty.B", "some value B");
        localProperties.put("someNewPropertyTest", "some new value");
        app.setDefaultProperties(localProperties);

        app.run(args);
        //SpringApplication.run(Main.class, args);
    }
}
</code>```

this would allow to have the changes only here, or maybe a new class and only point to that class, and add it to the ignore list on git. But the existing properties values are still there, not being overridden and the new property still NULL. So checking the class that I was trying to inject the properties, it reads it with @Qualifed property name :(

something like this

```<code>@Component
public class SomeClass{
    public SomeClass(@Qualifier(value = "somemodule.properties") final Properties properties) {
        final String propertyA = properties.getProperty("someProperty.A"));
        final String propertyB = properties.getProperty("someProperty.B"));
        final String newProperty = properties.getProperty("someNewPropertyTest"));
        /**......**/
    }
}
</code>```

so in this case, the property A and B still holds the value defined on the property file itself, and the new property just returns null as it does not exists on the original file.

Any ideas on how to have those properties overridden, even with the @Qualifier annotation?
It doesn't need to be pretty, just need to make life easier, specially when we have to change people on the team, it is always a nightmare to go over all gazilion configuration files

Body:
So, I got a very chaotic legacy project to work on, it is stuck in spring-boot.version 2.5.13.

The main has the import resource tag, similar to this

@Configuration
@ImportResource("classpath:app-context.xml")
@EnableAutoConfiguration(exclude = {SpringDataWebAutoConfiguration.class, ValidationAutoConfiguration.class})
public class Main {

    public static void main(String[] args) {
        SpringApplication.run(Main.class, args);
    }
}

the app-context.xml has the property-placeholder imports

<context:property-placeholder
        location="classpath:application.properties,file:ext/application.properties,classpath:somemodule.properties" />
<import resource="classpath:app-scope.xml" />
<import resource="classpath:app-this.xml" />
<import resource="classpath:app-that.xml" />

and each file has its on import like

moduleX.properties.location=etc/morepropertiesX.properties
moduleY.properties.location=config/morepropertiesY.properties
moduleZ.properties.location=morepropertiesZ.properties

so, it is bleeding configuration all over the place, some .yaml, some .properties, some .xml...

So, I couldn't find a way to just have one file, maybe a profile or something, that I could change all properties needed at once, something that I can just add to the ignore list on git, or maybe have an external arg on the IDE runner.

I tried making use of the the default properties like this

@Configuration
@ImportResource("classpath:appl-context.xml")
@EnableAutoConfiguration(exclude = {SpringDataWebAutoConfiguration.class, ValidationAutoConfiguration.class})
public class Main {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Main.class);

        java.util.Map<String, Object> localProperties = new java.util.HashMap<>();
        localProperties.put("someProperty.A", "some value A");
        localProperties.put("someProperty.B", "some value B");
        localProperties.put("someNewPropertyTest", "some new value");
        app.setDefaultProperties(localProperties);

        app.run(args);
        //SpringApplication.run(Main.class, args);
    }
}

this would allow to have the changes only here, or maybe a new class and only point to that class, and add it to the ignore list on git. But the existing properties values are still there, not being overridden and the new property still NULL. So checking the class that I was trying to inject the properties, it reads it with @Qualifed property name :(

something like this

@Component
public class SomeClass{
    public SomeClass(@Qualifier(value = "somemodule.properties") final Properties properties) {
        final String propertyA = properties.getProperty("someProperty.A"));
        final String propertyB = properties.getProperty("someProperty.B"));
        final String newProperty = properties.getProperty("someNewPropertyTest"));
        /**......**/
    }
}

so in this case, the property A and B still holds the value defined on the property file itself, and the new property just returns null as it does not exists on the original file.

Any ideas on how to have those properties overridden, even with the @Qualifier annotation?
It doesn't need to be pretty, just need to make life easier, specially when we have to change people on the team, it is always a nightmare to go over all gazilion configuration files


问:
Flutter Request Header case sensitive
While calling rest api, the request header keys converted to lower case. We have some custom header and thats need to be case sensitive.
Please let me know how to send the header as case sensitive while calling the api? I am using flutter web.

Thanks.

Title: Flutter Request Header case sensitive


问:
Excel: match date and find next value after, return date from that row
I have the following Spreadsheet.

```<code>A1:A1000 = Dates (in date order)
B1:B1000 = Values (in date order)
C1 = Date I want to look up
D1 = Value I want to look up
F1= //Answer
</code>```

I want to look for C1 in Column A and then from that row look down for a value <= D1 and then return the Date from that row in Column A to F1.

Is that possible?

Thanks in advance

```<code>Date           Price           Date to find      Value
24/9/1999       3.58             8/10/1999        3.55
1/10/1999       3.72
8/10/1999       3.57
15/10/1999      3.65
22/10/1999      3.62
29/10/1999      3.68
5/11/1999       3.66
12/11/1999      3.61
19/11/1999      3.50
</code>```

Result should be 19/11/1999

Body:
I have the following Spreadsheet.

A1:A1000 = Dates (in date order)
B1:B1000 = Values (in date order)
C1 = Date I want to look up
D1 = Value I want to look up
F1= //Answer

I want to look for C1 in Column A and then from that row look down for a value <= D1 and then return the Date from that row in Column A to F1.

Is that possible?

Thanks in advance

Date           Price           Date to find      Value
24/9/1999       3.58             8/10/1999        3.55
1/10/1999       3.72
8/10/1999       3.57
15/10/1999      3.65
22/10/1999      3.62
29/10/1999      3.68
5/11/1999       3.66
12/11/1999      3.61
19/11/1999      3.50

Result should be 19/11/1999


问:
opendkim, multiple domains, managing senders
Correct me if I'm wrong please.  Once you've created a list of "trusted hosts" and one or more dkim keys in the keytable and domain table, there's no way to say that ONLY "trusted host" A can send email as A.COM and have it DKIM signed and trusted host B can ONLY send email as B.COM and have the mail DKIM signed.  Either trusted host could send as either domain and the mailer is going to ask DKIM if they are trusted hosts and have dkim sign the mail if they are.  or am I missing something?

From my attempts, it doesn't matter where the mail comes from as long as it's trusted, opendkim will sign it.


问:
how to change the icon the is displaying with translate option in css?
I have react component that renders some title with the icon set as a prop. Icon should get change with transform: translate (Upside Down) option with styled components. Basically, when component in clicked the icon should be ↓  and when not clicked ↑.  Can you please advise how can I achieve this? I have defined icon as a prop, but not sure how this icon can change over this option ?

This is components:

```<code>import { string, node, oneOf,  } from "prop-types"
import * as Styled from "./Accordion.styled"
import Icon from "design-system/components/icon"
import React, { useState } from 'react'

const Accordion = ({ children, icon, text, button,
  color, activeColor,  }) =>  {
  const [isActive, setIsActive] = useState(false);
  return (
  <Styled.Accordion
  color={isActive ? activeColor : color}
  >
    <Styled.Title  onClick={() => setIsActive(!isActive)}
    color={isActive ? activeColor : color}
    activeColor={isActive ? activeColor : color}
    > {text}
    <Styled.Icon
    color={isActive ? activeColor : color}
    activeColor={isActive ? activeColor : color}
    >
    <Icon name={icon}/>
    </Styled.Icon>
    </Styled.Title>
    {isActive &&
    <Styled.Content
    color={isActive ? activeColor : color}
    activeColor={isActive ? activeColor : color}
    >
    {children}
    {button}
    </Styled.Content>
    }
  </Styled.Accordion>
);
}

Accordion.propTypes = {
  text: string.isRequired,
  children: node.isRequired,
  icon: string,
  name: string,
  button: node,
  color: oneOf(["primary", "neutrals", "grey", "white", "white with Button", ]),
  activeColor: oneOf(["primary", "neutrals", "grey", "white", "white with Button",]),
}

Accordion.defaultProps = {
  children: null,
  icon: null,
  name: null,
  button: null,
  color: "grey",
  activeColor: "grey",
}

export default Accordion
</code>```

and the styles:

```<code>import styled from "@emotion/styled"
import { css } from "@emotion/react"
import theme from "design-system/theme"

export const Accordion = styled.div`
  display: flex;
  text-decoration: none;
  border-radius: 10px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  border-radius: 10px;
  width: 100%;
  height: 20%;
 `
export const Title = styled.div`
  display: block;
  float: right;
  text-decoration: none;
  width: 200px;
  height: 50px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  padding-left: 10px;
  padding-top: 10px;
  border-radius: 10px 10px 0px 0px;
  background-color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor ) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.grey[600]
      case "primary":
        return theme.colors.neutrals[100]
      case "white":
        return theme.colors.neutrals[100]
      case "white with Button":
        return theme.colors.neutrals[100]
      case "black with Button":
          return theme.colors.grey[600]
      default:
        return theme.colors.neutrals[600]
    }
  }};
  color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.primary[500]
      case "primary":
        return theme.colors.grey[600]
        case "white":
        return theme.colors.primary[500]
      case "white with Button":
          return theme.colors.grey[600]
      case "black with Button":
            return theme.colors.neutrals[100]
      default:
        return theme.colors.grey[600]
    }
  }};
`

export const Content = styled.div`
  border-radius: 0px 0px 10px 10px;
  text-decoration: none;
  width: 200px;
  height: 150px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  padding-left: 10px;
  background-color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor ) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.neutrals[100]
      case "primary":
        return theme.colors.neutrals[100]
      case "white":
          return theme.colors.neutrals[100]
      case "white with Button":
            return theme.colors.neutrals[100]
      default:
        return theme.colors.neutrals[100]
    }
  }};
  color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor) {
      case "grey":
        return theme.colors.neutrals[100]
      case "neutrals":
        return theme.colors.neutrals[100]
      case "primary":
        return theme.colors.grey[600]
      case "white with Button":
          return theme.colors.grey[600]
      default:
        return theme.colors.grey[600]
    }
  }};
`

  export const Icon = styled.div`
  float: right;
  border-radius: 10px;
  padding-right: 10px;
  background-color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor ) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.grey[600]
      case "primary":
        return theme.colors.neutrals[100]
      case "white":
        return theme.colors.neutrals[100]
      case "white with Button":
          return theme.colors.neutrals[100]
      default:
        return theme.colors.grey[600]
    }
  }};
  color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor) {
      case "grey":
        return theme.colors.neutrals[100]
      case "neutrals":
        return theme.colors.primary[500]
      case "primary":
        return theme.colors.grey[600]
        case "white":
        return theme.colors.primary[500]
      case "white with Button":
          return theme.colors.primary[500]
      default:
        return theme.colors.grey[600]
    }
  }};
  `
</code>```

Any

Body:
I have react component that renders some title with the icon set as a prop. Icon should get change with transform: translate (Upside Down) option with styled components. Basically, when component in clicked the icon should be ↓  and when not clicked ↑.  Can you please advise how can I achieve this? I have defined icon as a prop, but not sure how this icon can change over this option ?

This is components:

import { string, node, oneOf,  } from "prop-types"
import * as Styled from "./Accordion.styled"
import Icon from "design-system/components/icon"
import React, { useState } from 'react'

const Accordion = ({ children, icon, text, button,
  color, activeColor,  }) =>  {
  const [isActive, setIsActive] = useState(false);
  return (

    </Styled.Title>
    {isActive &&

    }
  </Styled.Accordion>
);
}

Accordion.propTypes = {
  text: string.isRequired,
  children: node.isRequired,
  icon: string,
  name: string,
  button: node,
  color: oneOf(["primary", "neutrals", "grey", "white", "white with Button", ]),
  activeColor: oneOf(["primary", "neutrals", "grey", "white", "white with Button",]),
}

Accordion.defaultProps = {
  children: null,
  icon: null,
  name: null,
  button: null,
  color: "grey",
  activeColor: "grey",
}

export default Accordion

and the styles:

import styled from "@emotion/styled"
import { css } from "@emotion/react"
import theme from "design-system/theme"

export const Accordion = styled.div`
  display: flex;
  text-decoration: none;
  border-radius: 10px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  border-radius: 10px;
  width: 100%;
  height: 20%;
 `
export const Title = styled.div`
  display: block;
  float: right;
  text-decoration: none;
  width: 200px;
  height: 50px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  padding-left: 10px;
  padding-top: 10px;
  border-radius: 10px 10px 0px 0px;
  background-color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor ) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.grey[600]
      case "primary":
        return theme.colors.neutrals[100]
      case "white":
        return theme.colors.neutrals[100]
      case "white with Button":
        return theme.colors.neutrals[100]
      case "black with Button":
          return theme.colors.grey[600]
      default:
        return theme.colors.neutrals[600]
    }
  }};
  color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.primary[500]
      case "primary":
        return theme.colors.grey[600]
        case "white":
        return theme.colors.primary[500]
      case "white with Button":
          return theme.colors.grey[600]
      case "black with Button":
            return theme.colors.neutrals[100]
      default:
        return theme.colors.grey[600]
    }
  }};
`

export const Content = styled.div`
  border-radius: 0px 0px 10px 10px;
  text-decoration: none;
  width: 200px;
  height: 150px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  padding-left: 10px;
  background-color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor ) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.neutrals[100]
      case "primary":
        return theme.colors.neutrals[100]
      case "white":
          return theme.colors.neutrals[100]
      case "white with Button":
            return theme.colors.neutrals[100]
      default:
        return theme.colors.neutrals[100]
    }
  }};
  color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor) {
      case "grey":
        return theme.colors.neutrals[100]
      case "neutrals":
        return theme.colors.neutrals[100]
      case "primary":
        return theme.colors.grey[600]
      case "white with Button":
          return theme.colors.grey[600]
      default:
        return theme.colors.grey[600]
    }
  }};
`

  export const Icon = styled.div`
  float: right;
  border-radius: 10px;
  padding-right: 10px;
  background-color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor ) {
      case "grey":
        return theme.colors.grey[600]
      case "neutrals":
        return theme.colors.grey[600]
      case "primary":
        return theme.colors.neutrals[100]
      case "white":
        return theme.colors.neutrals[100]
      case "white with Button":
          return theme.colors.neutrals[100]
      default:
        return theme.colors.grey[600]
    }
  }};
  color: ${({ color, activeColor, theme }) => {
    switch (color, activeColor) {
      case "grey":
        return theme.colors.neutrals[100]
      case "neutrals":
        return theme.colors.primary[500]
      case "primary":
        return theme.colors.grey[600]
        case "white":
        return theme.colors.primary[500]
      case "white with Button":
          return theme.colors.primary[500]
      default:
        return theme.colors.grey[600]
    }
  }};
  `

Any


问:
How to parse an array using templates in BeanIO?
I am trying to create a template in BeanIO that will help me create an XML file which I will be converting into a JSON file.

This is the example of JSON file that I want to create:

```<code>{
    "abc": {
        "def": [
             {
                 "fname": "James"
             }
         ]
    }
}
</code>```

Now my question is that how do I define "def" element into my template as an array and how do I define "abc" as the parent element for "def"?

I tried to create a below template:

```<code><beanio>

  <template name="def">
    <field name="fname" />
  </template>
  <template name="abc>
    <segment name="deffff" template="def" class="example.def" />
  </template>
  <stream name="deffile" format="xml">
    <include template="abc" />
  </stream>
</beanio>
</code>```

Thanks for all the help.

Body:
I am trying to create a template in BeanIO that will help me create an XML file which I will be converting into a JSON file.

This is the example of JSON file that I want to create:

{
    "abc": {
        "def": [
             {
                 "fname": "James"
             }
         ]
    }
}

Now my question is that how do I define "def" element into my template as an array and how do I define "abc" as the parent element for "def"?

I tried to create a below template:

<beanio>

  <template name="def">
    <field name="fname" />
  </template>
  <template name="abc>
    <segment name="deffff" template="def" class="example.def" />
  </template>
  <stream name="deffile" format="xml">
    <include template="abc" />
  </stream>
</beanio>

Thanks for all the help.


问:
Problem with apt-key in Microsoft ODBC driver installation for Ubuntu?
These commands are pulled from this site: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16#ubuntu18

```<code>sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list

exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
</code>```

These are Microsoft's official steps to install ODBC drivers on Ubuntu. I am not too familiar with Linux, so I do not know if using the deprecated apt-key commands will cause me any issues in the future. Could someone let me know if this is a reasonable concern? And if it is, what is the best practice to make my environment more stable for the future?

Thanks

Body:
These commands are pulled from this site: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16#ubuntu18

sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list

exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev

These are Microsoft's official steps to install ODBC drivers on Ubuntu. I am not too familiar with Linux, so I do not know if using the deprecated apt-key commands will cause me any issues in the future. Could someone let me know if this is a reasonable concern? And if it is, what is the best practice to make my environment more stable for the future?

Thanks


问:
Eclipse CDT - Using cmake installation other than the default operating system installed version
I'm at my wits end with this.

I have a project I want to edit with the Eclipse CDT IDE, but it requires a more recent version of cmake than my distribution provides. I have a (verified working install) of the latest cmake in my home directory, but I cannot for the life of my figure out how to make Eclipse detect or use it.

I have tried every combination of changing eclipse's build environment variables I can possibly think of. I've tried the linux tool path setting. I've even tried adding my personal install of cmake to the global PATH and then nuking eclipse's setting and completely reinstalling. Nothing has worked, it's like it's hardcoded to /usr/bin/cmake.

How do I get it to use a different cmake binary? Preferably per-project, but I'd settle for a global setting at this point.


问:
How to prevent text from being echoed over netcat (nc) when reading it with bash's read -s?
I have an authentication implemented in a bash script.
A user enters his password through this line of code:

```<code>read -s password
</code>```

When entering the password over nc the password gets echoed like the -s option would not have been used.
This doesn't happen when running the script normally.

Is there an alternative to nc or an option for it that supports the -s option of bash's read function?

I tried this:

```<code>stty -echo
read -s password
stty echo
</code>```

but the password still gets displayed.

Body:
I have an authentication implemented in a bash script.
A user enters his password through this line of code:

read -s password

When entering the password over nc the password gets echoed like the -s option would not have been used.
This doesn't happen when running the script normally.

Is there an alternative to nc or an option for it that supports the -s option of bash's read function?

I tried this:

stty -echo
read -s password
stty echo

but the password still gets displayed.


问:
Monorepo with npm workspaces - Lerna version fails when inter-package dependency is introduced for existing packages
I am working on a monorepo with 2 packages, say child and parent, initially not dependent on each other and already published to registry.

However, when I add inter-package dependency, lerna version command fails.

npm workspaces was provided in root package.json

useWorkspaces was provided in lerna.json

All was fine, till I decided to add package parent as dependency of package child.

packages/child/package.json was updated like so:

```<code>{
  "name": "child",
  "version": "0.1.13",
  "description": "this package is being updated to depend on parent",
  "main": "dist/index.js",
  "dependencies": {
    "parent": "*"                                      // I added this
   }
}
</code>```

I had updates to both child and parent. Lets say published versions of parent was 0.2.13 and child was 0.1.13 prior to update.

npm install and the symlinks worked.
Build was successful.

During version however, after prompting for version bump with conventional-commits, lerna attempts npm install command and fails due to package parent version 0.2.14 being not available in npm remote registry.

It will not be available, as this version is going to be published only now.

On version command (i am using conventional-commits),

Lerna asked if parent -> 0.2.14 and child -> 0.1.14 was okay, it was..

Lerna updated the package.json of package child to be as follows:

```<code>{
  "name": "child",
  "version": "0.1.14",                                               // lerna changed this
  "description": "this package is being updated to depend on parent",
  "main": "dist/index.js",
  "dependencies": {
    "parent": "^0.2.14"                                             // lerna changed this
   }
}
</code>```

Lerna updated the package.json of package parent to be as follows:

```<code>{
  "name": "parent",
  "version": "0.2.14",                                               // lerna changed this
  "description": "this package will be dependency of child",
  "main": "dist/index.js",
}
</code>```

Lerna tried to do npm install on both child and parent packages

This fails with reason being package parent version 0.2.14 is not yet available to install, since its just going to be published now.

I followed this https://lerna.js.org/docs/getting-started.
It says

The "header": "*" and "footer": "*" tell Lerna to link the contents of the header and footer as if they were published to the registry.

I was expecting the lerna version command to work and create new version commit and tag as it was doing before I added inter-package dependencies using "*".

Should I be publishing parent first with new version 0.2.14 and then update child to point to this ?
If that is the case, should I always publish parent first whenever there are breaking changes. ?

What is the right way to do this ?

PS: Looks like it fails here: https://github.com/lerna/lerna/blob/main/commands/version/index.js#L634

Should I just remove package-lock.json from root ?

Body:
I am working on a monorepo with 2 packages, say child and parent, initially not dependent on each other and already published to registry.

However, when I add inter-package dependency, lerna version command fails.

npm workspaces was provided in root package.json

useWorkspaces was provided in lerna.json

All was fine, till I decided to add package parent as dependency of package child.

packages/child/package.json was updated like so:

{
  "name": "child",
  "version": "0.1.13",
  "description": "this package is being updated to depend on parent",
  "main": "dist/index.js",
  "dependencies": {
    "parent": "*"                                      // I added this
   }
}

I had updates to both child and parent. Lets say published versions of parent was 0.2.13 and child was 0.1.13 prior to update.

npm install and the symlinks worked.
Build was successful.

During version however, after prompting for version bump with conventional-commits, lerna attempts npm install command and fails due to package parent version 0.2.14 being not available in npm remote registry.

It will not be available, as this version is going to be published only now.

On version command (i am using conventional-commits),

Lerna asked if parent -> 0.2.14 and child -> 0.1.14 was okay, it was..

Lerna updated the package.json of package child to be as follows:

{
  "name": "child",
  "version": "0.1.14",                                               // lerna changed this
  "description": "this package is being updated to depend on parent",
  "main": "dist/index.js",
  "dependencies": {
    "parent": "^0.2.14"                                             // lerna changed this
   }
}

Lerna updated the package.json of package parent to be as follows:

{
  "name": "parent",
  "version": "0.2.14",                                               // lerna changed this
  "description": "this package will be dependency of child",
  "main": "dist/index.js",
}

Lerna tried to do npm install on both child and parent packages

This fails with reason being package parent version 0.2.14 is not yet available to install, since its just going to be published now.

I followed this https://lerna.js.org/docs/getting-started.
It says

The "header": "*" and "footer": "*" tell Lerna to link the contents of the header and footer as if they were published to the registry.

I was expecting the lerna version command to work and create new version commit and tag as it was doing before I added inter-package dependencies using "*".

Should I be publishing parent first with new version 0.2.14 and then update child to point to this ?
If that is the case, should I always publish parent first whenever there are breaking changes. ?

What is the right way to do this ?

PS: Looks like it fails here: https://github.com/lerna/lerna/blob/main/commands/version/index.js#L634

Should I just remove package-lock.json from root ?


问:
std::cos gives different result when run with valgrind
I've discovered an issue impacting several unit tests at my work, which only happens when the unit tests are run with valgrind, in that the value returned from std::cos and std::sin are different for identical inputs depending on if the unit test is run in isolation versus run under valgrind.

This issue only seems to happen for some specific inputs, because many unit tests pass which run through the same code.

Here's a minimally reproducible example (slightly worsened so that my compiler wouldn't optimize away any of the logic):

#include <complex>
#include <iomanip>
#include <iostream>

int main()
{
    std::complex<long double> input(0,0), output(0,0);

    input = std::complex<long double>(39.21460183660255L, -40);
    std::cout << "input: " << std::setprecision(20) << input << std::endl;

    output = std::cos(input);
    std::cout << "output: " << std::setprecision(20) << output << std::endl;

    if (std::abs(output) < 5.0)
    {
        std::cout << "TEST FAIL" << std::endl;
        return 1;
    }

    std::cout << "TEST PASS" << std::endl;
    return 0;
}
```
<p>Output when run normally:</p>
```input: (39.21460183660254728,-40)
output: (6505830161375283.1118,117512680740825220.91)
TEST PASS
```
<p>Output when run under valgrind:</p>
```input: (39.21460183660254728,-40)
output: (0.18053126362312540976,3.2608771240037195405)
TEST FAIL
```

Notes:

OS: Red Hat Enterprise Linux 7

Compiler: Intel OneAPI 2022 Next generation DPP/C++ Compiler

Valgrind: 3.20 (built with same compiler), also occurred on official distribution of 3.17

Issue did not manifest when unit tests were built with GCC-7 (cannot go back to that compiler) or GCC-11 (another larger bug with boost prevents us from using this with valgrind)

-O0/1/2/3 make no difference on this issue

only compiler flag I have set is "-fp-speculation=safe", which otherwise if unset causes numerical precision issues in other unit tests

Is there any better ways I can figure out what's going on to resolve this situation, or should I submit a bug report to valgrind? I hope this issue is benign but I want to be able to trust my valgrind output.

Body:
I've discovered an issue impacting several unit tests at my work, which only happens when the unit tests are run with valgrind, in that the value returned from std::cos and std::sin are different for identical inputs depending on if the unit test is run in isolation versus run under valgrind.

This issue only seems to happen for some specific inputs, because many unit tests pass which run through the same code.

Here's a minimally reproducible example (slightly worsened so that my compiler wouldn't optimize away any of the logic):

#include <complex>
#include <iomanip>
#include <iostream>

int main()
{
    std::complex<long double> input(0,0), output(0,0);

    input = std::complex<long double>(39.21460183660255L, -40);
    std::cout << "input: " << std::setprecision(20) << input << std::endl;

    output = std::cos(input);
    std::cout << "output: " << std::setprecision(20) << output << std::endl;

    if (std::abs(output) < 5.0)
    {
        std::cout << "TEST FAIL" << std::endl;
        return 1;
    }

    std::cout << "TEST PASS" << std::endl;
    return 0;
}

Output when run normally:

input: (39.21460183660254728,-40)
output: (6505830161375283.1118,117512680740825220.91)
TEST PASS

Output when run under valgrind:

input: (39.21460183660254728,-40)
output: (0.18053126362312540976,3.2608771240037195405)
TEST FAIL

Notes:

OS: Red Hat Enterprise Linux 7

Compiler: Intel OneAPI 2022 Next generation DPP/C++ Compiler

Valgrind: 3.20 (built with same compiler), also occurred on official distribution of 3.17

Issue did not manifest when unit tests were built with GCC-7 (cannot go back to that compiler) or GCC-11 (another larger bug with boost prevents us from using this with valgrind)

-O0/1/2/3 make no difference on this issue

only compiler flag I have set is "-fp-speculation=safe", which otherwise if unset causes numerical precision issues in other unit tests

Is there any better ways I can figure out what's going on to resolve this situation, or should I submit a bug report to valgrind? I hope this issue is benign but I want to be able to trust my valgrind output.


问:
Busy-waiting Future in Rust Tokio
I want to implement a Future that busy-waits on its completion.

According to this link, this is one option

```<code>impl Future for Delay {
    type Output = &'static str;

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>)
        -> Poll<&'static str>
    {
        if Instant::now() >= self.when {
            println!("Hello world");
            Poll::Ready("done")
        } else {
            // Ignore this line for now.
            cx.waker().wake_by_ref();
            Poll::Pending
        }
    }
}
</code>```

What I am worried about is this future starving out other tasks. Is it guaranteed that if I call wake inside the Future that returns Pending, that this wake will execute as a last item after epol, timers, and any other wakes called before?

Is this the good way to implement busy-wait Future?

Title: Busy-waiting Future in Rust Tokio

Body:
I want to implement a Future that busy-waits on its completion.

According to this link, this is one option

impl Future for Delay {
    type Output = &'static str;

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>)
        -> Poll<&'static str>
    {
        if Instant::now() >= self.when {
            println!("Hello world");
            Poll::Ready("done")
        } else {
            // Ignore this line for now.
            cx.waker().wake_by_ref();
            Poll::Pending
        }
    }
}

What I am worried about is this future starving out other tasks. Is it guaranteed that if I call wake inside the Future that returns Pending, that this wake will execute as a last item after epol, timers, and any other wakes called before?

Is this the good way to implement busy-wait Future?


问:
How can I do a Lua script for GHUB in order to switch my keyboard's lightning once my pc goes in stand by mode?
I have recently bought a new logitech keyboard and I want it to change lights whenever my pc goes in stand by mode... I have seen that you can assign scripts to your light profiles in GHUB but these scripts have to be written in Lua and I do'nt know any of it... is there a way to do so?

I have tried looking online but looks like no one wants their kb to switch lights after pc goes on stand by


问:
Issue with URL of images
I am doing an integration with Smartsheet and I have an issue with the presigned URLs for the images(attachments), all of them are expired, 4 weeks ago I did not have this issue, I was able to get the images from the presigned URL of AWS S3.

I am trying to pull presigned URLs for the images(attachments) that a smartsheet captures son I can transmit them to my client onboarding system.

Title: Issue with URL of images


问:
The strict inequality work but strict equality not. Discord.js
This is a part of an embed in discord.js bot. The first string work (the channels' string) the other not. I think the problem is ===, because if i use !=== to exlude all the other cases it work, but i want to know if i can use === to specify the only value i want.

When i start the bot and i run the command in my discord server the bot doesnt go in error, the bot stays on and in the console aren't log. The only things is that in the embed this values are 0. All of this (category, text, voice) are 0, the one is the correct value is channels counter, the section that use !==.

I try also to sobstitute the strings with for exapmle channeltype.text but it tell me that channeltype doesn't exist.

"**Channels:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type !== "GUILD_CATEGORY"
  ).size +
  "`" +
  "\n" +
  "**Category:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type === "GUILD_CATEGORY"
  ).size +
  "`" +
  "\n" +
  "**Text:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type === "GUILD_TEXT"
  ).size +
  "`" +
  "\n" +
  "**Voice:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type === "GUILD_VOICE"
  ).size +
  "`" +
  "\n";
```

Im tryning to get the amount of categorys, text channels and voice channels in separated values.

Body:
This is a part of an embed in discord.js bot. The first string work (the channels' string) the other not. I think the problem is ===, because if i use !=== to exlude all the other cases it work, but i want to know if i can use === to specify the only value i want.

When i start the bot and i run the command in my discord server the bot doesnt go in error, the bot stays on and in the console aren't log. The only things is that in the embed this values are 0. All of this (category, text, voice) are 0, the one is the correct value is channels counter, the section that use !==.

I try also to sobstitute the strings with for exapmle channeltype.text but it tell me that channeltype doesn't exist.

"**Channels:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type !== "GUILD_CATEGORY"
  ).size +
  "`" +
  "\n" +
  "**Category:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type === "GUILD_CATEGORY"
  ).size +
  "`" +
  "\n" +
  "**Text:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type === "GUILD_TEXT"
  ).size +
  "`" +
  "\n" +
  "**Voice:** `" +
  (await interaction.guild.channels.fetch()).filter(
    (c) => c.type === "GUILD_VOICE"
  ).size +
  "`" +
  "\n";

Im tryning to get the amount of categorys, text channels and voice channels in separated values.


问:
How Do I Stop Rewrite Rules in .htaccess from Being Removed by Wordpress?
I am developing a plugin which rewrites a specific URL pattern to a directory within the plugin. To add these rules I call add_rewrite_rule() in the plugin activation function before calling flush_rewrite_rules(). This does a great job of creating the rewrite rules, but somehow they get removed sometimes.

In one case, I changed the permalink structure for posts. Wordpress seemingly regenerated the .htaccess file without my rules. To regenerate the rules I had to deactivate and reactivate the plugin. This surprised me because I was under the impression that calling flush_rewrite_rules() inventories existing rules before adding new ones and regenerating .htaccess file. Something in my system seems to be regenerating the file without inventorying the existing rules first.

In another case, I added some plugins and I think one of them regenerated the .htaccess file when it was activated.

Is there any way to stop Wordpress and other plugins from removing my rules from the .htaccess file?

If there is some way to flag rules so that Wordpress cannot remove them in the future that would be great. Like if you could add a special character or something that tells Wordpress never to remove that specific rule for any reason other than a directive to remove it originating from the plugin which created it.

What I cannot entertain would be making the .htaccess file unwritable via file permissions because it must be writable for Wordpress to create the rules in the first place. I also believe that I cannot add the rules on init because this is a plugin not a theme. This is my first plugin which uses rewrite rules, so I could be wrong about this but according to my research so far you're supposed to add rewrite rules from plugins on activation not init.


问:
Why is Excel leaving a task open when a workbook is closed but not saved in Windows 11? This didn't happen in Windows 10
I have a simple workbook created using VBA which has a PivotTable populated from a text file. When the workbook is saved before closing, the Excel task is removed from task manager. However, if I close the workbook without saving, it leaves a task open in task manager each time. In Windows 10 this didn't happen with 32 bit Excel (my old computer). It happens in Windows 11 with 64 bit Excel (my new computer).

The data is in a tab delimited text file called Test.txt containing three columns of data

```<code>Field1  Field2  Field3
Dummy1  Dummy2  Dummy3
</code>```

The Schema.ini file is

```<code>[Test.txt]
Format = TabDelimited
ColNameHeader = True
MaxScanRows = 0
CharacterSet=ANSI
Col1=Field1 Text Width 255
Col2=Field2 Text Width 255
Col3=Field3 Text Width 255
</code>```

The VBA exhibiting this behaviour is

```<code>Option Explicit

Sub NoSaveLeavesTask()
Dim xlApp As Object
Dim xlwbs As Object
Dim xlwb As Object
Dim xlwss As Object
Dim xlws As Object
Dim xlpcs As Object
Dim xlpc As Object
Dim xlpt As Object

Set xlApp = CreateObject("Excel.Application")
Set xlwbs = xlApp.Workbooks
Set xlwb = xlwbs.Add
Set xlwss = xlwb.Sheets
Set xlws = xlwb.Sheets(1)
Set xlpcs = xlwb.PivotCaches
Set xlpc = xlpcs.Add(SourceType:=xlExternal)

With xlpc
.Connection = "ODBC;DBQ=.;Driver={Microsoft Access Text Driver (\*.txt, \*.csv)};DriverId=27;"
.CommandType = xlCmdSql
.CommandText = Array("SELECT \* FROM `Test.txt` ", "TEST")
Set xlpt = .CreatePivotTable(TableDestination:=xlws.Range("A3"), ReadData:=True)
End With

Set xlpt = Nothing
Set xlpc = Nothing
Set xlpcs = Nothing
Set xlws = Nothing
Set xlwss = Nothing
Set xlwb = Nothing
Set xlwbs = Nothing

xlApp.Visible = True
xlApp.Quit
Set xlApp = Nothing

End Sub
</code>```

On a Windows 10 machine with 32 bit excel the only change needed to the VBA is to change the driver in the connection to {Microsoft Text Driver (*.txt; *.csv)}. The problem behaviour does not occur on my Windows 10 machine.

I am unable to use different methodologies (e.g. ADODB recordsets) to populate the PivotTable because of size limitations. The above methodology facilitates much larger PivotCache sizes.

Body:
I have a simple workbook created using VBA which has a PivotTable populated from a text file. When the workbook is saved before closing, the Excel task is removed from task manager. However, if I close the workbook without saving, it leaves a task open in task manager each time. In Windows 10 this didn't happen with 32 bit Excel (my old computer). It happens in Windows 11 with 64 bit Excel (my new computer).

The data is in a tab delimited text file called Test.txt containing three columns of data

Field1  Field2  Field3
Dummy1  Dummy2  Dummy3

The Schema.ini file is

[Test.txt]
Format = TabDelimited
ColNameHeader = True
MaxScanRows = 0
CharacterSet=ANSI
Col1=Field1 Text Width 255
Col2=Field2 Text Width 255
Col3=Field3 Text Width 255

The VBA exhibiting this behaviour is

Option Explicit

Sub NoSaveLeavesTask()
Dim xlApp As Object
Dim xlwbs As Object
Dim xlwb As Object
Dim xlwss As Object
Dim xlws As Object
Dim xlpcs As Object
Dim xlpc As Object
Dim xlpt As Object

Set xlApp = CreateObject("Excel.Application")
Set xlwbs = xlApp.Workbooks
Set xlwb = xlwbs.Add
Set xlwss = xlwb.Sheets
Set xlws = xlwb.Sheets(1)
Set xlpcs = xlwb.PivotCaches
Set xlpc = xlpcs.Add(SourceType:=xlExternal)

With xlpc
.Connection = "ODBC;DBQ=.;Driver={Microsoft Access Text Driver (\*.txt, \*.csv)};DriverId=27;"
.CommandType = xlCmdSql
.CommandText = Array("SELECT \* FROM `Test.txt` ", "TEST")
Set xlpt = .CreatePivotTable(TableDestination:=xlws.Range("A3"), ReadData:=True)
End With

Set xlpt = Nothing
Set xlpc = Nothing
Set xlpcs = Nothing
Set xlws = Nothing
Set xlwss = Nothing
Set xlwb = Nothing
Set xlwbs = Nothing

xlApp.Visible = True
xlApp.Quit
Set xlApp = Nothing

End Sub

On a Windows 10 machine with 32 bit excel the only change needed to the VBA is to change the driver in the connection to {Microsoft Text Driver (*.txt; *.csv)}. The problem behaviour does not occur on my Windows 10 machine.

I am unable to use different methodologies (e.g. ADODB recordsets) to populate the PivotTable because of size limitations. The above methodology facilitates much larger PivotCache sizes.


问:
Loading multiple pickle files..the process keep getting killed
I'm working with a big dataset, and trying to load the data from some pickle files to start training a deep learning model. The files are seven with each having ~2.3GB of what's supposed to be nodes in a graph with each its pandas dataframe, basically the files all together should contain around 170k nodes.

Now, when I try to load the files into an object that must contain all of the nodes (this is how the model was implemented) the process keeps getting killed to what I think is being out of memory most probably.
Would there be any workaround this out of memory issue ? (maybe worth noting but I'm working on a machine with 64GB of RAM)


问:
Adjust figure height automatically, when the width is fixed and aspect ratio is defined by figure content
When using matplotlib to prepare publication-ready figures that include text, one wants to avoid re-scaling or stretching the image when including it into the (e.g. LaTeX) document. To achieve this, the standard procedure is to choose a figure width which matches the document in preparation (in LaTeX this is often the \textwidth or \columnwidth). On the other hand, it is usually less important to fix the figure height. If the figure content has a well-defined aspect ratio (for example, when plotting a grid of square images), there is an optimal figure height that maximally fills the figure, avoiding undue white space.

Ideally then, it should be possible to fix the figure width, tell matplotlib to use a constrained-layout, and let it figure out a good figure height.

Consider the following scenario:

```<code>import matplotlib.pyplot as plt
import numpy as np

ims = [np.random.random((20, 20)) for i in range(3)]

# Based on the \textwidth in our LaTeX document
width_inch = 4

# We plot the images in a 1x3 grid
fig, axes = plt.subplots(
    nrows=1,
    ncols=3,
    layout="constrained",
    linewidth=5,
    edgecolor="black")  # Uses the default figsize

for ax, im in zip(axes.flatten(), ims):
    ax.imshow(im)

# Fix the figure width
fig.set_figwidth(width_inch)
</code>```

This produces:

Clearly the figure height is much too large. On the other hand, making it too small leaves too much whitespace:

```<code>fig, axes = plt.subplots(
    nrows=1,
    ncols=3,
    layout="constrained",
    linewidth=5,
    edgecolor="black",
    figsize=(width_inch, 1))
</code>```

Is it possible to get matplotlib to calculate and apply an optimal figure height, or does this need to be manually adjusted?

Body:
When using matplotlib to prepare publication-ready figures that include text, one wants to avoid re-scaling or stretching the image when including it into the (e.g. LaTeX) document. To achieve this, the standard procedure is to choose a figure width which matches the document in preparation (in LaTeX this is often the \textwidth or \columnwidth). On the other hand, it is usually less important to fix the figure height. If the figure content has a well-defined aspect ratio (for example, when plotting a grid of square images), there is an optimal figure height that maximally fills the figure, avoiding undue white space.

Ideally then, it should be possible to fix the figure width, tell matplotlib to use a constrained-layout, and let it figure out a good figure height.

Consider the following scenario:

import matplotlib.pyplot as plt
import numpy as np

ims = [np.random.random((20, 20)) for i in range(3)]

# Based on the \textwidth in our LaTeX document
width_inch = 4

# We plot the images in a 1x3 grid
fig, axes = plt.subplots(
    nrows=1,
    ncols=3,
    layout="constrained",
    linewidth=5,
    edgecolor="black")  # Uses the default figsize

for ax, im in zip(axes.flatten(), ims):
    ax.imshow(im)

# Fix the figure width
fig.set_figwidth(width_inch)

This produces:

Clearly the figure height is much too large. On the other hand, making it too small leaves too much whitespace:

fig, axes = plt.subplots(
    nrows=1,
    ncols=3,
    layout="constrained",
    linewidth=5,
    edgecolor="black",
    figsize=(width_inch, 1))

Is it possible to get matplotlib to calculate and apply an optimal figure height, or does this need to be manually adjusted?


问:
Error when try to use "ScriptControl" from "MSScriptControl" in VbsScript
I trying to run this code:

```<code>Dim jsonString, jsonDictionary

jsonString = "{ ""name"": ""John"", ""age"": 30, ""city"": ""New York"" }"

Set jsonDictionary = JSONToDictionary(jsonString)

MsgBox(jsonDictionary.Item("name")) ' -> "John"
MsgBox(jsonDictionary.Item("age")) ' -> 30
MsgBox(jsonDictionary.Item("city")) ' -> "New York"

Function JSONToDictionary(jsonString)
    ' Crea un objeto de script
    Set jsonObject = CreateObject("ScriptControl")
    ' Establece la sintaxis JSON como el lenguaje de script
    jsonObject.Language = "JScript"
    ' Utiliza el método eval() del objeto de script para parsear la cadena JSON
    Set jsonDictionary = eval("(" + jsonString + ")")
    ' Devuelve el objeto diccionario
    JSONToDictionary = jsonDictionary
End Function
</code>```

But I get the error: "The ActiveX component can't create the object: 'ScriptControl' ".
Also I get the error: "System: This operation is not supported with BTT enabled".

I've tried everything but it doesn't work, would you know how to fix it?

Body:
I trying to run this code:

Dim jsonString, jsonDictionary

jsonString = "{ ""name"": ""John"", ""age"": 30, ""city"": ""New York"" }"

Set jsonDictionary = JSONToDictionary(jsonString)

MsgBox(jsonDictionary.Item("name")) ' -> "John"
MsgBox(jsonDictionary.Item("age")) ' -> 30
MsgBox(jsonDictionary.Item("city")) ' -> "New York"

Function JSONToDictionary(jsonString)
    ' Crea un objeto de script
    Set jsonObject = CreateObject("ScriptControl")
    ' Establece la sintaxis JSON como el lenguaje de script
    jsonObject.Language = "JScript"
    ' Utiliza el método eval() del objeto de script para parsear la cadena JSON
    Set jsonDictionary = eval("(" + jsonString + ")")
    ' Devuelve el objeto diccionario
    JSONToDictionary = jsonDictionary
End Function

But I get the error: "The ActiveX component can't create the object: 'ScriptControl' ".
Also I get the error: "System: This operation is not supported with BTT enabled".

I've tried everything but it doesn't work, would you know how to fix it?


问:
Xcode linker flags for GSL
I am trying to use the GSL library with C++ in Xcode and I was having an issue linking to the library.

I am able to link to GSL using the terminal and clang with the following linker flags

```<code>clang++ -std=c++17 -Wall -pedantic test.cpp -o test -lgsl -lgslcblas
</code>```

From the command line I'm able to verify it uses the GSL library for the computation. However in Xcode, I get a "'gsl/gsl_linalg.h' file not found" error when I try to build it. Its called in my header file with
#include <gsl/gsl_linalg.h>

I added -lgsl -lgslcblas into Xcode build settings thru the "Other Linker flags" option.

I also ran

gsl-config --cflags

gsl-config --libs

and got the following output

-I/usr/local/include

-L/usr/local/lib -lgsl -lgslcblas

So it seems like GSL is installed properly and can be used by clang but for some reason when I use clang through Xcode it isn't able to use it. I was also able to manually find that particular header file in /usr/local/include/gsl/gsl_linalg.h

Any ideas on what I'm might be doing wrong?

Title: Xcode linker flags for GSL

Body:
I am trying to use the GSL library with C++ in Xcode and I was having an issue linking to the library.

I am able to link to GSL using the terminal and clang with the following linker flags

clang++ -std=c++17 -Wall -pedantic test.cpp -o test -lgsl -lgslcblas

From the command line I'm able to verify it uses the GSL library for the computation. However in Xcode, I get a "'gsl/gsl_linalg.h' file not found" error when I try to build it. Its called in my header file with
#include <gsl/gsl_linalg.h>

I added -lgsl -lgslcblas into Xcode build settings thru the "Other Linker flags" option.

I also ran

gsl-config --cflags

gsl-config --libs

and got the following output

-I/usr/local/include

-L/usr/local/lib -lgsl -lgslcblas

So it seems like GSL is installed properly and can be used by clang but for some reason when I use clang through Xcode it isn't able to use it. I was also able to manually find that particular header file in /usr/local/include/gsl/gsl_linalg.h

Any ideas on what I'm might be doing wrong?


Title: Select column names

Body:
+----+-------+----+----+----+----+----+----+
| id | name  | 10 | 20 | 30 | 40 | 50 | 60 |
+----+-------+----+----+----+----+----+----+
|  0 | party |  0 |  7 | 82 |  0 |  8 |  0 |
|  1 | party |  9 |  0 |  0 |  3 |  0 | 17 |
+----+-------+----+----+----+----+----+----+

I need to know what columns have value on some id.
How to get column names, where column have value(value>0) on some id?

For example, for id = 1 i want to get 10, 40, 60


问:
core-js3 was installed — still getting WARN deprecated regarding old core-js
I'm very new to js and trying to set up canvas-sketch, but keep getting this:

I updated in terminal using 'npm install --save core-js@^3' and am getting this still:

```<code>madeleinesanchez@Madeleines-MacBook-Pro ~ % npm install --save core-js@^3

up to date, audited 544 packages in 885ms

69 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
madeleinesanchez@Madeleines-MacBook-Pro ~ % npm install canvas-sketch-cli -g
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

changed 541 packages, and audited 542 packages in 11s

68 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
madeleinesanchez@Madeleines-MacBook-Pro ~ %

</code>```

I've tried all kinds of workarounds but maybe am doing something wrong. Send help! lol thank you

Tried npm install --save core-js@^3, npm install --save core-js@^3, npm cache clean, npm update. I also tried npm uninstall core-js and then npm i core-js

I was expecting to stop recieving warnings about the old version after updating it.

Body:
I'm very new to js and trying to set up canvas-sketch, but keep getting this:

I updated in terminal using 'npm install --save core-js@^3' and am getting this still:

madeleinesanchez@Madeleines-MacBook-Pro ~ % npm install --save core-js@^3

up to date, audited 544 packages in 885ms

69 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
madeleinesanchez@Madeleines-MacBook-Pro ~ % npm install canvas-sketch-cli -g
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

changed 541 packages, and audited 542 packages in 11s

68 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
madeleinesanchez@Madeleines-MacBook-Pro ~ %

I've tried all kinds of workarounds but maybe am doing something wrong. Send help! lol thank you

Tried npm install --save core-js@^3, npm install --save core-js@^3, npm cache clean, npm update. I also tried npm uninstall core-js and then npm i core-js

I was expecting to stop recieving warnings about the old version after updating it.


问:
How to inspect the source code of LinalgCrossBackward
This is a simplified version of my code.

```<code>"""
Both vec1 and vec2 are torch.Tensor
    vec1.shape: (B, N, 3)
    vec2.shape: (B, N, 3)
"""
face_normals = torch.cross(vec1, vec2, -1)
print(face_normals.grad_fn)
</code>```

which gives me

```<code><LinalgCrossBackward0 object at 0x7f48092cda00>
</code>```

How can I inspect the implementation of this LinalgCrossBackward?

Body:
This is a simplified version of my code.

"""
Both vec1 and vec2 are torch.Tensor
    vec1.shape: (B, N, 3)
    vec2.shape: (B, N, 3)
"""
face_normals = torch.cross(vec1, vec2, -1)
print(face_normals.grad_fn)

which gives me

<LinalgCrossBackward0 object at 0x7f48092cda00>

How can I inspect the implementation of this LinalgCrossBackward?


问:
Multiple separate instances of same version of PHP-FPM with different php.ini (non per-dir settings)
I have Apache with several vhosts using PHP-FPM.

Most of the vhosts use the same version of PHP, 7.4.

My problem is: there are certain settings of PHP that cannot be overridden in .user.ini. And yet I need those settings to have different values for different virtualhosts.

In practice for me it's just one setting: xdebug.mode. I need it off for most vhosts, but on for one. Unfortunately, as per xdebug documentation:

This setting can only be set in php.ini or files like 99-xdebug.ini that are read when a PHP process starts (directly, or through php-fpm), but not in .htaccess and .user.ini files, which are read per-request.

My guess is, if it's possible with phpfpm to have multiple php versions running in parallel, certainly it must be possible to have multiple independent, isolated "instances" of the same version, each with its own global configuration, right? ....right? And have one (or a few) vhost use one of them, while all the other vhosts use the other.

How do I do that?


问:
Are the restrictions on native API gone for WinUI 3 vs UWP?
For UWP I always used this helpful page to reference the things I can and cannot use.  Note that APIs outside of this list actually do function on desktop, but they are rejected from the store for failing validation (presumably because other platforms like phone will not have them).  I cannot seem to find a WinUI 3 specific version of the Windows App Certification Kit for testing this, and I am wondering if the same restrictions apply given that WinUI 3 is back to being desktop only.  Does anyone have a source on this?  When we released the first UWP package our users informed us that their apps were rejected from the store because of illegal API usage and I want to avoid going through that a second time for WinUI 3 / MAUI.

NOTE: Our package is an SDK that users consume in their apps, so we don't distribute applications, but just a library.


问:
Revealjs - RevealHighlight plugin not recognized
While I can use other RevealJS plugins, my RevealHighlight plugin is not being recognized.

Here is a snippet of my code:

```<code><script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0/plugin/highlight/highlight.js" integrity="sha512-KajdeBnB+EkQSLjoqtSEshAxmUaTDUsOmeS7MWgP3KagyrUOLYs/tG14PR8eVZxUeH/NxXfQQ2+lReqUGOMJZA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js" integrity="sha512-bgHRAiTjGrzHzLyKOnpFvaEpGzJet3z4tZnXGjpsCcqOnAH6VGUx9frc5bcIhKTVLEiCO6vEhNAgx5jtLUYrfA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script>
    // Full list of configuration options available at:
    // https://github.com/hakimel/reveal.js#configuration
    Reveal.initialize({
        minScale: 0.2,
        maxScale: 1.4,

        markdown: {
            breaks: true
        },

        <% SLIDES_CONFIG[:revealjs_opts].each do |k, v| %>
        <%= k %>: <%= v.to_json %>,
        <% end %>

        // Optional reveal.js plugins
        plugins: [ RevealMarkdown, RevealHighlight ]
    })
</script>
</code>```


问:
Syncing videos with python
I am trying to write a program that takes 5 videos and sync them to a song in a loop. But I keep getting this period error.

When running the code I get this error:

```<code>return f(*args, **kwargs)
File "C:\Users\Mykhaylo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\beat.py", line 181, in beat_track
beats = __beat_tracker(onset_envelope, bpm, float(sr) / hop_length, tightness, trim)  File "C:\Users\Mykhaylo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\beat.py", line 579, in __beat_tracker
period = round(60.0 * fft_res / bpm)TypeError: type numpy.ndarray doesn't define __round__ method
</code>```

Here is the full code

```<code>import json
import random
import requests
import librosa
from moviepy.editor import VideoFileClip, concatenate_videoclips

# Fetch multiple random videos from Pexels API
response = requests.get("https://api.pexels.com/videos/search?query=jumping", headers={"Authorization": "563492ad6f91700001000001ffe8bbcab84343649c1acaaad1a446d9"})
response_json = json.loads(response.text)
video_urls = [v['video_files'][0]['link'] for v in response_json['videos']]
random.shuffle(video_urls)

# Load audio file and detect beats
audio, sr = librosa.load('nasty.mp3', sr=None, mono=False)
tempo, beat_frames = librosa.beat.beat_track(y=audio, sr=sr)
beat_times = librosa.frames_to_time(beat_frames, sr=sr)

# Prepare a list to store the subclips
subclips = []

# Process each video
for i, video_url in enumerate(video_urls):
    # Load video file
    video = VideoFileClip(video_url)
    video_duration = video.duration

    # Cut the first 2 seconds of the video
    subclip = video.subclip(0, 2)

    # Loop the subclip as many times as necessary to fit with the audio
    while subclip.duration < beat_times[-1]:
        subclip = concatenate_videoclips([subclip, subclip])

    # Trim the subclip to match the duration of the audio
    subclip = subclip.subclip(0, beat_times[-1])

    subclip = subclip.set_audio(audio)
    subclips.append(subclip)

final_video = concatenate_videoclips(subclips)
final_video.write_videofile("final_video.mp4")
</code>```

Title: Syncing videos with python

Body:
I am trying to write a program that takes 5 videos and sync them to a song in a loop. But I keep getting this period error.

When running the code I get this error:

return f(*args, **kwargs)
File "C:\Users\Mykhaylo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\beat.py", line 181, in beat_track
beats = __beat_tracker(onset_envelope, bpm, float(sr) / hop_length, tightness, trim)  File "C:\Users\Mykhaylo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\librosa\beat.py", line 579, in __beat_tracker
period = round(60.0 * fft_res / bpm)TypeError: type numpy.ndarray doesn't define __round__ method

Here is the full code

import json
import random
import requests
import librosa
from moviepy.editor import VideoFileClip, concatenate_videoclips

# Fetch multiple random videos from Pexels API
response = requests.get("https://api.pexels.com/videos/search?query=jumping", headers={"Authorization": "563492ad6f91700001000001ffe8bbcab84343649c1acaaad1a446d9"})
response_json = json.loads(response.text)
video_urls = [v['video_files'][0]['link'] for v in response_json['videos']]
random.shuffle(video_urls)

# Load audio file and detect beats
audio, sr = librosa.load('nasty.mp3', sr=None, mono=False)
tempo, beat_frames = librosa.beat.beat_track(y=audio, sr=sr)
beat_times = librosa.frames_to_time(beat_frames, sr=sr)

# Prepare a list to store the subclips
subclips = []

# Process each video
for i, video_url in enumerate(video_urls):
    # Load video file
    video = VideoFileClip(video_url)
    video_duration = video.duration

    # Cut the first 2 seconds of the video
    subclip = video.subclip(0, 2)

    # Loop the subclip as many times as necessary to fit with the audio
    while subclip.duration < beat_times[-1]:
        subclip = concatenate_videoclips([subclip, subclip])

    # Trim the subclip to match the duration of the audio
    subclip = subclip.subclip(0, beat_times[-1])

    subclip = subclip.set_audio(audio)
    subclips.append(subclip)

final_video = concatenate_videoclips(subclips)
final_video.write_videofile("final_video.mp4")


问:
Oracle JET Date picker in large Size
Is there any option to change the size of Oracle JET date picker to large or medium. Currently it is display in same size in all different screen modes - sm/md/lg

I tried looking oracle JET documentation for the available attributes

Title: Oracle JET Date picker in large Size


问:
Is there a way for me to write into google chrome tab something and generate/edit a specific file with that text?
Trying to create a fast way to create to do items in my list and i was hoping I could use the gchrome search bar that is always open as an input, structure some sort of shortcut and then type the note, hit enter and update a file somewhere where I am storing this.</p>


问:
vba on error fails to go to appropriate line
I am trying to log errors that occur when I move data from an Excel file to a MS Project file. The code is pasted below. It works for the first error only. When it encounters the first UniqueID that does not match, it logs the UniqueID to the listbox as intended. If a second error is encountered I get "Argument value not valid". It is like it forgets about the line that says to On Error GoTo 100. the Excel file opens fine and if there are no error it updates as desired. What am I doing wrong?

```<code>Private Sub CommandButton91_Click()

'open progress data file

    Dim i As Integer, wb As Workbook, ws As Worksheet

    myxl.Workbooks.Open TextBox110.Value

    Set wb = activeworkbook
    Set ws = wb.Sheets(1)

    For i = 2 To ws.UsedRange.Rows.count
25
        If ws.Cells(i, 2).Value = "False" Then

            If ws.Cells(i, 4).Value = "False" Then

                On Error GoTo 100

                ActiveProject.Tasks.UniqueID(ws.Cells(i, 1).Value).Number7 = ws.Cells(i, 15).Value
                ActiveProject.Tasks.UniqueID(ws.Cells(i, 1).Value).Number6 = ws.Cells(i, 17).Value

                If CheckBox34.Value = True Then
                    ActiveProject.Tasks.UniqueID(ws.Cells(i, 1).Value).Duration = ws.Cells(i, 11).Value * 480
                End If

            End If

        End If

    Next i

    Unload Me

    Exit Sub
100
    ListBox20.AddItem ws.Cells(i, 1).Value
    i = i + 1
    GoTo 25

End Sub
</code>```

Thanks

Ken

Body:
I am trying to log errors that occur when I move data from an Excel file to a MS Project file. The code is pasted below. It works for the first error only. When it encounters the first UniqueID that does not match, it logs the UniqueID to the listbox as intended. If a second error is encountered I get "Argument value not valid". It is like it forgets about the line that says to On Error GoTo 100. the Excel file opens fine and if there are no error it updates as desired. What am I doing wrong?

Private Sub CommandButton91_Click()

'open progress data file

    Dim i As Integer, wb As Workbook, ws As Worksheet

    myxl.Workbooks.Open TextBox110.Value

    Set wb = activeworkbook
    Set ws = wb.Sheets(1)

    For i = 2 To ws.UsedRange.Rows.count
25
        If ws.Cells(i, 2).Value = "False" Then

            If ws.Cells(i, 4).Value = "False" Then

                On Error GoTo 100

                ActiveProject.Tasks.UniqueID(ws.Cells(i, 1).Value).Number7 = ws.Cells(i, 15).Value
                ActiveProject.Tasks.UniqueID(ws.Cells(i, 1).Value).Number6 = ws.Cells(i, 17).Value

                If CheckBox34.Value = True Then
                    ActiveProject.Tasks.UniqueID(ws.Cells(i, 1).Value).Duration = ws.Cells(i, 11).Value * 480
                End If

            End If

        End If

    Next i

    Unload Me

    Exit Sub
100
    ListBox20.AddItem ws.Cells(i, 1).Value
    i = i + 1
    GoTo 25

End Sub

Thanks

Ken


问:
Opencv not importing on jupyter notebook
I'm trying to "import cv2" from jupyter notebook and I keep getting this error.

ImportError: dlopen(/Users/ju/opt/anaconda3/lib/python3.8/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: _VTRegisterSupplementalVideoDecoderIfAvailable
Referenced from: /Users/ju/opt/anaconda3/lib/python3.8/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib (which was built for Mac OS X 11.0)
Expected in: /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox
in /Users/ju/opt/anaconda3/lib/python3.8/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib

I've been trying to solve this issue for a couple days and I can't seem to find the issue here. I looked at different posts, articles and videos but I still can't solve this issue.


问:
Trying to download and install Visual Studio Code. Instead of extracting files it's detecting that Visual Studio code applications (3 of it) is open

I do not understand what is wrong, I uninstalled it, restart and install again but failed.

I uninstalled it, restart and install again but failed.


问:
missing menu items in MyJFrog UI
I created a cloud account on MyJFrog and now I want to create a maven repository in Artifactory. But there is no menu item available in the UI for creating a maven repository. How can I obtain the needed menu item for creating a repository?

Title: missing menu items in MyJFrog UI


问:
remove google-assets completely from the wordpress-site to meet GDPR-regulations
update: good news: i contacted the developer and they replied - that they are currently working on a solution:

concrete: the developer from astoundify.com sent me a mail:

cit:

We will be soon adding an option to remove Google Maps usage
completely. For Google Fonts, we have already provided an option to
download the fonts locally, see
https://kb.astoundify.com/article/how-to-ensure-your-jobify-theme-is-gdpr-compliant-with-google-fonts/
on how to use it. Make sure you are using the latest version.

well: thats sounds great and very promising - and i hope that this will solve the issues. That sounds great and would be a awesome.
lets hope that. i will keep you up to date - i will repost all the new things and will update this thread as soon as possible.

see all - the issue: and the phenomenon: due to the challenging GDPR-regulations in Germany, I would like to remove Google maps completely from my website. Actually I do not use it with the theme jobify (see https://kb.astoundify.com/article/how-to-remove-maps-in-jobify-results-page/ )

The theme Jobify i use in combination with the plugin wp-jobmanager ( see.: https://wordpress.org/plugins/wp-job-manager/ )

```<code>pulls content from  5 Domains
    pulls data from 5 foreign Domains from so called third countries
</code>```

tested with this Test-tool: https://www.ccm19.de/cookie-scanner/

```<code>    fetch https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry%2Cplaces&language=en&ver=6.1.1

    stylesheet https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,60...

    script https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry%2Cplaces&language=en&ver=6.1.1

    image: https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif

    xhr: https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true

</code>```

it seems that the site and the system is still using google maps as a source. How can I remove it completely to comply with the german GDPR?
In addition I would also like to get rid of the new em-search-group-type-list – especially the maps display option.  How can I do that?

btw; i allready tird what the jobfy-team suggested to do:

How to Remove Maps in Jobify Results page  https://kb.astoundify.com/article/how-to-remove-maps-in-jobify-results-page/

If you have your demo imported the most times you will have the Jobs results page indicating the map section at the top of the page. This simply displays the location of all the job listings within the map using pins. The maps display within this page because the template in use is the maps & results template. Therefore to remove the maps in the find a job page or simply the results page simply head over to edit the page and go to the page attributes on the right side, then under the dropdown select the default template instead. See the screenshot below

approach: i guess that  Google Maps is not included in WordPress core, so there's no general purpose solution. well the developer-documentation shows how to remove the map, but they're clearly still loading the Google Maps assets. We need to find out how to specifically remove those assets from the plugin.

Body:
update: good news: i contacted the developer and they replied - that they are currently working on a solution:

concrete: the developer from astoundify.com sent me a mail:

cit:

We will be soon adding an option to remove Google Maps usage
completely. For Google Fonts, we have already provided an option to
download the fonts locally, see
https://kb.astoundify.com/article/how-to-ensure-your-jobify-theme-is-gdpr-compliant-with-google-fonts/
on how to use it. Make sure you are using the latest version.

well: thats sounds great and very promising - and i hope that this will solve the issues. That sounds great and would be a awesome.
lets hope that. i will keep you up to date - i will repost all the new things and will update this thread as soon as possible.

see all - the issue: and the phenomenon: due to the challenging GDPR-regulations in Germany, I would like to remove Google maps completely from my website. Actually I do not use it with the theme jobify (see https://kb.astoundify.com/article/how-to-remove-maps-in-jobify-results-page/ )

The theme Jobify i use in combination with the plugin wp-jobmanager ( see.: https://wordpress.org/plugins/wp-job-manager/ )

pulls content from  5 Domains
    pulls data from 5 foreign Domains from so called third countries

tested with this Test-tool: https://www.ccm19.de/cookie-scanner/

    fetch https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry%2Cplaces&language=en&ver=6.1.1

    stylesheet https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,60...

    script https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry%2Cplaces&language=en&ver=6.1.1

    image: https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif

    xhr: https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true

it seems that the site and the system is still using google maps as a source. How can I remove it completely to comply with the german GDPR?
In addition I would also like to get rid of the new em-search-group-type-list – especially the maps display option.  How can I do that?

btw; i allready tird what the jobfy-team suggested to do:

How to Remove Maps in Jobify Results page  https://kb.astoundify.com/article/how-to-remove-maps-in-jobify-results-page/

If you have your demo imported the most times you will have the Jobs results page indicating the map section at the top of the page. This simply displays the location of all the job listings within the map using pins. The maps display within this page because the template in use is the maps & results template. Therefore to remove the maps in the find a job page or simply the results page simply head over to edit the page and go to the page attributes on the right side, then under the dropdown select the default template instead. See the screenshot below

approach: i guess that  Google Maps is not included in WordPress core, so there's no general purpose solution. well the developer-documentation shows how to remove the map, but they're clearly still loading the Google Maps assets. We need to find out how to specifically remove those assets from the plugin.


问:
RStudio Error: "C stack usage is too close to the limit" at R startup
Every time I open a new session in RStudio, I see the following error message (before I even run any of my code):

Error: C stack usage  7969360 is too close to the limit

I don't see this error when I open an R Console without RStudio.

Any advice on how to fix this?

In case it is helpful, here is some info:

R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"

RStudio Version 2022.12.0+353 (2022.12.0+353)

Platform: x86_64-apple-darwin17.0 (64-bit)

Computer: macOS Ventura, Version 13.1

I have tried updated my macOS version, reinstalling R, and reinstalling R Studio.


问:
Adding header and group items as columns in SectionList
I have a section list defined as

```<code>contentContainerStyle: {
    flexDirection: 'row',
    flexWrap: 'wrap',
}

<SectionList
      sections={data}
      scrollEnabled={!isLoading}
      contentContainerStyle={styles.contentContainerStyle}
      indicatorStyle={EStyleSheet.value(ThemeAttribute.ScrollIndicatorStyle)}
      ListEmptyComponent={renderEmptyComponent}
      keyboardDismissMode="on-drag"
      keyboardShouldPersistTaps="handled"
      refreshing={isLoading}
      renderItem={renderListItem}
      keyExtractor={keyExtractor}
      testID="explore-screen-section-list"
      ListFooterComponent={renderSeparator()}
      stickySectionHeadersEnabled={false}
      renderSectionHeader={renderSectionHeader}
    />
</code>```

I want headers to act like a column and group items to act like second column. Group items in screenshot act like they are also added as rows

but entire group should act like a single column something like

Body:
I have a section list defined as

contentContainerStyle: {
    flexDirection: 'row',
    flexWrap: 'wrap',
}

<SectionList
      sections={data}
      scrollEnabled={!isLoading}
      contentContainerStyle={styles.contentContainerStyle}
      indicatorStyle={EStyleSheet.value(ThemeAttribute.ScrollIndicatorStyle)}
      ListEmptyComponent={renderEmptyComponent}
      keyboardDismissMode="on-drag"
      keyboardShouldPersistTaps="handled"
      refreshing={isLoading}
      renderItem={renderListItem}
      keyExtractor={keyExtractor}
      testID="explore-screen-section-list"
      ListFooterComponent={renderSeparator()}
      stickySectionHeadersEnabled={false}
      renderSectionHeader={renderSectionHeader}
    />

I want headers to act like a column and group items to act like second column. Group items in screenshot act like they are also added as rows

but entire group should act like a single column something like