问:
ERROR ==> EACCES: permission denied, scandir '/home/$User/.ssh'
after install lando and star first project I get this error and I cant use sudo !!!

An error occurred while starting up your app!
Here are a few things you can try to get back into a good state:

■ Try running lando rebuild
■ Try restarting in debug mode lando restart -vvv
■ Try checking the logs with lando logs

If those fail then consult the troubleshooting materials:

Or post your issue to Slack or GitHub

ERROR ==> EACCES: permission denied, scandir '/home/baker/.ssh'

```<code>
     $lando start
     Let's get this party started! Starting app hello-lando...
     ERROR ==\> EACCES: permission denied, scandir '/home/baker/.ssh' message=EACCES: permission denied, scandir '/home/baker/.ssh', stack=Error: EACCES: permission denied, scandir '/home/baker/.ssh'
     at Object.readdirSync (fs.js:1047:3)
     at Object.readdirSync (pkg/prelude/bootstrap.js:1266:35)
     at AsyncEvents.\<anonymous\> (/snapshot/cli/plugins/lando-core/app.js)
     at AsyncEvents.handle (/snapshot/cli/lib/events.js)
     at /snapshot/cli/lib/events.js
     From previous event:
     at AsyncEvents.emit (/snapshot/cli/lib/events.js)
     at /snapshot/cli/lib/app.js
      From previous event:
      at App.init (/snapshot/cli/lib/app.js)
      at initAndReport (/snapshot/cli/lib/app.js)
      at App.start (/snapshot/cli/lib/app.js)
      at Object.run (/snapshot/cli/plugins/lando-core/tasks/start.js)
      From previous event:
      at /snapshot/cli/lib/cli.js
      From previous event:
      at Object.handler (/snapshot/cli/lib/cli.js)
      at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
      at Object.parseArgs \[as \_parseArgs\] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
      at Function.get \[as argv\] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
      at Cli.init (/snapshot/cli/lib/cli.js)
      at Cli.run (/snapshot/cli/lib/cli.js)
      at Object.\<anonymous\> (/snapshot/cli/bin/lando.js)
      at Module.\_compile (pkg/prelude/bootstrap.js:1887:22)
      at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
      at Module.load (internal/modules/cjs/loader.js:950:32)
      at Function.Module.\_load (internal/modules/cjs/loader.js:790:12)
      at Function.runMain (pkg/prelude/bootstrap.js:1940:12)
      at internal/main/run_main_module.js:17:47, errno=-13, syscall=scandir, code=EACCES,         path=/home/baker/.ssh, __stackCleaned__=true

     ██╗   ██╗██╗  ██╗     ██████╗ ██╗  ██╗██╗
     ██║   ██║██║  ██║    ██╔═══██╗██║  ██║██║
     ██║   ██║███████║    ██║   ██║███████║██║
     ██║   ██║██╔══██║    ██║   ██║██╔══██║╚═╝
     ╚██████╔╝██║  ██║    ╚██████╔╝██║  ██║██╗
      ╚═════╝ ╚═╝  ╚═╝     ╚═════╝ ╚═╝  ╚═╝╚═╝

    An error occurred while starting up your app!
    Here are a few things you can try to get back into a good state:

    ■ Try running lando rebuild
    ■ Try restarting in debug mode lando restart -vvv
    ■ Try checking the logs with lando logs

     If those fail then consult the troubleshooting materials:

     ■ https://docs.lando.dev/help/logs.html
     ■ https://docs.lando.dev/help/updating.html

     Or post your issue to Slack or GitHub

      ■ Slack - https://launchpass.com/devwithlando
      ■ GitHub - https://github.com/lando/lando/issues/new/choose

     ERROR ==\> EACCES: permission denied, scandir '/home/baker/.ssh'

</code>```
```<code>$ lando start
ERROR ==> EACCES: permission denied
</code>```

lando start = permission denied ,every time.
what is the problem?

Body:
after install lando and star first project I get this error and I cant use sudo !!!

An error occurred while starting up your app!
Here are a few things you can try to get back into a good state:

■ Try running lando rebuild
■ Try restarting in debug mode lando restart -vvv
■ Try checking the logs with lando logs

If those fail then consult the troubleshooting materials:

Or post your issue to Slack or GitHub

ERROR ==> EACCES: permission denied, scandir '/home/baker/.ssh'

     $lando start
     Let's get this party started! Starting app hello-lando...
     ERROR ==\> EACCES: permission denied, scandir '/home/baker/.ssh' message=EACCES: permission denied, scandir '/home/baker/.ssh', stack=Error: EACCES: permission denied, scandir '/home/baker/.ssh'
     at Object.readdirSync (fs.js:1047:3)
     at Object.readdirSync (pkg/prelude/bootstrap.js:1266:35)
     at AsyncEvents.\<anonymous\> (/snapshot/cli/plugins/lando-core/app.js)
     at AsyncEvents.handle (/snapshot/cli/lib/events.js)
     at /snapshot/cli/lib/events.js
     From previous event:
     at AsyncEvents.emit (/snapshot/cli/lib/events.js)
     at /snapshot/cli/lib/app.js
      From previous event:
      at App.init (/snapshot/cli/lib/app.js)
      at initAndReport (/snapshot/cli/lib/app.js)
      at App.start (/snapshot/cli/lib/app.js)
      at Object.run (/snapshot/cli/plugins/lando-core/tasks/start.js)
      From previous event:
      at /snapshot/cli/lib/cli.js
      From previous event:
      at Object.handler (/snapshot/cli/lib/cli.js)
      at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
      at Object.parseArgs \[as \_parseArgs\] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
      at Function.get \[as argv\] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
      at Cli.init (/snapshot/cli/lib/cli.js)
      at Cli.run (/snapshot/cli/lib/cli.js)
      at Object.\<anonymous\> (/snapshot/cli/bin/lando.js)
      at Module.\_compile (pkg/prelude/bootstrap.js:1887:22)
      at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
      at Module.load (internal/modules/cjs/loader.js:950:32)
      at Function.Module.\_load (internal/modules/cjs/loader.js:790:12)
      at Function.runMain (pkg/prelude/bootstrap.js:1940:12)
      at internal/main/run_main_module.js:17:47, errno=-13, syscall=scandir, code=EACCES,         path=/home/baker/.ssh, __stackCleaned__=true

     ██╗   ██╗██╗  ██╗     ██████╗ ██╗  ██╗██╗
     ██║   ██║██║  ██║    ██╔═══██╗██║  ██║██║
     ██║   ██║███████║    ██║   ██║███████║██║
     ██║   ██║██╔══██║    ██║   ██║██╔══██║╚═╝
     ╚██████╔╝██║  ██║    ╚██████╔╝██║  ██║██╗
      ╚═════╝ ╚═╝  ╚═╝     ╚═════╝ ╚═╝  ╚═╝╚═╝

    An error occurred while starting up your app!
    Here are a few things you can try to get back into a good state:

    ■ Try running lando rebuild
    ■ Try restarting in debug mode lando restart -vvv
    ■ Try checking the logs with lando logs

     If those fail then consult the troubleshooting materials:

     ■ https://docs.lando.dev/help/logs.html
     ■ https://docs.lando.dev/help/updating.html

     Or post your issue to Slack or GitHub

      ■ Slack - https://launchpass.com/devwithlando
      ■ GitHub - https://github.com/lando/lando/issues/new/choose

     ERROR ==\> EACCES: permission denied, scandir '/home/baker/.ssh'

$ lando start
ERROR ==> EACCES: permission denied

lando start = permission denied ,every time.
what is the problem?


来源: stackexchange

问:
How can I manage to encrypt saved data in Spring Authorization Server
I'm trying to encrypt on the application side the principal_name column in the oauth2_authorization table, but I couldn't find a way to do it.

When using Spring Data and Converter, it is quite easy to do on an classical Spring application, but I'm quite lost with Spring Authorization Server. How can that be done ?

ContentLicense: CC BY-SA 4.0


问:
Stream data using Dapper
My objective is to stream the data from the Database to the Client that consumes the API. The reason for that it the size of the data (MB).
I have the following code.

```<code>public async IAsyncEnumerable<ProductAvailability> GetProductsAsync()
    {
        await using var connection = new SqlConnection(connectionStrings.HpcDatabase);
        foreach (var product in connection.Query<ProductAvailability>(query, buffered: false))
        {
           yield return product;
        }
    }
</code>```
```<code>    [HttpGet("products-availability2")]
    public async IAsyncEnumerable<ProductAvailability> Get()
    {
        await foreach (var pro in productRepository.GetProductsAsync())
        {
            yield return pro;
        }
    }
</code>```

Yet every time I call the API, the memory usage keeps increasing.

Am I doing something wrong here? Am I looking at the wrong metric?

Title: Stream data using Dapper

Body:
My objective is to stream the data from the Database to the Client that consumes the API. The reason for that it the size of the data (MB).
I have the following code.

public async IAsyncEnumerable<ProductAvailability> GetProductsAsync()
    {
        await using var connection = new SqlConnection(connectionStrings.HpcDatabase);
        foreach (var product in connection.Query<ProductAvailability>(query, buffered: false))
        {
           yield return product;
        }
    }

    [HttpGet("products-availability2")]
    public async IAsyncEnumerable<ProductAvailability> Get()
    {
        await foreach (var pro in productRepository.GetProductsAsync())
        {
            yield return pro;
        }
    }

Yet every time I call the API, the memory usage keeps increasing.

Am I doing something wrong here? Am I looking at the wrong metric?


