问:
Create SQL statement from MongoDB request
I am migrating from MongoDB to PostgresDB and I have a request to mongo that I am having a hard time updating. Can someone help either transform this into a sequelize statement or a plain SQL query?

```<code>find(num: int) {
(await this.collection).aggregate(

[{
            $match: {
                id : num,
                active: true
            }
        }, {
            $lookup:
                {
                    from: 'list-database',
                    pipeline: [{
                        $match: {
                            id: num,
                            type: 'in',
                            active: true
                        }
                    }],
                    as: 'helper.in'
                }
        }, {
            $lookup:
                {
                    from: 'list-database',
                    pipeline: [{
                        $match: {
                            id: num,
                            type: 'out',
                            active: true
                        }
                    }],
                    as: 'helper.out'
                }
        }])}
</code>```

I tried tranforming it into this

```<code>where: {
    id: num,
    active: true
},
include: [
    {
        model: sequelize.models['list-database'],
        where: {
            id: num,
            doorType: 'inbound',
            active: true
        },
        as: 'helper.in',
        required: false
    },
    {
        model: sequelize.models['list-database'],
        where: {
            id: num,
            doorType: 'outbound',
            active: true
        },
        as: 'helper.out',
        required: false
    }]
});
</code>```

But it does not work. The two databases are not linked together

Body:
I am migrating from MongoDB to PostgresDB and I have a request to mongo that I am having a hard time updating. Can someone help either transform this into a sequelize statement or a plain SQL query?

find(num: int) {
(await this.collection).aggregate(

[{
            $match: {
                id : num,
                active: true
            }
        }, {
            $lookup:
                {
                    from: 'list-database',
                    pipeline: [{
                        $match: {
                            id: num,
                            type: 'in',
                            active: true
                        }
                    }],
                    as: 'helper.in'
                }
        }, {
            $lookup:
                {
                    from: 'list-database',
                    pipeline: [{
                        $match: {
                            id: num,
                            type: 'out',
                            active: true
                        }
                    }],
                    as: 'helper.out'
                }
        }])}

I tried tranforming it into this

where: {
    id: num,
    active: true
},
include: [
    {
        model: sequelize.models['list-database'],
        where: {
            id: num,
            doorType: 'inbound',
            active: true
        },
        as: 'helper.in',
        required: false
    },
    {
        model: sequelize.models['list-database'],
        where: {
            id: num,
            doorType: 'outbound',
            active: true
        },
        as: 'helper.out',
        required: false
    }]
});

But it does not work. The two databases are not linked together


来源: stackexchange

问:
How Do I query jenkins api for build history based on a partial search?
Our jobs are stored within folders per application. The builds are renamed to a variable $CODE_VERSION. We then name the build Artifacts to match the $CODE_VERSION. We store our artifact in storage blobs vs local on Jenkins.

Given the folder/job_name and GIT_REVISION for the CODE_VERSION based on a partial search; I want to be able to find the artifact for the git_revision.

I have been writing this in python so it can be triggered by automation. I started  https://github.com/pycontribs/jenkinsapi/blob/master/doc/source/using_jenkinsapi.rst but it doesn't recognize the artifacts in storageblobs. It also only allows lastBuild, lastGoodBuild. I cannot seem to query all build history

ContentLicense: CC BY-SA 4.0


问:
Azure Container Registry Task: Dokerfile is not getting uploaded to repo using terraform
Please help me with this:
I was trying to deploy an image into the ACR but it wasn't deploying to the repo. What wrong in the script.
Thank you in advance</p>
```<code>resource "azurerm_container_registry_task" "example" {
name = "example-task"
container_registry_id = azurerm_container_registry.acr.id
platform {
os = "Linux"
}
docker_step {
dockerfile_path = "/dock/Dockerfile"
context_path = "https://abcxyz.blob.core.windows.net/dock/Dockerfile"
context_access_token = "?sv=2021-06-08&ss=bfqt&srt=sco&sp=rwdlacupiyx&se=2022-12-12T13:44:59Z&st=2022-12-12T05:44:59Z&spr=https&sig=abcdefghijklmnopqrstuvwxyz%3D"
image_names = ["${azurerm_container_registry.acr.login_server}/flagcont:latest"]
push_enabled = true
target = "${azurerm_container_registry.acr.login_server}/flagcont:latest"
}
}
</code>```

Body:
Please help me with this:
I was trying to deploy an image into the ACR but it wasn't deploying to the repo. What wrong in the script.
Thank you in advance

resource "azurerm_container_registry_task" "example" {
name = "example-task"
container_registry_id = azurerm_container_registry.acr.id
platform {
os = "Linux"
}
docker_step {
dockerfile_path = "/dock/Dockerfile"
context_path = "https://abcxyz.blob.core.windows.net/dock/Dockerfile"
context_access_token = "?sv=2021-06-08&ss=bfqt&srt=sco&sp=rwdlacupiyx&se=2022-12-12T13:44:59Z&st=2022-12-12T05:44:59Z&spr=https&sig=abcdefghijklmnopqrstuvwxyz%3D"
image_names = ["${azurerm_container_registry.acr.login_server}/flagcont:latest"]
push_enabled = true
target = "${azurerm_container_registry.acr.login_server}/flagcont:latest"
}
}


问:
NgxExtendedPdfViewerModule shows error after install and importing it | Angular | NgxExtendedPdfViewerModule
```<code>Angular CLI: 11.2.12
Node: 14.16.1
OS: win32 x64
</code>```

After Import NgxExtendedPdfViewerModule when command ng s -o It shows this long error

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3774:25-46
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3809:36-57
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3862:32-53
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3909:28-4939m
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3956:33-54
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 4010:29-50
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 703:4-13
Can't import the named export 'ɵɵpipe' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 704:4-13
Can't import the named export 'ɵɵpipe' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 710:31-45
Can't import the named export 'ɵɵpipeBind1' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5904:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9230:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9231:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9232:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9379:18-32
Can't import the named export 'ɵɵreference' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 741:14-32
Can't import the named export 'ɵɵresolveWindow' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 2723:16-34
Can't import the named export 'ɵɵresolveWindow' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 107:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 122:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 227:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 242:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 257:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 372:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 474:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 498:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 738:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 745:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 754:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 793:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 797:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 809:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 288:4-18
Can't import the named export 'ɵɵstyleProp' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 383:4-18
Can't import the named export 'ɵɵstyleProp' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 6112:6-20
Can't import the named export 'ɵɵstyleProp' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 685:4-17
Can't import the named export 'ɵɵtemplate' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9375:6-19
Can't import the named export 'ɵɵtemplate' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9374:109-134
Can't import the named export 'ɵɵtemplateRefExtractor' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9375:107-132
Can't import the named export 'ɵɵtemplateRefExtractor' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 52:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 62:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 72:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 82:4-13
91mCan't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 92:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 102:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 117:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 132:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

