问:
I want to add condition if user already save the image than show toast image already saved
The current code works to save the photo but I want to implement the toast code below when the user saves the image already it show image save already. Any ideas how I would do this.

Below is the source code to take the photo:

```<code>
holder.save.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        checkFolder();
        final String path = imagesList.get(position).getPath();
        final File file=new File(path);
        String destPath = Environment.getExternalStorageDirectory().getAbsolutePath()+Common.APP_DIR;
        final File destFile =new File(destPath);
        try {
            FileUtils.copyFileToDirectory(file, destFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
        MediaScannerConnection.scanFile(context, new String[]{destPath + status.getTitle()},
                new String[]{"*/*"}, new MediaScannerConnection.MediaScannerConnectionClient() {
                    @Override
                    public void onMediaScannerConnected() {

                    }

                    @Override
                    public void onScanCompleted(String path, Uri uri) {

                    }
                });
        Toast.makeText(context, "Image Saved Successfully!", Toast.LENGTH_SHORT).show();
    }
});
</code>```

Body:
The current code works to save the photo but I want to implement the toast code below when the user saves the image already it show image save already. Any ideas how I would do this.

Below is the source code to take the photo:

holder.save.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        checkFolder();
        final String path = imagesList.get(position).getPath();
        final File file=new File(path);
        String destPath = Environment.getExternalStorageDirectory().getAbsolutePath()+Common.APP_DIR;
        final File destFile =new File(destPath);
        try {
            FileUtils.copyFileToDirectory(file, destFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
        MediaScannerConnection.scanFile(context, new String[]{destPath + status.getTitle()},
                new String[]{"*/*"}, new MediaScannerConnection.MediaScannerConnectionClient() {
                    @Override
                    public void onMediaScannerConnected() {

                    }

                    @Override
                    public void onScanCompleted(String path, Uri uri) {

                    }
                });
        Toast.makeText(context, "Image Saved Successfully!", Toast.LENGTH_SHORT).show();
    }
});


来源: stackexchange

问:
macos font display exception
I recently found that my editor font display is abnormal. What is the reason for this? This is the screenshot.
My system is mac os monterey 12.6.
enter image description here

Is it because I modified the font file of the system? But I have restored the system fonts.
I want the i and f characters to display normally when they are together.
enter image description here

ContentLicense: CC BY-SA 4.0

Title: macos font display exception


问:
Forge Laravel ssh2
I'm hosting a wordpress site on forge laravel. In one of my files I want to use ssh2_connect. But the ssh2 php module isn't installed. The site is running on PHP 8.0.

I've tried to install it through different commands in my terminal via ssh. But when I'm running the command php -m | grep shh2 it doesn't return anything. I've added extension=ssh2.so to the php.ini, but then I'm getting the error: PHP Startup: ssh2: Unable to initialize module.

Can somebody help me with the correct commands to run? My knowledge with this kind of stuff is minimal so some help would be appreciated :)

Title: Forge Laravel ssh2


问:
How to check django login status in JavaScript?
What is the best way to check django user is authenticated in JavaScript file?</p>


问:
Responsive slider timeline (NextJs project) with Swiper
I am new to NextJs/ReactJs and I was trying to implement the Responsive slide with Swiperjs which is available in codepen.io
Here is the link to codepen.
Responsive slider timeline with Swiper

Below are my steps I carried out;

Installed JQuery (npm install)

Imported both swiper.min.css and swiper.min.js CDNs to my _Document.js file

Added the css files to Globals.css for time being

Created a TimelineComponent.js to have the swiper component separately.

imported TimelineComponent.js in the index.js

When I run the project it nicely shows you the expected output as below.

But when I resize my browser it behaves abnormally like below

```<code>    import React, { useEffect } from 'react';
    import $ from 'jquery';

    function TimeLineComponent() {
      function operateTimeline() {
        var timelineSwiper = new Swiper('.timeline .swiper-container', {
          direction: 'vertical',
          loop: false,
          speed: 1600,
          pagination: '.swiper-pagination',
          paginationBulletRender: function (swiper, index, className) {
            var year = document
              .querySelectorAll('.swiper-slide')
              [index].getAttribute('data-year');
            return '<span class="' + className + '">' + year + '</span>';
          },
          paginationClickable: true,
          nextButton: '.swiper-button-next',
          prevButton: '.swiper-button-prev',
          breakpoints: {
            768: {
              direction: 'horizontal',
            },
          },
        });
      }

      useEffect(() => {
        $(window).on('load resize', operateTimeline);
        operateTimeline();
        return () => {
          $(window).off('load resize');
        };
      }, []);

      return (
        <div className="timeline-container">
          <div className="timeline">
            <div className="swiper-container">
              <div className="swiper-wrapper">
                <div
                  className="swiper-slide"
                  style={{
                    backgroundImage: "url('https://unsplash.it/1920/500?image=11')",
                  }}
                  data-year="2011"
                >
                  <div className="swiper-slide-content">
                    <span className="timeline-year">2011</span>
                    <h4 className="timeline-title">Our nice super title</h4>
                    <p className="timeline-text">
                      Lorem ipsum dolor site amet, consectetur adipscing elit, sed
                      do eisumod tempor incididut ut labore et dolore magna aliqua.
                      Ut enim ad mimim venjam, quis nostrud exercitation ullamco
                      laboris nisi ut aliquip ex ea commodo consequat.
                    </p>
                  </div>
                </div>
                <div
                  className="swiper-slide"
                  style={{
                    backgroundImage: "url('https://unsplash.it/1920/500?image=12')",
                  }}
                  data-year="2012"
                >
                  <div className="swiper-slide-content">
                    <span className="timeline-year">2012</span>
                    <h4 className="timeline-title">Our nice super title</h4>
                    <p className="timeline-text">
                      Lorem ipsum dolor site amet, consectetur adipscing elit, sed
                      do eisumod tempor incididut ut labore et dolore magna aliqua.
                      Ut enim ad mimim venjam, quis nostrud exercitation ullamco
                      laboris nisi ut aliquip ex ea commodo consequat.
                    </p>
                  </div>
                </div>
              </div>
              <div className="swiper-button-prev"></div>
              <div className="swiper-button-next"></div>
              <div className="swiper-pagination"></div>
            </div>
          </div>
        </div>
      );
    }

export default TimeLineComponent;
</code>```

Error can be replicated in the above codepen example as well. Most probably this is with the styling

Your help is much appreciated.

Body:
I am new to NextJs/ReactJs and I was trying to implement the Responsive slide with Swiperjs which is available in codepen.io
Here is the link to codepen.
Responsive slider timeline with Swiper

Below are my steps I carried out;

Installed JQuery (npm install)

Imported both swiper.min.css and swiper.min.js CDNs to my _Document.js file

Added the css files to Globals.css for time being

Created a TimelineComponent.js to have the swiper component separately.

imported TimelineComponent.js in the index.js

When I run the project it nicely shows you the expected output as below.

