问:
Bower component are not created on mvn command
My bower_component are not created. I have one dev profile inside my pom.xml file and when I execute the command mvn clean install -P dev I get error  Warning: Unable to read "C:\test-widgets\xcomponent-widgets\target/bower_components/angular-animate/angular-animate.js" file (Error code: ENOENT). Use --force to continue.

My dev profile looks like this

```<code><profile>
      <id>dev</id>
      <properties>
        <grunt.build.file>gruntfile-dev.js</grunt.build.file>
        <bower.components.dir>webapp/bower_components</bower.components.dir>
      </properties>
      <build>
            <plugins>
                <!-- For development, launch the grunt serve after compile phase -->
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                   <version>${frontend-maven-plugin.version}</version>
                    <configuration>
                        <workingDirectory>${basedir}/target</workingDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>grunt-fix-ngdocs</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>grunt-build</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>grunt</goal>
                            </goals>
                            <configuration>
                                <arguments>build</arguments>
                            </configuration>
                        </execution>
                        <execution>
                            <id>grunt-dist</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>grunt-serve</id>
                            <phase>test</phase>
                            <goals>
                                <goal>grunt</goal>
                            </goals>
                            <configuration>
                                <arguments>serve</arguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                    <configuration>
                        <excludeDefaultDirectories>true</excludeDefaultDirectories>
                        <filesets>
                            <fileset>
                                <directory>${project.build.directory}</directory>
                                <excludes>
                                    <exclude>**/node/**</exclude>
                                    <exclude>**/node_modules/**</exclude>
                                </excludes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</code>```

and my grunt file dev.js looks like this

