问:
Error when connection to mongodb version 6
I upgraded play-reactivemongo driver form version 0.16.2-play27 to version 1.1.0-play27-RC6
After fixing the code issues, I get an "Fails to send a isMaster request" error when trying to run the app against MongoDB ver 6 server with the same connection string as earlier when using MongoDB server ver 4.
Did anyone counter something like this issue? Thanks

Environment: Play 2.7.0
Scala 2.11.12
Mongo Server 6.0.3
SBT 0.13.18

```<code>Connection string: "mongodb+srv://<user>:<password>@general.foba0.mongodb.net/envoy4?ssl=true&authenticationDatabase=admin&authenticationMechanism=scram-sha1&readPreference=primaryPreferred&rm.nbChannelsPerNode=25&rm.failover=remote&rm.tcpNoDelay=true&rm.keepAlive=true&heartbeatFrequencyMS=5000"
</code>```
```<code>
--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

Server started, use Cmd+P to stop

2022-12-13 09:57:14,186 - [warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
2022-12-13 09:57:14,569 - [info] r.a.MongoConnection - Connection option 'replicaSet' is ignored: determined from servers response
2022-12-13 09:57:14,574 - [info] r.a.MongoConnection - Connection option 'authenticationDatabase' is deprecated in favor of 'authSource'
2022-12-13 09:57:16,508 - [warn] application - application.conf @ file:/Users/Yuri/devroot/core/target/scala-2.11/classes/application.conf: 8: play.crypto.secret is deprecated, use play.http.secret.key instead
2022-12-13 09:57:16,543 - [warn] application - application.langs is deprecated, use play.i18n.langs instead
2022-12-13 09:57:16,786 - [info] e.d.CheckoutLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection checkoutSessionLog by object envoy.data.CheckoutLogPersister@7a4db7ed
2022-12-13 09:57:16,850 - [info] r.api.Driver - [Supervisor-1] Creating connection: envoy4
2022-12-13 09:57:16,887 - [info] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Starting the MongoDBSystem
2022-12-13 09:57:16,910 - [info] r.c.netty.Pack - Instantiated reactivemongo.core.netty.Pack
2022-12-13 09:57:17,271 - [info] e.d.QuoteLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection quoteLog by object envoy.data.QuoteLogPersister@24ba159e
2022-12-13 09:57:17,280 - [info] e.d.OrderLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection orderLog by object envoy.data.OrderLogPersister@13ba1fb0
2022-12-13 09:57:17,284 - [info] e.d.AlipayLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipayLog by object envoy.data.AlipayLogPersister@572a2863
2022-12-13 09:57:17,285 - [info] e.d.AlipayPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipay by object envoy.data.AlipayPersister@20a0e45d
2022-12-13 09:57:17,286 - [info] e.d.AlipayAsyncPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipayAsync by object envoy.data.AlipayAsyncPersister@6b12437a
2022-12-13 09:57:17,288 - [info] e.d.AlipayStatusPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipayStatus by object envoy.data.AlipayStatusPersister@2009a18
2022-12-13 09:57:17,301 - [info] e.d.AltPayLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection altPayLog by object envoy.data.AltPayLogPersister@41f92064
2022-12-13 09:57:17,303 - [info] e.d.ViewStatePersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>)), Index(List((mapping,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection viewState by object envoy.data.ViewStatePersister@389159bd
2022-12-13 09:57:17,304 - [info] e.d.ViewStatePersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>)), Index(List((mapping,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection viewState by object envoy.data.ViewStatePersister@1a797a7d
2022-12-13 09:57:17,497 - [info] play.api.Play - Application started (Dev)
2022-12-13 09:57:17,500 - [warn] play.api.Play -
You are using the deprecated global state to set and access the current running application. If you
need an instance of Application, set play.allowGlobalApplication = false and use Dependency Injection instead.

2022-12-13 09:57:17,754 - [trace] e.f.f.RequestLoggingFilter - headers=Map(Host -> localhost:9000, Accept -> text/css,*/*;q=0.1, Cookie -> Idea-4047ded2=367b6c6c-5394-4485-8041-f02bba186f6e, Referer -> http://localhost:9000/, sec-ch-ua -> "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108", Connection -> keep-alive, User-Agent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36, If-None-Match -> "4ae3bb8b28e944372535986873b374cf65caad13", Remote-Address -> 0:0:0:0:0:0:0:1:50853, Sec-Fetch-Dest -> style, Sec-Fetch-Mode -> no-cors, Sec-Fetch-Site -> same-origin, Timeout-Access -> <function1>, Accept-Encoding -> gzip, deflate, br, Accept-Language -> en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,he-IL;q=0.6,he;q=0.5, Raw-Request-URI -> /assets/stylesheets/main.css, sec-ch-ua-mobile -> ?0, Tls-Session-Info -> [Session-1, SSL_NULL_WITH_NULL_NULL], If-Modified-Since -> Tue, 08 Dec 2020 08:05:34 GMT, sec-ch-ua-platform -> "macOS"), path=/assets/stylesheets/main.css, method=GET
2022-12-13 09:57:17,761 - [trace] e.f.f.RequestLoggingFilter - headers=Map(Host -> localhost:9000, Accept -> */*, Cookie -> Idea-4047ded2=367b6c6c-5394-4485-8041-f02bba186f6e, Referer -> http://localhost:9000/, sec-ch-ua -> "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108", Connection -> keep-alive, User-Agent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36, Remote-Address -> 0:0:0:0:0:0:0:1:50855, Sec-Fetch-Dest -> script, Sec-Fetch-Mode -> no-cors, Sec-Fetch-Site -> same-origin, Timeout-Access -> <function1>, Accept-Encoding -> gzip, deflate, br, Accept-Language -> en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,he-IL;q=0.6,he;q=0.5, Raw-Request-URI -> /assets/javascripts/jquery-1.9.0.min.js, sec-ch-ua-mobile -> ?0, Tls-Session-Info -> [Session-1, SSL_NULL_WITH_NULL_NULL], sec-ch-ua-platform -> "macOS"), path=/assets/javascripts/jquery-1.9.0.min.js, method=GET
2022-12-13 09:57:18,060 - [trace] e.f.f.RequestLoggingFilter - headers=Map(Host -> localhost:9000, Accept -> image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8, Cookie -> Idea-4047ded2=367b6c6c-5394-4485-8041-f02bba186f6e, Referer -> http://localhost:9000/, sec-ch-ua -> "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108", Connection -> keep-alive, User-Agent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36, If-None-Match -> "4e502da8bdd7ae9dbcba1d69b8e84a24c8bb1218", Remote-Address -> 0:0:0:0:0:0:0:1:50855, Sec-Fetch-Dest -> image, Sec-Fetch-Mode -> no-cors, Sec-Fetch-Site -> same-origin, Timeout-Access -> <function1>, Accept-Encoding -> gzip, deflate, br, Accept-Language -> en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,he-IL;q=0.6,he;q=0.5, Raw-Request-URI -> /assets/images/favicon.png, sec-ch-ua-mobile -> ?0, Tls-Session-Info -> [Session-1, SSL_NULL_WITH_NULL_NULL], If-Modified-Since -> Tue, 08 Dec 2020 08:05:34 GMT, sec-ch-ua-platform -> "macOS"), path=/assets/images/favicon.png, method=GET
2022-12-13 09:57:20,034 - [info] e.d.AlipayStatusPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipayStatus
2022-12-13 09:57:20,035 - [info] e.d.AlipayAsyncPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipayAsync
2022-12-13 09:57:20,035 - [info] e.d.AltPayLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on altPayLog
2022-12-13 09:57:20,034 - [info] e.d.AlipayLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipayLog
2022-12-13 09:57:20,033 - [info] e.d.ViewStatePersister - method=ensureIndexes, description='succcesfully ensured indexes on viewState
2022-12-13 09:57:20,050 - [info] e.d.OrderLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on orderLog
2022-12-13 09:57:20,052 - [info] e.d.AlipayPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipay
2022-12-13 09:57:20,052 - [info] e.d.ViewStatePersister - method=ensureIndexes, description='succcesfully ensured indexes on viewState
2022-12-13 09:57:20,053 - [info] e.d.CheckoutLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on checkoutSessionLog
2022-12-13 09:57:20,063 - [info] e.d.QuoteLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on quoteLog
2022-12-13 09:57:52,371 - [error] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Fails to send a isMaster request to cbr-atlas-dev-general-shard-00-00.foba0.mongodb.net:27017 (channel #508fd418)
reactivemongo.io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:860)
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:799)
    at reactivemongo.io.netty.handler.ssl.SslHandler.flush(SslHandler.java:780)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742)
2022-12-13 09:57:52,371 - [error] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Fails to send a isMaster request to cbr-atlas-dev-general-shard-00-01.foba0.mongodb.net:27017 (channel #392ce790)
reactivemongo.io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:860)
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:799)
    at reactivemongo.io.netty.handler.ssl.SslHandler.flush(SslHandler.java:780)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742)
2022-12-13 09:57:52,371 - [error] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Fails to send a isMaster request to cbr-atlas-dev-general-shard-00-02.foba0.mongodb.net:27017 (channel #f701a0f0)
reactivemongo.io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:860)
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:799)
    at reactivemongo.io.netty.handler.ssl.SslHandler.flush(SslHandler.java:780)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742)
2022-12-13 09:57:52,375 - [warn] r.c.p.MongoHandler - [Supervisor-1/envoy4] Channel is closed under 12838583ns: cbr-atlas-dev-general-shard-00-01.foba0.mongodb.net/192.168.153.113:27017; Please check network connectivity and the status of the set. (channel [id: 0x392ce790, L:0.0.0.0/0.0.0.0:50857 ! R:cbr-atlas-dev-general-shard-00-01.foba0.mongodb.net/192.168.153.113:27017])
2022-12-13 09:57:52,375 - [warn] r.c.p.MongoHandler - [Supervisor-1/envoy4] Channel is closed under 12599708ns: cbr-atlas-dev-general-shard-00-00.foba0.mongodb.net/192.168.153.186:27017; Please check network connectivity and the status of the set. (channel [id: 0x508fd418, L:0.0.0.0/0.0.0.0:50859 ! R:cbr-atlas-dev-general-shard-00-00.foba0.mongodb.net/192.168.153.186:27017])
2022-12-13 09:57:52,376 - [warn] r.c.p.MongoHandler - [Supervisor-1/envoy4] Channel is closed under 12856208ns: cbr-atlas-dev-general-shard-00-02.foba0.mongodb.net/192.168.153.43:27017; Please check network connectivity and the status of the set. (channel [id: 0xf701a0f0, L:0.0.0.0/0.0.0.0:50860 ! R:cbr-atlas-dev-general-shard-00-02.foba0.mongodb.net/192.168.153.43:27017])
2022-12-13 09:57:52,390 - [warn] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] The entire node set is unreachable, is there a network problem?

</code>```