9mError: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 2298:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5173:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5295:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5359:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5578:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5647:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5711:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5767:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5814:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 532:4-25
Can't import the named export 'ɵɵtextInterpolate1' from non EcmaScript module (only default export is available)
[91m
Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 710:4-25
Can't import the named export 'ɵɵtextInterpolate1' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 725:4-25
Can't import the named export 'ɵɵtextInterpolate1' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1657:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1658:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1659:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1660:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 2963:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 4874:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 4982:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5447:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5448:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5898:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9221:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9222:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9223:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9224:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Body:
Angular CLI: 11.2.12
Node: 14.16.1
OS: win32 x64

After Import NgxExtendedPdfViewerModule when command ng s -o It shows this long error

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3774:25-46
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3809:36-57
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3862:32-53
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3909:28-4939m
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 3956:33-54
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 4010:29-50
Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 703:4-13
Can't import the named export 'ɵɵpipe' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 704:4-13
Can't import the named export 'ɵɵpipe' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 710:31-45
Can't import the named export 'ɵɵpipeBind1' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5904:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9230:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9231:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9232:6-23
Can't import the named export 'ɵɵqueryRefresh' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9379:18-32
Can't import the named export 'ɵɵreference' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 741:14-32
Can't import the named export 'ɵɵresolveWindow' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 2723:16-34
Can't import the named export 'ɵɵresolveWindow' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 107:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 122:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 227:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 242:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 257:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 372:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 474:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 498:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 738:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 745:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 754:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 793:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 797:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 809:6-22
Can't import the named export 'ɵɵrestoreView' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 288:4-18
Can't import the named export 'ɵɵstyleProp' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 383:4-18
Can't import the named export 'ɵɵstyleProp' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 6112:6-20
Can't import the named export 'ɵɵstyleProp' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 685:4-17
Can't import the named export 'ɵɵtemplate' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9375:6-19
Can't import the named export 'ɵɵtemplate' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9374:109-134
Can't import the named export 'ɵɵtemplateRefExtractor' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9375:107-132
Can't import the named export 'ɵɵtemplateRefExtractor' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 52:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 62:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 72:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 82:4-13
91mCan't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 92:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 102:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 117:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 132:4-13
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

9mError: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 2298:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5173:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5295:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5359:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5578:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5647:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5711:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5767:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5814:6-15
Can't import the named export 'ɵɵtext' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 532:4-25
Can't import the named export 'ɵɵtextInterpolate1' from non EcmaScript module (only default export is available)
[91m
Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 710:4-25
Can't import the named export 'ɵɵtextInterpolate1' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 725:4-25
Can't import the named export 'ɵɵtextInterpolate1' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1657:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1658:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1659:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 1660:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 2963:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 4874:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 4982:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5447:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5448:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 5898:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9221:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9222:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9223:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)

Error: ./node_modules/ngx-extended-pdf-viewer/fesm2015/ngx-extended-pdf-viewer.mjs 9224:6-20
Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available)


问:
Strange error while running Dask on Windows
I’m trying to run the text vectorization example from the dask examples website but i keep getting this error on the pipe.fit() line:

ValueError: Layer (‘fit-cd0b5ca52f2c9a52f6c731defb4b4124’, 24) not in the HighLevelGraph’s layers: [‘from_pandas-8f0675dab85c873a055e3ff8b258cbce’, ‘getitem-8e9b8cb5e390ef27e9c606e88f4d8305’, ‘_transformer-0d48ff13d988fe55b2ebe2c8ffb8c405’, 2207520048768, ‘isin-2017431f699a918998d96bcc559a37b2’, ‘getitem-f4118e2e898ccf9c76c631916878f04a’, ‘ndarray-0edbb77c-b209-434a-9e08-d51958198a34’, ‘astype-b02ba61f005b644214eb131baf17fbef’]

And it only happens on windows pcs, works fine on linux.

Did this ever happen to anyone else?

```<code>ValueError                                Traceback (most recent call last)
Cell In [12], line 1
----> 1 pipe.fit(df['text'], y,
      2          incremental__classes=[0, 1])

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\sklearn\pipeline.py:394, in Pipeline.fit(self, X, y, **fit_params)
    392     if self._final_estimator != "passthrough":
    393         fit_params_last_step = fit_params_steps[self.steps[-1][0]]
--> 394         self._final_estimator.fit(Xt, y, **fit_params_last_step)
    396 return self

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask_ml\wrappers.py:495, in Incremental.fit(self, X, y, **fit_kwargs)
    493 def fit(self, X, y=None, **fit_kwargs):
    494     estimator = sklearn.base.clone(self.estimator)
--> 495     self._fit_for_estimator(estimator, X, y, **fit_kwargs)
    496     return self

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask_ml\wrappers.py:479, in Incremental._fit_for_estimator(self, estimator, X, y, **fit_kwargs)
    477     result = estimator.partial_fit(X=X, y=y, **fit_kwargs)
    478 else:
--> 479     result = fit(
    480         estimator,
    481         X,
    482         y,
    483         random_state=self.random_state,
    484         shuffle_blocks=self.shuffle_blocks,
    485         assume_equal_chunks=self.assume_equal_chunks,
    486         **fit_kwargs,
    487     )
    489 copy_learned_attributes(result, self)
    490 self.estimator_ = result

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask_ml\_partial.py:136, in fit(model, x, y, compute, shuffle_blocks, random_state, assume_equal_chunks, **kwargs)
    132     from dask import sharedict
    134     new_dsk = sharedict.merge(*graphs.values())
--> 136 value = Delayed((name, nblocks - 1), new_dsk)
    138 if compute:
    139     return value.compute()

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask\delayed.py:501, in Delayed.__init__(self, key, dsk, length, layer)
    499 self._layer = layer or key
    500 if isinstance(dsk, HighLevelGraph) and self._layer not in dsk.layers:
--> 501     raise ValueError(
    502         f"Layer {self._layer} not in the HighLevelGraph's layers: {list(dsk.layers)}"
    503     )

ValueError: Layer ('fit-d4e10b765f878f992c22aef804140620', 24) not in the HighLevelGraph's layers: ['from_pandas-8f0675dab85c873a055e3ff8b258cbce', 'getitem-8e9b8cb5e390ef27e9c606e88f4d8305', '_transformer-0d48ff13d988fe55b2ebe2c8ffb8c405', 2195545223936, 'isin-0adbaa8cd18afa85a47a2c9db849c587', 'getitem-f4118e2e898ccf9c76c631916878f04a', 'ndarray-f048cac7-ecaf-4145-926a-555d18deb73a', 'astype-bae22adfd02e007cdba13a6867f49afb']
</code>```

Body:
I’m trying to run the text vectorization example from the dask examples website but i keep getting this error on the pipe.fit() line:

ValueError: Layer (‘fit-cd0b5ca52f2c9a52f6c731defb4b4124’, 24) not in the HighLevelGraph’s layers: [‘from_pandas-8f0675dab85c873a055e3ff8b258cbce’, ‘getitem-8e9b8cb5e390ef27e9c606e88f4d8305’, ‘_transformer-0d48ff13d988fe55b2ebe2c8ffb8c405’, 2207520048768, ‘isin-2017431f699a918998d96bcc559a37b2’, ‘getitem-f4118e2e898ccf9c76c631916878f04a’, ‘ndarray-0edbb77c-b209-434a-9e08-d51958198a34’, ‘astype-b02ba61f005b644214eb131baf17fbef’]

And it only happens on windows pcs, works fine on linux.

Did this ever happen to anyone else?

ValueError                                Traceback (most recent call last)
Cell In [12], line 1
----> 1 pipe.fit(df['text'], y,
      2          incremental__classes=[0, 1])

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\sklearn\pipeline.py:394, in Pipeline.fit(self, X, y, **fit_params)
    392     if self._final_estimator != "passthrough":
    393         fit_params_last_step = fit_params_steps[self.steps[-1][0]]
--> 394         self._final_estimator.fit(Xt, y, **fit_params_last_step)
    396 return self

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask_ml\wrappers.py:495, in Incremental.fit(self, X, y, **fit_kwargs)
    493 def fit(self, X, y=None, **fit_kwargs):
    494     estimator = sklearn.base.clone(self.estimator)
--> 495     self._fit_for_estimator(estimator, X, y, **fit_kwargs)
    496     return self

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask_ml\wrappers.py:479, in Incremental._fit_for_estimator(self, estimator, X, y, **fit_kwargs)
    477     result = estimator.partial_fit(X=X, y=y, **fit_kwargs)
    478 else:
--> 479     result = fit(
    480         estimator,
    481         X,
    482         y,
    483         random_state=self.random_state,
    484         shuffle_blocks=self.shuffle_blocks,
    485         assume_equal_chunks=self.assume_equal_chunks,
    486         **fit_kwargs,
    487     )
    489 copy_learned_attributes(result, self)
    490 self.estimator_ = result

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask_ml\_partial.py:136, in fit(model, x, y, compute, shuffle_blocks, random_state, assume_equal_chunks, **kwargs)
    132     from dask import sharedict
    134     new_dsk = sharedict.merge(*graphs.values())
--> 136 value = Delayed((name, nblocks - 1), new_dsk)
    138 if compute:
    139     return value.compute()

File ~\anaconda3\envs\dask-tutorial\envs\dask\lib\site-packages\dask\delayed.py:501, in Delayed.__init__(self, key, dsk, length, layer)
    499 self._layer = layer or key
    500 if isinstance(dsk, HighLevelGraph) and self._layer not in dsk.layers:
--> 501     raise ValueError(
    502         f"Layer {self._layer} not in the HighLevelGraph's layers: {list(dsk.layers)}"
    503     )

ValueError: Layer ('fit-d4e10b765f878f992c22aef804140620', 24) not in the HighLevelGraph's layers: ['from_pandas-8f0675dab85c873a055e3ff8b258cbce', 'getitem-8e9b8cb5e390ef27e9c606e88f4d8305', '_transformer-0d48ff13d988fe55b2ebe2c8ffb8c405', 2195545223936, 'isin-0adbaa8cd18afa85a47a2c9db849c587', 'getitem-f4118e2e898ccf9c76c631916878f04a', 'ndarray-f048cac7-ecaf-4145-926a-555d18deb73a', 'astype-bae22adfd02e007cdba13a6867f49afb']


问:
How do I make this for loop that calculates the difference between two times more efficient?
I have a for loop that runs through weeks 1 - 8 of NFL offensive plays, throughout each week I have another loop that loops through each unique play. I then take the play marked "ball_snap", and another play marked "pass_forward" and calculate the difference between the two so that I know how long the QB held the ball. Then I append the playId and time_to_throw to 2 separate lists then outside the loop they create my dataframe.[enter image description here]

```<code>play_list = []
time_list = []
for week in weeks:
    for play in week.playId.unique():
        time_to_throw = 0
        #Extract the playId, and time for each unique play when ball was snapped
        try:
            ball_snap = week[(week['playId'] == play) &
             (week['event'] == 'ball_snap')].iloc[0, np.r_[1,4]]

        #convert the time recording when ball was snapped to datetime
            ball_snap_time = datetime.strptime(' '.join(ball_snap.time.split('T',1)), "%Y-%m-%d %H:%M:%S.%f")
            print(ball_snap_time)
        #Extract the playId, and time  for each unique play when ball was thrown forward
            pass_forward = week[(week['playId'] == play) &
             (week['event'] == 'pass_forward')].iloc[0, np.r_[1,4]]
        #convert the time recording when ball was thrown forward to datetime
            pass_forward_time = datetime.strptime((' '.join(pass_forward.time.split('T',1))), "%Y-%m-%d %H:%M:%S.%f")
            print(pass_forward_time)
        except:
            pass

        #Calculate the time it took from ball snap to ball thrown forward
        time_to_throw = (pass_forward_time - ball_snap_time).total_seconds()
        print(time_to_throw)
        #Now fill data into dictionary and convert to dataframe
        play_list.append(play)
        time_list.append(time_to_throw)

df_ttt = pd.DataFrame({'playId': play_list,
                    'time_to_throw': time_list})
</code>```

I was successful, kind of. This loop is extremely slow and takes upwards of 15 minutes to execute. I understand that it has to loop through each play and I believe that is my bottleneck. However, I don't think there is any other way to get the time from 'event'= 'ball_snap' and event='pass_forward' for the same play, convert both into datetime and then find the difference. OR maybe there is?

Body:
I have a for loop that runs through weeks 1 - 8 of NFL offensive plays, throughout each week I have another loop that loops through each unique play. I then take the play marked "ball_snap", and another play marked "pass_forward" and calculate the difference between the two so that I know how long the QB held the ball. Then I append the playId and time_to_throw to 2 separate lists then outside the loop they create my dataframe.[enter image description here]

play_list = []
time_list = []
for week in weeks:
    for play in week.playId.unique():
        time_to_throw = 0
        #Extract the playId, and time for each unique play when ball was snapped
        try:
            ball_snap = week[(week['playId'] == play) &
             (week['event'] == 'ball_snap')].iloc[0, np.r_[1,4]]

        #convert the time recording when ball was snapped to datetime
            ball_snap_time = datetime.strptime(' '.join(ball_snap.time.split('T',1)), "%Y-%m-%d %H:%M:%S.%f")
            print(ball_snap_time)
        #Extract the playId, and time  for each unique play when ball was thrown forward
            pass_forward = week[(week['playId'] == play) &
             (week['event'] == 'pass_forward')].iloc[0, np.r_[1,4]]
        #convert the time recording when ball was thrown forward to datetime
            pass_forward_time = datetime.strptime((' '.join(pass_forward.time.split('T',1))), "%Y-%m-%d %H:%M:%S.%f")
            print(pass_forward_time)
        except:
            pass

        #Calculate the time it took from ball snap to ball thrown forward
        time_to_throw = (pass_forward_time - ball_snap_time).total_seconds()
        print(time_to_throw)
        #Now fill data into dictionary and convert to dataframe
        play_list.append(play)
        time_list.append(time_to_throw)

df_ttt = pd.DataFrame({'playId': play_list,
                    'time_to_throw': time_list})

I was successful, kind of. This loop is extremely slow and takes upwards of 15 minutes to execute. I understand that it has to loop through each play and I believe that is my bottleneck. However, I don't think there is any other way to get the time from 'event'= 'ball_snap' and event='pass_forward' for the same play, convert both into datetime and then find the difference. OR maybe there is?


问:
How to wait for a forEach() to finish before executing another code?
I have code as below:

const images: string[] = [];
data.forEach(async (file: any) => {
    const extension = file
                .split(".")
                .pop()
                ?.split("?")[0]
                .toLocaleLowerCase();

    if (extension === "pdf") {
        await convertFromPdf(file).then((res) =>
            images.push(...res.map((x) => x as string))
        );
        window.dispatchEvent(new Event("resize"));
    } else if (
        extension === "jpg" ||
        extension === "jpeg" ||
        extension === "png"
    ) {
        images.push(file);
    }
});

// HERE FUNCTION THAT TAKES IN `images` AS A PARAMETER
```

How can I wait for data.forEach() to finish up, then execute the function after the loop? Note that here if the extension is pdf then the async function convertFromPdf is executed, if not then the file is just pushed into the image variable. So if the data is a mix of both pdf and non-pdf files, I want all of them to get processed in order.

Body:
I have code as below:

const images: string[] = [];
data.forEach(async (file: any) => {
    const extension = file
                .split(".")
                .pop()
                ?.split("?")[0]
                .toLocaleLowerCase();

    if (extension === "pdf") {
        await convertFromPdf(file).then((res) =>
            images.push(...res.map((x) => x as string))
        );
        window.dispatchEvent(new Event("resize"));
    } else if (
        extension === "jpg" ||
        extension === "jpeg" ||
        extension === "png"
    ) {
        images.push(file);
    }
});

// HERE FUNCTION THAT TAKES IN `images` AS A PARAMETER

How can I wait for data.forEach() to finish up, then execute the function after the loop? Note that here if the extension is pdf then the async function convertFromPdf is executed, if not then the file is just pushed into the image variable. So if the data is a mix of both pdf and non-pdf files, I want all of them to get processed in order.


问:
Why is computed property not updating?
I have a Typescript object that I want to spawn and listen to in a vue component.

It's a distance calculator that subscribes to some external events and then updates distanceInMm property. This all happens from inside the object and not through vue. (I don't want to post the whole code here, but it works fine, distanceInMm is updated when I expect it to)

```<code>export default class DistanceCalculator {

...
private distanceInMm: number = -1;

get distanceToTargetInCm(): number {
    return parseFloat((this.distanceInMm / 10).toFixed(2)); // cm
  }

...
}

</code>```

So basically, I just want to display distanceToTargetInCm in a vue component and have it update as the value changes in the back end. I've tried several methods and I can only get it to update once or not at all.

```<code><template>
    <div class="bottom-text">
      {{ distanceToTarget2 }} {{ distanceToTarget() }} {{ distanceCalculator.distanceToTargetInCm }}
    </div>
</template>

<script lang="ts">

// leaving imports out

export default defineComponent({
  props: {
    target: {
      type: Object as PropType<Target>,
      required: true,
    },
  },

  data(props) {
    const distanceCalculator = new DistanceCalculator(props.target);
    return {
      distanceCalculator,
      timer: {},
    };
  },
  mounted() {
    this.timer = setInterval(() => {
      this.distanceToTarget();
    }, 1000);
  },
  methods: {
    distanceToTarget() {
      console.log(`Triggered by timer: ${this.distanceCalculator.distanceToTargetInCm}`);
      return this.distanceCalculator.distanceToTargetInCm;
    },
  },
  computed: {
    distanceToTarget2() {
      return this.distanceCalculator.distanceToTargetInCm;
    },
  },
  watch: {
    distanceToTarget() {
      console.log('distanceToTarget changed');
    },
  },
});
</script>
</code>```

So {{ distanceToTarget2 }} never updates, always shows -0.1 which is the value on initialize, and both {{ distanceToTarget() }} {{ distanceCalculator.distanceToTargetInCm }} update once, to the first real distance value, and then never get updated again.

As you can see I added a timer (to mounted()) to check the content of distanceToTargetInCm  and when triggered by the timer, the distanceToTarget function prints what I expect.

Also the watch never triggers.

So I'm guessing this is an issue with reactivity.... but I don't understand how to fix it...  I tried making the calculator explicitly reactive (reactive(new DistanceCalculator(props.target))) but it made no difference...

I've read a bunch of answers to similar questions but haven't been able to solve the issue. Any help would be appreciated!

Title: Why is computed property not updating?

Body:
I have a Typescript object that I want to spawn and listen to in a vue component.

It's a distance calculator that subscribes to some external events and then updates distanceInMm property. This all happens from inside the object and not through vue. (I don't want to post the whole code here, but it works fine, distanceInMm is updated when I expect it to)

export default class DistanceCalculator {

...
private distanceInMm: number = -1;

get distanceToTargetInCm(): number {
    return parseFloat((this.distanceInMm / 10).toFixed(2)); // cm
  }

...
}

So basically, I just want to display distanceToTargetInCm in a vue component and have it update as the value changes in the back end. I've tried several methods and I can only get it to update once or not at all.

<template>

      {{ distanceToTarget2 }} {{ distanceToTarget() }} {{ distanceCalculator.distanceToTargetInCm }}

</template>

So {{ distanceToTarget2 }} never updates, always shows -0.1 which is the value on initialize, and both {{ distanceToTarget() }} {{ distanceCalculator.distanceToTargetInCm }} update once, to the first real distance value, and then never get updated again.

As you can see I added a timer (to mounted()) to check the content of distanceToTargetInCm  and when triggered by the timer, the distanceToTarget function prints what I expect.

Also the watch never triggers.

So I'm guessing this is an issue with reactivity.... but I don't understand how to fix it...  I tried making the calculator explicitly reactive (reactive(new DistanceCalculator(props.target))) but it made no difference...

I've read a bunch of answers to similar questions but haven't been able to solve the issue. Any help would be appreciated!


问:
Center different amounts of text inside divs with flexbox and keep the divs aligned
I have 3 inline div blocks.

When I have different amounts of text inside the div, it looses its alignment. Some white space appears at the top.

Why is that and what can I do to solve it?

Thanks!

body {
  font: 36px Arial, sans-serif;
}
.container-outer {
  display: inline-block;
}
.container {
  color: white;
  background: #ffbd17;
  width: 200px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.content {
  background: #06c;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="container-outer">
  <div class="container">
    <div class="content">
      Line 1
    </div>
  </div>
</div>
<div class="container-outer">
  <div class="container">
    <div class="content">
      Line 1<br>
      Line 2
    </div>
  </div>
</div>
<div class="container-outer">
  <div class="container">
    <div class="content">
      Line 1
    </div>
  </div>
</div></code>```

Body:
I have 3 inline div blocks.

When I have different amounts of text inside the div, it looses its alignment. Some white space appears at the top.

Why is that and what can I do to solve it?

Thanks!

body {
  font: 36px Arial, sans-serif;
}
.container-outer {
  display: inline-block;
}
.container {
  color: white;
  background: #ffbd17;
  width: 200px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.content {
  background: #06c;
}

      Line 1

      Line 1

      Line 2

      Line 1


问:
Roll back from Managed Private app to public app
I have accidentally added the organisation id and made my public app to private Managed Enterprise app(Changes not published yet).

How can we roll back to public app. Is there a way that we can undo the previous chages that we made in Google play console.


问:
Show Google Earth Touring Odometer
I am trying to find a way to add an odometer showing the travelled distance from the beginning of the tour over a path.
An alternative would be showing the elevation profile synchronized with the tour progress.
Any ideas?

I have read the Google Earth documentation but there is no mention to any feature allowing what I am looking for.

Title: Show Google Earth Touring Odometer


问:
Query another table with results of an another query that include a csv column
Brief Summary:

I am currently trying to get a count of completed parts that fall within a specific time range, machine number, operation number, and matches the tool number.

For example:

```<code>SELECT Sequence, Serial, Operation,Machine,DateTime,value as Tool
FROM tbPartProfile
CROSS APPLY STRING_SPLIT(Tool_Used, ',')
ORDER BY DateTime desc
</code>```

is running a query which pulls all the instances that a tool has been changed, I am splitting the CSV from Tool_Used column.  I am doing this because there can be multiple changes during one operation.

Objective:
This is where the production count come into place.  For example, record 1 has a to0l change of 36 on 12/12/2022.  I will need to go back in to the table and get the amount of part completed that equals the OPERATION/MACHINE/TOOL and fall between the date range.

For example:

```<code>SELECT *
FROM tbPartProfile
WHERE Operation = 20 AND Machine = 1 AND Tool_Used LIKE '%36%'
ORDER BY DateTime desc
</code>```

For example this query will give me the datetimes the tools LIKE 36 was changed.  I will need to take this datetime and compare it previous query and get the sum of all parts that were ran in this TimeRange/Operation/Machine/Tool Used

Body:
Brief Summary:

I am currently trying to get a count of completed parts that fall within a specific time range, machine number, operation number, and matches the tool number.

For example:

SELECT Sequence, Serial, Operation,Machine,DateTime,value as Tool
FROM tbPartProfile
CROSS APPLY STRING_SPLIT(Tool_Used, ',')
ORDER BY DateTime desc

is running a query which pulls all the instances that a tool has been changed, I am splitting the CSV from Tool_Used column.  I am doing this because there can be multiple changes during one operation.

Objective:
This is where the production count come into place.  For example, record 1 has a to0l change of 36 on 12/12/2022.  I will need to go back in to the table and get the amount of part completed that equals the OPERATION/MACHINE/TOOL and fall between the date range.

For example:

SELECT *
FROM tbPartProfile
WHERE Operation = 20 AND Machine = 1 AND Tool_Used LIKE '%36%'
ORDER BY DateTime desc

For example this query will give me the datetimes the tools LIKE 36 was changed.  I will need to take this datetime and compare it previous query and get the sum of all parts that were ran in this TimeRange/Operation/Machine/Tool Used


问:
Exporting a dynamic Go struct into BigQuery's JSON field type
As much as I want to use well-defined structures and schemas in BigQuery, I have a case now when I really need to export rows with a highly dynamic field into BigQuery.

This is the Go client I am using:
https://pkg.go.dev/cloud.google.com/go/bigquery

For brevity, here's my row struct in Go:

```<code>type Row struct {
    Name     string    `bigquery:"name"`
    Count    int64     `bigquery:"count"`
    Metadata Metadata  `bigquery:"metadata"`
}
</code>```

This Metadata struct is a slice of objects that have a set of nested fields. Some of those fields are unpredictable and this is why I cannot specify the schema explicitly and tag all the fields explicitly.

I have found the relatively new bigquery.FieldType JSON that is in theory supposed to work in these cases.

Having said that, I still get the error field metadata is not a record type when exporting my data to BQ.

This doesn't make a lot of sense because I decided to use this JSON field type in order to avoid specifying the schema for the RECORD type.

Another option would be to use the auto detect feature but it's only available when exporting data from a JSON file in a GCS bucket.

Is there a workaround in this case? Let me know if I should add more details to the question in the comments and I will do so.

Body:
As much as I want to use well-defined structures and schemas in BigQuery, I have a case now when I really need to export rows with a highly dynamic field into BigQuery.

This is the Go client I am using:
https://pkg.go.dev/cloud.google.com/go/bigquery

For brevity, here's my row struct in Go:

type Row struct {
    Name     string    `bigquery:"name"`
    Count    int64     `bigquery:"count"`
    Metadata Metadata  `bigquery:"metadata"`
}

This Metadata struct is a slice of objects that have a set of nested fields. Some of those fields are unpredictable and this is why I cannot specify the schema explicitly and tag all the fields explicitly.

I have found the relatively new bigquery.FieldType JSON that is in theory supposed to work in these cases.

Having said that, I still get the error field metadata is not a record type when exporting my data to BQ.

This doesn't make a lot of sense because I decided to use this JSON field type in order to avoid specifying the schema for the RECORD type.

Another option would be to use the auto detect feature but it's only available when exporting data from a JSON file in a GCS bucket.

Is there a workaround in this case? Let me know if I should add more details to the question in the comments and I will do so.


问:
Shiny for Python: Clearing Local Files on Session Close

How Do I Delete Local Files on Session Close?

My app allows users to upload a file and request some server-side stuff be done to it. Awesome. However, I don't want these files to stay there. Looking at the documentation, something like this should work (sanitized to protect the innocent)...

```<code>from shiny import App, reactive, render, ui
import os

def server(input, output, session):
     def delete_uploaded_file():
        try:
            os.remove('file.xlsx')))
        except:
            # If there isn't a file, it's not really a problem
            pass

    # This triggers at the end of a session
    session.on_ended(delete_uploaded_file())

    # this closes the session when the user exits out on their browser
    @reactive.Effect
    @reactive.event(input.close)
    async def _():
        await session.close()

app = App(app_ui, server)
</code>```

but it yields an 'Exception in ASGI application' and a 'TypeError,' all without triggering any of the above code. Everything in the traceback seems to point to shiny, so what am I doing wrong here?

```<code>ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 238, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "C:\Users\e365627\AppData\Roaming\Python\Python39\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\_app.py", line 220, in __call__
    await self.starlette_app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\middleware\errors.py", line 149, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\_autoreload.py", line 114, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py", line 341, in handle
    await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py", line 82, in app
    await func(session)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\_app.py", line 294, in _on_connect_cb
    await session._run()
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\session\_session.py", line 326, in _run
    self._run_session_end_tasks()
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\session\_session.py", line 228, in _run_session_end_tasks
    self._on_ended_callbacks.invoke()
  File "C:\Users\username\AppData\Python\Python39\site-packages\shiny\_utils.py", line 335, in invoke
    fn()
TypeError: 'NoneType' object is not callable
INFO:     connection closed
</code>```

Body:
How Do I Delete Local Files on Session Close?

My app allows users to upload a file and request some server-side stuff be done to it. Awesome. However, I don't want these files to stay there. Looking at the documentation, something like this should work (sanitized to protect the innocent)...

from shiny import App, reactive, render, ui
import os

def server(input, output, session):
     def delete_uploaded_file():
        try:
            os.remove('file.xlsx')))
        except:
            # If there isn't a file, it's not really a problem
            pass

    # This triggers at the end of a session
    session.on_ended(delete_uploaded_file())

    # this closes the session when the user exits out on their browser
    @reactive.Effect
    @reactive.event(input.close)
    async def _():
        await session.close()