```'use strict';

// Grunt file for de only
// Removed tasks for dist
module.exports = function (grunt) {
    // Load grunt tasks automatically
    require('load-grunt-tasks')(grunt);
    require('time-grunt')(grunt);

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        // Project settings
        yeoman: {
            // configurable paths
            app: require('${project.build.directory}/bower.json').appPath || 'components',
            sources: '${basedir}/src/main/webapp/components',
            modules: '${basedir}/src/main/webapp/modules',
            sourcesSass: '${basedir}/src/main/webapp/components',
            testSources: '${basedir}/src/test',
            resourcesDocs: '${basedir}/src/main/resources/docs',
            base: '${basedir}',
            // Target folder where all generated files are placed
            target: '${project.build.directory}',
            // Distribution folder is defined on target\dist
            dist: '${project.build.directory}/dist',
            // Minimal distribution folder is defined on target\binDist
            binDist: '${project.build.directory}/binDist',
            // Distribution folder for vendor assets
            vendor: '${project.build.directory}/dist/vendor',
            // Documentation folder is defined on target\docs
            docs: '${project.build.directory}/docs',
            tmp: '${project.build.directory}/.tmp',
            bower: '${project.build.directory}/bower_components'
        },
        watch: {
            docJS: {
                files: ['<%= yeoman.sources %>/**/*.*'],
                tasks: ['jsdocs'],
                options: {
                    livereload: true,
                }
            },
            docSCSS: {
                files: ['<%= yeoman.sources %>/**/*.scss'],
                tasks: ['compass', 'jsdocs'],
                options: {
                    livereload: true,
                }
            }
        },
        // Empties folders to start fresh
        clean: {
            options: {
                force: true
            },
            // Clean target index html
            targetIndexHtml: {
                files: [
                    {
                        src: '<%= yeoman.target %>/index.html'
                    }
                ]
            },
            // Clean target template cache
            targetTemplateCache: {
                files: [
                    {
                        src: '<%= yeoman.target %>/<%= pkg.name %>-template-cache.js'
                    }
                ]
            },
            // Clean build folder .tmp
            targetTemp: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.target %>/.tmp'
                    }
                ]
            },
            // Clean build folder components
            targetComponents: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.target %>/components'
                    }
                ]
            },
            // Clean build folder css
            targetCSS: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.target %>/css'
                    }
                ]
            },
            // Clean distribution folder
            dist: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.dist %>'
                    }
                ]
            },
            // Clean minimal distribution folder
            binDist: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.binDist %>'
                    }
                ]
            },
            // Clean documentation folder
            docs: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.docs %>'
                    },
                    {
                        dot: true,
                        src: '<%= yeoman.tmp %>/doc'
                    }
                ]
            }
        },
        // Copies files to places other tasks can use
        copy: {
            // Copy sources javascript to build directory
            targetJS: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.sources %>',
                        dest: '<%= yeoman.target %>/components',
                        src: [
                            '**/*.js',
                            '*/*'
                        ]
                    }
                ]
            },
            // Copy index html page to build directory
            targetIndexHtml: {
                files: [
                    {
                        src: '${basedir}/src/main/webapp/index.html',
                        dest: '<%= yeoman.target %>/index.html'
                    }
                ]
            },
            docsFont: {
                files: [
                    {
                        expand: true,
                        cwd: '<%= yeoman.bower %>/font-awesome/fonts/',
                        dest: '<%= yeoman.docs %>/fonts/',
                        src: ['**/*.*']
                    },
                    {
                        expand: true,
                        cwd: '<%= yeoman.sources %>/vendor/black-tie/fonts/',
                        dest: '<%= yeoman.docs %>/fonts/',
                        src: ['**/*.*']
                    },
                    {
                        expand: true,
                        cwd: '<%= yeoman.bower %>/bootstrap/fonts/',
                        dest: '<%= yeoman.docs %>/fonts/',
                        src: ['**/*.*']
                    }

                ]
            },
            docsBootstrap: {
                files: [
                    {
                        expand: true,
                        cwd: 'bower_components/bootstrap/dist/css/',
                        dest: '<%= yeoman.docs %>/css/',
                        src: ['*.map']
                    }
                ]
            },
            docsResource: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.resourcesDocs %>',
                        dest: '<%= yeoman.docs %>/doc_resource/',
                        src: ['**/*.pdf', '**/*.json']
                    }
                ]
            },
            docsTimeline: {
                files: [
                    {
                        expand: true,
                        cwd: '<%= yeoman.sources %>/vendor/TimelineJS/build',
                        dest: '<%= yeoman.docs %>',
                        src: ['css/**/*.*']
                    }
                ]
            },
            docsPdf: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.target %>/xcomponent-customization/pdfViewer',
                        dest: '<%= yeoman.docs %>/pdfViewer/',
                        src: ['**']
                    }
                ]
            },
            ngDocsPatch: {
                // T2i fix for ng-docs issue that routing does not work in AngularjS 1.6
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.resourcesDocs %>',
                        dest: '${project.build.directory}/node_modules/grunt-ngdocs/src/templates/js',
                        src: ['docs.js']
                    }
                ]
            }
        },
        // Generate javascript template cache file
        ngtemplates: {
            options: {
                url: function (url) {
                    return url.split("/").pop();
                },
                htmlmin: {
                    collapseBooleanAttributes: true,
                    collapseWhitespace: true,
                    removeAttributeQuotes: true,
                    removeComments: true, // Only if you don't use comment directives!
                    removeEmptyAttributes: true,
                    removeRedundantAttributes: true,
                    removeScriptTypeAttributes: true,
                    removeStyleLinkTypeAttributes: true
                }
            },
            'xcomponent-widgets': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*-template.html', '**/*-tpl.html', '**/template/*.html', '**/templates/*.html'],
                dest: '<%= yeoman.target %>/<%= pkg.name %>-template-cache.js'
            },
            // module enhancement
            't2i-common': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/dialog-box.html', '**/t2i-spinner.html', '**/search-field.html', '**/version-display.html', '**/t2i-badge.html'],
                dest: '<%= yeoman.target %>/templates/t2i-common-template-cache.js'
            },
            'pdf-viewer': {
                cwd: '<%= yeoman.sources %>/pdf-viewer',
                src: ['**/*.html'],
                dest: '<%= yeoman.target %>/templates/pdf-viewer-template-cache.js'
            },
            'vertical-menu': {
                cwd: '<%= yeoman.sources %>/vertical-menu',
                src: ['**/*.html'],
                dest: '<%= yeoman.target %>/templates/vertical-menu-template-cache.js'
            },
            'object-display-list': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*object-display-list/*.html'],
                dest: '<%= yeoman.target %>/templates/object-display-list-template-cache.js'
            },
            'multiple-fields-group': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*multiple-fields-group/*.html'],
                dest: '<%= yeoman.target %>/templates/multiple-fields-group-template-cache.js'
            },
            'multiple-search-and-select': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*multiple-search-and-select/*.html'],
                dest: '<%= yeoman.target %>/templates/multiple-search-and-select-template-cache.js'
            },
            'lookup-text-field': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*lookup-text-field/*.html'],
                dest: '<%= yeoman.target %>/templates/lookup-text-field-template-cache.js'
            },
            'attach-document': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*attach-document/*.html'],
                dest: '<%= yeoman.target %>/templates/attach-document-template-cache.js'
            },
            'bread-crumb': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/bread-crumb/*.html'],
                dest: '<%= yeoman.target %>/templates/bread-crumb-template-cache.js'
            },
            'calendar-navigation': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/calendar-navigation/*.html'],
                dest: '<%= yeoman.target %>/templates/calendar-navigation-template-cache.js'
            },
            'date-histogram-filter': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/date-histogram-filter/*.html'],
                dest: '<%= yeoman.target %>/templates/date-histogram-filter-template-cache.js'
            },
            'date-histogram-select-box-filter': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/date-histogram-select-box-filter/*.html'],
                dest: '<%= yeoman.target %>/templates/date-histogram-select-box-filter-template-cache.js'
            },
            'object-display-paginated-tile': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/object-display-paginated-tile/*.html'],
                dest: '<%= yeoman.target %>/templates/object-display-paginated-tile-template-cache.js'
            },
            'event-category-display-list': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/event-category-display-list/**/*.html'],
                dest: '<%= yeoman.target %>/templates/event-category-display-list-template-cache.js'
            },
            'event-tile': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/event-tile/**/*.html'],
                dest: '<%= yeoman.target %>/templates/event-tile-template-cache.js'
            },
            'file-manager-tile': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/file-manager-tile/*.html'],
                dest: '<%= yeoman.target %>/templates/file-manager-tile-template-cache.js'
            },
            'filter-sidebar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/filter-sidebar/*.html'],
                dest: '<%= yeoman.target %>/templates/filter-sidebar-template-cache.js'
            },
            'flexicard-calendar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/flexicard-calendar/*.html'],
                dest: '<%= yeoman.target %>/templates/flexicard-calendar-template-cache.js'
            },
            'vertical-floating-toolbar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/vertical-floating-toolbar/*.html','**/floating-circle-button/*.html'],
                dest: '<%= yeoman.target %>/templates/vertical-floating-toolbar-template-cache.js'
            },
            'form-paging': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/form-paging/*.html'],
                dest: '<%= yeoman.target %>/templates/form-paging-template-cache.js'
            },

            'theme-dropdown-button': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/theme-dropdown-button/*.html'],
                dest: '<%= yeoman.target %>/templates/theme-dropdown-button-template-cache.js'
            },
            'toolbar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/toolbar/*.html'],
                dest: '<%= yeoman.target %>/templates/toolbar-template-cache.js'
            },
            'workflow-display': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/workflow-display/*.html'],
                dest: '<%= yeoman.target %>/templates/workflow-display-template-cache.js'
            },
            'year-navigator-with-legend': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/year-navigator-with-legend/*.html'],
                dest: '<%= yeoman.target %>/templates/year-navigator-with-legend-template-cache.js'
            },
            'variable-list-edit': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/variable-list-edit/*.html'],
                dest: '<%= yeoman.target %>/templates/variable-list-edit-template-cache.js'
            },
        },
        // Create javaScript docs
        ngdocs: {
            options: {
                dest: '<%= yeoman.docs %>',
                editExample: false,
                scripts: [
                    'https://code.jquery.com/jquery-1.11.2.min.js',
                    'https://code.jquery.com/jquery-migrate-1.2.1.min.js',
                    '<%= yeoman.target %>/.tmp/concat/vendor/<%= pkg.name %>-vendor.js',
                    '<%= yeoman.target %>/bower_components/angular-animate/angular-animate.js',
                    '<%= yeoman.target %>/bower_components/iscroll/build/iscroll-probe.js',
                    '<%= yeoman.target %>/bower_components/ng-file-upload/ng-file-upload.js',
                    '<%= yeoman.target %>/<%= pkg.name %>.js',
                    '<%= yeoman.sources %>/vendor/TimelineJS/build/js/storyjs-embed.js',
                    '<%= yeoman.resourcesDocs %>/documentation_override.js',
                    'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false'
                ],
                styles: [
                    '<%= yeoman.target %>/.tmp/concat/vendor/<%= pkg.name %>-vendor.css',
                    '<%= yeoman.target %>/<%= pkg.name %>.css',
                    '<%= yeoman.sources %>/vendor/TimelineJS/build/css/timeline.css',
                    '<%= yeoman.resourcesDocs %>/documentation_override.css'
                ],
                html5Mode: false,
                startPage: '/api',
                title: "xcomponent-widget-js",
                bestMatch: true
            },
            api: {
                src: ['<%= yeoman.sources %>/**/*.js', '<%= yeoman.resourcesDocs %>/api/*.ngdoc'],
                title: 'API Documentation'
            }
        },
        ngAnnotate: {
            dist: {
                files: [
                    {
                        expand: true,
                        src: [
                            '<%= yeoman.target %>/xcomponent-widgets-js-template-cache.js',
                            '<%= yeoman.target %>/components/**/*.js',
                            '<%= yeoman.target %>/scripts/**/*.js'
                        ]
                    }
                ]
            }
        },
        useminPrepare: {
            html: ['<%= yeoman.target %>/index.html'],
            options: {
                dest: '<%= yeoman.target %>',
                flow: {
                    html: {
                        steps: {
                            js: ['concat', 'uglifyjs'],
                            css: ['concat', 'cssmin'],
                            copy: ['concat']
                        },
                        post: {}
                    }
                }
            }
        },
        usemin: {
            html: ['<%= yeoman.target %>/{,*/}*.html'],
            css: ['<%= yeoman.target %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.target %>'],
                assetsDirs: [
                    '<%= yeoman.target %>',
                    '<%= yeoman.target %>/images',
                    '<%= yeoman.target %>/styles']
            }
        },
        // Compiles Sass to CSS and generates necessary files if requested
        compass: {
            dist: {
                options: {
                    sassDir: '<%= yeoman.sources %>/',
                    cssDir: '<%= yeoman.target %>/css',
                    relativeAssets: true,
                    assetCacheBuster: false,
                    generatedImagesDir: '<%= yeoman.target %>/images',
                    httpPath: ".",
                    httpImagesPath: '/images',
                    httpGeneratedImagesPath: '/images',
                    httpFontsPath: '/fonts',
                    raw: 'Sass::Script::Number.precision = 10\n'
                }
            }

        },
        // Minify css files
        cssmin: {
            // Concat and minify all css on the distribution folder
            dist: {
                files: {
                    '<%= yeoman.target %>/<%= pkg.name %>.min.css': [
                        '<%= yeoman.target %>/css/**/*.css'
                    ]
                }
            }
        },
        // Minify js files
        uglify: {
            options: {
                mangle: false
            },
            dist: {
                files: {
                    '<%= yeoman.target %>/<%= pkg.name %>.min.js': [
                        '<%= yeoman.target %>/<%= pkg.name %>.js'
                    ]
                }
            },
            distTemplate: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-template.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-template.js'
                    ]
                }
            },
            distCore: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-core.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-core.js'
                    ]
                }
            },
            distOrganigram: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-organigram.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-organigram.js'
                    ]
                }
            },
            distParameterValue: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-parameter-value.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-parameter-value.js'
                    ]
                }
            },
            distTimeline: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-timeline.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-timeline.js'
                    ]
                }
            },
            distFile: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-file.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-file.js'
                    ]
                }
            },
        },
        concat: {
            // Concat all sources
            jsTargetAll: {
                src: [
                    // begin t2i modules in xcomponent-widgets
                    '<%= yeoman.modules %>/*.js',
                    // end t2i modules in xcomponent-widgets
                    '<%= yeoman.sources %>/**/*.js',
                    '<%= yeoman.target %>/xcomponent-customization/angular-strap/angular-strap.js',
                    '<%= yeoman.target %>/xcomponent-customization/angular-strap/angular-strap.tpl.js',
                    '!<%= yeoman.sources %>/vendor/TimelineJS/build/js/storyjs-embed.js',
                    '<%= yeoman.target %>/<%= pkg.name %>-template-cache.js',
                    // begin t2i modules in xcomponent-widgets
                    '<%= yeoman.target %>/templates/*.js',
                    // end t2i modules in xcomponent-widgets
                ],
                dest: '<%= yeoman.target %>/<%= pkg.name %>.js'
            },
            jsTargetNoTemplateCache: {
                src: [
                    '<%= yeoman.sources %>/xcomponent-widgets.js',
                    '<%= yeoman.sources %>/**/*.js',
                    '!<%= yeoman.sources %>/xcomponent-widgets-tpl-cache.js'
                ],
                dest: '<%= yeoman.target %>/<%= pkg.name %>-without-template-cache.js'
            },
            // Concat all css
            cssDist: {
                src: ['<%= yeoman.target %>/css/**/*.css'],
                dest: '<%= yeoman.target %>/<%= pkg.name %>.css'
            }
        },
        connect: {
            doc: {
                options: {
                    port: 9010,
                    base: '<%= yeoman.docs %>',
                    open: "http://localhost:9010/#/api",
                    hostname: '0.0.0.0',
                    livereload: true
                }
            }
        }
    });

    grunt.registerTask('jsdocs', [
        "clean:docs",
        'newer:copy:targetIndexHtml',
        'newer:copy:targetJS',
        'ngtemplates', // Generate template cache
        'newer:compass', // Compile scss to css
        'useminPrepare', // Prepare usemin tasks for minification
        'concat', // Concat sources for distribution
        'ngAnnotate',
        'usemin',
        'copyDocs', // Copy resources for documentation,
        'ngdocs' // Build documentation
    ]);

    grunt.registerTask('copyDocs', [
        'copy:docsResource',
        'copy:docsTimeline',
        'copy:docsPdf',
        'copy:docsFont',
        'copy:docsBootstrap',
    ]);

    // 1. Run grunt build by frontend-maven-plugin
    grunt.registerTask('build', [
        'clean', // Clean folders
        'copy:targetIndexHtml',
        'copy:targetJS',
        'ngtemplates', // Generate template cache
        'compass', // Compile scss to css
        'useminPrepare', // Prepare usemin tasks for minification
        'concat', // Concat sources for distribution
        'ngAnnotate',
        'usemin'
    ]);

    // 2. Build pdf js (npm run build-pdf-js) in frontend-maven-plugin

    // 3. Run grunt dist by frontend-maven-plugin
    grunt.registerTask('serve', [
        'copyDocs', // Copy resources for documentation,
        'ngdocs', // Build documentation
        'connect:doc',
        'watch'
    ]);

    grunt.registerTask('dist', [
    ]);
};
```
<p>where is the mistake ? I can't find out why when i execute the command the bower_components folder with the dependencies is not created</p>
<p>I tried to change the <code> <bower.components.dir></code> from webapp/bower_components to bower_components to search
on the root but after that I get error</p>
``` Warning: Unable to create directory "C:\test-widgets\xcomponent-widgets\target\components\bread-crumb"
```

