问:
initcontainer issue on deployment
I am facing issue on initcontianer where i am unable to pull the value from curl and story it in variable

tried with multiple methods like passing only value
tried with passing curl method directly

NOTE: condition is when the cluster size is 3 it should come out of loop and when cluster size is not equal to 3 it should get inside loop and execute waiting for the pod

Below is the script

echo "running below scripts"
curl -g -s -H "Content-Type: application/json" "http://hazelcast-service.bjy:8711/hazelcast/health " | jq -r '.clusterSize' > i;
cat 'i';
n=`cat i`;
while [ $n -ne 3 ];
do
   echo "waiting for pod";
   sleep 5;
done
```

Title: initcontainer issue on deployment


来源: stackexchange

问:
Chat app lookup and write performance: additionan lookup for user with each message vs. bulk message edit on user info update?
I use MongoDB to store chat message documents in comments collection:

{
  message: String,
  id: String,
  status: String,
  author: {
    id: String,
    role: String,
    title: String,
    image: String,
  },
... // plus some more stuff
}
```
<p>Full user credentials are stored in <code>users</code> collection:</p>
<pre class="lang-js prettyprint-override"><code>{
  id: String,
  title: String,
  image: String,
  text: String,
  role: { type: String, default: "member" },
  suspend: Boolean
}
</code>```

Using this architecture, I can display a user profile icon, their full name, their badge (user role, such as "admin"), and a link to their full profile.

This architecture lets me create a single lookup to create a chat message. If I have 100 messages, I'll query MongoDB for 100 messages, and we're done.

However, if the user wants to update their profile details, I would need to find all the messages they've ever created and change them in addition to their profile data in users collection.

It's possible that a single user can author thousands of messages.

Should I rewrite this so that fetching a message will also fetch user data afresh?

This way, to display a message, I'd have to look up a document in the comments and then use comments[comment].id to find the user.

ContentLicense: CC BY-SA 4.0

Body:
I use MongoDB to store chat message documents in comments collection:

{
  message: String,
  id: String,
  status: String,
  author: {
    id: String,
    role: String,
    title: String,
    image: String,
  },
... // plus some more stuff
}

Full user credentials are stored in users collection:

{
  id: String,
  title: String,
  image: String,
  text: String,
  role: { type: String, default: "member" },
  suspend: Boolean
}

Using this architecture, I can display a user profile icon, their full name, their badge (user role, such as "admin"), and a link to their full profile.

This architecture lets me create a single lookup to create a chat message. If I have 100 messages, I'll query MongoDB for 100 messages, and we're done.

However, if the user wants to update their profile details, I would need to find all the messages they've ever created and change them in addition to their profile data in users collection.

It's possible that a single user can author thousands of messages.

Should I rewrite this so that fetching a message will also fetch user data afresh?

This way, to display a message, I'd have to look up a document in the comments and then use comments[comment].id to find the user.


问:
How to perform a cumulative count of unique values in array[str] column in Pyspark DataFrame?
I have a dataframe with an array column of strings and another column of values.
The dataframe is ordered by the values column.

```<code>df = spark.createDataFrame([
    (["id1", "id2", "id3"], 0,5),
    (["id1", "id4"], 0.3)
    (["id5", "id6"], 0.2)
], ["id", "value"])
</code>```

I want to be able to obtain the following dataframe as a result:

```<code>df = spark.createDataFrame([
    (["id1", "id2", "id3"], 0,5, 3),
    (["id1", "id4"], 0.3, 4)
    (["id5", "id6"], 0.2, 6)
], ["id", "value", "cumulative_ids"])
</code>```

What is happening here: for the first row, the "cummulative_ids" value is 3 because we have 3 unique IDs.
For the second row, it is only 4, even though the set is of two IDs. That's because I want the sum to increment only with never before seen IDs.
For the third row, we add +2 since we've never seen these guys before.

How can I do such a thing in PySpark? Moreover, how scalable can such an operation be?
Thanks in advance.

I tried an implementation in Pandas with uses iterrows() and updates sets. While this is good for Pandas, it's proving difficult to implement in Spark. In Spark I have yet to come to a decent solution for the issue.

Body:
I have a dataframe with an array column of strings and another column of values.
The dataframe is ordered by the values column.

df = spark.createDataFrame([
    (["id1", "id2", "id3"], 0,5),
    (["id1", "id4"], 0.3)
    (["id5", "id6"], 0.2)
], ["id", "value"])

I want to be able to obtain the following dataframe as a result:

df = spark.createDataFrame([
    (["id1", "id2", "id3"], 0,5, 3),
    (["id1", "id4"], 0.3, 4)
    (["id5", "id6"], 0.2, 6)
], ["id", "value", "cumulative_ids"])

What is happening here: for the first row, the "cummulative_ids" value is 3 because we have 3 unique IDs.
For the second row, it is only 4, even though the set is of two IDs. That's because I want the sum to increment only with never before seen IDs.
For the third row, we add +2 since we've never seen these guys before.

How can I do such a thing in PySpark? Moreover, how scalable can such an operation be?
Thanks in advance.

I tried an implementation in Pandas with uses iterrows() and updates sets. While this is good for Pandas, it's proving difficult to implement in Spark. In Spark I have yet to come to a decent solution for the issue.


问:
Make existing Tabs swipeable on mobile
I'm using Tabs on my website and would like to be able to swipe through them on mobile.

(Swipe the active Tab content to left or right, to activate (show) another Tab content)

How can I achieve such thing?

I'm using the following tabs:

http://jsfiddle.net/yL8ropfj/

const btn = [].slice.call(document.getElementsByTagName('button'))
btn.forEach((item, index) => {
  item.addEventListener('click', function() {
    btn.forEach((item) => {
      item.classList.remove('active')
    })
    item.classList.add('active')
    document.getElementById('tab').setAttribute('data-tab', index)
  })
})```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.wrapper {
  overflow: hidden;
}

.tabs {
  position: relative;
  -webkit-transition: all .9s ease-in-out;
  -moz-transition: all .9s ease-in-out;
  -ms-transition: all .9s ease-in-out;
  -o-transition: all .9s ease-in-out;
  transition: all .9s ease-in-out;
}

.tabs>* {
  width: 100%;
}

.tabs[data-tab='1'] {
  transform: translateX(-100%);
}

.tabs[data-tab='2'] {
  transform: translateX(-200%);
}

.tabs[data-tab='3'] {
  transform: translateX(-300%);
}

.tabs[data-tab='4'] {
  transform: translateX(-400%);
}

.inliner {
  white-space: nowrap;
}

.inliner>* {
  display: inline-block;
  *display: inline;
  *zoom: 1;
  font-size: 1rem;
  letter-spacing: normal;
  vertical-align: top;
  word-spacing: normal;
  white-space: normal;
}</code>```

  <button> Tab 1</button>
  <button> Tab 2</button>
  <button> Tab 3</button>

Content 1

Content 2

Content 3

```

I tried starting with draggable / swipable divs for mobile but couldnt even get that to work

Dont know where im messing up, slim to none experience

Glad for answers, any help is much appreciated

Title: Make existing Tabs swipeable on mobile

Body:
I'm using Tabs on my website and would like to be able to swipe through them on mobile.

(Swipe the active Tab content to left or right, to activate (show) another Tab content)

How can I achieve such thing?

I'm using the following tabs:

http://jsfiddle.net/yL8ropfj/

const btn = [].slice.call(document.getElementsByTagName('button'))
btn.forEach((item, index) => {
  item.addEventListener('click', function() {
    btn.forEach((item) => {
      item.classList.remove('active')
    })
    item.classList.add('active')
    document.getElementById('tab').setAttribute('data-tab', index)
  })
})

.wrapper {
  overflow: hidden;
}

.tabs {
  position: relative;
  -webkit-transition: all .9s ease-in-out;
  -moz-transition: all .9s ease-in-out;
  -ms-transition: all .9s ease-in-out;
  -o-transition: all .9s ease-in-out;
  transition: all .9s ease-in-out;
}

.tabs>* {
  width: 100%;
}

.tabs[data-tab='1'] {
  transform: translateX(-100%);
}

.tabs[data-tab='2'] {
  transform: translateX(-200%);
}

.tabs[data-tab='3'] {
  transform: translateX(-300%);
}

.tabs[data-tab='4'] {
  transform: translateX(-400%);
}

.inliner {
  white-space: nowrap;
}

.inliner>* {
  display: inline-block;
  *display: inline;
  *zoom: 1;
  font-size: 1rem;
  letter-spacing: normal;
  vertical-align: top;
  word-spacing: normal;
  white-space: normal;
}

  <button> Tab 1</button>
  <button> Tab 2</button>
  <button> Tab 3</button>

Content 1

Content 2

Content 3

I tried starting with draggable / swipable divs for mobile but couldnt even get that to work

Dont know where im messing up, slim to none experience

Glad for answers, any help is much appreciated


问:
Angular 2 not making a http call when
I have a custom event on which I need to fetch the account info. I see that the fetchAccountInfo function gets called from the HostListener but I don't see the call in network, instead the observable just returns the old value. Even Angular interceptor does not receive any call.

Following is mock representation of my code.

In component.ts

```<code>@HostListener('custom-event', ['$event'])
handleEventChange(e: any) {
  this.accountInfoService.fetchAccountInfo().subscribe((data) => {
    console.log(data); // gives old value
  });
}
</code>```

In service.ts