Body:
I upgraded play-reactivemongo driver form version 0.16.2-play27 to version 1.1.0-play27-RC6
After fixing the code issues, I get an "Fails to send a isMaster request" error when trying to run the app against MongoDB ver 6 server with the same connection string as earlier when using MongoDB server ver 4.
Did anyone counter something like this issue? Thanks

Environment: Play 2.7.0
Scala 2.11.12
Mongo Server 6.0.3
SBT 0.13.18

Connection string: "mongodb+srv://<user>:<password>@general.foba0.mongodb.net/envoy4?ssl=true&authenticationDatabase=admin&authenticationMechanism=scram-sha1&readPreference=primaryPreferred&rm.nbChannelsPerNode=25&rm.failover=remote&rm.tcpNoDelay=true&rm.keepAlive=true&heartbeatFrequencyMS=5000"

--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

Server started, use Cmd+P to stop

2022-12-13 09:57:14,186 - [warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
2022-12-13 09:57:14,569 - [info] r.a.MongoConnection - Connection option 'replicaSet' is ignored: determined from servers response
2022-12-13 09:57:14,574 - [info] r.a.MongoConnection - Connection option 'authenticationDatabase' is deprecated in favor of 'authSource'
2022-12-13 09:57:16,508 - [warn] application - application.conf @ file:/Users/Yuri/devroot/core/target/scala-2.11/classes/application.conf: 8: play.crypto.secret is deprecated, use play.http.secret.key instead
2022-12-13 09:57:16,543 - [warn] application - application.langs is deprecated, use play.i18n.langs instead
2022-12-13 09:57:16,786 - [info] e.d.CheckoutLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection checkoutSessionLog by object envoy.data.CheckoutLogPersister@7a4db7ed
2022-12-13 09:57:16,850 - [info] r.api.Driver - [Supervisor-1] Creating connection: envoy4
2022-12-13 09:57:16,887 - [info] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Starting the MongoDBSystem
2022-12-13 09:57:16,910 - [info] r.c.netty.Pack - Instantiated reactivemongo.core.netty.Pack
2022-12-13 09:57:17,271 - [info] e.d.QuoteLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection quoteLog by object envoy.data.QuoteLogPersister@24ba159e
2022-12-13 09:57:17,280 - [info] e.d.OrderLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection orderLog by object envoy.data.OrderLogPersister@13ba1fb0
2022-12-13 09:57:17,284 - [info] e.d.AlipayLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipayLog by object envoy.data.AlipayLogPersister@572a2863
2022-12-13 09:57:17,285 - [info] e.d.AlipayPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipay by object envoy.data.AlipayPersister@20a0e45d
2022-12-13 09:57:17,286 - [info] e.d.AlipayAsyncPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipayAsync by object envoy.data.AlipayAsyncPersister@6b12437a
2022-12-13 09:57:17,288 - [info] e.d.AlipayStatusPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection alipayStatus by object envoy.data.AlipayStatusPersister@2009a18
2022-12-13 09:57:17,301 - [info] e.d.AltPayLogPersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection altPayLog by object envoy.data.AltPayLogPersister@41f92064
2022-12-13 09:57:17,303 - [info] e.d.ViewStatePersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>)), Index(List((mapping,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection viewState by object envoy.data.ViewStatePersister@389159bd
2022-12-13 09:57:17,304 - [info] e.d.ViewStatePersister - ensuring indexes List(Index(List((createDate,desc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<non-empty>)), Index(List((key,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>)), Index(List((mapping,asc)),None,false,false,None,false,None,None,None,None,None,None,None,None,None,None,None,None,None,None,BSONDocument(<empty>))) exist for collection viewState by object envoy.data.ViewStatePersister@1a797a7d
2022-12-13 09:57:17,497 - [info] play.api.Play - Application started (Dev)
2022-12-13 09:57:17,500 - [warn] play.api.Play -
You are using the deprecated global state to set and access the current running application. If you
need an instance of Application, set play.allowGlobalApplication = false and use Dependency Injection instead.

2022-12-13 09:57:17,754 - [trace] e.f.f.RequestLoggingFilter - headers=Map(Host -> localhost:9000, Accept -> text/css,*/*;q=0.1, Cookie -> Idea-4047ded2=367b6c6c-5394-4485-8041-f02bba186f6e, Referer -> http://localhost:9000/, sec-ch-ua -> "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108", Connection -> keep-alive, User-Agent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36, If-None-Match -> "4ae3bb8b28e944372535986873b374cf65caad13", Remote-Address -> 0:0:0:0:0:0:0:1:50853, Sec-Fetch-Dest -> style, Sec-Fetch-Mode -> no-cors, Sec-Fetch-Site -> same-origin, Timeout-Access -> <function1>, Accept-Encoding -> gzip, deflate, br, Accept-Language -> en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,he-IL;q=0.6,he;q=0.5, Raw-Request-URI -> /assets/stylesheets/main.css, sec-ch-ua-mobile -> ?0, Tls-Session-Info -> [Session-1, SSL_NULL_WITH_NULL_NULL], If-Modified-Since -> Tue, 08 Dec 2020 08:05:34 GMT, sec-ch-ua-platform -> "macOS"), path=/assets/stylesheets/main.css, method=GET
2022-12-13 09:57:17,761 - [trace] e.f.f.RequestLoggingFilter - headers=Map(Host -> localhost:9000, Accept -> */*, Cookie -> Idea-4047ded2=367b6c6c-5394-4485-8041-f02bba186f6e, Referer -> http://localhost:9000/, sec-ch-ua -> "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108", Connection -> keep-alive, User-Agent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36, Remote-Address -> 0:0:0:0:0:0:0:1:50855, Sec-Fetch-Dest -> script, Sec-Fetch-Mode -> no-cors, Sec-Fetch-Site -> same-origin, Timeout-Access -> <function1>, Accept-Encoding -> gzip, deflate, br, Accept-Language -> en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,he-IL;q=0.6,he;q=0.5, Raw-Request-URI -> /assets/javascripts/jquery-1.9.0.min.js, sec-ch-ua-mobile -> ?0, Tls-Session-Info -> [Session-1, SSL_NULL_WITH_NULL_NULL], sec-ch-ua-platform -> "macOS"), path=/assets/javascripts/jquery-1.9.0.min.js, method=GET
2022-12-13 09:57:18,060 - [trace] e.f.f.RequestLoggingFilter - headers=Map(Host -> localhost:9000, Accept -> image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8, Cookie -> Idea-4047ded2=367b6c6c-5394-4485-8041-f02bba186f6e, Referer -> http://localhost:9000/, sec-ch-ua -> "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108", Connection -> keep-alive, User-Agent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36, If-None-Match -> "4e502da8bdd7ae9dbcba1d69b8e84a24c8bb1218", Remote-Address -> 0:0:0:0:0:0:0:1:50855, Sec-Fetch-Dest -> image, Sec-Fetch-Mode -> no-cors, Sec-Fetch-Site -> same-origin, Timeout-Access -> <function1>, Accept-Encoding -> gzip, deflate, br, Accept-Language -> en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,he-IL;q=0.6,he;q=0.5, Raw-Request-URI -> /assets/images/favicon.png, sec-ch-ua-mobile -> ?0, Tls-Session-Info -> [Session-1, SSL_NULL_WITH_NULL_NULL], If-Modified-Since -> Tue, 08 Dec 2020 08:05:34 GMT, sec-ch-ua-platform -> "macOS"), path=/assets/images/favicon.png, method=GET
2022-12-13 09:57:20,034 - [info] e.d.AlipayStatusPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipayStatus
2022-12-13 09:57:20,035 - [info] e.d.AlipayAsyncPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipayAsync
2022-12-13 09:57:20,035 - [info] e.d.AltPayLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on altPayLog
2022-12-13 09:57:20,034 - [info] e.d.AlipayLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipayLog
2022-12-13 09:57:20,033 - [info] e.d.ViewStatePersister - method=ensureIndexes, description='succcesfully ensured indexes on viewState
2022-12-13 09:57:20,050 - [info] e.d.OrderLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on orderLog
2022-12-13 09:57:20,052 - [info] e.d.AlipayPersister - method=ensureIndexes, description='succcesfully ensured indexes on alipay
2022-12-13 09:57:20,052 - [info] e.d.ViewStatePersister - method=ensureIndexes, description='succcesfully ensured indexes on viewState
2022-12-13 09:57:20,053 - [info] e.d.CheckoutLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on checkoutSessionLog
2022-12-13 09:57:20,063 - [info] e.d.QuoteLogPersister - method=ensureIndexes, description='succcesfully ensured indexes on quoteLog
2022-12-13 09:57:52,371 - [error] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Fails to send a isMaster request to cbr-atlas-dev-general-shard-00-00.foba0.mongodb.net:27017 (channel #508fd418)
reactivemongo.io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:860)
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:799)
    at reactivemongo.io.netty.handler.ssl.SslHandler.flush(SslHandler.java:780)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742)
2022-12-13 09:57:52,371 - [error] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Fails to send a isMaster request to cbr-atlas-dev-general-shard-00-01.foba0.mongodb.net:27017 (channel #392ce790)
reactivemongo.io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:860)
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:799)
    at reactivemongo.io.netty.handler.ssl.SslHandler.flush(SslHandler.java:780)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742)
2022-12-13 09:57:52,371 - [error] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] Fails to send a isMaster request to cbr-atlas-dev-general-shard-00-02.foba0.mongodb.net:27017 (channel #f701a0f0)
reactivemongo.io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:860)
    at reactivemongo.io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:799)
    at reactivemongo.io.netty.handler.ssl.SslHandler.flush(SslHandler.java:780)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
    at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742)