app = App(app_ui, server)

but it yields an 'Exception in ASGI application' and a 'TypeError,' all without triggering any of the above code. Everything in the traceback seems to point to shiny, so what am I doing wrong here?

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 238, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "C:\Users\e365627\AppData\Roaming\Python\Python39\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\_app.py", line 220, in __call__
    await self.starlette_app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\middleware\errors.py", line 149, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\_autoreload.py", line 114, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py", line 341, in handle
    await self.app(scope, receive, send)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\starlette\routing.py", line 82, in app
    await func(session)
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\_app.py", line 294, in _on_connect_cb
    await session._run()
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\session\_session.py", line 326, in _run
    self._run_session_end_tasks()
  File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\shiny\session\_session.py", line 228, in _run_session_end_tasks
    self._on_ended_callbacks.invoke()
  File "C:\Users\username\AppData\Python\Python39\site-packages\shiny\_utils.py", line 335, in invoke
    fn()
TypeError: 'NoneType' object is not callable
INFO:     connection closed


问:
Heatmap based on OSM produces error "Discrete value supplied to continuous scale"
I'm trying to create a heatmap based on schools/unis/colleges in SF.
I am querying them from OSM and would like to plot them in CRS 2227.
This is what I tried:

```<code>san_fran_map <- get_map(c(-122.5209,37.6020,-122.3489,37.8130), maptype = "toner-background", source = "stamen")

location_spec <- opq(bbox = c(-122.5209,37.6020,-122.3489,37.8130))

specified_institutions <- c("college","school","university")

osm_institution <- location_spec %>%
  add_osm_feature(key = "amenity", value = specified_institutions) %>%
  osmdata_sf ()

#removing polygons that are empty
not_all_na <- function(x) any(!is.na(x))

osm_polys <- osm_institution$osm_polygons %>%
  select(where(not_all_na))

#creating a centroid
osm_polys$geometry <- st_centroid(osm_polys$geometry)
osm_polys <- st_sf(osm_polys)

osm_polys<-subset(osm_polys, (!is.na(osm_polys$name))) %>% #removing all unnamed ones
  filter(duplicated("name") == FALSE)

#splitting geography column up into longitude/latitude
osm_polys <- osm_polys %>%
  dplyr::mutate(longitude = sf::st_coordinates(.)[,1],
                latitude = sf::st_coordinates(.)[,2])

osm_polys <- st_as_sf(osm_polys, coords = c("longitude", "latitude"), crs = 2227, remove = FALSE)

san_fran <- ggmap(san_fran_map, extent="device", legend="none")

heatmap_map5 <- san_fran + stat_density2d(data=osm_polys,
                                          aes(x="latitude", y="longitude",
                                          fill=..level..,
                                          alpha=..level..),
                                          geom="polygon")
heatmap_map5 <- heatmap_map5 + scale_fill_gradientn(colours=rev(brewer.pal(7, "Spectral")))
heatmap_map5
</code>```