```<code>public fetchAccountInfo(): Observable<IAccountInformation> {
  return this.httpClient
    .get<IAccountInformation>('accountInfoURL')
    .pipe(
      tap((accountInfo) => this.setAccountInfo(accountInfo))
    );
}

private setAccountInfo(accountInfo: IAccountInformation): void {
  this.accountInfoSubject$.next(accountInfo);
}
</code>```

Anyone has any idea why this is happening.

This issue is resolved when we add a random salt query at the end of API url ?q=new Date().getTime().toString()

But I am looking for the reasons behind this issue and maybe a better way to handle this issue.

I have tried setting different cache-control value to request and response, but that did not help.

Please let me know if you need any more details or clarification.

Any help or clues are really appreciated.

Thanks.

Title: Angular 2 not making a http call when

Body:
I have a custom event on which I need to fetch the account info. I see that the fetchAccountInfo function gets called from the HostListener but I don't see the call in network, instead the observable just returns the old value. Even Angular interceptor does not receive any call.

Following is mock representation of my code.

In component.ts

@HostListener('custom-event', ['$event'])
handleEventChange(e: any) {
  this.accountInfoService.fetchAccountInfo().subscribe((data) => {
    console.log(data); // gives old value
  });
}

In service.ts

public fetchAccountInfo(): Observable<IAccountInformation> {
  return this.httpClient
    .get<IAccountInformation>('accountInfoURL')
    .pipe(
      tap((accountInfo) => this.setAccountInfo(accountInfo))
    );
}

private setAccountInfo(accountInfo: IAccountInformation): void {
  this.accountInfoSubject$.next(accountInfo);
}

Anyone has any idea why this is happening.

This issue is resolved when we add a random salt query at the end of API url ?q=new Date().getTime().toString()

But I am looking for the reasons behind this issue and maybe a better way to handle this issue.

I have tried setting different cache-control value to request and response, but that did not help.

Please let me know if you need any more details or clarification.

Any help or clues are really appreciated.

Thanks.


问:
how to uplaod a folder in firebase storage nodejs
Someone know how to upload a folder and files inside it in firebase storage with node.js?

I try to search a solution in the docs but i dont find anythings


问:
mongoDB server connection and basic operation code not working

I setup my mongoDB database and then added the code to connect to mongoDB and perform basic operations like adding an item to Database, updating it and then removing it from the database and finally closing the client server in index.js file.

but when I tried to run the index file while keeping the mongoDB server on , I am getting some long error message which I don't have an idea about...

```<code>const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');

const url = 'mongodb://127.0.0.1:27017/';
const dbname = 'conFusion';

MongoClient.connect(url)
.then((err, client) => {

    assert.equal(err, null);

    console.log('Connected correctly to Server');

    const db = client.db(dbname);
    const collection = db.collection('dishes');

    collection.insertOne({"name":"Uthappizza", "description":"test"})
    .then((err, res) => {

        assert.equal(err, null);

        console.log('After Insert:\n');
        console.log(res.ops);

        collection.find({}).toArray((err, docs) => {
           assert.equal(err, null);

           console.log('Found:\n');
           console.log(docs)

           db.collection.remove('dishes')
           .then((err, res) => {
                assert.equal(err, null);

                client.close();
           });
        });

    });

});
</code>```

output :

```<code>> mongodb-project@1.0.0 start
> node index

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

AssertionError [ERR_ASSERTION]: <ref *1> MongoClient {
  [Symbol(kCapture)]: false,
  [Symbol(options)]: [Object: null prototype] {
    compressors: [
      'none'
    ],
    connectTimeoutMS: 30000,
    dbName: 'test',
    directConnection: false,
    enableUtf8Validation: true,
    forceServerObjectId: false,
    heartbeatFrequencyMS: 10000,
    hosts: [
      HostAddress {
        host: '127.0.0.1',
        isIPv6: false,
        port: 27017,
        socketPath: undefined
      }
    ],
    keepAlive: true,
    keepAliveInitialDelay... == null
    at C:\Users\LENOVO\Desktop\mongoDB project\index.js:10:12
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: <ref *1> MongoClient {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    s: {
      url: 'mongodb://127.0.0.1:27017/',
      bsonOptions: {
        raw: false,
        promoteLongs: true,
        promoteValues: true,
        promoteBuffers: false,
        ignoreUndefined: false,
        bsonRegExp: false,
        serializeFunctions: false,
        fieldsAsRaw: {},
        enableUtf8Validation: true
      },
      namespace: MongoDBNamespace { db: 'admin', collection: undefined },
      hasBeenClosed: false,
      sessionPool: ServerSessionPool {
        client: [Circular *1],
        sessions: List {
          count: 0,
          head: <ref *2> {
            next: [Circular *2],
            prev: [Circular *2],
            value: null
          }
        }
      },
      activeSessions: Set(0) {},
      options: [Getter],
      readConcern: [Getter],
      writeConcern: [Getter],
      readPreference: [Getter],
      logger: [Getter],
      isMongoClient: [Getter]
    },
    topology: Topology {
      _events: [Object: null prototype] {
        connectionPoolCreated: [Function (anonymous)],
        connectionPoolReady: [Function (anonymous)],
        connectionPoolCleared: [Function (anonymous)],
        connectionPoolClosed: [Function (anonymous)],
        connectionCreated: [Function (anonymous)],
        connectionReady: [Function (anonymous)],
        connectionClosed: [Function (anonymous)],
        connectionCheckOutStarted: [Function (anonymous)],
        connectionCheckOutFailed: [Function (anonymous)],
        connectionCheckedOut: [Function (anonymous)],
        connectionCheckedIn: [Function (anonymous)],
        commandStarted: [Function (anonymous)],
        commandSucceeded: [Function (anonymous)],
        commandFailed: [Function (anonymous)],
        serverOpening: [Function (anonymous)],
        serverClosed: [Function (anonymous)],
        serverDescriptionChanged: [Function (anonymous)],
        topologyOpening: [Function (anonymous)],
        topologyClosed: [Function (anonymous)],
        topologyDescriptionChanged: [Function (anonymous)],
        error: [Function (anonymous)],
        timeout: [Function (anonymous)],
        close: [Function (anonymous)],
        serverHeartbeatStarted: [Function (anonymous)],
        serverHeartbeatSucceeded: [Function (anonymous)],
        serverHeartbeatFailed: [Function (anonymous)]
      },
      _eventsCount: 26,
      _maxListeners: undefined,
      selectServerAsync: [Function (anonymous)],
      bson: [Object: null prototype] {
        serialize: [Function: serialize],
        deserialize: [Function: deserialize]
      },
      s: {
        id: 0,
        options: [Object: null prototype] {
          hosts: [ [HostAddress] ],
          compressors: [ 'none' ],
          connectTimeoutMS: 30000,
          directConnection: false,
          metadata: {
            driver: [Object],
            os: [Object],
            platform: 'Node.js v18.12.1, LE (unified)|Node.js v18.12.1, LE (unified)'
          },
          enableUtf8Validation: true,
          forceServerObjectId: false,
          heartbeatFrequencyMS: 10000,
          keepAlive: true,
          keepAliveInitialDelay: 120000,
          loadBalanced: false,
          localThresholdMS: 15,
          logger: Logger { className: 'MongoClient' },
          maxConnecting: 2,
          maxIdleTimeMS: 0,
          maxPoolSize: 100,
          minPoolSize: 0,
          minHeartbeatFrequencyMS: 500,
          monitorCommands: false,
          noDelay: true,
          pkFactory: { createPk: [Function: createPk] },
          raw: false,
          readPreference: ReadPreference {
            mode: 'primary',
            tags: undefined,
            hedge: undefined,
            maxStalenessSeconds: undefined,
            minWireVersion: undefined
          },
          retryReads: true,
          retryWrites: true,
          serverSelectionTimeoutMS: 30000,
          socketTimeoutMS: 0,
          srvMaxHosts: 0,
          srvServiceName: 'mongodb',
          waitQueueTimeoutMS: 0,
          zlibCompressionLevel: 0,
          dbName: 'test',
          userSpecifiedAuthSource: false,
          userSpecifiedReplicaSet: false
        },
        seedlist: [
          HostAddress {
            host: '127.0.0.1',
            port: 27017,
            socketPath: undefined,
            isIPv6: false
          }
        ],
        state: 'connected',
        description: TopologyDescription {
          type: 'Single',
          servers: Map(1) { '127.0.0.1:27017' => [ServerDescription] },
          stale: false,
          compatible: true,
          heartbeatFrequencyMS: 10000,
          localThresholdMS: 15,
          setName: null,
          maxElectionId: null,
          maxSetVersion: null,
          commonWireVersion: 0,
          logicalSessionTimeoutMinutes: 30
        },
        serverSelectionTimeoutMS: 30000,
        heartbeatFrequencyMS: 10000,
        minHeartbeatFrequencyMS: 500,
        servers: Map(1) {
          '127.0.0.1:27017' => Server {
            _events: [Object: null prototype],
            _eventsCount: 18,
            _maxListeners: undefined,
            serverApi: undefined,
            s: [Object],
            [Symbol(kCapture)]: false,
            [Symbol(monitor)]: [Monitor]
          }
        },
        credentials: undefined,
        clusterTime: undefined,
        connectionTimers: Set(0) {},
        detectShardedTopology: [Function: detectShardedTopology],
        detectSrvRecords: [Function: detectSrvRecords]
      },
      client: [Circular *1],
      [Symbol(kCapture)]: false,
      [Symbol(waitQueue)]: List {
        count: 0,
        head: <ref *3> {
          next: [Circular *3],
          prev: [Circular *3],
          value: null
        }
      }
    },
    [Symbol(kCapture)]: false,
    [Symbol(options)]: [Object: null prototype] {
      hosts: [
        HostAddress {
          host: '127.0.0.1',
          port: 27017,
          socketPath: undefined,
          isIPv6: false
        }
      ],
      compressors: [ 'none' ],
      connectTimeoutMS: 30000,
      directConnection: false,
      metadata: {
        driver: { name: 'nodejs', version: '4.12.1' },
        os: {
          type: 'Windows_NT',
          name: 'win32',
          architecture: 'x64',
          version: '10.0.22621'
        },
        platform: 'Node.js v18.12.1, LE (unified)|Node.js v18.12.1, LE (unified)'
      },
      enableUtf8Validation: true,
      forceServerObjectId: false,
      heartbeatFrequencyMS: 10000,
      keepAlive: true,
      keepAliveInitialDelay: 120000,
      loadBalanced: false,
      localThresholdMS: 15,
      logger: Logger { className: 'MongoClient' },
      maxConnecting: 2,
      maxIdleTimeMS: 0,
Node.js v18.12.1
</code>```

