问:
Unable to load nokogiri in docker container on M1 Mac
I am building a linux docker image on an M1 mac (FROM ruby:3.0.2-alpine3.12 if it matters).

When I attempt to perform a bundle exec in my container, ruby complains that it is unable to load nokogiri. If I simply start ruby and try to require nokogiri I get the same result:

```<code>bash-5.0# irb
irb(main):001:0> require 'nokogiri'
<internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- nokogiri (LoadError)
    from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from (irb):1:in `<main>'
    from /usr/local/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
    from /usr/local/bin/irb:23:in `load'
    from /usr/local/bin/irb:23:in `<main>'
</code>```

The gem is installed

```<code>ls -la /app/vendor/bundle/ruby/3.0.0/gems/

<snip>
drwxr-xr-x    6 root     root          4096 Feb  2 22:43 nokogiri-1.13.1-aarch64-linux
<snip
</code>```

One somewhat curious thing is

```<code>bash-5.0# ruby --version
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [aarch64-linux-musl]
</code>```

I don't think the musl platform is causing the mismatch. Our production machines are amd64 and there's a similar amd64/amd64-musl mismatch there, but they run the containers correctly.

Is there a way to get this working?

Workaround

I have been able to work around this by disabling the use of precompiled gems when bundling, but it would be nice to not have to do so. (We have a mixed M1/Intel dev group and the cross compile for the foreign architecture seems to be pretty lengthy).

答:
I had a similar problem with a Rails app that has dependency on Nokogiri running on an Alpine based container on my Macbook M1. Here is what I did:

Reading the Nokogiri documentation, I found out that aarch64-linux (the architecture used inside the Docker container) is actually supported, but it requires glibc >= 2.29.

I am far from being an expert but, as far as I know, Alpine distributions don't include glibc but musl. Fortunately, there are ways to run programs that need glibc in Alpine.

I personally followed the first option, that is, I installed gcompat. I just needed to add gcompat to the list of packages to install in my Dockerfile.

RUN apk add --no-cache ... gcompat

After that change, things went smoothly and the Rails app started up with no issues.

Again, I am not an expert and the above might be inaccurate, but it did the magic for me. I hope it can help you too.

Body:
I am building a linux docker image on an M1 mac (FROM ruby:3.0.2-alpine3.12 if it matters).

When I attempt to perform a bundle exec in my container, ruby complains that it is unable to load nokogiri. If I simply start ruby and try to require nokogiri I get the same result:

bash-5.0# irb
irb(main):001:0> require 'nokogiri'
<internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- nokogiri (LoadError)
    from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from (irb):1:in `'
    from /usr/local/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
    from /usr/local/bin/irb:23:in `load'
    from /usr/local/bin/irb:23:in `'

The gem is installed

ls -la /app/vendor/bundle/ruby/3.0.0/gems/

<snip>
drwxr-xr-x    6 root     root          4096 Feb  2 22:43 nokogiri-1.13.1-aarch64-linux
<snip

One somewhat curious thing is

bash-5.0# ruby --version
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [aarch64-linux-musl]

I don't think the musl platform is causing the mismatch. Our production machines are amd64 and there's a similar amd64/amd64-musl mismatch there, but they run the containers correctly.

Is there a way to get this working?

Workaround

I have been able to work around this by disabling the use of precompiled gems when bundling, but it would be nice to not have to do so. (We have a mixed M1/Intel dev group and the cross compile for the foreign architecture seems to be pretty lengthy).


来源: stackexchange

问:
Keyboard and layout handling with React Native
I've been trying to figure out how to properly handle layout changes after keyboard opens up (At least on Android). I'm using latest Expo.
Example of my form:

```<code><View style={{flex: 1}}>
   <View style={{flex: 1}}></View>
   <View style={{flex: 2}}>
     <TextInput></TextInput>
     <TextInput></TextInput>
     <TextInput></TextInput>
     <TextInput></TextInput>
     <Button></Button>
   </View>
</View>
</code>```

The problem is, when i click on any TextInput, the keyboard squishes everything thats above it and it becomes unreachable until i close the keyboard.I've already tried using:

KeyboardAvoidingView + ScrollView inside

"softwareKeyboardLayoutMode": "pan" in app.json

KeyboardAwareScrollView - seems to be working, kinda, problem below

I also have a problem with "pan" setting, screen adjusts weirdly in a way that it will squish top elements when i click on a bottom TextInput, but wont when i click on a top TextInput, which breaks KeyboardAwareScrollView i guess (It adds different padding/height to  the bottom of a screen depending on where i click to open a keyboard)

Does anybody have a better solution to this problem? I want it to simply enable scroll on view (add height ?) without squishing flexboxes or changing anything in my layout.

答:
It's really tough to manage multiple inputs with help of the keyboard avoiding view from React Native Library.

To find the workaround for this, and fix the issues with the Multiple Inputs and Keyboard management in iOS, I have used an npm dependency known as react-native-keyboard-aware-scrollview

Which really helped me in achieving my goal.

You can also try the npm dependency, I hope it will surely help you in achieving your desired outcome.

Here I am attaching the HOC component, Using which I wrap my components in which I need to manage the input and keyboard avoiding.

HOC Component :