2022-12-13 09:57:52,375 - [warn] r.c.p.MongoHandler - [Supervisor-1/envoy4] Channel is closed under 12838583ns: cbr-atlas-dev-general-shard-00-01.foba0.mongodb.net/192.168.153.113:27017; Please check network connectivity and the status of the set. (channel [id: 0x392ce790, L:0.0.0.0/0.0.0.0:50857 ! R:cbr-atlas-dev-general-shard-00-01.foba0.mongodb.net/192.168.153.113:27017])
2022-12-13 09:57:52,375 - [warn] r.c.p.MongoHandler - [Supervisor-1/envoy4] Channel is closed under 12599708ns: cbr-atlas-dev-general-shard-00-00.foba0.mongodb.net/192.168.153.186:27017; Please check network connectivity and the status of the set. (channel [id: 0x508fd418, L:0.0.0.0/0.0.0.0:50859 ! R:cbr-atlas-dev-general-shard-00-00.foba0.mongodb.net/192.168.153.186:27017])
2022-12-13 09:57:52,376 - [warn] r.c.p.MongoHandler - [Supervisor-1/envoy4] Channel is closed under 12856208ns: cbr-atlas-dev-general-shard-00-02.foba0.mongodb.net/192.168.153.43:27017; Please check network connectivity and the status of the set. (channel [id: 0xf701a0f0, L:0.0.0.0/0.0.0.0:50860 ! R:cbr-atlas-dev-general-shard-00-02.foba0.mongodb.net/192.168.153.43:27017])
2022-12-13 09:57:52,390 - [warn] r.c.a.MongoDBSystem - [Supervisor-1/envoy4] The entire node set is unreachable, is there a network problem?


来源: stackexchange

问:
Dunn test in R giving "x must contain a numeric vector of data values, or a list of numeric data vectors" error
I'm working with circular data in R for the first time and I'm running into an issue with doing a Dunn's test. I ran a Kruskal-Wallis on the same variables and it worked fine. I checked to make sure the bedtime_WD variable was numeric using the class() function and it came back as "circular" "numeric". Is there a reason I can't do the Dunn's test on this data?

The bedtime_WD variable is reported as 1.15, 0.67, 3.43, etc.
Gender is reported as "F" or "M".

```<code>dunn.test(bedtime_WD,gender)
Error in dunn.test(bedtime_WD, gender) :
  x must contain a numeric vector of data values, or a list of numeric data vectors.
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I'm working with circular data in R for the first time and I'm running into an issue with doing a Dunn's test. I ran a Kruskal-Wallis on the same variables and it worked fine. I checked to make sure the bedtime_WD variable was numeric using the class() function and it came back as "circular" "numeric". Is there a reason I can't do the Dunn's test on this data?

The bedtime_WD variable is reported as 1.15, 0.67, 3.43, etc.
Gender is reported as "F" or "M".

dunn.test(bedtime_WD,gender)
Error in dunn.test(bedtime_WD, gender) :
  x must contain a numeric vector of data values, or a list of numeric data vectors.


问:
Is there a way to give different parameters to a single job in helm charts having parallelism
This is my job configuration when parallelism: 2

```<code>spec:
  ttlSecondsAfterFinished: 60
  backoffLimit: 0
  parallelism: 2
</code>```

Two pods for the same job will come up how do I give two different parameters to the two pods using helm charts

I have tried to do this like this
Below is my helm template for the job.

```<code>{{- range $index := until (.Values.replicaCount | int)  }}
apiVersion: batch/v1
kind: Job
metadata:
  name: alpine-base-{{ index $.Values.ip_range $index }}
  labels:
    app: alpine-app
    chart: alpine-chart
  annotations:
    "helm.sh/hook-delete-policy": "hook-succeeded"
spec:
  ttlSecondsAfterFinished: 60
  backoffLimit: 0
  completionMode: Indexed
  parallelism: {{ $.Values.replicaCount }}
  completions: {{ $.Values.replicaCount }}
  template:
    metadata:
      labels:
        app_type: base
    spec:
      containers:
      - name: alpine-base
        image: "{{ $.Values.global.imageRegistry }}/{{ $.Values.global.image.repository }}:{{ $.Values.global.image.tag }}"
        imagePullPolicy: "{{ $.Values.global.imagePullPolicy }}"
        volumeMounts:
          - mountPath: /scripts
            name: scripts-vol
        env:
        - name: IP
          value: {{ index $.Values.slave_producer.ip_range $index }}
        - name: SLEEP_TIME
          value: {{ $.Values.slave_producer.sleepTime }}
        command: ["/bin/bash"]
        args: ["/scripts/slave_trigger_script.sh"]
        ports:
        - containerPort: 1093
        - containerPort: 5000
        - containerPort: 3445
        resources:
          requests:
            memory: "1024Mi"
            cpu: "1024m"
          limits:
            memory: "1024Mi"
            cpu: "1024m"
      volumes:
        - name: scripts-vol
          configMap:
            name: scripts-configmap
      restartPolicy: Never
{{- end }}
</code>```

But both pods get the same IP in the environment variable

Body:
This is my job configuration when parallelism: 2

spec:
  ttlSecondsAfterFinished: 60
  backoffLimit: 0
  parallelism: 2

Two pods for the same job will come up how do I give two different parameters to the two pods using helm charts

I have tried to do this like this
Below is my helm template for the job.

{{- range $index := until (.Values.replicaCount | int)  }}
apiVersion: batch/v1
kind: Job
metadata:
  name: alpine-base-{{ index $.Values.ip_range $index }}
  labels:
    app: alpine-app
    chart: alpine-chart
  annotations:
    "helm.sh/hook-delete-policy": "hook-succeeded"
spec:
  ttlSecondsAfterFinished: 60
  backoffLimit: 0
  completionMode: Indexed
  parallelism: {{ $.Values.replicaCount }}
  completions: {{ $.Values.replicaCount }}
  template:
    metadata:
      labels:
        app_type: base
    spec:
      containers:
      - name: alpine-base
        image: "{{ $.Values.global.imageRegistry }}/{{ $.Values.global.image.repository }}:{{ $.Values.global.image.tag }}"
        imagePullPolicy: "{{ $.Values.global.imagePullPolicy }}"
        volumeMounts:
          - mountPath: /scripts
            name: scripts-vol
        env:
        - name: IP
          value: {{ index $.Values.slave_producer.ip_range $index }}
        - name: SLEEP_TIME
          value: {{ $.Values.slave_producer.sleepTime }}
        command: ["/bin/bash"]
        args: ["/scripts/slave_trigger_script.sh"]
        ports:
        - containerPort: 1093
        - containerPort: 5000
        - containerPort: 3445
        resources:
          requests:
            memory: "1024Mi"
            cpu: "1024m"
          limits:
            memory: "1024Mi"
            cpu: "1024m"
      volumes:
        - name: scripts-vol
          configMap:
            name: scripts-configmap
      restartPolicy: Never
{{- end }}

But both pods get the same IP in the environment variable


问:
JsonPath create from path on the fly
I'm using https://github.com/json-path/JsonPath, I want to set fields that might not be yet set in the document. For example: doc.set(JsonPath.compile("$.some.array[0].value"), "abc"); on an {} document would result in:

```<code>{
  "some": {
    "array": [
      {
        "value": "abc"
      }
    ]
  }
}
</code>```

I was thinking of trying to using the the compiled path, and get access to the path tokens to work my way through the document, but it doesn't seem that they are accessible. Is there any good way or alternative way of doing this?

Being able to access the path tokens in order to create fields that are needed

Title: JsonPath create from path on the fly

Body:
I'm using https://github.com/json-path/JsonPath, I want to set fields that might not be yet set in the document. For example: doc.set(JsonPath.compile("$.some.array[0].value"), "abc"); on an {} document would result in:

{
  "some": {
    "array": [
      {
        "value": "abc"
      }
    ]
  }
}

I was thinking of trying to using the the compiled path, and get access to the path tokens to work my way through the document, but it doesn't seem that they are accessible. Is there any good way or alternative way of doing this?

Being able to access the path tokens in order to create fields that are needed


问:
how to state update event(marker) in calendar(flutter)
i'm new in flutter
i'm study about calendar in flutter
have problem about add event
look at my code

```<code>Map<DateTime, List<Event>> events = {};