Body:
My bower_component are not created. I have one dev profile inside my pom.xml file and when I execute the command mvn clean install -P dev I get error  Warning: Unable to read "C:\test-widgets\xcomponent-widgets\target/bower_components/angular-animate/angular-animate.js" file (Error code: ENOENT). Use --force to continue.

My dev profile looks like this

<profile>
      <id>dev</id>
      <properties>
        <grunt.build.file>gruntfile-dev.js</grunt.build.file>
        <bower.components.dir>webapp/bower_components</bower.components.dir>
      </properties>
      <build>
            <plugins>

                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                   <version>${frontend-maven-plugin.version}</version>
                    <configuration>
                        <workingDirectory>${basedir}/target</workingDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>grunt-fix-ngdocs</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>grunt-build</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>grunt</goal>
                            </goals>
                            <configuration>
                                <arguments>build</arguments>
                            </configuration>
                        </execution>
                        <execution>
                            <id>grunt-dist</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>grunt-serve</id>
                            <phase>test</phase>
                            <goals>
                                <goal>grunt</goal>
                            </goals>
                            <configuration>
                                <arguments>serve</arguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                    <configuration>
                        <excludeDefaultDirectories>true</excludeDefaultDirectories>
                        <filesets>
                            <fileset>
                                <directory>${project.build.directory}</directory>
                                <excludes>
                                    <exclude>**/node/**</exclude>
                                    <exclude>**/node_modules/**</exclude>
                                </excludes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

and my grunt file dev.js looks like this

'use strict';

// Grunt file for de only
// Removed tasks for dist
module.exports = function (grunt) {
    // Load grunt tasks automatically
    require('load-grunt-tasks')(grunt);
    require('time-grunt')(grunt);

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        // Project settings
        yeoman: {
            // configurable paths
            app: require('${project.build.directory}/bower.json').appPath || 'components',
            sources: '${basedir}/src/main/webapp/components',
            modules: '${basedir}/src/main/webapp/modules',
            sourcesSass: '${basedir}/src/main/webapp/components',
            testSources: '${basedir}/src/test',
            resourcesDocs: '${basedir}/src/main/resources/docs',
            base: '${basedir}',
            // Target folder where all generated files are placed
            target: '${project.build.directory}',
            // Distribution folder is defined on target\dist
            dist: '${project.build.directory}/dist',
            // Minimal distribution folder is defined on target\binDist
            binDist: '${project.build.directory}/binDist',
            // Distribution folder for vendor assets
            vendor: '${project.build.directory}/dist/vendor',
            // Documentation folder is defined on target\docs
            docs: '${project.build.directory}/docs',
            tmp: '${project.build.directory}/.tmp',
            bower: '${project.build.directory}/bower_components'
        },
        watch: {
            docJS: {
                files: ['<%= yeoman.sources %>/**/*.*'],
                tasks: ['jsdocs'],
                options: {
                    livereload: true,
                }
            },
            docSCSS: {
                files: ['<%= yeoman.sources %>/**/*.scss'],
                tasks: ['compass', 'jsdocs'],
                options: {
                    livereload: true,
                }
            }
        },
        // Empties folders to start fresh
        clean: {
            options: {
                force: true
            },
            // Clean target index html
            targetIndexHtml: {
                files: [
                    {
                        src: '<%= yeoman.target %>/index.html'
                    }
                ]
            },
            // Clean target template cache
            targetTemplateCache: {
                files: [
                    {
                        src: '<%= yeoman.target %>/<%= pkg.name %>-template-cache.js'
                    }
                ]
            },
            // Clean build folder .tmp
            targetTemp: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.target %>/.tmp'
                    }
                ]
            },
            // Clean build folder components
            targetComponents: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.target %>/components'
                    }
                ]
            },
            // Clean build folder css
            targetCSS: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.target %>/css'
                    }
                ]
            },
            // Clean distribution folder
            dist: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.dist %>'
                    }
                ]
            },
            // Clean minimal distribution folder
            binDist: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.binDist %>'
                    }
                ]
            },
            // Clean documentation folder
            docs: {
                files: [
                    {
                        dot: true,
                        src: '<%= yeoman.docs %>'
                    },
                    {
                        dot: true,
                        src: '<%= yeoman.tmp %>/doc'
                    }
                ]
            }
        },
        // Copies files to places other tasks can use
        copy: {
            // Copy sources javascript to build directory
            targetJS: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.sources %>',
                        dest: '<%= yeoman.target %>/components',
                        src: [
                            '**/*.js',
                            '*/*'
                        ]
                    }
                ]
            },
            // Copy index html page to build directory
            targetIndexHtml: {
                files: [
                    {
                        src: '${basedir}/src/main/webapp/index.html',
                        dest: '<%= yeoman.target %>/index.html'
                    }
                ]
            },
            docsFont: {
                files: [
                    {
                        expand: true,
                        cwd: '<%= yeoman.bower %>/font-awesome/fonts/',
                        dest: '<%= yeoman.docs %>/fonts/',
                        src: ['**/*.*']
                    },
                    {
                        expand: true,
                        cwd: '<%= yeoman.sources %>/vendor/black-tie/fonts/',
                        dest: '<%= yeoman.docs %>/fonts/',
                        src: ['**/*.*']
                    },
                    {
                        expand: true,
                        cwd: '<%= yeoman.bower %>/bootstrap/fonts/',
                        dest: '<%= yeoman.docs %>/fonts/',
                        src: ['**/*.*']
                    }

                ]
            },
            docsBootstrap: {
                files: [
                    {
                        expand: true,
                        cwd: 'bower_components/bootstrap/dist/css/',
                        dest: '<%= yeoman.docs %>/css/',
                        src: ['*.map']
                    }
                ]
            },
            docsResource: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.resourcesDocs %>',
                        dest: '<%= yeoman.docs %>/doc_resource/',
                        src: ['**/*.pdf', '**/*.json']
                    }
                ]
            },
            docsTimeline: {
                files: [
                    {
                        expand: true,
                        cwd: '<%= yeoman.sources %>/vendor/TimelineJS/build',
                        dest: '<%= yeoman.docs %>',
                        src: ['css/**/*.*']
                    }
                ]
            },
            docsPdf: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.target %>/xcomponent-customization/pdfViewer',
                        dest: '<%= yeoman.docs %>/pdfViewer/',
                        src: ['**']
                    }
                ]
            },
            ngDocsPatch: {
                // T2i fix for ng-docs issue that routing does not work in AngularjS 1.6
                files: [
                    {
                        expand: true,
                        dot: true,
                        cwd: '<%= yeoman.resourcesDocs %>',
                        dest: '${project.build.directory}/node_modules/grunt-ngdocs/src/templates/js',
                        src: ['docs.js']
                    }
                ]
            }
        },
        // Generate javascript template cache file
        ngtemplates: {
            options: {
                url: function (url) {
                    return url.split("/").pop();
                },
                htmlmin: {
                    collapseBooleanAttributes: true,
                    collapseWhitespace: true,
                    removeAttributeQuotes: true,
                    removeComments: true, // Only if you don't use comment directives!
                    removeEmptyAttributes: true,
                    removeRedundantAttributes: true,
                    removeScriptTypeAttributes: true,
                    removeStyleLinkTypeAttributes: true
                }
            },
            'xcomponent-widgets': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*-template.html', '**/*-tpl.html', '**/template/*.html', '**/templates/*.html'],
                dest: '<%= yeoman.target %>/<%= pkg.name %>-template-cache.js'
            },
            // module enhancement
            't2i-common': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/dialog-box.html', '**/t2i-spinner.html', '**/search-field.html', '**/version-display.html', '**/t2i-badge.html'],
                dest: '<%= yeoman.target %>/templates/t2i-common-template-cache.js'
            },
            'pdf-viewer': {
                cwd: '<%= yeoman.sources %>/pdf-viewer',
                src: ['**/*.html'],
                dest: '<%= yeoman.target %>/templates/pdf-viewer-template-cache.js'
            },
            'vertical-menu': {
                cwd: '<%= yeoman.sources %>/vertical-menu',
                src: ['**/*.html'],
                dest: '<%= yeoman.target %>/templates/vertical-menu-template-cache.js'
            },
            'object-display-list': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*object-display-list/*.html'],
                dest: '<%= yeoman.target %>/templates/object-display-list-template-cache.js'
            },
            'multiple-fields-group': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*multiple-fields-group/*.html'],
                dest: '<%= yeoman.target %>/templates/multiple-fields-group-template-cache.js'
            },
            'multiple-search-and-select': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*multiple-search-and-select/*.html'],
                dest: '<%= yeoman.target %>/templates/multiple-search-and-select-template-cache.js'
            },
            'lookup-text-field': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*lookup-text-field/*.html'],
                dest: '<%= yeoman.target %>/templates/lookup-text-field-template-cache.js'
            },
            'attach-document': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/*attach-document/*.html'],
                dest: '<%= yeoman.target %>/templates/attach-document-template-cache.js'
            },
            'bread-crumb': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/bread-crumb/*.html'],
                dest: '<%= yeoman.target %>/templates/bread-crumb-template-cache.js'
            },
            'calendar-navigation': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/calendar-navigation/*.html'],
                dest: '<%= yeoman.target %>/templates/calendar-navigation-template-cache.js'
            },
            'date-histogram-filter': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/date-histogram-filter/*.html'],
                dest: '<%= yeoman.target %>/templates/date-histogram-filter-template-cache.js'
            },
            'date-histogram-select-box-filter': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/date-histogram-select-box-filter/*.html'],
                dest: '<%= yeoman.target %>/templates/date-histogram-select-box-filter-template-cache.js'
            },
            'object-display-paginated-tile': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/object-display-paginated-tile/*.html'],
                dest: '<%= yeoman.target %>/templates/object-display-paginated-tile-template-cache.js'
            },
            'event-category-display-list': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/event-category-display-list/**/*.html'],
                dest: '<%= yeoman.target %>/templates/event-category-display-list-template-cache.js'
            },
            'event-tile': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/event-tile/**/*.html'],
                dest: '<%= yeoman.target %>/templates/event-tile-template-cache.js'
            },
            'file-manager-tile': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/file-manager-tile/*.html'],
                dest: '<%= yeoman.target %>/templates/file-manager-tile-template-cache.js'
            },
            'filter-sidebar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/filter-sidebar/*.html'],
                dest: '<%= yeoman.target %>/templates/filter-sidebar-template-cache.js'
            },
            'flexicard-calendar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/flexicard-calendar/*.html'],
                dest: '<%= yeoman.target %>/templates/flexicard-calendar-template-cache.js'
            },
            'vertical-floating-toolbar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/vertical-floating-toolbar/*.html','**/floating-circle-button/*.html'],
                dest: '<%= yeoman.target %>/templates/vertical-floating-toolbar-template-cache.js'
            },
            'form-paging': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/form-paging/*.html'],
                dest: '<%= yeoman.target %>/templates/form-paging-template-cache.js'
            },

            'theme-dropdown-button': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/theme-dropdown-button/*.html'],
                dest: '<%= yeoman.target %>/templates/theme-dropdown-button-template-cache.js'
            },
            'toolbar': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/toolbar/*.html'],
                dest: '<%= yeoman.target %>/templates/toolbar-template-cache.js'
            },
            'workflow-display': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/workflow-display/*.html'],
                dest: '<%= yeoman.target %>/templates/workflow-display-template-cache.js'
            },
            'year-navigator-with-legend': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/year-navigator-with-legend/*.html'],
                dest: '<%= yeoman.target %>/templates/year-navigator-with-legend-template-cache.js'
            },
            'variable-list-edit': {
                cwd: '<%= yeoman.sources %>',
                src: ['**/variable-list-edit/*.html'],
                dest: '<%= yeoman.target %>/templates/variable-list-edit-template-cache.js'
            },
        },
        // Create javaScript docs
        ngdocs: {
            options: {
                dest: '<%= yeoman.docs %>',
                editExample: false,
                scripts: [
                    'https://code.jquery.com/jquery-1.11.2.min.js',
                    'https://code.jquery.com/jquery-migrate-1.2.1.min.js',
                    '<%= yeoman.target %>/.tmp/concat/vendor/<%= pkg.name %>-vendor.js',
                    '<%= yeoman.target %>/bower_components/angular-animate/angular-animate.js',
                    '<%= yeoman.target %>/bower_components/iscroll/build/iscroll-probe.js',
                    '<%= yeoman.target %>/bower_components/ng-file-upload/ng-file-upload.js',
                    '<%= yeoman.target %>/<%= pkg.name %>.js',
                    '<%= yeoman.sources %>/vendor/TimelineJS/build/js/storyjs-embed.js',
                    '<%= yeoman.resourcesDocs %>/documentation_override.js',
                    'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false'
                ],
                styles: [
                    '<%= yeoman.target %>/.tmp/concat/vendor/<%= pkg.name %>-vendor.css',
                    '<%= yeoman.target %>/<%= pkg.name %>.css',
                    '<%= yeoman.sources %>/vendor/TimelineJS/build/css/timeline.css',
                    '<%= yeoman.resourcesDocs %>/documentation_override.css'
                ],
                html5Mode: false,
                startPage: '/api',
                title: "xcomponent-widget-js",
                bestMatch: true
            },
            api: {
                src: ['<%= yeoman.sources %>/**/*.js', '<%= yeoman.resourcesDocs %>/api/*.ngdoc'],
                title: 'API Documentation'
            }
        },
        ngAnnotate: {
            dist: {
                files: [
                    {
                        expand: true,
                        src: [
                            '<%= yeoman.target %>/xcomponent-widgets-js-template-cache.js',
                            '<%= yeoman.target %>/components/**/*.js',
                            '<%= yeoman.target %>/scripts/**/*.js'
                        ]
                    }
                ]
            }
        },
        useminPrepare: {
            html: ['<%= yeoman.target %>/index.html'],
            options: {
                dest: '<%= yeoman.target %>',
                flow: {
                    html: {
                        steps: {
                            js: ['concat', 'uglifyjs'],
                            css: ['concat', 'cssmin'],
                            copy: ['concat']
                        },
                        post: {}
                    }
                }
            }
        },
        usemin: {
            html: ['<%= yeoman.target %>/{,*/}*.html'],
            css: ['<%= yeoman.target %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.target %>'],
                assetsDirs: [
                    '<%= yeoman.target %>',
                    '<%= yeoman.target %>/images',
                    '<%= yeoman.target %>/styles']
            }
        },
        // Compiles Sass to CSS and generates necessary files if requested
        compass: {
            dist: {
                options: {
                    sassDir: '<%= yeoman.sources %>/',
                    cssDir: '<%= yeoman.target %>/css',
                    relativeAssets: true,
                    assetCacheBuster: false,
                    generatedImagesDir: '<%= yeoman.target %>/images',
                    httpPath: ".",
                    httpImagesPath: '/images',
                    httpGeneratedImagesPath: '/images',
                    httpFontsPath: '/fonts',
                    raw: 'Sass::Script::Number.precision = 10\n'
                }
            }

        },
        // Minify css files
        cssmin: {
            // Concat and minify all css on the distribution folder
            dist: {
                files: {
                    '<%= yeoman.target %>/<%= pkg.name %>.min.css': [
                        '<%= yeoman.target %>/css/**/*.css'
                    ]
                }
            }
        },
        // Minify js files
        uglify: {
            options: {
                mangle: false
            },
            dist: {
                files: {
                    '<%= yeoman.target %>/<%= pkg.name %>.min.js': [
                        '<%= yeoman.target %>/<%= pkg.name %>.js'
                    ]
                }
            },
            distTemplate: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-template.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-template.js'
                    ]
                }
            },
            distCore: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-core.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-core.js'
                    ]
                }
            },
            distOrganigram: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-organigram.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-organigram.js'
                    ]
                }
            },
            distParameterValue: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-parameter-value.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-parameter-value.js'
                    ]
                }
            },
            distTimeline: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-timeline.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-timeline.js'
                    ]
                }
            },
            distFile: {
                files: {
                    '<%= yeoman.target %>/dist/scripts/<%= pkg.name %>-file.min.js': [
                        '<%= yeoman.target %>/.tmp/concat/scripts/<%= pkg.name %>-file.js'
                    ]
                }
            },
        },
        concat: {
            // Concat all sources
            jsTargetAll: {
                src: [
                    // begin t2i modules in xcomponent-widgets
                    '<%= yeoman.modules %>/*.js',
                    // end t2i modules in xcomponent-widgets
                    '<%= yeoman.sources %>/**/*.js',
                    '<%= yeoman.target %>/xcomponent-customization/angular-strap/angular-strap.js',
                    '<%= yeoman.target %>/xcomponent-customization/angular-strap/angular-strap.tpl.js',
                    '!<%= yeoman.sources %>/vendor/TimelineJS/build/js/storyjs-embed.js',
                    '<%= yeoman.target %>/<%= pkg.name %>-template-cache.js',
                    // begin t2i modules in xcomponent-widgets
                    '<%= yeoman.target %>/templates/*.js',
                    // end t2i modules in xcomponent-widgets
                ],
                dest: '<%= yeoman.target %>/<%= pkg.name %>.js'
            },
            jsTargetNoTemplateCache: {
                src: [
                    '<%= yeoman.sources %>/xcomponent-widgets.js',
                    '<%= yeoman.sources %>/**/*.js',
                    '!<%= yeoman.sources %>/xcomponent-widgets-tpl-cache.js'
                ],
                dest: '<%= yeoman.target %>/<%= pkg.name %>-without-template-cache.js'
            },
            // Concat all css
            cssDist: {
                src: ['<%= yeoman.target %>/css/**/*.css'],
                dest: '<%= yeoman.target %>/<%= pkg.name %>.css'
            }
        },
        connect: {
            doc: {
                options: {
                    port: 9010,
                    base: '<%= yeoman.docs %>',
                    open: "http://localhost:9010/#/api",
                    hostname: '0.0.0.0',
                    livereload: true
                }
            }
        }
    });

    grunt.registerTask('jsdocs', [
        "clean:docs",
        'newer:copy:targetIndexHtml',
        'newer:copy:targetJS',
        'ngtemplates', // Generate template cache
        'newer:compass', // Compile scss to css
        'useminPrepare', // Prepare usemin tasks for minification
        'concat', // Concat sources for distribution
        'ngAnnotate',
        'usemin',
        'copyDocs', // Copy resources for documentation,
        'ngdocs' // Build documentation
    ]);

    grunt.registerTask('copyDocs', [
        'copy:docsResource',
        'copy:docsTimeline',
        'copy:docsPdf',
        'copy:docsFont',
        'copy:docsBootstrap',
    ]);

    // 1. Run grunt build by frontend-maven-plugin
    grunt.registerTask('build', [
        'clean', // Clean folders
        'copy:targetIndexHtml',
        'copy:targetJS',
        'ngtemplates', // Generate template cache
        'compass', // Compile scss to css
        'useminPrepare', // Prepare usemin tasks for minification
        'concat', // Concat sources for distribution
        'ngAnnotate',
        'usemin'
    ]);

    // 2. Build pdf js (npm run build-pdf-js) in frontend-maven-plugin

    // 3. Run grunt dist by frontend-maven-plugin
    grunt.registerTask('serve', [
        'copyDocs', // Copy resources for documentation,
        'ngdocs', // Build documentation
        'connect:doc',
        'watch'
    ]);

    grunt.registerTask('dist', [
    ]);
};

