问:
Webhook error on Dialog Flow ES when trying to communicate (save data) between Google Sheets and Dialog Flow
I have a problem with connecting dialog flow with any database. In this case, it is for Google sheets. I followed up this video for connecting dialog flow with google sheets:
"[https://www.youtube.com/watch?v=FVPRAnJ5jRk&t=785s]".

So, when I communicate with the bot, and when I finish filling in the information that I specified in the fulfillment, the Diagnostic Info displays an error:

"message": "Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500."

Please, can anyone help me with this. Really, I tried every database to integrate with Dialog Flow, but none worked. I don't know what is happening with Dialog Flow.

Bellow is my code that I have written in fulfillment at index.js:

`

```<code>'use strict';

const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
const axios = require('axios');

process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
  const agent = new WebhookClient({ request, response });
  console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
  console.log('Dialogflow Request body: ' + JSON.stringify(request.body));

  function welcome(agent) {
    agent.add(`Welcome to my agent!`);
  }

  function fallback(agent) {
    return new Promise((resolve, reject) => {
      const queryText = request.body.queryResult.queryText;
      axios.post('https://sheetdb.io/api/v1/jv8fq8y7xucpf?sheet=failed', {
          "data": {
            "content": queryText
          }
      });

      agent.add(`I didn't understand`);
      agent.add(`I'm sorry, can you try again?`);
    });
  }

  function appointment(agent) {
    const doctor = agent.parameters.doctor.name;
    const date = agent.parameters.date;
    const name = agent.parameters.name;
    const phone = agent.parameters.phone;

    return new Promise((resolve, reject) => {
      axios.get(`https://sheetdb.io/api/v1/jv8fq8y7xucpf/search?name=*${doctor}*`).then(function(response) {
        let doctor = response.data[0];

        if (doctor) {
          axios.post('https://sheetdb.io/api/v1/jv8fq8y7xucpf?sheet=appointments', {
            "data": {
              "doctor": doctor.name,
              "patient": name,
              "patient_phone": phone,
              "date": date,
              "created": new Date()
            }
          });

          agent.add("Ok your appointment is set up for you");
        } else {
          agent.add(`Unfortuneatly we did not find ${doctor} in our doctors`);
        }

        resolve();
      });
    });
  }

  // Run the proper function handler based on the matched Dialogflow intent name
  let intentMap = new Map();
  intentMap.set('Default Welcome Intent', welcome);
  intentMap.set('Default Fallback Intent', fallback);
  intentMap.set('AppointmentIntent', appointment);

  agent.handleRequest(intentMap);
});
</code>```

`

Body:
I have a problem with connecting dialog flow with any database. In this case, it is for Google sheets. I followed up this video for connecting dialog flow with google sheets:
"[https://www.youtube.com/watch?v=FVPRAnJ5jRk&t=785s]".

So, when I communicate with the bot, and when I finish filling in the information that I specified in the fulfillment, the Diagnostic Info displays an error:

"message": "Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500."

Please, can anyone help me with this. Really, I tried every database to integrate with Dialog Flow, but none worked. I don't know what is happening with Dialog Flow.

Bellow is my code that I have written in fulfillment at index.js:

`

'use strict';

const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
const axios = require('axios');

process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
  const agent = new WebhookClient({ request, response });
  console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
  console.log('Dialogflow Request body: ' + JSON.stringify(request.body));

  function welcome(agent) {
    agent.add(`Welcome to my agent!`);
  }

  function fallback(agent) {
    return new Promise((resolve, reject) => {
      const queryText = request.body.queryResult.queryText;
      axios.post('https://sheetdb.io/api/v1/jv8fq8y7xucpf?sheet=failed', {
          "data": {
            "content": queryText
          }
      });

      agent.add(`I didn't understand`);
      agent.add(`I'm sorry, can you try again?`);
    });
  }

  function appointment(agent) {
    const doctor = agent.parameters.doctor.name;
    const date = agent.parameters.date;
    const name = agent.parameters.name;
    const phone = agent.parameters.phone;

    return new Promise((resolve, reject) => {
      axios.get(`https://sheetdb.io/api/v1/jv8fq8y7xucpf/search?name=*${doctor}*`).then(function(response) {
        let doctor = response.data[0];

        if (doctor) {
          axios.post('https://sheetdb.io/api/v1/jv8fq8y7xucpf?sheet=appointments', {
            "data": {
              "doctor": doctor.name,
              "patient": name,
              "patient_phone": phone,
              "date": date,
              "created": new Date()
            }
          });

          agent.add("Ok your appointment is set up for you");
        } else {
          agent.add(`Unfortuneatly we did not find ${doctor} in our doctors`);
        }

        resolve();
      });
    });
  }

  // Run the proper function handler based on the matched Dialogflow intent name
  let intentMap = new Map();
  intentMap.set('Default Welcome Intent', welcome);
  intentMap.set('Default Fallback Intent', fallback);
  intentMap.set('AppointmentIntent', appointment);

  agent.handleRequest(intentMap);
});

`


来源: stackexchange

问:
Design a heuristic for a determinated puzzle
I was wondering which heuristic could fit better in the following puzzle. This puzzle comes from the game "Professor Layton" and I was trying several popular heuristic like A*, Manhattan, Euclidean... and no one convince me because there are obstacles.

The problem consists in bring the ball (the red circle) to the goal (the green dotted square). Each piece can make one movement. I hear any suggest to help me solving this problem.

The problem image:

I have tried as I said before, several algorithms that could solve the problem but anyone is really useful.

ContentLicense: CC BY-SA 4.0


问:
Can't map firebase data to react-chartjs2
I am trying to map firebase data to a chart using react-chartjs-2 but it won't work. The labels are only supposed to be the titles. The chart should count the amount of incomplete tasks for a scope. So the y-axis is the count of incomplete tasks and the x-axis are the corrolating titles

My chart: here is the current chart

My data structure: for context here is where i'm trying to get the title and the amount of incomplete tasks

The log showing that the labelsArray does work, just isn't mapping: labelsArray:(https://i.stack.imgur.com/HBHmU.png)

Finally here is my code:

`

```<code>import React from 'react';
import './Page.css';

import {  useNavigate } from 'react-router-dom';

import Sidebar from '../Components/Sidebar'

import {Speedometer,CardText,BarChart,Hr } from 'react-bootstrap-icons'

import {
  Chart as ChartJS,
} from 'chart.js';
import {Button, Card} from 'react-bootstrap';
import Cookies from 'universal-cookie';
import { collection, getDocs } from 'firebase/firestore';
import { db } from '../firebaseConfig';
import { useEffect } from 'react';
import { Bar, Chart, Line } from 'react-chartjs-2';
import 'chart.js/auto'

window.Chart = ChartJS

function Trends() {
  const cookie = new Cookies()
  const user=cookie.get('useraidt')

  const col = collection(db,'Users',user,'Scopes');

  var labelsArray=[];
  var dataArray=[];

  const snap=async()=>{
    await    getDocs(col).then((snapshot)=>{
      snapshot.docs.forEach(doc=>{
        var sub = doc.data();

        var title = sub.title;
        labelsArray.push(title);
        console.log(labelsArray)

        var count= sub.incomplete;
        dataArray.push(count);

      })
    })
  }

  const userData ={
    labels: labelsArray ,
    datasets:[{
      label: 'Incomplete',
      data: dataArray
    }]}

  let nav = useNavigate();

  useEffect(()=>{
    snap()
  },[])

  return (

    <div className='Page'>

      <div className="navB">
      <Sidebar
        L1={<Button variant='dark' onClick={()=>nav(`/Dashboard/${user}`)}><Speedometer/></Button>}
        L2={<Button variant='dark' onClick={()=>nav(`/Sessions/${user}`)}><CardText/></Button>}
        L3={<Button variant='dark' onClick={()=>nav(`/Trends/${user}`)}><BarChart/></Button>}
        L4={<Button variant='dark' onClick={()=>nav(`/Scopes/${user}`)}><Hr/></Button>}/>
        </div>

        <div className="bod">
        <Card style={{
            width:'93vw',
             margin:'20px',
             height:'250px',
             backgroundImage:'linear-gradient(-45deg ,rgb(78, 193, 199) ,rgb(209, 194, 63), rgb(199, 78, 120))',
             backgroundSize:'400% 400%',
             textAlign:'center',
             alignItems:'center',
             color:'white',
             padding:' 10px',
             animation:'gradient 15s ease infinite'
              }}>
            <Card.Title ><h1 style={{FontWeight:'bold', FontSize:'40px'}}>Trends</h1></Card.Title>

          </Card>
           <div style={{width:700, margin: '20px', display: 'flex'}}>
           <Line data={userData}/>
           <Bar data={userData}/>

           </div>

        </div>

    </div>
  )
}

export default Trends
</code>```