List<Event> _getEventsForDay(DateTime day) {
    return events[day] ?? [];
  }

void _addCalendar() {
    final DateTime date = DateTime.now();
    events[date] ??= [];
    events[date]!.add(Event(true));
    print(events);
  }
</code>```
```<code>TableCalendar(
    ....
    eventLoader: (day) {
     return _getEventsForDay(day);
    },
...
)
</code>```

_addCalendar() is well run
see print(events) log
https://i.stack.imgur.com/1jALR.png

but calendar no state update...(marker)
markerstyle code exist in my code..

I call _addCalendar() function
so.. calendar update(marker) in today(DateTime.now)

Body:
i'm new in flutter
i'm study about calendar in flutter
have problem about add event
look at my code

Map<DateTime, List<Event>> events = {};

List<Event> _getEventsForDay(DateTime day) {
    return events[day] ?? [];
  }

void _addCalendar() {
    final DateTime date = DateTime.now();
    events[date] ??= [];
    events[date]!.add(Event(true));
    print(events);
  }

TableCalendar(
    ....
    eventLoader: (day) {
     return _getEventsForDay(day);
    },
...
)

_addCalendar() is well run
see print(events) log
https://i.stack.imgur.com/1jALR.png

but calendar no state update...(marker)
markerstyle code exist in my code..

I call _addCalendar() function
so.. calendar update(marker) in today(DateTime.now)


问:
How can I change message template in LogEvent?
I use scopes and structured logs extensively in my code bases. All the logs are then sent to Logstash and can be viewed in Kibana. But I have a problem with Logstash indexes such as that a property with a name must have the same type of value throughout all the logs. As a mitigation I came up with an idea to add suffixes to all my structured logs and scopes, but it's very tiresome and I could easily forget about adding suffixes manually, so I tried to write a custom enricher to add suffixes to property names.

Basically, I want to automatically transform this:

logger.LogInformation("Some log message with a {NamedProperty}", 42);
```
<p>to this</p>
<pre class="lang-cs prettyprint-override"><code>logger.LogInformation("Some log message with a {NamedProperty.MyCustomSuffix}", 42);
</code>```

This enricher searches for all named properties in a log and changes their names in properties dictionary. But I can't find a way to also change the template since it is apparently immutable.

public class NamedPropertiesTransformer : ILogEventEnricher
{
    readonly string _suffix;

    public NamedPropertiesTransformer(string suffix) => _suffix = suffix;

    public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
    {
        var propertyTokenNames = logEvent.MessageTemplate.Tokens
            .Where(_ => _ is PropertyToken {IsPositional: false})
            .Cast<PropertyToken>()
            .Select(_ => _.PropertyName)
            .ToHashSet();

        var properties = logEvent.Properties.Where(_ => propertyTokenNames.Contains(_.Key));

        foreach (var (name, value) in properties)
        {
            logEvent.RemovePropertyIfPresent(name);
            logEvent.AddOrUpdateProperty(new($"{name}.{_suffix}", value));
        }
    }
}
```

Is there a way to somehow achieve that?

Body:
I use scopes and structured logs extensively in my code bases. All the logs are then sent to Logstash and can be viewed in Kibana. But I have a problem with Logstash indexes such as that a property with a name must have the same type of value throughout all the logs. As a mitigation I came up with an idea to add suffixes to all my structured logs and scopes, but it's very tiresome and I could easily forget about adding suffixes manually, so I tried to write a custom enricher to add suffixes to property names.

Basically, I want to automatically transform this:

logger.LogInformation("Some log message with a {NamedProperty}", 42);

to this

logger.LogInformation("Some log message with a {NamedProperty.MyCustomSuffix}", 42);

This enricher searches for all named properties in a log and changes their names in properties dictionary. But I can't find a way to also change the template since it is apparently immutable.

public class NamedPropertiesTransformer : ILogEventEnricher
{
    readonly string _suffix;

    public NamedPropertiesTransformer(string suffix) => _suffix = suffix;

    public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
    {
        var propertyTokenNames = logEvent.MessageTemplate.Tokens
            .Where(_ => _ is PropertyToken {IsPositional: false})
            .Cast<PropertyToken>()
            .Select(_ => _.PropertyName)
            .ToHashSet();

        var properties = logEvent.Properties.Where(_ => propertyTokenNames.Contains(_.Key));

        foreach (var (name, value) in properties)
        {
            logEvent.RemovePropertyIfPresent(name);
            logEvent.AddOrUpdateProperty(new($"{name}.{_suffix}", value));
        }
    }
}

Is there a way to somehow achieve that?


问:
Why doesn't EditText.setRawInputType work anymore for Android 13?
I have found that setRawInputType(InputType.TYPE_CLASS_NUMBER) doesn't change the keyboard to numeric view.

setInputType(InputType.TYPE_CLASS_NUMBER) remains available, but that means it's no longer possible to insert a number like this 4.44E+10 and add a thousands separator due to the removal of any non-digit characters.

Is this a bug or just an innovative solution from Google?


问:
Why does this `join` method call with no arguments succeed?
This Groovy script looks simple enough:

def a = [].join()
println a
```

I would expect it to throw MissingMethodException because join method requires a parameter, if I'm looking at the right one, but it works just fine.
And here is the source code for that method, so the parameter is definitely not optional.
You know where it fails the way I expect it to? In Jenkins, of course.

So, why does it work? Is there some Groovy convention I don't know about? Or does it actually call a different method?

Body:
This Groovy script looks simple enough:

def a = [].join()
println a

I would expect it to throw MissingMethodException because join method requires a parameter, if I'm looking at the right one, but it works just fine.
And here is the source code for that method, so the parameter is definitely not optional.
You know where it fails the way I expect it to? In Jenkins, of course.

So, why does it work? Is there some Groovy convention I don't know about? Or does it actually call a different method?


问:
How to get Index numbers while using diff-match-patch in java?
I am using google's diff-match-patch in java for finding differences in two strings.

```<code>String s1 = "Comment, Version, Message Type, Action, USI prefix, USI Value, Primary Asset";
String s2 = "Comment, Version, Message Type, Action, USI prefix, JPY Value, Primary Asset, Secondary Asset";

DiffMatchPatch dmp = new DiffMatchPatch();
LinkedList<DiffMatchPatch.Diff> diff = dmp.diffMain(s1, s2, false);

System.out.print(diff);
</code>```

The code is giving correct output:

```<code>[Diff(EQUAL, "Comment, Version, Message Type, Action, USI prefix,"),
 Diff(DELETE, "USI"),
 Diff(INSERT, "JPY"),
 Diff(EQUAL, "Value, Primary Asset"),
 Diff(INSERT, ", Secondary Asset")]