```<code>import * as React from "react"
import { View, TouchableWithoutFeedback, Keyboard } from "react-native"
import SafeAreaView from 'react-native-safe-area-view'
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"

/**
 * Root component for screen managing safe area view and keyboard avoiding view
 */
const Root = (props) => {
  const { style, children } = props

  return (
    <SafeAreaView style={{ flex: 1, backgroundColor: 'white' }}>
      <KeyboardAwareScrollView
        keyboardShouldPersistTaps={'always'}
        contentContainerStyle={{
          flexGrow: 1 // this will fix scrollview scroll issue by passing parent view width and height to it
        }}
      >
        <TouchableWithoutFeedback
          onPress={Keyboard.dismiss}
          style={{ flexGrow: 1 }}
        >
          <View style={{ flexGrow: 1 }}>
            {children}
          </View>
        </TouchableWithoutFeedback>
      </KeyboardAwareScrollView>
    </SafeAreaView>
  )
}

export default Root
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I've been trying to figure out how to properly handle layout changes after keyboard opens up (At least on Android). I'm using latest Expo.
Example of my form:

<View style={{flex: 1}}>
   <View style={{flex: 1}}></View>
   <View style={{flex: 2}}>
     <TextInput></TextInput>
     <TextInput></TextInput>
     <TextInput></TextInput>
     <TextInput></TextInput>
     <Button></Button>
   </View>
</View>

The problem is, when i click on any TextInput, the keyboard squishes everything thats above it and it becomes unreachable until i close the keyboard.I've already tried using:

KeyboardAvoidingView + ScrollView inside

"softwareKeyboardLayoutMode": "pan" in app.json

KeyboardAwareScrollView - seems to be working, kinda, problem below

I also have a problem with "pan" setting, screen adjusts weirdly in a way that it will squish top elements when i click on a bottom TextInput, but wont when i click on a top TextInput, which breaks KeyboardAwareScrollView i guess (It adds different padding/height to  the bottom of a screen depending on where i click to open a keyboard)

Does anybody have a better solution to this problem? I want it to simply enable scroll on view (add height ?) without squishing flexboxes or changing anything in my layout.

Body:
It's really tough to manage multiple inputs with help of the keyboard avoiding view from React Native Library.

To find the workaround for this, and fix the issues with the Multiple Inputs and Keyboard management in iOS, I have used an npm dependency known as react-native-keyboard-aware-scrollview

Which really helped me in achieving my goal.

You can also try the npm dependency, I hope it will surely help you in achieving your desired outcome.

Here I am attaching the HOC component, Using which I wrap my components in which I need to manage the input and keyboard avoiding.

HOC Component :

import * as React from "react"
import { View, TouchableWithoutFeedback, Keyboard } from "react-native"
import SafeAreaView from 'react-native-safe-area-view'
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"

/**
 * Root component for screen managing safe area view and keyboard avoiding view
 */
const Root = (props) => {
  const { style, children } = props

  return (
    <SafeAreaView style={{ flex: 1, backgroundColor: 'white' }}>
      <KeyboardAwareScrollView
        keyboardShouldPersistTaps={'always'}
        contentContainerStyle={{
          flexGrow: 1 // this will fix scrollview scroll issue by passing parent view width and height to it
        }}
      >
        <TouchableWithoutFeedback
          onPress={Keyboard.dismiss}
          style={{ flexGrow: 1 }}
        >
          <View style={{ flexGrow: 1 }}>
            {children}
          </View>
        </TouchableWithoutFeedback>
      </KeyboardAwareScrollView>
    </SafeAreaView>
  )
}

export default Root


问:
How do you use a different theme in a remote VS Code window
Using VS Code Remote Development (SSH, container, WSL) I want a different theme on my remote and local VS Code windows so that I can easily tell them apart.</p>

答: Alternatively to @DanielImms' answer, you can add the same setting to your .vscode/settings.json or your .code-workspace file to select a different color scheme for each (remote) folder or workspace.


问:
Rounded Semicircle with CSS

I'm struggling to make the semicircle edges round, where can i fix my code?

.circle {
  position: absolute;
  width: 80px;
  height: 50px;
  background-color: transparent;
  top: 70;
  left: 20;
  border-bottom-right-radius: 70px;
  border-bottom-left-radius: 70px;
  border: 20px solid #fff58f;
  border-top: 0;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="circle"></div></code>```

答:
Another possibility with css

I have used ::before and ::after pseudo elements for the rounded corner for the semi circle.

.parentcircle {
  position: absolute;
  background: #824b20;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 30px;
}

.outercircle {
  position: relative;
  width: 100%;
  height: 100%;
  background: #e08027;
  border-radius: 50%;
}

.circle {
  position: relative;
  width: calc(100% - 20px);
  height: calc(50% - 10px);
  background-color: transparent;
  top: 50%;
  left: -10px;
  border-bottom-right-radius: 50% 100%;
  border-bottom-left-radius: 50% 100%;
  border: 20px solid #FFF58F;
  border-top: 0
}

.circle::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  background: #FFF58F;
  top: -10px;
  left: -20px;
}

.circle::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  background: #FFF58F;
  top: -10px;
  left: 100%;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="parentcircle">
  <div class="outercircle">
    <div class="circle"></div>
  </div>
</div></code>```

Title: Rounded Semicircle with CSS

Body:
Another possibility with css

I have used ::before and ::after pseudo elements for the rounded corner for the semi circle.

.parentcircle {
  position: absolute;
  background: #824b20;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 30px;
}

.outercircle {
  position: relative;
  width: 100%;
  height: 100%;
  background: #e08027;
  border-radius: 50%;
}

.circle {
  position: relative;
  width: calc(100% - 20px);
  height: calc(50% - 10px);
  background-color: transparent;
  top: 50%;
  left: -10px;
  border-bottom-right-radius: 50% 100%;
  border-bottom-left-radius: 50% 100%;
  border: 20px solid #FFF58F;
  border-top: 0
}

.circle::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  background: #FFF58F;
  top: -10px;
  left: -20px;
}

.circle::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  background: #FFF58F;
  top: -10px;
  left: 100%;
}

<div class="parentcircle">
  <div class="outercircle">
    <div class="circle"></div>
  </div>
</div>


问:
'Renaming' duplicate items in a Python list
I am creating a word guessing game where a player needs to guess the secret word.

For each guess the user makes, I classify each letter of a guess to either of the following three categories:

Hot - The letter is in the right place when compared to the secret word.

Warm - The letter is in the secret word but not in the right place.

Cold - The letter is not in the secret word.

To do this, I have created a simple loop:

```<code>for i in range(len(guess)):
    if guess[i] in secret_word[i]:
        # Hot
    elif guess[i] in secret_word:
        # Warm
    else:
        # Cold
</code>```

However, the problem with this loop is, for instance, the secret word is: apple, and the user inputs puppy. The loop returns:

```<code>Hot: [p]
Warm: [p, p]
Cold: [u, y]
</code>```

The error(s):

1. We don't know which 'p' are the right/wrong ones.

So to fix this, I was planning to 'assign' them numbers corresponding to how many times they appear in the guess so that the output should be like below:

```<code>Hot = [p2]
Warm = [p1] # Since there are 2 remaining 'p's, we'll just take the first one
Cold = [p3, u, y]
</code>```

This way, the user knows which letter and position they got right. Although, I have been trying to implement the above procedure in my code to no avail. I'll be really grateful if anyone can help me!

答:
You can achieve this easier by using enumerate. This way you can access both index and letter and quickly compute if a letter is hot, warm or cold. Something like this:

```<code>secret = "apple"
guess = "puppy"