问:
Dash appended to version identifier by pip at install time
I am developing a pip-installable package and have the following in my setup.py:

from setuptools import find_packages, setup

with open("requirements.txt") as f:
    required = [line for line in f.read().splitlines() if not line.startswith("-")]

with open("VERSION") as f:
    version = f.read()

setup(
    name="package_name",
    version=version,
    author="Me",
    author_email="me@my_domain.com",
    description="A python package",
    long_description=open("README.md").read(),
    python_requires=">=3.8",
    install_requires=[required],
    packages=find_packages(exclude=["tests"]),
)
```
<p>Inside the file <em>VERSION</em> I have the string: <code>v0.1.0.38.g70b6d28.dirty</code> which I can replace with a script that basically does <code>echo "$(git describe --tags --always --dirty | tr '-' '.')" >VERSION</code>.</p>
<p>When I try to locally install my package, running <code>pip install .</code> from the project root, I receive the following error:</p>
```WARNING: Built wheel for package_name is invalid: Metadata 1.2 mandates PEP 440 version, but 'v0.1.0.38.g70b6d28.dirty-' is not
Failed to build package_name
ERROR: Could not build wheels for package_name, which is required to install pyproject.toml-based projects
```

Note the additional - appended to the version specified in VERSION, resulting in: v0.1.0.38.g70b6d28.dirty- instead of v0.1.0.38.g70b6d28.dirty which AFAIK is a valid local version identifier according to PEP 440 (I do tr '-' '.' to convert the non-compliant dashes to dots).

Where is this additional dash being introduced?

Additional check: Is the string I'm providing as a version a valid one? I know this is not a valid public version identifier, but it is a valid local version identifier. Does this  suffice for a local installation?

Body:
I am developing a pip-installable package and have the following in my setup.py:

from setuptools import find_packages, setup

with open("requirements.txt") as f:
    required = [line for line in f.read().splitlines() if not line.startswith("-")]

with open("VERSION") as f:
    version = f.read()

setup(
    name="package_name",
    version=version,
    author="Me",
    author_email="me@my_domain.com",
    description="A python package",
    long_description=open("README.md").read(),
    python_requires=">=3.8",
    install_requires=[required],
    packages=find_packages(exclude=["tests"]),
)

Inside the file VERSION I have the string: v0.1.0.38.g70b6d28.dirty which I can replace with a script that basically does echo "$(git describe --tags --always --dirty | tr '-' '.')" >VERSION.

When I try to locally install my package, running pip install . from the project root, I receive the following error:

WARNING: Built wheel for package_name is invalid: Metadata 1.2 mandates PEP 440 version, but 'v0.1.0.38.g70b6d28.dirty-' is not
Failed to build package_name
ERROR: Could not build wheels for package_name, which is required to install pyproject.toml-based projects

Note the additional - appended to the version specified in VERSION, resulting in: v0.1.0.38.g70b6d28.dirty- instead of v0.1.0.38.g70b6d28.dirty which AFAIK is a valid local version identifier according to PEP 440 (I do tr '-' '.' to convert the non-compliant dashes to dots).

Where is this additional dash being introduced?

Additional check: Is the string I'm providing as a version a valid one? I know this is not a valid public version identifier, but it is a valid local version identifier. Does this  suffice for a local installation?


问:
JavaScript Capital Insensitive for Hyperlink and array
I have tried a few solutions for including VBA but now I move to JavaScript. I want to insert hyperlinks to an array of specific keywords. Which I have been able to do, but the array of keywords specified are capital sensitive in the JavaScript code. Is there any way to make the following code capital insensitive when inserting hyperlinks for specific keywords. Any help will be greatly appreciated.

```<code>      //your array word list
      var words = [
        {
          word: "Cape York tours from Cooktown",
          link: "https://www.farnorthescapes.com.au/daintree-tours-trips/cape-york-tours-from-cooktown",
        },
        {
          word: "Port Douglas to Cooktown tours",
          link: "https://www.farnorthescapes.com.au/daintree-tours-trips/cooktown-tours-from-port-douglas",
        },
      ];

      $(function () {
        //iterate the array
        $.each(words, function () {
          var searchWord = this.word;
          var link = this.link;
          $('body:contains("' + searchWord + '")').each(function () {
            var newHtml = $(this)
              .html()
              .replace(
                searchWord,
                '<a class="wikilink" title="here is a link to Wikipedia" href="' +
                  link +
                  '">' +
                  searchWord +
                  "</a>"
              );
            $(this).html(newHtml);
          });
        });
      });

      // tell the embed parent frame the height of the content
      if (window.parent && window.parent.parent) {
        window.parent.parent.postMessage(
          [
            "resultsFrame",
            {
              height: document.body.getBoundingClientRect().height,
              slug: "ju0L2m4x",
            },
          ],
          "*"
        );
      }

      // always overwrite window.name, in case users try to set it manually
      window.name = "result";
</code>```

I tried a few options of capital insensitive and can't get it to work.

Body:
I have tried a few solutions for including VBA but now I move to JavaScript. I want to insert hyperlinks to an array of specific keywords. Which I have been able to do, but the array of keywords specified are capital sensitive in the JavaScript code. Is there any way to make the following code capital insensitive when inserting hyperlinks for specific keywords. Any help will be greatly appreciated.

      //your array word list
      var words = [
        {
          word: "Cape York tours from Cooktown",
          link: "https://www.farnorthescapes.com.au/daintree-tours-trips/cape-york-tours-from-cooktown",
        },
        {
          word: "Port Douglas to Cooktown tours",
          link: "https://www.farnorthescapes.com.au/daintree-tours-trips/cooktown-tours-from-port-douglas",
        },
      ];

      $(function () {
        //iterate the array
        $.each(words, function () {
          var searchWord = this.word;
          var link = this.link;
          $('body:contains("' + searchWord + '")').each(function () {
            var newHtml = $(this)
              .html()
              .replace(
                searchWord,
                '' +
                  searchWord +
                  ""
              );
            $(this).html(newHtml);
          });
        });
      });

      // tell the embed parent frame the height of the content
      if (window.parent && window.parent.parent) {
        window.parent.parent.postMessage(
          [
            "resultsFrame",
            {
              height: document.body.getBoundingClientRect().height,
              slug: "ju0L2m4x",
            },
          ],
          "*"
        );
      }

      // always overwrite window.name, in case users try to set it manually
      window.name = "result";

I tried a few options of capital insensitive and can't get it to work.


问:
How to add properties file to Spring XML context?
Here is the structure of sample Spring application

```<code>src
  main
    my.example
      - MyBean.java
      - AppMain.java
  resources
      - applicationContext.xml
      - some.properties
</code>```

applicationContext.xml

```<code><beans ...>
    <context:property-placeholder location="classpath:some.properties"/>

    <bean id="a" class="my.example.MyBean"/>
</beans>
</code>```

some.properties

```<code>myprop=something
</code>```

AppMain.java

```<code>public class AppMain {

    public static void main(String[] args) {
        var context = new ClassPathXmlApplicationContext();
        context.setConfigLocations("classpath:applicationContext.xml");
        context.refresh();

        var bean = context.getBean("a");

        println(bean); // available

        ConfigurableEnvironment environment = context.getEnvironment();

        String javaHome = environment.getProperty("java.home");
        String myprop = environment.getProperty("myprop");

        println(environment.getPropertySources());
        println("javaHome is " + javaHome); // ok
        println("myprop is " + myprop);  // is null
    }
}
</code>```

Output:

```<code>my.example.MyBean@cecf639
[PropertiesPropertySource {name='systemProperties'}, SystemEnvironmentPropertySource {name='systemEnvironment'}]
javahome is [/mypath/to/java/17.0.5-zulu]
myprop is [null]
</code>```

As the output shows the property sources do not contains some.properties file, and hence myprop is null. At the same time the bean MyBean is available, which means applicationContext.xml was processed.

Why <context:property-placeholder ...> had no effect?

How to add some.properties file to the context, and get correct myprop value?

Body:
Here is the structure of sample Spring application

src
  main
    my.example
      - MyBean.java
      - AppMain.java
  resources
      - applicationContext.xml
      - some.properties

applicationContext.xml

<beans ...>
    <context:property-placeholder location="classpath:some.properties"/>

    <bean id="a" class="my.example.MyBean"/>
</beans>

some.properties

myprop=something

AppMain.java

public class AppMain {

    public static void main(String[] args) {
        var context = new ClassPathXmlApplicationContext();
        context.setConfigLocations("classpath:applicationContext.xml");
        context.refresh();

        var bean = context.getBean("a");

        println(bean); // available

        ConfigurableEnvironment environment = context.getEnvironment();

        String javaHome = environment.getProperty("java.home");
        String myprop = environment.getProperty("myprop");

        println(environment.getPropertySources());
        println("javaHome is " + javaHome); // ok
        println("myprop is " + myprop);  // is null
    }
}

Output:

my.example.MyBean@cecf639
[PropertiesPropertySource {name='systemProperties'}, SystemEnvironmentPropertySource {name='systemEnvironment'}]
javahome is [/mypath/to/java/17.0.5-zulu]
myprop is [null]

As the output shows the property sources do not contains some.properties file, and hence myprop is null. At the same time the bean MyBean is available, which means applicationContext.xml was processed.

Why <context:property-placeholder ...> had no effect?

How to add some.properties file to the context, and get correct myprop value?


问:
How can we show next or previous image as we swipe right or left in react native?
Well here i have a react native component with the implementation of geasture controls. 100% working code with no error. But now i want to achieve the functionality as we swipe right its shows previous image or if it swipes left it shows next images. as it looks the current image going back and new image coming. I have tried to figure this out but unable to do that.

here is code .

```<code>import React, { useState } from 'react';
import { FlatList, Image, Modal, Text, View ,StyleSheet,Dimensions, TouchableOpacity} from 'react-native';
import { GestureHandlerRootView, PanGestureHandler, } from 'react-native-gesture-handler';
import Animated ,{useAnimatedStyle,useAnimatedGestureHandler, useSharedValue, withTiming,Easing} from 'react-native-reanimated';

