问:
OSError: libopenslide.so.0: cannot open shared object file: No such file or directory
I am struggling to resolve an error I'm facing while importing openslide, and while I understand the meaning of the error broadly, I am still not sure how to resolve it.
This is the traceback of the error:

```<code>Python 3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openslide
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/site-packages/openslide/__init__.py", line 30, in <module>
    from openslide import lowlevel
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/site-packages/openslide/lowlevel.py", line 84, in <module>
    _lib = cdll.LoadLibrary('libopenslide.so.0')
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary
    return self._dlltype(name)
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libopenslide.so.0: cannot open shared object file: No such file or directory
</code>```

Here's the remote server details:

```<code>$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
</code>```

Since I'm on a remote server, I do not have the permission to run sudo ldconfig -v to diagnose the issue, unlike what most solutions on the internet recommend.

I checked, openslide is already installed in my conda environment.

```<code>$ conda list openslide
# packages in environment at xxx/anaconda3/envs/env_name:
#
# Name                    Version                   Build  Channel
openslide-python          1.2.0                    pypi_0    pypi
</code>```

I also tried:

Reinstalling the package

Downloading into pseudo root directory and then installing package as mentioned here
but doesn't help. Any guidance will be much appreciated, thanks.

Body:
I am struggling to resolve an error I'm facing while importing openslide, and while I understand the meaning of the error broadly, I am still not sure how to resolve it.
This is the traceback of the error:

Python 3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openslide
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/site-packages/openslide/__init__.py", line 30, in <module>
    from openslide import lowlevel
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/site-packages/openslide/lowlevel.py", line 84, in <module>
    _lib = cdll.LoadLibrary('libopenslide.so.0')
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary
    return self._dlltype(name)
  File "/h/329/keerat/anaconda3/envs/clam/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libopenslide.so.0: cannot open shared object file: No such file or directory

Here's the remote server details:

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Since I'm on a remote server, I do not have the permission to run sudo ldconfig -v to diagnose the issue, unlike what most solutions on the internet recommend.

I checked, openslide is already installed in my conda environment.

$ conda list openslide
# packages in environment at xxx/anaconda3/envs/env_name:
#
# Name                    Version                   Build  Channel
openslide-python          1.2.0                    pypi_0    pypi

I also tried:

Reinstalling the package

Downloading into pseudo root directory and then installing package as mentioned here
but doesn't help. Any guidance will be much appreciated, thanks.


来源: stackexchange