where is the mistake ? I can't find out why when i execute the command the bower_components folder with the dependencies is not created

I tried to change the  <bower.components.dir> from webapp/bower_components to bower_components to search
on the root but after that I get error

 Warning: Unable to create directory "C:\test-widgets\xcomponent-widgets\target\components\bread-crumb"


来源: stackexchange

问:
Create individual p.value / test method detail footnotes for add_difference in gtsummary
I am trying to apply the separate_p_footnotes() function of the gtsummary package to the p.value's generated by the add_difference() function.

When doing so, I am getting an error, as the x$meta_data doesn't contain the column named stat_test_lbl

Example:

library(tidyverse)
library(gtsummary)

trial %>%
  select(trt, age, response) %>%
  tbl_summary(
    by = trt
  ) %>%
  add_difference() %>%
  separate_p_footnotes()
#> Error in separate_p_footnotes(.): The `x$meta_data` data frame must have a column called 'stat_test_lbl'.
```

Created on 2023-01-11 with reprex v2.0.2

The test method details are stored much deeper, so I can't seem to figure out how to modify the separate_p_value() function to retrieve the test methods details for each row/variable.

Is there a way to retrieve similar separated p.value / test method information for add_difference()?

ContentLicense: CC BY-SA 4.0

Body:
I am trying to apply the separate_p_footnotes() function of the gtsummary package to the p.value's generated by the add_difference() function.

When doing so, I am getting an error, as the x$meta_data doesn't contain the column named stat_test_lbl

Example:

library(tidyverse)
library(gtsummary)

trial %>%
  select(trt, age, response) %>%
  tbl_summary(
    by = trt
  ) %>%
  add_difference() %>%
  separate_p_footnotes()
#> Error in separate_p_footnotes(.): The `x$meta_data` data frame must have a column called 'stat_test_lbl'.

Created on 2023-01-11 with reprex v2.0.2

The test method details are stored much deeper, so I can't seem to figure out how to modify the separate_p_value() function to retrieve the test methods details for each row/variable.

Is there a way to retrieve similar separated p.value / test method information for add_difference()?


问:
Terminate camunda sub-process in two ways (conditional)
I have a camunda sub process which can terminate normally (approved) or not (refused). A user task determines if the approval task is approved or refused. I tried to use a signal to leave the sub process in case the user task is refused but this triggers ALL active processes. If I have two active tasks waiting at the approval task, ALL are cancelled, which I don't want.

So I tried to use an Error end event to handle the refused gateway with a boundary event but I think there is a problem with camunda itself ? I get a NullPointerException on the subprocess as soon as I use Error event event instead of the signal :

```<code>public FlowElement getBpmnModelElementInstance() {
BpmnModelInstance bpmnModelInstance = getBpmnModelInstance();
if (bpmnModelInstance != null) {
  ModelElementInstance modelElementInstance = null;
  if (ExecutionListener.EVENTNAME_TAKE.equals(eventName)) {
    modelElementInstance = bpmnModelInstance.getModelElementById(transition.getId());
  } else {
    modelElementInstance = bpmnModelInstance.getModelElementById(activityId); <== activityId here is wrongly "subProcess#multiInstanceBody" instead of "subProcess" so it returns null
  }
...
</code>```

So is there something I missed ? Should I not use Error end event but something other instead ? What solution do I have to exit my subprocess in case of refusal which is another exit of the subprocess than the approval one.

Body:
I have a camunda sub process which can terminate normally (approved) or not (refused). A user task determines if the approval task is approved or refused. I tried to use a signal to leave the sub process in case the user task is refused but this triggers ALL active processes. If I have two active tasks waiting at the approval task, ALL are cancelled, which I don't want.

So I tried to use an Error end event to handle the refused gateway with a boundary event but I think there is a problem with camunda itself ? I get a NullPointerException on the subprocess as soon as I use Error event event instead of the signal :

public FlowElement getBpmnModelElementInstance() {
BpmnModelInstance bpmnModelInstance = getBpmnModelInstance();
if (bpmnModelInstance != null) {
  ModelElementInstance modelElementInstance = null;
  if (ExecutionListener.EVENTNAME_TAKE.equals(eventName)) {
    modelElementInstance = bpmnModelInstance.getModelElementById(transition.getId());
  } else {
    modelElementInstance = bpmnModelInstance.getModelElementById(activityId); <== activityId here is wrongly "subProcess#multiInstanceBody" instead of "subProcess" so it returns null
  }
...

So is there something I missed ? Should I not use Error end event but something other instead ? What solution do I have to exit my subprocess in case of refusal which is another exit of the subprocess than the approval one.


问:
GDBus: how to be notified when the top-level ObjectManager object appears on the bus?
In GDBus it's possible to watch for a particular name to appear on the bus with g_bus_watch_name_on_connection(). It's also possible to be notified about new interfaces/objects added on objects implementing the org.freedesktop.DBus.ObjectManager interface. I cannot however find a way to be notified about the appearance of the top-level ObjectManager on the bus. In other words:

We have a name org.foobar which exports an ObjectManager at /org/foobar which manages /org/foobar/abc and /org/foobar/xyz.

I can get notified about the name acquisition of org.foobar and about the addition of /org/foobar/abc and /org/foobar/xyz. However some time passes between when the org.foobar name is taken and then the /org/foobar object appears. How do I programmatically and correctly wait for it in GLib?


问:
how to take latest backupid to JSON for restore data to an instance in a different project GCP
I am working on restore the latest backup restore data to an instance into a different project GCP in Windows power shell.

Using below queries using power shell getting backup id's list

```<code>$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
    -Method GET `
    -Headers $headers `
    -Uri "https://sqladmin.googleapis.com/v1/projects/source-project/instances/source-instance/backupRuns" | Select-Object -Expand Content
</code>```

Restore using below command

```<code>$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
    -Method POST `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://sqladmin.googleapis.com/v1/projects/target-project/instances/target-instance/restoreBackup" | Select-Object -Expand Content
</code>```

In the request.json file updating latest backupid to restore latest backup up.
How to take latest backup id from the list automatically using power shell

Please help any one.

Body:
I am working on restore the latest backup restore data to an instance into a different project GCP in Windows power shell.

Using below queries using power shell getting backup id's list

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
    -Method GET `
    -Headers $headers `
    -Uri "https://sqladmin.googleapis.com/v1/projects/source-project/instances/source-instance/backupRuns" | Select-Object -Expand Content

Restore using below command

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
    -Method POST `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://sqladmin.googleapis.com/v1/projects/target-project/instances/target-instance/restoreBackup" | Select-Object -Expand Content

In the request.json file updating latest backupid to restore latest backup up.
How to take latest backup id from the list automatically using power shell

Please help any one.


问:
How to use git rebase --onto to solve the issue "there is nothing to compare" in github
I created a repository instead of cloning it locally, and then I directly push a folder of files to this repository, and finally the issue occurred. The github shows there is nothing to compare, main and master are entirely different commit histories. so the pushed files and folders are now in the master branch. I don't know how to change to make what I pushed merged into the main branch.

I read through several answers in stack overflow, one answer clearly explained what happened, and suggested using git rebase --onto. But I don't know what further steps. I also checked git documents to see how to use this command, but unfortunately I am still confused about this command. I tried to input git rebase --onto master next main, the terminal showed invalid upstream 'next'.

Other methods including forced push. But some users suggested not doing so. I wonder if anyone has tried git rebase to solve this problem? Could you explain how to use git rebase --onto or git cherry-pick to solve my issue?


问:
Vue JS - selected Dropdown value of an input in a create/edit dialog doesn´t appear
I have a Form in a Dialog with a dropdown list to select an element. When I select the element, the element doesn´t appear on the input field but when I submit the value is there.

I don´t know why but I have the same problem with Calendar Input

I just check the documentation, try different things but it doesn´t work

Dialog

```<code>    <Dialog
      v-model:visible="displayNewDelivery"
      :style="{ width: '30vw' }"
      :modal="true"
      class="p-fluid"
      :value="delivery"
      header="Add New Delivery">

      <div class = "card p-fluid">
        <div class="field">
          <strong><label for="ddate">Delivery Date</label></strong>
          <Calendar inputId="basic" v-model="date" autocomplete="off" />

        </div>

        <div class="field">
          <strong><label for="dw">Delivery Weight</label></strong>
            <InputNumber id="dw" v-model.trim="delivery.DeliveryWeight" required="true" autofocus  />
        </div>

        <div class="field">
          <strong><label for="lon">Final Storage</label></strong>
          <Dropdown
                id="dfinal"
                v-model="delivery.FinalStorage"
                :options="storages"
                option-label="designation"
                option-value="id"
                placeholder="Select a Storage"/>
        </div>

        <div class="field">
          <strong><label for="ttl">Time To Load</label></strong>
            <InputNumber id="ttl" v-model.trim="delivery.TimeToLoad" required="true" autofocus  />
        </div>

        <div class="field">
          <strong><label for="str">Time To Unload</label></strong>
            <InputNumber id="str" v-model.trim="delivery.TimeToUnload" required="true" autofocus  />
        </div>
      </div>
      <template #footer>
      <Button
        label="Save"
        @click="addDelivery"
        icon="pi pi-check"
        class="p-button-outlined"
      />
    </template>
    </Dialog>
</code>```

storages

```<code>  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "designation": "string",
    "location": {
      "id": {
        "value": "string"
      },
      "latitude": "string",
      "longitude": "string",
      "altitude": "string",
      "address": {
        "id": {
          "value": "string"
        },
        "street": "string",
        "door": "string",
        "floor": "string",
        "postalCode": "string",
        "city": {
          "id": {
            "value": "string"
          },
          "number": 0,
          "name": "string"
        }
      }
    },
    "chargingSystems": [
      {
        "id": {
          "value": "string"
        },
        "chargingTime": "string"
      }
    ],
    "active": true
  }
]