const { width, height } = Dimensions.get('window');
const GridListing = () => {
  const [selectedImage, setSelectedImage] = useState(null);
  const x = useSharedValue(0);

  const handleImagePress = (index) => {
    setSelectedImage(index);
  };

  const closeImagePreview = () => {
    setSelectedImage(null);
  }

  const nextImage = () => {
    const currentIndex = arrayOfObjects.findIndex((obj) => obj.id === selectedImage.id);
    if (currentIndex === arrayOfObjects.length - 1) {
      closeImagePreview();
    } else {
      setSelectedImage(arrayOfObjects[currentIndex + 1]);
    }
  }

  const previousImage = () => {
    const currentIndex = arrayOfObjects.findIndex((obj) => obj.id === selectedImage.id);
    if (currentIndex === 0) {
      closeImagePreview();
    } else {
      setSelectedImage(arrayOfObjects[currentIndex - 1]);
    }
  }

  const animationContainerStyle = useAnimatedStyle(() => ({
    transform:  [{ translateX: withTiming(x.value,{
      duration:100,
      easing:Easing.linear,
    }) }]
  }));

  const handleSwipe = useAnimatedGestureHandler({
    onActive: (event) => {
      if (Math.abs(event.translationX) > Math.abs(event.translationY)) {
        // Horizontal swipe
        if (event.translationX > 0) {
          console.log('Swiping right');
          x.value = event.translationX

        } else {
          console.log('Swiping left',event.translationX);
          x.value = event.translationX

        }
      } else {
        // Vertical swipe
        if (event.translationY > 0) {
          console.log('Swiping down');
        } else {
          console.log('Swiping up');
        }
      }
    },
    onEnd:()=>{
      if (x.value>width/2) {
        x.value = withTiming(width,{easing:Easing.linear})
        console.log("hey")
        const currentIndex = arrayOfObjects.findIndex(obj => obj.id === selectedImage?.id);
        console.log("currentIndex ",currentIndex)

        // setSelectedImage(arrayOfObjects[(currentIndex + 1) % arrayOfObjects.length]);
      }else if (x.value < -width / 2) {
        x.value = withTiming(-width,{easing:Easing.linear})
        console.log("ho")
      }else{
        x.value=withTiming(0,{easing:Easing.linear})
        console.log("oo")
      }
    }
  })

  return (
    <View style={styles.container}>
      <FlatList
        data={arrayOfObjects}
        renderItem={({ item, index }) => (
          <TouchableOpacity style={styles.itemContainer} onPress={() => handleImagePress(item)}>
            <Image style={styles.thumbnail} source={{ uri: item.imageUrl }} />
             </TouchableOpacity>
        )}
        numColumns={3}
        keyExtractor={(item) => item.id.toString()}
      />
      <Modal
        transparent
        visible={selectedImage !== null}
        onRequestClose={() => setSelectedImage(null)}
        style={styles.modalContainer}
      >
        <GestureHandlerRootView style={{flex:1}}>
          <PanGestureHandler onGestureEvent={handleSwipe}>
            <Animated.View style={[styles.modalContainer,animationContainerStyle]} >

            <Image
                source={{ uri: selectedImage?.imageUrl }}
                style={{ width: '100%', height: '100%' }}
                resizeMode="contain"
              />
            </Animated.View>

          </PanGestureHandler>
      </GestureHandlerRootView>
          {/* <PanGestureHandler onGestureEvent={handleSwipe}>
            <View style={{ flex: 1, backgroundColor: 'pink' ,flexDirection:"row",}}>
              <Animated.View style={{backgroundColor:"yellow",width:100,height:100}} />

            </View>
          </PanGestureHandler> */}
      </Modal>
    </View>
  );
  };