问:
Need to change my code from class component to functional Component
I want to change my code from class component to functional Component ,class component code is listing below,</p>
```<code>  import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { DocumentEditorComponent, Editor } from '@syncfusion/ej2-react-documenteditor';
DocumentEditorComponent.Inject(Editor);
export class Default extends React.Component {
    created() {
        // load your default document here
        let data = `{"sections":[{"sectionFormat":{"pageWidth":612,"pageHeight":792,"leftMargin":72,"rightMargin":72,"topMargin":72,"bottomMargin":72,"differentFirstPage":false,"differentOddAndEvenPages":false,"headerDistance":36,"footerDistance":36,"bidi":false},"blocks":[{"paragraphFormat":{"afterSpacing":30,"styleName":"Heading 1","listFormat":{}},"characterFormat":{},"inlines":[{"characterFormat":{},"text":"Adventure Works Cycles"}]}],"headersFooters":{"header":{"blocks":[{"paragraphFormat":{"listFormat":{}},"characterFormat":{},"inlines":[]}]},"footer":{"blocks":[{"paragraphFormat":{"listFormat":{}},"characterFormat":{},"inlines":[]}]}}}],"characterFormat":{"bold":false,"italic":false,"fontSize":11,"fontFamily":"Calibri","underline":"None","strikethrough":"None","baselineAlignment":"Normal","highlightColor":"NoColor","fontColor":"empty","fontSizeBidi":11,"fontFamilyBidi":"Calibri","allCaps":false},"paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":0,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","listFormat":{},"bidi":false},"defaultTabWidth":36,"trackChanges":false,"enforcement":false,"hashValue":"","saltValue":"","formatting":false,"protectionType":"NoProtection","dontUseHTMLParagraphAutoSpacing":false,"formFieldShading":true,"styles":[{"name":"Normal","type":"Paragraph","paragraphFormat":{"lineSpacing":1.149999976158142,"lineSpacingType":"Multiple","listFormat":{}},"characterFormat":{"fontFamily":"Calibri"},"next":"Normal"},{"name":"Default Paragraph Font","type":"Character","characterFormat":{}},{"name":"Heading 1 Char","type":"Character","characterFormat":{"fontSize":16,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 1","type":"Paragraph","paragraphFormat":{"beforeSpacing":12,"afterSpacing":0,"outlineLevel":"Level1","listFormat":{}},"characterFormat":{"fontSize":16,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 1 Char","next":"Normal"},{"name":"Heading 2 Char","type":"Character","characterFormat":{"fontSize":13,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 2","type":"Paragraph","paragraphFormat":{"beforeSpacing":2,"afterSpacing":6,"outlineLevel":"Level2","listFormat":{}},"characterFormat":{"fontSize":13,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 2 Char","next":"Normal"},{"name":"Heading 3","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level3","listFormat":{}},"characterFormat":{"fontSize":12,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Normal","link":"Heading 3 Char","next":"Normal"},{"name":"Heading 3 Char","type":"Character","characterFormat":{"fontSize":12,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Default Paragraph Font"},{"name":"Heading 4","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level4","listFormat":{}},"characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 4 Char","next":"Normal"},{"name":"Heading 4 Char","type":"Character","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 5","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level5","listFormat":{}},"characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 5 Char","next":"Normal"},{"name":"Heading 5 Char","type":"Character","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 6","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level6","listFormat":{}},"characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Normal","link":"Heading 6 Char","next":"Normal"},{"name":"Heading 6 Char","type":"Character","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Default Paragraph Font"}],"lists":[],"abstractLists":[],"comments":[],"revisions":[],"customXml":[]}`;
        // Open the default document
        this.documentEditor.open(data);
    }
    componentDidMount() {
        setTimeout(() => {
            this.created();
        });
    }
    render() {
        return (<DocumentEditorComponent id="container" height={'590px'} ref={(scope) => {
            this.documentEditor = scope;
            this.created.bind(this);
        }} serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/documenteditor/" enableToolbar={true}/>);
    }
}
ReactDOM.render(<Default />, document.getElementById('sample'));
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I want to change my code from class component to functional Component ,class component code is listing below,

  import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { DocumentEditorComponent, Editor } from '@syncfusion/ej2-react-documenteditor';
DocumentEditorComponent.Inject(Editor);
export class Default extends React.Component {
    created() {
        // load your default document here
        let data = `{"sections":[{"sectionFormat":{"pageWidth":612,"pageHeight":792,"leftMargin":72,"rightMargin":72,"topMargin":72,"bottomMargin":72,"differentFirstPage":false,"differentOddAndEvenPages":false,"headerDistance":36,"footerDistance":36,"bidi":false},"blocks":[{"paragraphFormat":{"afterSpacing":30,"styleName":"Heading 1","listFormat":{}},"characterFormat":{},"inlines":[{"characterFormat":{},"text":"Adventure Works Cycles"}]}],"headersFooters":{"header":{"blocks":[{"paragraphFormat":{"listFormat":{}},"characterFormat":{},"inlines":[]}]},"footer":{"blocks":[{"paragraphFormat":{"listFormat":{}},"characterFormat":{},"inlines":[]}]}}}],"characterFormat":{"bold":false,"italic":false,"fontSize":11,"fontFamily":"Calibri","underline":"None","strikethrough":"None","baselineAlignment":"Normal","highlightColor":"NoColor","fontColor":"empty","fontSizeBidi":11,"fontFamilyBidi":"Calibri","allCaps":false},"paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":0,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","listFormat":{},"bidi":false},"defaultTabWidth":36,"trackChanges":false,"enforcement":false,"hashValue":"","saltValue":"","formatting":false,"protectionType":"NoProtection","dontUseHTMLParagraphAutoSpacing":false,"formFieldShading":true,"styles":[{"name":"Normal","type":"Paragraph","paragraphFormat":{"lineSpacing":1.149999976158142,"lineSpacingType":"Multiple","listFormat":{}},"characterFormat":{"fontFamily":"Calibri"},"next":"Normal"},{"name":"Default Paragraph Font","type":"Character","characterFormat":{}},{"name":"Heading 1 Char","type":"Character","characterFormat":{"fontSize":16,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 1","type":"Paragraph","paragraphFormat":{"beforeSpacing":12,"afterSpacing":0,"outlineLevel":"Level1","listFormat":{}},"characterFormat":{"fontSize":16,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 1 Char","next":"Normal"},{"name":"Heading 2 Char","type":"Character","characterFormat":{"fontSize":13,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 2","type":"Paragraph","paragraphFormat":{"beforeSpacing":2,"afterSpacing":6,"outlineLevel":"Level2","listFormat":{}},"characterFormat":{"fontSize":13,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 2 Char","next":"Normal"},{"name":"Heading 3","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level3","listFormat":{}},"characterFormat":{"fontSize":12,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Normal","link":"Heading 3 Char","next":"Normal"},{"name":"Heading 3 Char","type":"Character","characterFormat":{"fontSize":12,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Default Paragraph Font"},{"name":"Heading 4","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level4","listFormat":{}},"characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 4 Char","next":"Normal"},{"name":"Heading 4 Char","type":"Character","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 5","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level5","listFormat":{}},"characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Normal","link":"Heading 5 Char","next":"Normal"},{"name":"Heading 5 Char","type":"Character","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"},"basedOn":"Default Paragraph Font"},{"name":"Heading 6","type":"Paragraph","paragraphFormat":{"leftIndent":0,"rightIndent":0,"firstLineIndent":0,"textAlignment":"Left","beforeSpacing":2,"afterSpacing":0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","outlineLevel":"Level6","listFormat":{}},"characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Normal","link":"Heading 6 Char","next":"Normal"},{"name":"Heading 6 Char","type":"Character","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"},"basedOn":"Default Paragraph Font"}],"lists":[],"abstractLists":[],"comments":[],"revisions":[],"customXml":[]}`;
        // Open the default document
        this.documentEditor.open(data);
    }
    componentDidMount() {
        setTimeout(() => {
            this.created();
        });
    }
    render() {
        return (<DocumentEditorComponent id="container" height={'590px'} ref={(scope) => {
            this.documentEditor = scope;
            this.created.bind(this);
        }} serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/documenteditor/" enableToolbar={true}/>);
    }
}
ReactDOM.render(<Default />, document.getElementById('sample'));


问:
how to implement drag and drop in event calendar in angular 14 using cdk?
I want to apply drag-and-drop  to the calendar using Angular CDK I tried the following methods:

AppComponent.html

```<code><div style="height: 100%; width: 100%;border: 1px solid gray;" cdkDropListGroup >

    <ngx-event-calendar
    [showAddButton]="true"
    [language]="'en'"
    [dataSource]="dataArray"
    (dayEvents)="selectDay($event)"
    (newEvent)="addEvent($event)"
    cdkDrag
    cdkDragHandle
   >
    </ngx-event-calendar >
</div>
</code>```

AppComponent.ts

```<code>export class AppComponent {
  title = 'calendar';
  language: string = 'en';
  newEvent = {} as IEventData;
  dataArray;

  constructor(public dialog: MatDialog) {
    const testData: IEventData[] = [ ];
    this.dataArray=testData;
    this.newEvent.id=13;
    this.newEvent.title='Title';
    this.newEvent.desc='Description';
    this.newEvent.startDate= new Date("2022-12-22T21:00:00");
    this.newEvent.endDate= new Date("2022-12-22T21:00:00");
    this.newEvent.createdBy='Mark';
    this.newEvent.createdAt=new Date("2022-12-22T10:00:00");
    this.newEvent.type=2;
    this.newEvent.color='red';
    testData.push(this.newEvent);
   }

  addEvent(event) {

  }

  selectDay(event) {

    if (event.events) {
      const dialogRef = this.dialog.open(AddEventDialogComponent, {
        width: '80%',
        height: '90%',
        data: event
      });
    }
  }
</code>```

the Image

I want to Implement drag and drop, when the user selects an event it can be drag and drop to the calendar my code doest not work can any one help me??
thanks

Body:
I want to apply drag-and-drop  to the calendar using Angular CDK I tried the following methods:

AppComponent.html

    <ngx-event-calendar
    [showAddButton]="true"
    [language]="'en'"
    [dataSource]="dataArray"
    (dayEvents)="selectDay($event)"
    (newEvent)="addEvent($event)"
    cdkDrag
    cdkDragHandle
   >
    </ngx-event-calendar >

AppComponent.ts

export class AppComponent {
  title = 'calendar';
  language: string = 'en';
  newEvent = {} as IEventData;
  dataArray;

  constructor(public dialog: MatDialog) {
    const testData: IEventData[] = [ ];
    this.dataArray=testData;
    this.newEvent.id=13;
    this.newEvent.title='Title';
    this.newEvent.desc='Description';
    this.newEvent.startDate= new Date("2022-12-22T21:00:00");
    this.newEvent.endDate= new Date("2022-12-22T21:00:00");
    this.newEvent.createdBy='Mark';
    this.newEvent.createdAt=new Date("2022-12-22T10:00:00");
    this.newEvent.type=2;
    this.newEvent.color='red';
    testData.push(this.newEvent);
   }

  addEvent(event) {

  }

  selectDay(event) {

    if (event.events) {
      const dialogRef = this.dialog.open(AddEventDialogComponent, {
        width: '80%',
        height: '90%',
        data: event
      });
    }
  }

the Image

I want to Implement drag and drop, when the user selects an event it can be drag and drop to the calendar my code doest not work can any one help me??
thanks


问:
Creating the cloning of forms in wordpress settings page Wordpress Plugin Development
I want to Add new form below the existing form in my wordpress plugin settings page by adding the Add more form and remove button what should i do

i tried the on click funciton but did not get event the first alert of testing done

```<code> $(document).ready(function(){
  $("#addmorebtn").click(function(){
    alert("testing done");

  $(".multipleforms .single-form:last-child").clone().appendTo(".multipleforms");
  });
  $(document).on('click','btn-remove',function(){

  if($(".multipleforms .single-form").length > 1)
  {
    $(this).parents(".single-form").remove();
  }

  });

  });
</code>```

Body:
I want to Add new form below the existing form in my wordpress plugin settings page by adding the Add more form and remove button what should i do

i tried the on click funciton but did not get event the first alert of testing done

 $(document).ready(function(){
  $("#addmorebtn").click(function(){
    alert("testing done");

  $(".multipleforms .single-form:last-child").clone().appendTo(".multipleforms");
  });
  $(document).on('click','btn-remove',function(){

  if($(".multipleforms .single-form").length > 1)
  {
    $(this).parents(".single-form").remove();
  }

  });

  });


问:
NPM removes entry point from package.json installed module
I have a private package published which contains a main entry point in package.json.

But when i install it, that main entry does not exists in node_modules/package/package.json resulting in a "Module not found" error.

If i download the archive from the _resolved entry, i do have the main entry defined in package.json, but for some reason, on npm install it gets removed.

Node version: 6.71.1
NPM version: 3.10.10

I cannot upgrade node or npm, its a legacy project and no changes are allowed.


问:
Onchange function not working properly in Reactjs
I am working on reactjs and i am using nextjs framework, Right now i am working on "update module"(blog update) using "QuillNoSSRWrapper editor" so right now i am showing user value with "value" tag (value={value}) but then i am unable to type/change anything in editor (something wrong with onchange), How can i fix this ? Here is my current code</p>
```<code>const [value, setValue] = useState('');
<QuillNoSSRWrapper modules={modules} onChange={setValue} theme="snow" value={value} />
</code>```

Body:
I am working on reactjs and i am using nextjs framework, Right now i am working on "update module"(blog update) using "QuillNoSSRWrapper editor" so right now i am showing user value with "value" tag (value={value}) but then i am unable to type/change anything in editor (something wrong with onchange), How can i fix this ? Here is my current code

const [value, setValue] = useState('');
<QuillNoSSRWrapper modules={modules} onChange={setValue} theme="snow" value={value} />


问:
I want to publish a private app on google playstore that can be searched but users can't download it unless they have an invite or code
I want to publish a private/ invitation only app in google playstore that can be searched but users can only see it. To download the app, users would either needs to get an invite, or send an invite request, or enter a code [anything like that].

Is there a possiblity for the same? Also, what are the challenges and restrictions?

I researched about private apps and EMM api but not getting anything solid. Just wondering if some expert can help me.


问:
nginx transparent reverse proxy keepalive Error
Creating nginx transparent proxy. As a result of checking the curl, it is successful.
However, http keep-alive does not works normally.

```<code>client ---> nginx ----> Server (GET)
client <--- nginx <---- Server (200 OK)
client ---> nginx ----> Server (GET failed)
</code>```

nginx log
failed (98: Address already in use) while connecting to upstream

nginx.conf file

```<code>upstream proxy {
    server proxy;
}

server {
    listen 80;
    proxy_bind $remote_addr:$remote_port transparent;
    server_name myhomepage.com;
    location / {
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_pass http://proxy;
    }

}
</code>```

$remote_port must be included.

https://www.nginx.com/blog/ip-transparency-direct-server-return-nginx-plus-transparent-proxy/

I think this problem occurs because it is managed by pool when connecting to nginx server.

Body:
Creating nginx transparent proxy. As a result of checking the curl, it is successful.
However, http keep-alive does not works normally.

client ---> nginx ----> Server (GET)
client <--- nginx <---- Server (200 OK)
client ---> nginx ----> Server (GET failed)

nginx log
failed (98: Address already in use) while connecting to upstream

nginx.conf file

upstream proxy {
    server proxy;
}

server {
    listen 80;
    proxy_bind $remote_addr:$remote_port transparent;
    server_name myhomepage.com;
    location / {
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_pass http://proxy;
    }

}

$remote_port must be included.

https://www.nginx.com/blog/ip-transparency-direct-server-return-nginx-plus-transparent-proxy/

I think this problem occurs because it is managed by pool when connecting to nginx server.


问:
Helm Charts on OCP Developer Catalog using red hat repository Issues with check: images-are-certified
As a part of red hat certification, we need to run the verifier tool, we have added the correct configuration but still verifier tool is still failing with the error

Error:

```<code>check: v1.0/images-are-certified
      type: Mandatory
      outcome: FAIL
      reason: 'Failed to certify images: Failed to get images, error running helm template: chart requires kubeVersion: >=1.21.0 which is incompatible with Kubernetes v1.20.0'
</code>```

Note: we have configured kubeVersion >=1.21.0 in Chart.YAML

Body:
As a part of red hat certification, we need to run the verifier tool, we have added the correct configuration but still verifier tool is still failing with the error

Error:

check: v1.0/images-are-certified
      type: Mandatory
      outcome: FAIL
      reason: 'Failed to certify images: Failed to get images, error running helm template: chart requires kubeVersion: >=1.21.0 which is incompatible with Kubernetes v1.20.0'

Note: we have configured kubeVersion >=1.21.0 in Chart.YAML


问:
incorrect header check , zlibOnError on Axios
I am trying to convert my project from reactjs to nextjs, While converting the backend was stable as it is on earlier, I have to change the frontend functions only. But I am getting an invalid header error while accessing the API.

If am removing the response header "compress" on the backend API I will get the response.

```<code> Header set in server:

    app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Max-Age", 86400);
    res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
    res.header("content-encoding", "compress");

    next();
});```
 [![Error][1]][1]

```
<p>API call:</p>
```return axios({
    method: "post",
    url: `${baseURL}/homebanner`,
    data: bodyFormData,
    headers: { "Content-Type": "multipart/form-data" },
  });
```
```
https://i.stack.imgur.com/SUGiW.png

```

Body:
I am trying to convert my project from reactjs to nextjs, While converting the backend was stable as it is on earlier, I have to change the frontend functions only. But I am getting an invalid header error while accessing the API.

If am removing the response header "compress" on the backend API I will get the response.

 Header set in server:

    app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Max-Age", 86400);
    res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
    res.header("content-encoding", "compress");

    next();
});```
 [![Error][1]][1]

API call:

return axios({
    method: "post",
    url: `${baseURL}/homebanner`,
    data: bodyFormData,
    headers: { "Content-Type": "multipart/form-data" },
  });

https://i.stack.imgur.com/SUGiW.png


问:
dose cross-validation alter any parameter or hyperparameters in the algorithm or just give an average scoring?
my question is related to my original wanting to train 70% of my data with only the cross-validation k-fold method, then use a "modified model" to test/predict the last 30%. I read some of the documentation, and I just want to check if cross-validation is only a scoring function with no power of altering parameters, and for it to get any altering ability it has to be paired with hyperparameter tuning.</p>


问:
Only one marker is added to the map in Flutter despite multiple documents satisfying the if condition
```<code>Future<void> readDataFromFirebase() async {
FirebaseFirestore firestore = FirebaseFirestore.instance;
CollectionReference<Map<String, dynamic>> collectionReference2 =
    await firestore.collection('stations');
collectionReference2
    .where('norequest', isGreaterThanOrEqualTo: 10)
    .snapshots()
    .listen((event) {
  List<DocumentSnapshot> snapshots = event.docs;

  for (var map in snapshots) {
    Map<String, dynamic> data = map.data() as Map<String, dynamic>;

    if (data['norequest'] % 10 == 0) {
      String nameDocument = map.id;
      listDocuments.add(nameDocument);
      list.add(
        Marker(
          markerId: MarkerId(nameDocument),
          position: LatLng(data['coor'].latitude, data['coor'].longitude),
        ),
      );
    } else {
      print('nooooooooooooooooooooooooooooooooooooooooooooooo');
    }
  }
});
  }
</code>```

In this function, an if condition checks if the value of the norequest field in a document is greater than or equal to 10 and is divisible by 10. If this condition is satisfied, the code adds a marker to the map and adds the document's ID to a list of documents. However, it seems that only one marker is being added to the map, even though there are supposed to be more documents that satisfy the if condition.

Body:
Future<void> readDataFromFirebase() async {
FirebaseFirestore firestore = FirebaseFirestore.instance;
CollectionReference<Map<String, dynamic>> collectionReference2 =
    await firestore.collection('stations');
collectionReference2
    .where('norequest', isGreaterThanOrEqualTo: 10)
    .snapshots()
    .listen((event) {
  List<DocumentSnapshot> snapshots = event.docs;

  for (var map in snapshots) {
    Map<String, dynamic> data = map.data() as Map<String, dynamic>;

    if (data['norequest'] % 10 == 0) {
      String nameDocument = map.id;
      listDocuments.add(nameDocument);
      list.add(
        Marker(
          markerId: MarkerId(nameDocument),
          position: LatLng(data['coor'].latitude, data['coor'].longitude),
        ),
      );
    } else {
      print('nooooooooooooooooooooooooooooooooooooooooooooooo');
    }
  }
});
  }

In this function, an if condition checks if the value of the norequest field in a document is greater than or equal to 10 and is divisible by 10. If this condition is satisfied, the code adds a marker to the map and adds the document's ID to a list of documents. However, it seems that only one marker is being added to the map, even though there are supposed to be more documents that satisfy the if condition.


问:
Xamarin forms android application showing un-usual behavior and crashing
Recently around Dec 1st reset my pc and installed visual studio. Previously when I last installed visual studio, it showed Xamarin forms in the installation directory. This time it showed MAUI and provided Xamarin as an addon to work with Xamarin. Until this its fine. After installation, I was able to load Xamarin forms project properly. Now, when I deploy to the android device for debugging, everything worked fine. But as I interacted more, UI started misbehaving with stack layout or frame view elements not resizing.

Below screen shots will explain the situation

Normal Behavior

Parent page for the above page

When interacting with the page in the first picture, elements like stack layout and frame are not resizing.

When navigated from the current page to parent page, UI misbehavior continues

When clicked on an item in the above page, instead of getting page that looks like 1st pic, getting empty page

When navigated back still same mal-formed page

On turning off and on the screen, UI refreshing to normal.(Before any crash happens)

While the above process happens, anytime application is crashing particularly when any data was being updated on the UI.

Debug Logs when crashed

I presume this is a Xamarin renderer or some library issues. How do I over come this as my app is in production stage.

I tried to reinstall entire visual studio and also cleared all the cache of Xamarin and Android like NuGet packages etc. It the same result. A workaround would be good and a solution would be excellent.


问:
php arrays, How come the maximum array size is 7...?
An array I use in my PHP code can grow only up to 7 elements. Could anybody shed some light to figure this out? please.

Description:
I use a PHP session to store an array, which should grow by adding data element on each click I made using Ajax call. (using PHP 5, codeIgniter 2.0.3)

Code:

```<code>$companyAddressList = $this->session->userdata('companyAddressList');

$companyAddressList[] = $_POST['address'];
$this->session->set_userdata('companyAddressList',$companyAddressList);
</code>```

Above code add data (an array containing address details) to the "companyAddressList" array for upto 7 elements, but after that the last array element get replaced with each new address data.

ContentLicense: CC BY-SA 3.0

Body:
An array I use in my PHP code can grow only up to 7 elements. Could anybody shed some light to figure this out? please.

Description:
I use a PHP session to store an array, which should grow by adding data element on each click I made using Ajax call. (using PHP 5, codeIgniter 2.0.3)

Code:

$companyAddressList = $this->session->userdata('companyAddressList');

$companyAddressList[] = $_POST['address'];
$this->session->set_userdata('companyAddressList',$companyAddressList);

Above code add data (an array containing address details) to the "companyAddressList" array for upto 7 elements, but after that the last array element get replaced with each new address data.


问:
ActiveMQ Artemis login in web console fail
Login works with SSL and Active Directory. However, login with HTTP and local admin fails without error message. The web console just returns to the login screen. Also, the log says user authenticated. We're using Artemis 2.27.0.

bootstrap.xml:

<web path="web">
    <binding uri="https://host1:sslport" keyStorePath="XXXXX" keyStorePassword="xxxxx">
        <app url="activemq-branding" war="activemq-branding.war"/>
        <app url="artemis-plugin" war="artemis-plugin.war"/>
        <app url="console" war="console.war"/>
    </binding>
    <binding uri="http://host1:port">
        <app url="activemq-branding" war="activemq-branding.war"/>
        <app url="artemis-plugin" war="artemis-plugin.war"/>
        <app url="console" war="console.war"/>
    </binding>
</web>
```
<p>login.config</p>
```activemq {
    org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule sufficient
       debug=false
       reload=true
       org.apache.activemq.jaas.properties.user="artemis-users.properties"
       org.apache.activemq.jaas.properties.role="artemis-roles.properties";

    org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule sufficient
-- The rest is secret --´
```
<p><code>artemis.profile</code> is default except for:</p>
```HAWTIO_ROLE='amq,LDAP_artemis_instance_admin,LDAP_artemis_admin'
```

´
Log
2022-12-20 14:52:53,822 INFO  [io.hawt.web.auth.LoginServlet] Logging in user: user1

Audit
2022-12-20 14:52:53,824 AUDIT AMQ601715: User user1(LDAP_Application_Artemis_Admin)@xx.x.xx.xx:xxxxx successfully authenticated
´

Body:
Login works with SSL and Active Directory. However, login with HTTP and local admin fails without error message. The web console just returns to the login screen. Also, the log says user authenticated. We're using Artemis 2.27.0.

bootstrap.xml:

<web path="web">
    <binding uri="https://host1:sslport" keyStorePath="XXXXX" keyStorePassword="xxxxx">
        <app url="activemq-branding" war="activemq-branding.war"/>
        <app url="artemis-plugin" war="artemis-plugin.war"/>
        <app url="console" war="console.war"/>
    </binding>
    <binding uri="http://host1:port">
        <app url="activemq-branding" war="activemq-branding.war"/>
        <app url="artemis-plugin" war="artemis-plugin.war"/>
        <app url="console" war="console.war"/>
    </binding>
</web>

login.config

activemq {
    org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule sufficient
       debug=false
       reload=true
       org.apache.activemq.jaas.properties.user="artemis-users.properties"
       org.apache.activemq.jaas.properties.role="artemis-roles.properties";

    org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule sufficient
-- The rest is secret --´

artemis.profile is default except for:

HAWTIO_ROLE='amq,LDAP_artemis_instance_admin,LDAP_artemis_admin'

´
Log
2022-12-20 14:52:53,822 INFO  [io.hawt.web.auth.LoginServlet] Logging in user: user1

Audit
2022-12-20 14:52:53,824 AUDIT AMQ601715: User user1(LDAP_Application_Artemis_Admin)@xx.x.xx.xx:xxxxx successfully authenticated
´


问:
Assigning onclick on button that is outside of current react app (php) gives unexpected behaviour
We are builidng react components for a php app, it doesn't really have much intergration but there's a php save button that is should listen for and save onclick. But there's a catch, for some reason most of functions i'm trying to use are just not getting ran. I'm working with react-form-hook and trying to run the onsubmit() with my function inside.

```<code> handleSubmit((data) => {
          handleSaveOrderProducts(data, selectedProductsRef.current);
 });
</code>```

To assign this function to the button i have to listen for the button clicks with id, i tried different approaches but none seems to fix the problem. Ways to listen i tried:
Using https://www.npmjs.com/package/react-detect-click-outside#features lib

```<code> const productInformationContainerRef = useDetectClickOutside({
    onTriggered(event) {
      // @ts-ignore
      if (event.target?.id === "save-order-button") {
        console.log("save order button");
        handleSubmit((data) => {
          handleSaveOrderProducts(data, selectedProductsRef.current);
        });
      }
    },
  });
</code>```

What i get in result? The callback itself runs, but the function (handlesubmit) is not. Even if i put a console.log in callback with data there's just nothing displayed.

Different approaches from this stackoverflow thread, mostly everything related to functional react Detect click outside React component .
If you had experience in something like this or have any theoretical knowledge please comment :)strong text

Body:
We are builidng react components for a php app, it doesn't really have much intergration but there's a php save button that is should listen for and save onclick. But there's a catch, for some reason most of functions i'm trying to use are just not getting ran. I'm working with react-form-hook and trying to run the onsubmit() with my function inside.

 handleSubmit((data) => {
          handleSaveOrderProducts(data, selectedProductsRef.current);
 });

To assign this function to the button i have to listen for the button clicks with id, i tried different approaches but none seems to fix the problem. Ways to listen i tried:
Using https://www.npmjs.com/package/react-detect-click-outside#features lib

 const productInformationContainerRef = useDetectClickOutside({
    onTriggered(event) {
      // @ts-ignore
      if (event.target?.id === "save-order-button") {
        console.log("save order button");
        handleSubmit((data) => {
          handleSaveOrderProducts(data, selectedProductsRef.current);
        });
      }
    },
  });

What i get in result? The callback itself runs, but the function (handlesubmit) is not. Even if i put a console.log in callback with data there's just nothing displayed.

Different approaches from this stackoverflow thread, mostly everything related to functional react Detect click outside React component .
If you had experience in something like this or have any theoretical knowledge please comment :)strong text


问:
vectorization does not give the same results of for bucle
I am trying to optimize my code by using vectorized functions instead of for loops. I have written a function s_curves1() that takes two inputs, t and x4, and returns a value based on certain conditions. I have tested this function using both a for loop and a vectorized version of the function, but the vectorized version is not giving the correct output. I would like to understand why this is happening and how to fix it.

I tried using the np.vectorize() function to vectorize the s_curves1() function, and then I tested both versions of the function using the same input values. I was expecting the output of the vectorized function to be equivalent to the output of the original function, but this was not the case. I got the following error message:

```<code>AssertionError:
Not equal to tolerance rtol=1e-07, atol=0

Mismatched elements: 6 / 16 (37.5%)
Max absolute difference: 0.48713929
Max relative difference: 0.
 x: array([[0.      , 0.      , 0.      , 0.      ],
       [1.      , 0.176777, 0.06415 , 0.03125 ],
       [1.      , 1.      , 0.362887, 0.176777],
       [1.      , 1.      , 1.      , 0.487139]])
 y: array([[0, 0, 0, 0],
       [1, 0, 0, 0],
       [1, 1, 0, 0],
       [1, 1, 1, 0]])
</code>```

The code I use:

```<code>def s_curves1(t, x4):
    """
        Unit hydrograph ordinates for UH1 derived from S-curves.
    """
    # Convertir t en un array, si es necesario
    t = np.asarray(t)

    # Si t es menor o igual que 0, devolver 0
    if np.any(t <= 0):
        return 0
    # Si t es menor que x4, devolver (t/x4)^2.5
    elif np.any(t < x4):
        return (t/x4)**2.5
    # En cualquier otro caso, devolver 1
    else:
        return 1
# Crear un array de valores para t y x4
t_values = np.array([0, 10, 20, 30])
x4_values = np.array([0, 20, 30, 40])

result1 = np.zeros((len(t_values), len(x4_values)))
# Evaluar la función s_curves1() para cada combinación de t y x4
for i in range(len(t_values)):
    for j in range(len(x4_values)):
        result1[i, j] = s_curves1(t_values[i], x4_values[j])
# Vectorizar la función s_curves1()
vs_curves1 = np.vectorize(s_curves1)

# Evaluar la función vectorizada vs_curves1() para cada combinación de t y x4
result2 = vs_curves1(t_values[:, np.newaxis], x4_values)

# Comprobar que la salida de la función vectorizada es equivalente a la salida de la función original
np.testing.assert_allclose(result1, result2)
</code>```

Body:
I am trying to optimize my code by using vectorized functions instead of for loops. I have written a function s_curves1() that takes two inputs, t and x4, and returns a value based on certain conditions. I have tested this function using both a for loop and a vectorized version of the function, but the vectorized version is not giving the correct output. I would like to understand why this is happening and how to fix it.

I tried using the np.vectorize() function to vectorize the s_curves1() function, and then I tested both versions of the function using the same input values. I was expecting the output of the vectorized function to be equivalent to the output of the original function, but this was not the case. I got the following error message:

AssertionError:
Not equal to tolerance rtol=1e-07, atol=0

Mismatched elements: 6 / 16 (37.5%)
Max absolute difference: 0.48713929
Max relative difference: 0.
 x: array([[0.      , 0.      , 0.      , 0.      ],
       [1.      , 0.176777, 0.06415 , 0.03125 ],
       [1.      , 1.      , 0.362887, 0.176777],
       [1.      , 1.      , 1.      , 0.487139]])
 y: array([[0, 0, 0, 0],
       [1, 0, 0, 0],
       [1, 1, 0, 0],
       [1, 1, 1, 0]])

The code I use:

def s_curves1(t, x4):
    """
        Unit hydrograph ordinates for UH1 derived from S-curves.
    """
    # Convertir t en un array, si es necesario
    t = np.asarray(t)

    # Si t es menor o igual que 0, devolver 0
    if np.any(t <= 0):
        return 0
    # Si t es menor que x4, devolver (t/x4)^2.5
    elif np.any(t < x4):
        return (t/x4)**2.5
    # En cualquier otro caso, devolver 1
    else:
        return 1
# Crear un array de valores para t y x4
t_values = np.array([0, 10, 20, 30])
x4_values = np.array([0, 20, 30, 40])

result1 = np.zeros((len(t_values), len(x4_values)))
# Evaluar la función s_curves1() para cada combinación de t y x4
for i in range(len(t_values)):
    for j in range(len(x4_values)):
        result1[i, j] = s_curves1(t_values[i], x4_values[j])
# Vectorizar la función s_curves1()
vs_curves1 = np.vectorize(s_curves1)

# Evaluar la función vectorizada vs_curves1() para cada combinación de t y x4
result2 = vs_curves1(t_values[:, np.newaxis], x4_values)

# Comprobar que la salida de la función vectorizada es equivalente a la salida de la función original
np.testing.assert_allclose(result1, result2)


问:
Error when installing apk on emulator in WebStorm but not in Android Studio
I want to develop a React Native app in WebStorm. Therefore I created my emulator in Android Studio which I use in WebStorm as an external tool. If I start it in WebStorm I get:

```<code>INFO    | Android emulator version 31.3.10.0 (build_id 8807927) (CL:N/A)
emulator: INFO: Found systemPath C:\Users\aerith\AppData\Local\Android\Sdk\system-images\android-33\google_apis\x86_64\
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
INFO    | IPv4 server found: 172.17.0.11
INFO    | added library vulkan-1.dll
INFO    | configAndStartRenderer: setting vsync to 60 hz
INFO    | injectedQemuChannel!
INFO    | Informing listeners of injection.
INFO    | Rootcanal has  been activated.
WHPX on Windows 10.0.19044 detected.
Windows Hypervisor Platform accelerator is operational
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local, auth: none
INFO    | Advertising in: C:\Users\aerith\AppData\Local\Temp\avd\running\pid_18624.ini
INFO    | setDisplayConfigs w 1080 h 2400 dpiX 420 dpiY 420
</code>```

It also starts successfully. However if I want to install an apk (I can install it on the same emulator in Android Studio) I get this error:

```<code>Unable to read the given APK.
Ensure that the file is readable.
</code>```

Any ideas where the problem could be?

Body:
I want to develop a React Native app in WebStorm. Therefore I created my emulator in Android Studio which I use in WebStorm as an external tool. If I start it in WebStorm I get:

INFO    | Android emulator version 31.3.10.0 (build_id 8807927) (CL:N/A)
emulator: INFO: Found systemPath C:\Users\aerith\AppData\Local\Android\Sdk\system-images\android-33\google_apis\x86_64\
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
INFO    | IPv4 server found: 172.17.0.11
INFO    | added library vulkan-1.dll
INFO    | configAndStartRenderer: setting vsync to 60 hz
INFO    | injectedQemuChannel!
INFO    | Informing listeners of injection.
INFO    | Rootcanal has  been activated.
WHPX on Windows 10.0.19044 detected.
Windows Hypervisor Platform accelerator is operational
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local, auth: none
INFO    | Advertising in: C:\Users\aerith\AppData\Local\Temp\avd\running\pid_18624.ini
INFO    | setDisplayConfigs w 1080 h 2400 dpiX 420 dpiY 420

It also starts successfully. However if I want to install an apk (I can install it on the same emulator in Android Studio) I get this error:

Unable to read the given APK.
Ensure that the file is readable.

Any ideas where the problem could be?


问:
cache manger : redis get value undefine
```<code>i am trying to get value from redis cache . use nest.js/ node .js

i am using cache manger . nestjs typescript

@Inject(CACHE_MANAGER) private readonly cacheStore: CacheStore

        const cacheData = await this.cacheStore.get<Number>(id);

            if (!isNil(cacheData)) {

                const data=await plainToClass(Number, cacheData, { exposeUnsetFields: false });
                return  childrenCount = { childrenCount: data };
            }
            if (isNil(cacheData)) {

                const response = await this.service.findChildrenCountById(id);
                const resolved =await plainToClass(Number, response);
                const tk=await this.cacheStore.set(id, resolved, { ttl: 24 * 60 * 60 }); //  save for 24 hours
                console.log('tk===', tk);
             childrenCount = await { childrenCount:  tk };
          return await childrenCount;
            }
</code>```

i try also with .then but not got result..........

i have problem with this line of code

const cacheData = await this.cacheStore.get(id);

Title: cache manger : redis get value undefine

Body:
i am trying to get value from redis cache . use nest.js/ node .js

i am using cache manger . nestjs typescript

@Inject(CACHE_MANAGER) private readonly cacheStore: CacheStore

        const cacheData = await this.cacheStore.get<Number>(id);

            if (!isNil(cacheData)) {

                const data=await plainToClass(Number, cacheData, { exposeUnsetFields: false });
                return  childrenCount = { childrenCount: data };
            }
            if (isNil(cacheData)) {

                const response = await this.service.findChildrenCountById(id);
                const resolved =await plainToClass(Number, response);
                const tk=await this.cacheStore.set(id, resolved, { ttl: 24 * 60 * 60 }); //  save for 24 hours
                console.log('tk===', tk);
             childrenCount = await { childrenCount:  tk };
          return await childrenCount;
            }

i try also with .then but not got result..........

i have problem with this line of code

const cacheData = await this.cacheStore.get(id);


问:
TypeError: 'NoneType' object is not callable. Pegasus Tokenizer
Getting the error "TypeError: 'NoneType' object is not callable", even after running "pip install sentencepiece".

```<code>TypeError                                 Traceback (most recent call last)
<ipython-input-10-388b02906732> in <module>
      3 model_name = 'tuner007/pegasus_paraphrase'
      4 torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
----> 5 tokenizer = PegasusTokenizer.from_pretrained(model_name)
      6 model = PegasusForConditionalGeneration.from_pretrained(model_name).to(torch_device)
      7

TypeError: 'NoneType' object is not callable
</code>```
```<code>import torch
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
model_name = 'tuner007/pegasus_paraphrase'
torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
**tokenizer = PegasusTokenizer.from_pretrained(model_name)**
model = PegasusForConditionalGeneration.from_pretrained(model_name).to(torch_device)

def get_response(input_text,num_return_sequences,num_beams):
  batch = tokenizer([input_text],truncation=True,padding='longest',max_length=60, return_tensors="pt").to(torch_device)
  translated = model.generate(**batch,max_length=60,num_beams=num_beams, num_return_sequences=num_return_sequences, temperature=1.5)
  tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)
  return tgt_text

</code>```

Issue seems to be in the bold line.

Body:
Getting the error "TypeError: 'NoneType' object is not callable", even after running "pip install sentencepiece".

TypeError                                 Traceback (most recent call last)
<ipython-input-10-388b02906732> in <module>
      3 model_name = 'tuner007/pegasus_paraphrase'
      4 torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
----> 5 tokenizer = PegasusTokenizer.from_pretrained(model_name)
      6 model = PegasusForConditionalGeneration.from_pretrained(model_name).to(torch_device)
      7

TypeError: 'NoneType' object is not callable

import torch
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
model_name = 'tuner007/pegasus_paraphrase'
torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
**tokenizer = PegasusTokenizer.from_pretrained(model_name)**
model = PegasusForConditionalGeneration.from_pretrained(model_name).to(torch_device)

def get_response(input_text,num_return_sequences,num_beams):
  batch = tokenizer([input_text],truncation=True,padding='longest',max_length=60, return_tensors="pt").to(torch_device)
  translated = model.generate(**batch,max_length=60,num_beams=num_beams, num_return_sequences=num_return_sequences, temperature=1.5)
  tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)
  return tgt_text

Issue seems to be in the bold line.


问:
Dotted points not showing on list items
got a small problem, I added list-items inside a accordion and and the dotted points that should indicate the start of a item isn't showing up, any solution on how to fix this? And thanks for the help!</p>
```<code><section id="Specialist">
            <div class="services-container">
              <div class="left1">
                <div class="content">
                  <h1>Specialist  Services</h1>
                  <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Et undevoluptatem</p>
                  <div class="accordion">
                    <div class="contentAB">
                      <div class="label">Specialist  Services</div>
                      <div class="content">
                        <ul>
                          <li>Fixed Term Contracts (Ad-Hoc).</li>
                          <li>Technical and project cost audits.</li>
                          <li>“Watching Brief” on EPCM and turnkey projects.</li>
                          <li>Mediation and dispute resolution.</li>
                        </ul>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            <div class="right1"></div>
            </div>
          </section>
</code>```

Title: Dotted points not showing on list items

Body:
got a small problem, I added list-items inside a accordion and and the dotted points that should indicate the start of a item isn't showing up, any solution on how to fix this? And thanks for the help!

Specialist  Services

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Et undevoluptatem

Specialist  Services

Fixed Term Contracts (Ad-Hoc).

Technical and project cost audits.

“Watching Brief” on EPCM and turnkey projects.

Mediation and dispute resolution.


问:
QuickBooks Desktop API connection issues when multiple users logged in
I am new to QuickBooks Desktop integration. I am running into an issue that I am hoping to get your help on.

I have implemented a c# console application (interface program) that connects to QuickBooks to read customer data. Here is the connection code:

```<code>            sessionManager = new RequestProcessor2();

            sessionManager.OpenConnection("", "Test QuickBooks Interface");

            // set Auth Preferences
            var prefs = sessionManager.AuthPreferences;
            prefs.PutUnattendedModePref(QBXMLRPUnattendedModePrefType.umpRequired);

            Ticket = sessionManager.BeginSession(QuickBooksCompanyFile, QBFileMode.qbFileOpenMultiUser);
</code>```

This test application is authorized in QuickBooks. When I run this application on the same machine without QuickBooks running all is fine. It logs in and pulls customer data.

When I log into the same server with another user and start QuickBooks with another QuickBooks user in multi-user mode I get an error "Could not start QuickBooks." when running the code listed. Closing the other QuickBooks instance the code listed works again.

I need to run this program periodically to extract data from QuickBooks so it's important that other users can use QuickBooks at the same time. What am I doing wrong? I thought running the interface program Unattended and open in Muti User Mode should do it but it does not.

Thanks for any help in advance,
Moz

Body:
I am new to QuickBooks Desktop integration. I am running into an issue that I am hoping to get your help on.

I have implemented a c# console application (interface program) that connects to QuickBooks to read customer data. Here is the connection code:

            sessionManager = new RequestProcessor2();

            sessionManager.OpenConnection("", "Test QuickBooks Interface");

            // set Auth Preferences
            var prefs = sessionManager.AuthPreferences;
            prefs.PutUnattendedModePref(QBXMLRPUnattendedModePrefType.umpRequired);

            Ticket = sessionManager.BeginSession(QuickBooksCompanyFile, QBFileMode.qbFileOpenMultiUser);

This test application is authorized in QuickBooks. When I run this application on the same machine without QuickBooks running all is fine. It logs in and pulls customer data.

When I log into the same server with another user and start QuickBooks with another QuickBooks user in multi-user mode I get an error "Could not start QuickBooks." when running the code listed. Closing the other QuickBooks instance the code listed works again.

I need to run this program periodically to extract data from QuickBooks so it's important that other users can use QuickBooks at the same time. What am I doing wrong? I thought running the interface program Unattended and open in Muti User Mode should do it but it does not.

Thanks for any help in advance,
Moz


问:
calling hook inside another hook makes a loop
I have a component called Home inside it with the help of a custom hook called useAxios I send a http request in useAxios hook I have an interceptor and with getting 401 error I will call another function named refreshHandler from another custom hook called useTokenHandler.  in refreshHandler function inside useTokenHandler I have to call another function from another custom hook called useAuth but because in useAuth hook I have to use a function from useAxios so I have to call useAxios hook in useAuth hook and it makes a loop. do you have any idea how can I inside useAxios call a function which is inside useTokenHandler and in that function it calls another function from useAuth hook? (I have redux so if you have any suggestion with redux that may solve the problem I can handle it in redux too)

Home component:

```<code>const Home = () => {

 const {axiosInstance} = useAxios()

 useEffect(() =>{
 //fetch some data with axiosInstace
 },[])
 return
 }
 export default Home
</code>```

useAxios hook

```<code>const useAxios = () => {

  const {refreshHandler} = useTokenHandler()

  const axiosInstance =
    axios.create({
      baseURL: "",
    })

  axiosInstance.interceptors.request.use((req) => {

    return req;
  });

  axiosInstance.interceptors.response.use(
  function (response) {
      return response;
    },
   async function (error) {

        // calling a function from useTokenHandler hook
        refreshHandler()

        return Promise.reject(error);
      }

  );

  return { axiosInstance };
};
export default useAxios;
</code>```

useTokenHandler hook :

```<code>const useTokenHandler = () => {

  const { refreshRequest } = useAuth();

  const refreshHandler = (refreshToken) => {

    // calling refreshRequst from useAuth

        refreshRequest(refreshToken);
  });

  return {  refreshHandler };
};

export default useTokenHandler;
</code>```

useAuth hook :

```<code>const useAuth = () => {

const {axiosInstance} = useAxios()

  const refreshRequst = async () => {

    const response = await axiosInstace("http.....", {
      method: "POST",
      body: JSON.stringify({
        refresh_token: refreshToken,
      }),
      headers: {
        "Content-Type": "application/json",
      },
    });

  };
  return {  refreshRequst };
};

export default useVenAuth;
</code>```

Body:
I have a component called Home inside it with the help of a custom hook called useAxios I send a http request in useAxios hook I have an interceptor and with getting 401 error I will call another function named refreshHandler from another custom hook called useTokenHandler.  in refreshHandler function inside useTokenHandler I have to call another function from another custom hook called useAuth but because in useAuth hook I have to use a function from useAxios so I have to call useAxios hook in useAuth hook and it makes a loop. do you have any idea how can I inside useAxios call a function which is inside useTokenHandler and in that function it calls another function from useAuth hook? (I have redux so if you have any suggestion with redux that may solve the problem I can handle it in redux too)

Home component:

const Home = () => {

 const {axiosInstance} = useAxios()

 useEffect(() =>{
 //fetch some data with axiosInstace
 },[])
 return
 }
 export default Home

useAxios hook

const useAxios = () => {

  const {refreshHandler} = useTokenHandler()

  const axiosInstance =
    axios.create({
      baseURL: "",
    })

  axiosInstance.interceptors.request.use((req) => {

    return req;
  });

  axiosInstance.interceptors.response.use(
  function (response) {
      return response;
    },
   async function (error) {

        // calling a function from useTokenHandler hook
        refreshHandler()

        return Promise.reject(error);
      }

  );

  return { axiosInstance };
};
export default useAxios;

useTokenHandler hook :

const useTokenHandler = () => {

  const { refreshRequest } = useAuth();

  const refreshHandler = (refreshToken) => {

    // calling refreshRequst from useAuth

        refreshRequest(refreshToken);
  });

  return {  refreshHandler };
};

export default useTokenHandler;

useAuth hook :

const useAuth = () => {

const {axiosInstance} = useAxios()

  const refreshRequst = async () => {

    const response = await axiosInstace("http.....", {
      method: "POST",
      body: JSON.stringify({
        refresh_token: refreshToken,
      }),
      headers: {
        "Content-Type": "application/json",
      },
    });

  };
  return {  refreshRequst };
};

export default useVenAuth;


问:
In the browser, how to convert the recorded video file into an HLS .m3u8 file and send it to the server?
At present, I am implementing a screen recording function that needs to record 5 hours in the browser, and then I use navigator.mediaDevices.getDisplayMedia() to get the stream of the screen, pass it to MediaRecorder for processing, and then get the blob through MediaRecorder.ondataavailable. The blobs are processed in an array, and the problem we encounter now is: if we want to record 5 hours of media in the browser, putting all these blob data in the local memory will definitely have a large memory overhead. If it is not possible, then the current solution is: whether it is possible to divide the blob into files with the suffix .ts during the recording process, and then upload them to the CDN, and at the same time generate HLS streaming media with the suffix . m3u8 files, is this idea possible?</p>
```<code>        const stream = await navigator.mediaDevices.getDisplayMedia({video:true,audio:true});
        const mediaRecorder = new MediaRecorder(stream, {mimeType:'video/webm'});

        mediaRecorder.start(1000);

        mediaRecorder.ondataavailable = (event) => {
          if (event?.data?.size > 0) {
            // If you need to record for 5 hours, the memory usage must be very large
            this.chunks.push(event.data);
          }
        };

        mediaRecorder.addEventListener("stop", (event) => {
          const blob= new Blob(this.chunks, { type: 'video/webm' });
          // Download to local or upload to server
          // ...
        });

</code>```
```<code> // ...
        const stream = await navigator.mediaDevices.getDisplayMedia({video:true,audio:true});
        const mediaRecorder = new MediaRecorder(stream, {mimeType:'video/webm'});

        mediaRecorder.start(1000);

        mediaRecorder.ondataavailable = (event) => {
          if (event?.data?.size > 0) {
            // Is it possible to convert these data to generate HLS protocol files with the suffix .ts at intervals (for example, 10S), and then generate .m3u8 files at the end of the final recording, and then upload them to the server.
          }
        };

        mediaRecorder.addEventListener("stop", (event) => {

          // Then at the end of the final recording, an .m3u8 file is generated and uploaded to the server.
        });
</code>```

Body:
At present, I am implementing a screen recording function that needs to record 5 hours in the browser, and then I use navigator.mediaDevices.getDisplayMedia() to get the stream of the screen, pass it to MediaRecorder for processing, and then get the blob through MediaRecorder.ondataavailable. The blobs are processed in an array, and the problem we encounter now is: if we want to record 5 hours of media in the browser, putting all these blob data in the local memory will definitely have a large memory overhead. If it is not possible, then the current solution is: whether it is possible to divide the blob into files with the suffix .ts during the recording process, and then upload them to the CDN, and at the same time generate HLS streaming media with the suffix . m3u8 files, is this idea possible?

        const stream = await navigator.mediaDevices.getDisplayMedia({video:true,audio:true});
        const mediaRecorder = new MediaRecorder(stream, {mimeType:'video/webm'});

        mediaRecorder.start(1000);

        mediaRecorder.ondataavailable = (event) => {
          if (event?.data?.size > 0) {
            // If you need to record for 5 hours, the memory usage must be very large
            this.chunks.push(event.data);
          }
        };

        mediaRecorder.addEventListener("stop", (event) => {
          const blob= new Blob(this.chunks, { type: 'video/webm' });
          // Download to local or upload to server
          // ...
        });

 // ...
        const stream = await navigator.mediaDevices.getDisplayMedia({video:true,audio:true});
        const mediaRecorder = new MediaRecorder(stream, {mimeType:'video/webm'});

        mediaRecorder.start(1000);

        mediaRecorder.ondataavailable = (event) => {
          if (event?.data?.size > 0) {
            // Is it possible to convert these data to generate HLS protocol files with the suffix .ts at intervals (for example, 10S), and then generate .m3u8 files at the end of the final recording, and then upload them to the server.
          }
        };

        mediaRecorder.addEventListener("stop", (event) => {

          // Then at the end of the final recording, an .m3u8 file is generated and uploaded to the server.
        });


问:
how to extract 15digit IMIE number and obeservation starting date from given column of dataframe
I got daily 100 to 200 mails in thuderbird mail account, I save this all mail to plain csv fortmat. In that csv first columns is mail date.second columns is mail body. and other columns.
I want to work on mail body columns. some records of that columns has 15digit IMEI number and observation starting date and till date information. I want to extract this 15digit NUMBERIC IMEI number and starting date data and save this another dataframe.

I make dataframe of extract 15 digit numeric but i could not extract starting date from it


问:
PDFium to create page numbers of a book
I am converting HTML to PDFs with some page numbering requirements that are standard in book printing.

Page numbers should be hidden on some pages

Front matter, which means everything up to the actual text, should have Roman page numbers (i, ii)

Page numbers should restart from 1 at the beginning of actual text

Table of Contents should show page numbers

Hiding page numbers is very important.  The three others are big nice-to-haves.

I am using html-pdf-node, which uses Puppeteer -> Chromium -> PDFium.
Since html-pdf-node only supports very simple page numbering, I am looking at possibilities of doing it in one of the deeper levels.

I tried to search the documentation of the four levels and I checked possibilities of removing or editing page numbers with other tools.  With Chromium/PDFium the answer might still be in the docs even I did not see it.  I also thought of forking our own version of PDFium if possible.

Title: PDFium to create page numbers of a book


问:
Split data in text file use pandas
I have a text file, for example:

```<code>The first day
A   B   C
1   4   6
3   2   7
The second day
A   B   C
3   6   7
7   9   0
The last day
A   B   C
3   5   2
4   7   0
</code>```

Then i need to convert it to csv file as:

```<code>A   B   C   Day
1   4   6   The first day
3   2   7   The first day
3   6   7   The second day
7   9   0   The second day
3   5   2   The last day
4   7   0   The last day
</code>```

I don't know to do. Help me, pleaseeee

Title: Split data in text file use pandas

Body:
I have a text file, for example:

The first day
A   B   C
1   4   6
3   2   7
The second day
A   B   C
3   6   7
7   9   0
The last day
A   B   C
3   5   2
4   7   0

Then i need to convert it to csv file as:

A   B   C   Day
1   4   6   The first day
3   2   7   The first day
3   6   7   The second day
7   9   0   The second day
3   5   2   The last day
4   7   0   The last day

I don't know to do. Help me, pleaseeee


问:
Sequelize transaction doesn't work after some time without restarting PM2
All API using Sequelize transactions stops working after some time in PM2 as a process manager where are other simple queries works fine. It shows pending in XHR request. But after restarting the PM2 it works fine but after few hours it stops. I am facing this problem with only those api's that are using Sequelize transactions. What could be the issue?

here is my configuration
Server - UBUNTU 20.04

PM2 - 5.2.2

express - ~4.16.1

sequelize - ^6.7.0


问:
Trying to Associate multiple route tables to the S3 VPC Endpoint ( Gateway ) using Terraform
I can associate single route table to the AWS VPC Endpoint for S3.
But not able to associate multiple route tables with AWS VPC Endpoint for S3.

**Getting below error :

```<code>STDERR: \\nError: Invalid index\\n\\n  on aws_vpc_endpoints/locals.tf line 30, in locals:\\n  30:                                               route_table_name = rtb[idx]} ] if endp.service_name == \\"s3\\" ]])\\n\\nThis value does not have any indices.\\n"}**
</code>```

Terraform code :

```<code>variable "vpc_endpoints" {
  type = list(object({
     vpc_name = string
     vpc_cidr = list(string)

     service = list(object({
             service_name = string
             subnet_names = optional(list(string))
             route_table_names = optional (list(string))
     }))

  }))
}
</code>```

Values of Variables :

```<code>VPC_Endpoints = [
{
vpc_name = TEST-VPC
vpc_cidr = ["X.X.X.X/X"]
service = [
service_name = s3,
route_table_names = ["Subnet1A", "Subnet1B"]
subnet_names = []
]   } ]
</code>```

We are trying to get list of VPC Name, Subnet Name, Route Tables Names, Tags Name into a map using below locals endp_list and rtb_list.

```<code>data "aws_route_tables" "s3_list" {
  for_each = { for endp in local.rtb_list : "${endp.vpc_name}-${endp.service_name}" => endp if endp.service_name == "s3"}
    filter {
    name = "tag:Name"
    values = [each.value.route_table_name]
  }
}