It leaves me with the error "Error: Discrete value supplied to continuous scale". I don't really know how to fix it and every adjustment I make leaves me with more errors.

These are the libraries I'm using (and a couple of others):

```<code>library("tidyverse")
library("sf")
library("readr")
library("dplyr")
library("tidytable")
library("tmap")
library("ggplot2")
library("mapsf")
library("scales")
library("ggmap") # need to cite if using
library("maptools")
library("acs")
library("leaflet")
library("tidycensus")
library("cowplot")
library("googleway")
library("ggrepel")
library("ggspatial")
library("rnaturalearth")
library("rnaturalearthdata")
library("RColorBrewer")
library("data.table")
library("osrm")
library("osmdata")
</code>```

Body:
I'm trying to create a heatmap based on schools/unis/colleges in SF.
I am querying them from OSM and would like to plot them in CRS 2227.
This is what I tried:

san_fran_map <- get_map(c(-122.5209,37.6020,-122.3489,37.8130), maptype = "toner-background", source = "stamen")

location_spec <- opq(bbox = c(-122.5209,37.6020,-122.3489,37.8130))

specified_institutions <- c("college","school","university")

osm_institution <- location_spec %>%
  add_osm_feature(key = "amenity", value = specified_institutions) %>%
  osmdata_sf ()

