问:
(webpack-cli) TypeError: Cannot read properties of undefined (reading 'resolve')
I'm trying to run npm run development, but I got a typescript error here

```<code>let { Chunks } = require('../Chunks');
let File = require('../File');
let VueVersion = require('../VueVersion');
let AppendVueStylesPlugin = require('../webpackPlugins/Css/AppendVueStylesPlugin');

/** @typedef {import("vue").VueLoaderOptions} VueLoaderOptions */

class Vue {
    /**
     * Create a new component instance.
     */
    constructor() {
        this.chunks = Chunks.instance();
    }

    /**
     * Register the component.
     *
     * @param {object} options
     * @param {number} [options.version] Which version of Vue to support. Detected automatically if not given.
     * @param {string|null} [options.globalStyles] A file to include w/ every vue style block.
     * @param {boolean|string} [options.extractStyles] Whether or not to extract vue styles. If given a string the name of the file to extract to.
     * @param {VueLoaderOptions} [options.options] Options to pass to Vue Loader
     */
    register(options = {}) {
        if (
            arguments.length === 2 &&
            typeof arguments[0] === 'string' &&
            typeof arguments[1] === 'string'
        ) {
            throw new Error(
                'mix.vue() is a feature flag. Use mix.js(source, destination).vue() instead'
            );
        }

        this.version = VueVersion.detect(options.version);

        this.options = Object.assign(
            {
                options: null,
                globalStyles: null,
                extractStyles: false
            },
            options
        );

        Mix.globalStyles = this.options.globalStyles;
        Mix.extractingStyles = !!this.options.extractStyles;
    }

    /**
     * Required dependencies for the component.
     */
    dependencies() {
        this.requiresReload = true;

        let dependencies = [
            this.version === 2 ? 'vue-template-compiler' : '@vue/compiler-sfc',
            this.version === 2 ? 'vue-loader@^15.9.5' : 'vue-loader@^16.1.0'
        ];

        if (this.options.extractStyles && this.options.globalStyles) {
            dependencies.push('sass-resources-loader');
        }

        return dependencies;
    }

    /**
     * Override the generated webpack configuration.
     *
     * @param {Object} webpackConfig
     */
    webpackConfig(webpackConfig) {
        // push -> unshift to combat vue loader webpack 5 bug
        webpackConfig.module.rules.unshift({
            test: /\.vue$/,
            use: [
                {
                    loader: this._mix.resolve('vue-loader'),
                    options: this.options.options || Config.vue || {}
                }
            ]
        });

        // Alias Vue to its ESM build if the user has not already given an alias
        webpackConfig.resolve.alias = webpackConfig.resolve.alias || {};

        if (!webpackConfig.resolve.alias['vue$']) {
            webpackConfig.resolve.alias['vue$'] = this.aliasPath();
        }

        webpackConfig.resolve.extensions.push('.vue');

        this.updateChunks();
    }

    aliasPath() {
        if (this.version === 2) {
            return this.options.runtimeOnly
                ? 'vue/dist/vue.runtime.esm.js'
                : 'vue/dist/vue.esm.js';
        }

        return this.options.runtimeOnly
            ? 'vue/dist/vue.runtime.esm-bundler.js'
            : 'vue/dist/vue.esm-bundler.js';
    }

    /**
     * webpack plugins to be appended to the master config.
     */
    webpackPlugins() {
        let { VueLoaderPlugin } = require(this._mix.resolve('vue-loader'));

        return [new VueLoaderPlugin(), new AppendVueStylesPlugin()];
    }

    /**a
     * Update CSS chunks to extract vue styles
     */
    updateChunks() {
        if (this.options.extractStyles === false) {
            return;
        }

        this.chunks.add(
            'styles-vue',
            this.styleChunkName(),
            [/.vue$/, module => module.type === 'css/mini-extract'],
            {
                chunks: 'all',
                enforce: true,
                type: 'css/mini-extract'
            }
        );
    }

    /**
     * Get the name of the style chunk.
     *
     * @returns {string}
     */
    styleChunkName() {
        // If the user set extractStyles: true, we'll try
        // to append the Vue styles to an existing CSS chunk.
        if (this.options.extractStyles === true) {
            let chunk = this.chunks.find((chunk, id) => id.startsWith('styles-'));

            if (chunk) {
                return chunk.name;
            }
        }

        return this.extractFile().relativePathWithoutExtension();
    }

    /**
     * Get a new File instance for the extracted file.
     *
     * @returns {File}
     */
    extractFile() {
        return new File(this.extractFileName());
    }

    /**
     * Determine the extract file name.
     *
     * @return {string}
     */
    extractFileName() {
        let fileName =
            typeof this.options.extractStyles === 'string'
                ? this.options.extractStyles
                : '/css/vue-styles.css';

        return fileName.replace(Config.publicPath, '').replace(/^\//, '');
    }
}

module.exports = Vue;

</code>```

**package.json

```<code>{
  "private": true,
  "scripts": {
    "development": "mix",
    "hot": "mix watch --hot",
    "production": "mix --production",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000"
  },
  "dependencies": {
    "@chenfengyuan/vue-countdown": "^1.1.5",
    "@mdi/light-font": "^0.2.63",
    "@types/ziggy-js": "^0.9.0",
    "@vue/cli-service": "^5.0.4",
    "axios": "^0.21.1",
    "dotenv": "^16.0.0",
    "eslint": "^7.18.0",
    "laravel-echo": "^1.10.0",
    "lottie-player-vue": "0.0.16",
    "object-to-formdata": "^4.1.0",
    "pusher-js": "^7.0.2",
    "qrcode": "^1.5.0",
    "read-excel-file": "^5.2.28",
    "sweetalert2": "^9.17.2",
    "v-money": "^0.8.1",
    "vee-validate": "^2.2.15",
    "vform": "^1.0.1",
    "vue-axios": "^2.1.5",
    "vue-cli": "^2.9.6",
    "vue-countdown": "^1.0.4",
    "vue-excel-xlsx": "^1.2.2",
    "vue-moment": "^4.1.0",
    "vue-qrcode-component": "^2.1.1",
    "vue-resource": "^1.5.3",
    "vue-sessionstorage": "^1.0.0",
    "vue-social-auth": "^1.4.9",
    "vue-socket.io": "^3.0.10",
    "vue2-storage": "^5.0.0",
    "vuedraggable": "^2.24.3",
    "vuetify": "^2.6.0",
    "vuex": "^3.6.2",
    "vuex-map-fields": "^1.4.1",
    "ziggy": "^2.4.0",
    "ziggy-js": "^1.4.3"
  },
  "devDependencies": {
    "@fortawesome/fontawesome-free": "^5.12.0",
    "@inertiajs/inertia": "^0.11.0",
    "@inertiajs/inertia-vue": "^0.8.0",
    "@inertiajs/progress": "^0.2.7",
    "@mdi/font": "^4.9.95",
    "@mdi/js": "^5.9.55",
    "@nuxtjs/vuetify": "^1.12.3",
    "@popperjs/core": "^2.10.2",
    "bootstrap": "^5.1.3",
    "browser-sync": "^2.26.13",
    "browser-sync-webpack-plugin": "^2.3.0",
    "cross-env": "^7.0.3",
    "deepmerge": "^4.2.2",
    "eslint-plugin-import": "^2.19.1",
    "eslint-plugin-vue": "^7.5.0",
    "font-awesome": "^4.7.0",
    "laravel-mix": "6.0.6",
    "lodash": "^4.17.20",
    "material-design-icons-iconfont": "^6.4.1",
    "resolve-url-loader": "^3.1.2",
    "roboto-fontface": "^0.10.0",
    "sass": "~1.32",
    "sass-loader": "^11.1.1",
    "vue": "^2.6.12",
    "vue-cli-plugin-vuetify": "~2.5.8",
    "vue-loader": "^14.2.4",
    "vue-template-compiler": "^2.7.14",
    "vuetify": "^2.4.2",
    "vuetify-loader": "^1.7.0",
    "webpack": "^5.75.0",
    "webpack-cli": "^5.0.1"
  }
}

</code>```

**

I dont know why I got this error.

I'm new to Vue.js, can someone enlighten me to how to use and continue other's project from scratch ? I got a lot of problems, such as the Vue code not showing changes in the application in my localhost.

Body:
I'm trying to run npm run development, but I got a typescript error here

let { Chunks } = require('../Chunks');
let File = require('../File');
let VueVersion = require('../VueVersion');
let AppendVueStylesPlugin = require('../webpackPlugins/Css/AppendVueStylesPlugin');

/** @typedef {import("vue").VueLoaderOptions} VueLoaderOptions */

class Vue {
    /**
     * Create a new component instance.
     */
    constructor() {
        this.chunks = Chunks.instance();
    }

    /**
     * Register the component.
     *
     * @param {object} options
     * @param {number} [options.version] Which version of Vue to support. Detected automatically if not given.
     * @param {string|null} [options.globalStyles] A file to include w/ every vue style block.
     * @param {boolean|string} [options.extractStyles] Whether or not to extract vue styles. If given a string the name of the file to extract to.
     * @param {VueLoaderOptions} [options.options] Options to pass to Vue Loader
     */
    register(options = {}) {
        if (
            arguments.length === 2 &&
            typeof arguments[0] === 'string' &&
            typeof arguments[1] === 'string'
        ) {
            throw new Error(
                'mix.vue() is a feature flag. Use mix.js(source, destination).vue() instead'
            );
        }

        this.version = VueVersion.detect(options.version);

        this.options = Object.assign(
            {
                options: null,
                globalStyles: null,
                extractStyles: false
            },
            options
        );

        Mix.globalStyles = this.options.globalStyles;
        Mix.extractingStyles = !!this.options.extractStyles;
    }

    /**
     * Required dependencies for the component.
     */
    dependencies() {
        this.requiresReload = true;

        let dependencies = [
            this.version === 2 ? 'vue-template-compiler' : '@vue/compiler-sfc',
            this.version === 2 ? 'vue-loader@^15.9.5' : 'vue-loader@^16.1.0'
        ];

        if (this.options.extractStyles && this.options.globalStyles) {
            dependencies.push('sass-resources-loader');
        }

        return dependencies;
    }

    /**
     * Override the generated webpack configuration.
     *
     * @param {Object} webpackConfig
     */
    webpackConfig(webpackConfig) {
        // push -> unshift to combat vue loader webpack 5 bug
        webpackConfig.module.rules.unshift({
            test: /\.vue$/,
            use: [
                {
                    loader: this._mix.resolve('vue-loader'),
                    options: this.options.options || Config.vue || {}
                }
            ]
        });

        // Alias Vue to its ESM build if the user has not already given an alias
        webpackConfig.resolve.alias = webpackConfig.resolve.alias || {};

        if (!webpackConfig.resolve.alias['vue$']) {
            webpackConfig.resolve.alias['vue$'] = this.aliasPath();
        }

        webpackConfig.resolve.extensions.push('.vue');

        this.updateChunks();
    }