</code>```

How to know that at which index the change has occured? E.g. there are two "USI" in the string, how to know that which "USI" is modified? I need the index numbers at which the change occured.

Body:
I am using google's diff-match-patch in java for finding differences in two strings.

String s1 = "Comment, Version, Message Type, Action, USI prefix, USI Value, Primary Asset";
String s2 = "Comment, Version, Message Type, Action, USI prefix, JPY Value, Primary Asset, Secondary Asset";

DiffMatchPatch dmp = new DiffMatchPatch();
LinkedList<DiffMatchPatch.Diff> diff = dmp.diffMain(s1, s2, false);

System.out.print(diff);

The code is giving correct output:

[Diff(EQUAL, "Comment, Version, Message Type, Action, USI prefix,"),
 Diff(DELETE, "USI"),
 Diff(INSERT, "JPY"),
 Diff(EQUAL, "Value, Primary Asset"),
 Diff(INSERT, ", Secondary Asset")]

How to know that at which index the change has occured? E.g. there are two "USI" in the string, how to know that which "USI" is modified? I need the index numbers at which the change occured.


问:
Solving Error on code 'performsFirstActionWithFullSwipe:' In Flutter
First i am still new in flutter and learning some flutter in open source code.

Recently i am want running some open source project but seem i am have some problem in this code

```<code>child: SwipeActionCell(
                                                  backgroundColor:
                                                      Colors.transparent,
                                                  key: ObjectKey(
                                                      selectedTransactions[
                                                          int]),
                                                  performsFirstActionWithFullSwipe:
                                                      true,
                                                  trailingActions: <
                                                      SwipeAction>[
                                                    SwipeAction(
                                                        title: getTranslated(context, 'Delete') ?? 'Delete',
                                                        onTap:
                                                            (CompletionHandler
                                                                handler) async {
                                                          Platform.isIOS
                                                              ? iosDialog(
                                                                  context,
                                                                  'Are you sure you want to delete this transaction?',
                                                                  'Delete',
                                                                  () async {
                                                                  DB.delete(
                                                                      selectedTransactions[
                                                                              int]
                                                                          .id!);
                                                                  await handler(
                                                                      true);
                                                                  Provider.of<InputModelList>(
                                                                          context,
                                                                          listen:
                                                                              false)
                                                                      .changeInputModelList();
                                                                  customToast(
                                                                      context,
                                                                      'Transaction has been deleted');
                                                                })
                                                              : androidDialog(
                                                                  context,
                                                                  'Are you sure you want to delete this transaction?',
                                                                  'Delete',
                                                                  () async {
                                                                  DB.delete(
                                                                      selectedTransactions[
                                                                              int]
                                                                          .id!);
                                                                  await handler(
                                                                      true);
                                                                  Provider.of<InputModelList>(
                                                                          context,
                                                                          listen:
                                                                              false)
                                                                      .changeInputModelList();
                                                                  customToast(
                                                                      context,
                                                                      'Transaction has been deleted');
                                                                });
                                                        },
                                                        color: red),
                                                    SwipeAction(
                                                        title: getTranslated(context, 'Add') ?? 'Add',
                                                        onTap:
                                                            (CompletionHandler
                                                                handler) {
                                                          var model =
                                                              selectedTransactions[
                                                                  int];
                                                          model.id = null;
                                                          DB.insert(model);
                                                          Provider.of<InputModelList>(
                                                                  context,
                                                                  listen: false)
                                                              .changeInputModelList();
                                                          customToast(context,
                                                              'Transaction has been updated');
                                                        },
                                                        color: Color.fromRGBO(
                                                            255, 183, 121, 1)),
                                                  ],
                                                  child: Padding(
                                                    padding: EdgeInsets.only(
                                                        left: 15.w,
                                                        right: 15.w,
                                                        top: 7.h),
                                                    child: Row(
                                                      children: [
                                                        Text(
                                                            DateFormat(sharedPrefs
                                                                    .dateFormat)
                                                                .format(DateFormat(
                                                                        'dd/MM/yyyy')
                                                                    .parse(selectedTransactions[
                                                                            int]
                                                                        .date!)),
                                                            style: GoogleFonts
                                                                .aBeeZee(
                                                                    fontSize:
                                                                        17.sp)),
                                                        Spacer(),
                                                        Text(
                                                            '${format(selectedTransactions[int].amount!)} $currency',
                                                            style: GoogleFonts
                                                                .aBeeZee(
                                                                    fontSize:
                                                                        18.5.sp)),
                                                        SizedBox(
                                                          width: 15.w,
                                                        ),
                                                        Icon(
                                                          Icons
                                                              .arrow_forward_ios,
                                                          size: 17.sp,
                                                        )
                                                      ],
                                                    ),
                                                  ),
                                                ),
</code>```

The error is on 'performsFirstActionWithFullSwipe' how to solve it? i am already running flutter upgrade package and using some latest SDK in flutter and still have problem with it, i am already clean flutter too and still having this error

Body:
First i am still new in flutter and learning some flutter in open source code.

Recently i am want running some open source project but seem i am have some problem in this code

child: SwipeActionCell(
                                                  backgroundColor:
                                                      Colors.transparent,
                                                  key: ObjectKey(
                                                      selectedTransactions[
                                                          int]),
                                                  performsFirstActionWithFullSwipe:
                                                      true,
                                                  trailingActions: <
                                                      SwipeAction>[
                                                    SwipeAction(
                                                        title: getTranslated(context, 'Delete') ?? 'Delete',
                                                        onTap:
                                                            (CompletionHandler
                                                                handler) async {
                                                          Platform.isIOS
                                                              ? iosDialog(
                                                                  context,
                                                                  'Are you sure you want to delete this transaction?',
                                                                  'Delete',
                                                                  () async {
                                                                  DB.delete(
                                                                      selectedTransactions[
                                                                              int]
                                                                          .id!);
                                                                  await handler(
                                                                      true);
                                                                  Provider.of<InputModelList>(
                                                                          context,
                                                                          listen:
                                                                              false)
                                                                      .changeInputModelList();
                                                                  customToast(
                                                                      context,
                                                                      'Transaction has been deleted');
                                                                })
                                                              : androidDialog(
                                                                  context,
                                                                  'Are you sure you want to delete this transaction?',
                                                                  'Delete',
                                                                  () async {
                                                                  DB.delete(
                                                                      selectedTransactions[
                                                                              int]
                                                                          .id!);
                                                                  await handler(
                                                                      true);
                                                                  Provider.of<InputModelList>(
                                                                          context,
                                                                          listen:
                                                                              false)
                                                                      .changeInputModelList();
                                                                  customToast(
                                                                      context,
                                                                      'Transaction has been deleted');
                                                                });
                                                        },
                                                        color: red),
                                                    SwipeAction(
                                                        title: getTranslated(context, 'Add') ?? 'Add',
                                                        onTap:
                                                            (CompletionHandler
                                                                handler) {
                                                          var model =
                                                              selectedTransactions[
                                                                  int];
                                                          model.id = null;
                                                          DB.insert(model);
                                                          Provider.of<InputModelList>(
                                                                  context,
                                                                  listen: false)
                                                              .changeInputModelList();
                                                          customToast(context,
                                                              'Transaction has been updated');
                                                        },
                                                        color: Color.fromRGBO(
                                                            255, 183, 121, 1)),
                                                  ],
                                                  child: Padding(
                                                    padding: EdgeInsets.only(
                                                        left: 15.w,
                                                        right: 15.w,
                                                        top: 7.h),
                                                    child: Row(
                                                      children: [
                                                        Text(
                                                            DateFormat(sharedPrefs
                                                                    .dateFormat)
                                                                .format(DateFormat(
                                                                        'dd/MM/yyyy')
                                                                    .parse(selectedTransactions[
                                                                            int]
                                                                        .date!)),
                                                            style: GoogleFonts
                                                                .aBeeZee(
                                                                    fontSize:
                                                                        17.sp)),
                                                        Spacer(),
                                                        Text(
                                                            '${format(selectedTransactions[int].amount!)} $currency',
                                                            style: GoogleFonts
                                                                .aBeeZee(
                                                                    fontSize:
                                                                        18.5.sp)),
                                                        SizedBox(
                                                          width: 15.w,
                                                        ),
                                                        Icon(
                                                          Icons
                                                              .arrow_forward_ios,
                                                          size: 17.sp,
                                                        )
                                                      ],
                                                    ),
                                                  ),
                                                ),

The error is on 'performsFirstActionWithFullSwipe' how to solve it? i am already running flutter upgrade package and using some latest SDK in flutter and still have problem with it, i am already clean flutter too and still having this error


问:
Vite forwad POST request to GET
Here is my vite config

```<code>  server: {
    host: "0.0.0.0",
    proxy: {
      "/api": {
        target: "https://xxx.xxx.inc",
        changeOrigin: true,
        rewrite: (path) => {
          return path.replace(/^\/api/, "");
        },
        secure: false,
      },
    },
  },
</code>```

When I post a data, weired things happend!

The POST was "301 Moved Permanently" And it became GET!

```<code> vite:proxy /api/core/login -> https://xxx.xxx.inc +0ms
  vite:time 475.67ms /core/login +10s
  vite:spa-fallback Not rewriting GET /core/login/ because the client prefers JSON. +10s
  vite:time 0.73ms /core/login/ +7ms
  vite:proxy /api/core/login -> https://xxx.xxx.inc +15m
  vite:time 476.08ms /core/login +15m
  vite:spa-fallback Not rewriting GET /core/login/ because the client prefers JSON. +15m
  vite:time 0.66ms /core/login/ +5ms