hot = []
warm = []
cold = []

for index, letter in enumerate(guess):
    if letter == secret[index]:
        hot.append(letter + str(index))
    elif letter in secret:
        warm.append(letter)
    else:
        cold.append(letter)

print(f"Hot: {hot};  Warm: {warm}; Cold: {cold}")
</code>```

For your example this will output:

```<code>Hot: ['p2'];  Warm: ['p', 'p']; Cold: ['u', 'y']
</code>```

Body:
I am creating a word guessing game where a player needs to guess the secret word.

For each guess the user makes, I classify each letter of a guess to either of the following three categories:

Hot - The letter is in the right place when compared to the secret word.

Warm - The letter is in the secret word but not in the right place.

Cold - The letter is not in the secret word.

To do this, I have created a simple loop:

for i in range(len(guess)):
    if guess[i] in secret_word[i]:
        # Hot
    elif guess[i] in secret_word:
        # Warm
    else:
        # Cold

However, the problem with this loop is, for instance, the secret word is: apple, and the user inputs puppy. The loop returns:

Hot: [p]
Warm: [p, p]
Cold: [u, y]

The error(s):

1. We don't know which 'p' are the right/wrong ones.

So to fix this, I was planning to 'assign' them numbers corresponding to how many times they appear in the guess so that the output should be like below:

Hot = [p2]
Warm = [p1] # Since there are 2 remaining 'p's, we'll just take the first one
Cold = [p3, u, y]

This way, the user knows which letter and position they got right. Although, I have been trying to implement the above procedure in my code to no avail. I'll be really grateful if anyone can help me!

Body:
You can achieve this easier by using enumerate. This way you can access both index and letter and quickly compute if a letter is hot, warm or cold. Something like this:

secret = "apple"
guess = "puppy"

hot = []
warm = []
cold = []

for index, letter in enumerate(guess):
    if letter == secret[index]:
        hot.append(letter + str(index))
    elif letter in secret:
        warm.append(letter)
    else:
        cold.append(letter)

print(f"Hot: {hot};  Warm: {warm}; Cold: {cold}")

For your example this will output:

Hot: ['p2'];  Warm: ['p', 'p']; Cold: ['u', 'y']


问:
How to design button with box shadow in native script
I am new in native script.I want to design button with box shadow

.boxShadow {
   box-shadow: 10px 10px 5px grey;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><Button class="boxShadow" text="submit"></Button></code>```

答:
Box-shadow is now supported in nativescript 8:

```<code>.boxShadow {
   box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
   box-shadow: 0 0 5px #000000;
}

.anotherBoxShadow {
   box-shadow: 0 0 5px #000000;
}

<Button class="boxShadow" text="submit"></Button>
</code>```

More details here: ns8 announcement

Body:
I am new in native script.I want to design button with box shadow

.boxShadow {
   box-shadow: 10px 10px 5px grey;
}

<Button class="boxShadow" text="submit"></Button>

Body:
Box-shadow is now supported in nativescript 8:

.boxShadow {
   box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
   box-shadow: 0 0 5px #000000;
}

.anotherBoxShadow {
   box-shadow: 0 0 5px #000000;
}

<Button class="boxShadow" text="submit"></Button>

More details here: ns8 announcement


问:
OpenCSV Avoid using FileWriter and return InputStream
I am using OpenCsv and the new CSVWriter() method takes a Writer as an argument.

What I am trying to achieve is that to avoid writing to the file system and instead return an InputStream. I am not sure how to go about this. Not very familiar with Streams also I am using JAVA 7.

Is it possible that I could make the writeValues method return an InputStream and avoid writing the output on file system.

This is my working implementation:

```<code>private static void writeValues(String[][] cellValues) throws IOException {

    CSVWriter writer = new CSVWriter(new FileWriter("/tmp/myfile.csv"));
    for(String[] row : cellValues) {
        writer.writeNext(row);
    }
    writer.close();
}
</code>```

This is what I want to achieve.
How to Convert the above method to avoid using a FileWriter.

```<code>private static InputStream writeValues(String[][] cellValues) throws IOException {

    InputStream inputStream = ?;

    CSVWriter writer = new CSVWriter(?);
    for(String[] row : cellValues) {
        writer.writeNext(row);
    }
    writer.close();

    return inputStream;
}
</code>```

答:
Grab a working snippet without StatefulBeanToCsv which I do not prefer.</p>
```<code> String[] headers = { "id", "result", "searchTerm"};
 ByteArrayOutputStream stream = new ByteArrayOutputStream();
 OutputStreamWriter streamWriter = new OutputStreamWriter(stream);
 CSVWriter writer = new CSVWriter(streamWriter);
 writer.writeNext(headers);
 // listOfRows -> business logic collection containing data for csv rows, as you can see I've separated the declaration of headers
 listOfRows.forEach(it -> {
        writer.writeNext(new String[] {it.getId().toString(), it.getResult(), it.getSearchTerm()});
 });

 streamWriter.flush();
 byte[] byteArrayOutputStream = stream.toByteArray();
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I am using OpenCsv and the new CSVWriter() method takes a Writer as an argument.

What I am trying to achieve is that to avoid writing to the file system and instead return an InputStream. I am not sure how to go about this. Not very familiar with Streams also I am using JAVA 7.

Is it possible that I could make the writeValues method return an InputStream and avoid writing the output on file system.

This is my working implementation:

private static void writeValues(String[][] cellValues) throws IOException {

    CSVWriter writer = new CSVWriter(new FileWriter("/tmp/myfile.csv"));
    for(String[] row : cellValues) {
        writer.writeNext(row);
    }
    writer.close();
}

This is what I want to achieve.
How to Convert the above method to avoid using a FileWriter.

private static InputStream writeValues(String[][] cellValues) throws IOException {

    InputStream inputStream = ?;

    CSVWriter writer = new CSVWriter(?);
    for(String[] row : cellValues) {
        writer.writeNext(row);
    }
    writer.close();

    return inputStream;
}

Body:
Grab a working snippet without StatefulBeanToCsv which I do not prefer.

 String[] headers = { "id", "result", "searchTerm"};
 ByteArrayOutputStream stream = new ByteArrayOutputStream();
 OutputStreamWriter streamWriter = new OutputStreamWriter(stream);
 CSVWriter writer = new CSVWriter(streamWriter);
 writer.writeNext(headers);
 // listOfRows -> business logic collection containing data for csv rows, as you can see I've separated the declaration of headers
 listOfRows.forEach(it -> {
        writer.writeNext(new String[] {it.getId().toString(), it.getResult(), it.getSearchTerm()});
 });

 streamWriter.flush();
 byte[] byteArrayOutputStream = stream.toByteArray();


问:
What I need write this second SFINAE constructor?
I wanted to activate a class with parameter packs when all types in the parameter pack is distinct. I wrote a small helper function like this that works with no problem:

```<code>template<typename T, typename... Ts>
constexpr bool has_duplicate_types() {
    if constexpr (sizeof...(Ts) == 0)
        return false;
    else
        return ((std::is_same_v<std::decay_t<T>, std::decay_t<Ts>> || ...) || has_duplicate_types<Ts...>());
}
</code>```

When I tried to activate my class using SFINAE, I tried several method and the working one was this:

```<code>template<typename T, typename dummy = void, typename... Ts>
struct XYZ_imp {
    XYZ_imp() {
        std::cout << "ok\n";
    }
};