    aliasPath() {
        if (this.version === 2) {
            return this.options.runtimeOnly
                ? 'vue/dist/vue.runtime.esm.js'
                : 'vue/dist/vue.esm.js';
        }

        return this.options.runtimeOnly
            ? 'vue/dist/vue.runtime.esm-bundler.js'
            : 'vue/dist/vue.esm-bundler.js';
    }

    /**
     * webpack plugins to be appended to the master config.
     */
    webpackPlugins() {
        let { VueLoaderPlugin } = require(this._mix.resolve('vue-loader'));

        return [new VueLoaderPlugin(), new AppendVueStylesPlugin()];
    }

    /**a
     * Update CSS chunks to extract vue styles
     */
    updateChunks() {
        if (this.options.extractStyles === false) {
            return;
        }

        this.chunks.add(
            'styles-vue',
            this.styleChunkName(),
            [/.vue$/, module => module.type === 'css/mini-extract'],
            {
                chunks: 'all',
                enforce: true,
                type: 'css/mini-extract'
            }
        );
    }

    /**
     * Get the name of the style chunk.
     *
     * @returns {string}
     */
    styleChunkName() {
        // If the user set extractStyles: true, we'll try
        // to append the Vue styles to an existing CSS chunk.
        if (this.options.extractStyles === true) {
            let chunk = this.chunks.find((chunk, id) => id.startsWith('styles-'));

            if (chunk) {
                return chunk.name;
            }
        }

        return this.extractFile().relativePathWithoutExtension();
    }

    /**
     * Get a new File instance for the extracted file.
     *
     * @returns {File}
     */
    extractFile() {
        return new File(this.extractFileName());
    }

    /**
     * Determine the extract file name.
     *
     * @return {string}
     */
    extractFileName() {
        let fileName =
            typeof this.options.extractStyles === 'string'
                ? this.options.extractStyles
                : '/css/vue-styles.css';

        return fileName.replace(Config.publicPath, '').replace(/^\//, '');
    }
}

module.exports = Vue;

**package.json

{
  "private": true,
  "scripts": {
    "development": "mix",
    "hot": "mix watch --hot",
    "production": "mix --production",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000"
  },
  "dependencies": {
    "@chenfengyuan/vue-countdown": "^1.1.5",
    "@mdi/light-font": "^0.2.63",
    "@types/ziggy-js": "^0.9.0",
    "@vue/cli-service": "^5.0.4",
    "axios": "^0.21.1",
    "dotenv": "^16.0.0",
    "eslint": "^7.18.0",
    "laravel-echo": "^1.10.0",
    "lottie-player-vue": "0.0.16",
    "object-to-formdata": "^4.1.0",
    "pusher-js": "^7.0.2",
    "qrcode": "^1.5.0",
    "read-excel-file": "^5.2.28",
    "sweetalert2": "^9.17.2",
    "v-money": "^0.8.1",
    "vee-validate": "^2.2.15",
    "vform": "^1.0.1",
    "vue-axios": "^2.1.5",
    "vue-cli": "^2.9.6",
    "vue-countdown": "^1.0.4",
    "vue-excel-xlsx": "^1.2.2",
    "vue-moment": "^4.1.0",
    "vue-qrcode-component": "^2.1.1",
    "vue-resource": "^1.5.3",
    "vue-sessionstorage": "^1.0.0",
    "vue-social-auth": "^1.4.9",
    "vue-socket.io": "^3.0.10",
    "vue2-storage": "^5.0.0",
    "vuedraggable": "^2.24.3",
    "vuetify": "^2.6.0",
    "vuex": "^3.6.2",
    "vuex-map-fields": "^1.4.1",
    "ziggy": "^2.4.0",
    "ziggy-js": "^1.4.3"
  },
  "devDependencies": {
    "@fortawesome/fontawesome-free": "^5.12.0",
    "@inertiajs/inertia": "^0.11.0",
    "@inertiajs/inertia-vue": "^0.8.0",
    "@inertiajs/progress": "^0.2.7",
    "@mdi/font": "^4.9.95",
    "@mdi/js": "^5.9.55",
    "@nuxtjs/vuetify": "^1.12.3",
    "@popperjs/core": "^2.10.2",
    "bootstrap": "^5.1.3",
    "browser-sync": "^2.26.13",
    "browser-sync-webpack-plugin": "^2.3.0",
    "cross-env": "^7.0.3",
    "deepmerge": "^4.2.2",
    "eslint-plugin-import": "^2.19.1",
    "eslint-plugin-vue": "^7.5.0",
    "font-awesome": "^4.7.0",
    "laravel-mix": "6.0.6",
    "lodash": "^4.17.20",
    "material-design-icons-iconfont": "^6.4.1",
    "resolve-url-loader": "^3.1.2",
    "roboto-fontface": "^0.10.0",
    "sass": "~1.32",
    "sass-loader": "^11.1.1",
    "vue": "^2.6.12",
    "vue-cli-plugin-vuetify": "~2.5.8",
    "vue-loader": "^14.2.4",
    "vue-template-compiler": "^2.7.14",
    "vuetify": "^2.4.2",
    "vuetify-loader": "^1.7.0",
    "webpack": "^5.75.0",
    "webpack-cli": "^5.0.1"
  }
}

**

I dont know why I got this error.

I'm new to Vue.js, can someone enlighten me to how to use and continue other's project from scratch ? I got a lot of problems, such as the Vue code not showing changes in the application in my localhost.


来源: stackexchange

问:
How to extract Header and Footer section from openXML file?
I have Open Xml file which has Header, Body and Footer content. When I am trying to insert that open Xml it always picking only Body related part and not able to extract Header & Footer section data out of it.

I tried below snippet, but it always printing Body part data instead of Header data which resides in Header1.xml

ps: WORD_OPEN_XML is holding whole content

```<code>async function insertHeader() {
    Word.run(async (context) => {
      const mySections = context.document.sections;
      context.load(mySections);
      await context.sync();
      for (let i = 0; i < mySections.items.length; i++) {
        mySections.items[i].getHeader('Primary').insertOoxml(WORD_OPEN_XML, 'Replace');
      }
      await context.sync();
    });
  }
</code>```

Please help me to insert Header and Footer part from that open Xml
WORD_OPEN_XML

ContentLicense: CC BY-SA 4.0

Body:
I have Open Xml file which has Header, Body and Footer content. When I am trying to insert that open Xml it always picking only Body related part and not able to extract Header & Footer section data out of it.

I tried below snippet, but it always printing Body part data instead of Header data which resides in Header1.xml

ps: WORD_OPEN_XML is holding whole content

async function insertHeader() {
    Word.run(async (context) => {
      const mySections = context.document.sections;
      context.load(mySections);
      await context.sync();
      for (let i = 0; i < mySections.items.length; i++) {
        mySections.items[i].getHeader('Primary').insertOoxml(WORD_OPEN_XML, 'Replace');
      }
      await context.sync();
    });
  }

Please help me to insert Header and Footer part from that open Xml
WORD_OPEN_XML


问:
Combobox based on a lookup field - how to appear another columns
I have an issue on a combobox on PowerApp based on a lookup field. In access, it is something more than easy but in PowerApp it seems like going to the moon...
I have a List A in which one of the columns (TblA_ColumnA) is a lookup fields based on List B. On sharepoint List definition setup, the lookup fields shows TblB_ColumnA.
In the table B, I have others columns.
When I create the form, for this specific fields, I see on the combobox the value indicated into tblB_ColumnA.
I want to see others columns of List B and not this one. For exemple the Column B of List B.
-Actual DataCard:
Default= ThisItem.TblA_ColumnA Update= DataCarValue64.Selected
-Actual Combobox
Items= Choices([@ListA].TblA_ColumnA) DisplayFields= ["Value"] DefaultSelectedItems=Parent.Default.

Please help me.
Thanks,
BR,
Damien

I tried to change the item putting a filter on List B but nothing works;


问:
how to view Docx file in flutter?
I get all docx files now i want to open the file using file path can someone help. I tried power file view, flutter file view etc packages but all engines failed to load can someone provide material to open Docx file in flutter.</p>

Title: how to view Docx file in flutter?


问:
VS19 + VS22 causes error - Visual Studio 2017 support for ARM64 is not installed
I have a local building agent for a Unity|HoloLens-Project. The whole time I had VS2019 on the agend installed and everything worked well. Today I had to install VS2022 on my agent because of a different .net 6 project (so it has nothing todo with my unity stuff!).

However, after installing VS2022, my Unity project can no longer be built with VS2019. I get the following output:

```<code>EXEC(0,0): Error : System.NotSupportedException: Visual Studio 2017 support for ARM64 is not installed.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): Error MSB3073: Der Befehl ""C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\build\deploy\netcoreapp3.1\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\\" -cachedirectory="C:\agent\_work\1\b\UWP_Build\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --baselib-directory="C:\agent\_work\1\b\UWP_Build\Players\UAP\il2cpp\ARM64\Release" --avoid-dynamic-library-copy --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --relative-data-path=Data/il2cpp_data --map-file-parser="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" wurde mit dem Code -1 beendet.
Process 'msbuild.exe' exited with code '1'.
</code>```

The whole thing makes no sense to me. If I have only VS19 installed everything runs. When I install VS22, I get this error message. I went back to the building agent myself and manually opened the project in VS19 and tried to creat/publish an APPX. There I got the already known errors displayed and one more:

```<code>System.NotSupportedException: Visual Studio 2017 support for ARM64 is not installed.
MSB3073 The command ""C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\build\deploy\netcoreapp3.1\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\\" -cachedirectory="C:\agent\_work\1\b\UWP_Build\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --baselib-directory="C:\agent\_work\1\b\UWP_Build\Players\UAP\il2cpp\ARM64\Release" --avoid-dynamic-library-copy --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --relative-data-path=Data/il2cpp_data --map-file-parser="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" was terminated with the code -1.
MSB8020 The build tools for v143 (platform toolset = "v143") were not found. To build using the v143 build tools, install the v143 build tools. Alternatively, upgrade to the latest Visual Studio tools by selecting the Project menu or right-clicking the solution and selecting Reassign Solution.
</code>```

Workload in my VSInstaller for VS19:

It doesn't make sense that VS17 with ARM64 is suddenly demanded.
 And it makes no sense that suddenly the build tools for version 143 are required.
 The project is opened with VS19(=v142) and not with VS22(=v143).

Body:
I have a local building agent for a Unity|HoloLens-Project. The whole time I had VS2019 on the agend installed and everything worked well. Today I had to install VS2022 on my agent because of a different .net 6 project (so it has nothing todo with my unity stuff!).

However, after installing VS2022, my Unity project can no longer be built with VS2019. I get the following output:

EXEC(0,0): Error : System.NotSupportedException: Visual Studio 2017 support for ARM64 is not installed.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): Error MSB3073: Der Befehl ""C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\build\deploy\netcoreapp3.1\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\\" -cachedirectory="C:\agent\_work\1\b\UWP_Build\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --baselib-directory="C:\agent\_work\1\b\UWP_Build\Players\UAP\il2cpp\ARM64\Release" --avoid-dynamic-library-copy --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --relative-data-path=Data/il2cpp_data --map-file-parser="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" wurde mit dem Code -1 beendet.
Process 'msbuild.exe' exited with code '1'.

