问:
in Python, get "merge as of" to match multiple (and possibly repetitive) rows of one dataframe to rows of another dataframe based on range of dates
I have two data frames and I want to merge them based on dates. I want any rows df2 to match with rows of df1 on the condition that the date on df2 entry is within the 5-year-prior window of the date of entry in df1.

to elaborate, let's say df1 looks something like this:

firm_id
firm_date

12345
30/11/1994

12345
31/03/1995

67890
31/12/1994

67890
31/03/1995

and df2 looks like this:

firm_id
patent_id
patent_filing_date

12345
14526368
15/12/1989

12345
75896328
05/06/1994

12345
42589651
20/02/1995

67890
54216987
20/02/1990

67890
65874139
12/07/1993

67890
65874139
17/05/1994

67890
58792543
13/02/1995

The desired output would look like this:

firm_id
datadate
patent_id
patent_filing_date

12345
30/11/1994
14526368
15/12/1989

12345
30/11/1994
75896328
05/06/1994

12345
31/03/1995
75896328
05/06/1994

12345
31/03/1995
42589651
20/02/1995

67890
31/12/1994
54216987
20/02/1990

67890
31/12/1994
65874139
12/07/1993

67890
31/03/1995
65874139
12/07/1993

67890
31/03/1995
65874139
17/05/1994

67890
31/03/1995
58792543
13/02/1995

So as you see, a row from df2 can match with multiple rows of df1 as long its date is within the 5-year-prior window to the date of df1.

so far, I have come up with the following code:

```<code>df_merge = pd.merge_asof(df2, df1 , left_on='patent_filing_date' , right_on='datadate',
direction='forward', tolerance=pd.Timedelta(1824, unit="d"), by='firm_id')
</code>```

The problem is, the above code matches each row from df2 to df1 only once and doesn't repeat the rows when necessary. That is, it looks like I am getting the following:

firm_id
datadate
patent_id
patent_filing_date

12345
30/11/1994
14526368
15/12/1989

12345
30/11/1994
75896328
05/06/1994

67890
31/12/1994
54216987
20/02/1990

67890
31/12/1994
65874139
12/07/1993

67890
31/03/1995
65874139
17/05/1994

67890
31/03/1995
58792543
13/02/1995

Whereas, I want each entry from df2 to match with all possible entries from df1 regardless of whether they have matched with another row of df1.

Appreciate any help with merge as of, or alternative functions.
Thanks

Body:
I have two data frames and I want to merge them based on dates. I want any rows df2 to match with rows of df1 on the condition that the date on df2 entry is within the 5-year-prior window of the date of entry in df1.

to elaborate, let's say df1 looks something like this:

firm_id
firm_date

12345
30/11/1994

12345
31/03/1995

67890
31/12/1994

67890
31/03/1995

and df2 looks like this:

firm_id
patent_id
patent_filing_date

12345
14526368
15/12/1989

12345
75896328
05/06/1994

12345
42589651
20/02/1995

67890
54216987
20/02/1990

67890
65874139
12/07/1993

67890
65874139
17/05/1994

67890
58792543
13/02/1995

The desired output would look like this:

firm_id
datadate
patent_id
patent_filing_date

12345
30/11/1994
14526368
15/12/1989

12345
30/11/1994
75896328
05/06/1994

12345
31/03/1995
75896328
05/06/1994

12345
31/03/1995
42589651
20/02/1995

67890
31/12/1994
54216987
20/02/1990

67890
31/12/1994
65874139
12/07/1993

67890
31/03/1995
65874139
12/07/1993

67890
31/03/1995
65874139
17/05/1994

67890
31/03/1995
58792543
13/02/1995

So as you see, a row from df2 can match with multiple rows of df1 as long its date is within the 5-year-prior window to the date of df1.

so far, I have come up with the following code:

df_merge = pd.merge_asof(df2, df1 , left_on='patent_filing_date' , right_on='datadate',
direction='forward', tolerance=pd.Timedelta(1824, unit="d"), by='firm_id')

The problem is, the above code matches each row from df2 to df1 only once and doesn't repeat the rows when necessary. That is, it looks like I am getting the following:

firm_id
datadate
patent_id
patent_filing_date

12345
30/11/1994
14526368
15/12/1989

12345
30/11/1994
75896328
05/06/1994

67890
31/12/1994
54216987
20/02/1990

67890
31/12/1994
65874139
12/07/1993

67890
31/03/1995
65874139
17/05/1994

67890
31/03/1995
58792543
13/02/1995

Whereas, I want each entry from df2 to match with all possible entries from df1 regardless of whether they have matched with another row of df1.

Appreciate any help with merge as of, or alternative functions.
Thanks


来源: stackexchange

问:
Why does not DeepExplainer from SHAP tool accept my data?
I'm trying to run SHAP tool On my data but to explain my EfficientNetV2S model  , I always get error.
I generate my data using the following code

```<code>train_datagen = ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input).flow_from_directory(train_path,target_size=(IMG_SIZE,IMG_SIZE),classes=['0','1','2','3','4','5','6','7','8','9'],batch_size = Bsize)
valid_datagen = ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input).flow_from_directory(valid_path,target_size=(IMG_SIZE,IMG_SIZE),classes=['0','1','2','3','4','5','6','7','8','9'],batch_size = Bsize)
test_datagen = ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input).flow_from_directory(test_path,target_size=(IMG_SIZE,IMG_SIZE),classes=['0','1','2','3','4','5','6','7','8','9'],batch_size = Bsize,shuffle=False)
</code>```