#removing polygons that are empty
not_all_na <- function(x) any(!is.na(x))

osm_polys <- osm_institution$osm_polygons %>%
  select(where(not_all_na))

#creating a centroid
osm_polys$geometry <- st_centroid(osm_polys$geometry)
osm_polys <- st_sf(osm_polys)

osm_polys<-subset(osm_polys, (!is.na(osm_polys$name))) %>% #removing all unnamed ones
  filter(duplicated("name") == FALSE)

#splitting geography column up into longitude/latitude
osm_polys <- osm_polys %>%
  dplyr::mutate(longitude = sf::st_coordinates(.)[,1],
                latitude = sf::st_coordinates(.)[,2])

osm_polys <- st_as_sf(osm_polys, coords = c("longitude", "latitude"), crs = 2227, remove = FALSE)

san_fran <- ggmap(san_fran_map, extent="device", legend="none")

heatmap_map5 <- san_fran + stat_density2d(data=osm_polys,
                                          aes(x="latitude", y="longitude",
                                          fill=..level..,
                                          alpha=..level..),
                                          geom="polygon")
heatmap_map5 <- heatmap_map5 + scale_fill_gradientn(colours=rev(brewer.pal(7, "Spectral")))
heatmap_map5

It leaves me with the error "Error: Discrete value supplied to continuous scale". I don't really know how to fix it and every adjustment I make leaves me with more errors.