The whole thing makes no sense to me. If I have only VS19 installed everything runs. When I install VS22, I get this error message. I went back to the building agent myself and manually opened the project in VS19 and tried to creat/publish an APPX. There I got the already known errors displayed and one more:

System.NotSupportedException: Visual Studio 2017 support for ARM64 is not installed.
MSB3073 The command ""C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\build\deploy\netcoreapp3.1\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARM64 -configuration=Release -platform=winrt -outputpath="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\GameAssembly.dll" --data-folder="C:\agent\_work\1\b\UWP_Build\\build\bin\ARM64\Release\\" -cachedirectory="C:\agent\_work\1\b\UWP_Build\\build\obj\il2cppOutputProject\ARM64\Release\\" -generatedcppdir="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --baselib-directory="C:\agent\_work\1\b\UWP_Build\Players\UAP\il2cpp\ARM64\Release" --avoid-dynamic-library-copy --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --relative-data-path=Data/il2cpp_data --map-file-parser="C:\agent\_work\1\b\UWP_Build\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" was terminated with the code -1.
MSB8020 The build tools for v143 (platform toolset = "v143") were not found. To build using the v143 build tools, install the v143 build tools. Alternatively, upgrade to the latest Visual Studio tools by selecting the Project menu or right-clicking the solution and selecting Reassign Solution.

Workload in my VSInstaller for VS19:

It doesn't make sense that VS17 with ARM64 is suddenly demanded.
 And it makes no sense that suddenly the build tools for version 143 are required.
 The project is opened with VS19(=v142) and not with VS22(=v143).


问:
Python - Read time out error in script with Google translate
I am trying translate one column in my xlsx file in Python. There are about 405 rows. I have this script:

```<code>import pandas as pd
import os
import numpy as np
import googletrans
from googletrans import Translator

WD = r'C:XXX\\'

for file in os.listdir(WD):
    if file.endswith('.xlsx'):
        FILE = file

        sheet_names = pd.ExcelFile(FILE).sheet_names

        for sn in sheet_names:
            OUTPUT_FILE = '{}_{}'
            df = pd.read_excel(FILE)
            print(FILE, sn)

            for col in df.columns.to_list():
                df[col] = df[col].map({True: '', False: ''}).fillna(df[col])

                translator = googletrans.Translator()
                df['GROUP_1'] = df['GROUP'].astype(str)
                df['GROUP_TRANSLATE'] = df['GROUP_1'].apply(translator.translate, src ='ru', dest = 'cs').apply(getattr, args=('text',))

        cn = ['NAME', 'GROUP_TRANSLATE' ]
        df = df.reindex(columns = cn)

        df.to_excel(r'C:\XXX.xlsx', index=False)
</code>```

But script is always cancelled with this error message: httpcore._exceptions.ReadTimeout: The read operation timed out
I don´t know if I have a wrong code or some missing part. It is only few rows with text which I want to translate. Can you help me please?

Following output:

```<code>Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\__main__.py", line 39, in <module>
    cli.main()
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "c:\Users\Admin\Documents\Data MSSQL\Ukrajina-pobyty\SEZNAMY k prověření\2022-05-15_kadyrovci_data\PREPIS_KAR.py", line 31, in <module>
    df['SKUPINA PŘEKLAD'] = df['SKUPINA_1'].apply(translator.translate, src ='ru', dest = 'cs').apply(getattr, args=('text',))
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\series.py", line 4433, in apply
    return SeriesApply(self, func, convert_dtype, args, kwargs).apply()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\apply.py", line 1082, in apply
    return self.apply_standard()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\apply.py", line 1137, in apply_standard
    mapped = lib.map_infer(
  File "pandas\_libs\lib.pyx", line 2870, in pandas._libs.lib.map_infer
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\apply.py", line 138, in f
    return func(x, *args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\googletrans\client.py", line 210, in translate
    data, response = self._translate(text, dest, src, kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\googletrans\client.py", line 108, in _translate
    r = self.client.get(url, params=params)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 755, in get
    return self.request(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 600, in request
    return self.send(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 620, in send
    response = self.send_handling_redirects(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 647, in send_handling_redirects
    response = self.send_handling_auth(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 684, in send_handling_auth
    response = self.send_single_request(request, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 714, in send_single_request
    ) = transport.request(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\connection_pool.py", line 152, in request
    response = connection.request(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\connection.py", line 78, in request
    return self.connection.request(method, url, headers, stream, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 118, in request
    return h2_stream.request(method, url, headers, stream, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 292, in request
    status_code, headers = self.receive_response(timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 344, in receive_response
    event = self.connection.wait_for_event(self.stream_id, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 197, in wait_for_event
    self.receive_events(timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 204, in receive_events
    data = self.socket.read(self.READ_NUM_BYTES, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_backends\sync.py", line 60, in read
    with map_exceptions(exc_map):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc) from None
httpcore._exceptions.ReadTimeout: The read operation timed out
</code>```

Body:
I am trying translate one column in my xlsx file in Python. There are about 405 rows. I have this script:

import pandas as pd
import os
import numpy as np
import googletrans
from googletrans import Translator

WD = r'C:XXX\\'

for file in os.listdir(WD):
    if file.endswith('.xlsx'):
        FILE = file

        sheet_names = pd.ExcelFile(FILE).sheet_names

        for sn in sheet_names:
            OUTPUT_FILE = '{}_{}'
            df = pd.read_excel(FILE)
            print(FILE, sn)

            for col in df.columns.to_list():
                df[col] = df[col].map({True: '', False: ''}).fillna(df[col])

                translator = googletrans.Translator()
                df['GROUP_1'] = df['GROUP'].astype(str)
                df['GROUP_TRANSLATE'] = df['GROUP_1'].apply(translator.translate, src ='ru', dest = 'cs').apply(getattr, args=('text',))

        cn = ['NAME', 'GROUP_TRANSLATE' ]
        df = df.reindex(columns = cn)

        df.to_excel(r'C:\XXX.xlsx', index=False)

But script is always cancelled with this error message: httpcore._exceptions.ReadTimeout: The read operation timed out
I don´t know if I have a wrong code or some missing part. It is only few rows with text which I want to translate. Can you help me please?