template<typename T, typename... Ts>
struct XYZ_imp<T, std::enable_if_t<has_duplicate_types<T, Ts...>()>, Ts...> {
    XYZ_imp() = delete;
};

template<typename T, typename... Ts>
using XYZ = XYZ_imp<T, void, Ts...>;
</code>```

But as you see, it is too much code. But when I tried to write it like this:

```<code>template<typename T, typename... Ts>
struct XYZ {
    template<typename U = T, std::enable_if_t<has_duplicate_types<U, Ts...>(), int> = 0>
    XYZ() = delete;
};
</code>```

I don't know why it is not working. It works as expected when there is a similar type like XYZ<int,int> and it says constructor is deleted, but when types differ like XYZ<int,double>, I get following error:

no matching function for call to 'XYZ<int, double>::XYZ()'

If I write another SFINAE constructor like this:

```<code>template<typename T, typename... Ts>
struct XYZ {
    template<typename U = T, std::enable_if_t<has_duplicate_types<U, Ts...>(), int> = 0>
    XYZ() = delete;
    template<typename U = T, std::enable_if_t<!has_duplicate_types<U, Ts...>(), int> = 0>
    XYZ() {
        std::cout << "ok\n";
    }
};
</code>```

It will work, but I have no idea why I need to write 2nd one and it does not pick defaulted one without it automatically. Any idea why?

答:
If I write another SFINAE constructor like this: ... It will work, but I have no idea why I need to write 2nd one and it does not pick defaulted one without it automatically.

The compiler doesn't generate the default constructor if you define any custom constructor, even if that constructor is disabled by SFINAE.

And since you need to write the non-=deleted constructor, you might as well remove the =deleted one:

```<code>template<typename T, typename... Ts>
struct XYZ
{
    template <typename U = T, std::enable_if_t<!has_duplicate_types<U, Ts...>(), int> = 0>
    XYZ()
    {
        std::cout << "ok\n";
    }
};
</code>```

Body:
I wanted to activate a class with parameter packs when all types in the parameter pack is distinct. I wrote a small helper function like this that works with no problem:

template<typename T, typename... Ts>
constexpr bool has_duplicate_types() {
    if constexpr (sizeof...(Ts) == 0)
        return false;
    else
        return ((std::is_same_v<std::decay_t<T>, std::decay_t<Ts>> || ...) || has_duplicate_types<Ts...>());
}

When I tried to activate my class using SFINAE, I tried several method and the working one was this:

template<typename T, typename dummy = void, typename... Ts>
struct XYZ_imp {
    XYZ_imp() {
        std::cout << "ok\n";
    }
};

template<typename T, typename... Ts>
struct XYZ_imp<T, std::enable_if_t<has_duplicate_types<T, Ts...>()>, Ts...> {
    XYZ_imp() = delete;
};

template<typename T, typename... Ts>
using XYZ = XYZ_imp<T, void, Ts...>;

But as you see, it is too much code. But when I tried to write it like this:

template<typename T, typename... Ts>
struct XYZ {
    template<typename U = T, std::enable_if_t<has_duplicate_types(), int> = 0>
    XYZ() = delete;
};

I don't know why it is not working. It works as expected when there is a similar type like XYZ<int,int> and it says constructor is deleted, but when types differ like XYZ<int,double>, I get following error:

no matching function for call to 'XYZ<int, double>::XYZ()'

If I write another SFINAE constructor like this:

template<typename T, typename... Ts>
struct XYZ {
    template<typename U = T, std::enable_if_t<has_duplicate_types(), int> = 0>
    XYZ() = delete;
    template<typename U = T, std::enable_if_t<!has_duplicate_types(), int> = 0>
    XYZ() {
        std::cout << "ok\n";
    }
};

It will work, but I have no idea why I need to write 2nd one and it does not pick defaulted one without it automatically. Any idea why?

Body:
If I write another SFINAE constructor like this: ... It will work, but I have no idea why I need to write 2nd one and it does not pick defaulted one without it automatically.

The compiler doesn't generate the default constructor if you define any custom constructor, even if that constructor is disabled by SFINAE.

And since you need to write the non-=deleted constructor, you might as well remove the =deleted one:

template<typename T, typename... Ts>
struct XYZ
{
    template <typename U = T, std::enable_if_t<!has_duplicate_types<U, Ts...>(), int> = 0>
    XYZ()
    {
        std::cout << "ok\n";
    }
};


问:
Custom Google Map Icon If Value >=1
I am using the code below to correctly show markers on a Google map using location data from MySQL database.

```<code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>All Locations</title>
        <link rel="stylesheet" href="css/alllocationsstyle.css" type="text/css" media="all" />
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en"></script>
        <script type="text/javascript">
            var customIcons = {
            0: {
            icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png',
            shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
            },
            1: {
            icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png',
            shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
            }
            };

            function load() {
            var map = new google.maps.Map(document.getElementById("map"), {
            center: new google.maps.LatLng(54.312195845815246,-4.45948481875007),
            zoom:6,
            mapTypeId: 'roadmap'
            });

            var infoWindow = new google.maps.InfoWindow;

            // Change this depending on the name of your PHP file
            downloadUrl("phpfile.php", function(data) {
            var xml = data.responseXML;
            var markers = xml.documentElement.getElementsByTagName("marker");
            for (var i = 0; i < markers.length; i++) {
            var locationname = markers[i].getAttribute("locationname");
            var address = markers[i].getAttribute("address");
            var finds = markers[i].getAttribute("finds");
         var totalfinds = markers[i].getAttribute("totalfinds");
            var point = new google.maps.LatLng(
            parseFloat(markers[i].getAttribute("osgb36lat")),
            parseFloat(markers[i].getAttribute("osgb36lon")));
            var html = locationname + ', No.of finds: ' + "<b>" + totalfinds + "</b>";
            var icon = customIcons[totalfinds] || {};
            var marker = new google.maps.Marker({
            map: map,
            position: point,
            title: address,
            icon: icon.icon,
            shadow: icon.shadow
            });
          bindInfoWindow(marker, map, infoWindow, html);
            }
            });
            }

            function bindInfoWindow(marker, map, infoWindow, html) {
            google.maps.event.addListener(marker, 'click', function() {
            infoWindow.setContent(html);
            infoWindow.open(map, marker);
            });
            }

            function downloadUrl(url, callback) {
            var request = window.ActiveXObject ?
            new ActiveXObject('Microsoft.XMLHTTP') :
            new XMLHttpRequest;

            request.onreadystatechange = function() {
            if (request.readyState == 4) {
            request.onreadystatechange = doNothing;
            callback(request, request.status);
            }
            };

            request.open('GET', url, true);
            request.send(null);
            }

            function doNothing() {}

            </script>
            </head>

            <body onLoad="load()">
                <div id="map"></div>
            </body>
            </html>