delivery.FinalStorage: string
</code>```

Body:
I have a Form in a Dialog with a dropdown list to select an element. When I select the element, the element doesn´t appear on the input field but when I submit the value is there.

I don´t know why but I have the same problem with Calendar Input

I just check the documentation, try different things but it doesn´t work

Dialog

    <Dialog
      v-model:visible="displayNewDelivery"
      :style="{ width: '30vw' }"
      :modal="true"
      class="p-fluid"
      :value="delivery"
      header="Add New Delivery">

          Delivery Date
          <Calendar inputId="basic" v-model="date" autocomplete="off" />

          Delivery Weight
            <InputNumber id="dw" v-model.trim="delivery.DeliveryWeight" required="true" autofocus  />

          Final Storage
          <Dropdown
                id="dfinal"
                v-model="delivery.FinalStorage"
                :options="storages"
                option-label="designation"
                option-value="id"
                placeholder="Select a Storage"/>

          Time To Load
            <InputNumber id="ttl" v-model.trim="delivery.TimeToLoad" required="true" autofocus  />

          Time To Unload
            <InputNumber id="str" v-model.trim="delivery.TimeToUnload" required="true" autofocus  />

      <template #footer>
      <Button
        label="Save"
        @click="addDelivery"
        icon="pi pi-check"
        class="p-button-outlined"
      />
    </template>
    </Dialog>

storages

  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "designation": "string",
    "location": {
      "id": {
        "value": "string"
      },
      "latitude": "string",
      "longitude": "string",
      "altitude": "string",
      "address": {
        "id": {
          "value": "string"
        },
        "street": "string",
        "door": "string",
        "floor": "string",
        "postalCode": "string",
        "city": {
          "id": {
            "value": "string"
          },
          "number": 0,
          "name": "string"
        }
      }
    },
    "chargingSystems": [
      {
        "id": {
          "value": "string"
        },
        "chargingTime": "string"
      }
    ],
    "active": true
  }
]

delivery.FinalStorage: string


问:
Finding a subset whose sum is zero
I have an Excel file containing two rows, one containing numbers, another having ID, serial number basically.
Now, these numbers are both positive and negative. I have to find if there exists a subset whose sum is zero. If yes, then the IDs of the element of the subsets whose sum is zero. It would be awesome if I could also find all subsets smaller than a number, say 3 or 4.
The most important part is that I want the IDs of the numbers.

```<code>def subset_sum_exists(numbers, target):
    n = len(numbers)
    # Initialize a 2D array with size (n+1) * (target+1)
    dp = [[False for _ in range(target + 1)] for _ in range(n + 1)]
    # Initialize the first column with true
    for i in range(n + 1):
        dp[i][0] = True
    for i in range(1, n + 1):
        for j in range(1, target + 1):
            # if j is less than current number
            if j < numbers[i - 1]:
                dp[i][j] = dp[i - 1][j]
            # if j is greater or equal than current number
            if j >= numbers[i - 1]:
                dp[i][j] = dp[i - 1][j] or dp[i - 1][j - numbers[i - 1]]
    # return the last element
    return dp[n][target]