`

Expected behaviour: a chart showing the incomplete task for the last 5 scopes

What i tried: logging the labels array and changing the datasets

Body:
I am trying to map firebase data to a chart using react-chartjs-2 but it won't work. The labels are only supposed to be the titles. The chart should count the amount of incomplete tasks for a scope. So the y-axis is the count of incomplete tasks and the x-axis are the corrolating titles

My chart: here is the current chart

My data structure: for context here is where i'm trying to get the title and the amount of incomplete tasks

The log showing that the labelsArray does work, just isn't mapping: labelsArray:(https://i.stack.imgur.com/HBHmU.png)

Finally here is my code:

`

import React from 'react';
import './Page.css';

import {  useNavigate } from 'react-router-dom';

import Sidebar from '../Components/Sidebar'

import {Speedometer,CardText,BarChart,Hr } from 'react-bootstrap-icons'

import {
  Chart as ChartJS,
} from 'chart.js';
import {Button, Card} from 'react-bootstrap';
import Cookies from 'universal-cookie';
import { collection, getDocs } from 'firebase/firestore';
import { db } from '../firebaseConfig';
import { useEffect } from 'react';
import { Bar, Chart, Line } from 'react-chartjs-2';
import 'chart.js/auto'

window.Chart = ChartJS

function Trends() {
  const cookie = new Cookies()
  const user=cookie.get('useraidt')

  const col = collection(db,'Users',user,'Scopes');

  var labelsArray=[];
  var dataArray=[];

  const snap=async()=>{
    await    getDocs(col).then((snapshot)=>{
      snapshot.docs.forEach(doc=>{
        var sub = doc.data();

        var title = sub.title;
        labelsArray.push(title);
        console.log(labelsArray)

        var count= sub.incomplete;
        dataArray.push(count);

      })
    })
  }

  const userData ={
    labels: labelsArray ,
    datasets:[{
      label: 'Incomplete',
      data: dataArray
    }]}

  let nav = useNavigate();

  useEffect(()=>{
    snap()
  },[])

  return (

      <Sidebar
        L1={<Button variant='dark' onClick={()=>nav(`/Dashboard/${user}`)}><Speedometer/></Button>}
        L2={<Button variant='dark' onClick={()=>nav(`/Sessions/${user}`)}><CardText/></Button>}
        L3={<Button variant='dark' onClick={()=>nav(`/Trends/${user}`)}><BarChart/></Button>}
        L4={<Button variant='dark' onClick={()=>nav(`/Scopes/${user}`)}>
</Button>}/>

        <Card style={{
            width:'93vw',
             margin:'20px',
             height:'250px',
             backgroundImage:'linear-gradient(-45deg ,rgb(78, 193, 199) ,rgb(209, 194, 63), rgb(199, 78, 120))',
             backgroundSize:'400% 400%',
             textAlign:'center',
             alignItems:'center',
             color:'white',
             padding:' 10px',
             animation:'gradient 15s ease infinite'
              }}>
            <Card.Title >
Trends
</Card.Title>

          </Card>

           <Line data={userData}/>
           <Bar data={userData}/>

  )
}

export default Trends

`

Expected behaviour: a chart showing the incomplete task for the last 5 scopes

What i tried: logging the labels array and changing the datasets


问:
Conditionally apply yup validation to the Material ui textfield when the react useState boolean state value is true
I have a form in which if the candidate is already a graduate then he should be able to enter the year of passing in textfield, and if he is appearing(still in college) then he should check the checkbox and the field should be disabled. so When the field is disabled I do not want yup validation to work, below in the code, I want the yup validation to be in picture when the "appearing" state is true.

const [appearing, setAppearing] = useState(false);

yearOfPassing:  Yup.string().required("Required"),
```
<p>I tried below <code>.when</code>, <code>.then</code>, but its not working. Please help.</p>
<pre class="lang-js prettyprint-override"><code>yearOfPassing: Yup.string().when("appearing", {
        is: true,
        then: Yup.string().required("Required"),
      }),
</code>```

Body:
I have a form in which if the candidate is already a graduate then he should be able to enter the year of passing in textfield, and if he is appearing(still in college) then he should check the checkbox and the field should be disabled. so When the field is disabled I do not want yup validation to work, below in the code, I want the yup validation to be in picture when the "appearing" state is true.

const [appearing, setAppearing] = useState(false);

yearOfPassing:  Yup.string().required("Required"),

I tried below .when, .then, but its not working. Please help.

yearOfPassing: Yup.string().when("appearing", {
        is: true,
        then: Yup.string().required("Required"),
      }),


问:
Unable to run unit test case in amplify React app
I want to implement unit test case in Amplify react app.

I am trying to run the default test case which is present in the App.test.js file

App.test.js
`

```<code>import { render, screen } from '@testing-library/react';
import App from './App';

test('renders home', () => {
  render(<App />);
  const linkElement = screen.getByText(/HomePage/i);
  expect(linkElement).toBeInTheDocument();
});

</code>```

App.js

```<code>import './App.css';
import { Amplify } from 'aws-amplify';

import { withAuthenticator } from '@aws-amplify/ui-react';
import '@aws-amplify/ui-react/styles.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import {
  Page, studioTheme
} from './custom-components';
import { AmplifyProvider } from '@aws-amplify/ui-react';
import awsExports from './aws-exports';
Amplify.configure(awsExports);

function App({ signOut, user }) {
  return (
    <AmplifyProvider theme={studioTheme}>
      <Page signOut={signOut} user={user} />
    </AmplifyProvider>
  );
}

export default withAuthenticator(App, { hideSignUp: true });
</code>```

`

is it due to authenticator?

I am expecting the test case should run successfully

Body:
I want to implement unit test case in Amplify react app.

I am trying to run the default test case which is present in the App.test.js file

App.test.js
`

import { render, screen } from '@testing-library/react';
import App from './App';

test('renders home', () => {
  render(<App />);
  const linkElement = screen.getByText(/HomePage/i);
  expect(linkElement).toBeInTheDocument();
});

App.js

import './App.css';
import { Amplify } from 'aws-amplify';

import { withAuthenticator } from '@aws-amplify/ui-react';
import '@aws-amplify/ui-react/styles.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import {
  Page, studioTheme
} from './custom-components';
import { AmplifyProvider } from '@aws-amplify/ui-react';
import awsExports from './aws-exports';
Amplify.configure(awsExports);

function App({ signOut, user }) {
  return (
    <AmplifyProvider theme={studioTheme}>
      <Page signOut={signOut} user={user} />
    </AmplifyProvider>
  );
}

export default withAuthenticator(App, { hideSignUp: true });

`

is it due to authenticator?

I am expecting the test case should run successfully


问:
Remove Dociql static documentation
I have generate dociql static documentation in my rails application. It has occupied my root route. I need to remove it permanently.

I tried to change the root route and also tried to remove the documentation but it didn't worked.

Title: Remove Dociql static documentation


问:
How to do centralised exception handling for both - REST API & non-REST - in spring boot?
My service is accepting request from client in two ways - either HTTP REST API or Kafka consumer. Apart from 2 different entry points, the business logic is common in both cases.

How can I do common centralised exception handling for both?

@ControllerAdvice, Filter, Interceptor - they all are going to work for REST API, but not for requests consumed via Kafka consumer.

Is it possible to have a common ex handling code/class in spring boot? And is there a solution without AOP?

All solutions talk about RestController ex handling, I could not find any clear solution on how to do it for non-controller requests.


问:
Double process in linux script
Can someone help me understand why if I launch my script, it results in two active processes?

```<code>$ ps -ef | grep pong
adminus+    3024    2923  0 10:25 pts/0    00:00:00 /bin/bash ./pong.sh
adminus+    3029    3024  0 10:25 pts/0    00:00:00 /bin/bash ./pong.sh`
</code>```