But when I resize my browser it behaves abnormally like below

    import React, { useEffect } from 'react';
    import $ from 'jquery';

    function TimeLineComponent() {
      function operateTimeline() {
        var timelineSwiper = new Swiper('.timeline .swiper-container', {
          direction: 'vertical',
          loop: false,
          speed: 1600,
          pagination: '.swiper-pagination',
          paginationBulletRender: function (swiper, index, className) {
            var year = document
              .querySelectorAll('.swiper-slide')
              [index].getAttribute('data-year');
            return '' + year + '';
          },
          paginationClickable: true,
          nextButton: '.swiper-button-next',
          prevButton: '.swiper-button-prev',
          breakpoints: {
            768: {
              direction: 'horizontal',
            },
          },
        });
      }

      useEffect(() => {
        $(window).on('load resize', operateTimeline);
        operateTimeline();
        return () => {
          $(window).off('load resize');
        };
      }, []);

      return (

                    2011

Our nice super title

                      Lorem ipsum dolor site amet, consectetur adipscing elit, sed
                      do eisumod tempor incididut ut labore et dolore magna aliqua.
                      Ut enim ad mimim venjam, quis nostrud exercitation ullamco
                      laboris nisi ut aliquip ex ea commodo consequat.

                    2012

Our nice super title

                      Lorem ipsum dolor site amet, consectetur adipscing elit, sed
                      do eisumod tempor incididut ut labore et dolore magna aliqua.
                      Ut enim ad mimim venjam, quis nostrud exercitation ullamco
                      laboris nisi ut aliquip ex ea commodo consequat.

      );
    }

export default TimeLineComponent;

Error can be replicated in the above codepen example as well. Most probably this is with the styling

Your help is much appreciated.


问:
OpenSearch - Cant filter an aggregated field
I'm currently working on an edited filter on magento2 (the sold_by field). The OS returns me a lot of sellers and I want to optimize the request to only gather the sellers in the current store. I indexed all my products with a list of all sellers with the format "seller-storeId", it's ok until I try to filter the request results. When I do this, it works

```<code>"my_filter": {
      "filter": {
        "term": {
          "type_id": "simple"
        }
      },
      "aggregations": {
        "type_id_test": {
          "terms": {
            "field": "type_id",
            "size": 10,
            "min_doc_count": 1,
            "shard_min_doc_count": 0,
            "show_term_doc_count_error": false,
            "order": [
              {
                "_count": "desc"
              },
              {
                "_key": "asc"
              }
            ]
          }
        }
      }
    },
</code>```

But when I do it with the field I am working on, it results 0 (but I have occurrences, so it should return at least 1)

The problem I identified is that type_id is mapped like this

```<code>"type_id": { -
          "type": "keyword"
        },
</code>```

and my field is

```<code>"option_text_sold_by": { -
          "type": "text",
          "fields": { -
            "untouched": { -
              "type": "keyword",
              "ignore_above": 256
            }
          },
          "copy_to": [ -
            "search",
            "spelling"
          ],
          "analyzer": "standard",
          "fielddata": true
        },
</code>```