</code>```

As it stands at the moment, the code to determine whether the marker shown, is red, or green, is pure and simply whether the value of one of the fields is '0' or '1'.

What I would like to do is to change this to reflect whether the value is '0' or whether it's '1' or 'greater than 1' to determine the color of the marker.

With my limited knowledge I've tried using '>1', '>=1' which haven't worked.

I just wondered whether it would be at all possible whether someone could please point me in the right direction so I can get this to work.

答:
@IRHM - Thanks for the reply, it's clear now.

The '0' and '1' in your example are just ways of "naming" those two icons. 'cat' and 'dog' would be equally valid names e.g.

```<code>var customIcons = {
  cat: {
    icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png',
    shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
  },
  dog: {
    icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png',
    shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
  }
};
</code>```

Your code happens to work today because when you count the icons, you end up with 0 or 1 which are the names you chose. To change it so that you can select '0' or '> 1' you need to add some extra logic. Replace:

```<code>var icon = customIcons[totalfinds] || {};
</code>```

with:

```<code>var icon = {};
if (totalFinds == 0) {
  icon = customIcons[0];
} else if (totalFinds >= 1) {
  icon = customIcons[1];
}
</code>```

This logic checks the value of totalFinds, and then uses that to look up one of the icons in customIcons using the names you provided (in this case '0' or '1').

Title: Custom Google Map Icon If Value >=1

Body:
I am using the code below to correctly show markers on a Google map using location data from MySQL database.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>All Locations</title>
        <link rel="stylesheet" href="css/alllocationsstyle.css" type="text/css" media="all" />

As it stands at the moment, the code to determine whether the marker shown, is red, or green, is pure and simply whether the value of one of the fields is '0' or '1'.

What I would like to do is to change this to reflect whether the value is '0' or whether it's '1' or 'greater than 1' to determine the color of the marker.

With my limited knowledge I've tried using '>1', '>=1' which haven't worked.

I just wondered whether it would be at all possible whether someone could please point me in the right direction so I can get this to work.

Body:
@IRHM - Thanks for the reply, it's clear now.

The '0' and '1' in your example are just ways of "naming" those two icons. 'cat' and 'dog' would be equally valid names e.g.

var customIcons = {
  cat: {
    icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png',
    shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
  },
  dog: {
    icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png',
    shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
  }
};

Your code happens to work today because when you count the icons, you end up with 0 or 1 which are the names you chose. To change it so that you can select '0' or '> 1' you need to add some extra logic. Replace:

var icon = customIcons[totalfinds] || {};

with:

var icon = {};
if (totalFinds == 0) {
  icon = customIcons[0];
} else if (totalFinds >= 1) {
  icon = customIcons[1];
}

This logic checks the value of totalFinds, and then uses that to look up one of the icons in customIcons using the names you provided (in this case '0' or '1').


问:
How to remove set-device-owner in Android DPM?
I have made an app device owner using ADB, by following this link :
How to make my app a device owner?

but now, I'm not able to revert this.

In the device administration Tab, this option is disabled. Not able to change the value of this app.

答:
This is crazy. I have been able to remove Device Admin (uninstall or disable) on my S7 and S5 forever.
I don't understand why I cannot disable/remove a Package Disabler app as is malfunctioning on my S10 w/ OS 11.

Surely there is a way to remove it via ADB?
I added it via ADB.

I wish people would write complete instructions WITH warnings that you will not be able to remove it after install without factory reset! (all my apps + data lost!)

Hmm... Please provide a solution for stock non-root users :D
Thanks!


问:
Flutter ios pod install failed after upgrading Xcode and Flutter version
Tried different solution, but nothing works for me.

Sharing links refereed.

Flutter Error running pod install After Upgrading Flutter version

Pod Result

```<code>Running "flutter pub get" in firstapp...                         2,706ms
</code>```

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...                                              5.3s
CocoaPods' output:
↳
Preparing

```<code>Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `razorpay_flutter` from `.symlinks/plugins/razorpay_flutter/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
</code>```

Error output from CocoaPods:
↳

```<code>[!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for #<String:0x00007fcbdf105240> (NoMethodError)
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173:in `repo_information'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77:in `stack'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:24:in `report'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for #<String:0x00007fcbda2b6c60> (NoMethodError)
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:393:in `source_with_url'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/sources_manager.rb:22:in `find_or_create_source_with_url'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `map'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `sources'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1077:in `block in resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
</code>```

Error running pod install
Error launching application on iPhone 12 Pro Max.

After updating the MAC OS response this

```<code>Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
</code>```

Running pod install...                                           1,300ms
CocoaPods' output:
↳
Preparing

```<code>Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `razorpay_flutter` from `.symlinks/plugins/razorpay_flutter/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
</code>```