I'm using DeepExplainer from SHAP using the following code:

```<code># we use the first 100 training examples as our background dataset to integrate over
explainer = shap.DeepExplainer(model, train_datagen[:100])
</code>```

I got this error

```<code>---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [24], in <cell line: 2>()
      1 # we use the first 100 training examples as our background dataset to integrate over
----> 2 explainer = shap.DeepExplainer(model, train_datagen[:100])
      4 # explain the first 10 predictions
      5 # explaining each prediction requires 2 * background dataset size runs
      6 shap_values = explainer.shap_values(train_datagen[:10])

File ~\anaconda3\lib\site-packages\keras\preprocessing\image.py:102, in Iterator.__getitem__(self, idx)
    101 def __getitem__(self, idx):
--> 102     if idx >= len(self):
    103         raise ValueError(
    104             "Asked to retrieve element {idx}, "
    105             "but the Sequence "
    106             "has length {length}".format(idx=idx, length=len(self))
    107         )
    108     if self.seed is not None:

TypeError: '>=' not supported between instances of 'slice' and 'int'
</code>```

I tried to change type of my data but it shap.DeepExplainer didn't accept this change.

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to run SHAP tool On my data but to explain my EfficientNetV2S model  , I always get error.
I generate my data using the following code

train_datagen = ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input).flow_from_directory(train_path,target_size=(IMG_SIZE,IMG_SIZE),classes=['0','1','2','3','4','5','6','7','8','9'],batch_size = Bsize)
valid_datagen = ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input).flow_from_directory(valid_path,target_size=(IMG_SIZE,IMG_SIZE),classes=['0','1','2','3','4','5','6','7','8','9'],batch_size = Bsize)
test_datagen = ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input).flow_from_directory(test_path,target_size=(IMG_SIZE,IMG_SIZE),classes=['0','1','2','3','4','5','6','7','8','9'],batch_size = Bsize,shuffle=False)

I'm using DeepExplainer from SHAP using the following code:

# we use the first 100 training examples as our background dataset to integrate over
explainer = shap.DeepExplainer(model, train_datagen[:100])

I got this error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [24], in <cell line: 2>()
      1 # we use the first 100 training examples as our background dataset to integrate over
----> 2 explainer = shap.DeepExplainer(model, train_datagen[:100])
      4 # explain the first 10 predictions
      5 # explaining each prediction requires 2 * background dataset size runs
      6 shap_values = explainer.shap_values(train_datagen[:10])

File ~\anaconda3\lib\site-packages\keras\preprocessing\image.py:102, in Iterator.__getitem__(self, idx)
    101 def __getitem__(self, idx):
--> 102     if idx >= len(self):
    103         raise ValueError(
    104             "Asked to retrieve element {idx}, "
    105             "but the Sequence "
    106             "has length {length}".format(idx=idx, length=len(self))
    107         )
    108     if self.seed is not None:

TypeError: '>=' not supported between instances of 'slice' and 'int'

I tried to change type of my data but it shap.DeepExplainer didn't accept this change.


问:
Graphql Error: Query.ocrProjects defined in resolvers, but not in schema
I am getting this error:
Error: Query.ocrProjects defined in resolvers, but not in schema

Model:

```<code>import mongoose from "mongoose";
const Schema = mongoose.Schema;

const ocrProjectSchema = {
  // Required fields
  Name: {
    type: String,
  },
  Description: {
    type: String,
  },
  ImgUrl: {
    type: String,
  },
  Creator: {
    type: String,
  },
};

export const OcrProject = mongoose.model("OcrProject", ocrProjectSchema, "OcrProject");
</code>```

Resolver:
resolver functions:

```<code>export const ocrProjects = async () => {
    try {
      const searchResult = await OcrProject.find();
      return searchResult;
    } catch (err) {
      throw err;
    }
};
</code>```

exporting resolvers:

```<code>import { ocrProjects } from "./ocrProject.js";

const OcrProjectResolvers = {
  Query: {
    ocrProjects,
  },
};

export default OcrProjectResolvers;
</code>```

Schema:

```<code>import { gql } from "apollo-server-express";

const OcrProjectSchema = gql`
  type OcrProject {
    _id: ID!
    Name: String
    Description: String
    ImgUrl: String
    Creator: String
  }

  extend type Query {
    ocrProjects: [OcrProject]!
  }
`;

export default OcrProjectSchema;
</code>```

Exact error in console

I am expecting to query all the OcrProjects from the database.

Body:
I am getting this error:
Error: Query.ocrProjects defined in resolvers, but not in schema

Model:

import mongoose from "mongoose";
const Schema = mongoose.Schema;

const ocrProjectSchema = {
  // Required fields
  Name: {
    type: String,
  },
  Description: {
    type: String,
  },
  ImgUrl: {
    type: String,
  },
  Creator: {
    type: String,
  },
};

export const OcrProject = mongoose.model("OcrProject", ocrProjectSchema, "OcrProject");

Resolver:
resolver functions:

export const ocrProjects = async () => {
    try {
      const searchResult = await OcrProject.find();
      return searchResult;
    } catch (err) {
      throw err;
    }
};

exporting resolvers:

import { ocrProjects } from "./ocrProject.js";

const OcrProjectResolvers = {
  Query: {
    ocrProjects,
  },
};

