问:
SOFTWARE_TOKEN_MFA 400 error with the MFA integration in cognito pool with reactjs
Please refer to the following image.

I was able to successfully integrate the MFA with my Cognito pool and I am getting the OTP as well. Once the OTP is submitted I get the following error message as a 400 bad request. It seems MFA integration is working since once I entered the wrong code as the OTP then it shows the error message.

Once entered the correct OTP that I received into my mobile only I get this error message. Could someone please help me to sort out this issue?

I am expecting to get rid of this 400 Bad request error message which is returned by cognito endpoint call. Please find the below code for my cognito integration with the ReactJs project.

```<code>cognitoUser.authenticateUser(authenticationDetails, {
      onSuccess: function(result) {
        console.log("RESULT SUCCESS: ", result);
        const accessToken = result.getAccessToken().getJwtToken();
        console.log("ACCESS TOKEN: ", accessToken);
        cognitoUser.getSession(function(err, session) {
          if (err) {
            console.log(err);
            return;
          }
          // console.log('session validity: ' + session.isValid());
          const totpMfaSettings = {
            PreferredMfa: true,
            Enabled: true
          };
          cognitoUser.setUserMfaPreference(null, totpMfaSettings, function(
            err,
            result
          ) {
            if (err) {
              console.log(err);
            }
            console.log("call result " + result);
          });
        });
      },

      onFailure: function(err) {
        alert(err.message || JSON.stringify(err));
      },

      mfaSetup: function(challengeName, challengeParameters) {
        console.log("MFA SETUP");
        cognitoUser.associateSoftwareToken(this);
      },

      associateSecretCode: function(secretCode) {
        const challengeAnswer = prompt("Please input the TOTP code.", "");
        cognitoUser.verifySoftwareToken(
          challengeAnswer,
          "My TOTP device",
          this
        );
      },

      selectMFAType: function(challengeName, challengeParameters) {
        var mfaType = prompt("Please select the MFA method.", ""); // valid values for mfaType is "SMS_MFA", "SOFTWARE_TOKEN_MFA"
        cognitoUser.sendMFASelectionAnswer(mfaType, this);
      },

      totpRequired: function(secretCode) {
        var challengeAnswer = prompt("Please input the TOTP code.", "");
        cognitoUser.sendMFACode(challengeAnswer, this, "SOFTWARE_TOKEN_MFA");
      },

      mfaRequired: function(codeDeliveryDetails) {
        var verificationCode = prompt("Please input verification code", "");
        cognitoUser.sendMFACode(verificationCode, this);
      },
      newPasswordRequired: userAttributes => {
        // XXXXXXXX
        // This is somethign we need to fetch from an input
        cognitoUser.completeNewPasswordChallenge("XXXXXXXX", {}, {
          onSuccess: result => {
            // login
            console.log(result)
          }
        });
        // };
      }
    });
</code>```

Body:
Please refer to the following image.

I was able to successfully integrate the MFA with my Cognito pool and I am getting the OTP as well. Once the OTP is submitted I get the following error message as a 400 bad request. It seems MFA integration is working since once I entered the wrong code as the OTP then it shows the error message.

Once entered the correct OTP that I received into my mobile only I get this error message. Could someone please help me to sort out this issue?

I am expecting to get rid of this 400 Bad request error message which is returned by cognito endpoint call. Please find the below code for my cognito integration with the ReactJs project.

cognitoUser.authenticateUser(authenticationDetails, {
      onSuccess: function(result) {
        console.log("RESULT SUCCESS: ", result);
        const accessToken = result.getAccessToken().getJwtToken();
        console.log("ACCESS TOKEN: ", accessToken);
        cognitoUser.getSession(function(err, session) {
          if (err) {
            console.log(err);
            return;
          }
          // console.log('session validity: ' + session.isValid());
          const totpMfaSettings = {
            PreferredMfa: true,
            Enabled: true
          };
          cognitoUser.setUserMfaPreference(null, totpMfaSettings, function(
            err,
            result
          ) {
            if (err) {
              console.log(err);
            }
            console.log("call result " + result);
          });
        });
      },

      onFailure: function(err) {
        alert(err.message || JSON.stringify(err));
      },

      mfaSetup: function(challengeName, challengeParameters) {
        console.log("MFA SETUP");
        cognitoUser.associateSoftwareToken(this);
      },

      associateSecretCode: function(secretCode) {
        const challengeAnswer = prompt("Please input the TOTP code.", "");
        cognitoUser.verifySoftwareToken(
          challengeAnswer,
          "My TOTP device",
          this
        );
      },

      selectMFAType: function(challengeName, challengeParameters) {
        var mfaType = prompt("Please select the MFA method.", ""); // valid values for mfaType is "SMS_MFA", "SOFTWARE_TOKEN_MFA"
        cognitoUser.sendMFASelectionAnswer(mfaType, this);
      },

      totpRequired: function(secretCode) {
        var challengeAnswer = prompt("Please input the TOTP code.", "");
        cognitoUser.sendMFACode(challengeAnswer, this, "SOFTWARE_TOKEN_MFA");
      },

      mfaRequired: function(codeDeliveryDetails) {
        var verificationCode = prompt("Please input verification code", "");
        cognitoUser.sendMFACode(verificationCode, this);
      },
      newPasswordRequired: userAttributes => {
        // XXXXXXXX
        // This is somethign we need to fetch from an input
        cognitoUser.completeNewPasswordChallenge("XXXXXXXX", {}, {
          onSuccess: result => {
            // login
            console.log(result)
          }
        });
        // };
      }
    });


来源: stackexchange

问:
is it possible to use Web Speech API for speech recognition of local languages?
I want to make a speech recognition web application for my community. I've been googling for 2-3 days, came up with many result like pocketsphinx.

I looked into various speech recognition, most of them just use english or other popular language, but still no luck.

ContentLicense: CC BY-SA 4.0


问:
How can I allow POST requests to an AWS S3 bucket?

Problem

I'm trying to upload files to an S3 bucket using presigned post requests (roughly following this blog post). My server (node) generates a presigned post request using createPresignedPost, and then returns it to the client (React), which uses it to upload a user-generated file to our S3 bucket.

Currently, any POST requests from the client to the bucket all fail with 405 Method Not Allowed. I checked the response headers, and saw that the Allow header does not list POST, although the Access-Control-Allow-Methods does.

Is there something else I need to do in order to allow POST requests to the bucket?

(note - the reason I'm trying to used presigned POST requests as opposed to the regular presigned urls (which use PUT), is because I need to specify restrictions on file type and size, which the latter doesn't seem to support)

Context / other info

The S3 bucket has no policy. It does have a CORS policy, which is

```<code>[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "POST",
            "PUT",
            "HEAD",
            "DELETE"
        ],
        "AllowedOrigins": [
            "http://localhost:3000",
            "http://localhost:8000",
            ...
        ],
        "ExposeHeaders": [
            "ETag",
            "x-amz-meta-custom-header"
        ]
    }
]
</code>```

The server-side code for generating the presigned POST request:

const signS3PostRequest = async ({ fileName, fileType, prefix, bucket }) => {
  const params = {
    Bucket: bucket,
    Fields: {
      $key,
    },
    Expires: 60,
    ContentType: fileType,
    ACL: 'private',
    Conditions: [['content-length-range', 0, 10000000]],
  }

  const s3 = new aws.S3({
    apiVersion: 'latest',
    region: $region,
    accessKeyId: process.env.AWS_ACCESSKEYID,
    secretAccessKey: process.env.AWS_SECRETACCESSKEY,
  })

  return new Promise((resolve, reject) => {
    s3.createPresignedPost(params, (err, data) => {
      if (err) {
        ...
      } else {
        resolve(data)
      }
    })
  })
}
```
<p>And the client-side code for uploading a file using this presigned request:</p>
<pre class="lang-js prettyprint-override"><code>export const uploadFileToS3UsingSignedPostRequest = (
  file,
  signedRequestData
) => {
  let form = new FormData()
  Object.keys(signedRequestData.fields).forEach((k) =>
    form.append(k, signedRequestData.fields[k])
  )
  form.append('file', file)
  return fetch(signedRequestData.url, { method: 'POST', body: form })
}
</code>```

Edit: The response I get back from s3.createPresignedPost looks like this:

```<code>{
    "url": "https://s3.amazonaws.com/$BUCKET_NAME",
    "fields": {
        "key": "test/6zb3rewm8cjydpslti3g/test.jpeg",
        "bucket": "$BUCKET_NAME",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Credential": "$CREDENTIAL",
        "X-Amz-Date": "20221230T090441Z",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMi0xMi0zMFQwOTowNTo0MVoiLCJjb25kaXRpb25zIjp...",
        "X-Amz-Signature": "$SIGNATURE"
    }
}
</code>```

and the response from S3 when trying to use the signed post request to upload the file looks like this:

```<code><?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>MethodNotAllowed</Code>
    <Message>The specified method is not allowed against this resource.</Message>
    <Method>POST</Method>
    <ResourceType>OBJECT</ResourceType>
    <RequestId>HTYWNACA6A1J6BBS</RequestId>
 <HostId>BSV4mFijEfgZEiMu6nVxqP9aocuhAwN7et/UfrO4r1PmkeFZ8nVUsNmcLVZoWCe06zrEFJXDfsE=</HostId>
</Error>
</code>```

Body:
Problem

I'm trying to upload files to an S3 bucket using presigned post requests (roughly following this blog post). My server (node) generates a presigned post request using createPresignedPost, and then returns it to the client (React), which uses it to upload a user-generated file to our S3 bucket.

Currently, any POST requests from the client to the bucket all fail with 405 Method Not Allowed. I checked the response headers, and saw that the Allow header does not list POST, although the Access-Control-Allow-Methods does.

Is there something else I need to do in order to allow POST requests to the bucket?