</code>```

Body:
Well here i have a react native component with the implementation of geasture controls. 100% working code with no error. But now i want to achieve the functionality as we swipe right its shows previous image or if it swipes left it shows next images. as it looks the current image going back and new image coming. I have tried to figure this out but unable to do that.

here is code .

import React, { useState } from 'react';
import { FlatList, Image, Modal, Text, View ,StyleSheet,Dimensions, TouchableOpacity} from 'react-native';
import { GestureHandlerRootView, PanGestureHandler, } from 'react-native-gesture-handler';
import Animated ,{useAnimatedStyle,useAnimatedGestureHandler, useSharedValue, withTiming,Easing} from 'react-native-reanimated';

const { width, height } = Dimensions.get('window');
const GridListing = () => {
  const [selectedImage, setSelectedImage] = useState(null);
  const x = useSharedValue(0);

  const handleImagePress = (index) => {
    setSelectedImage(index);
  };

  const closeImagePreview = () => {
    setSelectedImage(null);
  }

  const nextImage = () => {
    const currentIndex = arrayOfObjects.findIndex((obj) => obj.id === selectedImage.id);
    if (currentIndex === arrayOfObjects.length - 1) {
      closeImagePreview();
    } else {
      setSelectedImage(arrayOfObjects[currentIndex + 1]);
    }
  }

  const previousImage = () => {
    const currentIndex = arrayOfObjects.findIndex((obj) => obj.id === selectedImage.id);
    if (currentIndex === 0) {
      closeImagePreview();
    } else {
      setSelectedImage(arrayOfObjects[currentIndex - 1]);
    }
  }

  const animationContainerStyle = useAnimatedStyle(() => ({
    transform:  [{ translateX: withTiming(x.value,{
      duration:100,
      easing:Easing.linear,
    }) }]
  }));

  const handleSwipe = useAnimatedGestureHandler({
    onActive: (event) => {
      if (Math.abs(event.translationX) > Math.abs(event.translationY)) {
        // Horizontal swipe
        if (event.translationX > 0) {
          console.log('Swiping right');
          x.value = event.translationX

        } else {
          console.log('Swiping left',event.translationX);
          x.value = event.translationX

        }
      } else {
        // Vertical swipe
        if (event.translationY > 0) {
          console.log('Swiping down');
        } else {
          console.log('Swiping up');
        }
      }
    },
    onEnd:()=>{
      if (x.value>width/2) {
        x.value = withTiming(width,{easing:Easing.linear})
        console.log("hey")
        const currentIndex = arrayOfObjects.findIndex(obj => obj.id === selectedImage?.id);
        console.log("currentIndex ",currentIndex)

        // setSelectedImage(arrayOfObjects[(currentIndex + 1) % arrayOfObjects.length]);
      }else if (x.value < -width / 2) {
        x.value = withTiming(-width,{easing:Easing.linear})
        console.log("ho")
      }else{
        x.value=withTiming(0,{easing:Easing.linear})
        console.log("oo")
      }
    }
  })

  return (
    <View style={styles.container}>
      <FlatList
        data={arrayOfObjects}
        renderItem={({ item, index }) => (
          <TouchableOpacity style={styles.itemContainer} onPress={() => handleImagePress(item)}>
            <Image style={styles.thumbnail} source={{ uri: item.imageUrl }} />
             </TouchableOpacity>
        )}
        numColumns={3}
        keyExtractor={(item) => item.id.toString()}
      />
      <Modal
        transparent
        visible={selectedImage !== null}
        onRequestClose={() => setSelectedImage(null)}
        style={styles.modalContainer}
      >
        <GestureHandlerRootView style={{flex:1}}>
          <PanGestureHandler onGestureEvent={handleSwipe}>
            <Animated.View style={[styles.modalContainer,animationContainerStyle]} >

            <Image
                source={{ uri: selectedImage?.imageUrl }}
                style={{ width: '100%', height: '100%' }}
                resizeMode="contain"
              />
            </Animated.View>

          </PanGestureHandler>
      </GestureHandlerRootView>
          {/* <PanGestureHandler onGestureEvent={handleSwipe}>
            <View style={{ flex: 1, backgroundColor: 'pink' ,flexDirection:"row",}}>
              <Animated.View style={{backgroundColor:"yellow",width:100,height:100}} />

            </View>
          </PanGestureHandler> */}
      </Modal>
    </View>
  );
  };


问:
MySQL If else in SELECT performance
We are using IF conditions in SELECT statement like given below

```<code>IF(PG_COMPANY IS NULL,'N/A', REPLACE(REPLACE(REPLACE(tpgm.PG_COMPANY, 'COMPANY1', '') , 'COMPANY2', '') , 'COMPANY3', '') ) AS 'COMPANY_NAME'
</code>```

This works properly where output is upto 1 million records.
beyond that it starts giving performance issue.

Is there any way to reduce this performance issue. or are  there any other work around available ?

Title: MySQL If else in SELECT performance

Body:
We are using IF conditions in SELECT statement like given below

IF(PG_COMPANY IS NULL,'N/A', REPLACE(REPLACE(REPLACE(tpgm.PG_COMPANY, 'COMPANY1', '') , 'COMPANY2', '') , 'COMPANY3', '') ) AS 'COMPANY_NAME'

This works properly where output is upto 1 million records.
beyond that it starts giving performance issue.

Is there any way to reduce this performance issue. or are  there any other work around available ?


问:
Code Coverage Visual studio- Namespace not appearing in instrumented assembly
I have written few Unit test using MStest in visual studio and trying to generated the code coverage for the instrumented assembly which i have marked in the test settings. Although i am getting the code coverage for all  of the namespaces in the assembly but one. Is there a setting i need to make to make this namespace appear in the codecoverage window.</p>

ContentLicense: CC BY-SA 3.0


问:
How to deploy airflow using kubernetes and kustomize
I'm running minikube and I want to deploy airflow using kustomize instead of helm.

So first I got the docker-compose.yaml

curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.5.0/docker-compose.yaml'
```
<p>Then I execute <code>kompose convert</code>, to convert the docker-compose to kubernetes yaml.</p>
<p>After I change the service files to <code>type: LoadBalancer</code>.</p>
<p>Then I deploy all those file generated by the kompose, all pods are running.</p>
<p>I start minikube tunnel</p>
<p>I was expecting to get the airflow ui on the url localhost:8080</p>
<p>However I'm getting</p>
```The connection was reset
```
<p>What am I doing wrong?</p>
<p>I try to change the ports from 8080 to 8060</p>
<p>I saw the logs for each pod using <code>kubectl logs <pod-name></code> but no error appear</p>
<p>I try using the url generate by this cmd</p>
<pre class="lang-bash prettyprint-override"><code>minikube service airflow-webser --url
</code>```

Here is my docker-compose.yaml that I modify to work with kompose

---
version: '3'
# x-airflow-common:
#   image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
#   environment:
#     AIRFLOW__CORE__EXECUTOR: CeleryExecutor
#     AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
#     AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
#     AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
#     AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
#     AIRFLOW__CORE__FERNET_KEY: ''
#     AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
#     AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
#     AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
#     _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
#   volumes:
#   - ./dags:/opt/airflow/dags
#   - ./logs:/opt/airflow/logs
#   - ./plugins:/opt/airflow/plugins
#   user: ${AIRFLOW_UID:-50000}:0
#   depends_on:
#     - redis
#     - postgres

services:
  postgres:
    image: postgres:13
    environment:
      POSTGRES_USER: airflow
      POSTGRES_PASSWORD: airflow
      POSTGRES_DB: airflow
    volumes:
    - postgres-db-volume:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "airflow"]
      interval: 5s
      retries: 5
    restart: always

  redis:
    image: redis:latest
    expose:
    - 6379
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 30s
      retries: 50
    restart: always

  airflow-webserver:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0

    command: webserver
    ports:
    - 8080:8080
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-scheduler:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0

    command: scheduler
    healthcheck:
      test: ["CMD-SHELL", 'airflow jobs check --job-type SchedulerJob --hostname "$${HOSTNAME}"']
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-worker:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    command: celery worker
    healthcheck:
      test:
        - "CMD-SHELL"
        - 'celery --app airflow.executors.celery_executor.app inspect ping -d "celery@$${HOSTNAME}"'
      interval: 10s
      timeout: 10s
      retries: 5
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
      DUMB_INIT_SETSID: "0"
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-triggerer:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    command: triggerer
    healthcheck:
      test: ["CMD-SHELL", 'airflow jobs check --job-type TriggererJob --hostname "$${HOSTNAME}"']
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-init:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    entrypoint: /bin/bash
    command:
    - -c
    - |
      function ver() {
        printf "%04d%04d%04d%04d" $${1//./ }
      }
      airflow_version=$$(AIRFLOW__LOGGING__LOGGING_LEVEL=INFO && gosu airflow airflow version)
      airflow_version_comparable=$$(ver $${airflow_version})
      min_airflow_version=2.2.0
      min_airflow_version_comparable=$$(ver $${min_airflow_version})
      if (( airflow_version_comparable < min_airflow_version_comparable )); then
        echo
          echo -e "\033[1;31mERROR!!!: Too old Airflow version $${airflow_version}!\e[0m"
          echo "The minimum Airflow version supported: $${min_airflow_version}. Only use this or higher!"
          echo
          exit 1
        fi
        if [[ -z "${AIRFLOW_UID}" ]]; then
          echo
          echo -e "\033[1;33mWARNING!!!: AIRFLOW_UID not set!\e[0m"
          echo "If you are on Linux, you SHOULD follow the instructions below to set "
          echo "AIRFLOW_UID environment variable, otherwise files will be owned by root."
          echo "For other operating systems you can get rid of the warning with manually created .env file:"
          echo "    See: https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html#setting-the-right-airflow-user"
          echo
        fi
        one_meg=1048576
        mem_available=$$(($$(getconf _PHYS_PAGES) * $$(getconf PAGE_SIZE) / one_meg))
        cpus_available=$$(grep -cE 'cpu[0-9]+' /proc/stat)
        disk_available=$$(df / | tail -1 | awk '{print $$4}')
        warning_resources="false"
        if (( mem_available < 4000 )) ; then
          echo
          echo -e "\033[1;33mWARNING!!!: Not enough memory available for Docker.\e[0m"
          echo "At least 4GB of memory required. You have $$(numfmt --to iec $$((mem_available * one_meg)))"
          echo
          warning_resources="true"
        fi
        if (( cpus_available < 2 )); then
          echo
          echo -e "\033[1;33mWARNING!!!: Not enough CPUS available for Docker.\e[0m"
          echo "At least 2 CPUs recommended. You have $${cpus_available}"
          echo
          warning_resources="true"
        fi
        if (( disk_available < one_meg * 10 )); then
          echo
          echo -e "\033[1;33mWARNING!!!: Not enough Disk space available for Docker.\e[0m"
          echo "At least 10 GBs recommended. You have $$(numfmt --to iec $$((disk_available * 1024 )))"
          echo
          warning_resources="true"
        fi
        if [[ $${warning_resources} == "true" ]]; then
          echo
          echo -e "\033[1;33mWARNING!!!: You have not enough resources to run Airflow (see above)!\e[0m"
          echo "Please follow the instructions to increase amount of resources available:"
          echo "   https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html#before-you-begin"
          echo
        fi
        mkdir -p /sources/logs /sources/dags /sources/plugins
        chown -R "${AIRFLOW_UID}:0" /sources/{logs,dags,plugins}
        exec /entrypoint airflow version
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _AIRFLOW_DB_UPGRADE: 'true'
      _AIRFLOW_WWW_USER_CREATE: 'true'
      _AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-airflow}
      _AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-airflow}
      _PIP_ADDITIONAL_REQUIREMENTS: ''
    user: "0:0"
    volumes:
      - .:/sources
    depends_on:
      - redis
      - postgres

  airflow-cli:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    depends_on:
      - redis
      - postgres
    # profiles:
    # - debug
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
      CONNECTION_CHECK_MAX_COUNT: "0"
    command:
    - bash
    - -c
    - airflow

  flower:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    command: celery flower
    # profiles:
    # - flower
    ports:
    - 5555:5555
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://localhost:5554/"]
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

volumes:
  postgres-db-volume:
```

Body:
I'm running minikube and I want to deploy airflow using kustomize instead of helm.

So first I got the docker-compose.yaml

curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.5.0/docker-compose.yaml'

Then I execute kompose convert, to convert the docker-compose to kubernetes yaml.

After I change the service files to type: LoadBalancer.

Then I deploy all those file generated by the kompose, all pods are running.

I start minikube tunnel

I was expecting to get the airflow ui on the url localhost:8080

However I'm getting

The connection was reset

What am I doing wrong?

I try to change the ports from 8080 to 8060

I saw the logs for each pod using kubectl logs <pod-name> but no error appear

I try using the url generate by this cmd

minikube service airflow-webser --url

Here is my docker-compose.yaml that I modify to work with kompose

---
version: '3'
# x-airflow-common:
#   image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
#   environment:
#     AIRFLOW__CORE__EXECUTOR: CeleryExecutor
#     AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
#     AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
#     AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
#     AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
#     AIRFLOW__CORE__FERNET_KEY: ''
#     AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
#     AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
#     AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
#     _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
#   volumes:
#   - ./dags:/opt/airflow/dags
#   - ./logs:/opt/airflow/logs
#   - ./plugins:/opt/airflow/plugins
#   user: ${AIRFLOW_UID:-50000}:0
#   depends_on:
#     - redis
#     - postgres