I tried to get rid of all deprecated methods and run the index file again but the same error persists.

Body:
I setup my mongoDB database and then added the code to connect to mongoDB and perform basic operations like adding an item to Database, updating it and then removing it from the database and finally closing the client server in index.js file.

but when I tried to run the index file while keeping the mongoDB server on , I am getting some long error message which I don't have an idea about...

const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');

const url = 'mongodb://127.0.0.1:27017/';
const dbname = 'conFusion';

MongoClient.connect(url)
.then((err, client) => {

    assert.equal(err, null);

    console.log('Connected correctly to Server');

    const db = client.db(dbname);
    const collection = db.collection('dishes');

    collection.insertOne({"name":"Uthappizza", "description":"test"})
    .then((err, res) => {

        assert.equal(err, null);

        console.log('After Insert:\n');
        console.log(res.ops);

        collection.find({}).toArray((err, docs) => {
           assert.equal(err, null);

           console.log('Found:\n');
           console.log(docs)

           db.collection.remove('dishes')
           .then((err, res) => {
                assert.equal(err, null);

                client.close();
           });
        });

    });

});

output :

> mongodb-project@1.0.0 start
> node index

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

AssertionError [ERR_ASSERTION]: <ref *1> MongoClient {
  [Symbol(kCapture)]: false,
  [Symbol(options)]: [Object: null prototype] {
    compressors: [
      'none'
    ],
    connectTimeoutMS: 30000,
    dbName: 'test',
    directConnection: false,
    enableUtf8Validation: true,
    forceServerObjectId: false,
    heartbeatFrequencyMS: 10000,
    hosts: [
      HostAddress {
        host: '127.0.0.1',
        isIPv6: false,
        port: 27017,
        socketPath: undefined
      }
    ],
    keepAlive: true,
    keepAliveInitialDelay... == null
    at C:\Users\LENOVO\Desktop\mongoDB project\index.js:10:12
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: <ref *1> MongoClient {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    s: {
      url: 'mongodb://127.0.0.1:27017/',
      bsonOptions: {
        raw: false,
        promoteLongs: true,
        promoteValues: true,
        promoteBuffers: false,
        ignoreUndefined: false,
        bsonRegExp: false,
        serializeFunctions: false,
        fieldsAsRaw: {},
        enableUtf8Validation: true
      },
      namespace: MongoDBNamespace { db: 'admin', collection: undefined },
      hasBeenClosed: false,
      sessionPool: ServerSessionPool {
        client: [Circular *1],
        sessions: List {
          count: 0,
          head: <ref *2> {
            next: [Circular *2],
            prev: [Circular *2],
            value: null
          }
        }
      },
      activeSessions: Set(0) {},
      options: [Getter],
      readConcern: [Getter],
      writeConcern: [Getter],
      readPreference: [Getter],
      logger: [Getter],
      isMongoClient: [Getter]
    },
    topology: Topology {
      _events: [Object: null prototype] {
        connectionPoolCreated: [Function (anonymous)],
        connectionPoolReady: [Function (anonymous)],
        connectionPoolCleared: [Function (anonymous)],
        connectionPoolClosed: [Function (anonymous)],
        connectionCreated: [Function (anonymous)],
        connectionReady: [Function (anonymous)],
        connectionClosed: [Function (anonymous)],
        connectionCheckOutStarted: [Function (anonymous)],
        connectionCheckOutFailed: [Function (anonymous)],
        connectionCheckedOut: [Function (anonymous)],
        connectionCheckedIn: [Function (anonymous)],
        commandStarted: [Function (anonymous)],
        commandSucceeded: [Function (anonymous)],
        commandFailed: [Function (anonymous)],
        serverOpening: [Function (anonymous)],
        serverClosed: [Function (anonymous)],
        serverDescriptionChanged: [Function (anonymous)],
        topologyOpening: [Function (anonymous)],
        topologyClosed: [Function (anonymous)],
        topologyDescriptionChanged: [Function (anonymous)],
        error: [Function (anonymous)],
        timeout: [Function (anonymous)],
        close: [Function (anonymous)],
        serverHeartbeatStarted: [Function (anonymous)],
        serverHeartbeatSucceeded: [Function (anonymous)],
        serverHeartbeatFailed: [Function (anonymous)]
      },
      _eventsCount: 26,
      _maxListeners: undefined,
      selectServerAsync: [Function (anonymous)],
      bson: [Object: null prototype] {
        serialize: [Function: serialize],
        deserialize: [Function: deserialize]
      },
      s: {
        id: 0,
        options: [Object: null prototype] {
          hosts: [ [HostAddress] ],
          compressors: [ 'none' ],
          connectTimeoutMS: 30000,
          directConnection: false,
          metadata: {
            driver: [Object],
            os: [Object],
            platform: 'Node.js v18.12.1, LE (unified)|Node.js v18.12.1, LE (unified)'
          },
          enableUtf8Validation: true,
          forceServerObjectId: false,
          heartbeatFrequencyMS: 10000,
          keepAlive: true,
          keepAliveInitialDelay: 120000,
          loadBalanced: false,
          localThresholdMS: 15,
          logger: Logger { className: 'MongoClient' },
          maxConnecting: 2,
          maxIdleTimeMS: 0,
          maxPoolSize: 100,
          minPoolSize: 0,
          minHeartbeatFrequencyMS: 500,
          monitorCommands: false,
          noDelay: true,
          pkFactory: { createPk: [Function: createPk] },
          raw: false,
          readPreference: ReadPreference {
            mode: 'primary',
            tags: undefined,
            hedge: undefined,
            maxStalenessSeconds: undefined,
            minWireVersion: undefined
          },
          retryReads: true,
          retryWrites: true,
          serverSelectionTimeoutMS: 30000,
          socketTimeoutMS: 0,
          srvMaxHosts: 0,
          srvServiceName: 'mongodb',
          waitQueueTimeoutMS: 0,
          zlibCompressionLevel: 0,
          dbName: 'test',
          userSpecifiedAuthSource: false,
          userSpecifiedReplicaSet: false
        },
        seedlist: [
          HostAddress {
            host: '127.0.0.1',
            port: 27017,
            socketPath: undefined,
            isIPv6: false
          }
        ],
        state: 'connected',
        description: TopologyDescription {
          type: 'Single',
          servers: Map(1) { '127.0.0.1:27017' => [ServerDescription] },
          stale: false,
          compatible: true,
          heartbeatFrequencyMS: 10000,
          localThresholdMS: 15,
          setName: null,
          maxElectionId: null,
          maxSetVersion: null,
          commonWireVersion: 0,
          logicalSessionTimeoutMinutes: 30
        },
        serverSelectionTimeoutMS: 30000,
        heartbeatFrequencyMS: 10000,
        minHeartbeatFrequencyMS: 500,
        servers: Map(1) {
          '127.0.0.1:27017' => Server {
            _events: [Object: null prototype],
            _eventsCount: 18,
            _maxListeners: undefined,
            serverApi: undefined,
            s: [Object],
            [Symbol(kCapture)]: false,
            [Symbol(monitor)]: [Monitor]
          }
        },
        credentials: undefined,
        clusterTime: undefined,
        connectionTimers: Set(0) {},
        detectShardedTopology: [Function: detectShardedTopology],
        detectSrvRecords: [Function: detectSrvRecords]
      },
      client: [Circular *1],
      [Symbol(kCapture)]: false,
      [Symbol(waitQueue)]: List {
        count: 0,
        head: <ref *3> {
          next: [Circular *3],
          prev: [Circular *3],
          value: null
        }
      }
    },
    [Symbol(kCapture)]: false,
    [Symbol(options)]: [Object: null prototype] {
      hosts: [
        HostAddress {
          host: '127.0.0.1',
          port: 27017,
          socketPath: undefined,
          isIPv6: false
        }
      ],
      compressors: [ 'none' ],
      connectTimeoutMS: 30000,
      directConnection: false,
      metadata: {
        driver: { name: 'nodejs', version: '4.12.1' },
        os: {
          type: 'Windows_NT',
          name: 'win32',
          architecture: 'x64',
          version: '10.0.22621'
        },
        platform: 'Node.js v18.12.1, LE (unified)|Node.js v18.12.1, LE (unified)'
      },
      enableUtf8Validation: true,
      forceServerObjectId: false,
      heartbeatFrequencyMS: 10000,
      keepAlive: true,
      keepAliveInitialDelay: 120000,
      loadBalanced: false,
      localThresholdMS: 15,
      logger: Logger { className: 'MongoClient' },
      maxConnecting: 2,
      maxIdleTimeMS: 0,
Node.js v18.12.1

I tried to get rid of all deprecated methods and run the index file again but the same error persists.


问:
Excel Offset: Automating the Reference Cell by using Index Match
If the answer was already provided, please feel free to post the link, but I did not see one.

This is a real estate example. I have a table of a lot of properties and information. One of the fields is "Occupancy." I am trying to use the AVERAGE OFFSET functions combined with CELL and INDEX/MATCH to calculate the average Occupancy of the top 5 and top 10 buildings in this table. To accomplish this, I wanted to create a "Summary Table" below the Property table to list the averages.

Specifically:

For OFFSET, in the "Reference" section, I want to look up "Occupancy" in my summary cell, use INDEX MATCH to find "Occupancy" in the table, and then;

I want the Cell Reference returned AS A VALUE and then move one row down and then highlight the top 5.

Most importantly, I want everything cell referenced without hardcoding or navigating the table to highlight the cell reference. I am not sure if this is possible, but after pouring through a bunch of articles, I am having trouble finding a solution.

To make things simple, let's pull out all the columns I had in the original table and go off the below. Assume all the data types are in the proper format:

```<code>     **COLUMN A**       **COLUMN B**
ROW 1 | Properties   | Occupancy   |
ROW 2 | Property A   | 58%         |
ROW 3 | Property B   | 56%         |
ROW 4 | Property C   | 77%         |
ROW 5 | Property D   | 85%         |
ROW 6 | Property E   | 92%         |

ROW 7

ROW 8 |Top 5         |              |  'NOTE: I used a custom formula to format:
                                     "Top "#. Please do not think this is text.

ROW 10|Occupancy     | **CODE HERE**| 'Format is "General"
ROW 11|              |              |
ROW 12|              |              |
</code>```

Here's how I initially coded it in B10:

```<code>'=AVERAGE(OFFSET(CELL("address",INDEX($A$1:$B$1,MATCH(A10,$A$1:$B$1,0))),1,0,5,1))
</code>```

I am getting "there is a problem with your formula" since I am guessing it is due to the cell returning text in lieu of the cell reference as a value. So I error checked myself and stripped out the AVERAGE, OFFSET and put this is B11:

```<code>'=CELL("address",INDEX($A$1:$B$1,MATCH(A10,$A$1:$B$1,0)))
</code>```

I know I get $B$1, so I then put $B$1 to replace the CELL function within B10 to see if my average offset is wrong:

```<code>=AVERAGE(OFFSET($B$1,1,0,5,1))
</code>```

I now get the right solution since I went and hardcoded the reference, which does not solve the issue.

If I use INDIRECT and then CELL in B12:

```<code>'=INDIRECT(CELL("address",INDEX($A$1:$B$1,MATCH(A10,$A$1:$B$1,0))))
</code>```

I then get the title "Occupancy" and not the cell reference.

Obviously, I am aware of the fact that the CELL function will return text and not a value. I can't use INDIRECT because when I do, INDIRECT will just display the title of the column in text and not return the cell reference as a value. ADDRESS is not useful because you have to hardcode and the goal is to have zero hardcodes.

How can I code finding the cell reference of specific text in a table without actually going to the table to cell reference when I am building out my OFFSET function?

As you can see, I went through a variety of ways to dissect the problem and I would appreciate anyone's help to come to a solution. Thanks in advance.

Body:
If the answer was already provided, please feel free to post the link, but I did not see one.

This is a real estate example. I have a table of a lot of properties and information. One of the fields is "Occupancy." I am trying to use the AVERAGE OFFSET functions combined with CELL and INDEX/MATCH to calculate the average Occupancy of the top 5 and top 10 buildings in this table. To accomplish this, I wanted to create a "Summary Table" below the Property table to list the averages.

Specifically:

For OFFSET, in the "Reference" section, I want to look up "Occupancy" in my summary cell, use INDEX MATCH to find "Occupancy" in the table, and then;

I want the Cell Reference returned AS A VALUE and then move one row down and then highlight the top 5.

Most importantly, I want everything cell referenced without hardcoding or navigating the table to highlight the cell reference. I am not sure if this is possible, but after pouring through a bunch of articles, I am having trouble finding a solution.

To make things simple, let's pull out all the columns I had in the original table and go off the below. Assume all the data types are in the proper format:

     **COLUMN A**       **COLUMN B**
ROW 1 | Properties   | Occupancy   |
ROW 2 | Property A   | 58%         |
ROW 3 | Property B   | 56%         |
ROW 4 | Property C   | 77%         |
ROW 5 | Property D   | 85%         |
ROW 6 | Property E   | 92%         |

ROW 7

ROW 8 |Top 5         |              |  'NOTE: I used a custom formula to format:
                                     "Top "#. Please do not think this is text.

ROW 10|Occupancy     | **CODE HERE**| 'Format is "General"
ROW 11|              |              |
ROW 12|              |              |

Here's how I initially coded it in B10:

'=AVERAGE(OFFSET(CELL("address",INDEX($A$1:$B$1,MATCH(A10,$A$1:$B$1,0))),1,0,5,1))

I am getting "there is a problem with your formula" since I am guessing it is due to the cell returning text in lieu of the cell reference as a value. So I error checked myself and stripped out the AVERAGE, OFFSET and put this is B11:

'=CELL("address",INDEX($A$1:$B$1,MATCH(A10,$A$1:$B$1,0)))

I know I get $B$1, so I then put $B$1 to replace the CELL function within B10 to see if my average offset is wrong:

=AVERAGE(OFFSET($B$1,1,0,5,1))

I now get the right solution since I went and hardcoded the reference, which does not solve the issue.

If I use INDIRECT and then CELL in B12:

'=INDIRECT(CELL("address",INDEX($A$1:$B$1,MATCH(A10,$A$1:$B$1,0))))

I then get the title "Occupancy" and not the cell reference.

Obviously, I am aware of the fact that the CELL function will return text and not a value. I can't use INDIRECT because when I do, INDIRECT will just display the title of the column in text and not return the cell reference as a value. ADDRESS is not useful because you have to hardcode and the goal is to have zero hardcodes.

How can I code finding the cell reference of specific text in a table without actually going to the table to cell reference when I am building out my OFFSET function?

As you can see, I went through a variety of ways to dissect the problem and I would appreciate anyone's help to come to a solution. Thanks in advance.


问:
Having connection issue while connecting to MariaDb Galera cluster using mariadb jdbc connector plugin
Error: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: (conn=6037539) Client does not support authentication protocol requested by server; consider upgrading MySQL client

Mariadb Client I am using:

```<code><dependency>
  <groupId>org.mariadb.jdbc</groupId>
  <artifactId>mariadb-java-client</artifactId>
  <version>3.1.0</version>
</dependency>
</code>```

Connection String:

```<code>jdbc:mariadb://myremoteserverhost:3306/MY_DATABASE
</code>```

driver-class-name: org.mariadb.jdbc.Driver

```<code>I am using a spring boot application using maven as a build tool.

Can anyone help me solve this why the spring boot application using the mentioned jdbc client cannot make a connection to the database.

I am expecting a successfull connection made to the database
</code>```

Body:
Error: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: (conn=6037539) Client does not support authentication protocol requested by server; consider upgrading MySQL client

Mariadb Client I am using:

<dependency>
  <groupId>org.mariadb.jdbc</groupId>
  <artifactId>mariadb-java-client</artifactId>
  <version>3.1.0</version>
</dependency>

Connection String:

jdbc:mariadb://myremoteserverhost:3306/MY_DATABASE

driver-class-name: org.mariadb.jdbc.Driver

I am using a spring boot application using maven as a build tool.

Can anyone help me solve this why the spring boot application using the mentioned jdbc client cannot make a connection to the database.

I am expecting a successfull connection made to the database


问:
Encapsulated styles in react
I have two react projects (A, B). I have to include the project A inside the project B.

A: Made it with CRA, craco and scss modules.
B: Made with webpack.

The problem is that the styles of the project A are afecting the styles of the project B.

So I'm trying to encapsulate all the styles inside the root of the project A so it doesn't affect the project B. So far I didn't find a way to do it.

I can put more info if needed.

Thanks for the help

Title: Encapsulated styles in react


问:
Delay in the start of audio emit
I’m seeing two intermittent issues using just_audio for playback on iOS.  They have continued for months, but are seemingly random and I’ve not found how to reproduce.  Has anyone else had this and know how to solve it?

Scenario 1: Many times when playing audio, I have noticed that it starts with some delay. just_audio reports the change of position and states but I have a couple of seconds of no audio. If I pause the playback, or change the position, everything settles and corrects itself and everything works correctly.

Scenario 2: Sometimes audio is playing and then just stops emitting sound.  It still is reporting position and stage so it seems like playback is happening. Seeking to another spot will get it to start emitting sound again. Hitting pause will also kick it to get sound coming out again.

These may be different issues, but they feel related and both have only been seen to happen on iOS and not Android.

Title: Delay in the start of audio emit


问:
Blazor Controls the ChildContent property
I want to control the properties of the component passed in the SButtonGroup's ChildContent. It is a delegate. How do I get the passed component and pass the parameters to the component?


问:
Telerik UI Kendo Grid Dirty Markers
I have a razor page that implements a Telerik UI Kendo Grid .I want to use javascript to set / unset the dirty markers for certain fields in the grid when there is an error.

I have searched many forums and google'd the problem and looked at the examples on GitHub, but I cannot get anything to work.

I tried :
`

```<code>  function onError(e) {
            // got any error messages
            if (e.errors) {
                e.preventDefault();
                var grid = $("#grid").data("kendoGrid");
                var data = grid.dataSource.data();

                for (var i = 0; i < data.length; i++) {

                    data[i].dirty = true;
                }
                grid.refresh();
            }
        }
</code>```

I have also tried:

```<code>     function onError(e) {
            // got any error messages
            if (e.errors) {
                var grid = $("#grid").data("kendoGrid");
                var $gridData = grid.dataSource.data();

                for (var i = 0; i < $gridData.length; i++) {

                    var row = grid.tbody.find("tr[data-uid='" + $gridData[i].uid + "']");
                    var cell = row.find("td:eq(" + $gridData[i].ColumnIndex + ")");

                    cell.addClass("k-dirty-cell");
                    $gridData[i].dirty = true;
                    var foo = "";
                }

                grid.refresh();
            }
        }

</code>```

`

Thank you for your help.

Title: Telerik UI Kendo Grid Dirty Markers

Body:
I have a razor page that implements a Telerik UI Kendo Grid .I want to use javascript to set / unset the dirty markers for certain fields in the grid when there is an error.

I have searched many forums and google'd the problem and looked at the examples on GitHub, but I cannot get anything to work.

I tried :
`

  function onError(e) {
            // got any error messages
            if (e.errors) {
                e.preventDefault();
                var grid = $("#grid").data("kendoGrid");
                var data = grid.dataSource.data();

                for (var i = 0; i < data.length; i++) {

                    data[i].dirty = true;
                }
                grid.refresh();
            }
        }

I have also tried:

     function onError(e) {
            // got any error messages
            if (e.errors) {
                var grid = $("#grid").data("kendoGrid");
                var $gridData = grid.dataSource.data();

                for (var i = 0; i < $gridData.length; i++) {

                    var row = grid.tbody.find("tr[data-uid='" + $gridData[i].uid + "']");
                    var cell = row.find("td:eq(" + $gridData[i].ColumnIndex + ")");

                    cell.addClass("k-dirty-cell");
                    $gridData[i].dirty = true;
                    var foo = "";
                }

                grid.refresh();
            }
        }

`

Thank you for your help.


问:
Python and XML parsing non-parent/child data as a group
My goal is to parse an XML file using python ultimately reformatting certain data and writing it to a text file. The issue I am having is that the specific data I want to obtain does not have a parent/child relationship. The data is essentially bracketed by a start element and an end element. My ideas so far:

Make a list of the start and end elements IDs or location

Iterate through the elements and compare each element ID or location to see if it falls within the bracketed sets from 1

My question, is this even the right place to start? Below is a piece of the XML and I am trying to get all the data that falls between the <StartRoundsRecord ID="0000006f" TimeStamp="2022-11-29T09:00:10"/> and the
<EndRoundsRecord ID="0000007c" TimeStamp="2022-11-29T09:00:47"/>.

<?xml version="1.0" encoding="UTF-8"?>
<JOBFile jobName="185968_22_333_1" version="5.72" product="Trimble Access" productVersion="22.00" productDBVersion="2200-16" controllerSerialNumber="DAD181502429" TimeStamp="2022-11-29T08:57:38"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.trimble.com/schema/JobXML/5_7 http://www.trimble.com/schema/JobXML/5_7/JobXMLSchema-5.72.xsd">
    <FieldBook>

        <EllipsoidRecord ID="00000003" TimeStamp="2022-11-29T08:57:38">
            <EarthRadius/>
            <Flattening/>
        </EllipsoidRecord>

        <ProjectionRecord ID="00000004" TimeStamp="2022-11-29T08:57:38">
            <Projection>
                <Type>ScaleOnly</Type>
                <Scale>1</Scale>
            </Projection>
            <LocalSite>
                <Type>Grid</Type>
                <ProjectLocationLatitude/>
                <ProjectLocationLongitude/>
                <ProjectLocationHeight/>
            </LocalSite>
        </ProjectionRecord>

        <StartRoundsRecord ID="0000006f" TimeStamp="2022-11-29T09:00:10"/>

        <StartRoundRecord ID="00000070" TimeStamp="2022-11-29T09:00:10">
            <Round>1</Round>
        </StartRoundRecord>

        <TargetRecord ID="00000066" TimeStamp="2022-11-29T09:00:26">
            <PrismType>CustomPrism</PrismType>
            <PrismConstant>-0.03</PrismConstant>
            <TargetHeight>1.7038354076708</TargetHeight>
            <RawTargetHeight>
                <MeasurementMethod>TrueHeight</MeasurementMethod>
                <MeasuredHeight>1.7038354076708</MeasuredHeight>
                <HorizontalOffset>0</HorizontalOffset>
                <VerticalOffset>0</VerticalOffset>
            </RawTargetHeight>
        </TargetRecord>

        <PointRecord ID="00000067" TimeStamp="2022-11-29T09:00:10">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>37.6303464</HorizontalCircle>
                <VerticalCircle>90.2625264</VerticalCircle>
                <EDMDistance>117.4012</EDMDistance>
                <Face>Face1</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.0022348024</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38447583</North>
                <East>487316.07639709</East>
                <Elevation>192.63673294119</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <PointRecord ID="0000006b" TimeStamp="2022-11-29T09:00:19">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>217.6297299</HorizontalCircle>
                <VerticalCircle>269.7371991</VerticalCircle>
                <EDMDistance>117.40189</EDMDistance>
                <Face>Face2</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.00223480378</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38737123</North>
                <East>487316.0737672</East>
                <Elevation>192.63616748002</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <EndRoundRecord ID="00000071" TimeStamp="2022-11-29T09:00:26"/>

        <StartRoundRecord ID="0000007a" TimeStamp="2022-11-29T09:00:34">
            <Round>2</Round>
        </StartRoundRecord>

        <PointRecord ID="00000072" TimeStamp="2022-11-29T09:00:34">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>37.630215</HorizontalCircle>
                <VerticalCircle>90.2616921</VerticalCircle>
                <EDMDistance>117.39994</EDMDistance>
                <Face>Face1</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.00223479988</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38364849</North>
                <East>487316.07541938</East>
                <Elevation>192.6384477215</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <PointRecord ID="00000076" TimeStamp="2022-11-29T09:00:43">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>217.6297407</HorizontalCircle>
                <VerticalCircle>269.7377067</VerticalCircle>
                <EDMDistance>117.40069</EDMDistance>
                <Face>Face2</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.00223480138</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38641113</North>
                <East>487316.07305499</East>
                <Elevation>192.63721276808</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <EndRoundRecord ID="0000007b" TimeStamp="2022-11-29T09:00:47"/>

        <EndRoundsRecord ID="0000007c" TimeStamp="2022-11-29T09:00:47"/>
```
<p>I was able to create an array of the start and end IDs but do not know if comparing ids to my array will even work:</p>
<pre class="lang-py prettyprint-override"><code>for item in root.findall('./FieldBook'):

    #iterate child elements of item
    for child in item:
        if child.tag == 'StartRoundsRecord':
            startrounds.append(child.attrib['ID'])
        if child.tag == 'EndRoundsRecord':
            endrounds.append(child.attrib['ID'])

rounds = list(zip(startrounds, endrounds))
print(rounds)
</code>```

Also, by printing the element record I can get the location within the file:

for x in root.iter('StartRoundsRecord'):
    print(x)
```

Would this be a better way to group the elements?

Body:
My goal is to parse an XML file using python ultimately reformatting certain data and writing it to a text file. The issue I am having is that the specific data I want to obtain does not have a parent/child relationship. The data is essentially bracketed by a start element and an end element. My ideas so far:

Make a list of the start and end elements IDs or location

Iterate through the elements and compare each element ID or location to see if it falls within the bracketed sets from 1

My question, is this even the right place to start? Below is a piece of the XML and I am trying to get all the data that falls between the <StartRoundsRecord ID="0000006f" TimeStamp="2022-11-29T09:00:10"/> and the
<EndRoundsRecord ID="0000007c" TimeStamp="2022-11-29T09:00:47"/>.

<?xml version="1.0" encoding="UTF-8"?>
<JOBFile jobName="185968_22_333_1" version="5.72" product="Trimble Access" productVersion="22.00" productDBVersion="2200-16" controllerSerialNumber="DAD181502429" TimeStamp="2022-11-29T08:57:38"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.trimble.com/schema/JobXML/5_7 http://www.trimble.com/schema/JobXML/5_7/JobXMLSchema-5.72.xsd">
    <FieldBook>

        <EllipsoidRecord ID="00000003" TimeStamp="2022-11-29T08:57:38">
            <EarthRadius/>
            <Flattening/>
        </EllipsoidRecord>

        <ProjectionRecord ID="00000004" TimeStamp="2022-11-29T08:57:38">
            <Projection>
                <Type>ScaleOnly</Type>
                <Scale>1</Scale>
            </Projection>
            <LocalSite>
                <Type>Grid</Type>
                <ProjectLocationLatitude/>
                <ProjectLocationLongitude/>
                <ProjectLocationHeight/>
            </LocalSite>
        </ProjectionRecord>

        <StartRoundsRecord ID="0000006f" TimeStamp="2022-11-29T09:00:10"/>

        <StartRoundRecord ID="00000070" TimeStamp="2022-11-29T09:00:10">
            <Round>1</Round>
        </StartRoundRecord>

        <TargetRecord ID="00000066" TimeStamp="2022-11-29T09:00:26">
            <PrismType>CustomPrism</PrismType>
            <PrismConstant>-0.03</PrismConstant>
            <TargetHeight>1.7038354076708</TargetHeight>
            <RawTargetHeight>
                <MeasurementMethod>TrueHeight</MeasurementMethod>
                <MeasuredHeight>1.7038354076708</MeasuredHeight>
                <HorizontalOffset>0</HorizontalOffset>
                <VerticalOffset>0</VerticalOffset>
            </RawTargetHeight>
        </TargetRecord>

        <PointRecord ID="00000067" TimeStamp="2022-11-29T09:00:10">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>37.6303464</HorizontalCircle>
                <VerticalCircle>90.2625264</VerticalCircle>
                <EDMDistance>117.4012</EDMDistance>
                <Face>Face1</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.0022348024</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38447583</North>
                <East>487316.07639709</East>
                <Elevation>192.63673294119</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <PointRecord ID="0000006b" TimeStamp="2022-11-29T09:00:19">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>217.6297299</HorizontalCircle>
                <VerticalCircle>269.7371991</VerticalCircle>
                <EDMDistance>117.40189</EDMDistance>
                <Face>Face2</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.00223480378</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38737123</North>
                <East>487316.0737672</East>
                <Elevation>192.63616748002</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <EndRoundRecord ID="00000071" TimeStamp="2022-11-29T09:00:26"/>

        <StartRoundRecord ID="0000007a" TimeStamp="2022-11-29T09:00:34">
            <Round>2</Round>
        </StartRoundRecord>

        <PointRecord ID="00000072" TimeStamp="2022-11-29T09:00:34">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>37.630215</HorizontalCircle>
                <VerticalCircle>90.2616921</VerticalCircle>
                <EDMDistance>117.39994</EDMDistance>
                <Face>Face1</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.00223479988</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38364849</North>
                <East>487316.07541938</East>
                <Elevation>192.6384477215</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <PointRecord ID="00000076" TimeStamp="2022-11-29T09:00:43">
            <Name>16</Name>
            1INIPW/PP
            <Method>DirectReading</Method>
            <SurveyMethod>Fix</SurveyMethod>
            <Classification>Normal</Classification>
            <Deleted>false</Deleted>

            <Circle>
                <HorizontalCircle>217.6297407</HorizontalCircle>
                <VerticalCircle>269.7377067</VerticalCircle>
                <EDMDistance>117.40069</EDMDistance>
                <Face>Face2</Face>
                <HorizontalCircleStandardError>0.00027777777778</HorizontalCircleStandardError>
                <VerticalCircleStandardError>0.00027777777778</VerticalCircleStandardError>
                <EDMDistanceStandardError>0.00223480138</EDMDistanceStandardError>
                <EDMMeasurementMode>Fine</EDMMeasurementMode>
            </Circle>
            <StationID>00000053</StationID>
            <BackBearingID>00000054</BackBearingID>
            <TargetID>00000066</TargetID>
            <Pressure>1013.5459756583</Pressure>
            <Temperature>12.777777777778</Temperature>

            <ComputedGrid>
                <North>197106.38641113</North>
                <East>487316.07305499</East>
                <Elevation>192.63721276808</Elevation>
            </ComputedGrid>
            <Notes>
                <Note>Modified 10:36:44 AM 11/29/2022</Note>
                <Note>Old point name 16C</Note>
            </Notes>
        </PointRecord>

        <EndRoundRecord ID="0000007b" TimeStamp="2022-11-29T09:00:47"/>

        <EndRoundsRecord ID="0000007c" TimeStamp="2022-11-29T09:00:47"/>

I was able to create an array of the start and end IDs but do not know if comparing ids to my array will even work:

for item in root.findall('./FieldBook'):

    #iterate child elements of item
    for child in item:
        if child.tag == 'StartRoundsRecord':
            startrounds.append(child.attrib['ID'])
        if child.tag == 'EndRoundsRecord':
            endrounds.append(child.attrib['ID'])

rounds = list(zip(startrounds, endrounds))
print(rounds)

Also, by printing the element record I can get the location within the file:

for x in root.iter('StartRoundsRecord'):
    print(x)

Would this be a better way to group the elements?


问:
How can I attribute schema's privileges to a role?
Consider this case, in an Oracle database, there are some privileges attributed to an HR schema for example; i have created a role developer_user and i want to attribute HR's privileges to this role.What query should I try ? Thanks in advance.

I tried this but it didn't pay off :

SQL> GRANT all privileges from dba_sys_privs to developer_user where grantee='HR' ;


问:
Rechart stack barchart inner curve issue
I want to design a stack bar chart with an inner edge curve, I am using Rechart library.

This is my code for that:

```<code><ResponsiveContainer width="100%" height="100%">
 <BarChart
      width={500}
      height={300}
      data={data}
      margin={{
          top: 20,
          right: 30,
          left: 20,
          bottom: 5,
      }}
  >
      <CartesianGrid strokeDasharray="10" vertical={false} />
      <XAxis dataKey="name" axisLine={false} tick={CustomizedXAxisTick} />
      <YAxis axisLine={false} tick={CustomizedYAxisTick} />
      <Tooltip
          cursor={false}
          wrapperStyle={{ outline: "none" }}
          position={{

              x: position?.data.x ?? 0,
              y: position?.data.y ?? 0
          }}
          content={<CustomTooltip />}
      />

      <Bar dataKey="Company" stackId="a" fill="#49ABA8" radius={[0, 0, 10, 10]} />
      <Bar dataKey="Employee" stackId="a" fill="#296E6B" radius={[10, 10, 0, 0]}
          onMouseMove={(data) => setPosition({ data: data, show: true })}
          onMouseLeave={(data) =>
              setPosition({ data: data, show: false })
          }
      />
  </BarChart>
</ResponsiveContainer>
</code>```

I did not get the expected output

Output:

Expected output :

Expected output:

Body:
I want to design a stack bar chart with an inner edge curve, I am using Rechart library.

This is my code for that:

<ResponsiveContainer width="100%" height="100%">
 <BarChart
      width={500}
      height={300}
      data={data}
      margin={{
          top: 20,
          right: 30,
          left: 20,
          bottom: 5,
      }}
  >
      <CartesianGrid strokeDasharray="10" vertical={false} />
      <XAxis dataKey="name" axisLine={false} tick={CustomizedXAxisTick} />
      <YAxis axisLine={false} tick={CustomizedYAxisTick} />
      <Tooltip
          cursor={false}
          wrapperStyle={{ outline: "none" }}
          position={{

              x: position?.data.x ?? 0,
              y: position?.data.y ?? 0
          }}
          content={<CustomTooltip />}
      />

      <Bar dataKey="Company" stackId="a" fill="#49ABA8" radius={[0, 0, 10, 10]} />
      <Bar dataKey="Employee" stackId="a" fill="#296E6B" radius={[10, 10, 0, 0]}
          onMouseMove={(data) => setPosition({ data: data, show: true })}
          onMouseLeave={(data) =>
              setPosition({ data: data, show: false })
          }
      />
  </BarChart>
</ResponsiveContainer>

I did not get the expected output

Output:

Expected output :

Expected output:


问:
google tag datalayer push on ascx.page
I am trying to implement google tag with event purchase to our ecommerce site. However the site is built in old ASP.NET. I need to push to the data layer all of items that were in the cart when the purchase was completed. I do have information which I want to push in code behing ascx.cs (information about number of products and specific properties for them) - I would like to use them on .asxc file where I do have javascript for pushing the informations to google tag manager. So it more or less looks like this:

<asp:PlaceHolder>
 vvvv
</asp:PlaceHolder>```

So more question is like this: is it possible to get data from ascx.cs file directly into .asxc, so I can put the data from there inside gta values like item_id, item_name etc. Or is there any other better way? For example use document.querySelector('') inside the script tag for each of the property values? Thanks in advance ;)

Title: google tag datalayer push on ascx.page

Body:
I am trying to implement google tag with event purchase to our ecommerce site. However the site is built in old ASP.NET. I need to push to the data layer all of items that were in the cart when the purchase was completed. I do have information which I want to push in code behing ascx.cs (information about number of products and specific properties for them) - I would like to use them on .asxc file where I do have javascript for pushing the informations to google tag manager. So it more or less looks like this:

<asp:PlaceHolder>
 vvvv
</asp:PlaceHolder>

So more question is like this: is it possible to get data from ascx.cs file directly into .asxc, so I can put the data from there inside gta values like item_id, item_name etc. Or is there any other better way? For example use document.querySelector('') inside the script tag for each of the property values? Thanks in advance ;)


问:
Publish Excel addin through SharePoint catalog
I am trying to publish an Excel addin with Sharepoint catalog (Sharepoint online) as documented here https://learn.microsoft.com/en-us/office/dev/add-ins/publish/publish

If I try to access the addin from Excel Online everything works correctly, but from Excel Desktop when I try to add the addin from the catalog I get the following error.

Obviously on Excel desktop I am logged in with a SharePoint user who has access to the catalog. If I log in with the same user from a web browser I can access and download the manifest and add and use the addin correctly through Excel Online.

The Sharepoint catalog is accessible to Everyone except external users.

How can I manage to distribute the addin correctly ?


问:
Regex, extract substring from a list of multiple options
I am trying to extract out certain subtrings from email patterns.
I have a list of options the substring could match, is there a way to create a regex that will extract the substring from the total string if one of the matching substrings is in it. There is never be a situation where more than one substring shows up.

EX:

List of substring: confidental, customer, personal, unclassified.

dgov-cpd-confidental@gmail.com

dgov-rpt-personal-retr@gmail.com

dgov-trp-unclassified-ret@gmail.com

In this case i want to extract confidential, personal then unclassified.


问:
eksctl prefixes everything it creates with "eksctl" How do I chagne that?
The AWS team in my company has things locked down so that everything, including IAM roles, need to be prefixed with "project".  I set the name of the cluster I'm trying to create to have that:  project-projname.  But it's still trying to create everything as eksctl-project-projname.  And so is getting rejected.  I'm using a clusterConfig file.</p>
```<code>apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: project-leaf-legacy
  region: us-gov-west-1

managedNodeGroups:
  - name: project-leaf-workers
    instanceType: t2.medium
    labels: { role: worker }
    ami: <custom ami>
    desiredCapacity: 2
    ssh: # use existing EC2 key
      publicKeyName: supersecretsquirel
    overrideBootstrapCommand: |
      #!/bin/bash
      /etc/eks/bootstrap.sh project-leaf-legacy
</code>```

Body:
The AWS team in my company has things locked down so that everything, including IAM roles, need to be prefixed with "project".  I set the name of the cluster I'm trying to create to have that:  project-projname.  But it's still trying to create everything as eksctl-project-projname.  And so is getting rejected.  I'm using a clusterConfig file.

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: project-leaf-legacy
  region: us-gov-west-1

managedNodeGroups:
  - name: project-leaf-workers
    instanceType: t2.medium
    labels: { role: worker }
    ami: <custom ami>
    desiredCapacity: 2
    ssh: # use existing EC2 key
      publicKeyName: supersecretsquirel
    overrideBootstrapCommand: |
      #!/bin/bash
      /etc/eks/bootstrap.sh project-leaf-legacy


问:
Is there a more idiomatic way to do edge detection using ndarray?
Suppose I have an image represented as an Array2<u32>, for example:

```<code>const SIZE: usize = 8;
let image = Array2::from_elem((SIZE, SIZE), 0_u32);
</code>```

I want to obtain an Array2<bool> that has true in all locations where at least one pixel (in a 4-connected neighbourhood) is different from the current one. It's fine if this is 2 pixels smaller on each side.

Right now I'm doing it like this:

```<code>    let edges = Zip::from(image.slice(s![1..(INNER + 1), 1..(INNER + 1)]))
        .and(image.slice(s![0..(INNER + 0), 1..(INNER + 1)]))
        .and(image.slice(s![2..(INNER + 2), 1..(INNER + 1)]))
        .and(image.slice(s![1..(INNER + 1), 0..(INNER + 0)]))
        .and(image.slice(s![1..(INNER + 1), 2..(INNER + 2)]))
        .map_collect(|c, n, s, w, e| {
            [n, s, w, e].into_iter().any(|v| v != c)
        });
</code>```

However, I have several other operations that act on neighbouring elements, so I would like to build an abstraction. I can probably write an extension trait for Zip that lets me write this:

```<code>    let edges = Zip::from(image.slice(s![1..(INNER + 1), 1..(INNER + 1)]))
        .and_neighbors(&image) // From the extension trait
        .map_collect(|c, n, s, w, e| {
            [n, s, w, e].into_iter().any(|v| v != c)
        });
</code>```

Sadly, I still have to repeat the four arguments every time, and turn them back into an array inside the closure. Is there a better way?

It would be great to have an NdProducer that has an extra axis of length 4, that contains the four neighbour views as slices. I tried to write that, but it turns out that the NdProducer trait doesn't allow implementations outside of its crate.

I also tried ArrayView::from_shape_ptr to create a view like that, but we have to specify a fixed stride for each index, while the index of the "neighbours" axis doesn't have a fixed stride.

Body:
Suppose I have an image represented as an Array2<u32>, for example:

const SIZE: usize = 8;
let image = Array2::from_elem((SIZE, SIZE), 0_u32);

I want to obtain an Array2<bool> that has true in all locations where at least one pixel (in a 4-connected neighbourhood) is different from the current one. It's fine if this is 2 pixels smaller on each side.

Right now I'm doing it like this:

    let edges = Zip::from(image.slice(s![1..(INNER + 1), 1..(INNER + 1)]))
        .and(image.slice(s![0..(INNER + 0), 1..(INNER + 1)]))
        .and(image.slice(s![2..(INNER + 2), 1..(INNER + 1)]))
        .and(image.slice(s![1..(INNER + 1), 0..(INNER + 0)]))
        .and(image.slice(s![1..(INNER + 1), 2..(INNER + 2)]))
        .map_collect(|c, n, s, w, e| {
            [n, s, w, e].into_iter().any(|v| v != c)
        });

However, I have several other operations that act on neighbouring elements, so I would like to build an abstraction. I can probably write an extension trait for Zip that lets me write this:

    let edges = Zip::from(image.slice(s![1..(INNER + 1), 1..(INNER + 1)]))
        .and_neighbors(&image) // From the extension trait
        .map_collect(|c, n, s, w, e| {
            [n, s, w, e].into_iter().any(|v| v != c)
        });

Sadly, I still have to repeat the four arguments every time, and turn them back into an array inside the closure. Is there a better way?

It would be great to have an NdProducer that has an extra axis of length 4, that contains the four neighbour views as slices. I tried to write that, but it turns out that the NdProducer trait doesn't allow implementations outside of its crate.

I also tried ArrayView::from_shape_ptr to create a view like that, but we have to specify a fixed stride for each index, while the index of the "neighbours" axis doesn't have a fixed stride.


问:
Assign relative time string to TextView in Custom notification layout
The documentation doesn't show how to add this functionality to a custom notification. (The functionality being, for as long as the notification is not dismissed, the time since the notification increases.)

There are custom notification tutorials on Youtube, but I haven't found one that does this.

I need something like "notificationBuilder.GetWhen()" and set a TextView to this literal string, but this is unavailable.

Currently, I use DateUtils.getRelativeTimeSpanString() to set the initial text, but of course this isn't recalculated when the notification is viewed again.


问:
How to make a website that always embeds as an image on discord
I am trying to make a website using NodeJS that always embeds into discord as an image no matter what the URL path is.

This means if I typed the website as “https://example.com/“ it would embed as the same image as if I typed “https://example.com/test/kenfossjdkskwndlw/test”.

I have tried creating a 404 image that is the image I want. I did this because I noticed if I upload an image to the site and then type out the name of the image I want on the URL path, it embeds properly. Creating this 404 page did nothing and the link still did not embed.


问:
Setting default ignore_above value for dynamically mapped keywords
I'm using the .NET OpenSearch client to dynamically map objects. The keyword fields' ignore_above attribute are all set to 256 characters. Documentation here states that is the expected value for default dynamic mapping: https://opensearch.org/docs/1.3/opensearch/supported-field-types/keyword/

The language "default dynamic mapping" makes me think this is a configurable option for dynamic mapping. Does anyone know how that could be done?

To be clear, I'm looking for a solution that would set all keyword fields to a specified value, not manually setting an individual keyword field.


问:
Error in DB when storing seats for a Movie Ticket Seller API project
I'm creating a movie ticket seller API using the code-first approach in ASP.NET Core and SQL Server. In the project, I created a class to represent the seats and another class that represents the movie session. However, when testing the program, I received an error that I don't understand and haven't been able to find any information about it. The error is thrown in any route of the API that I have tried.

System.ArgumentException: Expression of type 'System.Collections.Generic.ICollection1[TicketSeller.Models.Models.Seat]' cannot be used for parameter of type 'System.Array' of method 'System.Array MapMultidimensional(System.Array, System.Type, AutoMapper.ResolutionContext)' (Parameter 'arg0') at System.Dynamic.Utils.ExpressionUtils.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, String methodParamName, String argumentParamName, Int32 index) at System.Linq.Expressions.Expression.Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2) at AutoMapper.Internal.Mappers.CollectionMapper.ArrayMapper.MapToArray(IGlobalConfiguration configuration, ProfileMap profileMap, Expression sourceExpression, Type destinationType) at AutoMapper.Internal.Mappers.CollectionMapper.MapExpression(IGlobalConfiguration configuration, ProfileMap profileMap, MemberMap memberMap, Expression sourceExpression, Expression destExpression) at AutoMapper.Execution.ExpressionBuilder.MapExpression(IGlobalConfiguration configuration, ProfileMap profileMap, TypePair typePair, Expression source, MemberMap memberMap, Expression destination) at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc(MemberMap memberMap, Expression destination, MemberInfo destinationMember) at AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc(Expression createDestination) at AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda() at AutoMapper.TypeMap.CreateMapperLambda(IGlobalConfiguration configuration) at AutoMapper.TypeMap.Seal(IGlobalConfiguration configuration) at AutoMapper.MapperConfiguration.<.ctor>g__Seal|20_0() at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression) at Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.<>c.b__12_2(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.<>c.b__12_3(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired) at lambda_method3(Closure , IServiceProvider , Object[] ) at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass7_0.b__0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.g__CreateController|0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

My classes are

```<code>public class Seat
    {
        [Key]
        public int Id { get; set; }
        public char Row { get; set; }
        public int Column { get; set; }
        public string Name => $"{Row}{Column}";
        public bool IsAvailable { get; set; }
        [ForeignKey("MovieSession")]
        public int MovieSessionId { get; set; }
        public virtual MovieSession MovieSession { get; set; }

        public Seat(char row, int column, bool isAvailable, int movieSessionId)
        {
            Row = row;
            Column = column;
            IsAvailable = isAvailable;
            MovieSessionId = movieSessionId;
        }
    }
</code>```
```<code>    public class MovieSession
    {
        [Key]
        [Required]
        public int Id { get; set; }
        [Required]
        public virtual Movie Movie { get; set; }
        [Required]
        [ForeignKey("Movie")]
        public int MovieId { get; set; }
        [Required]
        public virtual Cinema Cinema { get; set; }
        [Required]
        [ForeignKey("Cinema")]
        public int CinemaId { get; set; }
        [Required]
        public DateTime StartDateTime { get; set; }
        [Required]
        public DateTime EndDateTime { get; set; }
        [Required]
        public int MovieRoomNumber { get; set; }
        [JsonIgnore]
        public virtual ICollection<Seat> Seats { get; set; } = new List<Seat>();

        public MovieSession()
        {
            Seats = new List<Seat>();

            for(char row = 'A'; row <= 'O'; row++)
            {
                for(int column = 1; column <= 10; column++)
                {
                    Seats.Add(new Seat(row, column, true, this.Id));
                }
            }
        }
    }
</code>```
```<code>    public class AppDbContext : DbContext
    {
        public AppDbContext(DbContextOptions<AppDbContext> opt) : base(opt)
        {

        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            builder.Entity<MovieGenre>()
                .HasOne(movieGenres => movieGenres.Movie)
                .WithMany(movie => movie.MovieGenres)
                .HasForeignKey(movieGenres => movieGenres.MovieId);

            builder.Entity<MovieGenre>()
                .HasOne(movieGenres => movieGenres.Genre)
                .WithMany(genre => genre.MovieGenres)
                .HasForeignKey(movieGenres => movieGenres.GenreId);

            builder.Entity<Adress>()
                .HasOne(adress => adress.Cinema)
                .WithOne(cinema => cinema.Adress)
                .HasForeignKey<Cinema>(cinema => cinema.AdressId);

            builder.Entity<MovieSession>()
                .HasOne(movieSession => movieSession.Cinema)
                .WithMany(cinema => cinema.MovieSessions)
                .HasForeignKey(movieSession => movieSession.CinemaId);

            builder.Entity<MovieSession>()
                .HasOne(movieSession => movieSession.Movie)
                .WithMany(movie => movie.MovieSessions)
                .HasForeignKey(movieSession => movieSession.MovieId);

            builder.Entity<MovieSession>()
                .HasMany(m => m.Seats)
                .WithOne(s => s.MovieSession)
                .HasForeignKey(s => s.MovieSessionId);
        }

        public DbSet<Movie> Movies { get; set; }
        public DbSet<Genre> Genres { get; set; }
        public DbSet<MovieGenre> MoviesGenres { get; set; }
        public DbSet<Adress> Adresses { get; set; }
        public DbSet<Cinema> Cinemas { get; set; }
        public DbSet<MovieSession> MovieSessions { get; set; }
        public DbSet<Seat> Seats { get; set; }
    }
</code>```

the project can be found here: https://github.com/rafaelmaia23/TicketSeller

Body:
I'm creating a movie ticket seller API using the code-first approach in ASP.NET Core and SQL Server. In the project, I created a class to represent the seats and another class that represents the movie session. However, when testing the program, I received an error that I don't understand and haven't been able to find any information about it. The error is thrown in any route of the API that I have tried.

System.ArgumentException: Expression of type 'System.Collections.Generic.ICollection1[TicketSeller.Models.Models.Seat]' cannot be used for parameter of type 'System.Array' of method 'System.Array MapMultidimensional(System.Array, System.Type, AutoMapper.ResolutionContext)' (Parameter 'arg0') at System.Dynamic.Utils.ExpressionUtils.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, String methodParamName, String argumentParamName, Int32 index) at System.Linq.Expressions.Expression.Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2) at AutoMapper.Internal.Mappers.CollectionMapper.ArrayMapper.MapToArray(IGlobalConfiguration configuration, ProfileMap profileMap, Expression sourceExpression, Type destinationType) at AutoMapper.Internal.Mappers.CollectionMapper.MapExpression(IGlobalConfiguration configuration, ProfileMap profileMap, MemberMap memberMap, Expression sourceExpression, Expression destExpression) at AutoMapper.Execution.ExpressionBuilder.MapExpression(IGlobalConfiguration configuration, ProfileMap profileMap, TypePair typePair, Expression source, MemberMap memberMap, Expression destination) at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc(MemberMap memberMap, Expression destination, MemberInfo destinationMember) at AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc(Expression createDestination) at AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda() at AutoMapper.TypeMap.CreateMapperLambda(IGlobalConfiguration configuration) at AutoMapper.TypeMap.Seal(IGlobalConfiguration configuration) at AutoMapper.MapperConfiguration.<.ctor>g__Seal|20_0() at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression) at Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.<>c.b__12_2(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.<>c.b__12_3(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired) at lambda_method3(Closure , IServiceProvider , Object[] ) at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass7_0.b__0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.g__CreateController|0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

My classes are

public class Seat
    {
        [Key]
        public int Id { get; set; }
        public char Row { get; set; }
        public int Column { get; set; }
        public string Name => $"{Row}{Column}";
        public bool IsAvailable { get; set; }
        [ForeignKey("MovieSession")]
        public int MovieSessionId { get; set; }
        public virtual MovieSession MovieSession { get; set; }

        public Seat(char row, int column, bool isAvailable, int movieSessionId)
        {
            Row = row;
            Column = column;
            IsAvailable = isAvailable;
            MovieSessionId = movieSessionId;
        }
    }

    public class MovieSession
    {
        [Key]
        [Required]
        public int Id { get; set; }
        [Required]
        public virtual Movie Movie { get; set; }
        [Required]
        [ForeignKey("Movie")]
        public int MovieId { get; set; }
        [Required]
        public virtual Cinema Cinema { get; set; }
        [Required]
        [ForeignKey("Cinema")]
        public int CinemaId { get; set; }
        [Required]
        public DateTime StartDateTime { get; set; }
        [Required]
        public DateTime EndDateTime { get; set; }
        [Required]
        public int MovieRoomNumber { get; set; }
        [JsonIgnore]
        public virtual ICollection<Seat> Seats { get; set; } = new List<Seat>();

        public MovieSession()
        {
            Seats = new List<Seat>();

            for(char row = 'A'; row <= 'O'; row++)
            {
                for(int column = 1; column <= 10; column++)
                {
                    Seats.Add(new Seat(row, column, true, this.Id));
                }
            }
        }
    }

    public class AppDbContext : DbContext
    {
        public AppDbContext(DbContextOptions<AppDbContext> opt) : base(opt)
        {

        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            builder.Entity<MovieGenre>()
                .HasOne(movieGenres => movieGenres.Movie)
                .WithMany(movie => movie.MovieGenres)
                .HasForeignKey(movieGenres => movieGenres.MovieId);

            builder.Entity<MovieGenre>()
                .HasOne(movieGenres => movieGenres.Genre)
                .WithMany(genre => genre.MovieGenres)
                .HasForeignKey(movieGenres => movieGenres.GenreId);

            builder.Entity<Adress>()
                .HasOne(adress => adress.Cinema)
                .WithOne(cinema => cinema.Adress)
                .HasForeignKey<Cinema>(cinema => cinema.AdressId);

            builder.Entity<MovieSession>()
                .HasOne(movieSession => movieSession.Cinema)
                .WithMany(cinema => cinema.MovieSessions)
                .HasForeignKey(movieSession => movieSession.CinemaId);

            builder.Entity<MovieSession>()
                .HasOne(movieSession => movieSession.Movie)
                .WithMany(movie => movie.MovieSessions)
                .HasForeignKey(movieSession => movieSession.MovieId);

            builder.Entity<MovieSession>()
                .HasMany(m => m.Seats)
                .WithOne(s => s.MovieSession)
                .HasForeignKey(s => s.MovieSessionId);
        }

        public DbSet<Movie> Movies { get; set; }
        public DbSet<Genre> Genres { get; set; }
        public DbSet<MovieGenre> MoviesGenres { get; set; }
        public DbSet<Adress> Adresses { get; set; }
        public DbSet<Cinema> Cinemas { get; set; }
        public DbSet<MovieSession> MovieSessions { get; set; }
        public DbSet<Seat> Seats { get; set; }
    }

the project can be found here: https://github.com/rafaelmaia23/TicketSeller


问:
Is there any Swing API , Component or Sample Projects to Manage Spring Security Settings?
I'm working on a swing application and trying to merge it into Spring Framework.
fortunately every thing works in its basic mode.

but now I need a Swing-Based GUI to manage security stuff like Creating a new user, assign a user to a group ,.....

is there any Existing open source API or Swing Component which can help me?

I'm using

Extended DaoAuthenticationProvider & JdbcDaoImpl for Authentication.

UnanimousBased accessDecisionVoter & RoleVoter for Authorization

Simple MySql Database with Standard Tables(authorities,groups,users,..)

you know , I'm thinking of "if I use all things in their standard form, there might be some opensource implementations to handle a standard Userinterface"

thanks for any information
Moein

ContentLicense: CC BY-SA 3.0