(note - the reason I'm trying to used presigned POST requests as opposed to the regular presigned urls (which use PUT), is because I need to specify restrictions on file type and size, which the latter doesn't seem to support)

Context / other info

The S3 bucket has no policy. It does have a CORS policy, which is

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "POST",
            "PUT",
            "HEAD",
            "DELETE"
        ],
        "AllowedOrigins": [
            "http://localhost:3000",
            "http://localhost:8000",
            ...
        ],
        "ExposeHeaders": [
            "ETag",
            "x-amz-meta-custom-header"
        ]
    }
]

The server-side code for generating the presigned POST request:

const signS3PostRequest = async ({ fileName, fileType, prefix, bucket }) => {
  const params = {
    Bucket: bucket,
    Fields: {
      $key,
    },
    Expires: 60,
    ContentType: fileType,
    ACL: 'private',
    Conditions: [['content-length-range', 0, 10000000]],
  }

  const s3 = new aws.S3({
    apiVersion: 'latest',
    region: $region,
    accessKeyId: process.env.AWS_ACCESSKEYID,
    secretAccessKey: process.env.AWS_SECRETACCESSKEY,
  })

  return new Promise((resolve, reject) => {
    s3.createPresignedPost(params, (err, data) => {
      if (err) {
        ...
      } else {
        resolve(data)
      }
    })
  })
}

And the client-side code for uploading a file using this presigned request:

export const uploadFileToS3UsingSignedPostRequest = (
  file,
  signedRequestData
) => {
  let form = new FormData()
  Object.keys(signedRequestData.fields).forEach((k) =>
    form.append(k, signedRequestData.fields[k])
  )
  form.append('file', file)
  return fetch(signedRequestData.url, { method: 'POST', body: form })
}

Edit: The response I get back from s3.createPresignedPost looks like this:

{
    "url": "https://s3.amazonaws.com/$BUCKET_NAME",
    "fields": {
        "key": "test/6zb3rewm8cjydpslti3g/test.jpeg",
        "bucket": "$BUCKET_NAME",
        "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
        "X-Amz-Credential": "$CREDENTIAL",
        "X-Amz-Date": "20221230T090441Z",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMi0xMi0zMFQwOTowNTo0MVoiLCJjb25kaXRpb25zIjp...",
        "X-Amz-Signature": "$SIGNATURE"
    }
}

and the response from S3 when trying to use the signed post request to upload the file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
    MethodNotAllowed
    <Message>The specified method is not allowed against this resource.</Message>
    <Method>POST</Method>
    <ResourceType>OBJECT</ResourceType>
    <RequestId>HTYWNACA6A1J6BBS</RequestId>
 <HostId>BSV4mFijEfgZEiMu6nVxqP9aocuhAwN7et/UfrO4r1PmkeFZ8nVUsNmcLVZoWCe06zrEFJXDfsE=</HostId>
</Error>


问:
Printing the same report multiple times
I am having a request and I dont know if its doable, I need to print a report multiple times based on a field. For example I have a bin number 001 inside this bin I have 7 units of the same equipment part. Is there a way to make Cognos print the same report 7 times? Of course we considered when printing on the printer chose to print 7 times but this wont work as we have thousands of bins and we need to make this happens automatically.

THank you in advance

We have tried using repeater table but we couldnt make it work

Title: Printing the same report multiple times


问:
How to interpret the effect of stride size on Intel's hardware prefetching?
In Section 9.5.3 of Intel® 64 and IA-32 Architectures Optimization Reference Manual, the effects of hardware prefetching are described as follows:

The effective latency reduction for several microarchitecture implementations is shown in Figure 9-2. For a constant-stride access pattern, the benefit of the automatic hardware prefetcher begins at half the trigger threshold distance and reaches maximum benefit when the cache-miss stride is 64 bytes.

Family 6 model 13 and 14 are Pentium M (Dothan and Yonah respectively), from 2004 and 2006. (https://en.wikichip.org/wiki/intel/cpuid)

Family 15 is Netburst (pentium 4), model 0,1,2 early generations, Williamette and Northwood.

Fam 16 model 3,4 is Prescott, and model 6 is a successor to that.

Pentium 4 used 128-byte lines in its L2 cache (or pairs of 64-byte lines kept together), vs. 64-byte lines in its L1d cache.

Pentium M used 64-byte cache lines at all levels, up from 32-byte in Pentium III.

I have two questions:

How to explain the "Effective Latency Reduction" in the figure? Literally, it should be (Latency without prefetch - Latency with prefetch) / Latency without prefetch. However, it seems that the lower the indicator is, the better, contrary to the above understanding.

How long is the trigger threshold distance? As defined in Section 9.5.2, "It will attempt to prefetch two cache lines ahead of the prefetch stream", which is 64B*2 = 128B for LLC. However, the significant inflection point in the figure occurs around 132B. If it is "half the trigger threshold distance", the latter should be 132B*2 = 264B.

I read the context, but did not get the explanation of these two terms.


问:
How to display thumbnail preview of the local video (Existing video from our site) which is embedded through Media library module in the CKEditor
I have enabled Media library module in Drupal9 and configured it in the CKEditor module to embed existing videos from our site.Attached screenshot of media library embeded in ckeditor
In the Drupal CKEditor module, If I embed the local video file (existing video from our site) through the media library It is displaying in button format.Displayed in button format
But I want to display thumbnail preview of the selected video like YouTube videos (I have shared a test screenshot below) example of Preview I want to display

How to display thumbnail preview of the local video file (Existing video from our site) which is embedded through Media library module in the CKEditor.

Drupal version- 9.4.8 and PHP version- 8.1.6
Embedded Media library module with ckeditor : https://www.drupal.org/docs/core-modules-and-themes/core-modules/media-library-module/embedding-media-with-ckeditor

Thanks in advance...

I have tried Video embed field Drupal contributed module but it only supports to the YouTube and Vimeo URLs


问:
Terraform plan not working for a long time with AWS S3
I am using terraform to deploy the backend code to AWS. While configuring the terraform environments, I typed the terraform init. It works fine, however, the next command - terraform plan is not working for a long time. The command doesn't tell anything. I am waiting for a long time but can't see any message from cli. I would love to get helped from you developers.

Here is my main.tf code.

```<code>provider "aws" {
  alias  = "us_east_1"
  region = "us-east-1"

  default_tags {
    tags = {
      Owner   = "Example Owner"
      Project = "Example"
    }
  }
}

module "template_files" {
  source = "hashicorp/dir/template"

  base_dir = "react-app/build"

  template_vars = {
    vpc_id = "vpc-abc123123123"
  }
}

resource "aws_s3_bucket" "test_tf_bucket" {
  bucket = local.test_tf_creds.bucket

  website {
    index_document = "index.html"
  }

  tags = {
    Bucket = "Example Terraform Bucket"
  }
}

resource "aws_s3_bucket_object" "build_test_tf" {
  for_each = module.template_files.files

  bucket = local.test_tf_creds.bucket
  key    = each.key
  content_type = each.value.content_type
  source = each.value.source_path
  content = each.value.content
  etag   = each.value.digests.md5

  tags = {
    Bucket-Object = "Example Bucket Object"
  }
}
</code>```

I would love you developers to help me solve this problem.

Body:
I am using terraform to deploy the backend code to AWS. While configuring the terraform environments, I typed the terraform init. It works fine, however, the next command - terraform plan is not working for a long time. The command doesn't tell anything. I am waiting for a long time but can't see any message from cli. I would love to get helped from you developers.

Here is my main.tf code.

provider "aws" {
  alias  = "us_east_1"
  region = "us-east-1"

  default_tags {
    tags = {
      Owner   = "Example Owner"
      Project = "Example"
    }
  }
}

module "template_files" {
  source = "hashicorp/dir/template"

  base_dir = "react-app/build"

  template_vars = {
    vpc_id = "vpc-abc123123123"
  }
}

resource "aws_s3_bucket" "test_tf_bucket" {
  bucket = local.test_tf_creds.bucket

  website {
    index_document = "index.html"
  }

  tags = {
    Bucket = "Example Terraform Bucket"
  }
}

resource "aws_s3_bucket_object" "build_test_tf" {
  for_each = module.template_files.files

  bucket = local.test_tf_creds.bucket
  key    = each.key
  content_type = each.value.content_type
  source = each.value.source_path
  content = each.value.content
  etag   = each.value.digests.md5

  tags = {
    Bucket-Object = "Example Bucket Object"
  }
}

I would love you developers to help me solve this problem.


问:
I don't know whats wrong with this Android Studio project. Task: complete app that calculates quadratic equation
Task:

Download projects from the link. Open the HomeWork.2.4.1 project in android studio and modify MainActivity.java so that your application solves a quadratic equation like axx+b*x+c=0.

Input data: three fields for entering real numbers - coefficients a, b, c

Answer: one real root, or two real roots separated by a space, or the word any (for any roots), or the word none (if there are no roots) should be displayed.

Example: input -2, 2, 0 output 1.0, 0.0

After you have finished the application, right click on the APP and select Run 'All Test'

enter image description here

After checking, a message similar to the following will be displayed:

YOUR RESULT: -1.618034, -3

I don't know what is wrong. I writed OnClick{SolveEquation} but after click on button app fall down. What is wrong? Equation don't solve.

My code:

```<code>package ru.samsung.itschool.book;

import static java.lang.Math.sqrt;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void OnClick(){ // when click on the button
        solveEquation();
    }

    @SuppressLint("SetTextI18n")
    public void solveEquation() { // solver
        double a = Double.parseDouble( ((EditText)
                findViewById(R.id.a)).getText().toString());
        double b = Double.parseDouble( ((EditText)
                findViewById(R.id.b)).getText().toString());
        double c = Double.parseDouble( ((EditText)
                findViewById(R.id.c)).getText().toString());
        TextView result = (TextView) findViewById(R.id.res);

        double d = b * b - 4 * a * c;
        double root1 = 0;
        double root2 = 0;
        if (d >= 0) {
            root1 = ((-b + sqrt(d)) / (2 * a));
            root2 = ((-b - sqrt(d)) / (2 * a));
        }
        result.setText("" + String.valueOf(root1) + String.valueOf(root2));
    }
}
</code>```

Body:
Task:

Download projects from the link. Open the HomeWork.2.4.1 project in android studio and modify MainActivity.java so that your application solves a quadratic equation like axx+b*x+c=0.

Input data: three fields for entering real numbers - coefficients a, b, c

Answer: one real root, or two real roots separated by a space, or the word any (for any roots), or the word none (if there are no roots) should be displayed.

Example: input -2, 2, 0 output 1.0, 0.0

After you have finished the application, right click on the APP and select Run 'All Test'

enter image description here

After checking, a message similar to the following will be displayed:

YOUR RESULT: -1.618034, -3

I don't know what is wrong. I writed OnClick{SolveEquation} but after click on button app fall down. What is wrong? Equation don't solve.

My code:

package ru.samsung.itschool.book;

import static java.lang.Math.sqrt;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void OnClick(){ // when click on the button
        solveEquation();
    }

    @SuppressLint("SetTextI18n")
    public void solveEquation() { // solver
        double a = Double.parseDouble( ((EditText)
                findViewById(R.id.a)).getText().toString());
        double b = Double.parseDouble( ((EditText)
                findViewById(R.id.b)).getText().toString());
        double c = Double.parseDouble( ((EditText)
                findViewById(R.id.c)).getText().toString());
        TextView result = (TextView) findViewById(R.id.res);

        double d = b * b - 4 * a * c;
        double root1 = 0;
        double root2 = 0;
        if (d >= 0) {
            root1 = ((-b + sqrt(d)) / (2 * a));
            root2 = ((-b - sqrt(d)) / (2 * a));
        }
        result.setText("" + String.valueOf(root1) + String.valueOf(root2));
    }
}