</code>```

For Proxy server,

A POST should be always POST after

Title: Vite forwad POST request to GET

Body:
Here is my vite config

  server: {
    host: "0.0.0.0",
    proxy: {
      "/api": {
        target: "https://xxx.xxx.inc",
        changeOrigin: true,
        rewrite: (path) => {
          return path.replace(/^\/api/, "");
        },
        secure: false,
      },
    },
  },

When I post a data, weired things happend!

The POST was "301 Moved Permanently" And it became GET!

 vite:proxy /api/core/login -> https://xxx.xxx.inc +0ms
  vite:time 475.67ms /core/login +10s
  vite:spa-fallback Not rewriting GET /core/login/ because the client prefers JSON. +10s
  vite:time 0.73ms /core/login/ +7ms
  vite:proxy /api/core/login -> https://xxx.xxx.inc +15m
  vite:time 476.08ms /core/login +15m
  vite:spa-fallback Not rewriting GET /core/login/ because the client prefers JSON. +15m
  vite:time 0.66ms /core/login/ +5ms

For Proxy server,

A POST should be always POST after


问:
How can I use grad cam on transfer learning model?
```<code>`from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras import optimizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dropout, Flatten, Dense
from tensorflow.keras.models import Model
from tensorflow.keras import models
from tensorflow.keras import layers
from tensorflow.keras import optimizers

from keras.applications.vgg19 import VGG19

vgg_conv = VGG19(weights='imagenet', include_top=False, input_shape=(400, 400, 3))
vgg_conv.summary()

for layer in vgg_conv.layers:
    layer.trainable = False

model = models.Sequential()
model.add(layers.Conv2D(filters=3, kernel_size=3,padding='same',
                        activation="relu",
                         input_shape=(400,400,1)))

model.add(vgg_conv)

model.add(layers.Flatten())
model.add(layers.Dense(1024, activation='relu'))
model.add(layers.Dropout(0.5))
model.add(layers.Dense(2, activation='softmax'))

model.summary()`
</code>```
```<code>`from keras.callbacks import EarlyStopping
import tensorflow as tf
from tensorflow.keras import optimizers
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras.callbacks import LearningRateScheduler, ReduceLROnPlateau
import tensorflow_addons as tfa

model.compile(loss='categorical_crossentropy',
              optimizer=tf.keras.optimizers.Adam(learning_rate=0.00001),
              `metrics=[tf.keras.metrics.Precision(name='precision')\
                          ,tf.keras.metrics.Recall(name='recall')\
                          ,tf.keras.metrics.FalsePositives(name='false_positives')\
                          ,tf.keras.metrics.FalseNegatives(name='false_negatives')\
                          ,tfa.metrics.FBetaScore(num_classes=2,average="micro",threshold=0.5)\
                          ,'acc'])`
                        #  ,'acc',f1_score])

lr = ReduceLROnPlateau(monitor="val_loss", factor=0.9, patience=6, verbose=1)
es = EarlyStopping(monitor="val_loss", patience=32, verbose=1, mode="min", restore_best_weights=True)
sv = ModelCheckpoint('/root/work/VGG19_gray10_categorical.h5', monitor='val_loss', verbose=1, save_best_only=True, save_weights_only=False, mode='auto', save_freq='epoch')
`
</code>```

I compiled model like this. I customed model architecture a little cuz my images are in one channel but VGG19 model need 3 channels. I wanted to know which part of my images this model pays attention to, so I decided to use grad cam model like below.

```<code>`def make_gradcam_heatmap(img_array, model, last_conv_layer_name, pred_index=None):
    grad_model = tf.keras.models.Model(
        [model.input], [model.get_layer('vgg19').get_layer(last_conv_layer_name).output, model.output]
    )
    with tf.GradientTape() as tape:
        last_conv_layer_output, preds = grad_model(img_array)
        if pred_index is None:
            pred_index = tf.argmax(preds[0])
        class_channel = preds[:, pred_index]

    grads = tape.gradient(class_channel, last_conv_layer_output)

    pooled_grads = tf.reduce_mean(grads, axis=(0, 1, 2))

    last_conv_layer_output = last_conv_layer_output[0]

    heatmap = last_conv_layer_output
    heatmap = tf.squeeze(heatmap)

    heatmap = tf.maximum(heatmap, 0) / tf.math.reduce_max(heatmap)
    return heatmap.numpy()`
</code>```
```<code>make_gradcam_heatmap(train_reject[1], model, 'block5_conv4' , pred_index=None)
</code>```

This code cause this error.

```<code>ValueError: Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 400, 400, 3), dtype=tf.float32, name='input_2'), name='input_2', description="created by layer 'input_2'") at layer "block1_conv1". The following previous layers were accessed without issue: []
</code>```

Please help me anyone can solve this problem.

Body:
`from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras import optimizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dropout, Flatten, Dense
from tensorflow.keras.models import Model
from tensorflow.keras import models
from tensorflow.keras import layers
from tensorflow.keras import optimizers

from keras.applications.vgg19 import VGG19

vgg_conv = VGG19(weights='imagenet', include_top=False, input_shape=(400, 400, 3))
vgg_conv.summary()

for layer in vgg_conv.layers:
    layer.trainable = False

model = models.Sequential()
model.add(layers.Conv2D(filters=3, kernel_size=3,padding='same',
                        activation="relu",
                         input_shape=(400,400,1)))

model.add(vgg_conv)

model.add(layers.Flatten())
model.add(layers.Dense(1024, activation='relu'))
model.add(layers.Dropout(0.5))
model.add(layers.Dense(2, activation='softmax'))

model.summary()`

`from keras.callbacks import EarlyStopping
import tensorflow as tf
from tensorflow.keras import optimizers
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras.callbacks import LearningRateScheduler, ReduceLROnPlateau
import tensorflow_addons as tfa