export default OcrProjectResolvers;

Schema:

import { gql } from "apollo-server-express";

const OcrProjectSchema = gql`
  type OcrProject {
    _id: ID!
    Name: String
    Description: String
    ImgUrl: String
    Creator: String
  }

  extend type Query {
    ocrProjects: [OcrProject]!
  }
`;

export default OcrProjectSchema;

Exact error in console

I am expecting to query all the OcrProjects from the database.


问:
i want to split two linear layout with width as full screen. using horizontalscrollview
i want to split two linear layout with width as full screen. using horizontalscrollview.

here is struvture

-> Horizontalscrollview
width :match_parent
->LinearLayout
width:matchparent
->linearLayout
width:matchparent

```<code>                 ->linearLayout
                             width:matchparent
</code>```

but problem is second  linear layouts some parts is coming in first screen which is occupied by first layout

here is my code

```<HorizontalScrollView
            android:id="@+id/scrollview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="horizontal"
android:fillViewport="true"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal"
android:weightSum="2"

                >

                <LinearLayout
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"

                    >

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="right"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_ac"
                            android:layout_width="70dp"
                            android:layout_height="70dp"

                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:hapticFeedbackEnabled="true"
                            android:text="C"
                            android:textColor="#FFFF8D"
                            android:textSize="30dp"

                            />

                        <Button

                            android:id="@+id/btn_mod"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="%"
                            android:textColor="#03DAC6"
                            android:textSize="30dp"

                            />

                        <Button
                            android:id="@+id/btn_div"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="/"
                            android:textColor="#03DAC6"

                            android:textSize="30dp"

                            />

                        <ImageView
                            android:id="@+id/btn_back"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:src="@drawable/back"
                            android:textColor="@color/white"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_seven"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="7"
                            android:textColor="@color/white"
                            android:textSize="30dp"

                            />

                        <Button
                            android:id="@+id/btn_eight"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="8"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_nine"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="9"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_mult"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="X"
                            android:textColor="#03DAC6"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_four"
                            android:layout_width="70dp"
                            android:layout_height="70dp"

                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="4"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_minus"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="-"
                            android:textColor="#03DAC6"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_one"
                            android:layout_width="70dp"
                            android:layout_height="70dp"

                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="1"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_two"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="2"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_three"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="3"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_plus"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="+"
                            android:textColor="#03DAC6"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginStart="25dp"

                            android:background="#424242"
                            android:text="0"
                            android:textColor="@color/white"
                            android:textSize="30dp"
                            android:visibility="invisible" />

                        <Button

                            android:id="@+id/btn_equal"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="@color/purple_200"
                            android:text="="
                            android:textColor="@color/white"

                            android:textSize="40dp" />

                    </LinearLayout>
                </LinearLayout>

                        <LinearLayout
android:layout_weight="1"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"

                            android:gravity="right"

                            >
                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">
                                <Button
                                    android:id="@+id/sbtn_cot"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"

                                    android:textSize="15dp"
                                  android:backgroundTint="@color/black"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#916eff"

                                    android:text="cot"
                                    android:textAllCaps="false"

                                    />

                                <Button

                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:text="%"
                                    android:id="@+id/sbtn_mod"
                                    android:textColor="@color/white"
                                    android:textSize="15dp"

                                    />

                                <Button
                                    android:id="@+id/sbtn_div"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:text="/"
                                    android:textColor="@color/white"

                                    android:textSize="15dp"

                                    />

                                <ImageView
                                    android:id="@+id/sbtn_back"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:paddingRight="1dp"
                                    android:src="@drawable/back"
                                    android:textColor="@color/white"

                                    android:textSize="25dp" />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"

                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_square"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="@color/white"

                                    android:text="x2"
                                    android:textAllCaps="false"

                                    />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_root"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text="√ "
                                    android:textAllCaps="false"

                                    />
                                <Button
                                    android:id="@+id/sbtn_tan"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#916eff"

                                    android:text="tan"
                                    android:textAllCaps="false"

                                    />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_leftp"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text="("
                                    android:textAllCaps="false"

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_rightp"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text=")"
                                    android:textAllCaps="false"

                                    />
                                <Button
                                    android:id="@+id/sbtn_ln"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text="ln"
                                    android:textAllCaps="false"

                                    />
                                <Button
                                    android:id="@+id/sbtn_cosec"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#916eff"

                                    android:text="csc"
                                    android:textAllCaps="false"

                                    />

                                <Button
                                    android:id="@+id/sbtn_zero"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:text="0"
                                    android:textColor="@color/white"

                                    android:textSize="15dp" />

                                <Button
                                    android:id="@+id/sbtn_dot"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:gravity="center"
                                    android:text="."
                                    android:textColor="@color/white"
                                    android:textSize="15dp" />

                                <Button

                                    android:id="@+id/sbtn_equal"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="@color/purple_200"
                                    android:text="="
                                    android:textColor="@color/white"

                                    android:textSize="15dp" />

                            </LinearLayout>

                        </LinearLayout>
            </LinearLayout>
        </HorizontalScrollView>
```

Body:
i want to split two linear layout with width as full screen. using horizontalscrollview.

here is struvture

-> Horizontalscrollview
width :match_parent
->LinearLayout
width:matchparent
->linearLayout
width:matchparent

                 ->linearLayout
                             width:matchparent