问:
How to fetch documents from a collection without certain fields from Firestore?
I have a collection let's say "files" and a "file" document has 2 main properties (field) : name and content.

(note: I know storing files in a Firestore is not a good idea but that's just an example, let's assume the files are just text files)

When my app opens I want to be able to fetch all user's file names but not the content :

```<code>files = [{name: 'a'}, {name: 'b'}, {name: 'c'}, ...]
</code>```

The reason is obvious I don't want to pull files' content unless the user explicitly ask for from the UI, minimizing the size of data being pulled from Google Cloud and reducing the cost over time.

But collection(db, 'users', user.uid, 'files') seems to return all docs data. Even worst! if one "file" document change, all the docs and their content are being pulled again from the UI onSnapshot listener...

Reading the TypeScript doc I don't see an option to do atomic selection on docs' fields. Am I missing something?

Body:
I have a collection let's say "files" and a "file" document has 2 main properties (field) : name and content.

(note: I know storing files in a Firestore is not a good idea but that's just an example, let's assume the files are just text files)

When my app opens I want to be able to fetch all user's file names but not the content :

files = [{name: 'a'}, {name: 'b'}, {name: 'c'}, ...]

The reason is obvious I don't want to pull files' content unless the user explicitly ask for from the UI, minimizing the size of data being pulled from Google Cloud and reducing the cost over time.

But collection(db, 'users', user.uid, 'files') seems to return all docs data. Even worst! if one "file" document change, all the docs and their content are being pulled again from the UI onSnapshot listener...

Reading the TypeScript doc I don't see an option to do atomic selection on docs' fields. Am I missing something?


问:
Is a getter method `class ClassName ClassName() { ... }` legal C++?
We have just noticed that our code doesn't compile with gcc, but didn't have any issue with clang. We normally write getters without a get prefix because it often looks nicer, such as Context().Route().Leg(1).Arcs().

It can be made to work in gcc by specifying -fpermissive, but what does that mean for standard-conformance?

```<code>class Contained {};
class Aggregate {
    Contained contained_;
public:
    class Contained Contained() { return contained_; }
    //              ^~~~~~~~~ gcc: error, declaration changes meaning; clang: ok
};
</code>```

https://godbolt.org/z/n96bsoaYc

Body:
We have just noticed that our code doesn't compile with gcc, but didn't have any issue with clang. We normally write getters without a get prefix because it often looks nicer, such as Context().Route().Leg(1).Arcs().

It can be made to work in gcc by specifying -fpermissive, but what does that mean for standard-conformance?

class Contained {};
class Aggregate {
    Contained contained_;
public:
    class Contained Contained() { return contained_; }
    //              ^~~~~~~~~ gcc: error, declaration changes meaning; clang: ok
};

https://godbolt.org/z/n96bsoaYc


问:
Union of tables with common column name but different column type
I am a beginner in flask-sqlalchemy and application development.
I am really stuck at a situation where I need to do union of 3 tables but one of the columns of the of these tables have different column type but same column name. I use postgres DB for testing my python code which uses sqlalchemy.

I try casting the column to string to match the first query column i.e. TableCategorical.value, but my issue is that I need to remove the casting after union to get the original column type for the rest of the code.

How do I do that?

CODE:

```<code>query_1 = select(TableCategorical.name_id, TableCategorical.measurement,
                 TableCategorical.key, TableCategorical.value)
query_2 = select(TableNumerical.name_id, TableNumerical.measurement,
                 TableNumerical.key, cast(TableNumerical.value, String))
query_3 = select(TableDate.name_id, TableDate.measurement,
                 TableDate.key, cast(TableDate.value, String))
query_union = union(query_1, query_2, query_3)
</code>```

I have done my part of searching online to get a solution but I am not able to.

Body:
I am a beginner in flask-sqlalchemy and application development.
I am really stuck at a situation where I need to do union of 3 tables but one of the columns of the of these tables have different column type but same column name. I use postgres DB for testing my python code which uses sqlalchemy.

I try casting the column to string to match the first query column i.e. TableCategorical.value, but my issue is that I need to remove the casting after union to get the original column type for the rest of the code.

How do I do that?

CODE:

query_1 = select(TableCategorical.name_id, TableCategorical.measurement,
                 TableCategorical.key, TableCategorical.value)
query_2 = select(TableNumerical.name_id, TableNumerical.measurement,
                 TableNumerical.key, cast(TableNumerical.value, String))
query_3 = select(TableDate.name_id, TableDate.measurement,
                 TableDate.key, cast(TableDate.value, String))
query_union = union(query_1, query_2, query_3)

I have done my part of searching online to get a solution but I am not able to.


问:
VS Code internals erroneously calling python 2.7
My Visual Studio code (Mac OS) recently lost the ability to run debug sessions. The first symptom was the message, "The isort server crashed 5 times in the last 3 minutes. The server will not be restarted."  But uninstalling or replacing the isort extension makes no difference.

Digging into log files, I find useful information in this one:
/Library/Application Support/Code/logs/20221206T082042/window1/exthost/output_logging_20221206T082045/1-Python.log

Things start off looking good, properly handling my choice of python 3.9 as my interpreter

```<code>Experiment 'pythonPromptNewToolsExt' is active
LSP Notebooks experiment is enabled
LSP Notebooks interactive window support is enabled
> conda info --json
Python interpreter path: /usr/local/bin/python3
> /opt/miniconda3/bin/conda info --json
> /usr/bin/python ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
</code>```

But then it does something crazy:

```<code>> /usr/lib/python2.7 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /usr/local/bin/python3 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /opt/local/bin/python3.9 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
[ERROR 2022-11-6 8:20:47.978]: [Error: Command failed: /usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
/bin/sh: /usr/lib/python2.7: is a directory

    at ChildProcess.exithandler (node:child_process:408:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:526:28)
    at Pipe.<anonymous> (node:net:687:12)] {
  killed: false,
  code: 126,
  signal: null,
  cmd: '/usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py'
</code>```

I can see that it is erroneously calling python 2.7, but I don't know how to see where this is coming from. Just checking:

```<code>% ls -l /usr/local/bin/python3
lrwxr-xr-x  1 root  wheel  69 Sep 13  2021 /usr/local/bin/python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3
</code>```

no problem there. Can anyone suggest how to chase down this thing? Incidentally, this problem survived a deep uninstall (all preferences, support directories, etc.) and reinstall of Visual Studio code, so I'm wondering if something else somehow updated itself in a manner that harmed this functionality.

The rest of the log file, perhaps less relevant, is included below for completeness:

```<code>> /Library/Frameworks/Python.framework/Versions/2.7/bin/python ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /opt/miniconda3/bin/python ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
DAP Server launched with command: /usr/local/bin/python3 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/lib/python/debugpy/adapter
> /usr/lib/python2.7 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
[ERROR 2022-11-6 8:20:49.985]: [Error: Command failed: /usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
/bin/sh: /usr/lib/python2.7: is a directory

    at ChildProcess.exithandler (node:child_process:408:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)] {
  killed: false,
  code: 126,
  signal: null,
  cmd: '/usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py'
}
Starting Pylance language server.
</code>```

Body:
My Visual Studio code (Mac OS) recently lost the ability to run debug sessions. The first symptom was the message, "The isort server crashed 5 times in the last 3 minutes. The server will not be restarted."  But uninstalling or replacing the isort extension makes no difference.

Digging into log files, I find useful information in this one:
/Library/Application Support/Code/logs/20221206T082042/window1/exthost/output_logging_20221206T082045/1-Python.log

Things start off looking good, properly handling my choice of python 3.9 as my interpreter

Experiment 'pythonPromptNewToolsExt' is active
LSP Notebooks experiment is enabled
LSP Notebooks interactive window support is enabled
> conda info --json
Python interpreter path: /usr/local/bin/python3
> /opt/miniconda3/bin/conda info --json
> /usr/bin/python ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /usr/bin/python3 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py

But then it does something crazy:

> /usr/lib/python2.7 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /usr/local/bin/python3 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /opt/local/bin/python3.9 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
[ERROR 2022-11-6 8:20:47.978]: [Error: Command failed: /usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
/bin/sh: /usr/lib/python2.7: is a directory

    at ChildProcess.exithandler (node:child_process:408:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:526:28)
    at Pipe.<anonymous> (node:net:687:12)] {
  killed: false,
  code: 126,
  signal: null,
  cmd: '/usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py'

I can see that it is erroneously calling python 2.7, but I don't know how to see where this is coming from. Just checking:

% ls -l /usr/local/bin/python3
lrwxr-xr-x  1 root  wheel  69 Sep 13  2021 /usr/local/bin/python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3

no problem there. Can anyone suggest how to chase down this thing? Incidentally, this problem survived a deep uninstall (all preferences, support directories, etc.) and reinstall of Visual Studio code, so I'm wondering if something else somehow updated itself in a manner that harmed this functionality.

The rest of the log file, perhaps less relevant, is included below for completeness:

> /Library/Frameworks/Python.framework/Versions/2.7/bin/python ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
> /opt/miniconda3/bin/python ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
DAP Server launched with command: /usr/local/bin/python3 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/lib/python/debugpy/adapter
> /usr/lib/python2.7 ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
[ERROR 2022-11-6 8:20:49.985]: [Error: Command failed: /usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py
/bin/sh: /usr/lib/python2.7: is a directory

    at ChildProcess.exithandler (node:child_process:408:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)] {
  killed: false,
  code: 126,
  signal: null,
  cmd: '/usr/lib/python2.7 /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/get_output_via_markers.py /Users/ken/.vscode/extensions/ms-python.python-2022.19.13251009/pythonFiles/interpreterInfo.py'
}
Starting Pylance language server.


问:
Detect when all firebase actions are ended
I compare my device database with another one on Firebase. I do all in a loop.

```<code>for (int i = 0; i < dataInfo.size(); i++) {
   MESSAGE_REFERENCE.child("MyTable_" + myIndex).addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
            if(dataSnapshot.exists()){
                if (!Objects.equals(dataSnapshot.child("_user_id").getValue(), row.get(1).toString())){
                    dataSnapshot.child("_user_id").getRef().setValue(row.get(1).toString()).addOnCompleteListener(t -> {
                        modifications = modifications + 1;
                }

                if (!Objects.equals(dataSnapshot.child("_location").getValue(), row.get(2).toString())) {
                    dataSnapshot.child("_location").getRef().setValue(row.get(2).toString()).addOnCompleteListener(t -> {
                        modifications = modifications + 1;
                }
            }
        });
    }
}
</code>```

I want to post the total of modifications done but the loop is ending before all checks and modifications are done on firebase and allways return for modification a null value.

How can I wait to post result for modifications till all modifications are finally done?

Body:
I compare my device database with another one on Firebase. I do all in a loop.

for (int i = 0; i < dataInfo.size(); i++) {
   MESSAGE_REFERENCE.child("MyTable_" + myIndex).addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
            if(dataSnapshot.exists()){
                if (!Objects.equals(dataSnapshot.child("_user_id").getValue(), row.get(1).toString())){
                    dataSnapshot.child("_user_id").getRef().setValue(row.get(1).toString()).addOnCompleteListener(t -> {
                        modifications = modifications + 1;
                }

                if (!Objects.equals(dataSnapshot.child("_location").getValue(), row.get(2).toString())) {
                    dataSnapshot.child("_location").getRef().setValue(row.get(2).toString()).addOnCompleteListener(t -> {
                        modifications = modifications + 1;
                }
            }
        });
    }
}

I want to post the total of modifications done but the loop is ending before all checks and modifications are done on firebase and allways return for modification a null value.

How can I wait to post result for modifications till all modifications are finally done?


问:
My scrollview does not scroll (tried all the answers from stackoverflow)
I wanted all the elements to scroll, i did not give any values so that it may work on other devices too which are not of the similar size of mine, i tried nearly all the answers and suggestions given over here and failed to see it scroll, i came here as this is my last resort.

```<code><?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".arabicnamazfour">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:fillViewport="true"

        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"
            android:orientation="vertical"
            android:weightSum="25">

            <TextView
                android:id="@+id/textView2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="15"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="رکوع کی دعا"
                android:textStyle="bold|italic" />

            <View
                android:id="@+id/divider2"
                android:layout_width="match_parent"
                android:layout_height="6dp"
                android:background="?android:attr/listDivider"
                android:backgroundTint="#32728F"
                android:backgroundTintMode="src_over" />

            <TextView
                android:id="@+id/textView19"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:autoSizeTextType="uniform"
                android:text="سُبْحَانَ رَبِّيَ الْعَظِیْمِ ۔   (مسلم)        کم از کم تین مرتبہ" />

            <TextView
                android:id="@+id/textView21"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="10"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="یا دعا پڑھے۔ "
                android:textStyle="bold" />

            <TextView
                android:id="@+id/textView23"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="8"
                android:autoSizeTextType="uniform"
                android:text="سُبْحَانَکَ اَللّٰہُمَّ رَبَّنَا وَبِحَمْدِکَ اَللّٰہُمَّ اغْفِرْلِیْ ۔              (بخاری و مسلم)" />

            <TextView
                android:id="@+id/textView25"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="رکوع کے بعد کی دعا"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/textView27"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:autoSizeTextType="uniform"
                android:text="رَبَّنَاوَ لَکَ الْحَمْدُ ۔" />

            <TextView
                android:id="@+id/textView28"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="یا یہ کہے۔"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/textView29"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:autoSizeTextType="uniform"
                android:text="رَبَّنَا وَ لَکَ الْحَمْدُ‘ حَمْدًاکَثِیْرًا طَیِّبًا مُّبَارَکًا فِیْہ ۔    (بخاری)" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:weightSum="2">

                <ImageView
                    android:id="@+id/imageView7"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/fourth" />

                <ImageView
                    android:id="@+id/imageView8"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/fifth" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:weightSum="2">

                <ImageView
                    android:id="@+id/imageView9"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/sixth" />

                <ImageView
                    android:id="@+id/imageView10"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/seventh" />
            </LinearLayout>

            <TextView
                android:id="@+id/textView13"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autoSizeTextType="uniform"
                android:backgroundTint="#32728F"
                android:gravity="center_horizontal"
                android:text="4"

                android:textStyle="bold" />

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

                <ImageView
                    android:id="@+id/imageView17"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/ic_baseline_navigate_before_24" />

                <ImageView
                    android:id="@+id/imageView18"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/ic_baseline_navigate_next_24" />
            </LinearLayout>

        </LinearLayout>
    </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</code>```

I tried all the answers and everything that i could think of, but it simply wouldnt scroll

Body:
I wanted all the elements to scroll, i did not give any values so that it may work on other devices too which are not of the similar size of mine, i tried nearly all the answers and suggestions given over here and failed to see it scroll, i came here as this is my last resort.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".arabicnamazfour">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:fillViewport="true"

        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"
            android:orientation="vertical"
            android:weightSum="25">

            <TextView
                android:id="@+id/textView2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="15"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="رکوع کی دعا"
                android:textStyle="bold|italic" />

            <View
                android:id="@+id/divider2"
                android:layout_width="match_parent"
                android:layout_height="6dp"
                android:background="?android:attr/listDivider"
                android:backgroundTint="#32728F"
                android:backgroundTintMode="src_over" />

            <TextView
                android:id="@+id/textView19"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:autoSizeTextType="uniform"
                android:text="سُبْحَانَ رَبِّيَ الْعَظِیْمِ ۔   (مسلم)        کم از کم تین مرتبہ" />

            <TextView
                android:id="@+id/textView21"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="10"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="یا دعا پڑھے۔ "
                android:textStyle="bold" />

            <TextView
                android:id="@+id/textView23"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="8"
                android:autoSizeTextType="uniform"
                android:text="سُبْحَانَکَ اَللّٰہُمَّ رَبَّنَا وَبِحَمْدِکَ اَللّٰہُمَّ اغْفِرْلِیْ ۔              (بخاری و مسلم)" />

            <TextView
                android:id="@+id/textView25"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="رکوع کے بعد کی دعا"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/textView27"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:autoSizeTextType="uniform"
                android:text="رَبَّنَاوَ لَکَ الْحَمْدُ ۔" />

            <TextView
                android:id="@+id/textView28"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:autoSizeTextType="uniform"
                android:gravity="center_horizontal"
                android:text="یا یہ کہے۔"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/textView29"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:autoSizeTextType="uniform"
                android:text="رَبَّنَا وَ لَکَ الْحَمْدُ‘ حَمْدًاکَثِیْرًا طَیِّبًا مُّبَارَکًا فِیْہ ۔    (بخاری)" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:weightSum="2">

                <ImageView
                    android:id="@+id/imageView7"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/fourth" />

                <ImageView
                    android:id="@+id/imageView8"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/fifth" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:weightSum="2">

                <ImageView
                    android:id="@+id/imageView9"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/sixth" />

                <ImageView
                    android:id="@+id/imageView10"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/seventh" />
            </LinearLayout>

            <TextView
                android:id="@+id/textView13"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autoSizeTextType="uniform"
                android:backgroundTint="#32728F"
                android:gravity="center_horizontal"
                android:text="4"

                android:textStyle="bold" />

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

                <ImageView
                    android:id="@+id/imageView17"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/ic_baseline_navigate_before_24" />

                <ImageView
                    android:id="@+id/imageView18"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    app:srcCompat="@drawable/ic_baseline_navigate_next_24" />
            </LinearLayout>

        </LinearLayout>
    </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

I tried all the answers and everything that i could think of, but it simply wouldnt scroll


问:
I'm trying to plot a bar graph with error bars but error bars are weird
I'm trying to plot and add error bars, and somehow today it decided to plot like this. I'm clearly missing something, what is wrong with these error bars?!

```<code>hits <- ggplot(coverage_data, aes(Phenotype, Hits, fill=Phenotype)) +
  geom_bar(stat="identity",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=Hits,
                    ymax=Hits+STD),
                width=0.2)+
  theme_classic()
hits
</code>```

Cheers!

Body:
I'm trying to plot and add error bars, and somehow today it decided to plot like this. I'm clearly missing something, what is wrong with these error bars?!

hits <- ggplot(coverage_data, aes(Phenotype, Hits, fill=Phenotype)) +
  geom_bar(stat="identity",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=Hits,
                    ymax=Hits+STD),
                width=0.2)+
  theme_classic()
hits

Cheers!


问:
550 5.6.11 Your message contains invalid characters (bare line feed characters)
We have an ASP.net site that sends emails using SmtpClient.  It has worked fine until recently when some of recipient SMTP servers started rejecting our messages with:

Status code: 550 5.6.11: Your message contains invalid characters (bare line feed characters) which the email servers at <example.com> don't support.

And

This error occurs when the email program or device used to create or send an email message adds bare line feed characters into the message. When bare line feed characters are included in a message, the SMTP protocol chunking feature is required to transmit the message between email servers. Chunking uses the SMTP protocol BDAT command, but the recipient's email server doesn't support the BDAT command.

Questions:

Will using a newer version of the .NET Framework (currently 4.0) resolve this issue?  If not, is there a different .NET SMTP client that will resolve this issue?

Reference:
Fix email delivery issues for error code 550 5.6.11 in Exchange Online

Thanks in advance!


问:
Why I get TypeError: store.getState is not a function
could you help me where I wrong?</p>
```<code>import { applyMiddleware, compose, configureStore } from '@reduxjs/toolkit';
import createSagaMiddleware from 'redux-saga';
import rootReducer from './rootReducer';
import rootSaga from './rootSaga';

const sagaMiddleware = createSagaMiddleware();
const enhancers = compose(applyMiddleware(sagaMiddleware));

export default (preloadedState) => {
    const store = configureStore({
        reducer: rootReducer,
        middleware: (getDefaultMiddleware) => getDefaultMiddleware({ thunk: false }).concat(sagaMiddleware),
        enhancers,
        preloadedState,
    });

    sagaMiddleware.run(rootSaga);
    console.log(store);

    return store;
}
</code>```
```<code>import ReactDOM from "react-dom/client";
import { App } from "./components/App";
import { Provider } from "react-redux";
import store from "./store";

ReactDOM.createRoot(document.getElementById('root')).render(
    <Provider store={store}>
            <App />
    </Provider>
)

</code>```

Body:
could you help me where I wrong?

import { applyMiddleware, compose, configureStore } from '@reduxjs/toolkit';
import createSagaMiddleware from 'redux-saga';
import rootReducer from './rootReducer';
import rootSaga from './rootSaga';

const sagaMiddleware = createSagaMiddleware();
const enhancers = compose(applyMiddleware(sagaMiddleware));

export default (preloadedState) => {
    const store = configureStore({
        reducer: rootReducer,
        middleware: (getDefaultMiddleware) => getDefaultMiddleware({ thunk: false }).concat(sagaMiddleware),
        enhancers,
        preloadedState,
    });

    sagaMiddleware.run(rootSaga);
    console.log(store);

    return store;
}

import ReactDOM from "react-dom/client";
import { App } from "./components/App";
import { Provider } from "react-redux";
import store from "./store";

ReactDOM.createRoot(document.getElementById('root')).render(
    <Provider store={store}>
            <App />
    </Provider>
)


问:
xen linux + baremetal cortex A53
I am trying to run Linux (buildroot) + baremetal app on Xen.

Xen boots great and buildroot is ok on the first CPU.
My problem is the baremetal application.

The baremetal app is generated by Vitis (my A53 is in the FPGA).
This is the simplest example application : just an hello world and exit.
I am able to boot directly on this app using the jtag but when I try to run the baremetal app in Xen the app just hand and doesn't print anything.

My configurations :

FILE : xen.cfg

```<code>name = "test"
kernel = "/opt/baremetal_app.bin"
memory = 8
vcpus = 1
cpus = [1]
iomem = [ "0xff010,1" ] # UART1
</code>```

Xen command line :

```<code>console=dtuart dtuart=serial0 dom0_mem=1G bootscrub=0 maxcpus=1 timer_slop=0
</code>```

dom0 command line :

```<code>console=hvc0 earlycon=xen earlyprintk=xen maxcpus=1 clk_ignore_unused root=/dev/mmcblk0p2
</code>```

Vitis is configured to include the hypervisor_guest the in binary.
I already tried to change the psu_ddr_0_MEM_0 to 0x40000000, len 100000.

When I run the command "xl create xen.cfg", the system print "Parsing config from xen.cfg" and returns. I see my app test in "xl list".
The uart1 doesn't print anything and the "xl console test" neither.

With "xl top" my app test seems to use 100% of  the cpu.

Any idea ?

Title: xen linux + baremetal cortex A53

Body:
I am trying to run Linux (buildroot) + baremetal app on Xen.

Xen boots great and buildroot is ok on the first CPU.
My problem is the baremetal application.

The baremetal app is generated by Vitis (my A53 is in the FPGA).
This is the simplest example application : just an hello world and exit.
I am able to boot directly on this app using the jtag but when I try to run the baremetal app in Xen the app just hand and doesn't print anything.

My configurations :

FILE : xen.cfg

name = "test"
kernel = "/opt/baremetal_app.bin"
memory = 8
vcpus = 1
cpus = [1]
iomem = [ "0xff010,1" ] # UART1

Xen command line :

console=dtuart dtuart=serial0 dom0_mem=1G bootscrub=0 maxcpus=1 timer_slop=0

dom0 command line :

console=hvc0 earlycon=xen earlyprintk=xen maxcpus=1 clk_ignore_unused root=/dev/mmcblk0p2

Vitis is configured to include the hypervisor_guest the in binary.
I already tried to change the psu_ddr_0_MEM_0 to 0x40000000, len 100000.

When I run the command "xl create xen.cfg", the system print "Parsing config from xen.cfg" and returns. I see my app test in "xl list".
The uart1 doesn't print anything and the "xl console test" neither.

With "xl top" my app test seems to use 100% of  the cpu.

Any idea ?


问:
Integrated AsserJ to Eclipse / Linux
i'm a beginner (in english too)
I begin to develop with Eclipse.
I wan't add AsserJ to Eclipse, because these 2 lines are in error :
import static org.assertj.core.api.Assertions.*;
assertThat(twoThirdsTimesTwoThirds.numerator)
Bold is red underline
Can you help me please ?
Regards

I have already install junit 5
Thank you

Title: Integrated AsserJ to Eclipse / Linux


问:
how to get some of the cookies from the response header's Set-Cookie
need to get some cookie out from the Set-Cookie and pass the cookie in next request header's cookie. The sample Set-Cookie is like:

```<code>Set-Cookie:
AWSALB=8KRpAv...hpOJQm; Expires=Thu, 29 Dec 2022 13:45:03 GMT; Path=/
AWSALBCORS=8KRpAv...pOJQm; Expires=Thu, 29 Dec 2022 13:45:03 GMT; Path=/; SameSite=None; Secure
OTHER_BROWSER=1qpa...5a4jn; Domain=google.com; Path=/; Secure; SameSite=None
</code>```

When trying to get the Set-Cookie

```<code>HttpURLConnection connection = url..openConnection();
... ...

String response_header_setCookie = connection.getHeaderField("Set-Cookie");

// the response_header_setCookie has only OTHER_BROWSER=1qpa...5a4jn; Domain=google.com; Path=/; Secure; SameSite=None
</code>```

It returns "the latest" added one only.
Question:

How to selectively extract some of the cookies from "Set-Cookie" (i.e. by the cookie name AWSALB)?

How get the cookie part only (cut off the Domain/path etc.)? Is it safe to use the first ";"? theSingleCookieValue.substring( 0, theSingleCookieValue.indexOf(";")+1);

Body:
need to get some cookie out from the Set-Cookie and pass the cookie in next request header's cookie. The sample Set-Cookie is like:

Set-Cookie:
AWSALB=8KRpAv...hpOJQm; Expires=Thu, 29 Dec 2022 13:45:03 GMT; Path=/
AWSALBCORS=8KRpAv...pOJQm; Expires=Thu, 29 Dec 2022 13:45:03 GMT; Path=/; SameSite=None; Secure
OTHER_BROWSER=1qpa...5a4jn; Domain=google.com; Path=/; Secure; SameSite=None

When trying to get the Set-Cookie

HttpURLConnection connection = url..openConnection();
... ...

String response_header_setCookie = connection.getHeaderField("Set-Cookie");

// the response_header_setCookie has only OTHER_BROWSER=1qpa...5a4jn; Domain=google.com; Path=/; Secure; SameSite=None

It returns "the latest" added one only.
Question:

How to selectively extract some of the cookies from "Set-Cookie" (i.e. by the cookie name AWSALB)?

How get the cookie part only (cut off the Domain/path etc.)? Is it safe to use the first ";"? theSingleCookieValue.substring( 0, theSingleCookieValue.indexOf(";")+1);


问:
TCPDF - SVG - How to align encapsulated tspans in a container tspan
I'm using TCPDF 6.3 and when printing I can't get the same result as on screen for my SVG. On the screen, the nested tspans are organized natively in inline-block, so they remain well aligned and placed one after the other regardless of the value of the text-anchor (start, middle, end). The problem is that when printing the PDF, if text-anchor is set to "middle" the nested tspans overlap each other because they inherit the x attribute from the containing tspan. How do I make them stay aligned in the PDF? Here is the code:

```<code><? xml version = "1.0" encoding = "utf-8" ?>< !DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"[

< !ENTITY classLigne1H "fill:#c3373f;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne2H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne3H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne4H "fill:#c3378d;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne5H "fill:#37c339;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne6H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne7H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
]>
<svg version="1.1"
  id="Calque_1" xmlns:ev="http://www.w3.org/2001/xml-events"
  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0pt" y="0pt" width="297mm"
  height="210mm" viewBox="0 0 841.89 595.276" style="enable-background:new 0 0 841.89 595.276;" xml:space="preserve">
  <g id="montexte">
    <text id="Sosa1" x="0" y="538.583" width="225.354" height="56.6929" transform="translate(307.922,-43.2756)">
        <tspan x="0.0000" y="548" width="225.354" height="56.6929" data-ligne="nom_5LI" data-type="simple" data-libelle="nom" style="&classLigne1H;">Nom Sosa1</tspan>
        <tspan x="0.0000" y="558" width="225.354" height="56.6929" data-ligne="prenom_5LI" data-type="simple" data-libelle="prenom" style="&classLigne2H;">prenom Sosa1</tspan>
        <tspan x="0.0000" y="568" width="225.354" height="56.6929" data-ligne="metier_5LI" data-type="simple" data-libelle="metier" style="&classLigne3H;">metier Sosa1</tspan>
        <tspan x="53.1833" y="578" width="225.354" height="56.6929" data-ligne="date_n_5LI" data-type="triple_n" style="text-anchor: start;"><tspan data-libelle="intitule_n" style="&classLigne4H;">° </tspan><tspan data-libelle="date_n" style="&classLigne4H;">date_n Sosa1</tspan><tspan data-libelle="lieu_n" style="&classLigne5H;">lieu_n Sosa1</tspan><tspan data-libelle="finx"></tspan></tspan>
        <tspan x="-49.4167" y="588" width="225.354" height="56.6929" data-ligne="date_d_5LI" data-type="triple_d" style="text-anchor: start;"><tspan data-libelle="intitule_d" style="&classLigne6H;">+ </tspan><tspan data-libelle="date_d" style="&classLigne6H;">date_d Sosa1</tspan><tspan data-libelle="lieu_d" style="&classLigne7H;">lieu_d Sosa1</tspan><tspan data-libelle="finx"></tspan></tspan>
    </text>
  </g>
</svg>
</code>```

With Jquery, I tried to get the exact width of the group of nested tspans to force their absolute positioning in the text block (the tspan data-libelle="finx" is just there to get the left of its offset).

```<code>// the var 'name' is obtained by another function each (I don't put all the code here)
$('tspan[data-ligne=' + nom + ']', '#montexte').each(function (index) {
    var type = $(this).data('type');
    var bloctxt = $(this).parent().attr('id'); // bloc text Sosa
    var x = $(this).parent().attr('x'); // bloc text
    var width = $(this).parent().attr('width'); // bloc text
    var anchor = $('#centrageTexte option:selected').val();
    var convert = 0.75; // 1pt = 0.75px

// part of the switch case
switch (type) {
    case 'triple_n':// 3 tspan (intitulé + date + lieu)
            var offset = $(this).parent().position(); //left du bloc text
            var left = parseFloat((offset.left) * convert); // left du bloc text
            var offset0 = $('tspan[data-libelle="intitule_n"]', this).position();
            var left0 = parseFloat((offset0.left) * convert); // left du premier tspan
            var x0 = parseFloat($(this).attr('x')); // x du tspan conteneur
            var offsetx = $('tspan[data-libelle="finx"]', this).position(); // pos du dernier tspan (vide)
            var leftx = parseFloat((offsetx.left) * convert); // x du dernier tspan (vide)
            var marge = parseFloat(left0 - left); // largeur du tspan conteneur
            var larg = parseFloat(left0 - leftx); // largeur du tspan conteneur
            if (anchor == 'middle') x0 = parseFloat((x0 - (width / 2)) + (marge));
            if (anchor == 'end') x0 = parseFloat(x0 - larg);
            var xnew = parseFloat(x0).toFixed(4);
            $('tspan[data-ligne=' + nom + ']', '#clonetexte').attr('x', xnew);
    break;

    default:
    break;
}
});
</code>```

I force the display to 100% on the screen before calculations and printing, but the results are always uneven and hazardous.
Is another solution on SVG code possible (since CSS property inline-block doesn't work in SVG)?
Should we go directly to modify the startSVGElementHandler() function in the tcpdf.php file of TCPDF (line 24333 case 'text': case 'tspan') or getHTMLUnitToUnits()?
And if yes, how ?
Thanks in advance, hoping to have been sufficiently clear in the description of the problem.

Body:
I'm using TCPDF 6.3 and when printing I can't get the same result as on screen for my SVG. On the screen, the nested tspans are organized natively in inline-block, so they remain well aligned and placed one after the other regardless of the value of the text-anchor (start, middle, end). The problem is that when printing the PDF, if text-anchor is set to "middle" the nested tspans overlap each other because they inherit the x attribute from the containing tspan. How do I make them stay aligned in the PDF? Here is the code:

<? xml version = "1.0" encoding = "utf-8" ?>< !DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"[

< !ENTITY classLigne1H "fill:#c3373f;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne2H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne3H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne4H "fill:#c3378d;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne5H "fill:#37c339;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne6H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
< !ENTITY classLigne7H "fill:#4b37c3;stroke:#000000;stroke-width:0.1pt;text-anchor:middle;font-style:Normal;font-size:6pt;font-family:Acme;" >
]>
<svg version="1.1"
  id="Calque_1" xmlns:ev="http://www.w3.org/2001/xml-events"
  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0pt" y="0pt" width="297mm"
  height="210mm" viewBox="0 0 841.89 595.276" style="enable-background:new 0 0 841.89 595.276;" xml:space="preserve">
  <g id="montexte">
    <text id="Sosa1" x="0" y="538.583" width="225.354" height="56.6929" transform="translate(307.922,-43.2756)">
        <tspan x="0.0000" y="548" width="225.354" height="56.6929" data-ligne="nom_5LI" data-type="simple" data-libelle="nom" style="&classLigne1H;">Nom Sosa1</tspan>
        <tspan x="0.0000" y="558" width="225.354" height="56.6929" data-ligne="prenom_5LI" data-type="simple" data-libelle="prenom" style="&classLigne2H;">prenom Sosa1</tspan>
        <tspan x="0.0000" y="568" width="225.354" height="56.6929" data-ligne="metier_5LI" data-type="simple" data-libelle="metier" style="&classLigne3H;">metier Sosa1</tspan>
        <tspan x="53.1833" y="578" width="225.354" height="56.6929" data-ligne="date_n_5LI" data-type="triple_n" style="text-anchor: start;"><tspan data-libelle="intitule_n" style="&classLigne4H;">° </tspan><tspan data-libelle="date_n" style="&classLigne4H;">date_n Sosa1</tspan><tspan data-libelle="lieu_n" style="&classLigne5H;">lieu_n Sosa1</tspan><tspan data-libelle="finx"></tspan></tspan>
        <tspan x="-49.4167" y="588" width="225.354" height="56.6929" data-ligne="date_d_5LI" data-type="triple_d" style="text-anchor: start;"><tspan data-libelle="intitule_d" style="&classLigne6H;">+ </tspan><tspan data-libelle="date_d" style="&classLigne6H;">date_d Sosa1</tspan><tspan data-libelle="lieu_d" style="&classLigne7H;">lieu_d Sosa1</tspan><tspan data-libelle="finx"></tspan></tspan>
    </text>
  </g>
</svg>

With Jquery, I tried to get the exact width of the group of nested tspans to force their absolute positioning in the text block (the tspan data-libelle="finx" is just there to get the left of its offset).

// the var 'name' is obtained by another function each (I don't put all the code here)
$('tspan[data-ligne=' + nom + ']', '#montexte').each(function (index) {
    var type = $(this).data('type');
    var bloctxt = $(this).parent().attr('id'); // bloc text Sosa
    var x = $(this).parent().attr('x'); // bloc text
    var width = $(this).parent().attr('width'); // bloc text
    var anchor = $('#centrageTexte option:selected').val();
    var convert = 0.75; // 1pt = 0.75px

// part of the switch case
switch (type) {
    case 'triple_n':// 3 tspan (intitulé + date + lieu)
            var offset = $(this).parent().position(); //left du bloc text
            var left = parseFloat((offset.left) * convert); // left du bloc text
            var offset0 = $('tspan[data-libelle="intitule_n"]', this).position();
            var left0 = parseFloat((offset0.left) * convert); // left du premier tspan
            var x0 = parseFloat($(this).attr('x')); // x du tspan conteneur
            var offsetx = $('tspan[data-libelle="finx"]', this).position(); // pos du dernier tspan (vide)
            var leftx = parseFloat((offsetx.left) * convert); // x du dernier tspan (vide)
            var marge = parseFloat(left0 - left); // largeur du tspan conteneur
            var larg = parseFloat(left0 - leftx); // largeur du tspan conteneur
            if (anchor == 'middle') x0 = parseFloat((x0 - (width / 2)) + (marge));
            if (anchor == 'end') x0 = parseFloat(x0 - larg);
            var xnew = parseFloat(x0).toFixed(4);
            $('tspan[data-ligne=' + nom + ']', '#clonetexte').attr('x', xnew);
    break;

    default:
    break;
}
});

I force the display to 100% on the screen before calculations and printing, but the results are always uneven and hazardous.
Is another solution on SVG code possible (since CSS property inline-block doesn't work in SVG)?
Should we go directly to modify the startSVGElementHandler() function in the tcpdf.php file of TCPDF (line 24333 case 'text': case 'tspan') or getHTMLUnitToUnits()?
And if yes, how ?
Thanks in advance, hoping to have been sufficiently clear in the description of the problem.


问:
LogQL: Time limit exceeded by mistake
I have written a LogQL query. I want to count the events over a period of 7 days and output them as a total.
7 days = 168h.
Here I have a screenshot.
If I enter the 168h at "count_over_time" I exceed the limit of 169h. This makes no sense to me.

What is the problem here? Where does the 182,5h come from?

Title: LogQL: Time limit exceeded by mistake


问:
How to define a key to GET human readable ids in REDIS?
My goal is to save unique human readable ids in REDIS.

My problem is how to set the key to access the value(The value is the generated ID).

If I use an integer, for example, how do I know what is the next integer to GET the data from in redis. And if the application stops, how do I know which integer to return to?

My initial idea was to create all the ids in redis and then use GETDEL because it is O(1). The problem is how to set the key to fetch the generated id.


问:
Cannot Connect to DISPLAY from docker container
I am following a basic tutorial in which we run abiword (some gui) from a docker container. For some reason, the container cannot find my display.
I am running on Ubuntu 20.04, on a x86_64 machine.
My Dockerfile:

```<code>FROM ubuntu
RUN apt update && apt install -y abiword
CMD abiword
</code>```

My build command:
docker build -t abiword .

Before my run command, I add docker to my authorized xhosts:

```<code>mylinux@mylinux:$ xhost +local:docker
non-network local connections being added to access control list
mylinux@mylinux:$ xhost
access control enabled, only authorized clients can connect
LOCAL:
SI:localuser:lu20
</code>```

I also tried xhost + to disable access control altogether, but no luck.

Run commands I've tried:

docker run -e DISPLAY=$(hostname -I | awk '{print $1}')$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix abiword

docker run -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix abiword

docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix abiword

The volume I'm mounting does exist:

```<code>mylinux@mylinux:$ ls /tmp/.X11-unix/
X0  X1
</code>```

In all cases, I get the same output:

```<code>** (abiword:7): WARNING **: 13:46:51.920: clutter failed 0, get a life.
No DISPLAY: this may not be what you want.
</code>```

Any help is appreciated.

Body:
I am following a basic tutorial in which we run abiword (some gui) from a docker container. For some reason, the container cannot find my display.
I am running on Ubuntu 20.04, on a x86_64 machine.
My Dockerfile:

FROM ubuntu
RUN apt update && apt install -y abiword
CMD abiword

My build command:
docker build -t abiword .

Before my run command, I add docker to my authorized xhosts:

mylinux@mylinux:$ xhost +local:docker
non-network local connections being added to access control list
mylinux@mylinux:$ xhost
access control enabled, only authorized clients can connect
LOCAL:
SI:localuser:lu20

I also tried xhost + to disable access control altogether, but no luck.

Run commands I've tried:

docker run -e DISPLAY=$(hostname -I | awk '{print $1}')$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix abiword

docker run -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix abiword

docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix abiword

The volume I'm mounting does exist:

mylinux@mylinux:$ ls /tmp/.X11-unix/
X0  X1

In all cases, I get the same output:

** (abiword:7): WARNING **: 13:46:51.920: clutter failed 0, get a life.
No DISPLAY: this may not be what you want.

Any help is appreciated.


Title: How to store numbers in R (very very basic)

Body:
I am sorry for this basic question:

I have 1008 individual numbers that I would like to store in a single vector in R. Somehow this does not seem to be possible. The maximum seems to be 666 numbers. However I can split it in two objects and then combine them to get the object with 1008 elements. Does anyone have an explanation for this?

not working code:
a <- c(1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 16, 18, 19, 20, 24, 26, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 69, 71, 109, 113, 114, 115, 117, 134, 147, 148, 166, 173, 174, 175, 182, 184, 193, 199, 202, 208, 209, 217, 219, 232, 280, 288, 309, 321, 323, 331, 332, 338, 344, 357, 375, 378, 385, 386, 390, 398, 401, 406, 432, 433, 435, 450, 459, 460, 470, 476, 480, 482, 485, 525, 528, 529, 535, 549, 558, 596, 599, 604, 605, 614, 617, 619, 621, 622, 623, 626, 638, 640, 726, 741, 766, 770, 778, 779, 785, 799, 804, 813, 835, 837, 838, 861, 878, 888, 894, 898, 900, 905, 907, 912, 913, 914, 919, 920, 925, 926, 929, 930, 932, 958, 960, 961, 963, 968, 969, 990, 1014, 1023, 1031, 1078, 1080, 1082, 1084, 1085, 1086, 1088, 1089, 1090, 1096, 1099, 1101, 1104, 1108, 1111, 1113, 1114, 1119, 1120, 1132, 1164, 1166, 1167, 1171, 1172, 1173, 1174, 1175, 1178, 1179, 1184, 1191, 1208, 1219, 1226, 1243, 1255, 1298, 1303, 1307, 1308, 1309, 1316, 1331, 1339, 1340, 1343, 1344, 1346, 1353, 1374, 1376, 1377, 1380, 1416, 1418, 1419, 1421, 1424, 1428, 1432, 1435, 1461, 1464, 1483, 1484, 1485, 1486, 1487, 1489, 1501, 1503, 1507, 1510, 1513, 1516, 1517, 1519, 1539, 1573, 1579, 1588, 1592, 1594, 1605, 1606, 1629, 1632, 1648, 1664, 1667, 1680, 1682, 1765, 1768, 1769, 1781, 1782, 1783, 1790, 1840, 1841, 1843, 1847, 1851, 1854, 1855, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1866, 1867, 1885, 1886, 1887, 1888, 1889, 1890, 1902, 1903, 1905, 1906, 1922, 1923, 1942, 1943, 1944, 2062, 2063, 2064, 2065, 2071, 2072, 2127, 2128, 2131, 2132, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2145, 2169, 2198, 2224, 2238, 2239, 2247, 2253, 2254, 2255, 2256, 2257, 2258, 2261, 2262, 2272, 2273, 2274, 2275, 2276, 2285, 2286, 2287, 2288, 2289, 2290, 2295, 2296, 2298, 2299, 2300, 2301, 2304, 2307, 2308, 2309, 2310, 2312, 2313, 2314, 2319, 2320, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2331, 2332, 2356, 2358, 2359, 2362, 2390, 2393, 2394, 2396, 2397, 2401, 2402, 2403, 2405, 2406, 2411, 2412, 2413, 2419, 2423, 2427, 2429, 2430, 2497, 2500, 2512, 2513, 2514, 2515, 2516, 2519, 2535, 2548, 2555, 2558, 2559, 2562, 2563, 2565, 2587, 2588, 2612, 2615, 2616, 2897, 2900, 2904, 2906, 2909, 2916, 2920, 2923, 2925, 2926, 2927, 2928, 2932, 2933, 2934, 2937, 2938, 2939, 2940, 2941, 2948, 2952, 2990, 2991, 2992, 2993, 2995, 2998, 2999, 3000, 3002, 3003, 3004, 3030, 3031, 3032, 3034, 3132, 3135, 3138, 3140, 3143, 3146, 3151, 3313, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3342, 3343, 3344, 3346, 3347, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3370, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3389, 3391, 3417, 3418, 3419, 3421, 3423, 3424, 3425, 3426, 3427, 3429, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3480, 3488, 3489, 3490, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3517, 3520, 3522, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 3540, 3601, 3628, 3630, 3631, 3632, 3633, 3634, 3635, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3665, 3668, 3671, 3672, 3673, 3674, 3676, 3677, 3678, 3679, 3681, 3688, 3689, 3690, 3691, 3723, 3725, 3726, 3727, 3775, 3776, 3777, 3778, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 3788, 3789, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 3868, 3869, 3872, 3874, 3875, 3876, 3878, 3882, 3895, 3896, 3898, 3899, 3903, 3905, 3906, 3907, 3908, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 3928, 3929, 3930, 3931, 3933, 3936, 3947, 3948, 3949, 3950, 3952, 3954, 3955, 3956, 3957, 3958, 3970, 3971, 3972, 3974, 3975, 3976, 3977, 3980, 3981, 3982, 3984, 3995, 3997, 4062, 4066, 4067, 4068, 4069, 4072, 4073, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4106, 4127, 4134, 4135, 4136, 4137, 4138, 4139, 4141, 4142, 4143, 4144, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4185, 4186, 4191, 4193, 4194, 4197, 4198, 4199, 4205, 4207, 4209, 4211, 4212, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4224, 4225, 4226, 4232, 4233, 4234, 4235, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4248, 4251, 4252, 4253, 4254, 4256, 4257, 4258, 4259, 4260, 4261, 4263, 4264, 4265, 4266, 4268, 4269, 4270, 4271, 4272, 4275, 4276, 4277, 4278, 4283, 4284, 4285, 4286, 4290, 4291, 4293, 4310, 4311, 4313, 4317, 4325, 4349, 4350, 4352, 4354, 4355, 4356, 4359, 4360, 4365, 4366, 4367, 4369, 4370, 4373, 4379, 4380, 4381, 4383, 4384, 4386, 4387, 4388, 4390, 4391, 4393, 4394, 4395, 4396, 4398, 4399, 4401, 4428, 4430, 4431, 4432, 4434, 4436, 4440, 4443, 4445, 4446, 4447, 4448, 4455, 4456, 4458, 4459, 4460, 4462, 4465, 4466, 4467, 4469, 4471, 4472, 4473, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4498, 4499, 4500, 4501, 4502, 4509, 4510, 4511, 4514, 4525, 4526, 4528, 4529, 4530, 4537, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4549, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4577, 4578, 4579, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4589, 4590, 4591, 4592, 4593, 4594, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4624, 4625, 4627, 4628, 4630, 4633, 4634, 4638, 4641, 4642, 4643, 4644, 4645, 4646, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4661, 4662, 4663, 4664, 4668, 4669, 4670, 4671, 4672, 4673, 4716, 4717, 4734, 4735, 4736, 4738, 4739, 4741, 4742, 4743, 4746, 4747, 4765, 4767, 4768, 4769, 4770, 4777, 4778, 4779, 4781, 4782, 4783, 4784, 4788, 4789, 4790, 4791, 4792, 4795, 4796, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4816, 4828, 4829, 4830, 4831, 4832, 4833, 4835, 4836, 4837, 4838, 4839, 4840, 4842, 4854, 4856, 4857, 4858, 4859, 4862, 4863, 4864, 4865, 4867, 4868, 4870, 4873, 4875, 4877, 4880, 4881, 4883)

working code:
a <- c(1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 16, 18, 19, 20, 24, 26, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 69, 71, 109, 113, 114, 115, 117, 134, 147, 148, 166, 173, 174, 175, 182, 184, 193, 199, 202, 208, 209, 217, 219, 232, 280, 288, 309, 321, 323, 331, 332, 338, 344, 357, 375, 378, 385, 386, 390, 398, 401, 406, 432, 433, 435, 450, 459, 460, 470, 476, 480, 482, 485, 525, 528, 529, 535, 549, 558, 596, 599, 604, 605, 614, 617, 619, 621, 622, 623, 626, 638, 640, 726, 741, 766, 770, 778, 779, 785, 799, 804, 813, 835, 837, 838, 861, 878, 888, 894, 898, 900, 905, 907, 912, 913, 914, 919, 920, 925, 926, 929, 930, 932, 958, 960, 961, 963, 968, 969, 990, 1014, 1023, 1031, 1078, 1080, 1082, 1084, 1085, 1086, 1088, 1089, 1090, 1096, 1099, 1101, 1104, 1108, 1111, 1113, 1114, 1119, 1120, 1132, 1164, 1166, 1167, 1171, 1172, 1173, 1174, 1175, 1178, 1179, 1184, 1191, 1208, 1219, 1226, 1243, 1255, 1298, 1303, 1307, 1308, 1309, 1316, 1331, 1339, 1340, 1343, 1344, 1346, 1353, 1374, 1376, 1377, 1380, 1416, 1418, 1419, 1421, 1424, 1428, 1432, 1435, 1461, 1464, 1483, 1484, 1485, 1486, 1487, 1489, 1501, 1503, 1507, 1510, 1513, 1516, 1517, 1519, 1539, 1573, 1579, 1588, 1592, 1594, 1605, 1606, 1629, 1632, 1648, 1664, 1667, 1680, 1682, 1765, 1768, 1769, 1781, 1782, 1783, 1790, 1840, 1841, 1843, 1847, 1851, 1854, 1855, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1866, 1867, 1885, 1886, 1887, 1888, 1889, 1890, 1902, 1903, 1905, 1906, 1922, 1923, 1942, 1943, 1944, 2062, 2063, 2064, 2065, 2071, 2072, 2127, 2128, 2131, 2132, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2145, 2169, 2198, 2224, 2238, 2239, 2247, 2253, 2254, 2255, 2256, 2257, 2258, 2261, 2262, 2272, 2273, 2274, 2275, 2276, 2285, 2286, 2287, 2288, 2289, 2290, 2295, 2296, 2298, 2299, 2300, 2301, 2304, 2307, 2308, 2309, 2310, 2312, 2313, 2314, 2319, 2320, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2331, 2332, 2356, 2358, 2359, 2362, 2390, 2393, 2394, 2396, 2397, 2401, 2402, 2403, 2405, 2406, 2411, 2412, 2413, 2419, 2423, 2427, 2429, 2430, 2497, 2500, 2512, 2513, 2514, 2515, 2516, 2519, 2535, 2548, 2555, 2558, 2559, 2562, 2563, 2565, 2587, 2588, 2612, 2615, 2616, 2897, 2900, 2904, 2906, 2909, 2916, 2920, 2923, 2925, 2926, 2927, 2928, 2932, 2933, 2934, 2937, 2938, 2939, 2940, 2941, 2948, 2952, 2990, 2991, 2992, 2993, 2995, 2998, 2999, 3000, 3002, 3003, 3004, 3030, 3031, 3032, 3034, 3132, 3135, 3138, 3140, 3143, 3146, 3151, 3313, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3342, 3343, 3344, 3346, 3347, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3370, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3389, 3391, 3417, 3418, 3419, 3421, 3423, 3424, 3425, 3426, 3427, 3429, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3480, 3488, 3489, 3490, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3517, 3520, 3522, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 3540, 3601, 3628, 3630, 3631, 3632, 3633, 3634, 3635, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3665, 3668, 3671, 3672, 3673, 3674, 3676, 3677, 3678, 3679, 3681, 3688, 3689, 3690, 3691, 3723, 3725, 3726, 3727, 3775, 3776, 3777, 3778, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 3788, 3789, 3857, 3858, 3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 3868, 3869, 3872, 3874, 3875, 3876, 3878, 3882, 3895, 3896, 3898, 3899, 3903, 3905, 3906, 3907, 3908, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 3928, 3929, 3930, 3931, 3933, 3936, 3947, 3948, 3949, 3950, 3952, 3954, 3955, 3956, 3957, 3958, 3970, 3971, 3972, 3974, 3975, 3976, 3977, 3980, 3981, 3982, 3984, 3995, 3997, 4062, 4066, 4067, 4068, 4069, 4072, 4073, 4098, 4099, 4100, 4101)

b <- c(4102, 4103, 4104, 4106, 4127, 4134, 4135, 4136, 4137, 4138, 4139, 4141, 4142, 4143, 4144, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4185, 4186, 4191, 4193, 4194, 4197, 4198, 4199, 4205, 4207, 4209, 4211, 4212, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4224, 4225, 4226, 4232, 4233, 4234, 4235, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4248, 4251, 4252, 4253, 4254, 4256, 4257, 4258, 4259, 4260, 4261, 4263, 4264, 4265, 4266, 4268, 4269, 4270, 4271, 4272, 4275, 4276, 4277, 4278, 4283, 4284, 4285, 4286, 4290, 4291, 4293, 4310, 4311, 4313, 4317, 4325, 4349, 4350, 4352, 4354, 4355, 4356, 4359, 4360, 4365, 4366, 4367, 4369, 4370, 4373, 4379, 4380, 4381, 4383, 4384, 4386, 4387, 4388, 4390, 4391, 4393, 4394, 4395, 4396, 4398, 4399, 4401, 4428, 4430, 4431, 4432, 4434, 4436, 4440, 4443, 4445, 4446, 4447, 4448, 4455, 4456, 4458, 4459, 4460, 4462, 4465, 4466, 4467, 4469, 4471, 4472, 4473, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4498, 4499, 4500, 4501, 4502, 4509, 4510, 4511, 4514, 4525, 4526, 4528, 4529, 4530, 4537, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4549, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4577, 4578, 4579, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4589, 4590, 4591, 4592, 4593, 4594, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4624, 4625, 4627, 4628, 4630, 4633, 4634, 4638, 4641, 4642, 4643, 4644, 4645, 4646, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4661, 4662, 4663, 4664, 4668, 4669, 4670, 4671, 4672, 4673, 4716, 4717, 4734, 4735, 4736, 4738, 4739, 4741, 4742, 4743, 4746, 4747, 4765, 4767, 4768, 4769, 4770, 4777, 4778, 4779, 4781, 4782, 4783, 4784, 4788, 4789, 4790, 4791, 4792, 4795, 4796, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4816, 4828, 4829, 4830, 4831, 4832, 4833, 4835, 4836, 4837, 4838, 4839, 4840, 4842, 4854, 4856, 4857, 4858, 4859, 4862, 4863, 4864, 4865, 4867, 4868, 4870, 4873, 4875, 4877, 4880, 4881, 4883)

c <- c(a,b)

I know there are a million easier solutions for this (already have it), but I would like to have an understanding as to why it was not possible to store this amount of elements.

Thanks a lot


问:
sklearn RandomForestClassifier (TypeError: __cinit__() takes exactly 6 positional arguments (7 given))
In this code I get error when running rf_classifier.fit(train, label):
training classifier #TypeError: __cinit__() takes exactly 6 positional arguments (7 given)

```<code>from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
import numpy as np

train = np.ones((500, 7))
label = np.ones((500))

rf_classifier = RandomForestClassifier(random_state=0)
rf_classifier.fit(train, label)

kn_classifier = KNeighborsClassifier(n_neighbors=3)
kn_classifier.fit(train, label) # training classifier

</code>```

package versions:

scikit-learn == 0.24.1

numpy.version.version = 1.21.5

Running on Windows 11

I tried to use the KN classifier and it works fine for the same train and labels input. I also tried this code in Kaggle and it works fine, but when I try to train it on my local machine I get that error.

Solved:
installed latest version of scikit-learn

I did not think about this before I posted my question because I tested same code on Kaggle with same version of scikit-learn and there was no error

Body:
In this code I get error when running rf_classifier.fit(train, label):
training classifier #TypeError: __cinit__() takes exactly 6 positional arguments (7 given)

from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
import numpy as np

train = np.ones((500, 7))
label = np.ones((500))

rf_classifier = RandomForestClassifier(random_state=0)
rf_classifier.fit(train, label)

kn_classifier = KNeighborsClassifier(n_neighbors=3)
kn_classifier.fit(train, label) # training classifier

package versions:

scikit-learn == 0.24.1

numpy.version.version = 1.21.5

Running on Windows 11

I tried to use the KN classifier and it works fine for the same train and labels input. I also tried this code in Kaggle and it works fine, but when I try to train it on my local machine I get that error.

Solved:
installed latest version of scikit-learn

I did not think about this before I posted my question because I tested same code on Kaggle with same version of scikit-learn and there was no error