services:
  postgres:
    image: postgres:13
    environment:
      POSTGRES_USER: airflow
      POSTGRES_PASSWORD: airflow
      POSTGRES_DB: airflow
    volumes:
    - postgres-db-volume:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "airflow"]
      interval: 5s
      retries: 5
    restart: always

  redis:
    image: redis:latest
    expose:
    - 6379
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 30s
      retries: 50
    restart: always

  airflow-webserver:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0

    command: webserver
    ports:
    - 8080:8080
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-scheduler:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0

    command: scheduler
    healthcheck:
      test: ["CMD-SHELL", 'airflow jobs check --job-type SchedulerJob --hostname "$${HOSTNAME}"']
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-worker:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    command: celery worker
    healthcheck:
      test:
        - "CMD-SHELL"
        - 'celery --app airflow.executors.celery_executor.app inspect ping -d "celery@$${HOSTNAME}"'
      interval: 10s
      timeout: 10s
      retries: 5
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
      DUMB_INIT_SETSID: "0"
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-triggerer:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    command: triggerer
    healthcheck:
      test: ["CMD-SHELL", 'airflow jobs check --job-type TriggererJob --hostname "$${HOSTNAME}"']
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

  airflow-init:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    entrypoint: /bin/bash
    command:
    - -c
    - |
      function ver() {
        printf "%04d%04d%04d%04d" $${1//./ }
      }
      airflow_version=$$(AIRFLOW__LOGGING__LOGGING_LEVEL=INFO && gosu airflow airflow version)
      airflow_version_comparable=$$(ver $${airflow_version})
      min_airflow_version=2.2.0
      min_airflow_version_comparable=$$(ver $${min_airflow_version})
      if (( airflow_version_comparable < min_airflow_version_comparable )); then
        echo
          echo -e "\033[1;31mERROR!!!: Too old Airflow version $${airflow_version}!\e[0m"
          echo "The minimum Airflow version supported: $${min_airflow_version}. Only use this or higher!"
          echo
          exit 1
        fi
        if [[ -z "${AIRFLOW_UID}" ]]; then
          echo
          echo -e "\033[1;33mWARNING!!!: AIRFLOW_UID not set!\e[0m"
          echo "If you are on Linux, you SHOULD follow the instructions below to set "
          echo "AIRFLOW_UID environment variable, otherwise files will be owned by root."
          echo "For other operating systems you can get rid of the warning with manually created .env file:"
          echo "    See: https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html#setting-the-right-airflow-user"
          echo
        fi
        one_meg=1048576
        mem_available=$$(($$(getconf _PHYS_PAGES) * $$(getconf PAGE_SIZE) / one_meg))
        cpus_available=$$(grep -cE 'cpu[0-9]+' /proc/stat)
        disk_available=$$(df / | tail -1 | awk '{print $$4}')
        warning_resources="false"
        if (( mem_available < 4000 )) ; then
          echo
          echo -e "\033[1;33mWARNING!!!: Not enough memory available for Docker.\e[0m"
          echo "At least 4GB of memory required. You have $$(numfmt --to iec $$((mem_available * one_meg)))"
          echo
          warning_resources="true"
        fi
        if (( cpus_available < 2 )); then
          echo
          echo -e "\033[1;33mWARNING!!!: Not enough CPUS available for Docker.\e[0m"
          echo "At least 2 CPUs recommended. You have $${cpus_available}"
          echo
          warning_resources="true"
        fi
        if (( disk_available < one_meg * 10 )); then
          echo
          echo -e "\033[1;33mWARNING!!!: Not enough Disk space available for Docker.\e[0m"
          echo "At least 10 GBs recommended. You have $$(numfmt --to iec $$((disk_available * 1024 )))"
          echo
          warning_resources="true"
        fi
        if [[ $${warning_resources} == "true" ]]; then
          echo
          echo -e "\033[1;33mWARNING!!!: You have not enough resources to run Airflow (see above)!\e[0m"
          echo "Please follow the instructions to increase amount of resources available:"
          echo "   https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html#before-you-begin"
          echo
        fi
        mkdir -p /sources/logs /sources/dags /sources/plugins
        chown -R "${AIRFLOW_UID}:0" /sources/{logs,dags,plugins}
        exec /entrypoint airflow version
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _AIRFLOW_DB_UPGRADE: 'true'
      _AIRFLOW_WWW_USER_CREATE: 'true'
      _AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-airflow}
      _AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-airflow}
      _PIP_ADDITIONAL_REQUIREMENTS: ''
    user: "0:0"
    volumes:
      - .:/sources
    depends_on:
      - redis
      - postgres

  airflow-cli:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    depends_on:
      - redis
      - postgres
    # profiles:
    # - debug
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
      CONNECTION_CHECK_MAX_COUNT: "0"
    command:
    - bash
    - -c
    - airflow

  flower:
    image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.5.0}
    environment:
      AIRFLOW__CORE__EXECUTOR: CeleryExecutor
      AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
      AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
      AIRFLOW__CORE__FERNET_KEY: ''
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
      AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
      AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
      _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
    volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    user: ${AIRFLOW_UID:-50000}:0
    command: celery flower
    # profiles:
    # - flower
    ports:
    - 5555:5555
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://localhost:5554/"]
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    depends_on:
      - redis
      - postgres
      - airflow-init

volumes:
  postgres-db-volume:


问:
How to I change the colour fill on stat_ellipsis(geom='polygon') to match the scale_color_brewer palette colours for PCA plot?
I am using the autoplot() function to add ellipsis and polygons to my PCA plot in R, my colour palette for the points is the color.brewer 'Set2' palette. When I am filling my ellipsis with geom='polygon', I want the polygon fill colour to be the same as the colour of the points they are covering, so as to match the palette I am using.

However I get a "'mapping' must be creates using aes()" or "Aesthetics are not valid data columns" error.

I'm a novice in R so any help would be very much appreciated.

```<code>autoplot(pca_data + aes(color = group)+      # colours
           ggtitle('Principal Component Analysis')+         # title
           theme(plot.title = element_text(hjust = 0.5))+  #centred title
           stat_ellipse(lwd = 0.75,
                        linetype = 2,
                        geom='polygon',
                        aes(fill = group),
                        alpha = 0.25,
                        show.legend = F,
                        level = 0.8) +
           scale_color_brewer(palette = "Set2")) # ellipsis
</code>```

This is my current working and will only fill the polygons to match the default colours of the PCA plot, and not to the color palette I want to use

Body:
I am using the autoplot() function to add ellipsis and polygons to my PCA plot in R, my colour palette for the points is the color.brewer 'Set2' palette. When I am filling my ellipsis with geom='polygon', I want the polygon fill colour to be the same as the colour of the points they are covering, so as to match the palette I am using.

However I get a "'mapping' must be creates using aes()" or "Aesthetics are not valid data columns" error.

I'm a novice in R so any help would be very much appreciated.

autoplot(pca_data + aes(color = group)+      # colours
           ggtitle('Principal Component Analysis')+         # title
           theme(plot.title = element_text(hjust = 0.5))+  #centred title
           stat_ellipse(lwd = 0.75,
                        linetype = 2,
                        geom='polygon',
                        aes(fill = group),
                        alpha = 0.25,
                        show.legend = F,
                        level = 0.8) +
           scale_color_brewer(palette = "Set2")) # ellipsis

This is my current working and will only fill the polygons to match the default colours of the PCA plot, and not to the color palette I want to use


问:
I am trying to load a bunch of images from a folder I have and convert them into np arrays
```<code>import os
import numpy as np
from os import listdir
from PIL import Image
from numpy import asarray

data = np.array([])

path = "training_data"
images = os.listdir(path)

for file in images:
    data = np.append(asarray(file), data)

print(data)
</code>```

This is my code, training_data is a folder which contains a bunch of images, it is under the same parent folder which contains this python file. However, when I print the numpy array, "data" I get "['images']" as output, could someone guide me through this? Thanks in advance!

Body:
import os
import numpy as np
from os import listdir
from PIL import Image
from numpy import asarray

data = np.array([])

path = "training_data"
images = os.listdir(path)

for file in images:
    data = np.append(asarray(file), data)

print(data)

This is my code, training_data is a folder which contains a bunch of images, it is under the same parent folder which contains this python file. However, when I print the numpy array, "data" I get "['images']" as output, could someone guide me through this? Thanks in advance!


问:
why after splashscreen runs a bit slow to form1 in vb.net
is there a solution so that after the splashscreen so can go directly to form1? And is there something wrong with my code and is it because I created a splachscreen from a Windows Form instead of from a custom splashscreen?

Thanks

Here's [a link] video (https://drive.google.com/file/d/1URn_DDTnu3h1oERhwFGPCa9-9Se1H_g9/view?usp=share_link)!

```<code>Imports WinFormAnimation
Public Class FormWelcome
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        CircularProgressBar1.Value += 1
        CircularProgressBar1.Text = CircularProgressBar1.Value.ToString
        If Me.Opacity < 1 Then
            Me.Opacity += 0.05
        End If
        If CircularProgressBar1.Value = 100 Then
            Timer1.Stop()
            Timer2.Start()
        End If

    End Sub
    Private Sub FormWelcome_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CircularProgressBar1.Value = 0
        Me.Opacity = 0
        Timer1.Start()
    End Sub
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Me.Opacity -= 0.1
        If Me.Opacity = 0 Then
            Timer2.Stop()
            Form1.Show()
            Me.Close()
        End If
    End Sub
End Class
</code>```

Body:
is there a solution so that after the splashscreen so can go directly to form1? And is there something wrong with my code and is it because I created a splachscreen from a Windows Form instead of from a custom splashscreen?

Thanks

Here's [a link] video (https://drive.google.com/file/d/1URn_DDTnu3h1oERhwFGPCa9-9Se1H_g9/view?usp=share_link)!

Imports WinFormAnimation
Public Class FormWelcome
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        CircularProgressBar1.Value += 1
        CircularProgressBar1.Text = CircularProgressBar1.Value.ToString
        If Me.Opacity < 1 Then
            Me.Opacity += 0.05
        End If
        If CircularProgressBar1.Value = 100 Then
            Timer1.Stop()
            Timer2.Start()
        End If

    End Sub
    Private Sub FormWelcome_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CircularProgressBar1.Value = 0
        Me.Opacity = 0
        Timer1.Start()
    End Sub
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Me.Opacity -= 0.1
        If Me.Opacity = 0 Then
            Timer2.Stop()
            Form1.Show()
            Me.Close()
        End If
    End Sub
End Class