locals{
  endp_list = flatten([ for vpc in var.vpc_endpoints : [ for endp in vpc.service:
{ vpc_name = vpc.vpc_name, service_name = endp.service_name,
  subnet_names = endp.subnet_names,
  route_table_names = endp.route_table_names,

}]])

  rtb_list = flatten([ for vpc in var.vpc_endpoints :
  [ for endp in vpc.service:
  [ for idx, rtb in endp.route_table_names:
  { vpc_name = vpc.vpc_name,
  service_name = endp.service_name,
  route_table_name = rtb[idx]} ] if endp.service_name == "s3" ]])
}

resource "aws_vpc_endpoint" "s3" {
  for_each     = { for endp in local.endp_list : "${endp.vpc_name}-${endp.service_name}" => endp if endp.service_name == "s3" }
  vpc_id       = data.aws_vpc.vpc[each.value.vpc_name].id
  service_name = data.aws_vpc_endpoint_service.s3.service_name

}

resource "aws_vpc_endpoint_route_table_association" "s3_endpoint1_private" {
for_each = { for idx, endp in local.rtb_list : idx => endp if endp.service_name == "s3" }
vpc_endpoint_id = aws_vpc_endpoint.s3["${each.value.vpc_name}-${each.value.service_name}"].id
route_table_id  = data.aws_route_table.s3_list[idx].id
}
</code>```

Body:
I can associate single route table to the AWS VPC Endpoint for S3.
But not able to associate multiple route tables with AWS VPC Endpoint for S3.

**Getting below error :

STDERR: \\nError: Invalid index\\n\\n  on aws_vpc_endpoints/locals.tf line 30, in locals:\\n  30:                                               route_table_name = rtb[idx]} ] if endp.service_name == \\"s3\\" ]])\\n\\nThis value does not have any indices.\\n"}**

Terraform code :

variable "vpc_endpoints" {
  type = list(object({
     vpc_name = string
     vpc_cidr = list(string)

     service = list(object({
             service_name = string
             subnet_names = optional(list(string))
             route_table_names = optional (list(string))
     }))

  }))
}

Values of Variables :

VPC_Endpoints = [
{
vpc_name = TEST-VPC
vpc_cidr = ["X.X.X.X/X"]
service = [
service_name = s3,
route_table_names = ["Subnet1A", "Subnet1B"]
subnet_names = []
]   } ]

We are trying to get list of VPC Name, Subnet Name, Route Tables Names, Tags Name into a map using below locals endp_list and rtb_list.

data "aws_route_tables" "s3_list" {
  for_each = { for endp in local.rtb_list : "${endp.vpc_name}-${endp.service_name}" => endp if endp.service_name == "s3"}
    filter {
    name = "tag:Name"
    values = [each.value.route_table_name]
  }
}

locals{
  endp_list = flatten([ for vpc in var.vpc_endpoints : [ for endp in vpc.service:
{ vpc_name = vpc.vpc_name, service_name = endp.service_name,
  subnet_names = endp.subnet_names,
  route_table_names = endp.route_table_names,

}]])

  rtb_list = flatten([ for vpc in var.vpc_endpoints :
  [ for endp in vpc.service:
  [ for idx, rtb in endp.route_table_names:
  { vpc_name = vpc.vpc_name,
  service_name = endp.service_name,
  route_table_name = rtb[idx]} ] if endp.service_name == "s3" ]])
}

resource "aws_vpc_endpoint" "s3" {
  for_each     = { for endp in local.endp_list : "${endp.vpc_name}-${endp.service_name}" => endp if endp.service_name == "s3" }
  vpc_id       = data.aws_vpc.vpc[each.value.vpc_name].id
  service_name = data.aws_vpc_endpoint_service.s3.service_name

}

resource "aws_vpc_endpoint_route_table_association" "s3_endpoint1_private" {
for_each = { for idx, endp in local.rtb_list : idx => endp if endp.service_name == "s3" }
vpc_endpoint_id = aws_vpc_endpoint.s3["${each.value.vpc_name}-${each.value.service_name}"].id
route_table_id  = data.aws_route_table.s3_list[idx].id
}


问:
Yocto bitbake core-image-sato with preempt-rt failed
I want to set up a linux kernel with preempt-RT with yocto.

According to meta/recipes-rt/README, I add the following code in build/conf/local.conf, and do bitbake core-image-sato, but bitbake fail.

```<code>MACHINE ?= "genericx86-64"

PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
COMPATIBLE_MACHINE_quilt-native = "genericx86-64"
</code>```

Yocto output the following error:

```<code>NOTE: Bitbake server didn't start within 5 seconds, waiting for 90
Loading cache: 100% |#######################################################################################################################################################################| Time: 0:00:13
Loaded 1330 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "genericx86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.1.20"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta
meta-poky
meta-yocto-bsp       = "dunfell:90a6f6a110ab14890e2f6a1616e74ee259fc0f8f"

Initialising tasks: 100% |##################################################################################################################################################################| Time: 0:00:48
Sstate summary: Wanted 14 Found 0 Missed 14 Current 1203 (0% match, 98% complete)
NOTE: Executing Tasks
ERROR: linux-yocto-rt-5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0 do_kernel_metadata: Could not locate BSP definition for genericx86-64/preempt-rt and no defconfig was provided
ERROR: linux-yocto-rt-5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0 do_kernel_metadata: Execution of '/media/fff/disk1T/yocto/demo3/poky/build/tmp/work/genericx86_64-poky-linux/linux-yocto-rt/5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0/temp/run.do_kernel_metadata.1138429' failed with exit code 1
ERROR: Logfile of failure stored in: /media/fff/disk1T/yocto/demo3/poky/build/tmp/work/genericx86_64-poky-linux/linux-yocto-rt/5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0/temp/log.do_kernel_metadata.1138429
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/media/fff/disk1T/yocto/demo3/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['kern-tools-native', 'quilt-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_kernel_metadata
| NOTE: do_kernel_metadata: for summary/debug, set KCONF_AUDIT_LEVEL > 0
| ERROR: Could not locate BSP definition for genericx86-64/preempt-rt and no defconfig was provided
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/media/fff/disk1T/yocto/demo3/poky/build/tmp/work/genericx86_64-poky-linux/linux-yocto-rt/5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0/temp/run.do_kernel_metadata.1138429' failed with exit code 1
ERROR: Task (/media/fff/disk1T/yocto/demo3/poky/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb:do_kernel_metadata) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3173 tasks of which 3172 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /media/fff/disk1T/yocto/demo3/poky/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb:do_kernel_metadata
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

</code>```

My hardware cpu is x86-64 core. It hint genericx86-64/preempt-rt dont exist, what action should I adapt to generate core-image-sato with preempt-RT? Please leave a comment and help me if you are similar with this problem.

I try to checkout various branch of yocto but doesn't matter.These dunfell、langdale、kirkstone.I expect to use dunfell.

Following is my build/conf/bblayers.conf:

```<code>POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /media/fff/disk1T/yocto/demo3/poky/meta \
  /media/fff/disk1T/yocto/demo3/poky/meta-poky \
  /media/fff/disk1T/yocto/demo3/poky/meta-yocto-bsp \
 "
</code>```

Body:
I want to set up a linux kernel with preempt-RT with yocto.

According to meta/recipes-rt/README, I add the following code in build/conf/local.conf, and do bitbake core-image-sato, but bitbake fail.

MACHINE ?= "genericx86-64"

PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
COMPATIBLE_MACHINE_quilt-native = "genericx86-64"

Yocto output the following error:

NOTE: Bitbake server didn't start within 5 seconds, waiting for 90
Loading cache: 100% |#######################################################################################################################################################################| Time: 0:00:13
Loaded 1330 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "genericx86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.1.20"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta
meta-poky
meta-yocto-bsp       = "dunfell:90a6f6a110ab14890e2f6a1616e74ee259fc0f8f"

Initialising tasks: 100% |##################################################################################################################################################################| Time: 0:00:48
Sstate summary: Wanted 14 Found 0 Missed 14 Current 1203 (0% match, 98% complete)
NOTE: Executing Tasks
ERROR: linux-yocto-rt-5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0 do_kernel_metadata: Could not locate BSP definition for genericx86-64/preempt-rt and no defconfig was provided
ERROR: linux-yocto-rt-5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0 do_kernel_metadata: Execution of '/media/fff/disk1T/yocto/demo3/poky/build/tmp/work/genericx86_64-poky-linux/linux-yocto-rt/5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0/temp/run.do_kernel_metadata.1138429' failed with exit code 1
ERROR: Logfile of failure stored in: /media/fff/disk1T/yocto/demo3/poky/build/tmp/work/genericx86_64-poky-linux/linux-yocto-rt/5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0/temp/log.do_kernel_metadata.1138429
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/media/fff/disk1T/yocto/demo3/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['kern-tools-native', 'quilt-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_kernel_metadata
| NOTE: do_kernel_metadata: for summary/debug, set KCONF_AUDIT_LEVEL > 0
| ERROR: Could not locate BSP definition for genericx86-64/preempt-rt and no defconfig was provided
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/media/fff/disk1T/yocto/demo3/poky/build/tmp/work/genericx86_64-poky-linux/linux-yocto-rt/5.4.213+gitAUTOINC+2f18e629f7_03cd66d981-r0/temp/run.do_kernel_metadata.1138429' failed with exit code 1
ERROR: Task (/media/fff/disk1T/yocto/demo3/poky/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb:do_kernel_metadata) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3173 tasks of which 3172 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /media/fff/disk1T/yocto/demo3/poky/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb:do_kernel_metadata
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

My hardware cpu is x86-64 core. It hint genericx86-64/preempt-rt dont exist, what action should I adapt to generate core-image-sato with preempt-RT? Please leave a comment and help me if you are similar with this problem.

I try to checkout various branch of yocto but doesn't matter.These dunfell、langdale、kirkstone.I expect to use dunfell.

Following is my build/conf/bblayers.conf:

POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /media/fff/disk1T/yocto/demo3/poky/meta \
  /media/fff/disk1T/yocto/demo3/poky/meta-poky \
  /media/fff/disk1T/yocto/demo3/poky/meta-yocto-bsp \
 "


Title: How can I crop an image by a filter?

Body:
I want to crop a gray image by a mask. The gray image contains a digit that I want to process further for OCR.

The gray image in the following code snippet is only an excerpt of a bigger image but I took only the relevant part out of it (both for the image and the mask).

I thought that the cv2 function bitwise_and() should do the job, but I am apparently wrong (at least in the way I am doing it).

How can I achieve that my result contains these parts of the gray image that represent the digit 5 and all other parts of it are set to 0? Is this really something that cv2 should do, or is it better to use numpy for that? I have to keep the shades of gray as binarizing it would lead to errors in a further tesseract step.

So effectively it seems that everything equal/below the threshold 133 has to be set to 0.

The result:

The code:

import pandas as pd
import io
import cv2

maskString = \
"""
0,0,0,0,0,0,0,0,0,0
0,0,2,2,2,2,2,2,0,0
0,0,2,2,2,2,2,2,0,0
0,0,2,2,0,0,0,0,0,0
0,0,2,2,0,0,0,0,0,0
0,2,2,2,2,2,0,0,0,0
0,2,2,2,2,2,2,2,0,0
0,2,2,0,0,0,2,2,0,0
0,0,0,0,0,0,2,2,2,0
0,2,2,0,0,0,2,2,0,0
0,2,2,0,0,0,2,2,0,0
0,0,2,2,2,2,2,2,0,0
0,0,0,2,2,2,0,0,0,0
0,0,0,0,0,0,0,0,0,0
"""
grayedString = \
"""
133,133,133,133,133,133,133,133,133,133
133,132,168,201,201,201,201,185,132,133
133,132,225,232,201,201,201,185,132,133
133,132,247,185,132,132,132,132,132,133
133,142,255,168,132,132,132,132,132,133
133,168,255,159,201,193,151,132,132,133
133,193,255,232,201,217,255,177,132,133
133,168,193,132,132,132,201,255,132,133
133,132,132,132,132,132,168,255,168,133
133,185,168,132,132,132,168,255,151,133
133,217,247,132,132,132,210,247,132,133
133,142,240,232,201,232,255,159,132,133
133,132,142,185,201,185,142,132,132,133
133,133,133,133,133,133,133,133,133,133"""
grayed = pd.read_csv(io.StringIO(grayedString), sep=',', header=None).values.astype('uint8')
mask = pd.read_csv(io.StringIO(maskString), sep=',', header=None).values.astype('uint8')
result = cv2.bitwise_and(grayed,mask)


问:
How to keep click event even though the page refresh
How to keep click event(colour change event) if URL has changed after click.

this script below that for click a tag, the URL will changing it.

```<code><script type="text/javascript">
function sigun(sigun) {
    location.href = '/openSec.do?sigun=' + sigun + '&categoryCode1=select1' + '&categoryCode2=mon' + '&categoryCode3=00';
}
</code>```

this JSP code is sample code. if section1 cliked, the URL will chaned /openSec.do?sigun=' + section1 ..... like that. I think this mean the page refresh it.

```<code><div class="gnmap_txt_area">
    <div class="cw map_box">
        <div class="map_txt01">
            <a href="javascript:sigun('section1');">
                <c:forEach var="eventCnt" items="${eventCnt}">
                    <c:if test="${eventCnt.signgu == 'section1' && fn:length(eventCnt.signgu) > 0}">
                    <div class="jb-title"><img src="/images/ico_map_event.png" alt="eventit"> </div></c:if>
                    <div class="jb-text">
                        <c:forEach var="eventMain" items="${eventMain}">
                            <c:if test="${eventMain.signgu == 'section1'}">
                                <span style="font-size: 5px">* ${eventMain.evenNm} <br /></span>
                            </c:if>
                        </c:forEach>
                    </div>
                </c:forEach>
                <p>section1</p>
            </a>
        </div>
    </div>
</div>
</code>```

And JS blew is click event code.

```<code>    $('.map_box').click(function () {
    $('.map_box').removeClass('on');
    $(this).addClass('on');
});
</code>```

if clicked select1, the div (class="cw map_box") will change (class="cw map_box on")..

it works well but the problem is when i clicked select1 the page refresh it then click event also disappear.. is there anay way to keep click event? it just color change event

thank you


问:
how to limit map repeat on leaflet?

I want only one world map to be shown.

I tried searching about the problem But I did not find a solution.

Title: how to limit map repeat on leaflet?


问:
How use mutual information when Y is 2D Array
I have x and y data in 2D array. then I want to find the correlation value between x and y using mutual information. But whenI try it, y should be 1D array. can I use 2d array for y

X shape : 2050,11

X Data : [  0.   0.   0.  11.   1.  39.   0.  52.   0. 130.   0.]

Y shape : 2050,11

Y Data : [  0.   0.   0.  33.  33.  26.   0.  66.   0. 130.   0.]

```<code>from sklearn.feature_selection import mutual_info_regression
from sklearn.feature_selection import SelectKBest
MIData = mutual_info_regression(SIselection,test_SIselection)
MIData = SelectKBest(score_func=mutual_info_regression,k='all')
df_MIData=MIData.fit_transform(SIselection,test_SIselection)
</code>```

Error msg : ValueError: y should be a 1d array, got an array of shape (2050, 11) instead.

Body:
I have x and y data in 2D array. then I want to find the correlation value between x and y using mutual information. But whenI try it, y should be 1D array. can I use 2d array for y

X shape : 2050,11

X Data : [  0.   0.   0.  11.   1.  39.   0.  52.   0. 130.   0.]

Y shape : 2050,11

Y Data : [  0.   0.   0.  33.  33.  26.   0.  66.   0. 130.   0.]

from sklearn.feature_selection import mutual_info_regression
from sklearn.feature_selection import SelectKBest
MIData = mutual_info_regression(SIselection,test_SIselection)
MIData = SelectKBest(score_func=mutual_info_regression,k='all')
df_MIData=MIData.fit_transform(SIselection,test_SIselection)

Error msg : ValueError: y should be a 1d array, got an array of shape (2050, 11) instead.