Following output:

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\__main__.py", line 39, in <module>
    cli.main()
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "c:\Users\Admin\.vscode\extensions\ms-python.python-2023.1.10091012\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "c:\Users\Admin\Documents\Data MSSQL\Ukrajina-pobyty\SEZNAMY k prověření\2022-05-15_kadyrovci_data\PREPIS_KAR.py", line 31, in <module>
    df['SKUPINA PŘEKLAD'] = df['SKUPINA_1'].apply(translator.translate, src ='ru', dest = 'cs').apply(getattr, args=('text',))
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\series.py", line 4433, in apply
    return SeriesApply(self, func, convert_dtype, args, kwargs).apply()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\apply.py", line 1082, in apply
    return self.apply_standard()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\apply.py", line 1137, in apply_standard
    mapped = lib.map_infer(
  File "pandas\_libs\lib.pyx", line 2870, in pandas._libs.lib.map_infer
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\apply.py", line 138, in f
    return func(x, *args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\googletrans\client.py", line 210, in translate
    data, response = self._translate(text, dest, src, kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\googletrans\client.py", line 108, in _translate
    r = self.client.get(url, params=params)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 755, in get
    return self.request(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 600, in request
    return self.send(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 620, in send
    response = self.send_handling_redirects(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 647, in send_handling_redirects
    response = self.send_handling_auth(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 684, in send_handling_auth
    response = self.send_single_request(request, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 714, in send_single_request
    ) = transport.request(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\connection_pool.py", line 152, in request
    response = connection.request(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\connection.py", line 78, in request
    return self.connection.request(method, url, headers, stream, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 118, in request
    return h2_stream.request(method, url, headers, stream, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 292, in request
    status_code, headers = self.receive_response(timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 344, in receive_response
    event = self.connection.wait_for_event(self.stream_id, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 197, in wait_for_event
    self.receive_events(timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_sync\http2.py", line 204, in receive_events
    data = self.socket.read(self.READ_NUM_BYTES, timeout)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_backends\sync.py", line 60, in read
    with map_exceptions(exc_map):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc) from None
httpcore._exceptions.ReadTimeout: The read operation timed out


问:
How to convert multiple html string to multiple pdf using openhtmltopdf library
I have a Hashmap as a source of data and I'm generating a separate pdf for each key. But when the hashmap length is greater than 2 I'm getting only the 2nd pdf. 2nd one overrides the 1st pdf.(I'm storing HTML in the body key as you can see in the code). I don't want to create separate HTML files and store them in sever.Is there any way where I can store the HTML and generate separate pdf for all keys in hashmap</p>
```<code>    public byte[] BulkPdf(Map jsonObject) throws ApplicationException, IOException {
        LinkedHashMap<String, List<Map<String, Object>>> hashMapDept = new LinkedHashMap<>();
         byte[] reportByte = null;

        if (!hashMapDept.isEmpty()) {
            Integer count = 0;
            for (Entry<String, List<Map<String, Object>>> entry : hashMapDept.
                    entrySet()) {

               String body = "";
               Writer out = new StringWriter();
              Configuration cfg = new Configuration();
                try {

       cfg.setObjectWrapper(new DefaultObjectWrapper());
         String templateStr = UUID.randomUUID().
                    toString().
                    replaceAll("-",
                            "");
            logger.debug("templatename --> ",
                    templateStr);
            freemarker.template.Template freemarkerTemplate = new freemarker.template.Template(
                    templateStr,
                    new StringReader(html),
                    cfg);

                freemarkerTemplate.process(jsonObject,
                    out);
            body = out.toString();
                } catch (TemplateException | IOException | ApplicationException e) {
                   logger.debug("template pdf exception --> ",
                    e.getMessage());
                    out.flush();
                    e.printStackTrace();
                    cfg.clearTemplateCache();
                } finally {
                    out.flush();
                    cfg.clearTemplateCache();
                }

try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
            PdfRendererBuilder builder = new PdfRendererBuilder();
            builder.withHtmlContent(body,
                    "pathforpdf");
            builder.useFastMode();
            builder.toStream(outputStream);
            builder.run();
            reportByte = outputStream.toByteArray();
            outputStream.close();

        } catch (IOException e) {
            e.printStackTrace();
        }

            }
        }

        return reportByte;
    }
</code>```

Body:
I have a Hashmap as a source of data and I'm generating a separate pdf for each key. But when the hashmap length is greater than 2 I'm getting only the 2nd pdf. 2nd one overrides the 1st pdf.(I'm storing HTML in the body key as you can see in the code). I don't want to create separate HTML files and store them in sever.Is there any way where I can store the HTML and generate separate pdf for all keys in hashmap

    public byte[] BulkPdf(Map jsonObject) throws ApplicationException, IOException {
        LinkedHashMap<String, List<Map<String, Object>>> hashMapDept = new LinkedHashMap<>();
         byte[] reportByte = null;

        if (!hashMapDept.isEmpty()) {
            Integer count = 0;
            for (Entry<String, List<Map<String, Object>>> entry : hashMapDept.
                    entrySet()) {

               String body = "";
               Writer out = new StringWriter();
              Configuration cfg = new Configuration();
                try {

       cfg.setObjectWrapper(new DefaultObjectWrapper());
         String templateStr = UUID.randomUUID().
                    toString().
                    replaceAll("-",
                            "");
            logger.debug("templatename --> ",
                    templateStr);
            freemarker.template.Template freemarkerTemplate = new freemarker.template.Template(
                    templateStr,
                    new StringReader(html),
                    cfg);

                freemarkerTemplate.process(jsonObject,
                    out);
            body = out.toString();
                } catch (TemplateException | IOException | ApplicationException e) {
                   logger.debug("template pdf exception --> ",
                    e.getMessage());
                    out.flush();
                    e.printStackTrace();
                    cfg.clearTemplateCache();
                } finally {
                    out.flush();
                    cfg.clearTemplateCache();
                }

try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
            PdfRendererBuilder builder = new PdfRendererBuilder();
            builder.withHtmlContent(body,
                    "pathforpdf");
            builder.useFastMode();
            builder.toStream(outputStream);
            builder.run();
            reportByte = outputStream.toByteArray();
            outputStream.close();

        } catch (IOException e) {
            e.printStackTrace();
        }

            }
        }

        return reportByte;
    }


问:
How to update session user properties after update user model
I need to update the logged in user name and email.
The problem is that when I update them to the DB (MongoDB), session object properties do not change.

This is the code to make the problem clear:

```<code>const { data: session } = useSession();
const toast = useToast();
const { colorMode } = useColorMode();
const [name, setName] = useState(session?.user.name);
const [email, setEmail] = useState(session?.user.email);

const formSubmit = async (actions: any) => {
  actions.setSubmitting(false);

const res = await axios.post("/api/update", {name, email})
  .then(() => {
    toast({description: "Info successfully updated", status: 'success', position: 'bottom-right', isClosable: true, duration: 3000})
  })
  .catch((error) => {
      toast({description: error.response.data.error, status: 'error', position: 'bottom-right', isClosable: true, duration: 3000})
  });
};
</code>```

The update successfully occurs on MongoDB, however the session object remains the same.
How can I tell nextjs to update session object as well?

Body:
I need to update the logged in user name and email.
The problem is that when I update them to the DB (MongoDB), session object properties do not change.

This is the code to make the problem clear:

const { data: session } = useSession();
const toast = useToast();
const { colorMode } = useColorMode();
const [name, setName] = useState(session?.user.name);
const [email, setEmail] = useState(session?.user.email);

const formSubmit = async (actions: any) => {
  actions.setSubmitting(false);

const res = await axios.post("/api/update", {name, email})
  .then(() => {
    toast({description: "Info successfully updated", status: 'success', position: 'bottom-right', isClosable: true, duration: 3000})
  })
  .catch((error) => {
      toast({description: error.response.data.error, status: 'error', position: 'bottom-right', isClosable: true, duration: 3000})
  });
};

The update successfully occurs on MongoDB, however the session object remains the same.
How can I tell nextjs to update session object as well?


问:
GDB: Follow exception flow
Consider the following MWE:

```<code>#include <stdexcept>
#include <iostream>

int main() {
    int a = 2;

    try {
        throw std::runtime_error("Example");
        a = 4;
    } catch (const std::exception &) {
        a = 5;
    }

    std::cout << a << std::endl;
}
</code>```

If I compile this with g++ -g -O0 test.cpp and then run the resulting binary through gdb via gdb ./a.out I can start stepping through the program. However, as soon as I reach the line that throws the exception inputting next or step does not lead me to the line a = 5 but instead immediately prints 5 to the console and then gdb tells me that the process has exited normally.

This is quite annoying as oftentimes it would actually be useful to figure out where the thrown exception is handled.

Is there a way to get gdb to follow the full program flow even when exceptions are involved?

My GDB version is GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1

EDIT: To ensure that the thrown exception has not been optimized out of my binary, I checked the respective assembly via objdump and if interpret that corretly, throwing the exception is still part of the binary:

```<code>objdump -drwC -Mintel a.out

a.out:     file format elf64-x86-64

Disassembly of section .init:

0000000000001000 <_init>:
    1000:       f3 0f 1e fa             endbr64
    1004:       48 83 ec 08             sub    rsp,0x8
    1008:       48 8b 05 d1 2f 00 00    mov    rax,QWORD PTR [rip+0x2fd1]        # 3fe0 <__gmon_start__@Base>
    100f:       48 85 c0                test   rax,rax
    1012:       74 02                   je     1016 <_init+0x16>
    1014:       ff d0                   call   rax
    1016:       48 83 c4 08             add    rsp,0x8
    101a:       c3                      ret

Disassembly of section .plt:

0000000000001020 <.plt>:
    1020:       ff 35 2a 2f 00 00       push   QWORD PTR [rip+0x2f2a]        # 3f50 <_GLOBAL_OFFSET_TABLE_+0x8>
    1026:       f2 ff 25 2b 2f 00 00    bnd jmp QWORD PTR [rip+0x2f2b]        # 3f58 <_GLOBAL_OFFSET_TABLE_+0x10>
    102d:       0f 1f 00                nop    DWORD PTR [rax]
    1030:       f3 0f 1e fa             endbr64
    1034:       68 00 00 00 00          push   0x0
    1039:       f2 e9 e1 ff ff ff       bnd jmp 1020 <_init+0x20>
    103f:       90                      nop
    1040:       f3 0f 1e fa             endbr64
    1044:       68 01 00 00 00          push   0x1
    1049:       f2 e9 d1 ff ff ff       bnd jmp 1020 <_init+0x20>
    104f:       90                      nop
    1050:       f3 0f 1e fa             endbr64
    1054:       68 02 00 00 00          push   0x2
    1059:       f2 e9 c1 ff ff ff       bnd jmp 1020 <_init+0x20>
    105f:       90                      nop
    1060:       f3 0f 1e fa             endbr64
    1064:       68 03 00 00 00          push   0x3
    1069:       f2 e9 b1 ff ff ff       bnd jmp 1020 <_init+0x20>
    106f:       90                      nop
    1070:       f3 0f 1e fa             endbr64
    1074:       68 04 00 00 00          push   0x4
    1079:       f2 e9 a1 ff ff ff       bnd jmp 1020 <_init+0x20>
    107f:       90                      nop
    1080:       f3 0f 1e fa             endbr64
    1084:       68 05 00 00 00          push   0x5
    1089:       f2 e9 91 ff ff ff       bnd jmp 1020 <_init+0x20>
    108f:       90                      nop
    1090:       f3 0f 1e fa             endbr64
    1094:       68 06 00 00 00          push   0x6
    1099:       f2 e9 81 ff ff ff       bnd jmp 1020 <_init+0x20>
    109f:       90                      nop
    10a0:       f3 0f 1e fa             endbr64
    10a4:       68 07 00 00 00          push   0x7
    10a9:       f2 e9 71 ff ff ff       bnd jmp 1020 <_init+0x20>
    10af:       90                      nop
    10b0:       f3 0f 1e fa             endbr64
    10b4:       68 08 00 00 00          push   0x8
    10b9:       f2 e9 61 ff ff ff       bnd jmp 1020 <_init+0x20>
    10bf:       90                      nop
    10c0:       f3 0f 1e fa             endbr64
    10c4:       68 09 00 00 00          push   0x9
    10c9:       f2 e9 51 ff ff ff       bnd jmp 1020 <_init+0x20>
    10cf:       90                      nop
    10d0:       f3 0f 1e fa             endbr64
    10d4:       68 0a 00 00 00          push   0xa
    10d9:       f2 e9 41 ff ff ff       bnd jmp 1020 <_init+0x20>
    10df:       90                      nop

Disassembly of section .plt.got:

00000000000010e0 <__cxa_finalize@plt>:
    10e0:       f3 0f 1e fa             endbr64
    10e4:       f2 ff 25 cd 2e 00 00    bnd jmp QWORD PTR [rip+0x2ecd]        # 3fb8 <__cxa_finalize@GLIBC_2.2.5>
    10eb:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

Disassembly of section .plt.sec:

00000000000010f0 <std::runtime_error::runtime_error(char const*)@plt>:
    10f0:       f3 0f 1e fa             endbr64
    10f4:       f2 ff 25 65 2e 00 00    bnd jmp QWORD PTR [rip+0x2e65]        # 3f60 <std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21>
    10fb:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001100 <__cxa_begin_catch@plt>:
    1100:       f3 0f 1e fa             endbr64
    1104:       f2 ff 25 5d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e5d]        # 3f68 <__cxa_begin_catch@CXXABI_1.3>
    110b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001110 <__cxa_allocate_exception@plt>:
    1110:       f3 0f 1e fa             endbr64
    1114:       f2 ff 25 55 2e 00 00    bnd jmp QWORD PTR [rip+0x2e55]        # 3f70 <__cxa_allocate_exception@CXXABI_1.3>
    111b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001120 <__cxa_free_exception@plt>:
    1120:       f3 0f 1e fa             endbr64
    1124:       f2 ff 25 4d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e4d]        # 3f78 <__cxa_free_exception@CXXABI_1.3>
    112b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001130 <__cxa_atexit@plt>:
    1130:       f3 0f 1e fa             endbr64
    1134:       f2 ff 25 45 2e 00 00    bnd jmp QWORD PTR [rip+0x2e45]        # 3f80 <__cxa_atexit@GLIBC_2.2.5>
    113b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001140 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@plt>:
    1140:       f3 0f 1e fa             endbr64
    1144:       f2 ff 25 3d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e3d]        # 3f88 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@GLIBCXX_3.4>
    114b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001150 <std::ios_base::Init::Init()@plt>:
    1150:       f3 0f 1e fa             endbr64
    1154:       f2 ff 25 35 2e 00 00    bnd jmp QWORD PTR [rip+0x2e35]        # 3f90 <std::ios_base::Init::Init()@GLIBCXX_3.4>
    115b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001160 <__cxa_end_catch@plt>:
    1160:       f3 0f 1e fa             endbr64
    1164:       f2 ff 25 2d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e2d]        # 3f98 <__cxa_end_catch@CXXABI_1.3>
    116b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001170 <__cxa_throw@plt>:
    1170:       f3 0f 1e fa             endbr64
    1174:       f2 ff 25 25 2e 00 00    bnd jmp QWORD PTR [rip+0x2e25]        # 3fa0 <__cxa_throw@CXXABI_1.3>
    117b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001180 <std::ostream::operator<<(int)@plt>:
    1180:       f3 0f 1e fa             endbr64
    1184:       f2 ff 25 1d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e1d]        # 3fa8 <std::ostream::operator<<(int)@GLIBCXX_3.4>
    118b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001190 <_Unwind_Resume@plt>:
    1190:       f3 0f 1e fa             endbr64
    1194:       f2 ff 25 15 2e 00 00    bnd jmp QWORD PTR [rip+0x2e15]        # 3fb0 <_Unwind_Resume@GCC_3.0>
    119b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

Disassembly of section .text:

00000000000011a0 <_start>:
    11a0:       f3 0f 1e fa             endbr64
    11a4:       31 ed                   xor    ebp,ebp
    11a6:       49 89 d1                mov    r9,rdx
    11a9:       5e                      pop    rsi
    11aa:       48 89 e2                mov    rdx,rsp
    11ad:       48 83 e4 f0             and    rsp,0xfffffffffffffff0
    11b1:       50                      push   rax
    11b2:       54                      push   rsp
    11b3:       45 31 c0                xor    r8d,r8d
    11b6:       31 c9                   xor    ecx,ecx
    11b8:       48 8d 3d ca 00 00 00    lea    rdi,[rip+0xca]        # 1289 <main>
    11bf:       ff 15 03 2e 00 00       call   QWORD PTR [rip+0x2e03]        # 3fc8 <__libc_start_main@GLIBC_2.34>
    11c5:       f4                      hlt
    11c6:       66 2e 0f 1f 84 00 00 00 00 00   cs nop WORD PTR [rax+rax*1+0x0]

00000000000011d0 <deregister_tm_clones>:
    11d0:       48 8d 3d 49 2e 00 00    lea    rdi,[rip+0x2e49]        # 4020 <__TMC_END__>
    11d7:       48 8d 05 42 2e 00 00    lea    rax,[rip+0x2e42]        # 4020 <__TMC_END__>
    11de:       48 39 f8                cmp    rax,rdi
    11e1:       74 15                   je     11f8 <deregister_tm_clones+0x28>
    11e3:       48 8b 05 ee 2d 00 00    mov    rax,QWORD PTR [rip+0x2dee]        # 3fd8 <_ITM_deregisterTMCloneTable@Base>
    11ea:       48 85 c0                test   rax,rax
    11ed:       74 09                   je     11f8 <deregister_tm_clones+0x28>
    11ef:       ff e0                   jmp    rax
    11f1:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]
    11f8:       c3                      ret
    11f9:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]

0000000000001200 <register_tm_clones>:
    1200:       48 8d 3d 19 2e 00 00    lea    rdi,[rip+0x2e19]        # 4020 <__TMC_END__>
    1207:       48 8d 35 12 2e 00 00    lea    rsi,[rip+0x2e12]        # 4020 <__TMC_END__>
    120e:       48 29 fe                sub    rsi,rdi
    1211:       48 89 f0                mov    rax,rsi
    1214:       48 c1 ee 3f             shr    rsi,0x3f
    1218:       48 c1 f8 03             sar    rax,0x3
    121c:       48 01 c6                add    rsi,rax
    121f:       48 d1 fe                sar    rsi,1
    1222:       74 14                   je     1238 <register_tm_clones+0x38>
    1224:       48 8b 05 bd 2d 00 00    mov    rax,QWORD PTR [rip+0x2dbd]        # 3fe8 <_ITM_registerTMCloneTable@Base>
    122b:       48 85 c0                test   rax,rax
    122e:       74 08                   je     1238 <register_tm_clones+0x38>
    1230:       ff e0                   jmp    rax
    1232:       66 0f 1f 44 00 00       nop    WORD PTR [rax+rax*1+0x0]
    1238:       c3                      ret
    1239:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]

0000000000001240 <__do_global_dtors_aux>:
    1240:       f3 0f 1e fa             endbr64
    1244:       80 3d 05 2f 00 00 00    cmp    BYTE PTR [rip+0x2f05],0x0        # 4150 <completed.0>
    124b:       75 2b                   jne    1278 <__do_global_dtors_aux+0x38>
    124d:       55                      push   rbp
    124e:       48 83 3d 62 2d 00 00 00         cmp    QWORD PTR [rip+0x2d62],0x0        # 3fb8 <__cxa_finalize@GLIBC_2.2.5>
    1256:       48 89 e5                mov    rbp,rsp
    1259:       74 0c                   je     1267 <__do_global_dtors_aux+0x27>
    125b:       48 8b 3d a6 2d 00 00    mov    rdi,QWORD PTR [rip+0x2da6]        # 4008 <__dso_handle>
    1262:       e8 79 fe ff ff          call   10e0 <__cxa_finalize@plt>
    1267:       e8 64 ff ff ff          call   11d0 <deregister_tm_clones>
    126c:       c6 05 dd 2e 00 00 01    mov    BYTE PTR [rip+0x2edd],0x1        # 4150 <completed.0>
    1273:       5d                      pop    rbp
    1274:       c3                      ret
    1275:       0f 1f 00                nop    DWORD PTR [rax]
    1278:       c3                      ret
    1279:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]

0000000000001280 <frame_dummy>:
    1280:       f3 0f 1e fa             endbr64
    1284:       e9 77 ff ff ff          jmp    1200 <register_tm_clones>

0000000000001289 <main>:
    1289:       f3 0f 1e fa             endbr64
    128d:       55                      push   rbp
    128e:       48 89 e5                mov    rbp,rsp
    1291:       41 55                   push   r13
    1293:       41 54                   push   r12
    1295:       53                      push   rbx
    1296:       48 83 ec 18             sub    rsp,0x18
    129a:       c7 45 d4 02 00 00 00    mov    DWORD PTR [rbp-0x2c],0x2
    12a1:       bf 10 00 00 00          mov    edi,0x10
    12a6:       e8 65 fe ff ff          call   1110 <__cxa_allocate_exception@plt>
    12ab:       48 89 c3                mov    rbx,rax
    12ae:       48 8d 05 4f 0d 00 00    lea    rax,[rip+0xd4f]        # 2004 <_IO_stdin_used+0x4>
    12b5:       48 89 c6                mov    rsi,rax
    12b8:       48 89 df                mov    rdi,rbx
    12bb:       e8 30 fe ff ff          call   10f0 <std::runtime_error::runtime_error(char const*)@plt>
    12c0:       48 8b 05 09 2d 00 00    mov    rax,QWORD PTR [rip+0x2d09]        # 3fd0 <std::runtime_error::~runtime_error()@GLIBCXX_3.4>
    12c7:       48 89 c2                mov    rdx,rax
    12ca:       48 8d 05 4f 2a 00 00    lea    rax,[rip+0x2a4f]        # 3d20 <typeinfo for std::runtime_error@GLIBCXX_3.4>
    12d1:       48 89 c6                mov    rsi,rax
    12d4:       48 89 df                mov    rdi,rbx
    12d7:       e8 94 fe ff ff          call   1170 <__cxa_throw@plt>
    12dc:       f3 0f 1e fa             endbr64
    12e0:       49 89 c5                mov    r13,rax
    12e3:       49 89 d4                mov    r12,rdx
    12e6:       48 89 df                mov    rdi,rbx
    12e9:       e8 32 fe ff ff          call   1120 <__cxa_free_exception@plt>
    12ee:       4c 89 e8                mov    rax,r13
    12f1:       4c 89 e2                mov    rdx,r12
    12f4:       eb 04                   jmp    12fa <main+0x71>
    12f6:       f3 0f 1e fa             endbr64
    12fa:       48 83 fa 01             cmp    rdx,0x1
    12fe:       74 08                   je     1308 <main+0x7f>
    1300:       48 89 c7                mov    rdi,rax
    1303:       e8 88 fe ff ff          call   1190 <_Unwind_Resume@plt>
    1308:       48 89 c7                mov    rdi,rax
    130b:       e8 f0 fd ff ff          call   1100 <__cxa_begin_catch@plt>
    1310:       48 89 45 d8             mov    QWORD PTR [rbp-0x28],rax
    1314:       c7 45 d4 05 00 00 00    mov    DWORD PTR [rbp-0x2c],0x5
    131b:       e8 40 fe ff ff          call   1160 <__cxa_end_catch@plt>
    1320:       8b 45 d4                mov    eax,DWORD PTR [rbp-0x2c]
    1323:       89 c6                   mov    esi,eax
    1325:       48 8d 05 14 2d 00 00    lea    rax,[rip+0x2d14]        # 4040 <std::cout@GLIBCXX_3.4>
    132c:       48 89 c7                mov    rdi,rax
    132f:       e8 4c fe ff ff          call   1180 <std::ostream::operator<<(int)@plt>
    1334:       48 8b 15 85 2c 00 00    mov    rdx,QWORD PTR [rip+0x2c85]        # 3fc0 <std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)@GLIBCXX_3.4>
    133b:       48 89 d6                mov    rsi,rdx
    133e:       48 89 c7                mov    rdi,rax
    1341:       e8 fa fd ff ff          call   1140 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@plt>
    1346:       b8 00 00 00 00          mov    eax,0x0
    134b:       48 83 c4 18             add    rsp,0x18
    134f:       5b                      pop    rbx
    1350:       41 5c                   pop    r12
    1352:       41 5d                   pop    r13
    1354:       5d                      pop    rbp
    1355:       c3                      ret

0000000000001356 <__static_initialization_and_destruction_0(int, int)>:
    1356:       f3 0f 1e fa             endbr64
    135a:       55                      push   rbp
    135b:       48 89 e5                mov    rbp,rsp
    135e:       48 83 ec 10             sub    rsp,0x10
    1362:       89 7d fc                mov    DWORD PTR [rbp-0x4],edi
    1365:       89 75 f8                mov    DWORD PTR [rbp-0x8],esi
    1368:       83 7d fc 01             cmp    DWORD PTR [rbp-0x4],0x1
    136c:       75 3b                   jne    13a9 <__static_initialization_and_destruction_0(int, int)+0x53>
    136e:       81 7d f8 ff ff 00 00    cmp    DWORD PTR [rbp-0x8],0xffff
    1375:       75 32                   jne    13a9 <__static_initialization_and_destruction_0(int, int)+0x53>
    1377:       48 8d 05 d3 2d 00 00    lea    rax,[rip+0x2dd3]        # 4151 <std::__ioinit>
    137e:       48 89 c7                mov    rdi,rax
    1381:       e8 ca fd ff ff          call   1150 <std::ios_base::Init::Init()@plt>
    1386:       48 8d 05 7b 2c 00 00    lea    rax,[rip+0x2c7b]        # 4008 <__dso_handle>
    138d:       48 89 c2                mov    rdx,rax
    1390:       48 8d 05 ba 2d 00 00    lea    rax,[rip+0x2dba]        # 4151 <std::__ioinit>
    1397:       48 89 c6                mov    rsi,rax
    139a:       48 8b 05 4f 2c 00 00    mov    rax,QWORD PTR [rip+0x2c4f]        # 3ff0 <std::ios_base::Init::~Init()@GLIBCXX_3.4>
    13a1:       48 89 c7                mov    rdi,rax
    13a4:       e8 87 fd ff ff          call   1130 <__cxa_atexit@plt>
    13a9:       90                      nop
    13aa:       c9                      leave
    13ab:       c3                      ret

00000000000013ac <_GLOBAL__sub_I_main>:
    13ac:       f3 0f 1e fa             endbr64
    13b0:       55                      push   rbp
    13b1:       48 89 e5                mov    rbp,rsp
    13b4:       be ff ff 00 00          mov    esi,0xffff
    13b9:       bf 01 00 00 00          mov    edi,0x1
    13be:       e8 93 ff ff ff          call   1356 <__static_initialization_and_destruction_0(int, int)>
    13c3:       5d                      pop    rbp
    13c4:       c3                      ret

Disassembly of section .fini:

00000000000013c8 <_fini>:
    13c8:       f3 0f 1e fa             endbr64
    13cc:       48 83 ec 08             sub    rsp,0x8
    13d0:       48 83 c4 08             add    rsp,0x8
    13d4:       c3                      ret
</code>```

Title: GDB: Follow exception flow

Body:
Consider the following MWE:

#include <stdexcept>
#include <iostream>

int main() {
    int a = 2;

    try {
        throw std::runtime_error("Example");
        a = 4;
    } catch (const std::exception &) {
        a = 5;
    }

    std::cout << a << std::endl;
}

If I compile this with g++ -g -O0 test.cpp and then run the resulting binary through gdb via gdb ./a.out I can start stepping through the program. However, as soon as I reach the line that throws the exception inputting next or step does not lead me to the line a = 5 but instead immediately prints 5 to the console and then gdb tells me that the process has exited normally.

This is quite annoying as oftentimes it would actually be useful to figure out where the thrown exception is handled.

Is there a way to get gdb to follow the full program flow even when exceptions are involved?

My GDB version is GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1

EDIT: To ensure that the thrown exception has not been optimized out of my binary, I checked the respective assembly via objdump and if interpret that corretly, throwing the exception is still part of the binary:

objdump -drwC -Mintel a.out

a.out:     file format elf64-x86-64

Disassembly of section .init:

0000000000001000 <_init>:
    1000:       f3 0f 1e fa             endbr64
    1004:       48 83 ec 08             sub    rsp,0x8
    1008:       48 8b 05 d1 2f 00 00    mov    rax,QWORD PTR [rip+0x2fd1]        # 3fe0 <__gmon_start__@Base>
    100f:       48 85 c0                test   rax,rax
    1012:       74 02                   je     1016 <_init+0x16>
    1014:       ff d0                   call   rax
    1016:       48 83 c4 08             add    rsp,0x8
    101a:       c3                      ret

Disassembly of section .plt:

0000000000001020 <.plt>:
    1020:       ff 35 2a 2f 00 00       push   QWORD PTR [rip+0x2f2a]        # 3f50 <_GLOBAL_OFFSET_TABLE_+0x8>
    1026:       f2 ff 25 2b 2f 00 00    bnd jmp QWORD PTR [rip+0x2f2b]        # 3f58 <_GLOBAL_OFFSET_TABLE_+0x10>
    102d:       0f 1f 00                nop    DWORD PTR [rax]
    1030:       f3 0f 1e fa             endbr64
    1034:       68 00 00 00 00          push   0x0
    1039:       f2 e9 e1 ff ff ff       bnd jmp 1020 <_init+0x20>
    103f:       90                      nop
    1040:       f3 0f 1e fa             endbr64
    1044:       68 01 00 00 00          push   0x1
    1049:       f2 e9 d1 ff ff ff       bnd jmp 1020 <_init+0x20>
    104f:       90                      nop
    1050:       f3 0f 1e fa             endbr64
    1054:       68 02 00 00 00          push   0x2
    1059:       f2 e9 c1 ff ff ff       bnd jmp 1020 <_init+0x20>
    105f:       90                      nop
    1060:       f3 0f 1e fa             endbr64
    1064:       68 03 00 00 00          push   0x3
    1069:       f2 e9 b1 ff ff ff       bnd jmp 1020 <_init+0x20>
    106f:       90                      nop
    1070:       f3 0f 1e fa             endbr64
    1074:       68 04 00 00 00          push   0x4
    1079:       f2 e9 a1 ff ff ff       bnd jmp 1020 <_init+0x20>
    107f:       90                      nop
    1080:       f3 0f 1e fa             endbr64
    1084:       68 05 00 00 00          push   0x5
    1089:       f2 e9 91 ff ff ff       bnd jmp 1020 <_init+0x20>
    108f:       90                      nop
    1090:       f3 0f 1e fa             endbr64
    1094:       68 06 00 00 00          push   0x6
    1099:       f2 e9 81 ff ff ff       bnd jmp 1020 <_init+0x20>
    109f:       90                      nop
    10a0:       f3 0f 1e fa             endbr64
    10a4:       68 07 00 00 00          push   0x7
    10a9:       f2 e9 71 ff ff ff       bnd jmp 1020 <_init+0x20>
    10af:       90                      nop
    10b0:       f3 0f 1e fa             endbr64
    10b4:       68 08 00 00 00          push   0x8
    10b9:       f2 e9 61 ff ff ff       bnd jmp 1020 <_init+0x20>
    10bf:       90                      nop
    10c0:       f3 0f 1e fa             endbr64
    10c4:       68 09 00 00 00          push   0x9
    10c9:       f2 e9 51 ff ff ff       bnd jmp 1020 <_init+0x20>
    10cf:       90                      nop
    10d0:       f3 0f 1e fa             endbr64
    10d4:       68 0a 00 00 00          push   0xa
    10d9:       f2 e9 41 ff ff ff       bnd jmp 1020 <_init+0x20>
    10df:       90                      nop

Disassembly of section .plt.got:

00000000000010e0 <__cxa_finalize@plt>:
    10e0:       f3 0f 1e fa             endbr64
    10e4:       f2 ff 25 cd 2e 00 00    bnd jmp QWORD PTR [rip+0x2ecd]        # 3fb8 <__cxa_finalize@GLIBC_2.2.5>
    10eb:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

Disassembly of section .plt.sec:

00000000000010f0 <std::runtime_error::runtime_error(char const*)@plt>:
    10f0:       f3 0f 1e fa             endbr64
    10f4:       f2 ff 25 65 2e 00 00    bnd jmp QWORD PTR [rip+0x2e65]        # 3f60 <std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21>
    10fb:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001100 <__cxa_begin_catch@plt>:
    1100:       f3 0f 1e fa             endbr64
    1104:       f2 ff 25 5d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e5d]        # 3f68 <__cxa_begin_catch@CXXABI_1.3>
    110b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001110 <__cxa_allocate_exception@plt>:
    1110:       f3 0f 1e fa             endbr64
    1114:       f2 ff 25 55 2e 00 00    bnd jmp QWORD PTR [rip+0x2e55]        # 3f70 <__cxa_allocate_exception@CXXABI_1.3>
    111b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001120 <__cxa_free_exception@plt>:
    1120:       f3 0f 1e fa             endbr64
    1124:       f2 ff 25 4d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e4d]        # 3f78 <__cxa_free_exception@CXXABI_1.3>
    112b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001130 <__cxa_atexit@plt>:
    1130:       f3 0f 1e fa             endbr64
    1134:       f2 ff 25 45 2e 00 00    bnd jmp QWORD PTR [rip+0x2e45]        # 3f80 <__cxa_atexit@GLIBC_2.2.5>
    113b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001140 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@plt>:
    1140:       f3 0f 1e fa             endbr64
    1144:       f2 ff 25 3d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e3d]        # 3f88 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@GLIBCXX_3.4>
    114b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001150 <std::ios_base::Init::Init()@plt>:
    1150:       f3 0f 1e fa             endbr64
    1154:       f2 ff 25 35 2e 00 00    bnd jmp QWORD PTR [rip+0x2e35]        # 3f90 <std::ios_base::Init::Init()@GLIBCXX_3.4>
    115b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001160 <__cxa_end_catch@plt>:
    1160:       f3 0f 1e fa             endbr64
    1164:       f2 ff 25 2d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e2d]        # 3f98 <__cxa_end_catch@CXXABI_1.3>
    116b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001170 <__cxa_throw@plt>:
    1170:       f3 0f 1e fa             endbr64
    1174:       f2 ff 25 25 2e 00 00    bnd jmp QWORD PTR [rip+0x2e25]        # 3fa0 <__cxa_throw@CXXABI_1.3>
    117b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001180 <std::ostream::operator<<(int)@plt>:
    1180:       f3 0f 1e fa             endbr64
    1184:       f2 ff 25 1d 2e 00 00    bnd jmp QWORD PTR [rip+0x2e1d]        # 3fa8 <std::ostream::operator<<(int)@GLIBCXX_3.4>
    118b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

0000000000001190 <_Unwind_Resume@plt>:
    1190:       f3 0f 1e fa             endbr64
    1194:       f2 ff 25 15 2e 00 00    bnd jmp QWORD PTR [rip+0x2e15]        # 3fb0 <_Unwind_Resume@GCC_3.0>
    119b:       0f 1f 44 00 00          nop    DWORD PTR [rax+rax*1+0x0]

Disassembly of section .text:

00000000000011a0 <_start>:
    11a0:       f3 0f 1e fa             endbr64
    11a4:       31 ed                   xor    ebp,ebp
    11a6:       49 89 d1                mov    r9,rdx
    11a9:       5e                      pop    rsi
    11aa:       48 89 e2                mov    rdx,rsp
    11ad:       48 83 e4 f0             and    rsp,0xfffffffffffffff0
    11b1:       50                      push   rax
    11b2:       54                      push   rsp
    11b3:       45 31 c0                xor    r8d,r8d
    11b6:       31 c9                   xor    ecx,ecx
    11b8:       48 8d 3d ca 00 00 00    lea    rdi,[rip+0xca]        # 1289
    11bf:       ff 15 03 2e 00 00       call   QWORD PTR [rip+0x2e03]        # 3fc8 <__libc_start_main@GLIBC_2.34>
    11c5:       f4                      hlt
    11c6:       66 2e 0f 1f 84 00 00 00 00 00   cs nop WORD PTR [rax+rax*1+0x0]

00000000000011d0 <deregister_tm_clones>:
    11d0:       48 8d 3d 49 2e 00 00    lea    rdi,[rip+0x2e49]        # 4020 <__TMC_END__>
    11d7:       48 8d 05 42 2e 00 00    lea    rax,[rip+0x2e42]        # 4020 <__TMC_END__>
    11de:       48 39 f8                cmp    rax,rdi
    11e1:       74 15                   je     11f8 <deregister_tm_clones+0x28>
    11e3:       48 8b 05 ee 2d 00 00    mov    rax,QWORD PTR [rip+0x2dee]        # 3fd8 <_ITM_deregisterTMCloneTable@Base>
    11ea:       48 85 c0                test   rax,rax
    11ed:       74 09                   je     11f8 <deregister_tm_clones+0x28>
    11ef:       ff e0                   jmp    rax
    11f1:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]
    11f8:       c3                      ret
    11f9:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]

0000000000001200 <register_tm_clones>:
    1200:       48 8d 3d 19 2e 00 00    lea    rdi,[rip+0x2e19]        # 4020 <__TMC_END__>
    1207:       48 8d 35 12 2e 00 00    lea    rsi,[rip+0x2e12]        # 4020 <__TMC_END__>
    120e:       48 29 fe                sub    rsi,rdi
    1211:       48 89 f0                mov    rax,rsi
    1214:       48 c1 ee 3f             shr    rsi,0x3f
    1218:       48 c1 f8 03             sar    rax,0x3
    121c:       48 01 c6                add    rsi,rax
    121f:       48 d1 fe                sar    rsi,1
    1222:       74 14                   je     1238 <register_tm_clones+0x38>
    1224:       48 8b 05 bd 2d 00 00    mov    rax,QWORD PTR [rip+0x2dbd]        # 3fe8 <_ITM_registerTMCloneTable@Base>
    122b:       48 85 c0                test   rax,rax
    122e:       74 08                   je     1238 <register_tm_clones+0x38>
    1230:       ff e0                   jmp    rax
    1232:       66 0f 1f 44 00 00       nop    WORD PTR [rax+rax*1+0x0]
    1238:       c3                      ret
    1239:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]

0000000000001240 <__do_global_dtors_aux>:
    1240:       f3 0f 1e fa             endbr64
    1244:       80 3d 05 2f 00 00 00    cmp    BYTE PTR [rip+0x2f05],0x0        # 4150 <completed.0>
    124b:       75 2b                   jne    1278 <__do_global_dtors_aux+0x38>
    124d:       55                      push   rbp
    124e:       48 83 3d 62 2d 00 00 00         cmp    QWORD PTR [rip+0x2d62],0x0        # 3fb8 <__cxa_finalize@GLIBC_2.2.5>
    1256:       48 89 e5                mov    rbp,rsp
    1259:       74 0c                   je     1267 <__do_global_dtors_aux+0x27>
    125b:       48 8b 3d a6 2d 00 00    mov    rdi,QWORD PTR [rip+0x2da6]        # 4008 <__dso_handle>
    1262:       e8 79 fe ff ff          call   10e0 <__cxa_finalize@plt>
    1267:       e8 64 ff ff ff          call   11d0 <deregister_tm_clones>
    126c:       c6 05 dd 2e 00 00 01    mov    BYTE PTR [rip+0x2edd],0x1        # 4150 <completed.0>
    1273:       5d                      pop    rbp
    1274:       c3                      ret
    1275:       0f 1f 00                nop    DWORD PTR [rax]
    1278:       c3                      ret
    1279:       0f 1f 80 00 00 00 00    nop    DWORD PTR [rax+0x0]

0000000000001280 <frame_dummy>:
    1280:       f3 0f 1e fa             endbr64
    1284:       e9 77 ff ff ff          jmp    1200 <register_tm_clones>

0000000000001289 :
    1289:       f3 0f 1e fa             endbr64
    128d:       55                      push   rbp
    128e:       48 89 e5                mov    rbp,rsp
    1291:       41 55                   push   r13
    1293:       41 54                   push   r12
    1295:       53                      push   rbx
    1296:       48 83 ec 18             sub    rsp,0x18
    129a:       c7 45 d4 02 00 00 00    mov    DWORD PTR [rbp-0x2c],0x2
    12a1:       bf 10 00 00 00          mov    edi,0x10
    12a6:       e8 65 fe ff ff          call   1110 <__cxa_allocate_exception@plt>
    12ab:       48 89 c3                mov    rbx,rax
    12ae:       48 8d 05 4f 0d 00 00    lea    rax,[rip+0xd4f]        # 2004 <_IO_stdin_used+0x4>
    12b5:       48 89 c6                mov    rsi,rax
    12b8:       48 89 df                mov    rdi,rbx
    12bb:       e8 30 fe ff ff          call   10f0 <std::runtime_error::runtime_error(char const*)@plt>
    12c0:       48 8b 05 09 2d 00 00    mov    rax,QWORD PTR [rip+0x2d09]        # 3fd0 <std::runtime_error::~runtime_error()@GLIBCXX_3.4>
    12c7:       48 89 c2                mov    rdx,rax
    12ca:       48 8d 05 4f 2a 00 00    lea    rax,[rip+0x2a4f]        # 3d20 <typeinfo for std::runtime_error@GLIBCXX_3.4>
    12d1:       48 89 c6                mov    rsi,rax
    12d4:       48 89 df                mov    rdi,rbx
    12d7:       e8 94 fe ff ff          call   1170 <__cxa_throw@plt>
    12dc:       f3 0f 1e fa             endbr64
    12e0:       49 89 c5                mov    r13,rax
    12e3:       49 89 d4                mov    r12,rdx
    12e6:       48 89 df                mov    rdi,rbx
    12e9:       e8 32 fe ff ff          call   1120 <__cxa_free_exception@plt>
    12ee:       4c 89 e8                mov    rax,r13
    12f1:       4c 89 e2                mov    rdx,r12
    12f4:       eb 04                   jmp    12fa
    12f6:       f3 0f 1e fa             endbr64
    12fa:       48 83 fa 01             cmp    rdx,0x1
    12fe:       74 08                   je     1308
    1300:       48 89 c7                mov    rdi,rax
    1303:       e8 88 fe ff ff          call   1190 <_Unwind_Resume@plt>
    1308:       48 89 c7                mov    rdi,rax
    130b:       e8 f0 fd ff ff          call   1100 <__cxa_begin_catch@plt>
    1310:       48 89 45 d8             mov    QWORD PTR [rbp-0x28],rax
    1314:       c7 45 d4 05 00 00 00    mov    DWORD PTR [rbp-0x2c],0x5
    131b:       e8 40 fe ff ff          call   1160 <__cxa_end_catch@plt>
    1320:       8b 45 d4                mov    eax,DWORD PTR [rbp-0x2c]
    1323:       89 c6                   mov    esi,eax
    1325:       48 8d 05 14 2d 00 00    lea    rax,[rip+0x2d14]        # 4040 <std::cout@GLIBCXX_3.4>
    132c:       48 89 c7                mov    rdi,rax
    132f:       e8 4c fe ff ff          call   1180 <std::ostream::operator<<(int)@plt>
    1334:       48 8b 15 85 2c 00 00    mov    rdx,QWORD PTR [rip+0x2c85]        # 3fc0 <std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)@GLIBCXX_3.4>
    133b:       48 89 d6                mov    rsi,rdx
    133e:       48 89 c7                mov    rdi,rax
    1341:       e8 fa fd ff ff          call   1140 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@plt>
    1346:       b8 00 00 00 00          mov    eax,0x0
    134b:       48 83 c4 18             add    rsp,0x18
    134f:       5b                      pop    rbx
    1350:       41 5c                   pop    r12
    1352:       41 5d                   pop    r13
    1354:       5d                      pop    rbp
    1355:       c3                      ret

0000000000001356 <__static_initialization_and_destruction_0(int, int)>:
    1356:       f3 0f 1e fa             endbr64
    135a:       55                      push   rbp
    135b:       48 89 e5                mov    rbp,rsp
    135e:       48 83 ec 10             sub    rsp,0x10
    1362:       89 7d fc                mov    DWORD PTR [rbp-0x4],edi
    1365:       89 75 f8                mov    DWORD PTR [rbp-0x8],esi
    1368:       83 7d fc 01             cmp    DWORD PTR [rbp-0x4],0x1
    136c:       75 3b                   jne    13a9 <__static_initialization_and_destruction_0(int, int)+0x53>
    136e:       81 7d f8 ff ff 00 00    cmp    DWORD PTR [rbp-0x8],0xffff
    1375:       75 32                   jne    13a9 <__static_initialization_and_destruction_0(int, int)+0x53>
    1377:       48 8d 05 d3 2d 00 00    lea    rax,[rip+0x2dd3]        # 4151 <std::__ioinit>
    137e:       48 89 c7                mov    rdi,rax
    1381:       e8 ca fd ff ff          call   1150 <std::ios_base::Init::Init()@plt>
    1386:       48 8d 05 7b 2c 00 00    lea    rax,[rip+0x2c7b]        # 4008 <__dso_handle>
    138d:       48 89 c2                mov    rdx,rax
    1390:       48 8d 05 ba 2d 00 00    lea    rax,[rip+0x2dba]        # 4151 <std::__ioinit>
    1397:       48 89 c6                mov    rsi,rax
    139a:       48 8b 05 4f 2c 00 00    mov    rax,QWORD PTR [rip+0x2c4f]        # 3ff0 <std::ios_base::Init::~Init()@GLIBCXX_3.4>
    13a1:       48 89 c7                mov    rdi,rax
    13a4:       e8 87 fd ff ff          call   1130 <__cxa_atexit@plt>
    13a9:       90                      nop
    13aa:       c9                      leave
    13ab:       c3                      ret

00000000000013ac <_GLOBAL__sub_I_main>:
    13ac:       f3 0f 1e fa             endbr64
    13b0:       55                      push   rbp
    13b1:       48 89 e5                mov    rbp,rsp
    13b4:       be ff ff 00 00          mov    esi,0xffff
    13b9:       bf 01 00 00 00          mov    edi,0x1
    13be:       e8 93 ff ff ff          call   1356 <__static_initialization_and_destruction_0(int, int)>
    13c3:       5d                      pop    rbp
    13c4:       c3                      ret

Disassembly of section .fini:

00000000000013c8 <_fini>:
    13c8:       f3 0f 1e fa             endbr64
    13cc:       48 83 ec 08             sub    rsp,0x8
    13d0:       48 83 c4 08             add    rsp,0x8
    13d4:       c3                      ret


问:
In typescript, wierd inference from exact type from union type. How to handle it?
I want to define axios response with one union type ( when success /error )
and handle and inference date type by status code with user defined type guard.

IntRange is a just union type from n to m int. ( n | n+1 | n+2 | ... | m)

```<code>type SuccessCode = IntRange<200, 300>
type ErrorCode = IntRange<0, 200> | IntRange<300, 600>

interface SuccessResponse<T> extends Omit<AxiosResponse<T>, 'status'> {
   status: SuccessCode
}

interface ErrorResponse extends Omit<AxiosResponse<{message: string}, 'status'> {
   status: ErrorCode
}

type ResType<T> = SuccessResponse<T> | ErrorResponse

function isSuccessStatus(status: number): status is SuccessCode {
  return Number.isInteger(status) && (status >= 200 && status < 300)
}

</code>```

And I expect to when isSuccess(status) -> data type will be inferenced by T.

But in my code,

```<code>if (status === 204)
</code>```

data type is inferenced by T correctly,

but

```<code>if (isSuccessStatus(status))
</code>```

it consoles true, but data type is inference by T | {message: string} not T.

what is wrong with my code ? please help me ..

Just enumerating status === 200 || status === 201 || .... is working.

And after isSuccessStatus (user-defined type guards) => status type is inferenced by SuccessCode.

but data (must be T) is just T | {message: string} .
I don't know why this wierd thing happens ..

Body:
I want to define axios response with one union type ( when success /error )
and handle and inference date type by status code with user defined type guard.

IntRange is a just union type from n to m int. ( n | n+1 | n+2 | ... | m)

type SuccessCode = IntRange<200, 300>
type ErrorCode = IntRange<0, 200> | IntRange<300, 600>

interface SuccessResponse<T> extends Omit<AxiosResponse<T>, 'status'> {
   status: SuccessCode
}

interface ErrorResponse extends Omit<AxiosResponse<{message: string}, 'status'> {
   status: ErrorCode
}

type ResType<T> = SuccessResponse<T> | ErrorResponse

function isSuccessStatus(status: number): status is SuccessCode {
  return Number.isInteger(status) && (status >= 200 && status < 300)
}

And I expect to when isSuccess(status) -> data type will be inferenced by T.

But in my code,

if (status === 204)

data type is inferenced by T correctly,

but

if (isSuccessStatus(status))

it consoles true, but data type is inference by T | {message: string} not T.

what is wrong with my code ? please help me ..

Just enumerating status === 200 || status === 201 || .... is working.

And after isSuccessStatus (user-defined type guards) => status type is inferenced by SuccessCode.

but data (must be T) is just T | {message: string} .
I don't know why this wierd thing happens ..


问:
Error - Unable to load ai model in c# application
I tried to run a c# application which use an image classification model, but when I try to load the image, the program crashes with the following error:

System.ArgumentException: 'The parameter is incorrect.
Failed to load model with error: Unknown model file format version.'

This is the function that loads the model into memory:

private async Task loadModel()
{
    // Get an access the ONNX model and save it in memory.
    StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/Model.onnx"));

    // Instantiate the model.
    modelGen = await Model.CreateFromStreamAsync(modelFile);
}
```


问:
In linux, how to split large file into small files according to {size} and starts from the position where it ignores {n*size} of the large file
I'm splitting a large file which has the size of 1.1TB with the command

```<code>split -b 10G -d {large_file_path} {dest_path}
</code>```

However, some error occurs and it terminates while splitting into the 25th small file. I wonder how can I resume instead of starting over?

Body:
I'm splitting a large file which has the size of 1.1TB with the command

split -b 10G -d {large_file_path} {dest_path}

However, some error occurs and it terminates while splitting into the 25th small file. I wonder how can I resume instead of starting over?


问:
Google Books API deoesn't return results for certain ISBNs
I am trying to use Google Books API to get results for a book but although the book is available on Google Books website the API doesn't return results for its ISBN

The ISBNs I am searching for are: 9781595086228 - 1595086226

The API Request:

```<code>https://www.googleapis.com/books/v1/volumes?q=isbn:9781595086228&key=<API Key>
</code>```

and

```<code>https://www.googleapis.com/books/v1/volumes?q=isbn:1595086226&key=<API Key>
</code>```

The response:

```<code>{kind: "books#volumes",
totalItems: 0
}
</code>```

The Book page on Google Books:

https://books.google.com.eg/books?id=nAmyDwAAQBAJ&dq=9781595086228

I want to know if there is a problem with my request format or if the problem is not related to my request.

Body:
I am trying to use Google Books API to get results for a book but although the book is available on Google Books website the API doesn't return results for its ISBN

The ISBNs I am searching for are: 9781595086228 - 1595086226

The API Request:

https://www.googleapis.com/books/v1/volumes?q=isbn:9781595086228&key=<API Key>

and

https://www.googleapis.com/books/v1/volumes?q=isbn:1595086226&key=<API Key>

The response:

{kind: "books#volumes",
totalItems: 0
}

The Book page on Google Books:

https://books.google.com.eg/books?id=nAmyDwAAQBAJ&dq=9781595086228

I want to know if there is a problem with my request format or if the problem is not related to my request.


问:
Distinguish empty Stream, Stream of empty Optionals only, Stream with at least one non-empty Optional
I have a Stream<Optional<T>>.

I want to use the findFirst()/findAny() methods to return a value. However I want to throw different exceptions depending on the Stream being empty or not.

Stream<Optional<MyType>> stream = ...;
return stream
  .flatMap(Optional::stream)
  .findFirst()
  .orElseThrow(() -> {
    // I want to know here if the stream was empty or not but flatMap forgot that
});
```
<p>The logic should still be lazily evaluated, once I found a non-empty Optional, the stream should not be further progressed and the value should be returned early.</p>
<p>I tried to mutate a variable in the upper scope in a map to read from it but variables used in Lambda expressions have to be final.</p>
<pre class="lang-java prettyprint-override"><code>boolean empty = true;
Stream<Optional<MyType>> stream = ...;
return stream
  .map(t -> {
    empty = false; //error, must be final
    return t;
  })
  .flatMap(Optional::stream)
  .findFirst()
  .orElseThrow(() -> {
    if (empty) {
      throw ...;
    } else {
      throw ...;
    }
});
</code>```

I tried to write a plain for loop but this does not work with streams:

boolean empty = true;
Stream<Optional<MyType>> stream = ...;
for (Optional<MyType> o: stream) { //error, can't for loop on type Stream<...>
  if (o.isEmpty()) {
    empty = false;
  } else {
    return o.get();
  }
}
if (empty) {
  throw ...;
} else {
  throw ...;
}
```

What can I do here?

Body:
I have a Stream<Optional<T>>.

I want to use the findFirst()/findAny() methods to return a value. However I want to throw different exceptions depending on the Stream being empty or not.

Stream<Optional<MyType>> stream = ...;
return stream
  .flatMap(Optional::stream)
  .findFirst()
  .orElseThrow(() -> {
    // I want to know here if the stream was empty or not but flatMap forgot that
});

The logic should still be lazily evaluated, once I found a non-empty Optional, the stream should not be further progressed and the value should be returned early.

I tried to mutate a variable in the upper scope in a map to read from it but variables used in Lambda expressions have to be final.

boolean empty = true;
Stream<Optional<MyType>> stream = ...;
return stream
  .map(t -> {
    empty = false; //error, must be final
    return t;
  })
  .flatMap(Optional::stream)
  .findFirst()
  .orElseThrow(() -> {
    if (empty) {
      throw ...;
    } else {
      throw ...;
    }
});

I tried to write a plain for loop but this does not work with streams:

boolean empty = true;
Stream<Optional<MyType>> stream = ...;
for (Optional<MyType> o: stream) { //error, can't for loop on type Stream<...>
  if (o.isEmpty()) {
    empty = false;
  } else {
    return o.get();
  }
}
if (empty) {
  throw ...;
} else {
  throw ...;
}

What can I do here?


问:
Laravel Math Captcha generate image
I am using "mewebstudio/captcha" package two number and operator.. I want to one number then the operator then another number.

I want to bellow Image

Title: Laravel Math Captcha generate image


问:
nodemailer is sending email for each invalid url
I have created a script in node js which basically fetch some urls and get their http status codes. If the http status code are not equal to 200 and I want to send mail using nodemailer. (In the email I want to also send the url that is down).

Currently if 2 urls are down, nodemailer is sending 2 seperate e-mails. I only want to send one e-mail which will contain all the invalid urls.

```<code>const request = require("request");
const nodemailer = require("nodemailer");

const urlList = [
  "https://www.google.com",
  "https://www.mongodb.com",
  "https://www.mongoslsdb33.com",
  "https://www.google.comslflalfdkjlsdfj",
];

const transporter = nodemailer.createTransport({
  host: "smtp.gmail.com",
  port: 587,
  auth: {
    user: "email",
    pass: "password",
  },
  secure: false,
});

function getStatus(url) {
  return new Promise((resolve, reject) => {
    request(url, function (error, response, body) {
      resolve({
        site: url,
        status:
          !error && response.statusCode == 200
            ? "OK"
            : "Down: " + error.message,
      });
    });
  });
}

let promiseList = urlList.map((url) => getStatus(url));

Promise.all(promiseList).then((resultList) => {
  resultList.forEach((result) => {
    if (result.status.startsWith("Down")) {
      console.log(result);
      const message = {
        from: "from-email",
        to: "to-email",
        subject: "Subject",
        html: `<h1>Following URLs have issues:</h1>
            <p>${result} is down</p>`,
      };

      transporter.sendMail(message, function (err, info) {
        if (err) {
          console.log(err);
        } else {
          console.log(info);
        }
      });
    } else {
      return;
    }
  });
});
</code>```

Body:
I have created a script in node js which basically fetch some urls and get their http status codes. If the http status code are not equal to 200 and I want to send mail using nodemailer. (In the email I want to also send the url that is down).

Currently if 2 urls are down, nodemailer is sending 2 seperate e-mails. I only want to send one e-mail which will contain all the invalid urls.

const request = require("request");
const nodemailer = require("nodemailer");

const urlList = [
  "https://www.google.com",
  "https://www.mongodb.com",
  "https://www.mongoslsdb33.com",
  "https://www.google.comslflalfdkjlsdfj",
];

const transporter = nodemailer.createTransport({
  host: "smtp.gmail.com",
  port: 587,
  auth: {
    user: "email",
    pass: "password",
  },
  secure: false,
});

function getStatus(url) {
  return new Promise((resolve, reject) => {
    request(url, function (error, response, body) {
      resolve({
        site: url,
        status:
          !error && response.statusCode == 200
            ? "OK"
            : "Down: " + error.message,
      });
    });
  });
}

let promiseList = urlList.map((url) => getStatus(url));

Promise.all(promiseList).then((resultList) => {
  resultList.forEach((result) => {
    if (result.status.startsWith("Down")) {
      console.log(result);
      const message = {
        from: "from-email",
        to: "to-email",
        subject: "Subject",
        html: `
Following URLs have issues:

${result} is down
`,
      };

      transporter.sendMail(message, function (err, info) {
        if (err) {
          console.log(err);
        } else {
          console.log(info);
        }
      });
    } else {
      return;
    }
  });
});


问:
Why my hdfs namenode and datanode cannot be formatted?
Hi i tried to format the namenode. But the error shown below keeps appearing:

```<code>ERROR conf.Configuration: error parsing conf core-site.xmlcom.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <configuration>
at [row,col,system-id]: [26,0,"file:/C:/Hadoop/hadoop-3.1.0/etc/hadoop/core-site.xml"]

ERROR namenode.NameNode: Failed to start namenode.
java.lang.RuntimeException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <configuration>
</code>```

I have checked the configuration file but did not find any syntax error in that.

I tried to run hdfs namenode -format and datanode -format; but it failed. Can someone help me with this error ?

Body:
Hi i tried to format the namenode. But the error shown below keeps appearing:

ERROR conf.Configuration: error parsing conf core-site.xmlcom.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <configuration>
at [row,col,system-id]: [26,0,"file:/C:/Hadoop/hadoop-3.1.0/etc/hadoop/core-site.xml"]

ERROR namenode.NameNode: Failed to start namenode.
java.lang.RuntimeException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <configuration>

I have checked the configuration file but did not find any syntax error in that.

I tried to run hdfs namenode -format and datanode -format; but it failed. Can someone help me with this error ?


问:
Successful deployment but no debugging when deploying files to Hololens via vs
I am working on Hololens2 using Unity. I use unity build and deploy the program to Hololens using Visual-Studio.

Initially it has been successful, but recently I have run into a problem. At the end of the deployment, the output of Visual-Studio lists my "build" as successful and my "deploy" as successful. But at the same time a pop-up appears telling me that

"Unable to start debugging, operation not supported. Unknown error: 0x80070057"

How can I solve this problem? I can't find any information on the web about this. Thanks in advance!