but problem is second  linear layouts some parts is coming in first screen which is occupied by first layout

here is my code

<HorizontalScrollView
            android:id="@+id/scrollview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="horizontal"
android:fillViewport="true"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal"
android:weightSum="2"

                >

                <LinearLayout
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"

                    >

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="right"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_ac"
                            android:layout_width="70dp"
                            android:layout_height="70dp"

                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:hapticFeedbackEnabled="true"
                            android:text="C"
                            android:textColor="#FFFF8D"
                            android:textSize="30dp"

                            />

                        <Button

                            android:id="@+id/btn_mod"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="%"
                            android:textColor="#03DAC6"
                            android:textSize="30dp"

                            />

                        <Button
                            android:id="@+id/btn_div"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="/"
                            android:textColor="#03DAC6"

                            android:textSize="30dp"

                            />

                        <ImageView
                            android:id="@+id/btn_back"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:src="@drawable/back"
                            android:textColor="@color/white"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_seven"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="7"
                            android:textColor="@color/white"
                            android:textSize="30dp"

                            />

                        <Button
                            android:id="@+id/btn_eight"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="8"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_nine"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="9"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_mult"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="X"
                            android:textColor="#03DAC6"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_four"
                            android:layout_width="70dp"
                            android:layout_height="70dp"

                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="4"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_minus"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="-"
                            android:textColor="#03DAC6"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:id="@+id/btn_one"
                            android:layout_width="70dp"
                            android:layout_height="70dp"

                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="1"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_two"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="2"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_three"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:fontFamily="sans-serif-condensed"
                            android:text="3"
                            android:textColor="@color/white"
                            android:textSize="30dp" />

                        <Button
                            android:id="@+id/btn_plus"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="#0000"
                            android:text="+"
                            android:textColor="#03DAC6"

                            android:textSize="30dp" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="2dp"
                        android:layout_marginBottom="2dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:paddingTop="2dp"
                        android:paddingBottom="2dp">

                        <Button
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginStart="25dp"

                            android:background="#424242"
                            android:text="0"
                            android:textColor="@color/white"
                            android:textSize="30dp"
                            android:visibility="invisible" />

                        <Button

                            android:id="@+id/btn_equal"
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:layout_marginRight="25dp"
                            android:background="@color/purple_200"
                            android:text="="
                            android:textColor="@color/white"

                            android:textSize="40dp" />

                    </LinearLayout>
                </LinearLayout>

                        <LinearLayout
android:layout_weight="1"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"

                            android:gravity="right"

                            >
                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">
                                <Button
                                    android:id="@+id/sbtn_cot"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"

                                    android:textSize="15dp"
                                  android:backgroundTint="@color/black"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#916eff"

                                    android:text="cot"
                                    android:textAllCaps="false"

                                    />

                                <Button

                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:text="%"
                                    android:id="@+id/sbtn_mod"
                                    android:textColor="@color/white"
                                    android:textSize="15dp"

                                    />

                                <Button
                                    android:id="@+id/sbtn_div"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:text="/"
                                    android:textColor="@color/white"

                                    android:textSize="15dp"

                                    />

                                <ImageView
                                    android:id="@+id/sbtn_back"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:paddingRight="1dp"
                                    android:src="@drawable/back"
                                    android:textColor="@color/white"

                                    android:textSize="25dp" />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"

                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_square"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="@color/white"

                                    android:text="x2"
                                    android:textAllCaps="false"

                                    />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_root"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text="√ "
                                    android:textAllCaps="false"

                                    />
                                <Button
                                    android:id="@+id/sbtn_tan"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#916eff"

                                    android:text="tan"
                                    android:textAllCaps="false"

                                    />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_leftp"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text="("
                                    android:textAllCaps="false"

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="5dp"
                                android:layout_marginBottom="5dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                android:paddingTop="1dp"
                                android:paddingBottom="1dp">

                                <Button
                                    android:id="@+id/sbtn_rightp"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text=")"
                                    android:textAllCaps="false"

                                    />
                                <Button
                                    android:id="@+id/sbtn_ln"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="5dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#FFFF8D"

                                    android:text="ln"
                                    android:textAllCaps="false"

                                    />
                                <Button
                                    android:id="@+id/sbtn_cosec"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"

                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:textSize="15dp"
                                    android:hapticFeedbackEnabled="true"
                                    android:textColor="#916eff"

                                    android:text="csc"
                                    android:textAllCaps="false"

                                    />

                                <Button
                                    android:id="@+id/sbtn_zero"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:text="0"
                                    android:textColor="@color/white"

                                    android:textSize="15dp" />

                                <Button
                                    android:id="@+id/sbtn_dot"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="#0000"
                                    android:gravity="center"
                                    android:text="."
                                    android:textColor="@color/white"
                                    android:textSize="15dp" />

                                <Button

                                    android:id="@+id/sbtn_equal"
                                    android:layout_width="50dp"
                                    android:layout_height="60dp"
                                    android:layout_marginRight="1dp"
                                    android:background="@color/purple_200"
                                    android:text="="
                                    android:textColor="@color/white"

                                    android:textSize="15dp" />

                            </LinearLayout>

                        </LinearLayout>
            </LinearLayout>
        </HorizontalScrollView>


问:
Failed to configure cloudera manager agent
Hi I am new to bigdata and I am installing cloudera manager 7.4.4 on RHEL 8.0. While setting up the cluster I am facing the error like "failed to configure clouder manager agent" Can anyone help me to resolve the issue.
Thank you.


问:
Generates applicable ranges matched condition
I'm trying to write a function which accepts an array of objects, I need to generate all applicable range with object has result is pass. For example input/outout:

getRange([
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "1.24",
    "result": "non-applicable"
  },
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "6.87",
    "result": "pass"
  },
  {
    "value": null,
    "result": "non-applicable"
  }
]) // should output: ["Data < 1.24", "1.24 < Data ≤ 6.87"]