This is my script:

#!/bin/bash
DIR=/var/tmp/ping-pong
if [ -d $DIR ]
then
    echo "Directory Exists"
else
    mkdir -p $DIR
fi

ping google.it | while read pong; do echo "$(date): $pong" >> $DIR/google-ping-$(date +%d-%m-%Y).txt; done`
```

thank you

Title: Double process in linux script

Body:
Can someone help me understand why if I launch my script, it results in two active processes?

$ ps -ef | grep pong
adminus+    3024    2923  0 10:25 pts/0    00:00:00 /bin/bash ./pong.sh
adminus+    3029    3024  0 10:25 pts/0    00:00:00 /bin/bash ./pong.sh`

This is my script:

#!/bin/bash
DIR=/var/tmp/ping-pong
if [ -d $DIR ]
then
    echo "Directory Exists"
else
    mkdir -p $DIR
fi

ping google.it | while read pong; do echo "$(date): $pong" >> $DIR/google-ping-$(date +%d-%m-%Y).txt; done`

thank you


问:
Page can't capture data
This is my HTML page where there will be multiple rows depending on how many data will be in JSON file. The first problem I have is that I have problem with listing down all the color options that can be found in the JSON file. For now it only display only 1 value which is according to the fruit. I do not know what code I should include in the doPost method in Java

```<code>
  <form id="config_form" action="iLoveFruits" method="Post" enctype="multipart/form-data">
    <table>
    <c:forEach items="${fruits}" var="fruit" varStatus="count">
    <tbody>
    <tr>
      <td><input type="text" name="fruit" id="fruit" value="${fruit.type}"></td>
      <td>
        <select name="color"><option id="color">${color}</option></select>
      </td>
      <input type="file" id="image" name="image" var="image" accept=".img,.IMG"/>
      <label for="image">Upload</label>
    </tr>
    </tbody>
   <button type="submit" id="submitBtn">Submit</button>
  </form>
</code>```

This is the codes under my doPost method where the file will be uploaded upon pressing the submit button. The issue I am facing is if there is 2 rows for example, whichever "Upload" button I click, it will display the file name under the first row. For example, I want to upload a image for the 3 row of the HTML page, after uploading the image, the name of the file will be shown in the first rather than the third. I do not know how to solve thi s please assist me

```<code>
 for (FileItem uploadItem : uploadItems) {
   if (uploadItem.isFormField()) {
     String fieldName = uploadItem.getFieldName();
     if(fieldName.equals("fruit"))
       {
         String fruit = uploadItem.getString();
         newOutput.put("fruit",fruit);
       }
         else if(fieldName.equals("color"))
       {
         String color = uploadItem.getString();
         newOutput.put("color",color);
           if (cert.toLowerCase().endsWith(".img")) {
             File temp = new File(file_dir + File.separator + color);
             uploadItem.write(temp);
           }
       }
     }
   }

</code>```

I am trying to get the filename in the textbox according to the row that I am changing

Title: Page can't capture data

Body:
This is my HTML page where there will be multiple rows depending on how many data will be in JSON file. The first problem I have is that I have problem with listing down all the color options that can be found in the JSON file. For now it only display only 1 value which is according to the fruit. I do not know what code I should include in the doPost method in Java

  <form id="config_form" action="iLoveFruits" method="Post" enctype="multipart/form-data">

    <c:forEach items="${fruits}" var="fruit" varStatus="count">

      <input type="text" name="fruit" id="fruit" value="${fruit.type}">

        <select name="color"><option id="color">${color}</option></select>

      <input type="file" id="image" name="image" var="image" accept=".img,.IMG"/>
      Upload

   <button type="submit" id="submitBtn">Submit</button>
  </form>

This is the codes under my doPost method where the file will be uploaded upon pressing the submit button. The issue I am facing is if there is 2 rows for example, whichever "Upload" button I click, it will display the file name under the first row. For example, I want to upload a image for the 3 row of the HTML page, after uploading the image, the name of the file will be shown in the first rather than the third. I do not know how to solve thi s please assist me

 for (FileItem uploadItem : uploadItems) {
   if (uploadItem.isFormField()) {
     String fieldName = uploadItem.getFieldName();
     if(fieldName.equals("fruit"))
       {
         String fruit = uploadItem.getString();
         newOutput.put("fruit",fruit);
       }
         else if(fieldName.equals("color"))
       {
         String color = uploadItem.getString();
         newOutput.put("color",color);
           if (cert.toLowerCase().endsWith(".img")) {
             File temp = new File(file_dir + File.separator + color);
             uploadItem.write(temp);
           }
       }
     }
   }

I am trying to get the filename in the textbox according to the row that I am changing


问:
How Spring's @Async works internally? Why is it safe to use @Async in servlet container (e.g. Tomcat) environment?
I'm trying to understand how I can use concurrency in the Tomcat environment.
I saw Spring official tutorials where @Async was used with spring-web dependency. So I gues that is is safe.

On the other hand, I've read JSR 236: Concurrency Utilities for Java EE which tells: "java.util.Timer, java.lang.Thread and the thread pool creation APIs from the Java SE concurrency utilities (JSR-166) in the java.util.concurrent package should never be used within managed environments, as it creates threads outside the purview of the container".

Trying to understand how @Async works I've found out that it is handled by AsyncAnnotationBeanPostProcessor that uses org.springframework.core.task.TaskExecutor extends java.util.concurrent.Executor.

May you explain why @Async is safe in a container servlet environment or suggest documentation that explains this aspect?

Thank you.


问:
Generate a new training dataset at each epoch
I created this method to augment my time series dataset:

```<code>my_augmenter = (
            tsaug.AddNoise(scale=(0.001, 0.5)) @ 0.5
            + tsaug.Convolve(window="flattop", size=5)
            + tsaug.Drift(max_drift=(0, 0.1))
            + tsaug.TimeWarp(40)
            )

def augment(x_train):
    x_aug = []
    for i in range(x_train.shape[0]):
        temp = my_augmenter.augment(x_train[i])
        x_aug.append(temp)
    x_aug = np.array(x_aug)
return x_aug
</code>```

And I want to perform the classical keras fit method to train my neural network, using augment() method to generate a new augmented training dataset at each epoch:

```<code>history = model.fit(
   x = augment(xtr),
   y = ytr,
   batch_size = batch_size,
   epochs = epochs,
   validation_data = (xval, yval)
).history
</code>```

But I have the impression that the augmentation runs only for the first epoch and then it uses the same augmented xtr for the whole fit. How can I solve?

Body:
I created this method to augment my time series dataset:

my_augmenter = (
            tsaug.AddNoise(scale=(0.001, 0.5)) @ 0.5
            + tsaug.Convolve(window="flattop", size=5)
            + tsaug.Drift(max_drift=(0, 0.1))
            + tsaug.TimeWarp(40)
            )

def augment(x_train):
    x_aug = []
    for i in range(x_train.shape[0]):
        temp = my_augmenter.augment(x_train[i])
        x_aug.append(temp)
    x_aug = np.array(x_aug)
return x_aug

And I want to perform the classical keras fit method to train my neural network, using augment() method to generate a new augmented training dataset at each epoch:

history = model.fit(
   x = augment(xtr),
   y = ytr,
   batch_size = batch_size,
   epochs = epochs,
   validation_data = (xval, yval)
).history

But I have the impression that the augmentation runs only for the first epoch and then it uses the same augmented xtr for the whole fit. How can I solve?


问:
path visualization in network graph : how to highlight edge/s between 2 distant nodes using python
I am trying to create network graph visualization. I could achieve that using graphviz. However, it is rather static (with zoom-in/out functionality)