These are the libraries I'm using (and a couple of others):

library("tidyverse")
library("sf")
library("readr")
library("dplyr")
library("tidytable")
library("tmap")
library("ggplot2")
library("mapsf")
library("scales")
library("ggmap") # need to cite if using
library("maptools")
library("acs")
library("leaflet")
library("tidycensus")
library("cowplot")
library("googleway")
library("ggrepel")
library("ggspatial")
library("rnaturalearth")
library("rnaturalearthdata")
library("RColorBrewer")
library("data.table")
library("osrm")
library("osmdata")


问:
CupertinoTabBar page reload on tab selection
I use CupertinoTabBar how can I make it so that when another tab is selected, the tab page reloads and does not save its state

```<code>CupertinoTabScaffold(
        controller: controller,
        backgroundColor: Colors.black87,
        tabBar: CupertinoTabBar(
          iconSize: 30,
          currentIndex: currentIndex,
          onTap: (index) => setState(() => currentIndex = index),
          items: const [
            BottomNavigationBarItem(icon: Icon(Icons.home, size: 25)),
            BottomNavigationBarItem(icon: Icon(Icons.store, size: 25,)),
            BottomNavigationBarItem(icon: Icon(Icons.shopping_bag, size: 25)),
            BottomNavigationBarItem(icon: Icon(Icons.person, size: 25)),
          ],
        ),
        tabBuilder: (BuildContext context, int index) {
          switch (index) {
            case 0:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: HomePage(),
                  );
                },
              );
            case 1:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: CatalogPage(),
                  );
                },
              );
            case 2:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: ShoppingBag(),
                  );
                },
              );
            case 3:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: UserProfileScaffold(),
                  );
                },
              );
            default:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: HomePage(),
                  );
                },
              );
          }
        });

</code>```

Body:
I use CupertinoTabBar how can I make it so that when another tab is selected, the tab page reloads and does not save its state

CupertinoTabScaffold(
        controller: controller,
        backgroundColor: Colors.black87,
        tabBar: CupertinoTabBar(
          iconSize: 30,
          currentIndex: currentIndex,
          onTap: (index) => setState(() => currentIndex = index),
          items: const [
            BottomNavigationBarItem(icon: Icon(Icons.home, size: 25)),
            BottomNavigationBarItem(icon: Icon(Icons.store, size: 25,)),
            BottomNavigationBarItem(icon: Icon(Icons.shopping_bag, size: 25)),
            BottomNavigationBarItem(icon: Icon(Icons.person, size: 25)),
          ],
        ),
        tabBuilder: (BuildContext context, int index) {
          switch (index) {
            case 0:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: HomePage(),
                  );
                },
              );
            case 1:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: CatalogPage(),
                  );
                },
              );
            case 2:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: ShoppingBag(),
                  );
                },
              );
            case 3:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: UserProfileScaffold(),
                  );
                },
              );
            default:
              return CupertinoTabView(
                builder: (BuildContext context) {
                  return CupertinoPageScaffold(
                    resizeToAvoidBottomInset: false,
                    child: HomePage(),
                  );
                },
              );
          }
        });


问:
How to check if the pull request changes have fixed a bug on SonarQube?
The Sonar Qube has reported some bugs in Overall Code on the long-live branches (main, release...). So, I fixed those issues then I created a Pull Request to a long-live branch. The Sonar Qube has analyzed my new PR and is not showing any report regarding the bug issues, neither on the old code nor on my new fixes. The report shows 0 Bugs new Bugs. How to know if my changes have fixed the bugs?

I know that the PR analysis shows only stuff regarding the new code. But I'd like to know if my changes have been effective.


问:
Mapbox dash line animation
I am exploring ways to illustrate a directional walking route via animating dots (that are all smoothly moving in 1 direction) and I wanted to see if there is anything that I am missing. I am running into a similar issue in "@react-native-mapbox-gl/maps": "8.5.0" with MapboxGL.LineLayer and then updating style.lineDasharray via setInterval to simulate an animation. The issue also seem to persist in mapbox-gl-js/v0.34.