getRange([
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "-1.25",
    "result": "non-applicable"
  },
  {
    "value": null,
    "result": "pass"
  }
]) // should output: ["Data < -1.25", "Data > -1.25"]

getRange([
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "0.05",
    "result": "fail"
  },
  {
    "value": null,
    "result": "non-applicable"
  },
  {
    "value": "1.75",
    "result": "pass"
  },
  {
    "value": null,
    "result": "non-applicable"
  }
]) // should output: ["Data < 0.05", "Data = 1.75"]
```
<p>Everything works as I expect except case 1, it currently returns <code>["Data < 1.24", "Data > 1.24", "Data ≤ 6.87"]</code>. I expect it should be: <code>["Data < 1.24", "1.24 < Data ≤ 6.87"]</code>. Below are my practice code also live debugging in Codesandbox.</p>
<pre class="lang-js prettyprint-override"><code>type Shortcut = {
    value: string;
    result: DefaultResultMapping;
    id?: string;
}

enum DefaultResultMapping {
  Pass = 'pass',
  Fail = 'fail',
  NonApplicable = 'non-applicable'
}

export const getRange = (shortcut: Shortcut[]) => {
  let valueRange: string[] = [];

  shortcut.forEach((group, index) => {
    if (!group.value) {
      return;
    }

    const previous = shortcut[index - 1];
    const next = shortcut[index + 1];

    if (group.result === DefaultResultMapping.Pass) {
      if (
        previous.result !== DefaultResultMapping.Pass &&
        next.result !== DefaultResultMapping.Pass
      ) {
        valueRange.push(`Data = ${group.value}`);
      } else {
        if (previous.result === DefaultResultMapping.Pass) {
          valueRange.push(`Data ≤ ${group.value}`);
        }

        if (next.result === DefaultResultMapping.Pass) {
          valueRange.push(`Data ≥ ${group.value}`);
        }
      }
    } else {
      if (previous.result === DefaultResultMapping.Pass) {
        valueRange.push(`Data < ${group.value}`);
      }

      if (next.result === DefaultResultMapping.Pass) {
        valueRange.push(`Data > ${group.value}`);
      }

      const nextIntersectionIndex = shortcut.findIndex(
        (item, pos) =>
          item.result === DefaultResultMapping.Pass && item.value && pos > index
      );

      if (nextIntersectionIndex > -1) {
        const left = shortcut[nextIntersectionIndex - 1];
        const right = shortcut[nextIntersectionIndex + 1];

        if (
          left.result === DefaultResultMapping.Pass &&
          right.result === DefaultResultMapping.Pass
        ) {
          shortcut.length = index;
        }
      }
    }
  });

  return valueRange;
};

</code>```

Codesandbox.

Your suggestions are highly appreciated.

Body:
I'm trying to write a function which accepts an array of objects, I need to generate all applicable range with object has result is pass. For example input/outout:

getRange([
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "1.24",
    "result": "non-applicable"
  },
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "6.87",
    "result": "pass"
  },
  {
    "value": null,
    "result": "non-applicable"
  }
]) // should output: ["Data < 1.24", "1.24 < Data ≤ 6.87"]

getRange([
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "-1.25",
    "result": "non-applicable"
  },
  {
    "value": null,
    "result": "pass"
  }
]) // should output: ["Data < -1.25", "Data > -1.25"]

getRange([
  {
    "value": null,
    "result": "pass"
  },
  {
    "value": "0.05",
    "result": "fail"
  },
  {
    "value": null,
    "result": "non-applicable"
  },
  {
    "value": "1.75",
    "result": "pass"
  },
  {
    "value": null,
    "result": "non-applicable"
  }
]) // should output: ["Data < 0.05", "Data = 1.75"]

Everything works as I expect except case 1, it currently returns ["Data < 1.24", "Data > 1.24", "Data ≤ 6.87"]. I expect it should be: ["Data < 1.24", "1.24 < Data ≤ 6.87"]. Below are my practice code also live debugging in Codesandbox.

type Shortcut = {
    value: string;
    result: DefaultResultMapping;
    id?: string;
}

enum DefaultResultMapping {
  Pass = 'pass',
  Fail = 'fail',
  NonApplicable = 'non-applicable'
}