model.compile(loss='categorical_crossentropy',
              optimizer=tf.keras.optimizers.Adam(learning_rate=0.00001),
              `metrics=[tf.keras.metrics.Precision(name='precision')\
                          ,tf.keras.metrics.Recall(name='recall')\
                          ,tf.keras.metrics.FalsePositives(name='false_positives')\
                          ,tf.keras.metrics.FalseNegatives(name='false_negatives')\
                          ,tfa.metrics.FBetaScore(num_classes=2,average="micro",threshold=0.5)\
                          ,'acc'])`
                        #  ,'acc',f1_score])

lr = ReduceLROnPlateau(monitor="val_loss", factor=0.9, patience=6, verbose=1)
es = EarlyStopping(monitor="val_loss", patience=32, verbose=1, mode="min", restore_best_weights=True)
sv = ModelCheckpoint('/root/work/VGG19_gray10_categorical.h5', monitor='val_loss', verbose=1, save_best_only=True, save_weights_only=False, mode='auto', save_freq='epoch')
`

I compiled model like this. I customed model architecture a little cuz my images are in one channel but VGG19 model need 3 channels. I wanted to know which part of my images this model pays attention to, so I decided to use grad cam model like below.

`def make_gradcam_heatmap(img_array, model, last_conv_layer_name, pred_index=None):
    grad_model = tf.keras.models.Model(
        [model.input], [model.get_layer('vgg19').get_layer(last_conv_layer_name).output, model.output]
    )
    with tf.GradientTape() as tape:
        last_conv_layer_output, preds = grad_model(img_array)
        if pred_index is None:
            pred_index = tf.argmax(preds[0])
        class_channel = preds[:, pred_index]

    grads = tape.gradient(class_channel, last_conv_layer_output)

    pooled_grads = tf.reduce_mean(grads, axis=(0, 1, 2))

    last_conv_layer_output = last_conv_layer_output[0]

    heatmap = last_conv_layer_output
    heatmap = tf.squeeze(heatmap)

    heatmap = tf.maximum(heatmap, 0) / tf.math.reduce_max(heatmap)
    return heatmap.numpy()`

make_gradcam_heatmap(train_reject[1], model, 'block5_conv4' , pred_index=None)

This code cause this error.

ValueError: Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 400, 400, 3), dtype=tf.float32, name='input_2'), name='input_2', description="created by layer 'input_2'") at layer "block1_conv1". The following previous layers were accessed without issue: []

Please help me anyone can solve this problem.


问:
How to write a dynamic query inside @Query annotation for spring mongo JPA
I'm trying to write a query for spring mongo's @Query annotation, where it gets data for all those fields whose value is not null, that's coming from the front end.

Currently, I have tried this, but it just returns all the records.

```<code>@Query("{ { $or: [ { $where: '?0 == null' }, { name: '?0' } ] }" +
        " { $or: [ { $where: '?1 == null' }, { age: '?1' } ] }" +
        " { $or: [ { $where: '?2 == null' }, { batch: '?2' } ] }" +
        " { $or: [ { $where: '?3 == null' }, { $or: [{startDate: '?3'}, {endDate: '?3'}] } ] } }")
</code>```

Edit: I have tried wrapping the $or inside an $and , but it still returns all the records.

```<code>@Query("{$and:{\r\n"
        + "   { $or: [ { $where: '?0 == null' }, { name: '?0' } ] },\r\n"
        + "   { $or: [ { $where: '?1 == null' }, { age: '?1' } ] },\r\n"
        + "   { $or: [ { $where: '?2 == null' }, { batch: '?2' } ] },\r\n"
        + "}}")
</code>```

Edit:
tried criteria builder , now it says cannot find "find()" method

Body:
I'm trying to write a query for spring mongo's @Query annotation, where it gets data for all those fields whose value is not null, that's coming from the front end.

Currently, I have tried this, but it just returns all the records.

@Query("{ { $or: [ { $where: '?0 == null' }, { name: '?0' } ] }" +
        " { $or: [ { $where: '?1 == null' }, { age: '?1' } ] }" +
        " { $or: [ { $where: '?2 == null' }, { batch: '?2' } ] }" +
        " { $or: [ { $where: '?3 == null' }, { $or: [{startDate: '?3'}, {endDate: '?3'}] } ] } }")

Edit: I have tried wrapping the $or inside an $and , but it still returns all the records.

@Query("{$and:{\r\n"
        + "   { $or: [ { $where: '?0 == null' }, { name: '?0' } ] },\r\n"
        + "   { $or: [ { $where: '?1 == null' }, { age: '?1' } ] },\r\n"
        + "   { $or: [ { $where: '?2 == null' }, { batch: '?2' } ] },\r\n"
        + "}}")

Edit:
tried criteria builder , now it says cannot find "find()" method


问:
I could not write the data frame including twitter hashtag to the csv file. When I subset some of the variables, csv file does not show variables
I extracted the twitter data to the R script via packages (rtweet) and (tidyverse) through spesific hashtag. After sucessfully get the data, I need to subset some of the variables that I want to analyze. I code the subset function and console shows the subsetted variables. Despite this, when I tried to write this to the csv file, written csv shows the whole variables instead to show only subsetted variables. Codes that I entered as follows.

```<code>twitter_data_armenian_issue_iki <- search_tweets("ermeniler", n=1000, include_rts = FALSE)
view(twitter_data_armenian_issue_iki)

  twitter_data_armenian_issue_iki_clean <- cbind(twitter_data_armenian_issue_iki, users_data(twitter_data_armenian_issue_iki)[,c("id","id_str","name", "screen_name")])

  twitter_data_armenian_issue_iki_clean <-twitter_data_armenian_issue_iki_clean[,! duplicated(colnames(twitter_data_armenian_issue_iki_clean))]
  view(twitter_data_armenian_issue_iki_clean)
  data_bir <-data.frame(twitter_data_armenian_issue_iki_clean)
  data_bir[ , c("created_at", "id", "id_str", "full_text", "name", "screen_name", "in_reply_to_screen_name")]
  write.csv(data_bir, "newdata.csv", row.names = FALSE, )
</code>```

If anyone want to help me, I will be more pleased. Thank you

I tried to get twitter data with only some spesific columns that I want to analyze. In order to do this, I entried the subset function and run. But when I tried to write this to the csv, written csv file shows the wole variable. I controlled the environment panel, I could not see the subsetted data.
My question is How can I add the subsetted data to the environment and write this to the csv without any error.

Body:
I extracted the twitter data to the R script via packages (rtweet) and (tidyverse) through spesific hashtag. After sucessfully get the data, I need to subset some of the variables that I want to analyze. I code the subset function and console shows the subsetted variables. Despite this, when I tried to write this to the csv file, written csv shows the whole variables instead to show only subsetted variables. Codes that I entered as follows.

twitter_data_armenian_issue_iki <- search_tweets("ermeniler", n=1000, include_rts = FALSE)
view(twitter_data_armenian_issue_iki)

  twitter_data_armenian_issue_iki_clean <- cbind(twitter_data_armenian_issue_iki, users_data(twitter_data_armenian_issue_iki)[,c("id","id_str","name", "screen_name")])

  twitter_data_armenian_issue_iki_clean <-twitter_data_armenian_issue_iki_clean[,! duplicated(colnames(twitter_data_armenian_issue_iki_clean))]
  view(twitter_data_armenian_issue_iki_clean)
  data_bir <-data.frame(twitter_data_armenian_issue_iki_clean)
  data_bir[ , c("created_at", "id", "id_str", "full_text", "name", "screen_name", "in_reply_to_screen_name")]
  write.csv(data_bir, "newdata.csv", row.names = FALSE, )

If anyone want to help me, I will be more pleased. Thank you

I tried to get twitter data with only some spesific columns that I want to analyze. In order to do this, I entried the subset function and run. But when I tried to write this to the csv, written csv file shows the wole variable. I controlled the environment panel, I could not see the subsetted data.
My question is How can I add the subsetted data to the environment and write this to the csv without any error.


问:
fetch API causes a CSP error in some situations, but works directly or via ajax
I created a very basic expressjs app that listens to the port 5000 and responses with an error for all routes except the route "/ok"

when I navigate to any route (except /ok) and make a fetch request to "/ok" it refuses to connect with this error

```<code>VM591:1 Refused to connect to 'http://localhost:5000/ok' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
</code>```

but it works when I navigate to "/ok" in the browser and then make a fetch call.
however, it works in both cases if I make the request with XMLHttpRequest

express:

```<code>import express, { NextFunction, Request, Response } from "express";

let app = express();

app.use("/ok", (req: Request, res: Response) => res.send("ok"));

app.use("*", (req: Request, res: Response, next: NextFunction) =>
  next("error")
);

app.listen(5000, () => console.log("listening..."));
</code>```

minimal reproduction

1- install npm i

2- start npm start

3- navigate to http://localhost:5000 then in your browser's console run fetch('http://localhost:5000/ok') you will see an error
in the same console, run

```<code>let oReq = new XMLHttpRequest();
oReq.open("get", "http://localhost:5000/ok", true);
oReq.send();
console.log(oReq.response);
</code>```

it works.

4- navigate to http://localhost:5000/ok, and run the same requests from the previous step, it works in both cases.

The question is
why in the first scenario, only fetch API failed, whereas other methods success
i.e. when making a fetch request to a valid route from your console while you open a page that responsed with an error.

Body:
I created a very basic expressjs app that listens to the port 5000 and responses with an error for all routes except the route "/ok"

when I navigate to any route (except /ok) and make a fetch request to "/ok" it refuses to connect with this error

VM591:1 Refused to connect to 'http://localhost:5000/ok' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

but it works when I navigate to "/ok" in the browser and then make a fetch call.
however, it works in both cases if I make the request with XMLHttpRequest

express:

import express, { NextFunction, Request, Response } from "express";

let app = express();

app.use("/ok", (req: Request, res: Response) => res.send("ok"));

app.use("*", (req: Request, res: Response, next: NextFunction) =>
  next("error")
);

app.listen(5000, () => console.log("listening..."));

minimal reproduction

1- install npm i

2- start npm start

3- navigate to http://localhost:5000 then in your browser's console run fetch('http://localhost:5000/ok') you will see an error
in the same console, run

let oReq = new XMLHttpRequest();
oReq.open("get", "http://localhost:5000/ok", true);
oReq.send();
console.log(oReq.response);

it works.

4- navigate to http://localhost:5000/ok, and run the same requests from the previous step, it works in both cases.

The question is
why in the first scenario, only fetch API failed, whereas other methods success
i.e. when making a fetch request to a valid route from your console while you open a page that responsed with an error.


问:
does InAppPurchase require app review even if it's only testflight?
I am making an app and trying to put in-app-purchase function for iOS.
and it keeps returning "invalid receipt" error.

I tried to research and nothing I found was very helpful,
and I noticed some of them were talking about submission for app review.

currently the app is rejected due to in-app-purchase(the app requires the function but I didn't add the function) and that is why I did not submit screenshots of item purchases for review.

is it a must to pass the review to make IAP available even if it is rejected and on testflight only?


问:
Airflow - How to encrypt connection that is built through Extra
I've a connection to AWS S3 on Airflow that is made with Extra config:

aws_access_key_id

aws_secret_access_key
However, since this credentials are stored on Extra field, it's not encrypted and everyone that has access to Airflow UI can see those value:

Is there any way to encrypt those connection/values on Extra fields?

Thanks?


问:
Enable and disable SQS listener
I am working on spring boot project that uses docker and k8s for deployment. I have created a SQS listener class that listens to a SQS queue. I have a requirement where I need to implement a functionality that enables and disables the listener. Does sqs listner provide any such functionality?  How can I implement this feature? Below are the libraries that I am using to implement SQS listner `

```<code>implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2'
implementation 'io.awspring.cloud:spring-cloud-starter-aws-messaging:2.4.2'
</code>```

I saw this answer - How can I Stop/start/Pause a @JmsListener (the clean way), jms has a way to register and de-register the listner. Does SQS listner also provide something like this?

Title: Enable and disable SQS listener

Body:
I am working on spring boot project that uses docker and k8s for deployment. I have created a SQS listener class that listens to a SQS queue. I have a requirement where I need to implement a functionality that enables and disables the listener. Does sqs listner provide any such functionality?  How can I implement this feature? Below are the libraries that I am using to implement SQS listner `

implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2'
implementation 'io.awspring.cloud:spring-cloud-starter-aws-messaging:2.4.2'

I saw this answer - How can I Stop/start/Pause a @JmsListener (the clean way), jms has a way to register and de-register the listner. Does SQS listner also provide something like this?


问:
I set params but they still null
i wan't to create a chat so i have server and client; server code:

```<code>            serverSocket = new ServerSocket(8080);
            mainSocket = serverSocket.accept();
            out = new PrintWriter(mainSocket.getOutputStream());
            in = new BufferedReader(new InputStreamReader(mainSocket.getInputStream()));
            gui = new JavaFXGUI();
            gui.setIn(in);
            gui.setOut(out);
            gui.run()
</code>```

client code:

```<code>            clientSocket = new Socket("127.0.0.1", 8080);
            out = new PrintWriter(clientSocket.getOutputStream());
            in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));

            gui = new JavaFXGUI();
            gui.setIn(in);
            gui.setOut(out);
            gui.run()