问:
how to remove one adapter from inner recycle view android java
i have nested recycle view and i want to remove one item (inner recycle view) from the outer recycle view but my code clear all adapters in the inner recycle view so how can i delete or clear only one list adapter from inner recycle view and is their is a better way to make nested recycle view .....?</p>
```<code>
public class MainWorkingTimeAdapter extends RecyclerView.Adapter<MainWorkingTimeAdapter.MainWorkingTimeViewHolder> {
    private ArrayList<String> list = new ArrayList();
    OnItemListener pOnItemListener;
    String DAY_TAG;
    Context context ;

    ArrayList<WorkingTime>workingTimes;
    String TAG ="MainWorkingTimeAdapter";
    @NonNull
    @Override
    public MainWorkingTimeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new MainWorkingTimeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.main_working_time_layout, parent, false), pOnItemListener);
    }

    @Override
    public void onBindViewHolder(@NonNull MainWorkingTimeViewHolder holder, @SuppressLint("RecyclerView") int position) {
        holder.adapter = new WorkingTimePreviewAdapter();
                holder.adapter.setList(workingTimes,list.get(position).toLowerCase(Locale.ROOT));
        }
        holder.recyclerView.setAdapter(holder.adapter);
        holder.recyclerView.setLayoutManager(new LinearLayoutManager(context));

        holder.switch_.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (pOnItemListener != null) {
                    pOnItemListener.switchClicked(isChecked,position);
                }

                if(!isChecked){
                    holder.adapter.clearList();

                }
            }
        });
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    public void setList(ArrayList<String> list,String dayTag,Context context, OnItemListener onItemListener) {
        this.list = list;
        this.context =context;
        this.DAY_TAG =dayTag;
        this.pOnItemListener = onItemListener;
        notifyDataSetChanged();
    }

    public class MainWorkingTimeViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        OnItemListener onItemListener;
        RecyclerView recyclerView ;
        WorkingTimePreviewAdapter adapter ;
        Button button;
        Switch switch_ ;
        TextView title ;
        public MainWorkingTimeViewHolder(@NonNull View v, OnItemListener onItemListener) {
            super(v);
            recyclerView = v.findViewById(R.id.recycler_main_work_time);
            button = v.findViewById(R.id.button_right_main_work_time);
            title =  v.findViewById(R.id.tv_title_main_work_time);
            switch_ = v.findViewById(R.id.switch_day_preview);
            adapter = new WorkingTimePreviewAdapter();
            this.onItemListener = onItemListener;
            button.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            onItemListener.rightButtonClicked(getAdapterPosition(),list.get(getAdapterPosition()).toLowerCase(Locale.ROOT));
        }
    }

    public void updateRecycler(ArrayList<WorkingTime> workingTimes,int pos){
        this.workingTimes = workingTimes;
        notifyItemChanged(pos);
    }

    public interface OnItemListener {
        void rightButtonClicked(int pos,String day);
        void switchClicked(boolean isChecked,int pos);
    }

</code>```

Body:
i have nested recycle view and i want to remove one item (inner recycle view) from the outer recycle view but my code clear all adapters in the inner recycle view so how can i delete or clear only one list adapter from inner recycle view and is their is a better way to make nested recycle view .....?

public class MainWorkingTimeAdapter extends RecyclerView.Adapter<MainWorkingTimeAdapter.MainWorkingTimeViewHolder> {
    private ArrayList<String> list = new ArrayList();
    OnItemListener pOnItemListener;
    String DAY_TAG;
    Context context ;

    ArrayList<WorkingTime>workingTimes;
    String TAG ="MainWorkingTimeAdapter";
    @NonNull
    @Override
    public MainWorkingTimeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new MainWorkingTimeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.main_working_time_layout, parent, false), pOnItemListener);
    }

    @Override
    public void onBindViewHolder(@NonNull MainWorkingTimeViewHolder holder, @SuppressLint("RecyclerView") int position) {
        holder.adapter = new WorkingTimePreviewAdapter();
                holder.adapter.setList(workingTimes,list.get(position).toLowerCase(Locale.ROOT));
        }
        holder.recyclerView.setAdapter(holder.adapter);
        holder.recyclerView.setLayoutManager(new LinearLayoutManager(context));

        holder.switch_.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (pOnItemListener != null) {
                    pOnItemListener.switchClicked(isChecked,position);
                }

                if(!isChecked){
                    holder.adapter.clearList();

                }
            }
        });
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    public void setList(ArrayList<String> list,String dayTag,Context context, OnItemListener onItemListener) {
        this.list = list;
        this.context =context;
        this.DAY_TAG =dayTag;
        this.pOnItemListener = onItemListener;
        notifyDataSetChanged();
    }

    public class MainWorkingTimeViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        OnItemListener onItemListener;
        RecyclerView recyclerView ;
        WorkingTimePreviewAdapter adapter ;
        Button button;
        Switch switch_ ;
        TextView title ;
        public MainWorkingTimeViewHolder(@NonNull View v, OnItemListener onItemListener) {
            super(v);
            recyclerView = v.findViewById(R.id.recycler_main_work_time);
            button = v.findViewById(R.id.button_right_main_work_time);
            title =  v.findViewById(R.id.tv_title_main_work_time);
            switch_ = v.findViewById(R.id.switch_day_preview);
            adapter = new WorkingTimePreviewAdapter();
            this.onItemListener = onItemListener;
            button.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            onItemListener.rightButtonClicked(getAdapterPosition(),list.get(getAdapterPosition()).toLowerCase(Locale.ROOT));
        }
    }

    public void updateRecycler(ArrayList<WorkingTime> workingTimes,int pos){
        this.workingTimes = workingTimes;
        notifyItemChanged(pos);
    }

    public interface OnItemListener {
        void rightButtonClicked(int pos,String day);
        void switchClicked(boolean isChecked,int pos);
    }


问:
How to make non-sendable type usable in Sendable context?
I have such code

```<code>public func webView(
        _ webView: WKWebView,
        didReceive challenge: URLAuthenticationChallenge,
        completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void
    ) {

        Task.detached(priority: .background) {
 guard let serverTrust = challenge.protectionSpace.serverTrust else {
            completionHandler(.cancelAuthenticationChallenge, nil)
            return
        }
            let exceptions = SecTrustCopyExceptions(serverTrust)
            SecTrustSetExceptions(serverTrust, exceptions)
            completionHandler(.useCredential, URLCredential(trust: serverTrust))
        }
    }

</code>```

But Xcode complains that URLAuthenticationChallenge type is non-Sendable
How can I make this type sendable, or pass it to task and provide multithread safe access

I've done something like this

```<code>struct SendableValue<T> {
    let value: T
}
</code>```

Warning disappeared but I daubt that it is correct solution as there isn't any mutexes

Maybe it should be more like this

```<code>struct SendableValue<T>: Sendable {
    private let semaphore = DispatchSemaphore(value: 1)
    private var _value: T

    init(value: T) {
        _value = value
    }

    var value: T {
        get {
            semaphore.wait()
            defer { semaphore.signal() }
            return _value
        }
        set {
            semaphore.wait()
            defer { semaphore.signal() }
            _value = newValue
        }
    }
}
</code>```

but adding conformance to Sendable on this type throws another warnings

maybe I shouldn't conform to Sendable

I think I am doing somehting wrong here.

Is there any generic simple way to provide isolation layer to non-Sendable type from third party library to make it Sendable i.e. safe in multiconcurrency environment?

Body:
I have such code

public func webView(
        _ webView: WKWebView,
        didReceive challenge: URLAuthenticationChallenge,
        completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void
    ) {

        Task.detached(priority: .background) {
 guard let serverTrust = challenge.protectionSpace.serverTrust else {
            completionHandler(.cancelAuthenticationChallenge, nil)
            return
        }
            let exceptions = SecTrustCopyExceptions(serverTrust)
            SecTrustSetExceptions(serverTrust, exceptions)
            completionHandler(.useCredential, URLCredential(trust: serverTrust))
        }
    }

But Xcode complains that URLAuthenticationChallenge type is non-Sendable
How can I make this type sendable, or pass it to task and provide multithread safe access

I've done something like this

struct SendableValue<T> {
    let value: T
}

Warning disappeared but I daubt that it is correct solution as there isn't any mutexes

Maybe it should be more like this

struct SendableValue<T>: Sendable {
    private let semaphore = DispatchSemaphore(value: 1)
    private var _value: T

    init(value: T) {
        _value = value
    }

    var value: T {
        get {
            semaphore.wait()
            defer { semaphore.signal() }
            return _value
        }
        set {
            semaphore.wait()
            defer { semaphore.signal() }
            _value = newValue
        }
    }
}

but adding conformance to Sendable on this type throws another warnings

maybe I shouldn't conform to Sendable

I think I am doing somehting wrong here.

Is there any generic simple way to provide isolation layer to non-Sendable type from third party library to make it Sendable i.e. safe in multiconcurrency environment?


问:
Syncfussion StackedColumnSeries graph with group name .But Multiple series are not working
i am using the sync fusion chart plugin with Stacked Column Series graph with group name .But Multiple series are not working there because group names do not support them. Please find me any solution.

Please find any solution


问:
How to configure support for ePDG services on Android programmatically?
I need to provide configuration for carrier regarding whether he supports some ePDG servcies or not (e.g. voice, E911, mms).

The best I could find is Android CarrierConfigManager API. But in here I mostly see the configuration keys for discovering the ePDG address: https://developer.android.com/reference/android/telephony/CarrierConfigManager.Iwlan .