export const getRange = (shortcut: Shortcut[]) => {
  let valueRange: string[] = [];

  shortcut.forEach((group, index) => {
    if (!group.value) {
      return;
    }

    const previous = shortcut[index - 1];
    const next = shortcut[index + 1];

    if (group.result === DefaultResultMapping.Pass) {
      if (
        previous.result !== DefaultResultMapping.Pass &&
        next.result !== DefaultResultMapping.Pass
      ) {
        valueRange.push(`Data = ${group.value}`);
      } else {
        if (previous.result === DefaultResultMapping.Pass) {
          valueRange.push(`Data ≤ ${group.value}`);
        }

        if (next.result === DefaultResultMapping.Pass) {
          valueRange.push(`Data ≥ ${group.value}`);
        }
      }
    } else {
      if (previous.result === DefaultResultMapping.Pass) {
        valueRange.push(`Data < ${group.value}`);
      }

      if (next.result === DefaultResultMapping.Pass) {
        valueRange.push(`Data > ${group.value}`);
      }

      const nextIntersectionIndex = shortcut.findIndex(
        (item, pos) =>
          item.result === DefaultResultMapping.Pass && item.value && pos > index
      );

      if (nextIntersectionIndex > -1) {
        const left = shortcut[nextIntersectionIndex - 1];
        const right = shortcut[nextIntersectionIndex + 1];

        if (
          left.result === DefaultResultMapping.Pass &&
          right.result === DefaultResultMapping.Pass
        ) {
          shortcut.length = index;
        }
      }
    }
  });

  return valueRange;
};

Codesandbox.

Your suggestions are highly appreciated.


问:
python2 unicode replacement
after switching to python3 i get errors with unicode builtin functions. Thats my code:

```<code>import os

def Main(root):
    print(u"List Files")
    print(u"{")

    for path, dirs, filenames in os.walk(unicode(os.path.join(root, "property"), "utf-8")):
        for filename in filenames:
            p, file_extension = os.path.splitext(filename)
            if not file_extension.startswith(".pr"):
                continue

            filename = os.path.join(path, filename).encode("utf-8")
            filen = filename.replace("\\", "/").replace("source/", "")
            print("\t{0}".format(filen))

    print(u"}")
    print(u"")
    print(u"List ReservedCRC")
    print(u"{")

    for line in open(unicode(os.path.join(root, "property", "reserve"))):
        print(u"\t{0}".format(line.strip()))

    print(u"}")

if __name__ == "__main__":
    import sys
    import os
Main(sys.argv[1])
</code>```

And that's the error:

```<code>NameError: name 'unicode' is not defined
</code>```

I tried to replace unicode with str, but when i do that i get another error;

```<code>TypeError: decoding str is not supported
</code>```

what i can do to fix it
?

Title: python2 unicode replacement

Body:
after switching to python3 i get errors with unicode builtin functions. Thats my code:

import os

def Main(root):
    print(u"List Files")
    print(u"{")

    for path, dirs, filenames in os.walk(unicode(os.path.join(root, "property"), "utf-8")):
        for filename in filenames:
            p, file_extension = os.path.splitext(filename)
            if not file_extension.startswith(".pr"):
                continue

            filename = os.path.join(path, filename).encode("utf-8")
            filen = filename.replace("\\", "/").replace("source/", "")
            print("\t{0}".format(filen))

    print(u"}")
    print(u"")
    print(u"List ReservedCRC")
    print(u"{")

    for line in open(unicode(os.path.join(root, "property", "reserve"))):
        print(u"\t{0}".format(line.strip()))

    print(u"}")

if __name__ == "__main__":
    import sys
    import os
Main(sys.argv[1])

And that's the error:

NameError: name 'unicode' is not defined

I tried to replace unicode with str, but when i do that i get another error;

TypeError: decoding str is not supported

what i can do to fix it
?


问:
How to transform any column while fetching models
I am using adonisjs 5 for my project to create REST APIs. I am fetching records from Employees table. But what I want want to do is to format dob column to YYYY-MM-DD when retrieving the data.

I am not sure how to achieve it ...

Thanks

I have tried many solution given on internet like
How to format Date in Adonisjs?


问:
Plotting individual polygons using plotly in R
I have a shape file that has polygons and I want to display each polygon separately.

I want to display each polygon separately as if the polygon is represented on a screen and not as a list of coordinates.
What my code is doing here I think is it plots each coordinate and joins them as a line which is not what I want.

This is the output looks like

and this is the code

```<code>nc <- st_read("shp/allpolygons.shp")
#plot(st_zm(nc), max.plot = 1)
c <- st_coordinates(nc)
x <- c[,1]
y <- c[,2]
z <- c[,3]
df <- data.frame(x=x,y=y,z=z)
fig <- plot_ly(df, x = ~x, y = ~y, type = 'scatter', mode = 'lines')
fig
</code>```

How can I visualize each polygon separately?

Body:
I have a shape file that has polygons and I want to display each polygon separately.

I want to display each polygon separately as if the polygon is represented on a screen and not as a list of coordinates.
What my code is doing here I think is it plots each coordinate and joins them as a line which is not what I want.

This is the output looks like

and this is the code

nc <- st_read("shp/allpolygons.shp")
#plot(st_zm(nc), max.plot = 1)
c <- st_coordinates(nc)
x <- c[,1]
y <- c[,2]
z <- c[,3]
df <- data.frame(x=x,y=y,z=z)
fig <- plot_ly(df, x = ~x, y = ~y, type = 'scatter', mode = 'lines')
fig

How can I visualize each polygon separately?


问:
Unable to migrate a Asana project using Ditto
I've tried several times but I just couldn't migrate the project from one workspace to another. I always encounter an error and there seems to be a dead end on my migration path. Can you please help me with getting this sorted as I really need to migrate this project at the earliest.

Error Screenshot

I tried several times, it showed no warnings or errors in the beginning but reflected this in the end. Can you please help me migrate a project from one workspace to another?