</code>```

This code should at least tell me if such a subset exists or not, but seems like there is some error in this. For target = 0, it always says true. For others, it gives an error.

numbers = [6, 20, 54, 93, -54, -26]

Title: Finding a subset whose sum is zero

Body:
I have an Excel file containing two rows, one containing numbers, another having ID, serial number basically.
Now, these numbers are both positive and negative. I have to find if there exists a subset whose sum is zero. If yes, then the IDs of the element of the subsets whose sum is zero. It would be awesome if I could also find all subsets smaller than a number, say 3 or 4.
The most important part is that I want the IDs of the numbers.

def subset_sum_exists(numbers, target):
    n = len(numbers)
    # Initialize a 2D array with size (n+1) * (target+1)
    dp = [[False for _ in range(target + 1)] for _ in range(n + 1)]
    # Initialize the first column with true
    for i in range(n + 1):
        dp[i][0] = True
    for i in range(1, n + 1):
        for j in range(1, target + 1):
            # if j is less than current number
            if j < numbers[i - 1]:
                dp[i][j] = dp[i - 1][j]
            # if j is greater or equal than current number
            if j >= numbers[i - 1]:
                dp[i][j] = dp[i - 1][j] or dp[i - 1][j - numbers[i - 1]]
    # return the last element
    return dp[n][target]

This code should at least tell me if such a subset exists or not, but seems like there is some error in this. For target = 0, it always says true. For others, it gives an error.

numbers = [6, 20, 54, 93, -54, -26]


问:
Errors when using storybook with React and Chakra UI
I'm using React (17.0.2), Chakra UI and Storybook (6.5.15) to create a component library. I don't use create-react-app because I don't really need to run it as an app. However, I can't get around the errors related to the core node modules that I receive like can't resolve module 'fs'. I have tried to add custom configuration to main.js for Storybook's webpack v5 so that it will ignore the node core modules like this:

```<code>webpackFinal: (config) => {
   config.resolve.fallback.fs = false;
   config.resolve.fallback.module = false;
   config.resolve.fallback.os = false;

    return config;
  },