I've never worked with Elastic/OpenSearch, so it's kinda hard for me. Has anyone ever faced my issue ? :(

Body:
I'm currently working on an edited filter on magento2 (the sold_by field). The OS returns me a lot of sellers and I want to optimize the request to only gather the sellers in the current store. I indexed all my products with a list of all sellers with the format "seller-storeId", it's ok until I try to filter the request results. When I do this, it works

"my_filter": {
      "filter": {
        "term": {
          "type_id": "simple"
        }
      },
      "aggregations": {
        "type_id_test": {
          "terms": {
            "field": "type_id",
            "size": 10,
            "min_doc_count": 1,
            "shard_min_doc_count": 0,
            "show_term_doc_count_error": false,
            "order": [
              {
                "_count": "desc"
              },
              {
                "_key": "asc"
              }
            ]
          }
        }
      }
    },

But when I do it with the field I am working on, it results 0 (but I have occurrences, so it should return at least 1)

The problem I identified is that type_id is mapped like this

"type_id": { -
          "type": "keyword"
        },

and my field is

"option_text_sold_by": { -
          "type": "text",
          "fields": { -
            "untouched": { -
              "type": "keyword",
              "ignore_above": 256
            }
          },
          "copy_to": [ -
            "search",
            "spelling"
          ],
          "analyzer": "standard",
          "fielddata": true
        },

I've never worked with Elastic/OpenSearch, so it's kinda hard for me. Has anyone ever faced my issue ? :(


问:
I want to make a subscription system with django
How can I make an auto incrementing timer, for example, it will count forward 1 year from now and these transactions will be saved in the database.</p>


问:
requests.post in python returns null/empty in php when sending json data?
I am attempting to POST from python to php using requests.post however $_POST returns NULL or empty in php.

My PHP should output the request so I can loop through it.

Python

```<code># Import JSON data into POST
def create():
    #print(json.dumps(thisisjson, indent=4))
    #print(thisisjson)
    headers = {'Content-Type': 'application/json', 'Accept':'application/json'}
    r = requests.post(url='https://URL/import.php', data=json.dumps(thisisjson), verify=True, headers=headers)
    print(r.status_code)
    print(r.headers)
    print(r.text)

create()
</code>```

PHP

```<code><?php var_dump(json_decode($_POST, true)); ?>
</code>```

Sample data

```<code>[
  {
    "Work_order": 123
  },
  {
    "Work_order": 1234
  },
  {
    "Work_order": 12345
  }
]
</code>```

Body:
I am attempting to POST from python to php using requests.post however $_POST returns NULL or empty in php.

My PHP should output the request so I can loop through it.

Python

# Import JSON data into POST
def create():
    #print(json.dumps(thisisjson, indent=4))
    #print(thisisjson)
    headers = {'Content-Type': 'application/json', 'Accept':'application/json'}
    r = requests.post(url='https://URL/import.php', data=json.dumps(thisisjson), verify=True, headers=headers)
    print(r.status_code)
    print(r.headers)
    print(r.text)

create()

PHP

<?php var_dump(json_decode($_POST, true)); ?>

Sample data

[
  {
    "Work_order": 123
  },
  {
    "Work_order": 1234
  },
  {
    "Work_order": 12345
  }
]


问:
How to move an @hapi plugin out to its own separate file
I am upgrading the Node version of my system and have got to the point of updating hapi to @hapi/hapi. I am using Node version 14.0.0 and @hapi/hapi version 20.2.2
I've written a simple server with just one route, which works perfectly:

```<code>'use strict';
const Hapi = require('@hapi/hapi');
const init = async () => {
    const server = Hapi.server({
        port: 3000,
        host: 'localhost'
    });

    // await server.register(require('./plugins'))

    server.route({
        method: 'GET',
        path: '/',
        handler: (request, h) => {
            return 'Hello World!';
        }
    });

    await server.start();
    console.log(`'Test' server running on Node ${process.version} at:`, server.info.uri);
};
init();
</code>```

However, if I uncomment the server.register call and comment out the server.route code I get an error.  The file ./plugins/index.js looks like this:

```<code>'use strict';

const report = {
    name: 'report',
    version: '1.0.0',
    register: async function (server, options) {

        server.route({
            method: 'GET',
            path: '/',
            handler: (request, h) => {

                return 'Hello World!';
            }
        });
    }
}
</code>```

The error I am getting from the @hapi server is this:

```<code>(node:4793) UnhandledPromiseRejectionWarning: Error: Invalid plugin options  {
  "plugin": {
    "register" [1]: -- missing --
  }
}

[1] "plugin.register" is required
</code>```

It looks like a very simple issue, but I cannot find anything relatively modern on the Internet to help me out.  Please can someone just point me in the right direction? - thank you.

EDITED:  I have moved @hapi/hapi up to the latest version, 21.1.0, and Node up to 18.12.1 but still get the same message.

Body:
I am upgrading the Node version of my system and have got to the point of updating hapi to @hapi/hapi. I am using Node version 14.0.0 and @hapi/hapi version 20.2.2
I've written a simple server with just one route, which works perfectly:

'use strict';
const Hapi = require('@hapi/hapi');
const init = async () => {
    const server = Hapi.server({
        port: 3000,
        host: 'localhost'
    });

    // await server.register(require('./plugins'))

    server.route({
        method: 'GET',
        path: '/',
        handler: (request, h) => {
            return 'Hello World!';
        }
    });

    await server.start();
    console.log(`'Test' server running on Node ${process.version} at:`, server.info.uri);
};
init();

However, if I uncomment the server.register call and comment out the server.route code I get an error.  The file ./plugins/index.js looks like this:

'use strict';

const report = {
    name: 'report',
    version: '1.0.0',
    register: async function (server, options) {

        server.route({
            method: 'GET',
            path: '/',
            handler: (request, h) => {

                return 'Hello World!';
            }
        });
    }
}

The error I am getting from the @hapi server is this:

(node:4793) UnhandledPromiseRejectionWarning: Error: Invalid plugin options  {
  "plugin": {
    "register" [1]: -- missing --
  }
}

[1] "plugin.register" is required

It looks like a very simple issue, but I cannot find anything relatively modern on the Internet to help me out.  Please can someone just point me in the right direction? - thank you.

EDITED:  I have moved @hapi/hapi up to the latest version, 21.1.0, and Node up to 18.12.1 but still get the same message.


问:
cmake using two shared libraries that are dependant on each other
I'm trying to build a program, that is dependant on two other projects (ugh and thermough). thermough is dependant on ugh and both have multiple libraries.

The code species.cpp is the following:

```<code>#include "Test.h"
#include "tabstream.h"
#include <fstream>

int main()
{

    ugh::Test tp("water");

    std::ofstream file;
    tabstream tfile(file,16);

    file.open("water");

    tfile  << "T"
           << std::endl;
return 0;
}
</code>```

This is my CMakeLists.txt:

```<code>####################################
# General setup
####################################

cmake_minimum_required (VERSION 3.5.2)
project (getSpeciesTest VERSION 1.0)
set(CMAKE_VERBOSE_MAKEFILE OFF)

include(CMakePrintHelpers)
####################################
# Executable
####################################

add_executable(specieTestEx species.cpp)
#configure_file(TutorialConfig.h.in TutorialConfig.h)

####################################
# Libraries, etc
####################################

set(PATH_TO_SRC ${PROJECT_SOURCE_DIR}/../src)
set(PATH_TO_THERMOUGH ${PROJECT_SOURCE_DIR}/../../build)
set(PATH_TO_UGH ${PROJECT_SOURCE_DIR}/../../../ugh/build)
set(PATH_TO_UGH_SRC ${PROJECT_SOURCE_DIR}/../../../ugh/git/src)

include_directories (${PATH_TO_SRC})
include_directories (${PATH_TO_SRC}/ughMixture)
include_directories (${PATH_TO_SRC}/mathUtils)
include_directories (${PATH_TO_UGH})
include_directories (${PATH_TO_UGH_SRC}/ughBase)
include_directories (${PATH_TO_UGH_SRC}/ughMixture)
include_directories (${PATH_TO_UGH_SRC}/ughMath)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math1)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math2)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math3)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math4)

list(APPEND LIBS_THERMOUGH [...])
list(APPEND LIBS_UGH [...])

##this is where the already built libraries are
link_directories(${PATH_TO_THERMOUGH})
link_directories(${PATH_TO_UGH})

target_link_libraries(specieTestEx ${LIBS_THERMOUGH})
target_link_libraries(specieTestEx ${LIBS_UGH})

</code>```

I did not write both projects, I'm just trying to use so functionalities from thermough and therefore need to link both libraries. The libraries are as shared libraries in the build folders (.so files). I checked in the CMakeList.txt of thermough and the libraries of both projects are linked there.
My questions now:

As far as I understand it, in the libraries only the .cpp files and not the headers are compiled. Therefore I need to include all the directories to the header files (and if one called function is dependant on another file, i need to include the path to that directory and so on). This leads me to having so many include_directories commands. Is there an easier way?

Secondly I get the following error when compiling:

[SRCdirectory]/../../../ugh/git/src/ughMath/math4/mathImplementation.h:8:32: fatal error: ughMath/MathLog.h: No such file or directory

The path to ughMath is linked in my CMakeList.txt. Why does this happen then and what can I correct?

Thank you for your answer in advance.

Last but not least this is the structure of the code I'm working with:

code

ugh

git

build (contains all ugh_[..].so libraries)

thermough

git
- src
- myTestCase (contains species.cpp and the CMakeList.txt I'm talking about)

build (contains all thermough_[..].so libraries)

Body:
I'm trying to build a program, that is dependant on two other projects (ugh and thermough). thermough is dependant on ugh and both have multiple libraries.

The code species.cpp is the following:

#include "Test.h"
#include "tabstream.h"
#include <fstream>

int main()
{

    ugh::Test tp("water");

    std::ofstream file;
    tabstream tfile(file,16);

    file.open("water");

    tfile  << "T"
           << std::endl;
return 0;
}

This is my CMakeLists.txt:

####################################
# General setup
####################################

cmake_minimum_required (VERSION 3.5.2)
project (getSpeciesTest VERSION 1.0)
set(CMAKE_VERBOSE_MAKEFILE OFF)

include(CMakePrintHelpers)
####################################
# Executable
####################################

add_executable(specieTestEx species.cpp)
#configure_file(TutorialConfig.h.in TutorialConfig.h)

####################################
# Libraries, etc
####################################

set(PATH_TO_SRC ${PROJECT_SOURCE_DIR}/../src)
set(PATH_TO_THERMOUGH ${PROJECT_SOURCE_DIR}/../../build)
set(PATH_TO_UGH ${PROJECT_SOURCE_DIR}/../../../ugh/build)
set(PATH_TO_UGH_SRC ${PROJECT_SOURCE_DIR}/../../../ugh/git/src)

include_directories (${PATH_TO_SRC})
include_directories (${PATH_TO_SRC}/ughMixture)
include_directories (${PATH_TO_SRC}/mathUtils)
include_directories (${PATH_TO_UGH})
include_directories (${PATH_TO_UGH_SRC}/ughBase)
include_directories (${PATH_TO_UGH_SRC}/ughMixture)
include_directories (${PATH_TO_UGH_SRC}/ughMath)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math1)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math2)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math3)
include_directories (${PATH_TO_UGH_SRC}/ughMath/math4)

list(APPEND LIBS_THERMOUGH [...])
list(APPEND LIBS_UGH [...])

##this is where the already built libraries are
link_directories(${PATH_TO_THERMOUGH})
link_directories(${PATH_TO_UGH})

target_link_libraries(specieTestEx ${LIBS_THERMOUGH})
target_link_libraries(specieTestEx ${LIBS_UGH})

I did not write both projects, I'm just trying to use so functionalities from thermough and therefore need to link both libraries. The libraries are as shared libraries in the build folders (.so files). I checked in the CMakeList.txt of thermough and the libraries of both projects are linked there.
My questions now:

As far as I understand it, in the libraries only the .cpp files and not the headers are compiled. Therefore I need to include all the directories to the header files (and if one called function is dependant on another file, i need to include the path to that directory and so on). This leads me to having so many include_directories commands. Is there an easier way?