问:
Horizontal scrollbar not working as expected in react for table
I am going to implement horizontal scroll for table and vertical scroll for tbody. Like this https://codepen.io/bashid92/pen/LgoQRK but I am confusing to convert jQuery code to react js. working ex expected in jQuery but how can we add into react or if anyone know how add that codepen scroll logic to tanstack react table please add. please help. Thanks in advance.

jQuery code: https://codepen.io/bashid92/pen/LgoQRK react(need to add that jQuery functionality):  https://codesandbox.io/s/table-scrolling-ybuj84?file=/src/App.js

$('table').on('scroll', function () {

        $("#"+this.id+" > *").width($(this).width() + $(this).scrollLeft());
    });```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.table-responsive {
    min-height: .01%;
    overflow-x: auto;
}

table.table-condensed.table-striped {
    border-collapse: collapse;
    width: 500px;
    overflow-x: scroll;
    display: block;
}
.table-condensed.table-striped thead, .table-condensed.table-striped tbody {
    display: block;
}
.table-condensed.table-striped tbody {
    overflow-y: scroll;
    overflow-x: hidden;
    height: 420px;
}
.table>thead>tr>th {
    vertical-align: bottom;
    border-bottom: 2px solid transparent;
}
.table-condensed.table-striped td, .table-condensed.table-striped th {
    min-width: 150px;
    height: 25px;
    overflow:hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.tablehead {
    background-color: #5e5e60;
    color: #fff;
}
.table-condensed>thead.tablehead>tr>th {
    padding: 20px 10px 20px 20px;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 14px;
}
.table-condensed>tbody.tablebody>tr>td {
    padding: 15px 10px 15px 20px;
    text-transform: capitalize;
    font-weight: 400;
    font-size: 14px;
    color: #4d4d4f;
}
.table-striped>tbody>tr:nth-of-type(even) {
    background-color: #e4e4e5;
    min-width: 100%;
    display: inline-block;
    border-bottom: 2px solid #fff;
}
.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #f6f6f6;
    min-width: 100%;
    display: inline-block;
    border-bottom: 2px solid #fff;
}</code>```

                            City
                            No of Guest
                            Occupancy
                            Aloce
                            APR
                            Nationality
                            Title
                            City
                            No of Guest
                            Occupancy
                            Aloce
                            APR
                            Nationality
                            Title

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

```

Body:
I am going to implement horizontal scroll for table and vertical scroll for tbody. Like this https://codepen.io/bashid92/pen/LgoQRK but I am confusing to convert jQuery code to react js. working ex expected in jQuery but how can we add into react or if anyone know how add that codepen scroll logic to tanstack react table please add. please help. Thanks in advance.

jQuery code: https://codepen.io/bashid92/pen/LgoQRK react(need to add that jQuery functionality):  https://codesandbox.io/s/table-scrolling-ybuj84?file=/src/App.js

$('table').on('scroll', function () {

        $("#"+this.id+" > *").width($(this).width() + $(this).scrollLeft());
    });

.table-responsive {
    min-height: .01%;
    overflow-x: auto;
}

table.table-condensed.table-striped {
    border-collapse: collapse;
    width: 500px;
    overflow-x: scroll;
    display: block;
}
.table-condensed.table-striped thead, .table-condensed.table-striped tbody {
    display: block;
}
.table-condensed.table-striped tbody {
    overflow-y: scroll;
    overflow-x: hidden;
    height: 420px;
}
.table>thead>tr>th {
    vertical-align: bottom;
    border-bottom: 2px solid transparent;
}
.table-condensed.table-striped td, .table-condensed.table-striped th {
    min-width: 150px;
    height: 25px;
    overflow:hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.tablehead {
    background-color: #5e5e60;
    color: #fff;
}
.table-condensed>thead.tablehead>tr>th {
    padding: 20px 10px 20px 20px;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 14px;
}
.table-condensed>tbody.tablebody>tr>td {
    padding: 15px 10px 15px 20px;
    text-transform: capitalize;
    font-weight: 400;
    font-size: 14px;
    color: #4d4d4f;
}
.table-striped>tbody>tr:nth-of-type(even) {
    background-color: #e4e4e5;
    min-width: 100%;
    display: inline-block;
    border-bottom: 2px solid #fff;
}
.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #f6f6f6;
    min-width: 100%;
    display: inline-block;
    border-bottom: 2px solid #fff;
}

                            City
                            No of Guest
                            Occupancy
                            Aloce
                            APR
                            Nationality
                            Title
                            City
                            No of Guest
                            Occupancy
                            Aloce
                            APR
                            Nationality
                            Title

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms

                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms
                            Abu Dhabi
                            36789
                            100%
                            2.45
                            700 AED
                            India
                            Occupied Rooms


问:
How to show total child page number under a parent page in WordPress
enter image description here

I want to show total child page under a parent page in a custom post type. I have tried differnt solution but didn't get the result. It showing different result that i didn't expected.
Thanks in advance.

My example code is blew:

```<code><?php
$parent_pages = get_pages( array(
   'parent'   => 0,
   'post_type'    => 'docs'
) );

$totalPages = '';
$i = 1;