Error output from CocoaPods:
↳
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in initialize': undefined method with_indifferent_access' for #String:0x00007fd8f39e86e8 (NoMethodError)
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in new' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in from_file'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in refresh_metadata' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in refresh_metadata'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in initialize' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in initialize'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in new' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in block in source_from_path'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in source_from_path' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in block in aggregate_with_repos'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in map' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in aggregate_with_repos'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in aggregate' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in all'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173:in repo_information' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77:in stack'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:24:in report' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in handle_exception' from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in run' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in run'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in <top (required)>' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in load'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in ' /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in initialize': undefined method with_indifferent_access' for #<String:0x00007fd8f6a9e8a0> (NoMethodError) from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in new'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in from_file' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in refresh_metadata'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in refresh_metadata' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in initialize'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in initialize' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in new'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in block in source_from_path' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in source_from_path'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in block in aggregate_with_repos' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in map'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in aggregate_with_repos' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in aggregate'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in all' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:393:in source_with_url'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/sources_manager.rb:22:in find_or_create_source_with_url' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:178:in block in sources'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in map' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in sources'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1077:in block in resolve_dependencies' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in section'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in resolve_dependencies' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in analyze'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in analyze' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in block in resolve_dependencies'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in section' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in resolve_dependencies'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in install!' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in run'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in <top (required)>' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in load'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `'

Error running pod install
Error launching application on iPhone 12 Pro Max.

答:
Try this on android studio or any-other IDE which you use

rm -vrf ~/.cocoapods*

brew reinstall cocoapods

Delete the Podfile, Podfile.lock, Pods folder, Runner.xcworkspace, Flutter.framwork(in iOS/Flutter folder)

flutter clean

flutter build iOS

Body:
Tried different solution, but nothing works for me.

Sharing links refereed.

Flutter Error running pod install After Upgrading Flutter version

Pod Result

Running "flutter pub get" in firstapp...                         2,706ms

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...                                              5.3s
CocoaPods' output:
↳
Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `razorpay_flutter` from `.symlinks/plugins/razorpay_flutter/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update

Error output from CocoaPods:
↳