I wish to make it interactive using python i.e. search edges (through search box) between 2 distant nodes & highlight them explicitly. Once analyzed - reset diagram back to normal state (using reset button).

For ex. in below graph I wish to find path between 1 to 5 & highlight possible combinations of edges.

```<code>1----2----6
|    |
3--- 4----5
</code>```

I checked How to Highlight any given path in pyvis network graph visualization? but not matching expectations. I tried searching plotly/graphviz/gravis/pyvis but no luck. If someone has come across this already may I request for some pointers/information ? Thanks in advance.

Body:
I am trying to create network graph visualization. I could achieve that using graphviz. However, it is rather static (with zoom-in/out functionality)

I wish to make it interactive using python i.e. search edges (through search box) between 2 distant nodes & highlight them explicitly. Once analyzed - reset diagram back to normal state (using reset button).

For ex. in below graph I wish to find path between 1 to 5 & highlight possible combinations of edges.

1----2----6
|    |
3--- 4----5

I checked How to Highlight any given path in pyvis network graph visualization? but not matching expectations. I tried searching plotly/graphviz/gravis/pyvis but no luck. If someone has come across this already may I request for some pointers/information ? Thanks in advance.


问:
CSS Media Print Not Working with React MUI Components After first page break
I'm trying to style a react page to be printable using the browser print function using css media queries. However, I'm having issues with using break-inside: avoid-page in the media print section. Even though it is supported by google chrome, it seems to only be working the first time it is mentioned. The rest of the time it is ignored.

I have the following React tsx page that is used to render information about a usmler's CV:

        <Stack direction={'column'}>

        </Stack>
```
<p>The page looks like this:
<img src="https://i.stack.imgur.com/jtUtA.png" alt="enter image description here" />
the footer is not displayed as it is at the bottom of the page.</p>
<p>Now when I use the browser print function, it looks like this:
<img src="https://i.stack.imgur.com/BrhlK.png" alt="enter image description here" />
<img src="https://i.stack.imgur.com/NdgYY.png" alt="enter image description here" /></p>
<p>The text from the tech experience and work experience is overflowing over the footer and into the next page. The footer is positioned absolute so it renders on every page using the following media query:</p>
<pre class="lang-css prettyprint-override"><code>    @media print {
        position: fixed;
        bottom: 0;
    }
</code>```

I tried to use break-inside: avoid-page; as recommended by https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside to avoid breaking these divs into multiple pages and it works, but only for the first component.
For the tech component I did:

@media print {
    #tech {
        display: block;
        break-inside: avoid-page;
    }
}
```
<p>And the result:
<img src="https://i.stack.imgur.com/dD6Aw.png" alt="enter image description here" />
Which is exactly what I wanted. However, it doesn't work with the next overflowing element which is the certifications component, where I added following media query:</p>
<pre class="lang-css prettyprint-override"><code>@media print {
    body {
        -webkit-print-color-adjust: exact;
    }
    #tech {
        display: block;
        break-inside: avoid-page;
    }
    #certifications {
        display: block;
        break-inside: avoid-page;
    }
}
</code>```

The result:

All I want is for the elements not to collide with the footer and break before that. I didnt find any CSS to help with that so I'm trying the break-inside: avoid in the media print as a last resort.

I've researched the issue and haven't found any similar article online. Could someone provide more insight? Much appreciated!

Body:
I'm trying to style a react page to be printable using the browser print function using css media queries. However, I'm having issues with using break-inside: avoid-page in the media print section. Even though it is supported by google chrome, it seems to only be working the first time it is mentioned. The rest of the time it is ignored.

I have the following React tsx page that is used to render information about a usmler's CV:

        <Stack direction={'column'}>

        </Stack>

The page looks like this:

the footer is not displayed as it is at the bottom of the page.

Now when I use the browser print function, it looks like this:

The text from the tech experience and work experience is overflowing over the footer and into the next page. The footer is positioned absolute so it renders on every page using the following media query:

    @media print {
        position: fixed;
        bottom: 0;
    }

I tried to use break-inside: avoid-page; as recommended by https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside to avoid breaking these divs into multiple pages and it works, but only for the first component.
For the tech component I did:

@media print {
    #tech {
        display: block;
        break-inside: avoid-page;
    }
}

And the result:

Which is exactly what I wanted. However, it doesn't work with the next overflowing element which is the certifications component, where I added following media query:

@media print {
    body {
        -webkit-print-color-adjust: exact;
    }
    #tech {
        display: block;
        break-inside: avoid-page;
    }
    #certifications {
        display: block;
        break-inside: avoid-page;
    }
}

The result:

All I want is for the elements not to collide with the footer and break before that. I didnt find any CSS to help with that so I'm trying the break-inside: avoid in the media print as a last resort.

I've researched the issue and haven't found any similar article online. Could someone provide more insight? Much appreciated!


问:
Admob test ad not loading
Good day

Tell me why admob test ads may not be displayed?

Here is the script:
https://gist.github.com/udfvirus/9d820a3a7a25900465988aac991279aa

This script is attached to Main Camera

The console outputs the following:
Log

And after that I press the playButton and there:

```<code>onPlayButtonClick
UnityEngine.Debug:Log (object)
LevelInfo:onPlayButtonClick () (at Assets/Scripts/UI/LevelInfo/LevelInfo.cs:79)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)

this.interstitial.IsLoaded(): False
UnityEngine.Debug:Log (object)
LevelInfo:onPlayButtonClick () (at Assets/Scripts/UI/LevelInfo/LevelInfo.cs:81)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
</code>```

And nothing is displayed(

Please tell me why?

Title: Admob test ad not loading

Body:
Good day

Tell me why admob test ads may not be displayed?

Here is the script:
https://gist.github.com/udfvirus/9d820a3a7a25900465988aac991279aa

This script is attached to Main Camera

The console outputs the following:
Log

And after that I press the playButton and there:

onPlayButtonClick
UnityEngine.Debug:Log (object)
LevelInfo:onPlayButtonClick () (at Assets/Scripts/UI/LevelInfo/LevelInfo.cs:79)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)

this.interstitial.IsLoaded(): False
UnityEngine.Debug:Log (object)
LevelInfo:onPlayButtonClick () (at Assets/Scripts/UI/LevelInfo/LevelInfo.cs:81)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)