I also see this configuration key: https://developer.android.com/reference/android/telephony/CarrierConfigManager?hl=en#IMSI_KEY_AVAILABILITY_INT .
Description:

1 indicates that key type TelephonyManager#KEY_TYPE_EPDG is enabled.

Is this a configuration key for saying "operator supports ePDG"? If so, then is there a way to specify what services are supported?
If not, then what is the correct way to achieve this in Android?


问:
How to open a `vscode://file` link inside a devcontainer?
I'm trying to use the https://www.locatorjs.com tool. I'm using Remote - Containers VS Code extension and the link is generated correctly - it looks like this: vscode://file//workspaces/frontend/src/App.tsx:9:7. The path is correct but this is a path inside a container and, when clicked, VS Code is trying to open this path on a host and it fails.

Is it possible to force VS Code to open this link inside an existing window that is attached to a container?


问:
Regex problem for extract words from the larger list which meet certain conditions using python
I am trying to extract words from the list that meet certain conditions. It  read each line and if the line ends with ")" and in that line it extract words starting from "." and " " space and end to "(" and replace with "function_call".
I am using regex to extract specific words, It works totally fine with smaller dataset(1 millions line of code). But when I use larger dataset (100 millions lines of code). regex give Memoryerror.

The script and code data example.

```<code>import re
data = ["int k = b.k(parcel)",
"int k = kon(parcel)",
"int a",
"int bds",
"obtain.appendFrom(parcel, dataPosition2, readInt2)",
"obtain desFrom(package, dataPosition2, readInt2)",
"int abd(callme)",
"int.dbd(callyou)",
"int throw new UnsupportedOperationException(you)",
"int throw new.UnsupportedOperationException(me)"]

c_data = [
    re.sub(r"(\w+)\s*\(", "function_call(", i)
    for i in data
]
</code>```

I am trying to use a for loop to extract and replace.

```<code>g = []
for i in data:
    if " " or "." in i and i.endswith(")"):
          g = i.replace(f"{i}","function_call")
          clean_data.append(g)
</code>```

But I feels, something is wrong with the for loop code and it is not executing as expected.

Output should be like:

```<code>int k = b.function_call(parcel)
int k = function_call(parcel)
int a
int bds
obtain.function_call(parcel, dataPosition2, readInt2)
obtain function_call(package, dataPosition2, readInt2)
int function_call(callme)
int.function_call(callyou)
int throw new function_call(you)
int throw new.function_call(me)
</code>```

Body:
I am trying to extract words from the list that meet certain conditions. It  read each line and if the line ends with ")" and in that line it extract words starting from "." and " " space and end to "(" and replace with "function_call".
I am using regex to extract specific words, It works totally fine with smaller dataset(1 millions line of code). But when I use larger dataset (100 millions lines of code). regex give Memoryerror.

The script and code data example.

import re
data = ["int k = b.k(parcel)",
"int k = kon(parcel)",
"int a",
"int bds",
"obtain.appendFrom(parcel, dataPosition2, readInt2)",
"obtain desFrom(package, dataPosition2, readInt2)",
"int abd(callme)",
"int.dbd(callyou)",
"int throw new UnsupportedOperationException(you)",
"int throw new.UnsupportedOperationException(me)"]

c_data = [
    re.sub(r"(\w+)\s*\(", "function_call(", i)
    for i in data
]

I am trying to use a for loop to extract and replace.

g = []
for i in data:
    if " " or "." in i and i.endswith(")"):
          g = i.replace(f"{i}","function_call")
          clean_data.append(g)

But I feels, something is wrong with the for loop code and it is not executing as expected.

Output should be like:

int k = b.function_call(parcel)
int k = function_call(parcel)
int a
int bds
obtain.function_call(parcel, dataPosition2, readInt2)
obtain function_call(package, dataPosition2, readInt2)
int function_call(callme)
int.function_call(callyou)
int throw new function_call(you)
int throw new.function_call(me)


问:
Prevent Dash Tabs from auto-refreshing while switching in a multi-page app
Dear Stackoverflow Members

After finding an interesting recommendation prevent-tabs-from-auto-refreshing-when-switching-between-them on an issue (e.g. switching from dcc.Tab without refresh) that I am currently encountering, few additional advice or suggestions are sought on the implementation side, since tabs t2-t4 are missing.

```<code>register_page(__name__, path='/')

def buildTabs():
   tb = [
         dcc.Tab(label='tab1', value='t1'),
         dcc.Tab(label='tab2', value='t2'),
         dcc.Tab(label='tab3', value='t3'),
         dcc.Tab(label='tab4', value='t4'),
        ]

def layout():
   tabs = buildTabs()
   layout = dcc.Tabs(id='test_tab', value='t1', children=tabs)
   return layout

   layout = html.Div([
               layout(),
               html.Div(id='qkt', children='bt'),
             ])
</code>```

N.B: I have not been impressed (owing to limitations) with solutions involving the setting of persistence=True, persistence_type='memory'  on each control held in dcc.Tab such as dcc.Text, etc.

Thanks in advance for your assistance.

Best

Body:
Dear Stackoverflow Members

After finding an interesting recommendation prevent-tabs-from-auto-refreshing-when-switching-between-them on an issue (e.g. switching from dcc.Tab without refresh) that I am currently encountering, few additional advice or suggestions are sought on the implementation side, since tabs t2-t4 are missing.

register_page(__name__, path='/')

def buildTabs():
   tb = [
         dcc.Tab(label='tab1', value='t1'),
         dcc.Tab(label='tab2', value='t2'),
         dcc.Tab(label='tab3', value='t3'),
         dcc.Tab(label='tab4', value='t4'),
        ]

def layout():
   tabs = buildTabs()
   layout = dcc.Tabs(id='test_tab', value='t1', children=tabs)
   return layout

   layout = html.Div([
               layout(),
               html.Div(id='qkt', children='bt'),
             ])

N.B: I have not been impressed (owing to limitations) with solutions involving the setting of persistence=True, persistence_type='memory'  on each control held in dcc.Tab such as dcc.Text, etc.

Thanks in advance for your assistance.

Best


问:
Azure Devops Server M170 - YAML Pipelines "Stages to Run"
i am using Azure Devops Server 2020 (M170) and in Run Pipeline there are no option for select "Stages to Run". It was anounced in M162 but still not working on M170, is it moved to never version or? I have not menu point "Stages to Run" totally....

Tried to research versions, but have no result. Tried to make hardcoded stages, have stages but still no "Stages to Run" menu...


问:
Fix WSL Ubuntu imported from external file
I exported from Windows Subsystem for Linux (WSL) an image containing an Ubuntu OS with the PowerShell command

```<code>wsl --export <WSL Image Name> <file on external drive>
</code>```

Then I imported that file to the WSL subsystem of another computer with

```<code>wsl --import <WSL Image Name> <destination directory> <file on external drive>
</code>```

However something in Ubuntu has changed:

the home directory has changed from /home/<username> to /root, which is also the directory where the OS starts

I'm not asked for password anymore when using sudo

How to restore the original WSL Ubuntu home directory and avoid sudo use without password?

Also, how to check for other possible differences from original installation? After all the goal of exporting/importing a WSL image is to reproduce an OS which behave identically on any machine, which isn't the case for WSL right now.

Body:
I exported from Windows Subsystem for Linux (WSL) an image containing an Ubuntu OS with the PowerShell command

wsl --export <WSL Image Name> <file on external drive>

Then I imported that file to the WSL subsystem of another computer with

wsl --import <WSL Image Name> <destination directory> <file on external drive>

However something in Ubuntu has changed:

the home directory has changed from /home/<username> to /root, which is also the directory where the OS starts

I'm not asked for password anymore when using sudo

How to restore the original WSL Ubuntu home directory and avoid sudo use without password?

Also, how to check for other possible differences from original installation? After all the goal of exporting/importing a WSL image is to reproduce an OS which behave identically on any machine, which isn't the case for WSL right now.


问:
Is it possible to add empty line between sibling elements in VSCode using Prettier?
Desired behaviour =>

Before formatting

After formatting


问:
After sending email with emailJs I receive a 404 error
I'm implementing a Contact Page for my portfolio with a send email option. The email works to find, I receive it in my account, and after sending it I have an alert of success or error. But after I click on ok button of the alert, I have a 404 GitHub error:-

Error Image

The page name is https://myPortfolio.github.io/contact and after sending the email I'm pretending to reload of the page

This is the code I'm using to send the email with EmailJS

const refForm = useRef();
```
<pre class="lang-js prettyprint-override"><code>const sendEmail = (e) => {
 e.preventDefault()

 emailJs.sendForm('XXXX', 'XXXXX', refForm.current, 'XXXXX').then(
  () => {
   alert('Message succesfully sent!')
   window.location.reload(false)
  },
  () => {
   alert('Failed to send the message, please try again')
  }
 )
}
</code>```

And this is the form.

 <form
  ref="{refForm}"
  onSubmit="{sendEmail}">

    <input
     type="text"
     name="name"
     placeholder="Name"
     required />

    <input
     type="email"
     name="email"
     placeholder="email"
     required />

    <input
     type="text"
     name="subject"
     placeholder="Subject"
     required />

    <textarea
     placeholder="Message"
     name="message"
     required></textarea>

    <input
     type="submit"
     className="flat-button"
     value="SEND"
     required />

 </form>