[!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for #<String:0x00007fcbdf105240> (NoMethodError)
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173:in `repo_information'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77:in `stack'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:24:in `report'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for #<String:0x00007fcbda2b6c60> (NoMethodError)
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in `refresh_metadata'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:393:in `source_with_url'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/sources_manager.rb:22:in `find_or_create_source_with_url'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `map'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `sources'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1077:in `block in resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
    from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `'

Error running pod install
Error launching application on iPhone 12 Pro Max.

After updating the MAC OS response this

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...

Running pod install...                                           1,300ms
CocoaPods' output:
↳
Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `razorpay_flutter` from `.symlinks/plugins/razorpay_flutter/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update

Error output from CocoaPods:
↳
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in initialize': undefined method with_indifferent_access' for #String:0x00007fd8f39e86e8 (NoMethodError)
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in new' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in from_file'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in refresh_metadata' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in refresh_metadata'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in initialize' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in initialize'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in new' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in block in source_from_path'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in source_from_path' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in block in aggregate_with_repos'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in map' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in aggregate_with_repos'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in aggregate' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in all'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173:in repo_information' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77:in stack'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:24:in report' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in handle_exception' from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in run' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in run'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in <top (required)>' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in load'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in ' /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in initialize': undefined method with_indifferent_access' for #<String:0x00007fd8f6a9e8a0> (NoMethodError) from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in new'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in from_file' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in refresh_metadata'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in refresh_metadata' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in initialize'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in initialize' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in new'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in block in source_from_path' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in source_from_path'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in block in aggregate_with_repos' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in map'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in aggregate_with_repos' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in aggregate'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in all' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:393:in source_with_url'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/sources_manager.rb:22:in find_or_create_source_with_url' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:178:in block in sources'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in map' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in sources'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1077:in block in resolve_dependencies' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in section'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in resolve_dependencies' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in analyze'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in analyze' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in block in resolve_dependencies'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in section' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in resolve_dependencies'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in install!' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in run'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in <top (required)>' from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in load'
from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `'

Error running pod install
Error launching application on iPhone 12 Pro Max.


问:
How to fix position image on another image
I have the following code (also pasted below), where I want to make a layout of two columns. In the first one I am putting two images, and in the second displaying some text.

In the first column, I want to have the first image with width:70% and the second one with position:absolute on it. The final result should be like this

As you see the second image partially located in first one in every screens above to 768px.

I can partially locate second image on first one, but that is not dynamic, if you change screen dimensions you can see how that collapse.

But no matter how hard I try, I can not achieve this result.

.checkoutWrapper {
  display: grid;
  grid-template-columns: 50% 50%;
}

.coverIMGLast {
  width: 70%;
  height: 100vh;
}

/* this .phone class should be dynamically  located partially on first image */
.phone {
  position: absolute;
  height: 90%;
  top: 5%;
  bottom: 5%;
  margin-left: 18%;
}

.CheckoutProcess {
  padding: 5.8rem 6.4rem;
}

.someContent {
  border: 1px solid red;
}

/* removing for demo purposes
@media screen and (max-width: 768px) {
  .checkoutWrapper {
    display: grid;
    grid-template-columns: 100%;
  }
  img {
    display: none;
  }
  .CheckoutProcess {
    padding: 0;
  }
}
*/```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="checkoutWrapper">
  <img src="https://via.placeholder.com/300" class="coverIMGLast" />
  <img src="https://via.placeholder.com/300/ff0000" class="phone" />

  <div class="CheckoutProcess">
    <Content />
  </div>
</div></code>```

答:
With the code below, you have the structure that you want. All you have to do is to play with the width, height, etc to make exactly what you need.

.checkoutWrapper {
  display: grid;
  grid-template-columns: 50% 50%;
  align-items:center;
}

.checkoutImgs {
  position: relative;
}

img{
  object-fit:cover;
  display:block;
  height:100%;
}

.coverIMGLast {
  width: 70%;
  height: 100vh;

}

.phone {
  position: absolute;
  height: 80%;
  width:40%;
  top: 10%;
  right: 0;

}

.CheckoutProcess {
  padding: 1rem 2.4rem;
  display:grid;
  place-items:center
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="checkoutWrapper">
  <div class="checkoutImgs">
    <img
      src="https://images.unsplash.com/photo-1659592516254-c00ca7af3db4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw0fHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=500&q=60"
      class="coverIMGLast"
    />
    <img
      src="https://images.unsplash.com/photo-1659808749760-e5baf9c16f10?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxMnx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60"
      class="phone"
    />
  </div>

  <div class="CheckoutProcess">
    Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page
    avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les
    années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour
    réaliser un livre spécimen de polices de texte. Il n'a pas fait que survivre cinq siècles,
    mais s'est aussi adapté à la bureautique informatique
  </div>
</div></code>```

Body:
I have the following code (also pasted below), where I want to make a layout of two columns. In the first one I am putting two images, and in the second displaying some text.

In the first column, I want to have the first image with width:70% and the second one with position:absolute on it. The final result should be like this

As you see the second image partially located in first one in every screens above to 768px.

I can partially locate second image on first one, but that is not dynamic, if you change screen dimensions you can see how that collapse.

But no matter how hard I try, I can not achieve this result.

.checkoutWrapper {
  display: grid;
  grid-template-columns: 50% 50%;
}

.coverIMGLast {
  width: 70%;
  height: 100vh;
}

/* this .phone class should be dynamically  located partially on first image */
.phone {
  position: absolute;
  height: 90%;
  top: 5%;
  bottom: 5%;
  margin-left: 18%;
}

.CheckoutProcess {
  padding: 5.8rem 6.4rem;
}

.someContent {
  border: 1px solid red;
}

/* removing for demo purposes
@media screen and (max-width: 768px) {
  .checkoutWrapper {
    display: grid;
    grid-template-columns: 100%;
  }
  img {
    display: none;
  }
  .CheckoutProcess {
    padding: 0;
  }
}
*/

    <Content />

Body:
With the code below, you have the structure that you want. All you have to do is to play with the width, height, etc to make exactly what you need.

.checkoutWrapper {
  display: grid;
  grid-template-columns: 50% 50%;
  align-items:center;
}

.checkoutImgs {
  position: relative;
}

img{
  object-fit:cover;
  display:block;
  height:100%;
}

.coverIMGLast {
  width: 70%;
  height: 100vh;

}

.phone {
  position: absolute;
  height: 80%;
  width:40%;
  top: 10%;
  right: 0;

}

.CheckoutProcess {
  padding: 1rem 2.4rem;
  display:grid;
  place-items:center
}

<div class="checkoutWrapper">
  <div class="checkoutImgs">
    <img
      src="https://images.unsplash.com/photo-1659592516254-c00ca7af3db4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw0fHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=500&q=60"
      class="coverIMGLast"
    />
    <img
      src="https://images.unsplash.com/photo-1659808749760-e5baf9c16f10?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxMnx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60"
      class="phone"
    />
  </div>

  <div class="CheckoutProcess">
    Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page
    avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les
    années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour
    réaliser un livre spécimen de polices de texte. Il n'a pas fait que survivre cinq siècles,
    mais s'est aussi adapté à la bureautique informatique
  </div>
</div>


问:
Is there a way to count sequence of 0 and 1 in R?
I have the following data as an excel file:

X

0

0

1

1

0

0

I want to count the number of times I have the following sequence:

```<code>00
11
10
01
</code>```

I desire the following output:

Sequence Count

00  2

11  1

01  1

10  1

I tried using count but I could not come up with anything useful. count.seq serves a similar purpose but it estimates for DNA or RNA sequence data.

Body:
I have the following data as an excel file:

X

0

0

1

1

0

0

I want to count the number of times I have the following sequence:

00
11
10
01

I desire the following output:

Sequence Count

00  2

11  1

01  1

10  1

I tried using count but I could not come up with anything useful. count.seq serves a similar purpose but it estimates for DNA or RNA sequence data.

Body:
x <- c(0, 0, 1, 1, 0, 0)
n <- length(x)
s <- paste0(x[-n], x[-1L])
s
## [1] "00" "01" "11" "10" "00"

table(factor(s, levels = c("00", "01", "10", "11")))
## 00 01 10 11
##  2  1  1  1


问:
is requestAnimationFrame belong to microtask or macrotask in main thread task management? if not, how can we categorize this kind of render side task
how react schedule effects? I made some test, it seems hooks is called after requestAnimationFrame, but before setTimeout. So, I was wondering, how is the real implementation of scheduler. I checked react source code, it seems built upon MessageChannel api.
Also, how event-loop runs the macrotask sequence, for instance setTimeout/script etc.?

```<code>const addMessageChannel = (performWorkUntilDeadline: any) => {
    const channel = new MessageChannel();
    const port = channel.port2;
    channel.port1.onmessage = performWorkUntilDeadline;
    port.postMessage(null);
}
const Component1 = () => {
    const [value,] = useState('---NOT INITIALISED')
    requestIdleCallback(() => {
        console.log('requestIdleCallback---')
    })
    useEffect(() => {
        console.log('useEffect---')
    }, [])
    Promise.resolve().then(() => {
        console.log('promise---')
    })
    setTimeout(() => {
        console.log('setTimeout---')
    });
    addMessageChannel(()=> {
        console.log('addMessageChannel---')
    })
    requestAnimationFrame(() => {
        console.log('requestAnimationFrame---')
    })
    return <div>{value}</div>;
}
export default Component1
</code>```

browser console result:

```<code>promise---
requestAnimationFrame---
addMessageChannel---
useEffect---
setTimeout---
requestIdleCallback---
</code>```

答:
I'm not sure about the useEffect so I'll take your word they use a MessageChannel and consider both addMessageChannel and  useEffect a tie.

First the title (part of it at least):

[Does] requestAnimationFrame belong to microtask or macrotask[...]?

Technically... neither. requestAnimationFrame (rAF)'s callbacks are ... callbacks.

Friendly reminder that there is no such thing as a "macrotask": there are "tasks" and "microtasks", the latter being a subset of the former.

Now while microtasks are tasks they do have a peculiar processing model since they do have their own microtask-queue (which is not a task queue) and which will get visited several times during each event-loop iterations. There are multiple "microtask-checkpoints" defined in the event-loop processing model, and every time the JS callstack is empty this microtask-queue will get visited too.

Then there are tasks, colloquially called "macro-tasks" here and there to differentiate from the micro-tasks. Only one of these tasks will get executed per event-loop iteration, selected at the first step.

Finally there are callbacks. These may be called from a task (e.g when the task is to fire an event), or in some particular event-loop iterations, called "painting frames".

Indeed the step labelled update the rendering is to be called once in a while (generally when the monitor sent its V-Sync update), and will run a series of operations, calling callbacks, among which our dear rAF's callbacks.

Why is this important? Because this means that rAF (and the other callbacks in the "painting frame"), have a special place in the event-loop where they may seem to be called with the highest priority. Actually they don't participate in the task prioritization system per se (which happens in the first step of the event loop), they may indeed be called from the same event-loop iteration as even the task that did queue them.

setTimeout(() => {
  console.log("timeout 1");
  requestAnimationFrame(() => console.log("rAF callback"));
  const now = performance.now();
  while(performance.now() - now < 1000) {} // lock the event loop
});
setTimeout(() => console.log("timeout 2"));```
</div>
</div>

Which we can compare with this other snippet where we start the whole thing from inside a rAF callback:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>requestAnimationFrame(() => {
  setTimeout(() => {
    console.log("timeout 1");
    requestAnimationFrame(() => console.log("rAF callback"));
  });
  setTimeout(() => console.log("timeout 2"));
});</code>```

While this may seem like an exceptional case to have our task called in a painting-frame, it's actually quite common, because browsers have recently decided to <s>break rAF</s> make the first call to rAF trigger a painting frame instantly when the document is not animated.

So any test with rAF should start long after the document has started, with an rAF loop already running in the background...

Ok, so rAF result may be fluck. What about your other results.

Promise first, yes. Not part of the task prioritization either, as said above the microtask-queue will get visited as soon as the JS callstack is empty, as part of the clean after running a script step.

rAF, fluck.

addMessageChannel, see this answer of mine. Basically, in Chrome it's due to both setTimeout having a minimum timeout of 1ms, and a higher priority of the message-tasksource over the timeout-tasksource.

setTimeout currently has a 1ms minimum delay in Chrome and a lower priority than MessageEvents, still it would not be against the specs to have it called before the message.

requestIdleCallback, that one is a bit complex but given it will wait for the event-loop has not done anything in some time, it will be the last.

Body:
how react schedule effects? I made some test, it seems hooks is called after requestAnimationFrame, but before setTimeout. So, I was wondering, how is the real implementation of scheduler. I checked react source code, it seems built upon MessageChannel api.
Also, how event-loop runs the macrotask sequence, for instance setTimeout/script etc.?

const addMessageChannel = (performWorkUntilDeadline: any) => {
    const channel = new MessageChannel();
    const port = channel.port2;
    channel.port1.onmessage = performWorkUntilDeadline;
    port.postMessage(null);
}
const Component1 = () => {
    const [value,] = useState('---NOT INITIALISED')
    requestIdleCallback(() => {
        console.log('requestIdleCallback---')
    })
    useEffect(() => {
        console.log('useEffect---')
    }, [])
    Promise.resolve().then(() => {
        console.log('promise---')
    })
    setTimeout(() => {
        console.log('setTimeout---')
    });
    addMessageChannel(()=> {
        console.log('addMessageChannel---')
    })
    requestAnimationFrame(() => {
        console.log('requestAnimationFrame---')
    })
    return
{value}
;
}
export default Component1

browser console result:

promise---
requestAnimationFrame---
addMessageChannel---
useEffect---
setTimeout---
requestIdleCallback---

Body:
I'm not sure about the useEffect so I'll take your word they use a MessageChannel and consider both addMessageChannel and  useEffect a tie.

First the title (part of it at least):

[Does] requestAnimationFrame belong to microtask or macrotask[...]?

Technically... neither. requestAnimationFrame (rAF)'s callbacks are ... callbacks.

Friendly reminder that there is no such thing as a "macrotask": there are "tasks" and "microtasks", the latter being a subset of the former.

Now while microtasks are tasks they do have a peculiar processing model since they do have their own microtask-queue (which is not a task queue) and which will get visited several times during each event-loop iterations. There are multiple "microtask-checkpoints" defined in the event-loop processing model, and every time the JS callstack is empty this microtask-queue will get visited too.

Then there are tasks, colloquially called "macro-tasks" here and there to differentiate from the micro-tasks. Only one of these tasks will get executed per event-loop iteration, selected at the first step.

Finally there are callbacks. These may be called from a task (e.g when the task is to fire an event), or in some particular event-loop iterations, called "painting frames".

Indeed the step labelled update the rendering is to be called once in a while (generally when the monitor sent its V-Sync update), and will run a series of operations, calling callbacks, among which our dear rAF's callbacks.

Why is this important? Because this means that rAF (and the other callbacks in the "painting frame"), have a special place in the event-loop where they may seem to be called with the highest priority. Actually they don't participate in the task prioritization system per se (which happens in the first step of the event loop), they may indeed be called from the same event-loop iteration as even the task that did queue them.

setTimeout(() => {
  console.log("timeout 1");
  requestAnimationFrame(() => console.log("rAF callback"));
  const now = performance.now();
  while(performance.now() - now < 1000) {} // lock the event loop
});
setTimeout(() => console.log("timeout 2"));

Which we can compare with this other snippet where we start the whole thing from inside a rAF callback:

requestAnimationFrame(() => {
  setTimeout(() => {
    console.log("timeout 1");
    requestAnimationFrame(() => console.log("rAF callback"));
  });
  setTimeout(() => console.log("timeout 2"));
});

While this may seem like an exceptional case to have our task called in a painting-frame, it's actually quite common, because browsers have recently decided to <s>break rAF</s> make the first call to rAF trigger a painting frame instantly when the document is not animated.

So any test with rAF should start long after the document has started, with an rAF loop already running in the background...

Ok, so rAF result may be fluck. What about your other results.

Promise first, yes. Not part of the task prioritization either, as said above the microtask-queue will get visited as soon as the JS callstack is empty, as part of the clean after running a script step.

rAF, fluck.

addMessageChannel, see this answer of mine. Basically, in Chrome it's due to both setTimeout having a minimum timeout of 1ms, and a higher priority of the message-tasksource over the timeout-tasksource.

setTimeout currently has a 1ms minimum delay in Chrome and a lower priority than MessageEvents, still it would not be against the specs to have it called before the message.

requestIdleCallback, that one is a bit complex but given it will wait for the event-loop has not done anything in some time, it will be the last.