It appears that the animation looks correct when using lineCap: 'butt', but it breaks down when I switch to lineCap: 'round'. Even when it works correctly, you can see a 1 pixel static lines with line-cap: "butt".  I assume it's it looks broken when we switch to "round" because the library code attempts to create a round shape and adds left & right pieces. Basically, it looks like some dashes are moving and some are static (see attached videos). Any tricks to make this into a smooth mono-directional animation? Here is a code snippet that demonstrates the issue.

https://codepen.io/prototypersf/pen/XWYwBYN?editors=1010

```<code><!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8' />
    <title></title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.js'></script>
    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.css' rel='stylesheet' />
    <style>
        body { margin:0; padding:0; }
        #map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
</head>
<body>

<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibHVjYXN3b2oiLCJhIjoiY2l5Nmg4cWU1MDA0ejMzcDJtNHJmZzJkcyJ9.WhcEdTYQH6sSw2pm0RSP9Q';
var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v9',
    center: [-122.486052, 37.830348],
    zoom: 15
});

map.on('load', function () {

    map.addLayer({
        "id": "route",
        "type": "line",
        "source": {
            "type": "geojson",
            "data": {
                "type": "Feature",
                "properties": {},
                "geometry": {
                    "type": "LineString",
                    "coordinates": [
                        [-122.48369693756104, 37.83381888486939],
                        [-122.48348236083984, 37.83317489144141],
                        [-122.48339653015138, 37.83270036637107],
                        [-122.48356819152832, 37.832056363179625],
                        [-122.48404026031496, 37.83114119107971],
                        [-122.48404026031496, 37.83049717427869],
                        [-122.48348236083984, 37.829920943955045],
                        [-122.48356819152832, 37.82954808664175],
                        [-122.48507022857666, 37.82944639795659],
                        [-122.48610019683838, 37.82880236636284],
                        [-122.48695850372314, 37.82931081282506],
                        [-122.48700141906738, 37.83080223556934],
                        [-122.48751640319824, 37.83168351665737],
                        [-122.48803138732912, 37.832158048267786],
                        [-122.48888969421387, 37.83297152392784],
                        [-122.48987674713133, 37.83263257682617],
                    ]
                }
            }
        },
        "layout": {
            //"line-join": "round",
            "line-cap": "round"
        },
        "paint": {
            "line-color": "#888",
            "line-width": 6
        }
    });

    var dashLength = 1;
    var gapLength = 13;
    // We divide the animation up into 40 steps to make careful use of the finite space in LineAtlas    //
    var steps = 24;
    // A # of steps proportional to the dashLength are devoted to manipulating the dash
    var dashSteps = steps * dashLength / (gapLength + dashLength);
    // A # of steps proportional to the gapLength are devoted to manipulating the gap
    var gapSteps = steps - dashSteps;

    // The current step #
    var step = 0;

    setInterval(function() {
        step = step + 1;
        if (step >= steps) step = 0;

        var t, a, b, c, d;
        if (step < dashSteps) {
          t = step / dashSteps;
          a = (1 - t) * dashLength;
          b = gapLength;
          c = t * dashLength;
          d = 0;
        } else {
          t = (step - dashSteps) / (gapSteps);
          a = 0;
          b = (1 - t) * gapLength;
          c = dashLength;
          d = t * gapLength;
        }

        map.setPaintProperty("route", "line-dasharray", [a, b, c, d]);
    }, 125);
  map.setPaintProperty("route", "line-dasharray", [1, 2, 1, 4]);
});
</script>

</body>
</html>

</code>```

Title: Mapbox dash line animation

Body:
I am exploring ways to illustrate a directional walking route via animating dots (that are all smoothly moving in 1 direction) and I wanted to see if there is anything that I am missing. I am running into a similar issue in "@react-native-mapbox-gl/maps": "8.5.0" with MapboxGL.LineLayer and then updating style.lineDasharray via setInterval to simulate an animation. The issue also seem to persist in mapbox-gl-js/v0.34.

It appears that the animation looks correct when using lineCap: 'butt', but it breaks down when I switch to lineCap: 'round'. Even when it works correctly, you can see a 1 pixel static lines with line-cap: "butt".  I assume it's it looks broken when we switch to "round" because the library code attempts to create a round shape and adds left & right pieces. Basically, it looks like some dashes are moving and some are static (see attached videos). Any tricks to make this into a smooth mono-directional animation? Here is a code snippet that demonstrates the issue.

https://codepen.io/prototypersf/pen/XWYwBYN?editors=1010

<!DOCTYPE html>

    <meta charset='utf-8' />
    <title></title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.css' rel='stylesheet' />


问:
Cannot use import statement outside a module in Next.js while using Redux
So whenever I am using redux-toolkit with any of the components, it throws me an error that I can't use an import statement outside. I have tried changing my package.  json file also to type='module'

Error in terminal

```<code>import Provider from './components/Provider';
location of error :- \node_modules\react-redux\es\exports.js
</code>```

used only basic redux like this

```<code>const shownDown = useSelector((state: RootState) => state.navbar.isShown);
  const infoDown = useSelector(
    (state: RootState) => state.navbar.isUsefulInfoShown
  );
</code>```

Any help would be appreciate other wise have to shift back to CRA

Body:
So whenever I am using redux-toolkit with any of the components, it throws me an error that I can't use an import statement outside. I have tried changing my package.  json file also to type='module'

Error in terminal

import Provider from './components/Provider';
location of error :- \node_modules\react-redux\es\exports.js

used only basic redux like this

const shownDown = useSelector((state: RootState) => state.navbar.isShown);
  const infoDown = useSelector(
    (state: RootState) => state.navbar.isUsefulInfoShown
  );

Any help would be appreciate other wise have to shift back to CRA


问:
Unable to mock FullCalendar's getApi() that returns a mock Calendar (Angular & Jasmine, Karma)
I'm trying to write test cases around a component that contains my FullCalendar component in Angular.

I've written karma tests using a MockFullCalendar that extends FullCalendar and have been successfully able to mock the getApi().view calls for getting fake active start and active end dates. But when I use the same method for getApi().getResources() and getApi.getResourceById(id) I get this error when running tests

```<code>error TS2339: Property 'getResourceById' does not exist on type 'Calendar'.
const calendarResource = this.calendar.getApi().getResourceById(resourceIdAssignedToEvent);
</code>```

Here are my mock classes

```<code>export class MockFullCalendarComponent extends FullCalendarComponent {
  getApi(): any {
    return {};
  }
}

export class MockCalendarApi extends CalendarApi {
  getResources(): any {
    return [];
  }
  getResourceById(resourceId: any): any {
    return {};
  }
}

export class MockCalendar extends MockCalendarApi {
  get view(): any {
    return {
      get activeStart(): any {
        return new Date();
      },
      get activeEnd(): any {
        return new Date();
      }
    };
  }
}
</code>```

The following is how I was able to successfully mock the getApi().view

```<code>export class MockFullCalendarComponent extends FullCalendarComponent {
   getApi(): any {
     return {
       view: {
         activeStart: new Date(),
         activeEnd: new Date()
       }
     };
   }
 }
</code>```

Using the same pattern somehow does not work for the Calendar and CalendarApi classes. I'm not sure if this is because there is a class and an interface of the same name (CalendarApi) in FullCalendar common and only the interface contains these two methods.

I'm using Angular 12 and FullCalendar V5.

I've tried mocking as described above, tried different ways to provide my mock classes to the TestBed for injection.
My test case does not run at all, because these methods aren't detected somehow, none of the existing tests run at all, its almost like the whole initialization of the test case fails at this and I'm not sure how else I can force the spec to use my mock classes that contains mock implementations of those methods.