?>
</code>```
```<code><div class="row">
   <?php foreach ( $parent_pages as $parent_page ) : ?>

      <?php
         $all_pages = get_pages(array( 'child_of'=> $parent_page->ID, 'post_type'=> 'docs' ) );
         $child_pages = get_page_children( $parent_page->ID, $all_pages );
      ?>

   <div class="col-lg-4">
      <div class="wp-ayyash-single-doc">
         <h5><?php echo esc_html__( $parent_page->post_title , 'wp-ayyash' ); ?></h5>
         <span><?php echo $totalPages;?> Articles</span>
         <div class="wp-ayyash-single-doc-inside">
            <ul>
               <?php
               foreach ( $child_pages as $child_page ) {
                  $pageNumber[$child_page->ID] = $i;
                  $totalPages = count($pageNumber);
               ?>
               <li><a href="<?php echo esc_url(get_permalink($child_page->ID));?>"><?php echo esc_html__( $child_page->post_title , 'wp-ayyash') ?></a></li>
               <?php } ?>
            </ul>
         </div>
         <a href="<?php echo esc_url(get_permalink($parent_page->ID)); ?>" class="button"> <?php esc_html_e('View All', 'wp-ayyash');?> <i class="ai ai-arrow-long-right"></i></a>
      </div>
   </div>
   <?php endforeach;?>
</div>
</code>```

enter image description here

I want to as like the image above. I have tried many solution but i didn't get acctual result.

Body:
enter image description here

I want to show total child page under a parent page in a custom post type. I have tried differnt solution but didn't get the result. It showing different result that i didn't expected.
Thanks in advance.

My example code is blew:

<?php
$parent_pages = get_pages( array(
   'parent'   => 0,
   'post_type'    => 'docs'
) );

$totalPages = '';
$i = 1;

?>

   <?php foreach ( $parent_pages as $parent_page ) : ?>

      <?php
         $all_pages = get_pages(array( 'child_of'=> $parent_page->ID, 'post_type'=> 'docs' ) );
         $child_pages = get_page_children( $parent_page->ID, $all_pages );
      ?>

<?php echo esc_html__( $parent_page->post_title , 'wp-ayyash' ); ?>

         <?php echo $totalPages;?> Articles

               <?php
               foreach ( $child_pages as $child_page ) {
                  $pageNumber[$child_page->ID] = $i;
                  $totalPages = count($pageNumber);
               ?>

<a href="<?php echo esc_url(get_permalink($child_page->ID));?>"><?php echo esc_html__( $child_page->post_title , 'wp-ayyash') ?>

               <?php } ?>

         <a href="<?php echo esc_url(get_permalink($parent_page->ID)); ?>" class="button"> <?php esc_html_e('View All', 'wp-ayyash');?>

   <?php endforeach;?>

enter image description here

I want to as like the image above. I have tried many solution but i didn't get acctual result.


问:
HeidiSQL is not showing any data even when table size is more than 0B
I have Postgresql Database in production and i'm trying to insert data from my localhost using psycopg2 library. i'm seeing my database through HeidiSQL. But after i finished inserting the data, my HeidiSQL shows that table size increased but when i try to see the data, it shows 0 rows. I have tried to drop all tables and re-migrate and re-insert the data, but still it shows 0 rows even when the table size is not 0 B.

I have tried to insert table one by one from the program by comment the other insert and it works. But i still can't understand why i can't see any data when i'm inserting simultaneously


问:
SpecFlow BDD Project build error Could not load file or assembly 'System.Runtime, Version=6.0.0.0
Build the .Net Core 6.0 SpecFlow BDD project on my local machine VS2022 without any problem, however when trying building the same project on Bamboo server with command:

```<code>dotnet test ./TestAutomation.sln -s TestAutomation\test.runsettings
</code>```

got following warning:

```<code>Framework: .NET 5.0.17
build   Warning: Unable to load one or more of the requested types.
build   Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
build   Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
build   Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
</code>```

run the 'dotnet --info' at Bamboo server, retrieving following installation information:

```<code>.NET SDKs installed:
  2.1.4 [C:\Program Files\dotnet\sdk]
  2.1.500 [C:\Program Files\dotnet\sdk]
  3.1.102 [C:\Program Files\dotnet\sdk]
  3.1.416 [C:\Program Files\dotnet\sdk]
  5.0.301 [C:\Program Files\dotnet\sdk]
  5.0.412 [C:\Program Files\dotnet\sdk]
  6.0.200 [C:\Program Files\dotnet\sdk]
  6.0.401 [C:\Program Files\dotnet\sdk]
  7.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
</code>```

What could be the reason, and what I need to check to resolve the problem? thanks.

Body:
Build the .Net Core 6.0 SpecFlow BDD project on my local machine VS2022 without any problem, however when trying building the same project on Bamboo server with command:

dotnet test ./TestAutomation.sln -s TestAutomation\test.runsettings

got following warning:

Framework: .NET 5.0.17
build   Warning: Unable to load one or more of the requested types.
build   Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
build   Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
build   Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

run the 'dotnet --info' at Bamboo server, retrieving following installation information:

.NET SDKs installed:
  2.1.4 [C:\Program Files\dotnet\sdk]
  2.1.500 [C:\Program Files\dotnet\sdk]
  3.1.102 [C:\Program Files\dotnet\sdk]
  3.1.416 [C:\Program Files\dotnet\sdk]
  5.0.301 [C:\Program Files\dotnet\sdk]
  5.0.412 [C:\Program Files\dotnet\sdk]
  6.0.200 [C:\Program Files\dotnet\sdk]
  6.0.401 [C:\Program Files\dotnet\sdk]
  7.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

What could be the reason, and what I need to check to resolve the problem? thanks.