</code>```

When I try to show the story for the component I receive the following error:

```<code>TypeError: fs[fsStatType] is not a function
    at isTypeSync (http://localhost:6006/vendors-node_modules_chakra-ui_layout_dist_chakra-ui-layout_esm_js-node_modules_chakra-ui_spi-d8af64.iframe.bundle.js:116363:24)
    at getDirectorySync (http://localhost:6006/vendors-node_modules_chakra-ui_layout_dist_chakra-ui-layout_esm_js-node_modules_chakra-ui_spi-d8af64.iframe.bundle.js:82082:61)
    at ExplorerSync.searchSync (http://localhost:6006/vendors-node_modules_chakra-ui_layout_dist_chakra-ui-layout_esm_js-node_modules_chakra-ui_spi-d8af64.iframe.bundle.js:81910:63)
</code>```

Below you'll find a list of the dev dependencies from my package.json.

```<code>"devDependencies": {
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@chakra-ui/react": "^1.7.1",
"@chakra-ui/storybook-addon": "^4.0.16",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.1.5",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^10.0.1",
"@storybook/addon-actions": "^6.5.15",
"@storybook/addon-essentials": "^6.5.15",
"@storybook/addon-interactions": "^6.5.15",
"@storybook/addon-links": "^6.5.15",
"@storybook/builder-webpack5": "^6.5.15",
"@storybook/manager-webpack5": "^6.5.15",
"@storybook/react": "^6.5.15",
"@storybook/testing-library": "0.0.13",
"@types/react": "^18.0.26",
"babel-loader": "^8.3.0",
"base64-arraybuffer": "^1.0.2",
"cross-fetch": "^3.1.5",
"crypto": "^1.0.1",
"framer-motion": "^6.5.0",
"jest-fetch-mock": "^3.0.3",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2",
"nanoid": "^4.0.0",
"njwt": "^1.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npm-run-all": "^4.1.5",
"randomstring": "^1.2.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^3.9.1",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-dts": "^5.1.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"webpack": "^5.75.0"},
</code>```

Does anyone have an idea on how to solve this issue?

I have tried to add the NodePolyfillPlugin plugin to webpack but I was still receiving errors related to fs, likely because it doesn't have a fallback for it and adding aliases with the modules to resolve it to node modules but I wasn't able to find an npm package for 'fs'. It seems deprecated?

Body:
I'm using React (17.0.2), Chakra UI and Storybook (6.5.15) to create a component library. I don't use create-react-app because I don't really need to run it as an app. However, I can't get around the errors related to the core node modules that I receive like can't resolve module 'fs'. I have tried to add custom configuration to main.js for Storybook's webpack v5 so that it will ignore the node core modules like this:

webpackFinal: (config) => {
   config.resolve.fallback.fs = false;
   config.resolve.fallback.module = false;
   config.resolve.fallback.os = false;

    return config;
  },

When I try to show the story for the component I receive the following error:

TypeError: fs[fsStatType] is not a function
    at isTypeSync (http://localhost:6006/vendors-node_modules_chakra-ui_layout_dist_chakra-ui-layout_esm_js-node_modules_chakra-ui_spi-d8af64.iframe.bundle.js:116363:24)
    at getDirectorySync (http://localhost:6006/vendors-node_modules_chakra-ui_layout_dist_chakra-ui-layout_esm_js-node_modules_chakra-ui_spi-d8af64.iframe.bundle.js:82082:61)
    at ExplorerSync.searchSync (http://localhost:6006/vendors-node_modules_chakra-ui_layout_dist_chakra-ui-layout_esm_js-node_modules_chakra-ui_spi-d8af64.iframe.bundle.js:81910:63)

Below you'll find a list of the dev dependencies from my package.json.

"devDependencies": {
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@chakra-ui/react": "^1.7.1",
"@chakra-ui/storybook-addon": "^4.0.16",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.1.5",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^10.0.1",
"@storybook/addon-actions": "^6.5.15",
"@storybook/addon-essentials": "^6.5.15",
"@storybook/addon-interactions": "^6.5.15",
"@storybook/addon-links": "^6.5.15",
"@storybook/builder-webpack5": "^6.5.15",
"@storybook/manager-webpack5": "^6.5.15",
"@storybook/react": "^6.5.15",
"@storybook/testing-library": "0.0.13",
"@types/react": "^18.0.26",
"babel-loader": "^8.3.0",
"base64-arraybuffer": "^1.0.2",
"cross-fetch": "^3.1.5",
"crypto": "^1.0.1",
"framer-motion": "^6.5.0",
"jest-fetch-mock": "^3.0.3",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2",
"nanoid": "^4.0.0",
"njwt": "^1.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npm-run-all": "^4.1.5",
"randomstring": "^1.2.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^3.9.1",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-dts": "^5.1.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"webpack": "^5.75.0"},

Does anyone have an idea on how to solve this issue?

I have tried to add the NodePolyfillPlugin plugin to webpack but I was still receiving errors related to fs, likely because it doesn't have a fallback for it and adding aliases with the modules to resolve it to node modules but I wasn't able to find an npm package for 'fs'. It seems deprecated?


问:
image over flow not fixed in croper js
i used Upload cropped image to server and Minimum and maximum cropped dimensions for my upload cropper image.but i have a problem that when image load in modal, my image over flow.for example when i load this image

show in modal as this:

this is my code:

```<code>let pathfile=''
addEventListener('DOMContentLoaded', function () {

      var avatar = document.getElementById('avatar');
      var image = document.getElementById('image');
      var input = document.getElementById('input');
      var $progress = $('.progress');
      var $progressBar = $('.progress-bar');
      var $alert = $('.alert');
      var $modal = $('#modal');
      var cropper;

      $('[data-toggle="tooltip"]').tooltip();

      input.addEventListener('change', function (e) {

        var files = e.target.files;
        var done = function (url) {
          input.value = '';
          image.src = url;
          $alert.hide();
          $modal.modal('show');
        };
        var reader;
        var file;
        var url;

        if (files && files.length > 0) {
          file = files[0];
          pathfile=file
          if (URL) {
            done(URL.createObjectURL(file));
          } else if (FileReader) {
            reader = new FileReader();
            reader.onload = function (e) {
              done(reader.result);
            };
            reader.readAsDataURL(file);
          }
        }
      });
      let minAspectRatio = 0.5;
      let maxAspectRatio = 1.5;
              let minCroppedWidth = 320;
        let minCroppedHeight = 160;
        let maxCroppedWidth = 640;
        let maxCroppedHeight = 320;
      $modal.on('shown.bs.modal', function () {

        cropper = new Cropper(image, {
          /*aspectRatio: 1,*/
          viewMode: 3,

        zoomable: false,
         data: {
          width: (minCroppedWidth + maxCroppedWidth) / 2,
          height: (minCroppedHeight + maxCroppedHeight) / 2,
        },

        crop: function (event) {
          var width = Math.round(event.detail.width);
          var height = Math.round(event.detail.height);

          if (
            width < minCroppedWidth
            || height < minCroppedHeight
            || width > maxCroppedWidth
            || height > maxCroppedHeight
          ) {
            cropper.setData({
              width: Math.max(minCroppedWidth, Math.min(maxCroppedWidth, width)),
              height: Math.max(minCroppedHeight, Math.min(maxCroppedHeight, height)),
            });
          }
        },
        });

      }).on('hidden.bs.modal', function () {
        cropper.destroy();
        cropper = null;
      });

      document.getElementById('crop').addEventListener('click', function () {
        var initialAvatarURL;
        var canvas;

        $modal.modal('hide');

        if (cropper) {
          canvas = cropper.getCroppedCanvas({
            width: 160,
            height: 160,
          });
          debugger;
          initialAvatarURL = avatar.src;
          avatar.src = canvas.toDataURL();
          $progress.show();
          $alert.removeClass('alert-success alert-warning');
          let AllowedExtention ='jpg,png,gif,jpeg';
          canvas.toBlob(function (blob) {
            var formData = new FormData();
            let url = '********'

            formData.append('avatar', blob, 'avatar.jpg');
            $.ajax(url, {
              method: 'POST',
              data: formData,
              processData: false,
              contentType: false,

              xhr: function () {
                var xhr = new XMLHttpRequest();

                xhr.upload.onprogress = function (e) {
                  var percent = '0';
                  var percentage = '0%';

                  if (e.lengthComputable) {
                    percent = Math.round((e.loaded / e.total) * 100);
                    percentage = percent + '%';
                    $progressBar.width(percentage).attr('aria-valuenow', percent).text(percentage);
                  }
                };

                return xhr;
              },

              success: function (data) {
        let postData = "xxxxxxxxxxxxxx"
        $.ajax({
            url: '/Page/PageAction.aspx',
            type: 'POST',
            data: postData,
            success: function (response) {
            ,
            error: function (data) {

            }
        })
              },

              error: function () {
                avatar.src = initialAvatarURL;
                $alert.show().addClass('alert-warning').text('Upload error');
              },

              complete: function () {
                $progress.hide();
              },
            });
          });
        }
      });
    });
</code>```

Title: image over flow not fixed in croper js

Body:
i used Upload cropped image to server and Minimum and maximum cropped dimensions for my upload cropper image.but i have a problem that when image load in modal, my image over flow.for example when i load this image

show in modal as this:

this is my code:

let pathfile=''
addEventListener('DOMContentLoaded', function () {

      var avatar = document.getElementById('avatar');
      var image = document.getElementById('image');
      var input = document.getElementById('input');
      var $progress = $('.progress');
      var $progressBar = $('.progress-bar');
      var $alert = $('.alert');
      var $modal = $('#modal');
      var cropper;

      $('[data-toggle="tooltip"]').tooltip();

      input.addEventListener('change', function (e) {

        var files = e.target.files;
        var done = function (url) {
          input.value = '';
          image.src = url;
          $alert.hide();
          $modal.modal('show');
        };
        var reader;
        var file;
        var url;

        if (files && files.length > 0) {
          file = files[0];
          pathfile=file
          if (URL) {
            done(URL.createObjectURL(file));
          } else if (FileReader) {
            reader = new FileReader();
            reader.onload = function (e) {
              done(reader.result);
            };
            reader.readAsDataURL(file);
          }
        }
      });
      let minAspectRatio = 0.5;
      let maxAspectRatio = 1.5;
              let minCroppedWidth = 320;
        let minCroppedHeight = 160;
        let maxCroppedWidth = 640;
        let maxCroppedHeight = 320;
      $modal.on('shown.bs.modal', function () {

        cropper = new Cropper(image, {
          /*aspectRatio: 1,*/
          viewMode: 3,

        zoomable: false,
         data: {
          width: (minCroppedWidth + maxCroppedWidth) / 2,
          height: (minCroppedHeight + maxCroppedHeight) / 2,
        },

        crop: function (event) {
          var width = Math.round(event.detail.width);
          var height = Math.round(event.detail.height);

          if (
            width < minCroppedWidth
            || height < minCroppedHeight
            || width > maxCroppedWidth
            || height > maxCroppedHeight
          ) {
            cropper.setData({
              width: Math.max(minCroppedWidth, Math.min(maxCroppedWidth, width)),
              height: Math.max(minCroppedHeight, Math.min(maxCroppedHeight, height)),
            });
          }
        },
        });

      }).on('hidden.bs.modal', function () {
        cropper.destroy();
        cropper = null;
      });

      document.getElementById('crop').addEventListener('click', function () {
        var initialAvatarURL;
        var canvas;

        $modal.modal('hide');

        if (cropper) {
          canvas = cropper.getCroppedCanvas({
            width: 160,
            height: 160,
          });
          debugger;
          initialAvatarURL = avatar.src;
          avatar.src = canvas.toDataURL();
          $progress.show();
          $alert.removeClass('alert-success alert-warning');
          let AllowedExtention ='jpg,png,gif,jpeg';
          canvas.toBlob(function (blob) {
            var formData = new FormData();
            let url = '********'

            formData.append('avatar', blob, 'avatar.jpg');
            $.ajax(url, {
              method: 'POST',
              data: formData,
              processData: false,
              contentType: false,

              xhr: function () {
                var xhr = new XMLHttpRequest();

                xhr.upload.onprogress = function (e) {
                  var percent = '0';
                  var percentage = '0%';

                  if (e.lengthComputable) {
                    percent = Math.round((e.loaded / e.total) * 100);
                    percentage = percent + '%';
                    $progressBar.width(percentage).attr('aria-valuenow', percent).text(percentage);
                  }
                };

                return xhr;
              },

              success: function (data) {
        let postData = "xxxxxxxxxxxxxx"
        $.ajax({
            url: '/Page/PageAction.aspx',
            type: 'POST',
            data: postData,
            success: function (response) {
            ,
            error: function (data) {

            }
        })
              },

              error: function () {
                avatar.src = initialAvatarURL;
                $alert.show().addClass('alert-warning').text('Upload error');
              },

              complete: function () {
                $progress.hide();
              },
            });
          });
        }
      });
    });


问:
Why does TypeScript not recognize an error thrown in a nested method?
I have this TypeScript playground demonstrating how TypeScript doesn't seem to see that there is an error being thrown, and so it should assume the return type of the function is always a string otherwise. See the two cases for comparison:

```<code>function throwError(message: string) {
  throw new Error(message)
}

function generateErrorMessage() {
  return 'error!'
}

function somethingWithReturn(): string {
  if (Math.random() > 0.5) {
    return 'hello world'
  } else {
    throwError(generateErrorMessage())
  }
}

function somethingWithReturnAndExplicitError(): string {
  if (Math.random() > 0.5) {
    return 'hello world'
  } else {
    throwError(generateErrorMessage())
    throw new Error('hmm?')
  }
}
</code>```

In my project I have a throwError function which does a bunch of custom error stuff and then throws an error. However, TypeScript doesn't pick it up. Instead, it only seems to recognize a literal throw new X within the direct body of the function. Any ideas if this is a bug or a feature, or how to get it to recognize my error throwing function?

Instead, it says:

Function lacks ending return statement and return type does not include 'undefined'.(2366)

Body:
I have this TypeScript playground demonstrating how TypeScript doesn't seem to see that there is an error being thrown, and so it should assume the return type of the function is always a string otherwise. See the two cases for comparison:

function throwError(message: string) {
  throw new Error(message)
}

function generateErrorMessage() {
  return 'error!'
}

function somethingWithReturn(): string {
  if (Math.random() > 0.5) {
    return 'hello world'
  } else {
    throwError(generateErrorMessage())
  }
}

function somethingWithReturnAndExplicitError(): string {
  if (Math.random() > 0.5) {
    return 'hello world'
  } else {
    throwError(generateErrorMessage())
    throw new Error('hmm?')
  }
}

In my project I have a throwError function which does a bunch of custom error stuff and then throws an error. However, TypeScript doesn't pick it up. Instead, it only seems to recognize a literal throw new X within the direct body of the function. Any ideas if this is a bug or a feature, or how to get it to recognize my error throwing function?

Instead, it says:

Function lacks ending return statement and return type does not include 'undefined'.(2366)


问:
wxWidgets wx/version.h file not found
I am using VS Code and I want to compile C++ code that use wxWidgets3.2 via cmake.

I installed:

mingw-w64-x86_64-gcc

mingw-w64-x86_64-cmake

mingw-w64-x86_64-wxwidgets3.2-msw

During cmake configure i got this following error:

[variant] Loaded new set of variants
[kit] Successfully loaded 2 kits from C:\Users\walkiewi\AppData\Local\CMakeTools\cmake-tools-kits.json
[proc] Executing command: C:\msys64\mingw64\bin\gcc.exe -v
[main] Configuring folder: jcp
[proc] Executing command: C:\msys64\mingw64\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -Sc:/Users/walkiewi/Documents/projects/jcp -Bc:/Users/walkiewi/Documents/projects/jcp/build -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error at C:/msys64/mingw64/share/cmake/Modules/FindwxWidgets.cmake:225 (message):
[cmake]   wxWidgets wx/version.h file not found in C:/Program;C:/Program.
[cmake] Call Stack (most recent call first):
[cmake]   C:/msys64/mingw64/share/cmake/Modules/FindwxWidgets.cmake:955 (wx_extract_version)
[cmake]   CMakeLists.txt:12 (find_package)
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/walkiewi/Documents/projects/jcp/build/CMakeFiles/CMakeOutput.log".
[proc] The command: C:\msys64\mingw64\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -Sc:/Users/walkiewi/Documents/projects/jcp -Bc:/Users/walkiewi/Documents/projects/jcp/build -G "MinGW Makefiles" exited with code: 1 and signal: null
```
<p>I tried changing two lines in FindwxWidgets.cmake</p>
<p>from</p>
```if(WIN32 AND NOT CYGWIN AND NOT MSYS AND AND NOT CMAKE_CROSSCOMPILING)
if(wxWidgets_FOUND AND MSYS)
```
<p>to:</p>
```if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT MINGW AND NOT CMAKE_CROSSCOMPILING)
if(wxWidgets_FOUND AND (MSYS OR MINGW))
```

But the error is still present

Title: wxWidgets wx/version.h file not found

Body:
I am using VS Code and I want to compile C++ code that use wxWidgets3.2 via cmake.

I installed:

mingw-w64-x86_64-gcc

mingw-w64-x86_64-cmake

mingw-w64-x86_64-wxwidgets3.2-msw

During cmake configure i got this following error:

[variant] Loaded new set of variants
[kit] Successfully loaded 2 kits from C:\Users\walkiewi\AppData\Local\CMakeTools\cmake-tools-kits.json
[proc] Executing command: C:\msys64\mingw64\bin\gcc.exe -v
[main] Configuring folder: jcp
[proc] Executing command: C:\msys64\mingw64\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -Sc:/Users/walkiewi/Documents/projects/jcp -Bc:/Users/walkiewi/Documents/projects/jcp/build -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error at C:/msys64/mingw64/share/cmake/Modules/FindwxWidgets.cmake:225 (message):
[cmake]   wxWidgets wx/version.h file not found in C:/Program;C:/Program.
[cmake] Call Stack (most recent call first):
[cmake]   C:/msys64/mingw64/share/cmake/Modules/FindwxWidgets.cmake:955 (wx_extract_version)
[cmake]   CMakeLists.txt:12 (find_package)
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/walkiewi/Documents/projects/jcp/build/CMakeFiles/CMakeOutput.log".
[proc] The command: C:\msys64\mingw64\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -Sc:/Users/walkiewi/Documents/projects/jcp -Bc:/Users/walkiewi/Documents/projects/jcp/build -G "MinGW Makefiles" exited with code: 1 and signal: null

I tried changing two lines in FindwxWidgets.cmake

from

if(WIN32 AND NOT CYGWIN AND NOT MSYS AND AND NOT CMAKE_CROSSCOMPILING)
if(wxWidgets_FOUND AND MSYS)

to:

if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT MINGW AND NOT CMAKE_CROSSCOMPILING)
if(wxWidgets_FOUND AND (MSYS OR MINGW))

But the error is still present


问:
Connection to cloud server via android studio
hope all is well
may anyone please assist me with connecting an android App to a cloud server
for this is my first time doing this and youtube really isn't helpful

any documentations, feedback and links will highly be appreciated

I tried youtube research and expected to get a valid video that would ahow me how to actually show me how to connect to the cloud server and to actually confirm it

THANKS


问:
Android screen flickering when navigating to the new activity with auto-rotation disabled
I have set orientation programmatically to landscape for tablets and portrait for phones.

The issue is that when navigating on tablet from one activity to another, with auto-rotation disabled and in portrait mode the screen is flickering. First, it navigates to the new activity in portrait mode and then changes to landscape which is not the output I would want.

I've tried adding to the manifest

```<code>android:screenOrientation="locked"
android:screenOrientation="nosensor"
android:screenOrientation="sensor"
</code>```

and in activity for tablets I've set

```<code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
</code>```

Which doesn't flicker, but still its not what I want.

Expected outcome is for phones to stay as portrait mode and tablet as landscape. I think that the main issue is with system auto-rotate setting as disabled, because when it's enabled and I try to navigate from one activity to another, the screens doesn't flick and just stay as either portrait or landscape.

I think I could use

```<code>Settings.System.putInt(context.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 1);
</code>```

but then I need settings write permissions, which should be enabled by the user and I want to know if somehow I can omit that

Body:
I have set orientation programmatically to landscape for tablets and portrait for phones.

The issue is that when navigating on tablet from one activity to another, with auto-rotation disabled and in portrait mode the screen is flickering. First, it navigates to the new activity in portrait mode and then changes to landscape which is not the output I would want.

I've tried adding to the manifest

android:screenOrientation="locked"
android:screenOrientation="nosensor"
android:screenOrientation="sensor"

and in activity for tablets I've set

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);

Which doesn't flicker, but still its not what I want.

Expected outcome is for phones to stay as portrait mode and tablet as landscape. I think that the main issue is with system auto-rotate setting as disabled, because when it's enabled and I try to navigate from one activity to another, the screens doesn't flick and just stay as either portrait or landscape.

I think I could use

Settings.System.putInt(context.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 1);

but then I need settings write permissions, which should be enabled by the user and I want to know if somehow I can omit that