And nothing is displayed(

Please tell me why?


问:
AUC drop while move Logit function (statsmodel) to Logistic regression (SkLearn)
While changing logit function(statsmodel) to logistic regression (sklearn), my AUC is dropped from 68% to 62%. I don't know why?. Could you please help me on this.

I have totally 61 variables and contains mixed of both binary & continuous variables.

My prevalence rate is 5%.

Logit Function

```<code>import statsmodels.api as sm

X_sm = sm.add_constant(X)
lr_model = sm.Logit(Y, X_sm).fit()
y_pred_sm = lr_model.predict(X_sm)

print('Auc Score',roc_auc_score(Y['target_var'],y_pred_sm ))
</code>```

AUC Score: 0.68251

Logistic Regression Function

```<code>from sklearn.linear_model import LogisticRegression

logreg=LogisticRegression(random_state=47,class_weight='balanced')
logreg_cv=logreg.fit(X,Y)
result=logreg_cv.predict_proba(X)

print('Auc Score',roc_auc_score(Y['mail_flag'],result[:,-1]))
</code>```

AUC Score: 0.62547

Body:
While changing logit function(statsmodel) to logistic regression (sklearn), my AUC is dropped from 68% to 62%. I don't know why?. Could you please help me on this.

I have totally 61 variables and contains mixed of both binary & continuous variables.

My prevalence rate is 5%.

Logit Function

import statsmodels.api as sm

X_sm = sm.add_constant(X)
lr_model = sm.Logit(Y, X_sm).fit()
y_pred_sm = lr_model.predict(X_sm)

print('Auc Score',roc_auc_score(Y['target_var'],y_pred_sm ))

AUC Score: 0.68251

Logistic Regression Function

from sklearn.linear_model import LogisticRegression

logreg=LogisticRegression(random_state=47,class_weight='balanced')
logreg_cv=logreg.fit(X,Y)
result=logreg_cv.predict_proba(X)

print('Auc Score',roc_auc_score(Y['mail_flag'],result[:,-1]))

AUC Score: 0.62547


问:
What is the diffence between middleware and web api filter?
I am trying to understand the diffrence between middlware and web api filter.

I have created this class.

```<code>public static class ExceptionMiddlewareExtensions
    {
        public static void ConfigureExceptionHandler(this IApplicationBuilder app)
        {
            app.UseExceptionHandler(appError =>
            {
                appError.Run(async context =>
                {
                    context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
                    context.Response.ContentType = "application/json";
                    var contextFeature = context.Features.Get<IExceptionHandlerFeature>();
                    if (contextFeature != null)
                    {
                        await context.Response.WriteAsync(new ErrorDetails()
                        {
                            StatusCode = context.Response.StatusCode,
                            Message = "Internal Server Error."
                        }.ToString());
                    }
                });
            });
        }
    }
</code>```

and regsiter the middlewar

app.ConfigureExceptionHandler();

Will this run in all actions and all controllers ?

What is the diffrence if I use web api core filetr ?

like here https://codetosolutions.com/blog/2/how-to-add-exception-filter-in-asp.net-core-globally

Body:
I am trying to understand the diffrence between middlware and web api filter.

I have created this class.

public static class ExceptionMiddlewareExtensions
    {
        public static void ConfigureExceptionHandler(this IApplicationBuilder app)
        {
            app.UseExceptionHandler(appError =>
            {
                appError.Run(async context =>
                {
                    context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
                    context.Response.ContentType = "application/json";
                    var contextFeature = context.Features.Get<IExceptionHandlerFeature>();
                    if (contextFeature != null)
                    {
                        await context.Response.WriteAsync(new ErrorDetails()
                        {
                            StatusCode = context.Response.StatusCode,
                            Message = "Internal Server Error."
                        }.ToString());
                    }
                });
            });
        }
    }

and regsiter the middlewar

app.ConfigureExceptionHandler();

Will this run in all actions and all controllers ?

What is the diffrence if I use web api core filetr ?

like here https://codetosolutions.com/blog/2/how-to-add-exception-filter-in-asp.net-core-globally


问:
Optimizing CTE in SQL
I have a stored procedure which uses CTE, currently it is given as inline query in C# code. now i i have created a SQL stored procedure, it takes more time to execute than the inline query. i need to optimize the code. Please help me on this. Thanks in advance.

I am using SQL SERVER DB

This is the Stored procedure which i have created.

```<code>BEGIN

WITH MyCTE AS (
  SELECT i.Id, ParentId, i.Name, i.Description,
  i.Name as ParentName,
  i.Description as ParentDescription,
  1 as level, i.Id as ItemKey
  FROM tableA i
  JOIN tableB l ON l.Id=i.ListId
  WHERE l.Name=@listName
  and i.Lifecyclestatus in ('A','D')
  UNION ALL
  SELECT i.Id, i.ParentId, x.Name Name, x.Description,
  i.Name ParentName,
  i.Description as ParentDescription,
  x.Level+1, X.ItemKey
  FROM tableA i
  JOIN MyCTE x ON i.Id = x.ParentId
)

SELECT * FROM (
  SELECT r.ItemKey as ItemKey, r.Name as Name,
  r.Description,
  STRING_AGG(r.ParentName, '$$')
  WITHIN GROUP (ORDER BY r.Level DESC) as Path
  FROM MyCTE r
  GROUP By r.ItemKey, r.Name, r.Description ) H
WHERE H.Path LIKE '%' + @searchExpression + '%'
OR H.Description LIKE '%' + @searchExpression + '%';

end
</code>```

Please help me on this, i need to optimize this code

Title: Optimizing CTE in SQL

Body:
I have a stored procedure which uses CTE, currently it is given as inline query in C# code. now i i have created a SQL stored procedure, it takes more time to execute than the inline query. i need to optimize the code. Please help me on this. Thanks in advance.

I am using SQL SERVER DB

This is the Stored procedure which i have created.

BEGIN

WITH MyCTE AS (
  SELECT i.Id, ParentId, i.Name, i.Description,
  i.Name as ParentName,
  i.Description as ParentDescription,
  1 as level, i.Id as ItemKey
  FROM tableA i
  JOIN tableB l ON l.Id=i.ListId
  WHERE l.Name=@listName
  and i.Lifecyclestatus in ('A','D')
  UNION ALL
  SELECT i.Id, i.ParentId, x.Name Name, x.Description,
  i.Name ParentName,
  i.Description as ParentDescription,
  x.Level+1, X.ItemKey
  FROM tableA i
  JOIN MyCTE x ON i.Id = x.ParentId
)

SELECT * FROM (
  SELECT r.ItemKey as ItemKey, r.Name as Name,
  r.Description,
  STRING_AGG(r.ParentName, '$$')
  WITHIN GROUP (ORDER BY r.Level DESC) as Path
  FROM MyCTE r
  GROUP By r.ItemKey, r.Name, r.Description ) H
WHERE H.Path LIKE '%' + @searchExpression + '%'
OR H.Description LIKE '%' + @searchExpression + '%';

end

Please help me on this, i need to optimize this code


问:
Prevent concurrent execution of sub with same parameter
We have an application running on clinet which is used by about 30 concurrent users.
In the application there is a Sub which deletes and inserts records in the underlying SQL-Server-Database.

The ID is a primary key in table A. Table B is filled in dosomething(ByVal ID as Integer) based on various data coming from Table A. Entries in Table B have a reference to table A (B.ID_A).

Due to the fact that this sub needs to be called from various places in the code and the number of concurrent users running the app at the same time we had some troubles with race conditions in the past. This resulted in data duplication because the code was running simultaneously.

```<code>Public Sub dosomething(ByVal ID As Integer)

End Sub
</code>```

My question is if there is any way to prevent concurrent execution of this sub with the same ID at the same time in a multi-user application?

I've read about SyncLock  but this doesn't solve the problem when running multiple instances of the application, right? Another solution i could think of is creating a Database Table where IDs are temporarily inserted as primary key at the beginning of the sub. This would result in the later execution getting an SQL-Exception when trying to insert a duplicate primary key i guess.

Body:
We have an application running on clinet which is used by about 30 concurrent users.
In the application there is a Sub which deletes and inserts records in the underlying SQL-Server-Database.

The ID is a primary key in table A. Table B is filled in dosomething(ByVal ID as Integer) based on various data coming from Table A. Entries in Table B have a reference to table A (B.ID_A).

Due to the fact that this sub needs to be called from various places in the code and the number of concurrent users running the app at the same time we had some troubles with race conditions in the past. This resulted in data duplication because the code was running simultaneously.

Public Sub dosomething(ByVal ID As Integer)

End Sub

My question is if there is any way to prevent concurrent execution of this sub with the same ID at the same time in a multi-user application?

I've read about SyncLock  but this doesn't solve the problem when running multiple instances of the application, right? Another solution i could think of is creating a Database Table where IDs are temporarily inserted as primary key at the beginning of the sub. This would result in the later execution getting an SQL-Exception when trying to insert a duplicate primary key i guess.


问:
Passing an Object in to another component blazor
hey im struggling with my blazor project.

I have a file called LoginCode.razor.cs
I make an HTTP request and receive a response. The response is a JSON that I deserialize and wrote to an object called ResponseData.
I want to call this object in another Razor component called SecondMain.razor and display the data that came back as a response.

I already tried to transfer the object using the NavigationManager by passing it to the NavigateTo method but this dont work because the NavigationManager can't transfer objects.
How can I use the object from the first component in the second component?
This is my json

```<code>{"success":{"code":22,"message":"Authentication
succeeded","data":"some
data","timetolive":86400,"mobilenumber":null}}
</code>```

And this is my ResposneData class

```<code>namespace AdminFrontend.Services
{
public class ResponseData
{
public SuccessData success { get; set; }

public ErrorData error { get; set; }

 }

public class SuccessData
{
public int code { get; set; }
public string message { get; set; }
public string data { get; set; }
public int timetolive { get; set; }
public int mobilenumber { get; set; }

}

public class ErrorData
{
public int code { get; set; }
public string message { get; set; }
public string data { get; set; }
public int timetolive { get; set; }
public object mobilenumber { get; set; }
}
}
</code>```

At the moment im trying something like this

```<code>var response = await httpClient.SendAsync(request);
var antwort = await response.Content.ReadAsStringAsync();
try
{
  response.EnsureSuccessStatusCode();
  var responseData = JsonSerializer.Deserialize<ResponseData>
                                                  (antwort);
     // Login succees;
            id = Convert.ToInt32(response.StatusCode);
            LoginApi loginApi = new LoginApi(id, antwort);

            _loginErrorMessages = loginApi.GetMessage();
            await InvokeAsync(() => appState.LoggedIn = true);
            navigationManager.NavigateTo
                              ($"/secondMain, {responseData}");

        }
        catch (HttpRequestException)
        {

            LoginApi loginApi = new LoginApi(id, antwort);
            _loginErrorMessages = loginApi.GetMessage();
        }
</code>```

Body:
hey im struggling with my blazor project.

I have a file called LoginCode.razor.cs
I make an HTTP request and receive a response. The response is a JSON that I deserialize and wrote to an object called ResponseData.
I want to call this object in another Razor component called SecondMain.razor and display the data that came back as a response.

I already tried to transfer the object using the NavigationManager by passing it to the NavigateTo method but this dont work because the NavigationManager can't transfer objects.
How can I use the object from the first component in the second component?
This is my json

{"success":{"code":22,"message":"Authentication
succeeded","data":"some
data","timetolive":86400,"mobilenumber":null}}

And this is my ResposneData class

namespace AdminFrontend.Services
{
public class ResponseData
{
public SuccessData success { get; set; }

public ErrorData error { get; set; }

 }

public class SuccessData
{
public int code { get; set; }
public string message { get; set; }
public string data { get; set; }
public int timetolive { get; set; }
public int mobilenumber { get; set; }

}

public class ErrorData
{
public int code { get; set; }
public string message { get; set; }
public string data { get; set; }
public int timetolive { get; set; }
public object mobilenumber { get; set; }
}
}

At the moment im trying something like this

var response = await httpClient.SendAsync(request);
var antwort = await response.Content.ReadAsStringAsync();
try
{
  response.EnsureSuccessStatusCode();
  var responseData = JsonSerializer.Deserialize<ResponseData>
                                                  (antwort);
     // Login succees;
            id = Convert.ToInt32(response.StatusCode);
            LoginApi loginApi = new LoginApi(id, antwort);

            _loginErrorMessages = loginApi.GetMessage();
            await InvokeAsync(() => appState.LoggedIn = true);
            navigationManager.NavigateTo
                              ($"/secondMain, {responseData}");

        }
        catch (HttpRequestException)
        {

            LoginApi loginApi = new LoginApi(id, antwort);
            _loginErrorMessages = loginApi.GetMessage();
        }


问:
Appending data to an existing file using Java
I have a file which contains some identifier one on each line. No. of lines can be order 10^6.

I want to append more identifiers on the file. However, I would like to skip the identifiers which are already on the file.

One way is to read the file, create a set, add new identifiers on the set and then re-write the fresh file.

However, I am concerned if we should read such big files and if there would be memory issue.

What could be the other solutions of this use-case?


问:
Open a window from a dart command line app
I have a dart command line app. From that I would like to sometimes open a small window. I don't really care if it is a flutter window or a native ui window, as long as it works on all desktop platforms.

I have tried including the flutter sdk, but then the dart vm goes on to assume that the whole thing is a flutter app, which it is not really. There don't seem to be any packages to do this, nor any answers on the internet.


问:
Macro that open all the files in specific subfolders, asking for the Mother Folder to the user. Compilation Tool - Part 1
I am trying to design a tool for general use, that can open all the ".xlsx" files in only some subfolders (all of them share a common word, in this case is "Depto") in a massive folder <"H:/">. I have tried with two soutions I have ound on internet but non of them work as they should. the first one is this:

Open all the files in subfolders

it only open 1 file when I add the macro I need them to do for each of the files (copy the information in another excel file)

then the second solution I have is this one, which I have been trying to make work: altho my for each is not working properly:

```<code>Option Explicit

'Late binding version

Public Sub Open_All_Workbooks_In_Folders()

    Dim FldrPicker As FileDialog

    Set FldrPicker = Application.FileDialog(msoFileDialogFolderPicker)

    With FldrPicker

        .Title = "Select A Target Folder"
        .AllowMultiSelect = False

        If .Show Then

            Application.ScreenUpdating = False
            Application.EnableEvents = False

            Open_Workbooks_In_Folder .SelectedItems(1), "*.xlsx"

            Application.ScreenUpdating = False
            Application.EnableEvents = False

            MsgBox "Done"

        End If

    End With

End Sub

Private Sub Open_Workbooks_In_Folder(folderPath As String, matchWorkbooks As String)

    Static FSO As Object
    Dim thisFolder As Object, subfolder As Object
    Dim thisFile As Object
    Dim wb As Workbook
    Dim SubFolderName As String
    Dim i As Integer
    i = 0

    If FSO Is Nothing Then Set FSO = CreateObject("Scripting.FileSystemObject")

    Set thisFolder = FSO.GetFolder(folderPath)

    SubFolderName = thisFolder.Name
If InStr(1, SubFolderName, "Dept") <> 0 Then

    For Each thisFile In thisFolder.Files
    i = i + 1
        If LCase(thisFile.Name) Like LCase(matchWorkbooks) Then

            Set wb = Workbooks.Open(thisFile.Path, UpdateLinks:=3)

            Windows("Massive Compilation Tools.xlsm").Activate
            Range("A" & i).Select
            Range("A" & i).Value = thisFile.Path
            wb.Activate
            wb.Close SaveChanges:=False 'True

            DoEvents
        End If
    Next
End If
    'Do subfolders

    For Each subfolder In thisFolder.SubFolders
        Open_Workbooks_In_Folder subfolder.Path, matchWorkbooks
    Next

End Sub

</code>```

What I am trying to do is to create a compilation tool for 124 files distributed in different subfolders. The result so far is 1 of my macros is opening the files but it doesn't copy and paste the information in the order I need (it only overwrite the same place)

Body:
I am trying to design a tool for general use, that can open all the ".xlsx" files in only some subfolders (all of them share a common word, in this case is "Depto") in a massive folder <"H:/">. I have tried with two soutions I have ound on internet but non of them work as they should. the first one is this:

Open all the files in subfolders

it only open 1 file when I add the macro I need them to do for each of the files (copy the information in another excel file)

then the second solution I have is this one, which I have been trying to make work: altho my for each is not working properly:

Option Explicit

'Late binding version

Public Sub Open_All_Workbooks_In_Folders()

    Dim FldrPicker As FileDialog

    Set FldrPicker = Application.FileDialog(msoFileDialogFolderPicker)

    With FldrPicker

        .Title = "Select A Target Folder"
        .AllowMultiSelect = False

        If .Show Then

            Application.ScreenUpdating = False
            Application.EnableEvents = False

            Open_Workbooks_In_Folder .SelectedItems(1), "*.xlsx"

            Application.ScreenUpdating = False
            Application.EnableEvents = False

            MsgBox "Done"

        End If

    End With

End Sub

Private Sub Open_Workbooks_In_Folder(folderPath As String, matchWorkbooks As String)

    Static FSO As Object
    Dim thisFolder As Object, subfolder As Object
    Dim thisFile As Object
    Dim wb As Workbook
    Dim SubFolderName As String
    Dim i As Integer
    i = 0

    If FSO Is Nothing Then Set FSO = CreateObject("Scripting.FileSystemObject")

    Set thisFolder = FSO.GetFolder(folderPath)

    SubFolderName = thisFolder.Name
If InStr(1, SubFolderName, "Dept") <> 0 Then

    For Each thisFile In thisFolder.Files
    i = i + 1
        If LCase(thisFile.Name) Like LCase(matchWorkbooks) Then

            Set wb = Workbooks.Open(thisFile.Path, UpdateLinks:=3)

            Windows("Massive Compilation Tools.xlsm").Activate
            Range("A" & i).Select
            Range("A" & i).Value = thisFile.Path
            wb.Activate
            wb.Close SaveChanges:=False 'True

            DoEvents
        End If
    Next
End If
    'Do subfolders

    For Each subfolder In thisFolder.SubFolders
        Open_Workbooks_In_Folder subfolder.Path, matchWorkbooks
    Next

End Sub

What I am trying to do is to create a compilation tool for 124 files distributed in different subfolders. The result so far is 1 of my macros is opening the files but it doesn't copy and paste the information in the order I need (it only overwrite the same place)


问:
nexus pentaho unavailable?
In my pom I have this dependency

```<code><dependency>
    <groupId>org.pentaho.reporting.engine</groupId>
    <artifactId>classic-core</artifactId>
    <version>9.2.0.0-290</version>
</dependency>
</code>```

available at https://mvnrepository.com/artifact/org.pentaho.reporting.engine/classic-core/9.2.0.0-290

But https://nexus.pentaho.org/content/groups/omni/ is unaivailable

How should I do to install?

Title: nexus pentaho unavailable?

Body:
In my pom I have this dependency

<dependency>
    <groupId>org.pentaho.reporting.engine</groupId>
    <artifactId>classic-core</artifactId>
    <version>9.2.0.0-290</version>
</dependency>

available at https://mvnrepository.com/artifact/org.pentaho.reporting.engine/classic-core/9.2.0.0-290

But https://nexus.pentaho.org/content/groups/omni/ is unaivailable

How should I do to install?


问:
Visual Studio 2022 adds using statemens that I don't need
It keeps adding usings even though I disabled all usings checkboxes on "Tools->Options->C#->Advanced".
It adds whatever it wants, and not only on paste, not sure when, but I usually find new usings all the time.</p>


问:
How to limit day recomposition if I am drawing a calendar view
I am using https://github.com/kizitonwose/Calendar/tree/main/sample/src/main/java/com/kizitonwose/calendar/sample/compose to build a vertical calendar, how can I limit the number of recomposition of the days, because my app is getting slow. This is my view containing all components.

When scrolling it its becoming very slow due to recomposition

```<code>@Composable
fun ChooseDateView(
    appointmentViewModel: AppointmentViewModel,
    modifier: Modifier = Modifier
        .background(color = Color.White)
        .height(400.dp)
) {
    var selectedDate by remember { mutableStateOf<LocalDate>(appointmentViewModel.state.value.currentDateTime) }
    val currentMonth =
        remember { mutableStateOf<LocalDate>(appointmentViewModel.state.value.currentDateTime).value.yearMonth }
    val startMonth = remember { YearMonth.now().minusMonths(24) }
    val endMonth = remember { YearMonth.now().plusMonths(24) }
    val daysOfWeek = remember { daysOfWeek(firstDayOfWeek = DayOfWeek.MONDAY) }

    val state = rememberCalendarState(
        startMonth = startMonth,
        endMonth = endMonth,
        firstVisibleMonth = currentMonth,
        firstDayOfWeek = daysOfWeek.first()
    )
    Card(
        shape = RoundedCornerShape(8.dp),
        elevation = 8.dp
    ) {
    Column {
        TopBar(
            modifier = Modifier
                .background(color = Color.White),
            title = "Choose Date",
            leftContent = {
                IconButton(
                    modifier = Modifier,
                    onClick = {
                        appointmentViewModel.onEvent(AppointmentEvent.ClosedDialog)
                    }) {
                    Icon(
                        Icons.Default.ArrowBack,
                        contentDescription = "back"
                    )
                }
            }
        )
        DaysOfWeekTitle(daysOfWeek = daysOfWeek)
        VerticalCalendar(
            modifier = modifier
                .height(360.dp),
            state = state,
            dayContent = { day ->
                Day(day, isSelected = selectedDate == day.date) { day ->
                    selectedDate = day
                    appointmentViewModel.onEvent(AppointmentEvent.OnSelectedDate(day))
                }
            },
            monthHeader = { month ->
                println("========== i got rerender i am maping entire weekdays")
                //val daysOfWeek = month.weekDays.first().map { it.date.dayOfWeek }
                MonthHeader(month)
            }
        )
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .background(color = appColors.primary),
            horizontalArrangement = Arrangement.SpaceEvenly

        ) {
            TextButton(onClick = { appointmentViewModel.onEvent(AppointmentEvent.ClosedDialog) }) {
                Text(
                    text = "Dismiss",
                    style = FontLibrary.regularBody14(color = Color.White),
                    modifier = Modifier.padding(top = 5.dp, bottom = 5.dp)

                )
            }
            TextButton(onClick = { appointmentViewModel.onEvent(AppointmentEvent.ClosedDialog) }) {
                Text(
                    text = "Change Date",
                    style = FontLibrary.regularBody14(color = Color.White),
                    modifier = Modifier.padding(
top = 5.dp, bottom = 5.dp)
                )
            }

        }
    }
}
}

  @Composable
  fun Day(day: CalendarDay, isSelected: Boolean, onClick: (LocalDate) -> Unit) {
    println("======== day is recomposed")
    Box(
        modifier = Modifier
            .aspectRatio(1f) // This is important for square sizing!
            .clip(CircleShape)
            .background(color = if (isSelected && day.position == DayPosition.MonthDate) appColors.primary else Color.Transparent)
            .clickable(
                enabled = day.position == DayPosition.MonthDate,
                onClick = { onClick(day.date) }
            ),
        contentAlignment = Alignment.Center
    ) {
        Text(
            text = day.date.dayOfMonth.toString(),
            style = FontLibrary.Outfit18(
                color = if (day.position == DayPosition.MonthDate && isSelected) Color.White
                else if (day.position == DayPosition.MonthDate) appColors.secondary
                else Color.Transparent
            )
        )
    }
}
</code>```

Body:
I am using https://github.com/kizitonwose/Calendar/tree/main/sample/src/main/java/com/kizitonwose/calendar/sample/compose to build a vertical calendar, how can I limit the number of recomposition of the days, because my app is getting slow. This is my view containing all components.

When scrolling it its becoming very slow due to recomposition

@Composable
fun ChooseDateView(
    appointmentViewModel: AppointmentViewModel,
    modifier: Modifier = Modifier
        .background(color = Color.White)
        .height(400.dp)
) {
    var selectedDate by remember { mutableStateOf<LocalDate>(appointmentViewModel.state.value.currentDateTime) }
    val currentMonth =
        remember { mutableStateOf<LocalDate>(appointmentViewModel.state.value.currentDateTime).value.yearMonth }
    val startMonth = remember { YearMonth.now().minusMonths(24) }
    val endMonth = remember { YearMonth.now().plusMonths(24) }
    val daysOfWeek = remember { daysOfWeek(firstDayOfWeek = DayOfWeek.MONDAY) }

    val state = rememberCalendarState(
        startMonth = startMonth,
        endMonth = endMonth,
        firstVisibleMonth = currentMonth,
        firstDayOfWeek = daysOfWeek.first()
    )
    Card(
        shape = RoundedCornerShape(8.dp),
        elevation = 8.dp
    ) {
    Column {
        TopBar(
            modifier = Modifier
                .background(color = Color.White),
            title = "Choose Date",
            leftContent = {
                IconButton(
                    modifier = Modifier,
                    onClick = {
                        appointmentViewModel.onEvent(AppointmentEvent.ClosedDialog)
                    }) {
                    Icon(
                        Icons.Default.ArrowBack,
                        contentDescription = "back"
                    )
                }
            }
        )
        DaysOfWeekTitle(daysOfWeek = daysOfWeek)
        VerticalCalendar(
            modifier = modifier
                .height(360.dp),
            state = state,
            dayContent = { day ->
                Day(day, isSelected = selectedDate == day.date) { day ->
                    selectedDate = day
                    appointmentViewModel.onEvent(AppointmentEvent.OnSelectedDate(day))
                }
            },
            monthHeader = { month ->
                println("========== i got rerender i am maping entire weekdays")
                //val daysOfWeek = month.weekDays.first().map { it.date.dayOfWeek }
                MonthHeader(month)
            }
        )
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .background(color = appColors.primary),
            horizontalArrangement = Arrangement.SpaceEvenly

        ) {
            TextButton(onClick = { appointmentViewModel.onEvent(AppointmentEvent.ClosedDialog) }) {
                Text(
                    text = "Dismiss",
                    style = FontLibrary.regularBody14(color = Color.White),
                    modifier = Modifier.padding(top = 5.dp, bottom = 5.dp)

                )
            }
            TextButton(onClick = { appointmentViewModel.onEvent(AppointmentEvent.ClosedDialog) }) {
                Text(
                    text = "Change Date",
                    style = FontLibrary.regularBody14(color = Color.White),
                    modifier = Modifier.padding(
top = 5.dp, bottom = 5.dp)
                )
            }

        }
    }
}
}

  @Composable
  fun Day(day: CalendarDay, isSelected: Boolean, onClick: (LocalDate) -> Unit) {
    println("======== day is recomposed")
    Box(
        modifier = Modifier
            .aspectRatio(1f) // This is important for square sizing!
            .clip(CircleShape)
            .background(color = if (isSelected && day.position == DayPosition.MonthDate) appColors.primary else Color.Transparent)
            .clickable(
                enabled = day.position == DayPosition.MonthDate,
                onClick = { onClick(day.date) }
            ),
        contentAlignment = Alignment.Center
    ) {
        Text(
            text = day.date.dayOfMonth.toString(),
            style = FontLibrary.Outfit18(
                color = if (day.position == DayPosition.MonthDate && isSelected) Color.White
                else if (day.position == DayPosition.MonthDate) appColors.secondary
                else Color.Transparent
            )
        )
    }
}


问:
Annotations outside Ternary Plot
Im plotting a ternary plot. However, I can't manage to get the annotation (e.g. Final Energy) to appear outside the plot with arrows pointing to the relevant data point.

Here is the code with data included

```<code># Data
Ambition = [0.716,
    0.13,
    0.28
    ]
Scenario = [0.009,
    0.56,
    0.07
    ]
Model = [0.108,
    0.31,
    0.65
    ]
Type =[
    'Emissions',
    'Non-Fossil',
    'Final Energy'
]

df = pd.DataFrame({'Ambition':Ambition, 'Model':Model,'Scenario':Scenario, 'Type':Type})

fig = px.scatter_ternary(df,
    a="Ambition",
    b="Model",
    c="Scenario",
    symbol="Type",
    color='Type',
    template="ggplot2",
    color_discrete_map={"Emissions":"#C0392B", "Non-Fossil":"#F4D03F", 'Final Energy':'#52BE80'},
    labels={"Ambition": "Ambition (100%)",
            "Model": "Model (100%)",
            "Scenario": "Scenario (100%)"},
    title="Variance Summary",
    text='Type',
    hover_name='Type',
    )

fig.show()
</code>```

Any help would be greatly apprecaited

Thanks

Title: Annotations outside Ternary Plot

Body:
Im plotting a ternary plot. However, I can't manage to get the annotation (e.g. Final Energy) to appear outside the plot with arrows pointing to the relevant data point.

Here is the code with data included

# Data
Ambition = [0.716,
    0.13,
    0.28
    ]
Scenario = [0.009,
    0.56,
    0.07
    ]
Model = [0.108,
    0.31,
    0.65
    ]
Type =[
    'Emissions',
    'Non-Fossil',
    'Final Energy'
]

df = pd.DataFrame({'Ambition':Ambition, 'Model':Model,'Scenario':Scenario, 'Type':Type})

fig = px.scatter_ternary(df,
    a="Ambition",
    b="Model",
    c="Scenario",
    symbol="Type",
    color='Type',
    template="ggplot2",
    color_discrete_map={"Emissions":"#C0392B", "Non-Fossil":"#F4D03F", 'Final Energy':'#52BE80'},
    labels={"Ambition": "Ambition (100%)",
            "Model": "Model (100%)",
            "Scenario": "Scenario (100%)"},
    title="Variance Summary",
    text='Type',
    hover_name='Type',
    )

fig.show()

Any help would be greatly apprecaited

Thanks


问:
How to upload Platform specific wheels packages
I have generated a wheel package for windows, linux and mac platform with latest python[3.11].

What happens is if i have built wheel on linux, only that wheel can be uploaded and along with .tar.gz file.
But i want to build wheel package on other platform as well and it has to be uploaded from one machine and which is not happening for me.

I tried to upload these packages on my windwos, i got the error as:
Binary wheel has an unsupported platform tag 'linux_x86_64'

Kindly help me in packaging these with one package.

Thanks

I expected to have all the packages to be uploaded in one package having windows, linux and mac [both 32-bit and 64-bit].


问:
Creating OCaml binding from C++ with Swig
I am creating a C++ package with just about everything being wrapped in a class and am testing out using Swig to create different bindings for my project. Right now I am looking into the process for OCaml using the documentation here as the main point of reference. I am fairly new to OCaml and Swig but I was able to successfully create the binding for Python with no hiccups but when trying for OCaml I am running into issues with using camlp4(I believe this is the default for swig so I did not bother with camlp5). I am running into issues specifically when running the following:

```<code>$ ocamlmktop -custom swig.cmo -I `camlp4 -where` camlp4o.cma swigp4.cmo example_wrap.o example.cmo -o example
</code>```

I get the error

```<code>Error: Module `Dynlink' is unavailable (required by `Camlp4')
</code>```

Before trying to use the Camlp4 util in my Swig process I was running the following to successfully compile the OCaml module:

```<code>    swig -c++ -ocaml -co swigp4.ml
    swig -c++ -ocaml example.i
    for file in swig.mli swig.ml swigp4.ml ; do swig -ocaml -co $$file ; done
    swig -ocaml -co swig.mli ; swig -ocaml -co swig.ml
    ocamlc -c swig.mli ; ocamlc -c swig.ml
    cp example_wrap.cxx example_wrap.c
    ocamlc -c -ccopt -xc++ example_wrap.c
    ocamlc -c example.mli
    ocamlc -c example.ml
</code>```

The issue with this was trying to figure out calling the objects of my class within the top level. Since I am a beginner in the land of OCaml and functional programming as a whole, I am of course curious how to go about calling class methods of my original C++ code in OCaml after complete the Swig binding process (without camlp4)

Does anyone have experience with the C++->OCaml binding process using Swig have some pointers on how to properly perform this?

Body:
I am creating a C++ package with just about everything being wrapped in a class and am testing out using Swig to create different bindings for my project. Right now I am looking into the process for OCaml using the documentation here as the main point of reference. I am fairly new to OCaml and Swig but I was able to successfully create the binding for Python with no hiccups but when trying for OCaml I am running into issues with using camlp4(I believe this is the default for swig so I did not bother with camlp5). I am running into issues specifically when running the following:

$ ocamlmktop -custom swig.cmo -I `camlp4 -where` camlp4o.cma swigp4.cmo example_wrap.o example.cmo -o example

I get the error

Error: Module `Dynlink' is unavailable (required by `Camlp4')

Before trying to use the Camlp4 util in my Swig process I was running the following to successfully compile the OCaml module:

    swig -c++ -ocaml -co swigp4.ml
    swig -c++ -ocaml example.i
    for file in swig.mli swig.ml swigp4.ml ; do swig -ocaml -co $$file ; done
    swig -ocaml -co swig.mli ; swig -ocaml -co swig.ml
    ocamlc -c swig.mli ; ocamlc -c swig.ml
    cp example_wrap.cxx example_wrap.c
    ocamlc -c -ccopt -xc++ example_wrap.c
    ocamlc -c example.mli
    ocamlc -c example.ml

The issue with this was trying to figure out calling the objects of my class within the top level. Since I am a beginner in the land of OCaml and functional programming as a whole, I am of course curious how to go about calling class methods of my original C++ code in OCaml after complete the Swig binding process (without camlp4)

Does anyone have experience with the C++->OCaml binding process using Swig have some pointers on how to properly perform this?