Secondly I get the following error when compiling:

[SRCdirectory]/../../../ugh/git/src/ughMath/math4/mathImplementation.h:8:32: fatal error: ughMath/MathLog.h: No such file or directory

The path to ughMath is linked in my CMakeList.txt. Why does this happen then and what can I correct?

Thank you for your answer in advance.

Last but not least this is the structure of the code I'm working with:

code

ugh

git

build (contains all ugh_[..].so libraries)

thermough

git
- src
- myTestCase (contains species.cpp and the CMakeList.txt I'm talking about)

build (contains all thermough_[..].so libraries)


问:
How Apache virtual host is working actually when name based is not setup
I have started one EC2 instance
I am using http as I have not set up anything related to SSL yet.

Url I am using is suppose http://ec2-instance-domain/ which is publicly accessible

I install 2 applications on it

Apaches sites-available conf files are as follows
/etc/apache2/sites-available/zurmo.conf
/etc/apache2/sites-available/suitecrm.conf

Since I dont have any domain for any of them yet
ServerName is in actual (example is literally present) zurmo.example.com and  suitecrm.example.com

In these files, document root is /var/www/html/zurmo and /var/www/html/suitecrm respectively

When I started apache, both applications are working
If I go to http://ec2-instance-domain/zurmo -> it starts zurmo application login screen
If I go to http://ec2-instance-domain/suitecrm -> it starts suitecrm application login screen

I am confused as how this is working.

What I read about name-based virtualhost was www.one.com would point virtual host having ServerName www.one.com and so on

But here domain name is of ec2-instance which is nowhere used in apache conf files.

Can someone pls explain how this is working in these case ? I tried reading many material but all explain in above www.one.com scenario, not for my scenario

Thanks in advance


问:
&array_name in C
So I understand that the array name represents the first address of the array. Thus, printf("%d", name5); should return an address. However, I realized printf("\n%d", &name5); returns the same address as the previous expression.

Does &name5 represent "address of an address"? How does this work?

I also realized this &array_name syntax wouldn't work on malloc. Would appreciate any explanation why this may be the case.

```<code>    char name5[10] = "Matt";
    printf("%d", name5);
    printf("\n%d", &name5);

    //char* name2 = (char*)malloc(10);
    //scanf("%s", &name2); // &pointer
    //printf("%s", name2); //error
</code>```

Title: &array_name in C

Body:
So I understand that the array name represents the first address of the array. Thus, printf("%d", name5); should return an address. However, I realized printf("\n%d", &name5); returns the same address as the previous expression.

Does &name5 represent "address of an address"? How does this work?

I also realized this &array_name syntax wouldn't work on malloc. Would appreciate any explanation why this may be the case.

    char name5[10] = "Matt";
    printf("%d", name5);
    printf("\n%d", &name5);

    //char* name2 = (char*)malloc(10);
    //scanf("%s", &name2); // &pointer
    //printf("%s", name2); //error


问:
How do I fix this speech_recognition error?
I am writing a script involving TTS and there is a problem with the "speech_recognition" module. I have already downloaded the module with pip3 install SpeechRecognition as when I wrote pip3 install speech_recognition, it returned "ERROR: Could not find a version that satisfies the requirement speech_recognition (from versions: none)
ERROR: No matching distribution found for speech_recognition".

This is the line of code that triggers the error.

import speech_recognition as sr

I was trying to import a speech recognition program, but it just returned "ModuleNotFoundError: No module named 'speech_recognition'"


问:
Limit number of characters users can send
I'm trying to find a way of limiting the number of characters users in my telegram channel can send in a single text

I have looked for a bot that can do this but haven't find one


问:
Column name in SELECTCOLUMNS ()
I'm new into DAX and with trial/error and this formum came to the query below.
It works fine
I would like to do one optimization, adjust the column headers presented
I tried many options and keep running into errors
Can someone please advise what needs to be adjusted in order to adjust the name of the first column into EXAMPLE

```<code>DEFINE VAR __DS0Core =
  SELECTCOLUMNS(
    KEEPFILTERS(
      FILTER(
        KEEPFILTERS(
          SUMMARIZECOLUMNS(
            'Vessel Historic'[Vessel Historic Commercial Manager],
            'Vessel Grouping'[Vessel Grouping Name],
            'Operations Contract'[TC Code],
            'Operations Contract Fact'[From GMT Date Time],
            'Operations Contract Fact'[To GMT Date Time],
            'Operations Contract'[Charterer],
            'Operations Contract'[Currency],
            'Operations Contract'[Proj Act Redel GMT Date],
            'Operations Contract'[Redelivery Date],
            'Operations Contract'[Hire Rate],
            "CountRowsOperations_Contract_Fact", CALCULATE(COUNTROWS('Operations Contract Fact'))
          )
        ),
        AND(
                'Vessel Historic'[Vessel Historic Commercial Manager]="V06 Iver Ships B.V.",
        'Operations Contract Fact'[To GMT Date Time]>TODAY()-30)
      )
    ),
    "'Vessel Historic'[Vessel Historic Commercial Manager]", 'Vessel Historic'[Vessel Historic Commercial Manager],
    "'Vessel Grouping'[Vessel Grouping Name]", 'Vessel Grouping'[Vessel Grouping Name],
    "'Operations Contract'[TC Code]", 'Operations Contract'[TC Code],
    "'Operations Contract Fact'[From GMT Date Time]", 'Operations Contract Fact'[From GMT Date Time],
    "'Operations Contract Fact'[To GMT Date Time]", 'Operations Contract Fact'[To GMT Date Time],
    "'Operations Contract'[Charterer]", 'Operations Contract'[Charterer],
    "'Operations Contract'[Currency]", 'Operations Contract'[Currency],
    "'Operations Contract'[Proj Act Redel GMT Date]", 'Operations Contract'[Proj Act Redel GMT Date],
    "'Operations Contract'[Redelivery Date]", 'Operations Contract'[Redelivery Date],
    "'Operations Contract'[Hire Rate]", 'Operations Contract'[Hire Rate]
  )

EVALUATE
  __DS0Core

ORDER BY
  'Vessel Historic'[Vessel Historic Commercial Manager],
  'Vessel Grouping'[Vessel Grouping Name],
  'Operations Contract'[TC Code],
  'Operations Contract Fact'[From GMT Date Time],
  'Operations Contract Fact'[To GMT Date Time],
  'Operations Contract'[Charterer],
  'Operations Contract'[Currency],
  'Operations Contract'[Proj Act Redel GMT Date],
  'Operations Contract'[Redelivery Date],
  'Operations Contract'[Hire Rate]

</code>```

I would like the first column to show EXAMPLE
I tried adjusting the first line after SUMMARIZECOLUMNS
I tried adjusting the first line after the AND statement

Title: Column name in SELECTCOLUMNS ()

Body:
I'm new into DAX and with trial/error and this formum came to the query below.
It works fine
I would like to do one optimization, adjust the column headers presented
I tried many options and keep running into errors
Can someone please advise what needs to be adjusted in order to adjust the name of the first column into EXAMPLE

DEFINE VAR __DS0Core =
  SELECTCOLUMNS(
    KEEPFILTERS(
      FILTER(
        KEEPFILTERS(
          SUMMARIZECOLUMNS(
            'Vessel Historic'[Vessel Historic Commercial Manager],
            'Vessel Grouping'[Vessel Grouping Name],
            'Operations Contract'[TC Code],
            'Operations Contract Fact'[From GMT Date Time],
            'Operations Contract Fact'[To GMT Date Time],
            'Operations Contract'[Charterer],
            'Operations Contract'[Currency],
            'Operations Contract'[Proj Act Redel GMT Date],
            'Operations Contract'[Redelivery Date],
            'Operations Contract'[Hire Rate],
            "CountRowsOperations_Contract_Fact", CALCULATE(COUNTROWS('Operations Contract Fact'))
          )
        ),
        AND(
                'Vessel Historic'[Vessel Historic Commercial Manager]="V06 Iver Ships B.V.",
        'Operations Contract Fact'[To GMT Date Time]>TODAY()-30)
      )
    ),
    "'Vessel Historic'[Vessel Historic Commercial Manager]", 'Vessel Historic'[Vessel Historic Commercial Manager],
    "'Vessel Grouping'[Vessel Grouping Name]", 'Vessel Grouping'[Vessel Grouping Name],
    "'Operations Contract'[TC Code]", 'Operations Contract'[TC Code],
    "'Operations Contract Fact'[From GMT Date Time]", 'Operations Contract Fact'[From GMT Date Time],
    "'Operations Contract Fact'[To GMT Date Time]", 'Operations Contract Fact'[To GMT Date Time],
    "'Operations Contract'[Charterer]", 'Operations Contract'[Charterer],
    "'Operations Contract'[Currency]", 'Operations Contract'[Currency],
    "'Operations Contract'[Proj Act Redel GMT Date]", 'Operations Contract'[Proj Act Redel GMT Date],
    "'Operations Contract'[Redelivery Date]", 'Operations Contract'[Redelivery Date],
    "'Operations Contract'[Hire Rate]", 'Operations Contract'[Hire Rate]
  )

EVALUATE
  __DS0Core

ORDER BY
  'Vessel Historic'[Vessel Historic Commercial Manager],
  'Vessel Grouping'[Vessel Grouping Name],
  'Operations Contract'[TC Code],
  'Operations Contract Fact'[From GMT Date Time],
  'Operations Contract Fact'[To GMT Date Time],
  'Operations Contract'[Charterer],
  'Operations Contract'[Currency],
  'Operations Contract'[Proj Act Redel GMT Date],
  'Operations Contract'[Redelivery Date],
  'Operations Contract'[Hire Rate]

I would like the first column to show EXAMPLE
I tried adjusting the first line after SUMMARIZECOLUMNS
I tried adjusting the first line after the AND statement


问:
DeskTop: How to Fix MC1000 unknown Build error - could not find type 'System.Management.Instrumentation.InstrumentedAttribute
I am migrating a .net framework 4.6.1 Desktop app to Core 6. I have resolved all errors except this one: MC1000 Unknown build error, 'Could not find type 'System.Management.Instrumentation.InstrumentedAttribute' in assembly 'C:\Users\M70151.nuget\packages\system.management\7.0.0\lib\net6.0\System.Management.dll'.'    ABC C:\ProgramFiles\dotnet\sdk\7.0.100\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets.

I cannot see System.Management being used anywhere in the App. I do not see WinFX.Targets referenced in the framework version of the App. I guess this was added because of the migration? Any ideas on resolving this issue?

I tried replacing system.Management, verifying the path, no success. I checked the System.Management.Instrumentation for the InstrumentedMethod. It does not appear to exist.How can I tell what is trying to use the method?


问:
Uncaught TypeError: Cannot read properties of null (reading 'includes') at Text.render (Text.js:421:1)
Have issue with Multi bar chart when i am trying to run the below code with latest version
Versions:  "recharts": "^2.2.0","react": "^18.2.0","react-dom":
"^18.2.0", "react-scripts": "^5.0.1",

```<code>Uncaught TypeError: Cannot read properties of null (reading 'includes')
at Text.render (Text.js:421:1)
at finishClassComponent (react-dom.development.js:17164:1)
at updateClassComponent (react-dom.development.js:17121:1)
at beginWork (react-dom.development.js:18747:1)
at beginWork$1 (react-dom.development.js:23691:1)
at performUnitOfWork (react-dom.development.js:22960:1)
at workLoopSync (react-dom.development.js:22883:1)
at renderRootSync (react-dom.development.js:22856:1)
at recoverFromConcurrentError (react-dom.development.js:22348:1)
at performConcurrentWorkOnRoot (react-dom.development.js:22260:1)
</code>```

Code :

```<code>    import React from 'react'
import {
  BarChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Bar
} from 'recharts'
import PropTypes from 'prop-types'
import { CustomTooltip } from './CustomToolTip'

export default function MultiBarsChart ({ bars, barSize = 25, dataKey = 'name', dataURL, params }) {
  let dataLength = 0
  dataLength = data?.length

  return (
    <div>
      {dataLength !== 0
      ? <ResponsiveContainer height={298} width='100%' margin={0}>
        <BarChart
          height={300} data={data}
          margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
        >

          <XAxis dataKey={dataKey} />
          <YAxis
            type='number'
            yAxisId={0}
            axisLine={false}
            stroke={null}
          />
          <CartesianGrid strokeDasharray='1 0' vertical={false} />
          <Tooltip content={<CustomTooltip />} />
          {bars.map((bar) =>
            <Bar barSize={barSize} key={bar.id} dataKey={bar.name} fill={bar.color} />
          )}
        </BarChart>

      </ResponsiveContainer>
    : <div className='overall-title'>There is no data available.</div>}
    </div>
  )
}
</code>```

Library: Rechart

```<code>data:  [
{"incomplete": 12,"complete": 7,"name": "abc"},
{'incomplete": 31,"complete": 25,"name": "bdc"}

bars=[
{ name: 'complete', id: 1, color: '#7500c0' },
{ name: 'incomplete', id: 2, color: '#c4cdd5' }
]
</code>```

Body:
Have issue with Multi bar chart when i am trying to run the below code with latest version
Versions:  "recharts": "^2.2.0","react": "^18.2.0","react-dom":
"^18.2.0", "react-scripts": "^5.0.1",

Uncaught TypeError: Cannot read properties of null (reading 'includes')
at Text.render (Text.js:421:1)
at finishClassComponent (react-dom.development.js:17164:1)
at updateClassComponent (react-dom.development.js:17121:1)
at beginWork (react-dom.development.js:18747:1)
at beginWork$1 (react-dom.development.js:23691:1)
at performUnitOfWork (react-dom.development.js:22960:1)
at workLoopSync (react-dom.development.js:22883:1)
at renderRootSync (react-dom.development.js:22856:1)
at recoverFromConcurrentError (react-dom.development.js:22348:1)
at performConcurrentWorkOnRoot (react-dom.development.js:22260:1)

Code :

    import React from 'react'
import {
  BarChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Bar
} from 'recharts'
import PropTypes from 'prop-types'
import { CustomTooltip } from './CustomToolTip'

export default function MultiBarsChart ({ bars, barSize = 25, dataKey = 'name', dataURL, params }) {
  let dataLength = 0
  dataLength = data?.length

  return (

      {dataLength !== 0
      ? <ResponsiveContainer height={298} width='100%' margin={0}>
        <BarChart
          height={300} data={data}
          margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
        >

          <XAxis dataKey={dataKey} />
          <YAxis
            type='number'
            yAxisId={0}
            axisLine={false}
            stroke={null}
          />
          <CartesianGrid strokeDasharray='1 0' vertical={false} />
          <Tooltip content={<CustomTooltip />} />
          {bars.map((bar) =>
            <Bar barSize={barSize} key={bar.id} dataKey={bar.name} fill={bar.color} />
          )}
        </BarChart>

      </ResponsiveContainer>
    :
There is no data available.
}

  )
}

Library: Rechart

data:  [
{"incomplete": 12,"complete": 7,"name": "abc"},
{'incomplete": 31,"complete": 25,"name": "bdc"}

bars=[
{ name: 'complete', id: 1, color: '#7500c0' },
{ name: 'incomplete', id: 2, color: '#c4cdd5' }
]


问:
DB2 database not connecting with notebooks on IBM Watson
Recently I'm working on jupyter notebook of ibm watson and ibm db2 and I want to connect them. But it's showing error. And I am new to ibm db2 and ibm watson. Here is my code:

```<code>!pip install --force-reinstall ibm_db==3.1.0 ibm_db_sa==0.3.3
!pip uninstall sqlalchemy==1.4 -y && pip install sqlalchemy==1.3.24
!pip install ipython-sql

%load_ext sql
</code>```

The sql extension is already loaded. To reload it, use:   %reload_ext
sql

```<code>%sql ibm_db_sa://username:password@6667d8e9-9d4d-4ccb-ba32-21da3bb5aafc.c1ogj3sd0tgtu0lqde00.databases.appdomain.cloud:30376/bludb?security=SSL
</code>```

Ans it showing this error:

Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([]) Can't load plugin: sqlalchemy.dialects:ibm_db_sa Connection info needed in
SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([])

Any suggestion how to connect IBM DB2 on jupyter notebook of IBM watson.

Body:
Recently I'm working on jupyter notebook of ibm watson and ibm db2 and I want to connect them. But it's showing error. And I am new to ibm db2 and ibm watson. Here is my code:

!pip install --force-reinstall ibm_db==3.1.0 ibm_db_sa==0.3.3
!pip uninstall sqlalchemy==1.4 -y && pip install sqlalchemy==1.3.24
!pip install ipython-sql

%load_ext sql

The sql extension is already loaded. To reload it, use:   %reload_ext
sql

%sql ibm_db_sa://username:password@6667d8e9-9d4d-4ccb-ba32-21da3bb5aafc.c1ogj3sd0tgtu0lqde00.databases.appdomain.cloud:30376/bludb?security=SSL

Ans it showing this error:

Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([]) Can't load plugin: sqlalchemy.dialects:ibm_db_sa Connection info needed in
SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([])

Any suggestion how to connect IBM DB2 on jupyter notebook of IBM watson.


问:
Jquery each function anchor points in WordPress
I'm trying to automatically find anchor points in a WordPress blog and show them as a list in a sidebar. So far I've found this. Great to create anchor points, but I want the anchor points underneath 'In this artikel' (left sidebar).

I tried to use append (see below) in the each(function), i didn't worked.

How to achieve this?

Thanks for your help!

$(document).ready(function () {
            $('.post-content h2').each(function () {

                //create id from heading text
                var id = $(this).attr('id') || $(this).text().toLowerCase().replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '').replace(/ +/g, '-');

                //add id to heading
                $(this).attr('id', id);

                //append parent class to heading
                $(this).addClass('anchor-heading');

                //create anchor
                var anchor = $('#');

                //append anchor link after heading text
                $(this).append(anchor);

                $('.post-list').append('
' + anchor + '
');

            });

            //add smooth scroll for anchor links
            $(document).on('click', 'a.anchor-link', function (e) {
                e.preventDefault();
                $('html, body').stop().animate({
                    scrollTop: $($(this).attr('href')).offset().top - 50
                }, 1000, 'linear');
            });

            //navigate to anchor if available
            if (window.location.hash.length > 0) {
                $('a[href="' + window.location.hash + '"]').trigger('click');
            }
        });```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.row {width:100%; display:flex;}
.post-list {width:25%;}
.post-content {width:75%;}

 .post-content p {
            font-size: 1.1rem;
            line-height: 2rem;
            margin-bottom: 2rem;
        }

        /*Anchor Links CSS*/
        .anchor-heading .anchor-link {
            display: inline-block;
            padding-left: .25rem;
            text-decoration: none;
            opacity: 0;
            transition: opacity ease-in-out .25s;
        }

        .anchor-heading .anchor-link:hover {
            opacity: 1 !important;
        }

        .anchor-heading:hover .anchor-link {
            opacity: .5;
        }</code>```

In this artikel

Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Chapter 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Part 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Part 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. /p>

Chapter 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. /p>

```

Body:
I'm trying to automatically find anchor points in a WordPress blog and show them as a list in a sidebar. So far I've found this. Great to create anchor points, but I want the anchor points underneath 'In this artikel' (left sidebar).

I tried to use append (see below) in the each(function), i didn't worked.

How to achieve this?

Thanks for your help!

$(document).ready(function () {
            $('.post-content h2').each(function () {

                //create id from heading text
                var id = $(this).attr('id') || $(this).text().toLowerCase().replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '').replace(/ +/g, '-');

                //add id to heading
                $(this).attr('id', id);

                //append parent class to heading
                $(this).addClass('anchor-heading');

                //create anchor
                var anchor = $('#');

                //append anchor link after heading text
                $(this).append(anchor);

                $('.post-list').append('
' + anchor + '
');

            });

            //add smooth scroll for anchor links
            $(document).on('click', 'a.anchor-link', function (e) {
                e.preventDefault();
                $('html, body').stop().animate({
                    scrollTop: $($(this).attr('href')).offset().top - 50
                }, 1000, 'linear');
            });

            //navigate to anchor if available
            if (window.location.hash.length > 0) {
                $('a[href="' + window.location.hash + '"]').trigger('click');
            }
        });

.row {width:100%; display:flex;}
.post-list {width:25%;}
.post-content {width:75%;}

 .post-content p {
            font-size: 1.1rem;
            line-height: 2rem;
            margin-bottom: 2rem;
        }

        /*Anchor Links CSS*/
        .anchor-heading .anchor-link {
            display: inline-block;
            padding-left: .25rem;
            text-decoration: none;
            opacity: 0;
            transition: opacity ease-in-out .25s;
        }

        .anchor-heading .anchor-link:hover {
            opacity: 1 !important;
        }

        .anchor-heading:hover .anchor-link {
            opacity: .5;
        }

In this artikel

Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Chapter 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Part 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Part 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. /p>

Chapter 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet libero non felis congue bibendum sed ut mauris. Ut mi tellus, dignissim non rutrum et, ultrices et nisi. Pellentesque hendrerit luctus orci in aliquam. Vestibulum molestie, metus vel tincidunt rhoncus, ipsum purus aliquam lorem, at porta ipsum dolor et metus. Duis semper tortor quis ante ullamcorper pulvinar. Nam mattis velit quis augue auctor viverra. Fusce laoreet viverra dui laoreet varius. Fusce augue turpis, interdum vel risus a, suscipit tincidunt nisi. Ut eu nisl congue, aliquam metus a, auctor enim. Aenean a posuere nisl. Aliquam sed condimentum orci. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. /p>


问:
Extract numbers and text in Python Pandas
I am new to Python Pandas, need your guidance. I have following below code which extract specific data from a pdf files and export into a excel file. The code is working fine, however all data are exported into text format. Is there any way I can use text and number extract in same code.

```<code>import os
import pandas as pd
import numpy as np
import glob
import pdfplumber

def get_keyword(start, end, text):

for i in range(len(start)):
    try:
        field = ((text.split(start[i]))[1].split(end[i])[0])
        return field
    except:
        continue

   def main():
   my_dataframe = pd.DataFrame()
   for files in glob.glob("C:/PDFs\*.pdf"):
    with pdfplumber.open(files) as pdf:
        page = pdf.pages[0]
        text = page.extract_text()
        text = " ".join(text.split())

        # obtain keyword #1-Find Supplier-This is text & it is fine
        start = ['SUPPLIER ']
        end = [' Purchase']
        keyword1 = get_keyword(start, end, text)

        # obtain keyword #2-Find Invoice, This is number-which need to number not text.
        start = ['Invoice Weight(Kg) ']
        end = ['.00 Net Weight.(Kg)']
        keyword2 = get_keyword(start, end, text)

        my_list = [keyword1, keyword2]
        my_list = pd.Series(my_list)
        my_dataframe = my_dataframe.append(my_list, ignore_index=True)
        print("Document's keywords have been extracted successfully!")
        my_dataframe = my_dataframe.rename(columns={0:'Supplier',
                                                1:'Invoice Number',
                                                2:'Mill Lot Number'})
        save_path: str = 'C:/PDFs'
        os.chdir(save_path)

        # extract my dataframe to an .xlsx file!
        my_dataframe.to_excel('sample.xlsx', sheet_name = 'Sheet1')
        print("")
        print(my_dataframe)

       if __name__ == '__main__':
       main()
</code>```

I tried using #str.extract(r"([A-Za-z\s]+)([\d-]+)"))- but it did not work. I also tried below link, but could not decipher. Kindly help!!

Python pandas extracting numbers and text within text to two new column

Body:
I am new to Python Pandas, need your guidance. I have following below code which extract specific data from a pdf files and export into a excel file. The code is working fine, however all data are exported into text format. Is there any way I can use text and number extract in same code.

import os
import pandas as pd
import numpy as np
import glob
import pdfplumber

def get_keyword(start, end, text):

for i in range(len(start)):
    try:
        field = ((text.split(start[i]))[1].split(end[i])[0])
        return field
    except:
        continue

   def main():
   my_dataframe = pd.DataFrame()
   for files in glob.glob("C:/PDFs\*.pdf"):
    with pdfplumber.open(files) as pdf:
        page = pdf.pages[0]
        text = page.extract_text()
        text = " ".join(text.split())

        # obtain keyword #1-Find Supplier-This is text & it is fine
        start = ['SUPPLIER ']
        end = [' Purchase']
        keyword1 = get_keyword(start, end, text)

        # obtain keyword #2-Find Invoice, This is number-which need to number not text.
        start = ['Invoice Weight(Kg) ']
        end = ['.00 Net Weight.(Kg)']
        keyword2 = get_keyword(start, end, text)

        my_list = [keyword1, keyword2]
        my_list = pd.Series(my_list)
        my_dataframe = my_dataframe.append(my_list, ignore_index=True)
        print("Document's keywords have been extracted successfully!")
        my_dataframe = my_dataframe.rename(columns={0:'Supplier',
                                                1:'Invoice Number',
                                                2:'Mill Lot Number'})
        save_path: str = 'C:/PDFs'
        os.chdir(save_path)

        # extract my dataframe to an .xlsx file!
        my_dataframe.to_excel('sample.xlsx', sheet_name = 'Sheet1')
        print("")
        print(my_dataframe)

       if __name__ == '__main__':
       main()

I tried using #str.extract(r"([A-Za-z\s]+)([\d-]+)"))- but it did not work. I also tried below link, but could not decipher. Kindly help!!

Python pandas extracting numbers and text within text to two new column


问:
Display Wordpress woocommerce product in next application
I use a wordpress system with woocommerce as content management system.
But I also want to display the products in my Next application.

For this I currently use the npm package @woocommerce/woocommerce-rest-api

But this has 3 vulnerabilities. Does anyone have an idea how to solve this differently?


问:
First entry in table misaglinged
When printing with "\t" the first entry in my loop is misaligned with the rest of the table. Does anybody have a fix?

```<code>def c38():
  years = int(input("Enter the number of years to calculate: "))
  saving = float(input("Enter the yearly saving in the format £X.XX: "))
  start = 000.00
  print("Year\tStar\tPaid In\tInterest\tFinal")
  for i in range(1,years+1):
    num = start+saving
    interest = num*0.1
    print(i, "\t", "%.2f" % start, "\t", "%.2f" % saving, "\t", "%.2f" % interest, "\t", "%.2f" % (interest+num))
    start = interest+num
</code>```

I want the output to be straight, but I can't figure out what may be wrong.

Title: First entry in table misaglinged

Body:
When printing with "\t" the first entry in my loop is misaligned with the rest of the table. Does anybody have a fix?

def c38():
  years = int(input("Enter the number of years to calculate: "))
  saving = float(input("Enter the yearly saving in the format £X.XX: "))
  start = 000.00
  print("Year\tStar\tPaid In\tInterest\tFinal")
  for i in range(1,years+1):
    num = start+saving
    interest = num*0.1
    print(i, "\t", "%.2f" % start, "\t", "%.2f" % saving, "\t", "%.2f" % interest, "\t", "%.2f" % (interest+num))
    start = interest+num

I want the output to be straight, but I can't figure out what may be wrong.


问:
FlowChart in Nuxt, how to do?
I need a plugin in Nuxt3, where I can make flowcharts like the FlowChart of GoJs, how could I solve this issue, some use case?

have not found anything yet uqe could try.

Title: FlowChart in Nuxt, how to do?


问:
How to let Flutter stream in streambuilder get limited document from firebase and accept new document created at the same time?
I am building an instant messaging app with flutter and firebase. I have a view to display user messages with a StreamBuider. The stream of the StreamBuider is accepting data from firebase. I have limited the number of messages loaded at a time for lazy loading purposes. The current problem is that when the user creates a new messages

For example, the original view has 3 messages (m1,m2,m3). When the user writes a new message (m4), the view will display (m2,m3,m4). m1 has gone. What I want is to keep all 4 messages. Is there a way to limit the number of documents gotten while listening on new documents?

```<code>StreamBuilder<QuerySnapshot>(
          stream: messageService.getMessagesByChatIdStream(chatId),
          builder: (BuildContext context, snapshot) {
            if (snapshot.hasData) {
                return ListView.builder(
                  padding: EdgeInsets.all(10),
                  itemBuilder: (context, index) {
                    return buildMessageTile(index, snapshot.data?.docs[index]);
                  },
                  reverse: true,
                  itemCount: snapshot.data?.docs.length,
                );
            }
</code>```

the getMessagesByChatIdStream() function is like this:

```<code>Stream<QuerySnapshot> getMessagesByChatIdStream(String chatId, {int limit = 5}) {

    CollectionReference colRef =
    firebaseFirestore.collection("messages").doc(chatId).collection(chatId);

    return colRef
        .limit(limit)
        .orderBy('timestamp', descending: true)
        .snapshots();
  }

</code>```

Body:
I am building an instant messaging app with flutter and firebase. I have a view to display user messages with a StreamBuider. The stream of the StreamBuider is accepting data from firebase. I have limited the number of messages loaded at a time for lazy loading purposes. The current problem is that when the user creates a new messages

For example, the original view has 3 messages (m1,m2,m3). When the user writes a new message (m4), the view will display (m2,m3,m4). m1 has gone. What I want is to keep all 4 messages. Is there a way to limit the number of documents gotten while listening on new documents?

StreamBuilder<QuerySnapshot>(
          stream: messageService.getMessagesByChatIdStream(chatId),
          builder: (BuildContext context, snapshot) {
            if (snapshot.hasData) {
                return ListView.builder(
                  padding: EdgeInsets.all(10),
                  itemBuilder: (context, index) {
                    return buildMessageTile(index, snapshot.data?.docs[index]);
                  },
                  reverse: true,
                  itemCount: snapshot.data?.docs.length,
                );
            }

the getMessagesByChatIdStream() function is like this:

Stream<QuerySnapshot> getMessagesByChatIdStream(String chatId, {int limit = 5}) {

    CollectionReference colRef =
    firebaseFirestore.collection("messages").doc(chatId).collection(chatId);

    return colRef
        .limit(limit)
        .orderBy('timestamp', descending: true)
        .snapshots();
  }


问:
"package identifier or launch activity not found" in Flutter app using Android Studio
I recently updated my Android SDK, and my version of Flutter.

When I tried to test my app after the update, I receive this error:

package identifier or launch activity not found.
Please check C:\Users\matta\StudioProjects\smile-app-master\android\app\src\main\AndroidManifest.xml for errors.
No application found for TargetPlatform.android_x86.
Is your project missing an android\app\src\main\AndroidManifest.xml?
Consider running "flutter create ." to create one.

When I look at my AndroidManifest, there are several errors that were not there before the update:

Attribute android:icon is not allowed here
Unresolved class 'MainActivity'
Attribute android:launchMode is not allowed here
Attribute android:theme is not allowed here
Attribute android:configChanges is not allowed here
Attribute android:hardwareAccelerated is not allowed here
Attribute android:windowSoftInputMode is not allowed here

I have tried the fixes I have seen online (e.g., Invalidate Caches, close the AndroidManifest and reopen it, etc.), but none seems to fix the problem.


问:
ARKit crashes on internal Assert in "MovingIMUCameraDiscrepancyClassifier.cpp"
I am developing an app which uses the "Motion Capture" feature of ARKit/RealityKit. At least since iOS 16 it often crashes after a few seconds due to an Assert in Apples C++ code, even in release mode. I am pretty stuck right now. The console log reads:

```<code>Assert: /Library/Caches/com.apple.xbs/Sources/AppleCV3D/library/VIO/Odometry/src/MovingIMUCameraDiscrepancyClassifier.cpp:37 : current_state_timestamp > last_update_timestamp_
</code>```

So it is pretty clear what fails, but what can I do about it?

Body:
I am developing an app which uses the "Motion Capture" feature of ARKit/RealityKit. At least since iOS 16 it often crashes after a few seconds due to an Assert in Apples C++ code, even in release mode. I am pretty stuck right now. The console log reads:

Assert: /Library/Caches/com.apple.xbs/Sources/AppleCV3D/library/VIO/Odometry/src/MovingIMUCameraDiscrepancyClassifier.cpp:37 : current_state_timestamp > last_update_timestamp_

So it is pretty clear what fails, but what can I do about it?


问:
Deployment for salesforce org using SFDX plugin
[

```<code>** Creating meta.xml files **
{
  status: 500,
  error: Error: Unable to create /BuildFiles/Templates/package.xml Error: ENOENT: no such file or directory, lstat '/BuildFiles/Templates/package.xml'
</code>```

](https://i.stack.imgur.com/aj9tV.png)

```<code>
</code>```
```<code>
</code>```

Body:
[

** Creating meta.xml files **
{
  status: 500,
  error: Error: Unable to create /BuildFiles/Templates/package.xml Error: ENOENT: no such file or directory, lstat '/BuildFiles/Templates/package.xml'

](https://i.stack.imgur.com/aj9tV.png)


问:
How to solve Monkey and Bananas Graphplan and JavaGP?
Helo everyone,n I can't find what's the problem with my planning here that makes the goal unsolvable. I would like to ask what could be the problem here?

Problem.txt:

```<code>start(
    at(Monkey, a),
    at(Banana, b),
    at(Box, c),
    height(Monkey, Low),
    height(Box, Low),
    height(Banana, High),
    pushable(Box),
    climbable(Box)
)

goal(
    have(Monkey, Banana)
)
</code>```

Domain.txt:

```<code>operator go(X,Y)
pre: at(Monkey, X), height(Monkey, Low)
post: at(Monkey, Y), ~at(Monkey, X)

operator push(B,X,Y)
pre: at(Monkey, X), height(Monkey, Low), at(B, X), height(B, Low), pushable(B)
post: at(B, Y), at(Monkey, Y), ~at(B, X), ~at(Monkey, X)

operator climbUp(X,B)
pre: at(Monkey, X), height(Monkey, Low), at(B, X), height(B, Low), climbable(B)
post: on(Monkey, B), ~height(Monkey, Low), height(Monkey, High)

operator grasp(X,B,H)
pre:  at(Monkey, X), height(Monkey, H), at(B, X), height(B, H)
post: have(Monkey, B)
</code>```

The error:

```<code>INFO: Expanding graph
INFO: Goals not possible with 1 steps
INFO: Expanding graph
INFO: Goals not possible with 2 steps
INFO: Expanding graph
INFO: Goals not possible with 3 steps
INFO: Expanding graph
INFO: Goals not possible with 4 steps
Exception in thread "main" graphplan.graph.PlanningGraphException: At graph level 8: Goals are not possible and graph has levelled off, plan is not possible.
at graphplan.Graphplan.plan(Graphplan.java:238)
at graphplan.Graphplan.main(Graphplan.java:137)
</code>```

Body:
Helo everyone,n I can't find what's the problem with my planning here that makes the goal unsolvable. I would like to ask what could be the problem here?

Problem.txt:

start(
    at(Monkey, a),
    at(Banana, b),
    at(Box, c),
    height(Monkey, Low),
    height(Box, Low),
    height(Banana, High),
    pushable(Box),
    climbable(Box)
)

goal(
    have(Monkey, Banana)
)

Domain.txt:

operator go(X,Y)
pre: at(Monkey, X), height(Monkey, Low)
post: at(Monkey, Y), ~at(Monkey, X)

operator push(B,X,Y)
pre: at(Monkey, X), height(Monkey, Low), at(B, X), height(B, Low), pushable(B)
post: at(B, Y), at(Monkey, Y), ~at(B, X), ~at(Monkey, X)

operator climbUp(X,B)
pre: at(Monkey, X), height(Monkey, Low), at(B, X), height(B, Low), climbable(B)
post: on(Monkey, B), ~height(Monkey, Low), height(Monkey, High)

operator grasp(X,B,H)
pre:  at(Monkey, X), height(Monkey, H), at(B, X), height(B, H)
post: have(Monkey, B)

The error:

INFO: Expanding graph
INFO: Goals not possible with 1 steps
INFO: Expanding graph
INFO: Goals not possible with 2 steps
INFO: Expanding graph
INFO: Goals not possible with 3 steps
INFO: Expanding graph
INFO: Goals not possible with 4 steps
Exception in thread "main" graphplan.graph.PlanningGraphException: At graph level 8: Goals are not possible and graph has levelled off, plan is not possible.
at graphplan.Graphplan.plan(Graphplan.java:238)
at graphplan.Graphplan.main(Graphplan.java:137)