```

Body:
I'm implementing a Contact Page for my portfolio with a send email option. The email works to find, I receive it in my account, and after sending it I have an alert of success or error. But after I click on ok button of the alert, I have a 404 GitHub error:-

Error Image

The page name is https://myPortfolio.github.io/contact and after sending the email I'm pretending to reload of the page

This is the code I'm using to send the email with EmailJS

const refForm = useRef();

const sendEmail = (e) => {
 e.preventDefault()

 emailJs.sendForm('XXXX', 'XXXXX', refForm.current, 'XXXXX').then(
  () => {
   alert('Message succesfully sent!')
   window.location.reload(false)
  },
  () => {
   alert('Failed to send the message, please try again')
  }
 )
}

And this is the form.

 <form
  ref="{refForm}"
  onSubmit="{sendEmail}">

    <input
     type="text"
     name="name"
     placeholder="Name"
     required />

    <input
     type="email"
     name="email"
     placeholder="email"
     required />

    <input
     type="text"
     name="subject"
     placeholder="Subject"
     required />

    <textarea
     placeholder="Message"
     name="message"
     required></textarea>

    <input
     type="submit"
     className="flat-button"
     value="SEND"
     required />

 </form>


问:
IntelliJ org/apache/cxf/tools/wsdlto/WSDLToJava has been compiled by a more recent version of the Java Runtime
I am getting the following error message:
error message

For some reason IntelliJ compiles plugin JAR files with JDK 11 not 8.

I have the following configuration in Project Structure:
IntelliJ Project Structure view

Gradle JVM:

Gradle JVM view

Java Compiler:
Java compiler view

Also tried to change Boot runtime version, but in case I am using an old one IntelliJ won't open:
Currently selected version of JBR version

JAVA_HOME is referencing to JDK 8:

Windows JAVA_HOME variable value

Right now I don't have any ideas what to do. Any suggestions?

IntelliJ version: 2022.3.1

Gradle Wrapper version: 3.0

JDK version: 1.8


问:
Need to get full PDF in one page only Puppeteer?
I have an application in which I have to generate PDF for report but I am facing issue in creating PDF

As I want my PDF to look good and I don't know height of my PDF content so when I create PDF it breaks pages at wrong place

So is there any way to create full PDF in one Page only so that it want break on any other place

I have added my code below

```<code>const reportDetailHTML = await this.getHTML("report-detail.html", {
  ...
});

const sectionHTML = await this.getHTML(
  "section-divider.html",
  {
    ...
  }
);

const browser = await puppeteer.launch({
  args: ["--font-render-hinting=none", "--force-color-profile=srgb"],
  headless: true,
});

const page: any = await browser.newPage();

await page.setUserAgent(
  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
);

await page.setContent(reportDetailHTML + sectionHTML, {
  waitUntil: "networkidle0",
});

let height = await page.evaluate(
  () => document.documentElement.offsetHeight
);
console.log(height);
await page.waitForNetworkIdle();
await page.evaluateHandle("document.fonts.ready");
await page.emulateMediaType("screen");
const pdf = await page.pdf({
  printBackground: true,
  margin: "none",
  format:"A4",
  height,
});

writeFile("./report.pdf", pdf, {}, (err) => {
  if (err) {
    return console.error("error");
  }
  console.log("success!");
});
await browser.close();`
</code>```

So is there any way to create full PDF in one Page only so that it want break on any other place

Body:
I have an application in which I have to generate PDF for report but I am facing issue in creating PDF

As I want my PDF to look good and I don't know height of my PDF content so when I create PDF it breaks pages at wrong place

So is there any way to create full PDF in one Page only so that it want break on any other place

I have added my code below

const reportDetailHTML = await this.getHTML("report-detail.html", {
  ...
});

const sectionHTML = await this.getHTML(
  "section-divider.html",
  {
    ...
  }
);

const browser = await puppeteer.launch({
  args: ["--font-render-hinting=none", "--force-color-profile=srgb"],
  headless: true,
});

const page: any = await browser.newPage();

await page.setUserAgent(
  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
);

await page.setContent(reportDetailHTML + sectionHTML, {
  waitUntil: "networkidle0",
});

let height = await page.evaluate(
  () => document.documentElement.offsetHeight
);
console.log(height);
await page.waitForNetworkIdle();
await page.evaluateHandle("document.fonts.ready");
await page.emulateMediaType("screen");
const pdf = await page.pdf({
  printBackground: true,
  margin: "none",
  format:"A4",
  height,
});

writeFile("./report.pdf", pdf, {}, (err) => {
  if (err) {
    return console.error("error");
  }
  console.log("success!");
});
await browser.close();`

So is there any way to create full PDF in one Page only so that it want break on any other place


问:
"MODULE FAILURE\nSee stdout/stderr for the exact error"
im try to install grafana on ansible playbook, and I try this in a CentOS 7 OS, my task is using "ansible.builtin.yum" that I found in ansible documentation like this:

```<code>- name: Install the grafana rpm from a remote repo
  ansible.builtin.yum:
    name: https://dl.grafana.com/oss/release/grafana-{{ grafana_version }}.x86_64.rpm
    state: present
</code>```

With the grafana_version set in the default file...

But the task give me a problem with the msg "MODULE FAILURE\nSee stdout/stderr for the exact error"

I reed that is a problem with the sudoers but i dont have the access to this by my ssh.

The problem:

```<code> FAILED! => {"changed": false, "module_stderr": "Shared connection to (SSH) closed.\r\n", "module_stdout": "\r\nTraceback (most recent call last):\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/AnsiballZ_dnf.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/AnsiballZ_dnf.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/AnsiballZ_dnf.py\", line 47, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.dnf', init_globals=dict(_module_fqn='ansible.modules.dnf', _modlib_path=modlib_path),\r\n  File \"<frozen runpy>\", line 226, in run_module\r\n  File \"<frozen runpy>\", line 98, in _run_module_code\r\n  File \"<frozen runpy>\", line 88, in _run_code\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1465, in <module>\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1454, in main\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1428, in run\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1073, in ensure\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 973, in _install_remote_rpms\r\n  File \"/usr/lib/python3.11/site-packages/dnf/base.py\", line 1341, in add_remote_rpms\r\n    raise IOError(_(\"Could not open: {}\").format(' '.join(pkgs_error)))\r\nOSError: Could not open: /home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/grafana-9.3.2.x86_6438hmxnkk.rpm\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
</code>```

I try install the grafana by binaty with the unarchive, and this make the download but take me anocther error with nor find the requested service grafana-server: host

Body:
im try to install grafana on ansible playbook, and I try this in a CentOS 7 OS, my task is using "ansible.builtin.yum" that I found in ansible documentation like this:

- name: Install the grafana rpm from a remote repo
  ansible.builtin.yum:
    name: https://dl.grafana.com/oss/release/grafana-{{ grafana_version }}.x86_64.rpm
    state: present

With the grafana_version set in the default file...

But the task give me a problem with the msg "MODULE FAILURE\nSee stdout/stderr for the exact error"

I reed that is a problem with the sudoers but i dont have the access to this by my ssh.

The problem:

 FAILED! => {"changed": false, "module_stderr": "Shared connection to (SSH) closed.\r\n", "module_stdout": "\r\nTraceback (most recent call last):\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/AnsiballZ_dnf.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/AnsiballZ_dnf.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/AnsiballZ_dnf.py\", line 47, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.dnf', init_globals=dict(_module_fqn='ansible.modules.dnf', _modlib_path=modlib_path),\r\n  File \"<frozen runpy>\", line 226, in run_module\r\n  File \"<frozen runpy>\", line 98, in _run_module_code\r\n  File \"<frozen runpy>\", line 88, in _run_code\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1465, in <module>\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1454, in main\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1428, in run\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1073, in ensure\r\n  File \"/tmp/ansible_ansible.legacy.dnf_payload_q_8jy3dh/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 973, in _install_remote_rpms\r\n  File \"/usr/lib/python3.11/site-packages/dnf/base.py\", line 1341, in add_remote_rpms\r\n    raise IOError(_(\"Could not open: {}\").format(' '.join(pkgs_error)))\r\nOSError: Could not open: /home/user/.ansible/tmp/ansible-tmp-1672318071.738662-2292270-253361333856714/grafana-9.3.2.x86_6438hmxnkk.rpm\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

I try install the grafana by binaty with the unarchive, and this make the download but take me anocther error with nor find the requested service grafana-server: host


问:
Determining if C++ code has changes since last make
I am calling some C++ through a python code using the subprocess library. A number of times (in the past) I have made changes to the C++ code and forgotten to 'make' it and ran my python code. This resulted in it running the old version of the C++ code and making the results useless.

I have seen that some debuggers alert me that there were changes to the C++ code since the last 'make'. Is there a way to do this using python or some terminal command to alert me of this so that I avoid running old code.


问:
Creating a single all day calendar event from a single google sheet
I want to create a single all day calendar event from a single google sheet.

I have been racking my brain over this for a couple days and its getting old. All the examples I have seen and tried to adapt use a range of cells to create multiple calendar events. I want to do something like this, every sheet is an order form, and every order will have its own sheet, so every sheet will have a single due date, and a single job name, and each sheet needs to be added to the calendar. And every time I need to make a new order I will copy the blank sheet, fill it out, and click a button to add that new order to the calendar. So every time I have thought I had it figured out, and I modify code I fond online to do this, I get errors, I try to fix them, I get others, and I just cant seem to get this stupid thing working!

I feel like what I want to do is doable, and should be pretty simple, I'm just lost on this. I am not new to coding, generally, but I have not coded is this format, and I honestly don't understand a lot of the callouts and what they are doing.

Any help? Please?

I have tried adapting code I have found across the internet, such as the code found here