Body:
I'm trying to write test cases around a component that contains my FullCalendar component in Angular.

I've written karma tests using a MockFullCalendar that extends FullCalendar and have been successfully able to mock the getApi().view calls for getting fake active start and active end dates. But when I use the same method for getApi().getResources() and getApi.getResourceById(id) I get this error when running tests

error TS2339: Property 'getResourceById' does not exist on type 'Calendar'.
const calendarResource = this.calendar.getApi().getResourceById(resourceIdAssignedToEvent);

Here are my mock classes

export class MockFullCalendarComponent extends FullCalendarComponent {
  getApi(): any {
    return {};
  }
}

export class MockCalendarApi extends CalendarApi {
  getResources(): any {
    return [];
  }
  getResourceById(resourceId: any): any {
    return {};
  }
}

export class MockCalendar extends MockCalendarApi {
  get view(): any {
    return {
      get activeStart(): any {
        return new Date();
      },
      get activeEnd(): any {
        return new Date();
      }
    };
  }
}

The following is how I was able to successfully mock the getApi().view

export class MockFullCalendarComponent extends FullCalendarComponent {
   getApi(): any {
     return {
       view: {
         activeStart: new Date(),
         activeEnd: new Date()
       }
     };
   }
 }

Using the same pattern somehow does not work for the Calendar and CalendarApi classes. I'm not sure if this is because there is a class and an interface of the same name (CalendarApi) in FullCalendar common and only the interface contains these two methods.

I'm using Angular 12 and FullCalendar V5.

I've tried mocking as described above, tried different ways to provide my mock classes to the TestBed for injection.
My test case does not run at all, because these methods aren't detected somehow, none of the existing tests run at all, its almost like the whole initialization of the test case fails at this and I'm not sure how else I can force the spec to use my mock classes that contains mock implementations of those methods.


问:
Testing android flow
I am trying to unit test my android viewmodel:

inside of it I have a few init calls:

```<code>  init {
        executeUseCase(useCases.GetUserResults())
        executeUseCase(useCases.GetUserInfectionDetectionLinkUseCase())
    }
</code>```

Now I want to test that my viewmodel actually gets data and sets the view state. But these "calls" returns a flow:

```<code>return  flow {
    DataState.Data(useCase, response)
}
</code>```

Note that I have dumbed down the actual code but in general these returns a flow.

In my test I have the a @Before

```<code>    @Before
fun setUp() {
    logger = mockk<Logger>()
    useCases = useCases(RepositoryMock())
    userUseCases = mockk<UserUseCases>()

    viewModel =  MyViewModel(logger = logger,useCases, userUseCases);
}
</code>```

How can I ensure that the viewmodel gets the databack from the repository (IE the flow is complete) before I begin my test?

Title: Testing android flow

Body:
I am trying to unit test my android viewmodel:

inside of it I have a few init calls:

  init {
        executeUseCase(useCases.GetUserResults())
        executeUseCase(useCases.GetUserInfectionDetectionLinkUseCase())
    }

Now I want to test that my viewmodel actually gets data and sets the view state. But these "calls" returns a flow:

return  flow {
    DataState.Data(useCase, response)
}

Note that I have dumbed down the actual code but in general these returns a flow.

In my test I have the a @Before

    @Before
fun setUp() {
    logger = mockk<Logger>()
    useCases = useCases(RepositoryMock())
    userUseCases = mockk<UserUseCases>()

    viewModel =  MyViewModel(logger = logger,useCases, userUseCases);
}

How can I ensure that the viewmodel gets the databack from the repository (IE the flow is complete) before I begin my test?


问:
Aspnetcore 3.1 Date control and links sending differing formats
I have been asked to look at a form on an aspnetcore 3.1 view, although this hopefully will change to aspnetcore 6.0 soon using a standard datetimepicker

```<code><input class="datetimePicker" asp-for="SubmittedDateFrom" asp-format="{0:dd/MM/yyyyTHH:mm}" />
</code>```

This gives  ModelState values like "2022-11-01T18:27" and in the endpoint a value of {01/11/2022 18:27:00} and the date is preserved in the input.

There are various sort columns and paging that use a link to submit the data e.g.

```<code><a asp-controller="Submissions"
                               asp-action="Index"
                               asp-route-SortField="Submitted"
                               asp-route-SortDir="@Model.SortDir"
                               asp-route-SortDirNext="@Model.SortDirNext"
                               asp-route-PageSize="@Model.PageSize"
                               asp-route-PageNumber="@Model.PageNumber"
                               asp-route-SubmittedDateFrom="@Model.SubmittedDateFrom"
                               asp-route-SubmittedDateTo="@Model.SubmittedDateTo">
                                @Html.DisplayNameFor(model => model.First().Submitted)
                            </a>
</code>```

The links call the same endpoint as the form submit.

When that link is clicked the ModelState values like "01/11/2022 18:27:00" and in the endpoint a value of {01/11/2022 18:27:00} and the date is lost in the input.

What am I looking at that is incorrect and how can I therefore fix this.  I have tried custom date validators, but that was not the solution.  I could hard tweak the ModelState to stop losing the input field value but that has to be wrong ad I have not manged to google something that explains this.

Note: The endpoint does not use a model its passed like this

```<code>public async Task<ActionResult<IEnumerable<Submission>>> Index(string SortField = "Changed",
                            SortDirection SortDir = SortDirection.Descending,
                            SortDirection? SortDirNext = null,
                            int PageSize = 20,
                            int PageNumber = 1,
                            DateTime? SubmittedDateFrom = null,
                            DateTime? SubmittedDateTo = null)

</code>```

Body:
I have been asked to look at a form on an aspnetcore 3.1 view, although this hopefully will change to aspnetcore 6.0 soon using a standard datetimepicker

<input class="datetimePicker" asp-for="SubmittedDateFrom" asp-format="{0:dd/MM/yyyyTHH:mm}" />

This gives  ModelState values like "2022-11-01T18:27" and in the endpoint a value of {01/11/2022 18:27:00} and the date is preserved in the input.

There are various sort columns and paging that use a link to submit the data e.g.

<a asp-controller="Submissions"
                               asp-action="Index"
                               asp-route-SortField="Submitted"
                               asp-route-SortDir="@Model.SortDir"
                               asp-route-SortDirNext="@Model.SortDirNext"
                               asp-route-PageSize="@Model.PageSize"
                               asp-route-PageNumber="@Model.PageNumber"
                               asp-route-SubmittedDateFrom="@Model.SubmittedDateFrom"
                               asp-route-SubmittedDateTo="@Model.SubmittedDateTo">
                                @Html.DisplayNameFor(model => model.First().Submitted)

The links call the same endpoint as the form submit.

When that link is clicked the ModelState values like "01/11/2022 18:27:00" and in the endpoint a value of {01/11/2022 18:27:00} and the date is lost in the input.

What am I looking at that is incorrect and how can I therefore fix this.  I have tried custom date validators, but that was not the solution.  I could hard tweak the ModelState to stop losing the input field value but that has to be wrong ad I have not manged to google something that explains this.

Note: The endpoint does not use a model its passed like this

public async Task<ActionResult<IEnumerable<Submission>>> Index(string SortField = "Changed",
                            SortDirection SortDir = SortDirection.Descending,
                            SortDirection? SortDirNext = null,
                            int PageSize = 20,
                            int PageNumber = 1,
                            DateTime? SubmittedDateFrom = null,
                            DateTime? SubmittedDateTo = null)