</code>```

JavaFXGUI :

```<code>public class JavaFXGUI extends Application{
    private BufferedReader in;
    private PrintWriter out;
    private ChatController chatController;

    @Override
    public void start(Stage primaryStage) throws Exception {
        FXMLLoader loader = new FXMLLoader();
        URL xmlUrl = getClass().getResource("/GUI/scenes/mainScene.fxml");
        loader.setLocation(xmlUrl);
        System.out.println(in);
        chatController = new ChatController(out,in);

        loader.setController(chatController);
        Parent root = loader.load();

        primaryStage.setTitle("Chat");
        primaryStage.setWidth(800);
        primaryStage.setHeight(450);

        primaryStage.setScene(new Scene(root));
        primaryStage.show();
    }

    public void run() {
        launch();
    }

    public void setIn(BufferedReader in) {
        this.in = in;
    }

    public void setOut(PrintWriter out) {
        this.out = out;
    }
}
</code>```

so the problem is that in start method in and out parameters are null, why is this hapenning and how can i fix it. (i tried to pass in and out in constructor but it throws an error)

Title: I set params but they still null

Body:
i wan't to create a chat so i have server and client; server code:

            serverSocket = new ServerSocket(8080);
            mainSocket = serverSocket.accept();
            out = new PrintWriter(mainSocket.getOutputStream());
            in = new BufferedReader(new InputStreamReader(mainSocket.getInputStream()));
            gui = new JavaFXGUI();
            gui.setIn(in);
            gui.setOut(out);
            gui.run()

client code:

            clientSocket = new Socket("127.0.0.1", 8080);
            out = new PrintWriter(clientSocket.getOutputStream());
            in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));

            gui = new JavaFXGUI();
            gui.setIn(in);
            gui.setOut(out);
            gui.run()

JavaFXGUI :

public class JavaFXGUI extends Application{
    private BufferedReader in;
    private PrintWriter out;
    private ChatController chatController;

    @Override
    public void start(Stage primaryStage) throws Exception {
        FXMLLoader loader = new FXMLLoader();
        URL xmlUrl = getClass().getResource("/GUI/scenes/mainScene.fxml");
        loader.setLocation(xmlUrl);
        System.out.println(in);
        chatController = new ChatController(out,in);

        loader.setController(chatController);
        Parent root = loader.load();

        primaryStage.setTitle("Chat");
        primaryStage.setWidth(800);
        primaryStage.setHeight(450);

        primaryStage.setScene(new Scene(root));
        primaryStage.show();
    }

    public void run() {
        launch();
    }

    public void setIn(BufferedReader in) {
        this.in = in;
    }

    public void setOut(PrintWriter out) {
        this.out = out;
    }
}

so the problem is that in start method in and out parameters are null, why is this hapenning and how can i fix it. (i tried to pass in and out in constructor but it throws an error)


问:
[Invalid Frame]: Please select frame to connect the console
I am using Python 3.11, Windows 10 x64 , Eclipse IDE 2022-12, PyDev.

x = str(3)
[Invalid Frame]: Please select frame to connect the console.
x
[Invalid Frame]: Please select frame to connect the console.
```

How to type and run program in console inside Eclipse success?

Body:
I am using Python 3.11, Windows 10 x64 , Eclipse IDE 2022-12, PyDev.

x = str(3)
[Invalid Frame]: Please select frame to connect the console.
x
[Invalid Frame]: Please select frame to connect the console.

How to type and run program in console inside Eclipse success?


问:
How to get row as array in postgres SQL?
I am using RAW PostgreSQL query in nestjs - query builder.

My query :

```<code>SELECT DISTINCT
    user.id,
    ARRAY_AGG(fct.fanname) AS name
FROM
    users u
    LEFT JOIN user_fans ufe ON ufe.fanid = u.id
    LEFT JOIN fans fct ON fct.id = ufe.fanid
WHERE
    u.id = 1
GROUP BY
    u.id,
    ufe.id,
    fct.id
ORDER BY
    u.id

</code>```

My problem is resulting table is shown as below :

id
fanname

1
fan1

1
fan2

I tried the array aggregator function and still fails to get expected result as below.

id
fanname

1
fan1 ,fan2

Table images links : 3 tables user , user_fans, fans
enter image description here

Body:
I am using RAW PostgreSQL query in nestjs - query builder.

My query :

SELECT DISTINCT
    user.id,
    ARRAY_AGG(fct.fanname) AS name
FROM
    users u
    LEFT JOIN user_fans ufe ON ufe.fanid = u.id
    LEFT JOIN fans fct ON fct.id = ufe.fanid
WHERE
    u.id = 1
GROUP BY
    u.id,
    ufe.id,
    fct.id
ORDER BY
    u.id

My problem is resulting table is shown as below :

id
fanname

1
fan1

1
fan2

I tried the array aggregator function and still fails to get expected result as below.

id
fanname

1
fan1 ,fan2

Table images links : 3 tables user , user_fans, fans
enter image description here


问:
Why do other tests in a collection run when I select a single test to run?
I have a class containing four tests, this class is part of a collection with a shared database fixture. When I execute a single test in the class from Test Explorer in Visual Studio it passes as expected. However, looking at the state of the database after it runs, it seems that some of the other tests are also attempting to run. SQL profiler confirmed this.

SQL profiler also revealed that the database fixture constructor is being executed multiple times when a single test is selected to run.

The behavior is the same when I execute just the one test by right clicking it in the code editor and selecting run.

I tried removing the class from the collection, and instantiating the database fixture within each of the test methods in the class.

This actually does result in the expected database state after a single test has been run. I just don't understand why removing the tests from the collection results in different behavior. From my understanding, the whole point of a collection fixture is to have it run once for all tests in the collection.

It would be preferable to keep the tests in a single collection, as the database fixture loads some data in it's constructor. It is much slower to instantiate it for every test and requires a fair amount of wiring in each test method.

Simplified example:

    public class DatabaseFixture : IDisposable
    {
        internal IDbConnection Db;
        internal IConfiguration Configuration;
        internal OrmLiteConnectionFactory dbFactory;

        public DatabaseFixture()
        {
            Configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            var connectionString = Configuration.GetConnectionString(name: "Connection");

            dbFactory
               = new OrmLiteConnectionFactory(connectionString, SqlServerDialect.Provider, false);

            Db = dbFactory.Open();

            Db.ExecuteNonQuery("DELETE FROM TestTable");

        }
        public void Dispose()
        {

        }
    }

```
<pre class="lang-cs prettyprint-override"><code>    [CollectionDefinition("TestCollection")]
    public class TestCollection : ICollectionFixture<DatabaseFixture>
    {
    }
</code>```

    [Collection("TestCollection")]
    public class TestClass
    {
        DatabaseFixture dbFixture;
        public TestClass(DatabaseFixture database)
        {
            dbFixture = database;
        }

        [Fact]
        public void Test1()
        {
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 1" });
        }

        [Fact]
        public void Test2()
        {
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 2" });

        }
    }
```
<p>Executing only Test1 produces the following in the table:
<img src="https://i.stack.imgur.com/U4eXT.png" alt="enter image description here" /></p>
<p>Then when I change TestClass to the following:</p>
<pre class="lang-cs prettyprint-override"><code>    public class TestClass
    {
        DatabaseFixture dbFixture;

        [Fact]
        public void Test1()
        {
            dbFixture = new();
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 1" });
        }

        [Fact]
        public void Test2()
        {
            dbFixture = new();
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 2" });

        }
    }

</code>```

And execute only Test1, I get the expected result:

Body:
I have a class containing four tests, this class is part of a collection with a shared database fixture. When I execute a single test in the class from Test Explorer in Visual Studio it passes as expected. However, looking at the state of the database after it runs, it seems that some of the other tests are also attempting to run. SQL profiler confirmed this.

SQL profiler also revealed that the database fixture constructor is being executed multiple times when a single test is selected to run.

The behavior is the same when I execute just the one test by right clicking it in the code editor and selecting run.

I tried removing the class from the collection, and instantiating the database fixture within each of the test methods in the class.

This actually does result in the expected database state after a single test has been run. I just don't understand why removing the tests from the collection results in different behavior. From my understanding, the whole point of a collection fixture is to have it run once for all tests in the collection.

It would be preferable to keep the tests in a single collection, as the database fixture loads some data in it's constructor. It is much slower to instantiate it for every test and requires a fair amount of wiring in each test method.

Simplified example:

    public class DatabaseFixture : IDisposable
    {
        internal IDbConnection Db;
        internal IConfiguration Configuration;
        internal OrmLiteConnectionFactory dbFactory;

        public DatabaseFixture()
        {
            Configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            var connectionString = Configuration.GetConnectionString(name: "Connection");

            dbFactory
               = new OrmLiteConnectionFactory(connectionString, SqlServerDialect.Provider, false);

            Db = dbFactory.Open();

            Db.ExecuteNonQuery("DELETE FROM TestTable");

        }
        public void Dispose()
        {

        }
    }

    [CollectionDefinition("TestCollection")]
    public class TestCollection : ICollectionFixture<DatabaseFixture>
    {
    }

    [Collection("TestCollection")]
    public class TestClass
    {
        DatabaseFixture dbFixture;
        public TestClass(DatabaseFixture database)
        {
            dbFixture = database;
        }

        [Fact]
        public void Test1()
        {
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 1" });
        }

        [Fact]
        public void Test2()
        {
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 2" });

        }
    }

Executing only Test1 produces the following in the table:

Then when I change TestClass to the following:

    public class TestClass
    {
        DatabaseFixture dbFixture;

        [Fact]
        public void Test1()
        {
            dbFixture = new();
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 1" });
        }

        [Fact]
        public void Test2()
        {
            dbFixture = new();
            dbFixture.Db.Insert<TestTable>(new TestTable { Value = DateTime.Now.ToString(), Method = "TEST 2" });

        }
    }

And execute only Test1, I get the expected result: