问:
How to trigger a GH Actions workflow once a Slim CI job is completed (and successful)
We are currently running a linter for each of our CI builds within GitHub PRs. This linter, though, requires a dbt manifest.json which we can only build when the full dbt schemas are available in the PR schema.

We currently need to manually re-trigger the action workflow after dbt Cloud Slim CI is finished, since we have the on trigger as follows:

on:
  pull_request:
    branches:
    - main
    types: [opened, reopened, ready_for_review, synchronize]
```

And, as mentioned, the manifest.json is not yet built at the moment when the PR is e.g. opened.

Is there any way that we can trigger the workflow only once the Slim CI job (that is triggered by dbt Cloud) is actually completed, and therefore the manifest.json already built?

I've come across on.check_run and on.status for Events that trigger workflows (see GH docs), but not sure whether these can be used since, as specified in the docs: "Note: This event will only trigger a workflow run if the workflow file is on the default branch."

Body:
We are currently running a linter for each of our CI builds within GitHub PRs. This linter, though, requires a dbt manifest.json which we can only build when the full dbt schemas are available in the PR schema.

We currently need to manually re-trigger the action workflow after dbt Cloud Slim CI is finished, since we have the on trigger as follows:

on:
  pull_request:
    branches:
    - main
    types: [opened, reopened, ready_for_review, synchronize]

And, as mentioned, the manifest.json is not yet built at the moment when the PR is e.g. opened.

Is there any way that we can trigger the workflow only once the Slim CI job (that is triggered by dbt Cloud) is actually completed, and therefore the manifest.json already built?

I've come across on.check_run and on.status for Events that trigger workflows (see GH docs), but not sure whether these can be used since, as specified in the docs: "Note: This event will only trigger a workflow run if the workflow file is on the default branch."


来源: stackexchange

问:
Next JS: Get URL fragment with context (on getServerSideProps)
I want to get a URL fragment on getServerSideProps. The URL as the following structure: http://localhost:3000/some-folder#desiredParam=value

I am passing the context as a parameter to the getServerSideProps function, but I haven't been able to retrieve the URL param because the structure of the URL isn't http://localhost:3000/some-folder?desiredParam=value. If it was like this, I could just use context.query.desiredParam

Using context.query.url returns /some-folder and context.query returns null.

If I could just retrieve the whole window.location I would split the string by #, but that's not possible on getServerSideProps.

So... what can I do to get the desiredParam's value?

ContentLicense: CC BY-SA 4.0


问:
Setting up Dockerfile to use non-root user
I'm currently having an issue when I tried to run pip as a non-root user in my Dockerfile. When It starts to build the wheel it gives these warnings WARNING: The script foo is installed in '/home/myuser/.local/bin' which is  not on PATH. for pep8, sqlformat, isort, gunicorn, django-admin, epylint, pylint, pyreverse, and symilar.
In the current code I have, the build fails with the error COPY failed: stat usr/src/app/wheels: file does not exist when it tries to run COPY --from=builder /usr/src/app/wheels /wheels although it was failing earlier before I took out --wheel-dir /usr/src/app/wheels from line 35.

```<code>
###########
# BUILDER #
###########

# pull official base image
FROM python:3.9.4-alpine as builder

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
RUN apk update \
    && apk add postgresql-dev gcc python3-dev musl-dev

# lint
RUN pip install --upgrade pip
RUN pip install flake8==3.9.2
COPY . .
RUN flake8 --ignore=E501,F401 .

# install dependencies
RUN adduser -D myuser
USER myuser
WORKDIR /home/myuser
COPY --chown=myuser:myuser requirements.txt requirements.txt
RUN pip install --user -r requirements.txt
ENV PATH="/home/myuser/.local/bin:${PATH}"
COPY --chown=myuser:myuser . .

WORKDIR /usr/src/app
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt

#########
# FINAL #
#########

# pull official base image
FROM python:3.9.4-alpine

# create directory for the app user
RUN mkdir -p /home/app

# create the app user
RUN addgroup -S app && adduser -S app -G app

# create the appropriate directories
ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/staticfiles
RUN mkdir $APP_HOME/mediafiles
WORKDIR $APP_HOME

# install dependencies
RUN apk update && apk add libpq
COPY --from=builder /usr/src/app/wheels /wheels
COPY --from=builder /usr/src/app/requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache /wheels/*

# copy entrypoint.prod.sh
COPY ./entrypoint.prod.sh .
RUN sed -i 's/\r$//g'  $APP_HOME/entrypoint.prod.sh
RUN chmod +x  $APP_HOME/entrypoint.prod.sh

# copy project
COPY . $APP_HOME

# copy media files
COPY ./media/ $APP_HOME/mediafiles

# chown all the files to the app user
RUN chown -R app:app $APP_HOME

# change to the app user
USER app

# run entrypoint.prod.sh
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]
</code>```

I've tried tinkering with the WORKDIR, ENV PATH, and  RUN pip wheel.

Body:
I'm currently having an issue when I tried to run pip as a non-root user in my Dockerfile. When It starts to build the wheel it gives these warnings WARNING: The script foo is installed in '/home/myuser/.local/bin' which is  not on PATH. for pep8, sqlformat, isort, gunicorn, django-admin, epylint, pylint, pyreverse, and symilar.
In the current code I have, the build fails with the error COPY failed: stat usr/src/app/wheels: file does not exist when it tries to run COPY --from=builder /usr/src/app/wheels /wheels although it was failing earlier before I took out --wheel-dir /usr/src/app/wheels from line 35.

###########
# BUILDER #
###########

# pull official base image
FROM python:3.9.4-alpine as builder

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
RUN apk update \
    && apk add postgresql-dev gcc python3-dev musl-dev

# lint
RUN pip install --upgrade pip
RUN pip install flake8==3.9.2
COPY . .
RUN flake8 --ignore=E501,F401 .

# install dependencies
RUN adduser -D myuser
USER myuser
WORKDIR /home/myuser
COPY --chown=myuser:myuser requirements.txt requirements.txt
RUN pip install --user -r requirements.txt
ENV PATH="/home/myuser/.local/bin:${PATH}"
COPY --chown=myuser:myuser . .

WORKDIR /usr/src/app
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt

#########
# FINAL #
#########

# pull official base image
FROM python:3.9.4-alpine

# create directory for the app user
RUN mkdir -p /home/app

# create the app user
RUN addgroup -S app && adduser -S app -G app

# create the appropriate directories
ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/staticfiles
RUN mkdir $APP_HOME/mediafiles
WORKDIR $APP_HOME

# install dependencies
RUN apk update && apk add libpq
COPY --from=builder /usr/src/app/wheels /wheels
COPY --from=builder /usr/src/app/requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache /wheels/*

# copy entrypoint.prod.sh
COPY ./entrypoint.prod.sh .
RUN sed -i 's/\r$//g'  $APP_HOME/entrypoint.prod.sh
RUN chmod +x  $APP_HOME/entrypoint.prod.sh

# copy project
COPY . $APP_HOME

# copy media files
COPY ./media/ $APP_HOME/mediafiles

# chown all the files to the app user
RUN chown -R app:app $APP_HOME

# change to the app user
USER app

# run entrypoint.prod.sh
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]

I've tried tinkering with the WORKDIR, ENV PATH, and  RUN pip wheel.


问:
Can I implement Pokemon Go using Google Maps on Flutter?
I'm not using AR or Unity like Pokemon Go, I'm just trying to implement a map.

I want to have my position in the center of the bottom from the first person point of view, and I want to make the camera angle like Pokemon Go.

like this.

Ref

I'm going to implement Pokemon Go Map with a Flutter.


问:
How do I link an HTML drop down list selection to a statement using Javascript?
I am learning programming and I am trying to link an HTML drop down list to two alternative statements via a submit button and If/Else statements. I have been able to run the code when using a text input field, but not with a drop down list selection.

This is my HTML code:

```<code><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>

  <div class="test-container">
    <h1>Test2</h1>
    <br>
    <br>
    <form>
        <label for="mental capacity">Does resident have mental capacity?</label>
        <select name="mental capacity" id="mySelect">
            <option disabled hidden selected>Select</option>
            <option value="yes">Yes</option>
            <option value="no">No</option>
        </select>
    </form>
    <br>
    <br>
    <button class="submit">Submit</button>
    <br>
    </div>
  <h3 class="statement"></h3>
  <p class="statement"></p>
  <script src="test2.js"></script>
</body>
</html>
</code>```

And this is my Javascript code:

```<code>var mySelect = document.querySelector(".mySelect");
var statement = document.querySelector(".statement");
var submitButton = document.querySelector(".submit");

submitButton.addEventListener("click", ()=>{

    if(mySelect.value == "yes"){

        statement.innerText = `As service user has mental capacity, staff are to gain their consent prior to performing interventions.`;

    }else if(mySelect.value == "no"){

        statement.innerText = `As service user does not have mental capacity, staff will need to make a decision in their best interest`;

}
});
</code>```

Body:
I am learning programming and I am trying to link an HTML drop down list to two alternative statements via a submit button and If/Else statements. I have been able to run the code when using a text input field, but not with a drop down list selection.

This is my HTML code:

<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

Test2

    <form>
        Does resident have mental capacity?
        <select name="mental capacity" id="mySelect">
            <option disabled hidden selected>Select</option>
            <option value="yes">Yes</option>
            <option value="no">No</option>
        </select>
    </form>

    <button class="submit">Submit</button>

And this is my Javascript code:

var mySelect = document.querySelector(".mySelect");
var statement = document.querySelector(".statement");
var submitButton = document.querySelector(".submit");

submitButton.addEventListener("click", ()=>{

    if(mySelect.value == "yes"){

        statement.innerText = `As service user has mental capacity, staff are to gain their consent prior to performing interventions.`;

    }else if(mySelect.value == "no"){

        statement.innerText = `As service user does not have mental capacity, staff will need to make a decision in their best interest`;

}
});


问:
How to trigger didReceiveLocationPushPayload in iOS?

(void)didReceiveLocationPushPayload:(NSDictionary <NSString *, id> *)payload completion:(void (^)(void))completion unable to trigger

I have successfully applied for the com.apple.developer.location.push authority and followed the documentation and implemented everything, the notifications are successfully sent from the server with all the required headers, but the client didReceiveLocationPushPayload method did not respond.


问:
How can I change the week starting day in Date picker of Google Calendar add-on?
I have a Date Picker field in a Google Calendar Add-on. Here, the week start from a Sunday. Can I change this so that the week starts from a Monday ?

Here is the code I am using to add a Date picker -

```<code>const today = new Date();
const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1);
var startDatePicker = CardService.newDatePicker()
                      .setTitle("Start Date")
                      .setFieldName("start_date")
                      .setValueInMsSinceEpoch(tomorrow.getTime())
                      .setOnChangeAction(CardService.newAction().setFunctionName("dateStartCheck"));
</code>```

This code is currently giving me a calendar where a week is Sunday-Saturday. Expectation is that the week should be Monday-Sunday.

Body:
I have a Date Picker field in a Google Calendar Add-on. Here, the week start from a Sunday. Can I change this so that the week starts from a Monday ?

Here is the code I am using to add a Date picker -

const today = new Date();
const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1);
var startDatePicker = CardService.newDatePicker()
                      .setTitle("Start Date")
                      .setFieldName("start_date")
                      .setValueInMsSinceEpoch(tomorrow.getTime())
                      .setOnChangeAction(CardService.newAction().setFunctionName("dateStartCheck"));

This code is currently giving me a calendar where a week is Sunday-Saturday. Expectation is that the week should be Monday-Sunday.


问:
SonarQube - Malformed input or input contains unmappable characters
I have a Django project. It has some files with cyrillic chars in their names:

SonarQube gives error:

java.nio.file.InvalidPathException: Malformed input or input contains
unmappable characters:
src/apps/orders/sap_data_examples/ZLO_CANCEL_ORDERS/??????????
?????????????? ??????????????.json    at
java.base/sun.nio.fs.UnixPath.encode(Unknown Source)  at
java.base/sun.nio.fs.UnixPath.(Unknown Source)  at
java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source)   at
java.base/java.nio.file.Path.resolve(Unknown Source)  at
org.sonar.scm.git.IncludedFilesRepository.indexFiles(IncludedFilesRepository.java:65)
at
org.sonar.scm.git.IncludedFilesRepository.(IncludedFilesRepository.java:40)
at org.sonar.scm.git.GitIgnoreCommand.init(GitIgnoreCommand.java:37)
at
org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:104)
at
org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:352)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at
org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)  at
org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)     at
org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)   at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)   at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)   at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at
org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)    at
org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at
org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)  at
org.sonarsource.scanner.cli.Main.execute(Main.java:75)    at
org.sonarsource.scanner.cli.Main.main(Main.java:61)

SonarQube in gitlab-ci is being started as follows:

```<code>analyze:
  stage: analyze
  needs: ["tests"]
  dependencies:
    - tests
  image:
    name: docker-sre.site.ru/sonarqube/scanner:${SONAR_TAG}
    entrypoint: [""]
  before_script:
    - echo code analysis will be executed on ${SONAR_HOST}
  script:
    - /entrypoint.sh ${SONAR_HOST} ${SONAR_LOGIN} -X
  allow_failure: true
  artifacts:
    when: always
    reports:
      junit: report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
</code>```

I supposed that the error related to cyrillic chars in file names. If so how to fix this? Maybe specify encoding some how?

Body:
I have a Django project. It has some files with cyrillic chars in their names:

SonarQube gives error:

java.nio.file.InvalidPathException: Malformed input or input contains
unmappable characters:
src/apps/orders/sap_data_examples/ZLO_CANCEL_ORDERS/??????????
?????????????? ??????????????.json    at
java.base/sun.nio.fs.UnixPath.encode(Unknown Source)  at
java.base/sun.nio.fs.UnixPath.(Unknown Source)  at
java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source)   at
java.base/java.nio.file.Path.resolve(Unknown Source)  at
org.sonar.scm.git.IncludedFilesRepository.indexFiles(IncludedFilesRepository.java:65)
at
org.sonar.scm.git.IncludedFilesRepository.(IncludedFilesRepository.java:40)
at org.sonar.scm.git.GitIgnoreCommand.init(GitIgnoreCommand.java:37)
at
org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:104)
at
org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:352)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at
org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)  at
org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)     at
org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)   at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)   at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)   at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at
org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)    at
org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at
org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)  at
org.sonarsource.scanner.cli.Main.execute(Main.java:75)    at
org.sonarsource.scanner.cli.Main.main(Main.java:61)

SonarQube in gitlab-ci is being started as follows:

analyze:
  stage: analyze
  needs: ["tests"]
  dependencies:
    - tests
  image:
    name: docker-sre.site.ru/sonarqube/scanner:${SONAR_TAG}
    entrypoint: [""]
  before_script:
    - echo code analysis will be executed on ${SONAR_HOST}
  script:
    - /entrypoint.sh ${SONAR_HOST} ${SONAR_LOGIN} -X
  allow_failure: true
  artifacts:
    when: always
    reports:
      junit: report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml

I supposed that the error related to cyrillic chars in file names. If so how to fix this? Maybe specify encoding some how?


问:
Error: Error trying to diff '[object Object]'. Only arrays and iterables are allowed
The error comes when i sellect the encounter.dateOfService data i dont know why it comes i tried getting the response by using response.data.But the error still exist any idea where i'm missing out or what might be the code error. Any help will be appreciated.I received a json data from api. And this how my api data looks

```<code>    {
  "expires_in": 0,
  "data": {
    "patientEncounterTemplate": [
      {
        "id": 2,
        "patientEncounterId": 2,
        "masterTemplateId": 1,
        "templateData": "",
        "templateJson": "",
        "isDeleted": false
      }
    ],
    "id": 2,
    "patientID": 6,
    "patientAppointmentId": 60,
    "dateOfService": "2021-03-02T12:00:00",
    "startDateTime": "2021-03-02T12:00:00",
    "endDateTime": "2021-03-02T13:00:00",
    "appointmentStartDateTime": "0001-01-01T00:00:00",
    "appointmentEndDateTime": "0001-01-01T00:00:00",
    "staffID": 10,
    "officeAddressID": 1,
    "serviceLocationID": 1,
    "notetypeId": 1,
    "staffName": "Staff 1",
    "patientName": "Rahul Singh",
    "locationName": "Eveda",
    "status": "Pending",
    "totalRecords": 0,
    "unitsBlocked": 0,
    "unitsConsumed": 0,
    "serviceFacility": "62 - Comprehensive Outpatient ",
    "isDirectService": true,
    "isBillableEncounter": false,
    "soapNotes": {
      "id": 2,
      "subjective": "",
      "objective": "",
      "assessment": "",
      "plans": ""
    },
    "patientEncounterServiceCodes": [],
    "patientEncounterDiagnosisCodes": [],
    "encounterSignature": []
  },
  "message": "Success",
  "statusCode": 200,
  "appError": "",
  "firstTimeLogin": false,
  "openDefaultClient": false
}
</code>```

and this is how i called the data

```<code>getSelectedPreviousEncountersData(event:any){
    debugger
   this.previousEncounterId = event;
   this.encounterService.getPreviousEncountersData(this.previousEncounterId)
   .subscribe(
     response => {
       if (response.statusCode == 200) {
        debugger
         this.previousEncounters=response.data;
         if (response.statusCode == 200) {
          debugger
          console.log(this.previousEncounters)
          this.isPreviousEncounter=true;
          this.encounterId=0;
          this.soapNotes = response.data.soapNotes || null;
          this.patientEncounterTemplate = response.data.patientEncounterTemplate || [];
          this.templateFormId = response.data.patientEncounterTemplate &&
          response.data.patientEncounterTemplate[0].masterTemplateId || 0;

        } else {
          this.soapNotes = null;
          this.unitsConsumed = 0;
          this.isSoapCompleted = false;
        }
        debugger
        if (this.previousEncounterId) {
          this.getTemplateForm(this.templateFormId);
        }
       }
     }
   )
  }
</code>```

and this is the html i i have

```<code><div class="col-sm-3">
                          <div class="form-group">
                              <mat-form-field class="example-full-width">
                                  <mat-select placeholder="Select Previous Encounters"
                                      [(value)]="previousEncounterId"
                                      (selectionChange)="getSelectedPreviousEncountersData($event.value)">
                                      <mat-option *ngFor="let encounter of previousEncounters"
                                          [value]="encounter.id">
                                          {{ encounter.dateOfService }}
                                      </mat-option>
                                  </mat-select>
                              </mat-form-field>
                          </div>
                      </div>
                      <div class="col-sm-3 ">
                          <div class="filter-btn d-flex justify-content-end">
                              <button type="button" class="rounded px-1" color="warn"
                                  mat-raised-button (click)="clearFilters()">Clear All</button>
                              <button name="Filter" mat-raised-button class="rounded px-1 ml-3"
                                  color="accent" (click)="applyFilter()">Filter</button>
                          </div>
                      </div>
</code>```

Now i found out that i'm trying to access object not an array encounter.dateOfService is not an array so how can i convert json object into array.

```<code>applyFilter() {
    debugger
    let formValues = this.soapForm.value;
    this.getPreviousEncounters(this.patientAppointmentDetails.patientID, formValues.fromDate ? format(formValues.fromDate, 'MM/DD/YYYY') : "", formValues.toDate ? format(formValues.toDate, 'MM/DD/YYYY') : "");
  }

getPreviousEncounters(patientId, fromDate, toDate){

    this.encounterService.getPreviousEncounters(patientId, fromDate, toDate)
    .subscribe(
      response => {
        if (response.statusCode == 200) {
          this.previousEncounters=response.data;
          this.previousEncounterId=response.data.id;
          this.previousEncounters = (response.data || []).map((obj: any) => {
            obj.dateOfService = format(obj.dateOfService, 'MM/DD/YYYY hh:mm a');
            return obj;
          });

          //Legasov Added
          ////this.changeDetector.detectChanges();
        }
        else{
          this.previousEncounters=[];
        }
      }
    )
  }
</code>```

Body:
The error comes when i sellect the encounter.dateOfService data i dont know why it comes i tried getting the response by using response.data.But the error still exist any idea where i'm missing out or what might be the code error. Any help will be appreciated.I received a json data from api. And this how my api data looks

    {
  "expires_in": 0,
  "data": {
    "patientEncounterTemplate": [
      {
        "id": 2,
        "patientEncounterId": 2,
        "masterTemplateId": 1,
        "templateData": "",
        "templateJson": "",
        "isDeleted": false
      }
    ],
    "id": 2,
    "patientID": 6,
    "patientAppointmentId": 60,
    "dateOfService": "2021-03-02T12:00:00",
    "startDateTime": "2021-03-02T12:00:00",
    "endDateTime": "2021-03-02T13:00:00",
    "appointmentStartDateTime": "0001-01-01T00:00:00",
    "appointmentEndDateTime": "0001-01-01T00:00:00",
    "staffID": 10,
    "officeAddressID": 1,
    "serviceLocationID": 1,
    "notetypeId": 1,
    "staffName": "Staff 1",
    "patientName": "Rahul Singh",
    "locationName": "Eveda",
    "status": "Pending",
    "totalRecords": 0,
    "unitsBlocked": 0,
    "unitsConsumed": 0,
    "serviceFacility": "62 - Comprehensive Outpatient ",
    "isDirectService": true,
    "isBillableEncounter": false,
    "soapNotes": {
      "id": 2,
      "subjective": "",
      "objective": "",
      "assessment": "",
      "plans": ""
    },
    "patientEncounterServiceCodes": [],
    "patientEncounterDiagnosisCodes": [],
    "encounterSignature": []
  },
  "message": "Success",
  "statusCode": 200,
  "appError": "",
  "firstTimeLogin": false,
  "openDefaultClient": false
}

and this is how i called the data

getSelectedPreviousEncountersData(event:any){
    debugger
   this.previousEncounterId = event;
   this.encounterService.getPreviousEncountersData(this.previousEncounterId)
   .subscribe(
     response => {
       if (response.statusCode == 200) {
        debugger
         this.previousEncounters=response.data;
         if (response.statusCode == 200) {
          debugger
          console.log(this.previousEncounters)
          this.isPreviousEncounter=true;
          this.encounterId=0;
          this.soapNotes = response.data.soapNotes || null;
          this.patientEncounterTemplate = response.data.patientEncounterTemplate || [];
          this.templateFormId = response.data.patientEncounterTemplate &&
          response.data.patientEncounterTemplate[0].masterTemplateId || 0;

        } else {
          this.soapNotes = null;
          this.unitsConsumed = 0;
          this.isSoapCompleted = false;
        }
        debugger
        if (this.previousEncounterId) {
          this.getTemplateForm(this.templateFormId);
        }
       }
     }
   )
  }

and this is the html i i have

                              <mat-form-field class="example-full-width">
                                  <mat-select placeholder="Select Previous Encounters"
                                      [(value)]="previousEncounterId"
                                      (selectionChange)="getSelectedPreviousEncountersData($event.value)">
                                      <mat-option *ngFor="let encounter of previousEncounters"
                                          [value]="encounter.id">
                                          {{ encounter.dateOfService }}
                                      </mat-option>
                                  </mat-select>
                              </mat-form-field>

                              <button type="button" class="rounded px-1" color="warn"
                                  mat-raised-button (click)="clearFilters()">Clear All</button>
                              <button name="Filter" mat-raised-button class="rounded px-1 ml-3"
                                  color="accent" (click)="applyFilter()">Filter</button>

Now i found out that i'm trying to access object not an array encounter.dateOfService is not an array so how can i convert json object into array.

applyFilter() {
    debugger
    let formValues = this.soapForm.value;
    this.getPreviousEncounters(this.patientAppointmentDetails.patientID, formValues.fromDate ? format(formValues.fromDate, 'MM/DD/YYYY') : "", formValues.toDate ? format(formValues.toDate, 'MM/DD/YYYY') : "");
  }

getPreviousEncounters(patientId, fromDate, toDate){

    this.encounterService.getPreviousEncounters(patientId, fromDate, toDate)
    .subscribe(
      response => {
        if (response.statusCode == 200) {
          this.previousEncounters=response.data;
          this.previousEncounterId=response.data.id;
          this.previousEncounters = (response.data || []).map((obj: any) => {
            obj.dateOfService = format(obj.dateOfService, 'MM/DD/YYYY hh:mm a');
            return obj;
          });

          //Legasov Added
          ////this.changeDetector.detectChanges();
        }
        else{
          this.previousEncounters=[];
        }
      }
    )
  }


问:
GTK: Treeview with comboboxes - How to get different selectable items for each row?
I have prepared a simple GUI with a treeview which contains comboboxes. This works fine, I can use the comboboxes and select the specified items. However currently I can only specify the items and they are the same for the whole column, but how to get different selectable items for each row?

This is what I have now, it creates a new column with a combobox containing selectable items "item1", "item2", "item3":

```<code>    GtkCellRenderer *renderer;
    GtkListStore *combo_list;
    GtkTreeViewColumn *column;

    renderer = gtk_cell_renderer_combo_new ();
    combo_list = gtk_list_store_new(1, G_TYPE_STRING);

    gtk_list_store_insert_with_values(combo_list, NULL, -1, 0, "item1", -1);
    gtk_list_store_insert_with_values(combo_list, NULL, -1, 0, "item2", -1);
    gtk_list_store_insert_with_values(combo_list, NULL, -1, 0, "item3", -1);

    g_object_set(renderer, "model", combo_list, "text-column", 0, "has-entry", FALSE, "editable", TRUE, (char *)NULL);
    column = gtk_tree_view_column_new_with_attributes("data", renderer, "text", ELEMENT_TYPEDATA, NULL);

    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
</code>```

Can anyone provide an example for that in C?

Body:
I have prepared a simple GUI with a treeview which contains comboboxes. This works fine, I can use the comboboxes and select the specified items. However currently I can only specify the items and they are the same for the whole column, but how to get different selectable items for each row?

This is what I have now, it creates a new column with a combobox containing selectable items "item1", "item2", "item3":

    GtkCellRenderer *renderer;
    GtkListStore *combo_list;
    GtkTreeViewColumn *column;

    renderer = gtk_cell_renderer_combo_new ();
    combo_list = gtk_list_store_new(1, G_TYPE_STRING);

    gtk_list_store_insert_with_values(combo_list, NULL, -1, 0, "item1", -1);
    gtk_list_store_insert_with_values(combo_list, NULL, -1, 0, "item2", -1);
    gtk_list_store_insert_with_values(combo_list, NULL, -1, 0, "item3", -1);

    g_object_set(renderer, "model", combo_list, "text-column", 0, "has-entry", FALSE, "editable", TRUE, (char *)NULL);
    column = gtk_tree_view_column_new_with_attributes("data", renderer, "text", ELEMENT_TYPEDATA, NULL);

    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);

Can anyone provide an example for that in C?


问:
Maui.Devices.DeviceDisplay.MainDisplayInfo
I need to list all the screens on my Windows PC, not only the main display or current screen.
The reason; I would like my user to be able to display a message window on a screen of their choice and not only on the main screen.
The below code works, but it's not enough for what I'm trying to do.
Any ideas on how to detect all the screens, please?

```<code>    var h = Microsoft.Maui.Devices.DeviceDisplay.MainDisplayInfo.Height.ToString();
        var w = Microsoft.Maui.Devices.DeviceDisplay.MainDisplayInfo.Width.ToString();
</code>```

I tried traversing the structure of libraries in search of the multi display option or the option to detect the screen but nothing like that seems to be available.

Body:
I need to list all the screens on my Windows PC, not only the main display or current screen.
The reason; I would like my user to be able to display a message window on a screen of their choice and not only on the main screen.
The below code works, but it's not enough for what I'm trying to do.
Any ideas on how to detect all the screens, please?

    var h = Microsoft.Maui.Devices.DeviceDisplay.MainDisplayInfo.Height.ToString();
        var w = Microsoft.Maui.Devices.DeviceDisplay.MainDisplayInfo.Width.ToString();

I tried traversing the structure of libraries in search of the multi display option or the option to detect the screen but nothing like that seems to be available.


问:
Incremental training of ALS model
I'm trying to find out if it is possible to have "incremental training of ALS model" on kinesis streaming data using MLlib in Apache Spark.
I have real time interaction of user from kinesis stream, but to get updated prediction results I need to train the model on whole data. This takes some time.
I'm trying to figure out if I can do incremental training of ALS model on streaming data, but cannot find an answer.

Incremental training of ALS

Title: Incremental training of ALS model


问:
Angular reset service when log out
I am building an app with ngx socket io which connects properly and works fine. This app is securized and it connects to an URL including the username. As the URL is different for each user I have defined a custom socket with my config:

```<code>import { Injectable } from "@angular/core";
import { Socket } from "ngx-socket-io";
import { environment } from "src/environments/environment";
import { AuthService } from "./auth.service";

@Injectable({
  providedIn: 'root'
})
  export class CustomSocket extends Socket {

    socketStatus : boolean = false;

    constructor(private authServ: AuthService) {

      super({
        url: environment.wsUrl + authServ.getUsuarioAutenticado() ?? "",

        options: { transports: ['polling']
        }
      })
     }

  }
</code>```

This custom socket is called from the websocket service and works as a normal socket:

```<code>import { Injectable } from '@angular/core';
import { CustomSocket } from './customSocket';

@Injectable({
  providedIn: 'root'
})
export class WebsocketService {

  socketStatus : boolean = false;

  constructor(private socket: CustomSocket) {
    this.checkStatus()

   }

  checkStatus() {

    this.socket.on('connect', () => {
      console.log('Conectado al servidor');
      this.socketStatus = true;
    });

    this.socket.on('disconnect', () => {
      console.log('Desconectado del servidor');
      this.socketStatus = false;
    });
  }

  emitir( evento: string, payload?: any, callback?: Function ) {

    console.log('Emitiendo', evento);
    // emit('EVENTO', payload, callback?)
    this.socket.emit( evento, payload, callback );

  }

  listen( evento: string ) {
    return this.socket.fromEvent( evento );
  }

  disconnect () {
    this.socket.disconnect()
  }

  connect () {
    this.socket.connect()
  }
}

</code>```

And I print in a list all the elements I get from the socket in real time.

The problem comes when I log out as if I log in a different user without reloading the page, It gets connected to the URL of the previous user, as the CustomSocket service has already been triggered and will not trigger again. I want to kill that instance of the service when logged out or something equivalent.

I know that if I would use the custom socket in a component instead of another Injectable, I could just remove the provideIn: 'root', and add as a provider in the component, but I believe this can not be done in another injectable.

Any help is welcome, thank you.

Title: Angular reset service when log out

Body:
I am building an app with ngx socket io which connects properly and works fine. This app is securized and it connects to an URL including the username. As the URL is different for each user I have defined a custom socket with my config:

import { Injectable } from "@angular/core";
import { Socket } from "ngx-socket-io";
import { environment } from "src/environments/environment";
import { AuthService } from "./auth.service";

@Injectable({
  providedIn: 'root'
})
  export class CustomSocket extends Socket {

    socketStatus : boolean = false;

    constructor(private authServ: AuthService) {

      super({
        url: environment.wsUrl + authServ.getUsuarioAutenticado() ?? "",

        options: { transports: ['polling']
        }
      })
     }

  }

This custom socket is called from the websocket service and works as a normal socket:

import { Injectable } from '@angular/core';
import { CustomSocket } from './customSocket';

@Injectable({
  providedIn: 'root'
})
export class WebsocketService {

  socketStatus : boolean = false;

  constructor(private socket: CustomSocket) {
    this.checkStatus()

   }

  checkStatus() {

    this.socket.on('connect', () => {
      console.log('Conectado al servidor');
      this.socketStatus = true;
    });

    this.socket.on('disconnect', () => {
      console.log('Desconectado del servidor');
      this.socketStatus = false;
    });
  }

  emitir( evento: string, payload?: any, callback?: Function ) {

    console.log('Emitiendo', evento);
    // emit('EVENTO', payload, callback?)
    this.socket.emit( evento, payload, callback );

  }

  listen( evento: string ) {
    return this.socket.fromEvent( evento );
  }

  disconnect () {
    this.socket.disconnect()
  }

  connect () {
    this.socket.connect()
  }
}

And I print in a list all the elements I get from the socket in real time.

The problem comes when I log out as if I log in a different user without reloading the page, It gets connected to the URL of the previous user, as the CustomSocket service has already been triggered and will not trigger again. I want to kill that instance of the service when logged out or something equivalent.

I know that if I would use the custom socket in a component instead of another Injectable, I could just remove the provideIn: 'root', and add as a provider in the component, but I believe this can not be done in another injectable.

Any help is welcome, thank you.


问:
Yii2 Fileinput allow multiple screenshot insert
I have a Fileinput field and I want to insert there screenshots one by one, using print screen, but Fileinput remove previous file. What can I do ?</p>
```<code>
use kartik\widgets\FileInput

echo '<label class="control-label">Add Attachments</label>';
echo FileInput::widget([
    'model' => $model,
    'attribute' => 'attachment_1[]',
    'options' => ['multiple' => true]
]);

</code>```

Body:
I have a Fileinput field and I want to insert there screenshots one by one, using print screen, but Fileinput remove previous file. What can I do ?

use kartik\widgets\FileInput

echo 'Add Attachments';
echo FileInput::widget([
    'model' => $model,
    'attribute' => 'attachment_1[]',
    'options' => ['multiple' => true]
]);


问:
What is the difference between BillingClient.queryPurchasesAsync() vs Purchases.subscriptionsv2:get?
Can i know what is the difference between BillingClient.queryPurchasesAsync() vs Purchases.subscriptionsv2:get ?

I see the documentation for https://developer.android.com/google/play/billing/integrate is using BillingClient.

Thank you and much appreaciated

Can I know when and why need to use Purchases.subscriptionsv2:get Google API ?


问:
HTTP thingsboard issue
i tried to send data to simulate some alarms in thingsboard  ,when i send data over MQTT it works but when i send data with http ,alarm dont show up in thingsboard , probably it's an issue of keeping connexion with the device, i tried to pass -H "connection :close" but i have the same issue.
i tested that with two different  versions  tb 3.3.3 and  tb 3.4.
and when this happens with http and i tried to change to mqtt , still bugged .to resolve that i need to create another device profile and i start sending with MQTT to see the alarms

my http request is like that  :

```<code> `import requests,json

headers = {
    'accept': 'application/json',
    'Connetion': 'close',
    'X-Authorization': 'Bearer MY JWT TOKEN',
}

params = {
    'scope': 'ANY',
}

json_data = {
    'temperature': 90,
}

response = requests.post(
    'http://localhost:8080/api/plugins/telemetry/DEVICE/deviceID/timeseries/ANY',
    params=params,
    headers=headers,
    json=json_data,
)`
</code>```

i create the alarm using device profile because i dont know how to create a rule chain and call 7 or 6 shared attribute  with from different devices

Title: HTTP thingsboard issue

Body:
i tried to send data to simulate some alarms in thingsboard  ,when i send data over MQTT it works but when i send data with http ,alarm dont show up in thingsboard , probably it's an issue of keeping connexion with the device, i tried to pass -H "connection :close" but i have the same issue.
i tested that with two different  versions  tb 3.3.3 and  tb 3.4.
and when this happens with http and i tried to change to mqtt , still bugged .to resolve that i need to create another device profile and i start sending with MQTT to see the alarms

my http request is like that  :

 `import requests,json

headers = {
    'accept': 'application/json',
    'Connetion': 'close',
    'X-Authorization': 'Bearer MY JWT TOKEN',
}

params = {
    'scope': 'ANY',
}

json_data = {
    'temperature': 90,
}

response = requests.post(
    'http://localhost:8080/api/plugins/telemetry/DEVICE/deviceID/timeseries/ANY',
    params=params,
    headers=headers,
    json=json_data,
)`

i create the alarm using device profile because i dont know how to create a rule chain and call 7 or 6 shared attribute  with from different devices


问:
How to run lmbench tests in singularity
I want to run lmbench in a singularity container that is a memory test tool. This process produces the result file, but singularity is read-only and will exit

The purpose of my experiment was to verify the extent of performance loss of the container, this is my run command.

```<code>singularity exec cachetest.sif bash -c 'cd /home/lmbench-3.0-a9 && make results'

</code>```

Title: How to run lmbench tests in singularity

Body:
I want to run lmbench in a singularity container that is a memory test tool. This process produces the result file, but singularity is read-only and will exit

The purpose of my experiment was to verify the extent of performance loss of the container, this is my run command.

singularity exec cachetest.sif bash -c 'cd /home/lmbench-3.0-a9 && make results'


问:
How to mouse over from left to right on a graph in Robot framework automation. Can anyone write JavaScript code to do this action?
I have a graph which can be filtered as per day, week month and year. The data may be present for a day an not in some other day. When I mouse over on the graph that has data, a pop would come with values, this locator has to be validated.

For this task : i used the below. How do we know it's hovering on the part that has data ?

```<code>Mouse Over    //div[@class="ui chart-wrap basic-chart"]
</code>```

So i though of a solution to mouse over from left to right on the graph locator slowly(3 seconds). Where ever the data is there, we get a pop up and we can verify that graph has loaded.

Body:
I have a graph which can be filtered as per day, week month and year. The data may be present for a day an not in some other day. When I mouse over on the graph that has data, a pop would come with values, this locator has to be validated.

For this task : i used the below. How do we know it's hovering on the part that has data ?

Mouse Over    //div[@class="ui chart-wrap basic-chart"]

So i though of a solution to mouse over from left to right on the graph locator slowly(3 seconds). Where ever the data is there, we get a pop up and we can verify that graph has loaded.


问:
ReactJS MuiListItemButton ripple effect not able to remove
I created a custom styles to override ListItemButton css but can't remove the ripple effect when button is clicked. I found out that the api to call is from ".MuiButtonBase-root" but even after setting "disableRipple" to True, the ripple effect still persists.</p>


问:
How to auto scroll when dragging mat tabs with cdk drag drop
It seems that the cdk drag drop auto scroll is not working when used with mat tabs:

Here is the template

```<code><div
  #docTabGroup
  mat-tab-nav-bar
  cdkDropList
  cdkScrollable
  cdkDropListOrientation="horizontal"
  class="example-list"
  (cdkDropListDropped)="drop($event)"
  (wheel)="scrollTabs($event)"
>
  <div
    #dragItem
    mat-tab-link
    class="example-box"
    *ngFor="let timePeriod of timePeriods"
    cdkDrag
  >
    {{timePeriod}}
  </div>
</div>
</code>```

Dragging an item is not triggering the scroll. Is there a way I could implement that with tabs?

See this stackblitz

Body:
It seems that the cdk drag drop auto scroll is not working when used with mat tabs:

Here is the template

    {{timePeriod}}

Dragging an item is not triggering the scroll. Is there a way I could implement that with tabs?

See this stackblitz


问:
Nextjs useState delays when type CKeditor5 input
Created ckeditor 5 component separately and included other component

```<code>import React from "react";
import EditorCustom from "ckeditor5-custom-build/build/ckeditor";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import { fileStorage } from "../../../firebase/firebase.config";
import { ref, uploadBytes, getDownloadURL } from "firebase/storage";

class MyUploadAdapter {
  constructor(loader) {
    this.loader = loader;
  }
  // Starts the upload process.
  upload() {
    return this.loader.file.then(
      (file) =>
        new Promise((resolve, reject) => {
          let storage = fileStorage;
          uploadBytes(ref(storage, file.name), file)
            .then((snapshot) => {
              return getDownloadURL(snapshot.ref);
            })
            .then((downloadURL) => {
              resolve({
                default: downloadURL,
              });
            })
            .catch((error) => {
              reject(error.message);
            });
        })
    );
  }
}

const editorConfiguration = {
  ui: {
    viewportOffset: {
      top: 56,
    },
  },
  toolbar: {
    items: [
      "undo",
      "redo",
      "|",
      "heading",
      "fontFamily",
      "fontSize",
      "fontBackgroundColor",
      "fontColor",
      "highlight",
      "bulletedList",
      "numberedList",
      "todoList",
      "|",
      "imageUpload",
      "imageInsert",
      "insertTable",
      "mediaEmbed",
      "link",
      "pageBreak",
      "-",
      "outdent",
      "indent",
      "|",
      "blockQuote",
      "bold",
      "italic",
      "underline",
      "strikethrough",
      "horizontalLine",
    ],
    shouldNotGroupWhenFull: true,
  },
  language: "en",
  image: {
    toolbar: [
      "imageTextAlternative",
      "toggleImageCaption",
      "imageStyle:inline",
      "imageStyle:block",
      "imageStyle:side",
      "linkImage",
    ],
  },
  table: {
    contentToolbar: [
      "tableColumn",
      "tableRow",
      "mergeTableCells",
      "tableCellProperties",
      "tableProperties",
    ],
  },
};

const Editor = ({ value, onChange }) => {
  return (
    <>
      <CKEditor
        editor={EditorCustom}
        config={editorConfiguration}
        onReady={(editor) => {
          editor.plugins.get("FileRepository").createUploadAdapter = (
            loader
          ) => {
            return new MyUploadAdapter(loader);
          };
        }}
        data={value}
        onChange={(event, editor) => {
          const data = editor.getData();
          onChange(data);
        }}
      />
    </>
  );
};

export default Editor;

</code>```

but when i include component in create.js other default inputs delay and ckeditor input delay too, if not use useState ckeditor working fine

```<code>
import { useEffect, useState } from "react";
import dynamic from "next/dynamic";
import { database } from "../../../firebase/firebase.config";
import { collection, addDoc } from "firebase/firestore";

const CreateBlog = () => {
  const Editor = dynamic(() => import("../../dashboard/utils/myEditor"), {
    ssr: false,
  });
  const [title, setTitle] = useState("");
  const [subTitle, setSubTitle] = useState("");
  const [message, setMessage] = useState("");
  const [body, setBody] = useState("");
  const databaseRef = collection(database, "blogs");
  const addData = () => {
    addDoc(databaseRef, {
      title: title,
      sub_title: subTitle,
      message: message,
    })
      .then(() => {
        alert("Data Sent");
        // getData();
        setTitle("");
        setSubTitle("");
        setMessage("");
      })
      .catch((err) => {
        console.error(err);
      });
  };

  return (
    <>
      <div className="w-full px-4">
        <div className="w-full p-8 mt-10 bg-white rounded-lg shadow-md lg:w-3/3 md:w-2/2 md:ml-auto md:mt-0">
          <h2 className="mb-1 text-lg font-medium text-gray-900 title-font">
            Create Post
          </h2>
          <div className="mb-4 ">
            <label htmlFor="titile" className="text-sm leading-7 text-gray-600">
              Title
            </label>
            <input
              type="title"
              id="title"
              name="title"
              value={title}
              onChange={(event) => setTitle(event.target.value)}
              className="w-full px-3 py-1 text-base leading-8 text-gray-700 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
            />
          </div>
          <div className="mb-4">
            <label htmlFor="titile" className="text-sm leading-7 text-gray-600">
              Sub Title
            </label>
            <input
              type="title"
              id="title"
              name="title"
              value={subTitle}
              onChange={(event) => setSubTitle(event.target.value)}
              className="w-full px-3 py-1 text-base leading-8 text-gray-700 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
            />
          </div>
          <div className="relative mb-4">
            <label
              htmlFor="message"
              className="text-sm leading-7 text-gray-600"
            >
              Message
            </label>
            <textarea
              id="message"
              name="message"
              value={message}
              onChange={(event) => setMessage(event.target.value)}
              className="w-full h-32 px-3 py-1 text-base leading-6 text-gray-700 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded outline-none resize-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
            ></textarea>
          </div>
          <div className="mb-4 ">
            <label htmlFor="body" className="text-sm leading-7 text-gray-600">
              Body
            </label>
            <Editor value={body} onChange={(value) => setBody(value)} />
          </div>
          <button
            onClick={addData}
            className="px-6 py-2 text-lg text-white bg-blue-500 border-0 rounded focus:outline-none hover:bg-blue-600"
          >
            Button
          </button>
        </div>
      </div>
    </>
  );
};

export default CreateBlog;

</code>```
```<code><Editor value={body} onChange={(value) => setBody(value)} />
</code>```

used useState but its delay and slow breaking input type
how to use ckeditor with other inputs and value set useState without dealy

Body:
Created ckeditor 5 component separately and included other component

import React from "react";
import EditorCustom from "ckeditor5-custom-build/build/ckeditor";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import { fileStorage } from "../../../firebase/firebase.config";
import { ref, uploadBytes, getDownloadURL } from "firebase/storage";

class MyUploadAdapter {
  constructor(loader) {
    this.loader = loader;
  }
  // Starts the upload process.
  upload() {
    return this.loader.file.then(
      (file) =>
        new Promise((resolve, reject) => {
          let storage = fileStorage;
          uploadBytes(ref(storage, file.name), file)
            .then((snapshot) => {
              return getDownloadURL(snapshot.ref);
            })
            .then((downloadURL) => {
              resolve({
                default: downloadURL,
              });
            })
            .catch((error) => {
              reject(error.message);
            });
        })
    );
  }
}

const editorConfiguration = {
  ui: {
    viewportOffset: {
      top: 56,
    },
  },
  toolbar: {
    items: [
      "undo",
      "redo",
      "|",
      "heading",
      "fontFamily",
      "fontSize",
      "fontBackgroundColor",
      "fontColor",
      "highlight",
      "bulletedList",
      "numberedList",
      "todoList",
      "|",
      "imageUpload",
      "imageInsert",
      "insertTable",
      "mediaEmbed",
      "link",
      "pageBreak",
      "-",
      "outdent",
      "indent",
      "|",
      "blockQuote",
      "bold",
      "italic",
      "underline",
      "strikethrough",
      "horizontalLine",
    ],
    shouldNotGroupWhenFull: true,
  },
  language: "en",
  image: {
    toolbar: [
      "imageTextAlternative",
      "toggleImageCaption",
      "imageStyle:inline",
      "imageStyle:block",
      "imageStyle:side",
      "linkImage",
    ],
  },
  table: {
    contentToolbar: [
      "tableColumn",
      "tableRow",
      "mergeTableCells",
      "tableCellProperties",
      "tableProperties",
    ],
  },
};

const Editor = ({ value, onChange }) => {
  return (
    <>
      <CKEditor
        editor={EditorCustom}
        config={editorConfiguration}
        onReady={(editor) => {
          editor.plugins.get("FileRepository").createUploadAdapter = (
            loader
          ) => {
            return new MyUploadAdapter(loader);
          };
        }}
        data={value}
        onChange={(event, editor) => {
          const data = editor.getData();
          onChange(data);
        }}
      />
    </>
  );
};

export default Editor;

but when i include component in create.js other default inputs delay and ckeditor input delay too, if not use useState ckeditor working fine

import { useEffect, useState } from "react";
import dynamic from "next/dynamic";
import { database } from "../../../firebase/firebase.config";
import { collection, addDoc } from "firebase/firestore";

const CreateBlog = () => {
  const Editor = dynamic(() => import("../../dashboard/utils/myEditor"), {
    ssr: false,
  });
  const [title, setTitle] = useState("");
  const [subTitle, setSubTitle] = useState("");
  const [message, setMessage] = useState("");
  const [body, setBody] = useState("");
  const databaseRef = collection(database, "blogs");
  const addData = () => {
    addDoc(databaseRef, {
      title: title,
      sub_title: subTitle,
      message: message,
    })
      .then(() => {
        alert("Data Sent");
        // getData();
        setTitle("");
        setSubTitle("");
        setMessage("");
      })
      .catch((err) => {
        console.error(err);
      });
  };

  return (
    <>

            Create Post

              Title

            <input
              type="title"
              id="title"
              name="title"
              value={title}
              onChange={(event) => setTitle(event.target.value)}
              className="w-full px-3 py-1 text-base leading-8 text-gray-700 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
            />

              Sub Title

            <input
              type="title"
              id="title"
              name="title"
              value={subTitle}
              onChange={(event) => setSubTitle(event.target.value)}
              className="w-full px-3 py-1 text-base leading-8 text-gray-700 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
            />

              Message

            <textarea
              id="message"
              name="message"
              value={message}
              onChange={(event) => setMessage(event.target.value)}
              className="w-full h-32 px-3 py-1 text-base leading-6 text-gray-700 transition-colors duration-200 ease-in-out bg-white border border-gray-300 rounded outline-none resize-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
            ></textarea>

              Body

            <Editor value={body} onChange={(value) => setBody(value)} />

          <button
            onClick={addData}
            className="px-6 py-2 text-lg text-white bg-blue-500 border-0 rounded focus:outline-none hover:bg-blue-600"
          >
            Button
          </button>

    </>
  );
};

export default CreateBlog;

<Editor value={body} onChange={(value) => setBody(value)} />

used useState but its delay and slow breaking input type
how to use ckeditor with other inputs and value set useState without dealy


问:
How to do certificate pinning with chopper client
I'm developing an application using ChopperClient. To improve application security I want to do certificate pinning by using http_certificate_pinning library.

What I've tried:
I try using HttpCertificatePinning.check as suggested in the library's official guide. The serverURL is my mock api url. When I run the application, the application crashed and exited. When I change the url to https://www.google.com/ the application is not crash and the result is returned as false.

Does anyone have experience using Chopper with this library?
How should I do certificate pinning with this library?

```<code>Future<bool> myCustomImplementation(String url, Map<String, String> headers,
  List<String> allowedSHAFingerprints) async {
try {
  final String secure = await HttpCertificatePinning.check(
      serverURL: url, //mock api url
      headerHttp: headers, //mock headers
      sha: SHA.SHA256,
      allowedSHAFingerprints: allowedSHAFingerprints, //mock fingerprints
      timeout: 100);

  if (secure.contains("CONNECTION_SECURE")) {
    return true;
  } else {
    return false;
  }
} catch (e) {
  return false;
}
</code>```

}

Body:
I'm developing an application using ChopperClient. To improve application security I want to do certificate pinning by using http_certificate_pinning library.

What I've tried:
I try using HttpCertificatePinning.check as suggested in the library's official guide. The serverURL is my mock api url. When I run the application, the application crashed and exited. When I change the url to https://www.google.com/ the application is not crash and the result is returned as false.

Does anyone have experience using Chopper with this library?
How should I do certificate pinning with this library?

Future<bool> myCustomImplementation(String url, Map<String, String> headers,
  List<String> allowedSHAFingerprints) async {
try {
  final String secure = await HttpCertificatePinning.check(
      serverURL: url, //mock api url
      headerHttp: headers, //mock headers
      sha: SHA.SHA256,
      allowedSHAFingerprints: allowedSHAFingerprints, //mock fingerprints
      timeout: 100);

  if (secure.contains("CONNECTION_SECURE")) {
    return true;
  } else {
    return false;
  }
} catch (e) {
  return false;
}

}


问:
error on MODX. Alert when entering the site or the administration panel
Who can tell where to look for the error. There is a site on MODX, when you enter the site or the control panel, a window with data entry is shown, this window appeared by itself. The hosting says that the site has virus files, where to start looking for the sinister code?


问:
Remove a specific woocommerce registration errors
I'm trying to remove this registration error 'registration-error-email-exists' from woocommerce/wp error. Tried several options but couldn't figure out the solution. So any solutions without editing the wc core plugin file would be appriciated(as by editing the core plugin file a little solves my issue but I want to a proper solution).

So far I've tried

```<code>function wp_kama_woocommerce_registration_errors_filter( $errors, $email ){

    $errors = $errors->remove('registration-error-email-exists');
    return $errors;

}
add_filter( 'woocommerce_registration_errors', 'wp_kama_woocommerce_registration_errors_filter', 10, 4 );
</code>```

But it seems not working, below are the reference I've followed so far
Ref 1
Ref 2

Related woocommerce file: woocommerce/includes/wc-user-functions.php

Body:
I'm trying to remove this registration error 'registration-error-email-exists' from woocommerce/wp error. Tried several options but couldn't figure out the solution. So any solutions without editing the wc core plugin file would be appriciated(as by editing the core plugin file a little solves my issue but I want to a proper solution).

So far I've tried

function wp_kama_woocommerce_registration_errors_filter( $errors, $email ){

    $errors = $errors->remove('registration-error-email-exists');
    return $errors;

}
add_filter( 'woocommerce_registration_errors', 'wp_kama_woocommerce_registration_errors_filter', 10, 4 );

But it seems not working, below are the reference I've followed so far
Ref 1
Ref 2

Related woocommerce file: woocommerce/includes/wc-user-functions.php


问:
Dynamics 365: why an assemby was found for real-time workflow but wosn't for the same background workflow?
Dynamics 365 On-Premises, version 2014 (9.1.3.11)

.Net Framework 4.6.2

NuGet-package: Microsoft.CrmSdk.Workflow version 9.0.2.46

I created some CodeActivity and use it in my Process. If the workflow is real-time then it works fine. But if I convert it to background workflow then I get an Exception when it works:

could not load file or assemby System.Text.Json Version=5.0.0.2

What is the reason of such behaviour can be? Why was the assembly successfully found in the first case, but wasn't in the second?


问:
First navigation link is not working for the first time in SwiftUI
I have one navigationLink in the view but for the very first time its not clickable, but when i copy pasted same code below that the second navigationLink is working properly, I am not sure what is the issue with the first navigation (for the first time) only</p>
```<code>if let groups = initialViewModel.groupsResponse {
// not clickable for first time
    ABCBanner(bannerType: .info,
              bannerBody: "title",
               bannerCTA: "title",
       bannerCTACallback: {
           initialViewModel.activateShow.toggle()
       })
    NavigationLink(destination: AlternatView(viewModel: AlternatViewModel(groups: Groups),
                                          showIsActive: $initialViewModel.activateShow),
                                              isActive: $initialViewModel.activateShow) { }

//clickable for first time
    ABCBanner(bannerType: .info,
              bannerBody: "title",
               bannerCTA: "title",
       bannerCTACallback: {
            initialViewModel.activateShow.toggle()
       })
    NavigationLink(destination: AlternatView(viewModel: AlternatViewModel(groups: Groups),
                                          showIsActive: $initialViewModel.activateShow),
                                              isActive: $initialViewModel.activateShow) { }
}
</code>```

Body:
I have one navigationLink in the view but for the very first time its not clickable, but when i copy pasted same code below that the second navigationLink is working properly, I am not sure what is the issue with the first navigation (for the first time) only

if let groups = initialViewModel.groupsResponse {
// not clickable for first time
    ABCBanner(bannerType: .info,
              bannerBody: "title",
               bannerCTA: "title",
       bannerCTACallback: {
           initialViewModel.activateShow.toggle()
       })
    NavigationLink(destination: AlternatView(viewModel: AlternatViewModel(groups: Groups),
                                          showIsActive: $initialViewModel.activateShow),
                                              isActive: $initialViewModel.activateShow) { }

//clickable for first time
    ABCBanner(bannerType: .info,
              bannerBody: "title",
               bannerCTA: "title",
       bannerCTACallback: {
            initialViewModel.activateShow.toggle()
       })
    NavigationLink(destination: AlternatView(viewModel: AlternatViewModel(groups: Groups),
                                          showIsActive: $initialViewModel.activateShow),
                                              isActive: $initialViewModel.activateShow) { }
}


问:
Why is dotenv config method returning my system environmental variables?
I am trying to import strings from my .env file located in the root directory of my project into my index.js file. The dotenv config method is importing in all my system environmental variables instead.

Here is the structure of the project folder.

```<code>myapp/
  .env
  package.json
  src/
     index.js
     commands/
</code>```

I tried running my app out of different directories in the project folder thinking that config was using the cwd to check for the .env file. But neither worked. I have also tried setting the config() argument to "../index.env" because it is the path relative to index.js.

```<code>import { config } from "dotenv";

config();

const TOKEN = process.env.DISCORD_TOKEN;
</code>```

Resulted in bringing in all the env variables like "PATH", "SHELL" etc

Body:
I am trying to import strings from my .env file located in the root directory of my project into my index.js file. The dotenv config method is importing in all my system environmental variables instead.

Here is the structure of the project folder.

myapp/
  .env
  package.json
  src/
     index.js
     commands/

I tried running my app out of different directories in the project folder thinking that config was using the cwd to check for the .env file. But neither worked. I have also tried setting the config() argument to "../index.env" because it is the path relative to index.js.

import { config } from "dotenv";

config();

const TOKEN = process.env.DISCORD_TOKEN;

Resulted in bringing in all the env variables like "PATH", "SHELL" etc


问:
How do I create a refresh token outside of Auth (bearer, basic, digest)?
I'm having trouble creating a refresh token in Kotlin Multiplatform, because the token I'm using is out of basic, bearer, and digest. Example code :

```<code>defaultRequest {
    url {
        protocol = URLProtocol.HTTPS
        // Base URL
        host = urlHost

        headers {
            append(HttpHeaders.ContentType, "application/json")
            if (preferences.token.isNotEmpty()) {
                append("token", "static")
            } else {
                append("token", preferences.token)
            }
        }
    }
}
</code>```

How do I update the token if an error code 401 occurs?

Body:
I'm having trouble creating a refresh token in Kotlin Multiplatform, because the token I'm using is out of basic, bearer, and digest. Example code :

defaultRequest {
    url {
        protocol = URLProtocol.HTTPS
        // Base URL
        host = urlHost

        headers {
            append(HttpHeaders.ContentType, "application/json")
            if (preferences.token.isNotEmpty()) {
                append("token", "static")
            } else {
                append("token", preferences.token)
            }
        }
    }
}

How do I update the token if an error code 401 occurs?


问:
Split items per columns in WPF/XAML
I have a list of items and 3 columns, and i want to split them one by one per column to make it ordered horizontally, basically like a food menu.

This is my ProductView.xml

```<code><Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition></ColumnDefinition>
    <ColumnDefinition></ColumnDefinition>
    <ColumnDefinition></ColumnDefinition>
  </Grid.ColumnDefinitions>

  <ListView ItemsSource="{Binding Products}"
            Background="Transparent"
            Foreground="White"
            FontFamily="/Fonts/#Poppins"
            BorderThickness="0">
    <ListView.Resources>
      <DataTemplate DataType="{x:Type models:Product}">
        <Grid>
          <StackPanel Margin="4">
            <TextBlock Text="{Binding Id, StringFormat={}Id: {0}}"/>
            <TextBlock Text="{Binding Name, StringFormat={}Name: {0}}"/>
            <TextBlock Text="{Binding Description, StringFormat={}Description: {0}}"/>
            <TextBlock Text="{Binding Category, StringFormat={}Category: {0}}"/>
            <TextBlock Text="{Binding Price, StringFormat={}Price: {0}$}"/>
          </StackPanel>
        </Grid>
      </DataTemplate>
    </ListView.Resources>
  </ListView>
</Grid>
</code>```

This is my Product.cs, where i make the list

```<code>public class Product
{
  public int Id { get; set; }
  public string Name { get; set; }
  public string Description { get; set; }
  public string Category { get; set; }
  public decimal Price { get; set; }
}
</code>```

And this is where i manually add items to the list, file is ProductViewModel.cs

```<code>public class ProductViewModel : ObservableObject
{
  public List<Product> Products { get; set; }

    public ProductViewModel()
    {
    Products = new();

    for (int i = 1; i <= 15; i++)
    {
      Products.Add(new()
      {
        Id = i,
        Name = $"Name {i}",
        Description = $"Description {i}",
        Category = $"Category {i}",
        Price = i * 10
      });
    }
  }
}
</code>```

What i would like is:

```<code>| item 1 | item 2 | item 3 |

| item 4 | item 5 | item 6 |
</code>```

How can i split this into my three columns and act as a single scrollable list?

Title: Split items per columns in WPF/XAML

Body:
I have a list of items and 3 columns, and i want to split them one by one per column to make it ordered horizontally, basically like a food menu.

This is my ProductView.xml

<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition></ColumnDefinition>
    <ColumnDefinition></ColumnDefinition>
    <ColumnDefinition></ColumnDefinition>
  </Grid.ColumnDefinitions>

  <ListView ItemsSource="{Binding Products}"
            Background="Transparent"
            Foreground="White"
            FontFamily="/Fonts/#Poppins"
            BorderThickness="0">
    <ListView.Resources>
      <DataTemplate DataType="{x:Type models:Product}">
        <Grid>
          <StackPanel Margin="4">
            <TextBlock Text="{Binding Id, StringFormat={}Id: {0}}"/>
            <TextBlock Text="{Binding Name, StringFormat={}Name: {0}}"/>
            <TextBlock Text="{Binding Description, StringFormat={}Description: {0}}"/>
            <TextBlock Text="{Binding Category, StringFormat={}Category: {0}}"/>
            <TextBlock Text="{Binding Price, StringFormat={}Price: {0}$}"/>
          </StackPanel>
        </Grid>
      </DataTemplate>
    </ListView.Resources>
  </ListView>
</Grid>

This is my Product.cs, where i make the list

public class Product
{
  public int Id { get; set; }
  public string Name { get; set; }
  public string Description { get; set; }
  public string Category { get; set; }
  public decimal Price { get; set; }
}

And this is where i manually add items to the list, file is ProductViewModel.cs

public class ProductViewModel : ObservableObject
{
  public List<Product> Products { get; set; }

    public ProductViewModel()
    {
    Products = new();

    for (int i = 1; i <= 15; i++)
    {
      Products.Add(new()
      {
        Id = i,
        Name = $"Name {i}",
        Description = $"Description {i}",
        Category = $"Category {i}",
        Price = i * 10
      });
    }
  }
}

What i would like is:

| item 1 | item 2 | item 3 |

| item 4 | item 5 | item 6 |

How can i split this into my three columns and act as a single scrollable list?


问:
How send tmp file in response?
I wonder how can I send temp file in Laravel or with php funciotn.
I know that tmp file exist to the end of script or to its close time.

I'm crating tmp file with this function tmpfile();

I tried to send tmp file with

```<code>$headers = [
   'Content-Type' => 'application/pdf',
];

return response()->download($tmpfile, 'tmp_name.pdf', $headers);
</code>```

But I got error The file \"Resource id #968\" does not exist

What I miss misunderstand or what I'm doing wrong? Should I first get file content for example by File::get($tmppath) and then return in response file content?

Title: How send tmp file in response?

Body:
I wonder how can I send temp file in Laravel or with php funciotn.
I know that tmp file exist to the end of script or to its close time.

I'm crating tmp file with this function tmpfile();

I tried to send tmp file with

$headers = [
   'Content-Type' => 'application/pdf',
];

return response()->download($tmpfile, 'tmp_name.pdf', $headers);

But I got error The file \"Resource id #968\" does not exist

What I miss misunderstand or what I'm doing wrong? Should I first get file content for example by File::get($tmppath) and then return in response file content?


问:
The command '/bin/sh -c wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' returned a non-zero code: 4
I'm trying to install chrome driver on docker container. Its gives me an error saying "The command '/bin/sh -c wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' returned a non-zero code: 4"

First Try :

```<code>RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install ./google-chrome-stable_current_amd64.deb
</code>```

Second try :

```<code>RUN apt-get install -y wget
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get -y install google-chrome-stable
</code>```

Third try :

```<code>RUN apt update \
    && apt-get install -y default-jre \
    && curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb \
    && apt-get update \
    && dpkg -i /chrome.deb \
</code>```

Body:
I'm trying to install chrome driver on docker container. Its gives me an error saying "The command '/bin/sh -c wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' returned a non-zero code: 4"

First Try :

RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install ./google-chrome-stable_current_amd64.deb

Second try :

RUN apt-get install -y wget
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get -y install google-chrome-stable

Third try :

RUN apt update \
    && apt-get install -y default-jre \
    && curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb \
    && apt-get update \
    && dpkg -i /chrome.deb \


问:
airflow logs: how to view them live in the server directly
I am using airflow and running a dag

In have following in airflow.cfg

```<code>[core]
# The folder where your airflow pipelines live, most likely a
# subfolder in a code repository. This path must be absolute.
dags_folder = /usr/local/airflow/dags

# The folder where airflow should store its log files
# This path must be absolute
base_log_folder = /usr/local/airflow/logs
</code>```

I have a long running task in airflow.

Its very difficuly to use web interface to check the logs of such size.

Instead i want to check on the airflow server directly

But i dont see a log file is created till the task fails or completely succeeded

In between the task i cant see any 1.log file created in the local server at the path mentioned in cfg

So on the server if i have access, how to check the logs of the airflow task live

Body:
I am using airflow and running a dag

In have following in airflow.cfg

[core]
# The folder where your airflow pipelines live, most likely a
# subfolder in a code repository. This path must be absolute.
dags_folder = /usr/local/airflow/dags

# The folder where airflow should store its log files
# This path must be absolute
base_log_folder = /usr/local/airflow/logs

I have a long running task in airflow.

Its very difficuly to use web interface to check the logs of such size.

Instead i want to check on the airflow server directly

But i dont see a log file is created till the task fails or completely succeeded

In between the task i cant see any 1.log file created in the local server at the path mentioned in cfg

So on the server if i have access, how to check the logs of the airflow task live


问:
how do i use access data to write an word document?
I want to write a basic examination report on word, and than using access form complete the "fields",
for example:

the student X was doing Y during the last year.
he had difficulties at: A
and done good job at: B

than ill have a table of students in access, with name, overall observation, goos and bads.
the name has to replace the X in the word letter, the overall will replace the Y and etc.

i found some blog that explains how to  do this using word bookmarks, but for some reason, the code isn't working...

thats the code i tired (just for the name, i didn't put yet all the info,

```<code>Dim AddyLineVar As String

AddyLineVar = [FirstName] + " " + [LastName]

Set wrd = CreateObject("Word.application")

Dim mergedoc As String

mergedoc = Application.CurrentProject.Path
mergedoc = mergedoc + "\wow.dotx"

wrd.Documents.Add mergedoc
wrd.Visible = True
wrd.activedocument.Bookmark
wrd.Item("FIRSTNAME").range.Text = AddyLineVar
wrd.activedocument.PrintOut
wrd.activedocument.Close wddonotsavechanges
wrd.Quit

</code>```

Body:
I want to write a basic examination report on word, and than using access form complete the "fields",
for example:

the student X was doing Y during the last year.
he had difficulties at: A
and done good job at: B

than ill have a table of students in access, with name, overall observation, goos and bads.
the name has to replace the X in the word letter, the overall will replace the Y and etc.

i found some blog that explains how to  do this using word bookmarks, but for some reason, the code isn't working...

thats the code i tired (just for the name, i didn't put yet all the info,

Dim AddyLineVar As String

AddyLineVar = [FirstName] + " " + [LastName]

Set wrd = CreateObject("Word.application")

Dim mergedoc As String

mergedoc = Application.CurrentProject.Path
mergedoc = mergedoc + "\wow.dotx"

wrd.Documents.Add mergedoc
wrd.Visible = True
wrd.activedocument.Bookmark
wrd.Item("FIRSTNAME").range.Text = AddyLineVar
wrd.activedocument.PrintOut
wrd.activedocument.Close wddonotsavechanges
wrd.Quit


问:
This release includes permissions that haven't been declared in Play Console. Go to Sensitive app permissions to update your permission declarations
My react native app is being rejected in the google play store for the reason that it requests background location of which my app does not request for user location weather foreground or background. And i can't find location access declaration in my app even after i ran expo eject no location permission declared in my manifest.xml.

How can i tell google that my app does not request user location.


问:
Which configuration to use to connect to kafka cluster using Kafka.js
I am not being able to connect to Kafka using kafka.js. I am thinking that I am using the wrong kafka.js configuration.

Following are the items that are given to me :-

Host: kafka-xxx-xx.cloudclusters.net
Port: xxxxx
IP: xx.xx.xxx.xxx
Security Type: SCRAM-SHA-256
Trustore: kafka.truststore.jks (attached)
Trustore PW: xxxxx
Keystore: kafka.keystore.jks (attached)
Keystore PW: xxx
```
<p>I am using the SSL configuration here :-</p>
<pre class="lang-js prettyprint-override"><code>import { Kafka } from 'kafkajs';
import { Partitioners } from 'kafkajs';
import jks from 'jks-js';

const keystore = jks.toPem(fs.readFileSync('./kafka.keystore.jks'), 'my-password');

const trustore = jks.toPem(
  fs.readFileSync('./kafka.truststore.jks'),
  'my-password'
);

const {
  // caroot: { ca },
  localhost: { key, cert },
} = keystore;

const {
  caroot: { ca },
} = trustore;

// setting up kafka
const kafka = new Kafka({
  clientId: 'qa-topic',
  brokers: ['kafka-xxx-xx.cloudclusters.net:${port}'],

  ssl: {
    rejectUnauthorized: false,
    ca: ca,
    key: key,
    cert: cert,
    host: 'kafka-xxx-xx.cloudclusters.net',
  },
});

const producer = kafka.producer({
  createPartitioner: Partitioners.LegacyPartitioner,
});

await producer.connect().catch((e) => {
  console.log('ERROR happened ==>', e);
});

</code>```

At the moment, I am getting the following error :-

cause: KafkaJSConnectionError: Connection timeout
      at Timeout.onTimeout [as _onTimeout] (/home/abdullah/web-socket-tradehat/node_modules/kafkajs/src/network/connection.js:223:23)
      at listOnTimeout (internal/timers.js:557:17)
      at processTimers (internal/timers.js:500:7) {
    retriable: true,
    helpUrl: undefined,
    cause: undefined,
    broker: 'kafka-xxx-xx.cloudclusters.net:${port}',
    code: undefined
  },
```

Body:
I am not being able to connect to Kafka using kafka.js. I am thinking that I am using the wrong kafka.js configuration.

Following are the items that are given to me :-

Host: kafka-xxx-xx.cloudclusters.net
Port: xxxxx
IP: xx.xx.xxx.xxx
Security Type: SCRAM-SHA-256
Trustore: kafka.truststore.jks (attached)
Trustore PW: xxxxx
Keystore: kafka.keystore.jks (attached)
Keystore PW: xxx

I am using the SSL configuration here :-

import { Kafka } from 'kafkajs';
import { Partitioners } from 'kafkajs';
import jks from 'jks-js';

const keystore = jks.toPem(fs.readFileSync('./kafka.keystore.jks'), 'my-password');

const trustore = jks.toPem(
  fs.readFileSync('./kafka.truststore.jks'),
  'my-password'
);

const {
  // caroot: { ca },
  localhost: { key, cert },
} = keystore;

const {
  caroot: { ca },
} = trustore;

// setting up kafka
const kafka = new Kafka({
  clientId: 'qa-topic',
  brokers: ['kafka-xxx-xx.cloudclusters.net:${port}'],

  ssl: {
    rejectUnauthorized: false,
    ca: ca,
    key: key,
    cert: cert,
    host: 'kafka-xxx-xx.cloudclusters.net',
  },
});

const producer = kafka.producer({
  createPartitioner: Partitioners.LegacyPartitioner,
});

await producer.connect().catch((e) => {
  console.log('ERROR happened ==>', e);
});

At the moment, I am getting the following error :-

cause: KafkaJSConnectionError: Connection timeout
      at Timeout.onTimeout [as _onTimeout] (/home/abdullah/web-socket-tradehat/node_modules/kafkajs/src/network/connection.js:223:23)
      at listOnTimeout (internal/timers.js:557:17)
      at processTimers (internal/timers.js:500:7) {
    retriable: true,
    helpUrl: undefined,
    cause: undefined,
    broker: 'kafka-xxx-xx.cloudclusters.net:${port}',
    code: undefined
  },