问:
Set number format on BarChart Label in word document using Apache POI
I am trying to update already existing Bar Chart in word document using Apache poi.
Before Updating chart, series already has some values in percentage but after update, not able to see percentage value, After I click on Edit Excel percentage value gets reflected.
For example - I want to Update 80% and 20% so for this I am updating 0.8 and 0.2 in chart's excel source data but in the chart I see 0.8 and 0.2.

What I want ? - After updating the Bar chart it should show labels in percentage without the need of refresh or Edit Excel Data.

After Update (after running the code)

After clicking on Edit Excel Data

Excel Data is as below

Code

```<code>import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Iterator;

import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.xddf.usermodel.chart.XDDFCategoryDataSource;
import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory;
import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.usermodel.XWPFChart;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

public class ReadWord {
    public static void main(String[] args) {
        String fileName = "D:\\Test - Copy.docx";

    try (XWPFDocument doc = new XWPFDocument(Files.newInputStream(Paths.get(fileName)))) {
        XWPFChart chart = null;
        for (POIXMLDocumentPart part : doc.getRelations()) {
            if (part instanceof XWPFChart) {
                chart = (XWPFChart) part;
                break;
            }
        }

        XSSFWorkbook chartDataWorkbook = chart.getWorkbook();
        String sheetName = chartDataWorkbook.getSheetName(0);
        XSSFSheet chartDataSheet = chartDataWorkbook.getSheet(sheetName);

        Iterator<Row> itr = chartDataSheet.iterator();

        while (itr.hasNext()) {
            Row row = itr.next();
            Iterator<Cell> cellIterator = row.cellIterator(); // iterating over each column
            while (cellIterator.hasNext()) {
                Cell cell = cellIterator.next();
                switch (cell.getCellType()) {
                case STRING: // field that represents string cell type
                    System.out.print(cell.getStringCellValue() + "\t\t\t");
                    break;
                case NUMERIC: // field that represents number cell type
                    System.out.print(cell.getNumericCellValue() + "\t\t\t");
                    break;
                default:
                }
            }
            System.out.println("");
        }

        Object[][] data = new Object[][] { // 1 series, 1 categories
                { "", "RECYCLED", "REFURISHED" }, // series titles
                { "DESKTOP", 0.20d, 0.80d }, // category 1
        };

        //System.out.println("Data -> "+chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().getNumFmt());

        int rMin = 1;
        int rMax = 1;
        int c = 0;
        XDDFCategoryDataSource category = null;
        XDDFChartData chartData = chart.getChartSeries().get(0);

        for (int r = rMin; r < rMax + 1; r++) {
            chartDataSheet.getRow(r).getCell(c).setCellValue((String) data[r][c]); // in sheet
        }
        category = XDDFDataSourcesFactory.fromStringCellRange(chartDataSheet, new CellRangeAddress(1, 1, c, c)); // in
                                                                                // chart

        // Series 1
        XDDFChartData.Series series1 = chartData.getSeries().get(0);
        c = 1;
        String series1Title = (String) data[0][c];
        chartDataSheet.getRow(0).getCell(c).setCellValue(series1Title); // in sheet

        if (chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().size() > c) {
            chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().get(c)
                    .setName(series1Title);
        }
        series1.setTitle(series1Title, new CellReference(sheetName, 0, c, true, true)); // in chart

        /*CellStyle style = chartDataWorkbook.createCellStyle();
        style.setDataFormat(chartDataWorkbook.createDataFormat().getFormat("0.0%"));*/

        // set new values
        XDDFNumericalDataSource<Double> values = null;
        for (int r = rMin; r < rMax+1; r++) {
            System.out.println("r->" + r + ", c->" + c);
            System.out.println("Data -> " + (Double) data[c][r]);
            chartDataSheet.getRow(r).getCell(c).setCellValue((Double) data[r][c]); // in sheet
            //chartDataSheet.getRow(r).getCell(c).setCellStyle(style);
        }

        System.out.println("rMin->" + rMin + ",rMax->" + rMax + ",c->" + c + ",c->" + c);
        values = XDDFDataSourcesFactory.fromNumericCellRange(chartDataSheet,
                new CellRangeAddress(rMin, rMax, c, c));
        // values = XDDFDataSourcesFactory.fromNumericCellRange(chartDataSheet, new
        // CellRangeAddress(1,1,1,2));

        series1.replaceData(category, values);
        series1.plot(); // in chart

        // series 2
        // series 2
        XDDFChartData.Series series2 = chartData.getSeries().get(1);
        c = 2;
        // set new title
        String series2Title = (String) data[0][c];
        chartDataSheet.getRow(0).getCell(c).setCellValue(series2Title); // in sheet
        if (chartDataSheet.getTables().size() > 0) {
            if (chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().size() > c)
                chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().get(c)
                        .setName(series2Title);
        }
        series2.setTitle(series2Title, new CellReference(sheetName, 0, c, true, true)); // in chart

        // set new values
        for (int r = rMin; r < rMax + 1; r++) {
            chartDataSheet.getRow(r).getCell(c).setCellValue((Double) data[r][c]); // in sheet
            //chartDataSheet.getRow(r).getCell(c).setCellStyle(style);
        }
        values = XDDFDataSourcesFactory.fromNumericCellRange(chartDataSheet,
                new CellRangeAddress(rMin, rMax, c, c));
        series2.replaceData(category, values);
        series2.plot(); // in chart

        chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().addNewNumFmt();
        chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().getNumFmt().setSourceLinked(false);
        chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().getNumFmt().setFormatCode("0%");

        FileOutputStream out = new FileOutputStream(fileName);
        doc.write(out);
        out.close();
        doc.close();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InvalidFormatException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}
</code>```

}

Body:
I am trying to update already existing Bar Chart in word document using Apache poi.
Before Updating chart, series already has some values in percentage but after update, not able to see percentage value, After I click on Edit Excel percentage value gets reflected.
For example - I want to Update 80% and 20% so for this I am updating 0.8 and 0.2 in chart's excel source data but in the chart I see 0.8 and 0.2.

What I want ? - After updating the Bar chart it should show labels in percentage without the need of refresh or Edit Excel Data.

After Update (after running the code)

After clicking on Edit Excel Data

Excel Data is as below

Code

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Iterator;

import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.xddf.usermodel.chart.XDDFCategoryDataSource;
import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory;
import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.usermodel.XWPFChart;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

public class ReadWord {
    public static void main(String[] args) {
        String fileName = "D:\\Test - Copy.docx";

    try (XWPFDocument doc = new XWPFDocument(Files.newInputStream(Paths.get(fileName)))) {
        XWPFChart chart = null;
        for (POIXMLDocumentPart part : doc.getRelations()) {
            if (part instanceof XWPFChart) {
                chart = (XWPFChart) part;
                break;
            }
        }

        XSSFWorkbook chartDataWorkbook = chart.getWorkbook();
        String sheetName = chartDataWorkbook.getSheetName(0);
        XSSFSheet chartDataSheet = chartDataWorkbook.getSheet(sheetName);

        Iterator<Row> itr = chartDataSheet.iterator();

        while (itr.hasNext()) {
            Row row = itr.next();
            Iterator<Cell> cellIterator = row.cellIterator(); // iterating over each column
            while (cellIterator.hasNext()) {
                Cell cell = cellIterator.next();
                switch (cell.getCellType()) {
                case STRING: // field that represents string cell type
                    System.out.print(cell.getStringCellValue() + "\t\t\t");
                    break;
                case NUMERIC: // field that represents number cell type
                    System.out.print(cell.getNumericCellValue() + "\t\t\t");
                    break;
                default:
                }
            }
            System.out.println("");
        }

        Object[][] data = new Object[][] { // 1 series, 1 categories
                { "", "RECYCLED", "REFURISHED" }, // series titles
                { "DESKTOP", 0.20d, 0.80d }, // category 1
        };

        //System.out.println("Data -> "+chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().getNumFmt());

        int rMin = 1;
        int rMax = 1;
        int c = 0;
        XDDFCategoryDataSource category = null;
        XDDFChartData chartData = chart.getChartSeries().get(0);

        for (int r = rMin; r < rMax + 1; r++) {
            chartDataSheet.getRow(r).getCell(c).setCellValue((String) data[r][c]); // in sheet
        }
        category = XDDFDataSourcesFactory.fromStringCellRange(chartDataSheet, new CellRangeAddress(1, 1, c, c)); // in
                                                                                // chart

        // Series 1
        XDDFChartData.Series series1 = chartData.getSeries().get(0);
        c = 1;
        String series1Title = (String) data[0][c];
        chartDataSheet.getRow(0).getCell(c).setCellValue(series1Title); // in sheet

        if (chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().size() > c) {
            chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().get(c)
                    .setName(series1Title);
        }
        series1.setTitle(series1Title, new CellReference(sheetName, 0, c, true, true)); // in chart

        /*CellStyle style = chartDataWorkbook.createCellStyle();
        style.setDataFormat(chartDataWorkbook.createDataFormat().getFormat("0.0%"));*/

        // set new values
        XDDFNumericalDataSource<Double> values = null;
        for (int r = rMin; r < rMax+1; r++) {
            System.out.println("r->" + r + ", c->" + c);
            System.out.println("Data -> " + (Double) data[c][r]);
            chartDataSheet.getRow(r).getCell(c).setCellValue((Double) data[r][c]); // in sheet
            //chartDataSheet.getRow(r).getCell(c).setCellStyle(style);
        }

        System.out.println("rMin->" + rMin + ",rMax->" + rMax + ",c->" + c + ",c->" + c);
        values = XDDFDataSourcesFactory.fromNumericCellRange(chartDataSheet,
                new CellRangeAddress(rMin, rMax, c, c));
        // values = XDDFDataSourcesFactory.fromNumericCellRange(chartDataSheet, new
        // CellRangeAddress(1,1,1,2));

        series1.replaceData(category, values);
        series1.plot(); // in chart

        // series 2
        // series 2
        XDDFChartData.Series series2 = chartData.getSeries().get(1);
        c = 2;
        // set new title
        String series2Title = (String) data[0][c];
        chartDataSheet.getRow(0).getCell(c).setCellValue(series2Title); // in sheet
        if (chartDataSheet.getTables().size() > 0) {
            if (chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().size() > c)
                chartDataSheet.getTables().get(0).getCTTable().getTableColumns().getTableColumnList().get(c)
                        .setName(series2Title);
        }
        series2.setTitle(series2Title, new CellReference(sheetName, 0, c, true, true)); // in chart

        // set new values
        for (int r = rMin; r < rMax + 1; r++) {
            chartDataSheet.getRow(r).getCell(c).setCellValue((Double) data[r][c]); // in sheet
            //chartDataSheet.getRow(r).getCell(c).setCellStyle(style);
        }
        values = XDDFDataSourcesFactory.fromNumericCellRange(chartDataSheet,
                new CellRangeAddress(rMin, rMax, c, c));
        series2.replaceData(category, values);
        series2.plot(); // in chart

        chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().addNewNumFmt();
        chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().getNumFmt().setSourceLinked(false);
        chart.getCTChart().getPlotArea().getBarChartArray(0).getSerArray(0).getDLbls().getNumFmt().setFormatCode("0%");

        FileOutputStream out = new FileOutputStream(fileName);
        doc.write(out);
        out.close();
        doc.close();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InvalidFormatException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

}


来源: stackexchange

问:
Error in parsing value for ‘font-size’ and ‘letter-spacing’. Declaration dropped. The data not not visualized in ReactJS using leaflet map and rechart
I visualize 1919 markers on a map (leaflet).

I'm trying to click on the marker to load forecast charts for our country.

The first thing that strikes me in network inspector is these mistakes:

GET http://194.141.118.43:3000/?date=2019-10-20&id=4&daysForward=8
[HTTP/1.1 304 Not Modified 358ms]

The second request passes with code 200 ok

GET http://194.141.118.43:3000/?date=2019-10-20&id=4&daysForward=8
[HTTP/1.1 200 OK 418ms]

When I use console.log(data) I can see the API data in the console inspector.

When I click on a marker on the map I see the same error many times:

```<code>MouseEvent.mozPressure is deprecated. Use PointerEvent.pressure instead. Util.js:15
Error in parsing value for ‘font-size’.  Declaration dropped. localhost:5000
Error in parsing value for ‘letter-spacing’.  Declaration dropped. localhost:5000
</code>```

When I click on different markers on the map, the data does not change in the graphs.

My App.js look like this:

```<code>    import logo from './logo.svg';
import './App.css';
import React from 'react';
import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet'
import L from "leaflet";
import Chart from './chart';

const customMarker = new L.Icon({
  iconUrl: require('../src/images/marker.png'),
  iconSize: [25, 25],
  iconAnchor: [10, 41],
  popupAnchor: [2, -40]
});

class App extends React.Component {

  state = {
    date: new Date(),
  }

  constructor(props) {
    super(props);
    this.state = {
      coords: [
        { lat: 41.19197, lng: 25.33719 },
        { lat: 41.26352, lng: 25.1471 },
        { lat: 41.26365, lng: 25.24215 },
        { lat: 41.26369, lng: 25.33719 },
        { lat: 41.26365, lng: 25.43224 }
      ],
      dats: null,
      temp: null,
      dataAPI: null,
      id: 4,
      lng: 0,
      lat: 0,
      loading: true,
    };
    this.onChangeHandler = this.onChangeHandler.bind(this);
    this.loadData = this.loadData.bind(this);
  }

  async loadData(data) {
    this.setState({id: data.id})
     this.getData();
   }

   async componentDidMount() {
    this.getData();
   }

   async getData(){
    var id = this.state.id;
    const url = `http://194.141.118.43:3000/?date=2019-10-20&id=${id}&daysForward=8`;
    const response = await fetch(url);
    let data = await response.json();
    this.setState({ dataAPI: data.aladinModel[0], loading: false });
    this.setState({ temp: data.aladinModel[0], loading: false });
    this.setState({ dats: data.aladinModel[0], loading: false });
    console.log(data);
  }

  async onChangeHandler(e) {
    debugger;
    this.setState({ [e.target.name]: e.target.value });
    this.getData();
}

  render() {
    const { coords } = this.state;
    return (
      <div className="App">
        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <p>
            Edit <code>src/App.js</code> and save to reload.
          </p>

          <MapContainer center={[42.733883, 25.48583]} zoom={8} scrollWheelZoom={false}>
            <TileLayer
              attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
              url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
            />

            {coords.map(({ lat, lng }, index) => (
              <Marker position={[lat, lng]} icon={customMarker} key={index}
                onClick={() => this.loadData(
                  {
                    id: index,
                    lat: lat,
                    lng: lng
                  }
                )}>
                <div className="leaflet-popup-content">
                  <Chart
                    dats={this.state.dats}
                    index={this.state.id}
                    lng={lng}
                    lat={lat}
                  />
                </div>
              </Marker>
            ))}

            {/* Default Marker

            <Marker position={[51.505, -0.09]}>
              <Popup>
                A pretty CSS3 popup. <br /> Easily customizable.
              </Popup>
            </Marker>

             */}
          </MapContainer>

        </header>

      </div>
    );
  }
}

export default App;
</code>```

This is my Chart.jsx file:

```<code>    import React from 'react';
import {
    ComposedChart,
    Bar,
    Area,
    Line,
    XAxis,
    YAxis,
    CartesianGrid,
    Tooltip,
    Legend,
    LineChart,
    Label,
} from 'recharts';

import { MapContainer, LeafletMap, TileLayer, Marker, Popup } from "react-leaflet";
import moment from 'moment';

moment.globalTimezone = 'Europe/Sofia';

let Chart = (data) => {
    return (
        <Popup maxWidth="1000" maxHeight="auto" >

            <div className="chart">
                <ComposedChart width={440} height={250} data={data.dats} margin={{
                    top: 20, right: 0, left: 0, bottom: 20,
                }}>
                    <CartesianGrid strokeDasharray="3 3" />
                    <XAxis dataKey="DATS" tickFormatter={(unixTime) => moment(unixTime).format('DD.MM - HHч.')} />
                    <YAxis yAxisId="left" >
                    <XAxis Label value="Темп." dx={-15} />
                        </YAxis>
                    <YAxis yAxisId="right" orientation="right" >
                        <YAxis Label value="Сняг" dy={11} dx={13} />
                        <YAxis Label value="Дъжд" dy={25} dx={14} />
                    </YAxis>
                    <Tooltip />
                    <Legend />
                    <Bar dataKey='RR' yAxisId="right" name="Дъжд [mm]" barSize={6} fill='rgba(0, 60, 255, 0.6)' unit=" mm" animationDuration={0} isAnimationActive={false} />
                    <Bar dataKey='SR' yAxisId="right" name="Сняг [mm]" barSize={6} fill='rgba(93, 245, 220, 0.8)' unit=" mm" animationDuration={0} isAnimationActive={false} />
                    <Line dataKey='TA' yAxisId="left" name="Температура [°C]" type="monotone" stroke="rgba(235, 94, 52, 0.85)" activeDot={{ r: 5 }} unit=' °C' animationDuration={0} isAnimationActive={false} />
                </ComposedChart>
            </div>

            <div className="chart">
                <ComposedChart width={500} height={250} data={data.dats}
                    margin={{ top: 20, right: 0, left: 0, bottom: 20, }}>
                    <CartesianGrid strokeDasharray="3 3" />
                    <XAxis dataKey="DATS" tickFormatter={(unixTime) => moment(unixTime).format('DD.MM - HHч.')} />
                    <YAxis yAxisId="left" domain={[80000, 110000]} />
                    <YAxis yAxisId="right" domain={[0, 100]} orientation="right" >
                        <YAxis Label value="RH" dx={5} />
                    </YAxis>
                    <YAxis yAxisId="rightWS" orientation="right">
                        <YAxis Label value="WS" dx={5} />
                    </YAxis>
                    <Tooltip />
                    <Legend />
                    <Area yAxisId="left" type="monotone" dataKey="APRES" fill="rgba(136, 132, 216, 0.5)" stroke="rgba(136, 132, 216, 0.9)" activeDot={{ r: 5 }} name="Атмосферно налягане [hPa]" unit=" hPa" animationDuration={0} isAnimationActive={false} />
                    <Bar dataKey='WS' yAxisId="rightWS" name="Скорост на вятъра [км/ч]" barSize={6} fill='rgba(148, 153, 255, 0.8)' unit=" км/ч" animationDuration={0} isAnimationActive={false} />
                    <Line yAxisId="right" type="monotone" dataKey="RH" stroke="#82ca9d" name="Относителна влажност [%]" unit=" %" animationDuration={0} isAnimationActive={false} />
                </ComposedChart>
            </div>

            {data.index + 1} is for popup with lat: {data.lat} and lng {data.lng}
            {/* {data.index + 1} is for popup with lat: {data.lat} and lon {data.lng} */}
        </Popup>
    )
}

export default Chart
</code>```

*The data from the api is test, so it can be used for testing. If the two pages are copied for testing, they will most likely start with three libraries installed:

npm i react-leaflet

npm i react-moment

npm i recharts*

Can I get some solution to change the data automatically when clicking on a different marker ?

ContentLicense: CC BY-SA 4.0

Body:
I visualize 1919 markers on a map (leaflet).

I'm trying to click on the marker to load forecast charts for our country.

The first thing that strikes me in network inspector is these mistakes:

GET http://194.141.118.43:3000/?date=2019-10-20&id=4&daysForward=8
[HTTP/1.1 304 Not Modified 358ms]

The second request passes with code 200 ok

GET http://194.141.118.43:3000/?date=2019-10-20&id=4&daysForward=8
[HTTP/1.1 200 OK 418ms]

When I use console.log(data) I can see the API data in the console inspector.

When I click on a marker on the map I see the same error many times:

MouseEvent.mozPressure is deprecated. Use PointerEvent.pressure instead. Util.js:15
Error in parsing value for ‘font-size’.  Declaration dropped. localhost:5000
Error in parsing value for ‘letter-spacing’.  Declaration dropped. localhost:5000

When I click on different markers on the map, the data does not change in the graphs.

My App.js look like this:

    import logo from './logo.svg';
import './App.css';
import React from 'react';
import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet'
import L from "leaflet";
import Chart from './chart';

const customMarker = new L.Icon({
  iconUrl: require('../src/images/marker.png'),
  iconSize: [25, 25],
  iconAnchor: [10, 41],
  popupAnchor: [2, -40]
});

class App extends React.Component {

  state = {
    date: new Date(),
  }

  constructor(props) {
    super(props);
    this.state = {
      coords: [
        { lat: 41.19197, lng: 25.33719 },
        { lat: 41.26352, lng: 25.1471 },
        { lat: 41.26365, lng: 25.24215 },
        { lat: 41.26369, lng: 25.33719 },
        { lat: 41.26365, lng: 25.43224 }
      ],
      dats: null,
      temp: null,
      dataAPI: null,
      id: 4,
      lng: 0,
      lat: 0,
      loading: true,
    };
    this.onChangeHandler = this.onChangeHandler.bind(this);
    this.loadData = this.loadData.bind(this);
  }

  async loadData(data) {
    this.setState({id: data.id})
     this.getData();
   }

   async componentDidMount() {
    this.getData();
   }

   async getData(){
    var id = this.state.id;
    const url = `http://194.141.118.43:3000/?date=2019-10-20&id=${id}&daysForward=8`;
    const response = await fetch(url);
    let data = await response.json();
    this.setState({ dataAPI: data.aladinModel[0], loading: false });
    this.setState({ temp: data.aladinModel[0], loading: false });
    this.setState({ dats: data.aladinModel[0], loading: false });
    console.log(data);
  }

  async onChangeHandler(e) {
    debugger;
    this.setState({ [e.target.name]: e.target.value });
    this.getData();
}

  render() {
    const { coords } = this.state;
    return (

            Edit src/App.js and save to reload.

          <MapContainer center={[42.733883, 25.48583]} zoom={8} scrollWheelZoom={false}>
            <TileLayer
              attribution='© OpenStreetMap contributors'
              url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
            />

            {coords.map(({ lat, lng }, index) => (
              <Marker position={[lat, lng]} icon={customMarker} key={index}
                onClick={() => this.loadData(
                  {
                    id: index,
                    lat: lat,
                    lng: lng
                  }
                )}>

                  <Chart
                    dats={this.state.dats}
                    index={this.state.id}
                    lng={lng}
                    lat={lat}
                  />

              </Marker>
            ))}

            {/* Default Marker

            <Marker position={[51.505, -0.09]}>
              <Popup>
                A pretty CSS3 popup.
 Easily customizable.
              </Popup>
            </Marker>

             */}
          </MapContainer>

    );
  }
}

export default App;

This is my Chart.jsx file:

    import React from 'react';
import {
    ComposedChart,
    Bar,
    Area,
    Line,
    XAxis,
    YAxis,
    CartesianGrid,
    Tooltip,
    Legend,
    LineChart,
    Label,
} from 'recharts';

import { MapContainer, LeafletMap, TileLayer, Marker, Popup } from "react-leaflet";
import moment from 'moment';

moment.globalTimezone = 'Europe/Sofia';

let Chart = (data) => {
    return (
        <Popup maxWidth="1000" maxHeight="auto" >

                <ComposedChart width={440} height={250} data={data.dats} margin={{
                    top: 20, right: 0, left: 0, bottom: 20,
                }}>
                    <CartesianGrid strokeDasharray="3 3" />
                    <XAxis dataKey="DATS" tickFormatter={(unixTime) => moment(unixTime).format('DD.MM - HHч.')} />
                    <YAxis yAxisId="left" >
                    <XAxis Label value="Темп." dx={-15} />
                        </YAxis>
                    <YAxis yAxisId="right" orientation="right" >
                        <YAxis Label value="Сняг" dy={11} dx={13} />
                        <YAxis Label value="Дъжд" dy={25} dx={14} />
                    </YAxis>
                    <Tooltip />
                    <Legend />
                    <Bar dataKey='RR' yAxisId="right" name="Дъжд [mm]" barSize={6} fill='rgba(0, 60, 255, 0.6)' unit=" mm" animationDuration={0} isAnimationActive={false} />
                    <Bar dataKey='SR' yAxisId="right" name="Сняг [mm]" barSize={6} fill='rgba(93, 245, 220, 0.8)' unit=" mm" animationDuration={0} isAnimationActive={false} />
                    <Line dataKey='TA' yAxisId="left" name="Температура [°C]" type="monotone" stroke="rgba(235, 94, 52, 0.85)" activeDot={{ r: 5 }} unit=' °C' animationDuration={0} isAnimationActive={false} />
                </ComposedChart>

                <ComposedChart width={500} height={250} data={data.dats}
                    margin={{ top: 20, right: 0, left: 0, bottom: 20, }}>
                    <CartesianGrid strokeDasharray="3 3" />
                    <XAxis dataKey="DATS" tickFormatter={(unixTime) => moment(unixTime).format('DD.MM - HHч.')} />
                    <YAxis yAxisId="left" domain={[80000, 110000]} />
                    <YAxis yAxisId="right" domain={[0, 100]} orientation="right" >
                        <YAxis Label value="RH" dx={5} />
                    </YAxis>
                    <YAxis yAxisId="rightWS" orientation="right">
                        <YAxis Label value="WS" dx={5} />
                    </YAxis>
                    <Tooltip />
                    <Legend />
                    <Area yAxisId="left" type="monotone" dataKey="APRES" fill="rgba(136, 132, 216, 0.5)" stroke="rgba(136, 132, 216, 0.9)" activeDot={{ r: 5 }} name="Атмосферно налягане [hPa]" unit=" hPa" animationDuration={0} isAnimationActive={false} />
                    <Bar dataKey='WS' yAxisId="rightWS" name="Скорост на вятъра [км/ч]" barSize={6} fill='rgba(148, 153, 255, 0.8)' unit=" км/ч" animationDuration={0} isAnimationActive={false} />
                    <Line yAxisId="right" type="monotone" dataKey="RH" stroke="#82ca9d" name="Относителна влажност [%]" unit=" %" animationDuration={0} isAnimationActive={false} />
                </ComposedChart>

            {data.index + 1} is for popup with lat: {data.lat} and lng {data.lng}
            {/* {data.index + 1} is for popup with lat: {data.lat} and lon {data.lng} */}
        </Popup>
    )
}

export default Chart

*The data from the api is test, so it can be used for testing. If the two pages are copied for testing, they will most likely start with three libraries installed:

npm i react-leaflet

npm i react-moment

npm i recharts*

Can I get some solution to change the data automatically when clicking on a different marker ?


问:
How to receive messages from OSC in Flutter?
I'm trying to receive data from a gadget with OSC Protocol, and with a port that I defined, I can receive the message in the Protokol android app. I want to receive messages in my app. I think the OSCpackage for flutter is not properly working, or maybe I made a wrong!

```<code>This is receive function:

</code>```
```<code>int defaultPort = 12345;

  void receiveOsc(List<String> args) {
    final port = defaultPort;

    final socket = OSCSocket(serverPort: port);
    print(socket);
    socket.listen((msg) {
      print("${msg.toString()}");
      socket.reply(OSCMessage('/received', arguments: []));
    });
  }
</code>```
```<code></code>```

i Want to get messages in string format in my defined port.

Body:
I'm trying to receive data from a gadget with OSC Protocol, and with a port that I defined, I can receive the message in the Protokol android app. I want to receive messages in my app. I think the OSCpackage for flutter is not properly working, or maybe I made a wrong!

This is receive function:

int defaultPort = 12345;

  void receiveOsc(List<String> args) {
    final port = defaultPort;

    final socket = OSCSocket(serverPort: port);
    print(socket);
    socket.listen((msg) {
      print("${msg.toString()}");
      socket.reply(OSCMessage('/received', arguments: []));
    });
  }

i Want to get messages in string format in my defined port.


问:
flutter app stuck on "Running Gradle task 'assembleDebug'..." forever
when i run the app, it gets stuck forever.

I've been working on this project for about 6 months, I have never had a problem with gradle

has anyone ever experienced something similar?

here is the output of my flutter doctor

```<code>
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
\[√\] Flutter (Channel stable, 3.0.4, on Microsoft Windows \[Version 10.0.19044.2251\], locale en-CH)
Checking Android licenses is taking an unexpectedly long time...\[√\] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
\[√\] Chrome - develop for the web
\[√\] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.19)
\[√\] Android Studio (version 2021.2)
\[√\] IntelliJ IDEA Ultimate Edition (version 2022.2)
\[√\] VS Code (version 1.73.1)
\[√\] Connected device (4 available)
\[√\] HTTP Host Availability

• No issues found!

</code>```

I also tried to do gradlew clean, but it gets stuck aswell

```<code>
.\\gradlew clean
Starting a Gradle Daemon, 16 busy Daemons could not be reused, use --status for details

> Configure project :firebase_auth
> WARNING: The option setting 'android.enableR8=true' is deprecated.
> It will be removed in version 5.0 of the Android Gradle plugin.
> You will no longer be able to disable R8
> \<-------------\> 0% EXECUTING \[8m 32s\]

</code>```
```<code></code>```

Body:
when i run the app, it gets stuck forever.

I've been working on this project for about 6 months, I have never had a problem with gradle

has anyone ever experienced something similar?

here is the output of my flutter doctor

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
\[√\] Flutter (Channel stable, 3.0.4, on Microsoft Windows \[Version 10.0.19044.2251\], locale en-CH)
Checking Android licenses is taking an unexpectedly long time...\[√\] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
\[√\] Chrome - develop for the web
\[√\] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.19)
\[√\] Android Studio (version 2021.2)
\[√\] IntelliJ IDEA Ultimate Edition (version 2022.2)
\[√\] VS Code (version 1.73.1)
\[√\] Connected device (4 available)
\[√\] HTTP Host Availability

• No issues found!

I also tried to do gradlew clean, but it gets stuck aswell

.\\gradlew clean
Starting a Gradle Daemon, 16 busy Daemons could not be reused, use --status for details

> Configure project :firebase_auth
> WARNING: The option setting 'android.enableR8=true' is deprecated.
> It will be removed in version 5.0 of the Android Gradle plugin.
> You will no longer be able to disable R8
> \<-------------\> 0% EXECUTING \[8m 32s\]


问:
what type of pointer does fread need
I want to read data from a bmp file into a 2d array the array is a array of RGB Structure
but in vscode i get an error:

argument of type "RGB" is incompatible with parameter of type "void
*"

Here is were I get the error:

```<code>void read (RGB** pic,FILE* file, int hojde, int brede)
{
  for (int y=hojde-1;y>0;y--)
  {
    for(int x=0;x<brede;x++)
    {
      fread(pic[x][y],3,1,file);
    }

  }
  fseek(file,(brede*3)%4,SEEK_CUR);

  return;
}

typedef struct
{
    unsigned char blue;
    unsigned char green;
    unsigned char red;
}RGB;
</code>```

And here is were I declare the array and call the function:

```<code>RGB** pic;
pic= malloc(sizeof(RGB*)*dip_header.hojde);

for (int i=0;i<dip_header.hojde;i++)
{
    pic[i]=malloc(sizeof(RGB)*dip_header.brede);
}
read(pic,file,dip_header.hojde,dip_header.brede);
</code>```

I thought I could load a array into fread because the array is kind of a pointer(at least I thought so)

Title: what type of pointer does fread need

Body:
I want to read data from a bmp file into a 2d array the array is a array of RGB Structure
but in vscode i get an error:

argument of type "RGB" is incompatible with parameter of type "void
*"

Here is were I get the error:

void read (RGB** pic,FILE* file, int hojde, int brede)
{
  for (int y=hojde-1;y>0;y--)
  {
    for(int x=0;x<brede;x++)
    {
      fread(pic[x][y],3,1,file);
    }

  }
  fseek(file,(brede*3)%4,SEEK_CUR);

  return;
}

typedef struct
{
    unsigned char blue;
    unsigned char green;
    unsigned char red;
}RGB;

And here is were I declare the array and call the function:

RGB** pic;
pic= malloc(sizeof(RGB*)*dip_header.hojde);

for (int i=0;i<dip_header.hojde;i++)
{
    pic[i]=malloc(sizeof(RGB)*dip_header.brede);
}
read(pic,file,dip_header.hojde,dip_header.brede);

I thought I could load a array into fread because the array is kind of a pointer(at least I thought so)


问:
How to read data with text line as a column in pandas?
I have a data in the format of  (6 columns, text between "...." count as one column):

```<code>name kind number purenumber dew fin
John "['car' 'house' 'bicycle']" "[2 9 6]" 3 7 medium
Paul "['pool' 'gym' 'factory']" "[1 1 1]" 1 2 high
</code>```

I need to load all the data between "........"  as a column and basic delimeter as a space for between columns. Could not find the correct load method with pandas.

```<code>import pandas as pd
df = pd.read_csv("/Users/comp1/Desktop/cost_val.csv",  delimiter = '\t', sep=" ")
</code>```

does not seem to be working, any way to quickly load this with pandas?

Body:
I have a data in the format of  (6 columns, text between "...." count as one column):

name kind number purenumber dew fin
John "['car' 'house' 'bicycle']" "[2 9 6]" 3 7 medium
Paul "['pool' 'gym' 'factory']" "[1 1 1]" 1 2 high

I need to load all the data between "........"  as a column and basic delimeter as a space for between columns. Could not find the correct load method with pandas.

import pandas as pd
df = pd.read_csv("/Users/comp1/Desktop/cost_val.csv",  delimiter = '\t', sep=" ")

does not seem to be working, any way to quickly load this with pandas?


问:
How to make my program to wait for user to close JDialog?
I wanted to ask if anyone knows how to make the program go to rest and the user having to confirm his return? For now I have a timer that check if the mouse was not moving on the screen and any key was pressed in last 10 minutes.

So after showing a JDialog in the timer:

```<code>JDialog d = new JDialog(this, "Program stopped by AntyAFK procedure.", true );
d.setSize(300, 300);
        d.show();
</code>```

I tried to make my program rest by making a thread go to stop until user close the JDialog, because I don't want my program to make any changes when the user is away:

```<code>while (new MyFrame().isVisible()) {
    try {
        Thread.currentThread().stop();
    } catch (Exception e) {
    }
}
</code>```

But it does not work. I actually know that it is incorrect, because I stopped my main thread, but for now I don't have any hint what to do to stop it and make possible way to close a new showed JDialog to restart main thread.

Body:
I wanted to ask if anyone knows how to make the program go to rest and the user having to confirm his return? For now I have a timer that check if the mouse was not moving on the screen and any key was pressed in last 10 minutes.

So after showing a JDialog in the timer:

JDialog d = new JDialog(this, "Program stopped by AntyAFK procedure.", true );
d.setSize(300, 300);
        d.show();

I tried to make my program rest by making a thread go to stop until user close the JDialog, because I don't want my program to make any changes when the user is away:

while (new MyFrame().isVisible()) {
    try {
        Thread.currentThread().stop();
    } catch (Exception e) {
    }
}

But it does not work. I actually know that it is incorrect, because I stopped my main thread, but for now I don't have any hint what to do to stop it and make possible way to close a new showed JDialog to restart main thread.


问:
Entering a kubeCTL pod from a node script
I have the following code:

```<code>exec('kubectl exec -it -n production my-kubectl-pod-id bash',
            function (e, stdo, stde) {
                console.log(stdo)
            })
</code>```

However it doesnt work.  When it runs, the program just stalls and I can't see the command line prompt at all, but i can type new lines but it is not running any commands i type.

I'm expecting to enter a pod and be able to work inside the pod however i need.

Is there a way to do this from inside a node script? Or a way for the script to end and then run that command?

Body:
I have the following code:

exec('kubectl exec -it -n production my-kubectl-pod-id bash',
            function (e, stdo, stde) {
                console.log(stdo)
            })

However it doesnt work.  When it runs, the program just stalls and I can't see the command line prompt at all, but i can type new lines but it is not running any commands i type.

I'm expecting to enter a pod and be able to work inside the pod however i need.

Is there a way to do this from inside a node script? Or a way for the script to end and then run that command?


问:
Suitable technology for scalable cloud app with API for approx 100K requests per minute
I'm C# dev with focus on mobile apps and desktop, I've never done anything which includes cloud, cloud apps, web or cloud API (other than WCF). What is latest (LTS) technology for simple API with its own database (one or two tables at most) ? Majority of the requests wouldn't need write access to DB. Could you hold data in memory like cache and synchro it once in a while ? What is the best approach to achieve this ? Scalability is a must as it should be able to serve approx 100K requests per minute in peek. Preferably it should be something from Azure and .NET, but its so huge that I don't know whats best combination for it.</p>


问:
Pandas Matching exact key phrases / words Between Main dataframe and Keywords dataframe
I have 2 dataframes. First one is my main data with hundred-thousands of rows.
Another is where my list of keywords/phrases are kept.
In the main data, there will be a column called 'Match' where the matching keywords/phrases are found. Example: string from main data is "I have a red apple and a pear.", and the keywords/phrases I have are "apple", "pear" and "red apple" (Non-Case sensitive)

The output im looking for is to have multiple columns of matching results ("red apple" in 1st column, "apple" in 2nd column and "pear" in 3rd column. Order of the matching keywords/phrases are not crucial).
If not, I can just have red apple and pear


问:
Latest modified code is not reloading / Updating in the application RN 0.59.10
```<code>React Native Environment Info:
    System:
      OS: macOS 13.0.1
      CPU: (10) arm64 Apple M1 Pro
      Memory: 1.33 GB / 16.00 GB
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9014738
      Xcode: 14.1/14B47b - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.59.10 => 0.59.10
    npmGlobalPackages:
      react-native-cli: 2.0.1
</code>```

Due to some emergency fix we are using old version of RN 0.59.10. In that code we are added our fixes but its not reflecting in the application. If we are removed some View (UI), that is also not reflecting the application.

We are tried build clean, kill the app and re-run and restarted our machine also. But, our code changes not reflecting in the application. Can any one help us...

Body:
React Native Environment Info:
    System:
      OS: macOS 13.0.1
      CPU: (10) arm64 Apple M1 Pro
      Memory: 1.33 GB / 16.00 GB
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9014738
      Xcode: 14.1/14B47b - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.59.10 => 0.59.10
    npmGlobalPackages:
      react-native-cli: 2.0.1

Due to some emergency fix we are using old version of RN 0.59.10. In that code we are added our fixes but its not reflecting in the application. If we are removed some View (UI), that is also not reflecting the application.

We are tried build clean, kill the app and re-run and restarted our machine also. But, our code changes not reflecting in the application. Can any one help us...


问:
How do I send a Discord message using the console (javascript)
How to send a message on a Discord channel using the web console and without Discord API.
I searched a lot but didn't find what I need. I know that you can "copy as fetch" a message that has been sended and edit the body but I want a code that will get the token and everything and send the message.

I think the Discord script contains a function to send a message or something but I can't find it...

I hope someone has the answer :)


问:
Running netlogo headless and repeat the experiment
I plan to run my model on a cluster so I can repete the run (at least 40 times) on multiple cores.  I found usefull info on stack, on the netlogo website but I don't see the codes lines to speficy the number of repetitions ? Is it something like --repetition 40  ?

```<code>--model ~/myproject/MyModel.nlogo \
--experiment MyExperiment \
--threads 8
--Dnetlogo.extensions.dir="path"
</code>```

Body:
I plan to run my model on a cluster so I can repete the run (at least 40 times) on multiple cores.  I found usefull info on stack, on the netlogo website but I don't see the codes lines to speficy the number of repetitions ? Is it something like --repetition 40  ?

--model ~/myproject/MyModel.nlogo \
--experiment MyExperiment \
--threads 8
--Dnetlogo.extensions.dir="path"


问:
Getting Wifi SSID in Android13/API Level 33
Whrn i try to get the WIFI-SSID, I get UNKNOWN_SSID

below is my Code:

```<code>if(ContextCompat.checkSelfPermission(MainActivity.super.getApplicationContext(), Manifest.permission.ACCESS_WIFI_STATE)== PackageManager.PERMISSION_GRANTED){
    if(ContextCompat.checkSelfPermission(MainActivity.super.getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){
        ConnectivityManager cm = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
        Network netnow = cm.getActiveNetwork();
        WifiInfo wf =  (WifiInfo)cm.getNetworkCapabilities(netnow).getTransportInfo();
        String ssid = wf.getSSID();
    }
}
</code>```

i want to get the right SSID.
The document said WIFIinfo requires same permission as WifiManager#getScanResults,I checked it but still cant get ssid,i dont know why and how can i solve it.
1
2

Body:
Whrn i try to get the WIFI-SSID, I get UNKNOWN_SSID

below is my Code:

if(ContextCompat.checkSelfPermission(MainActivity.super.getApplicationContext(), Manifest.permission.ACCESS_WIFI_STATE)== PackageManager.PERMISSION_GRANTED){
    if(ContextCompat.checkSelfPermission(MainActivity.super.getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){
        ConnectivityManager cm = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
        Network netnow = cm.getActiveNetwork();
        WifiInfo wf =  (WifiInfo)cm.getNetworkCapabilities(netnow).getTransportInfo();
        String ssid = wf.getSSID();
    }
}

i want to get the right SSID.
The document said WIFIinfo requires same permission as WifiManager#getScanResults,I checked it but still cant get ssid,i dont know why and how can i solve it.
1
2


问:
How to preserve query params using <Route> in React Router V6?
I don't see any mention of a "search" parameter on Route
https://reactrouter.com/en/main/route/route

Currently, at least for my project, params are lost when a new route is matched and applied.

Does anyone know the best way of ensuring any existing search params are re-applied after a route change?


问:
How to merge a separate branch into main?
I have 2 branches.

main

branch_A

main branch

```<code>folder_a
folder_b
submodule_a
readme_a.md
</code>```

branch_A branch

```<code>folder_c
submodule_b
readme_b.md
</code>```

I need to merge branch_A with main so that i can add this as different tag.

What i am doing is cloning the main branch and making changes to branch_A structure.

Issue is git is throwing error branch_A is behind main or head is not at start.

How should i merge it? Any help appreciated. Thanks.

Body:
I have 2 branches.

main

branch_A

main branch

folder_a
folder_b
submodule_a
readme_a.md

branch_A branch

folder_c
submodule_b
readme_b.md

I need to merge branch_A with main so that i can add this as different tag.

What i am doing is cloning the main branch and making changes to branch_A structure.

Issue is git is throwing error branch_A is behind main or head is not at start.

How should i merge it? Any help appreciated. Thanks.


问:
dynamic partition prunning not working in spark
There are two tables: one big (T0), one small (T1). I run code below and expect it to use DPP, but it does not:

df = spark.table('T0').select('A', 'B', 'C')
df1 = spark.table('T1').select('A')
df.join(F.broadcast(df1), ['A']).explain()
```
<p>Then I do a hack and it starts working:</p>
<pre class="lang-py prettyprint-override"><code>values = [_.A for _ in df1.select('A').collect()]
values_type = ArrayType(StringType())
df2 = spark.createDataFrame([values], values_type).select(F.explode('value').alias('A'))
df.join(F.broadcast(df2), ['A']).explain()
</code>```

In first case I see BatchScan[...] T0 [filters=] RuntimeFilters: []

And in second: BatchScan[...] T0 [filters=] RuntimeFilters: [dynamicpruningexpression(A#5172 IN dynamicpruning#10343)]

What is the difference between two cases? My guess was about nullable = true for T1 but I tried both options (nullable = true|false) and it does not work in both.

Don't know if it is important but I use iceberg as a data storage.

Body:
There are two tables: one big (T0), one small (T1). I run code below and expect it to use DPP, but it does not:

df = spark.table('T0').select('A', 'B', 'C')
df1 = spark.table('T1').select('A')
df.join(F.broadcast(df1), ['A']).explain()

Then I do a hack and it starts working:

values = [_.A for _ in df1.select('A').collect()]
values_type = ArrayType(StringType())
df2 = spark.createDataFrame([values], values_type).select(F.explode('value').alias('A'))
df.join(F.broadcast(df2), ['A']).explain()

In first case I see BatchScan[...] T0 [filters=] RuntimeFilters: []

And in second: BatchScan[...] T0 [filters=] RuntimeFilters: [dynamicpruningexpression(A#5172 IN dynamicpruning#10343)]

What is the difference between two cases? My guess was about nullable = true for T1 but I tried both options (nullable = true|false) and it does not work in both.

Don't know if it is important but I use iceberg as a data storage.


问:
Laravel vite won't process custom css
I am trying to inject my custom css in built css file but it does not process resources/css/app.css file

vite.config.js

```<code>import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/sass/app.scss',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
    resolve: {
        alias: {
            '$': 'jQuery'
        },
    },
});
</code>```

resources/css/app.css

```<code>h2.swal2-title {
    font-size: 1.2em !important;
}
</code>```

This css does not add to generate css file by npm run build

Any idea?

Title: Laravel vite won't process custom css

Body:
I am trying to inject my custom css in built css file but it does not process resources/css/app.css file

vite.config.js

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/sass/app.scss',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
    resolve: {
        alias: {
            '$': 'jQuery'
        },
    },
});

resources/css/app.css

h2.swal2-title {
    font-size: 1.2em !important;
}

This css does not add to generate css file by npm run build

Any idea?


问:
Is there an R function to format a character string pattern?
Hey guys am trying to format the character strings

```<code>X <- c("20,85","30,45,60")
</code>```

and have something like this ->

```<code>X <-c("20","85", "30","45","60")
</code>```

I tried using the str_split() in R but instead got a notification "list output truncated "

Is there any way I can do this in R  and apply it to a bigger data frame without losing its structure?

Body:
Hey guys am trying to format the character strings

X <- c("20,85","30,45,60")

and have something like this ->

X <-c("20","85", "30","45","60")

I tried using the str_split() in R but instead got a notification "list output truncated "

Is there any way I can do this in R  and apply it to a bigger data frame without losing its structure?


问:
Datatable double-click event : issue while trying to display reactive values within modalDialog (Rshiny)
I'm trying to display a range of reactive values within a modalDialog based on double-click event in a datatable.

What I did so far (reproducible example):

```<code>ui <-fluidPage(DT::dataTableOutput("test"))

server <- function(input, output, session) {

  output$test <- DT::renderDataTable({
    DT::datatable(
      data = iris,
      class = 'compact',
      escape = FALSE,
      rownames = FALSE,
      selection = "single",
      options = (
        list(
          dom = "t",
          ordering = FALSE,
          paging = FALSE,
          autoWidth = FALSE,
          scrollY = "100vh",
          scrollCollapse = FALSE
        )
      ),
      callback = htmlwidgets::JS(
        "table.on('dblclick', 'td',",
        "  function() {",
        "    var row = table.cell(this).index().row;",
        "    var col = table.cell(this).index().column;",
        "    Shiny.setInputValue('dt_dblclick', {dt_row: row, dt_col: col});",
        "  }",
        ");"
      )
    )
  }, server = FALSE)

  modal_content <- reactive(paste(
    '<figure class="snip0056 yellow">
    <figcaption>
      <h5 style="color:black;font-size:3rem"><b> Flower name:', iris$Species[input$test_rows_selected], '</b></h5>
      <h2 style="color:#7C8386;font-size:2.5rem"><b> Petal Width', iris$Species[input$test_rows_selected], '</b></h2>
    <h5 style="color:#3ba51a;font-size:2rem;padding-top: 10px;">Keywords: </b></h5></i>',
    checkboxGroupButtons(
      inputId = "domaines_tags",
      label = "",
      choices = c(unique(iris$Species[input$test_rows_selected])),
      selected = NULL
    ),
    '<div class="icons"><a href="#"><i class="ion-ios-home"></i></a><a href="#"><i class="ion-ios-email"></i></a><a href="#"><i class="ion-ios-telephone"></i></a></div>
    </figcaption><img src="https://u.cubeupload.com/adsuri/7NQDHz.jpeg" alt="sample9" width="10"/>'))

  observeEvent(input$dt_dblclick, {
      showModal(modalDialog(
        title = "Popup test",
        HTML(modal_content()),
        footer = tagList(
          modalButton("Annuler")
        ),  size = "l"
      ))
    })

}
</code>```

As you can see the reactive values are not displayed in the modal window but if I change       observeEvent(input$dt_dblclick, { by observeEvent(input$test_rows_selected, { the code works perfectly fine ! What am I missing ?

Body:
I'm trying to display a range of reactive values within a modalDialog based on double-click event in a datatable.

What I did so far (reproducible example):

ui <-fluidPage(DT::dataTableOutput("test"))

server <- function(input, output, session) {

  output$test <- DT::renderDataTable({
    DT::datatable(
      data = iris,
      class = 'compact',
      escape = FALSE,
      rownames = FALSE,
      selection = "single",
      options = (
        list(
          dom = "t",
          ordering = FALSE,
          paging = FALSE,
          autoWidth = FALSE,
          scrollY = "100vh",
          scrollCollapse = FALSE
        )
      ),
      callback = htmlwidgets::JS(
        "table.on('dblclick', 'td',",
        "  function() {",
        "    var row = table.cell(this).index().row;",
        "    var col = table.cell(this).index().column;",
        "    Shiny.setInputValue('dt_dblclick', {dt_row: row, dt_col: col});",
        "  }",
        ");"
      )
    )
  }, server = FALSE)

  modal_content <- reactive(paste(
    '

 Flower name:', iris$Species[input$test_rows_selected], '

 Petal Width', iris$Species[input$test_rows_selected], '

Keywords:
',
    checkboxGroupButtons(
      inputId = "domaines_tags",
      label = "",
      choices = c(unique(iris$Species[input$test_rows_selected])),
      selected = NULL
    ),
    '

'))

  observeEvent(input$dt_dblclick, {
      showModal(modalDialog(
        title = "Popup test",
        HTML(modal_content()),
        footer = tagList(
          modalButton("Annuler")
        ),  size = "l"
      ))
    })

}

As you can see the reactive values are not displayed in the modal window but if I change       observeEvent(input$dt_dblclick, { by observeEvent(input$test_rows_selected, { the code works perfectly fine ! What am I missing ?


问:
Cannot download C#/.Net (Xamarin v4.2.1) on visual studio 2015
I have a legacy project built on Xamarin Android target framework 19. The apk is installed on a custom device that runs Android KitKat. I am trying to build the project with VS2019 but I face some compatibility issues, hence I am trying to install VS2015. But the Xamarin studio URL seems to be changed with the recent update from Microsoft chance I see the following issue.

C#/.NET (Xamarin v4.2.1) This product did not download successfully.
HTTP status 404 .The requested url does not exist on the server.

It looks like the visual studio 2015 iso file doesn't contain xamarin packages.
Can anyone help me to istall xamarin on VS2015 or share me iso with xamarin included?


问:
google-cloud-dialogflow-cx: Cannot resolve "google.cloud.dialogflowcx_v3" import "types" statement
I am currently trying to import types from google.cloud.dialogflowcx_v3 through the google-cloud-dialogflow-cx library as follows:

```<code>from google.cloud import dialogflowcx_v3 as dialogflow
from google.cloud.dialogflowcx_v3 import types
</code>```

The second line of code is giving me the error:

from "google.cloud.dialogflowcx_v3" import types could not be resolved

On VSCode despite having google-cloud-dialogflow-cx installed. Has anyone run into this problem before?

(I am hoping to use the following code from this thread after I can get the second line of code to work: How to start a conversation using an event in Dialogflow cx sending by python)

Body:
I am currently trying to import types from google.cloud.dialogflowcx_v3 through the google-cloud-dialogflow-cx library as follows:

from google.cloud import dialogflowcx_v3 as dialogflow
from google.cloud.dialogflowcx_v3 import types

The second line of code is giving me the error:

from "google.cloud.dialogflowcx_v3" import types could not be resolved

On VSCode despite having google-cloud-dialogflow-cx installed. Has anyone run into this problem before?

(I am hoping to use the following code from this thread after I can get the second line of code to work: How to start a conversation using an event in Dialogflow cx sending by python)


问:
My laravel API only returns empty curly bracket
This is the response I get when making a get request to my API

enter image description here

The code below is my current code

```<code>function getDNSData(string $domain)
{
    $dns = new Dns();

    try {
        $records = json_encode($dns->getRecords($domain));
        return $records;
    } catch(CouldNotFetchDns $e) {
        dd($e);
        return ["errors" => $e];
    }
}
</code>```

I used die dump function to check if data was being passed through correctly and that worked
Using json_decode i couldnt get it to work either

diedumpResult

Body:
This is the response I get when making a get request to my API

enter image description here

The code below is my current code

function getDNSData(string $domain)
{
    $dns = new Dns();

    try {
        $records = json_encode($dns->getRecords($domain));
        return $records;
    } catch(CouldNotFetchDns $e) {
        dd($e);
        return ["errors" => $e];
    }
}

I used die dump function to check if data was being passed through correctly and that worked
Using json_decode i couldnt get it to work either

diedumpResult


问:
Pytorch: Is there an issue in the forward pass when I reassign a variable with a new value?
I am new with pytorch and I have an issue when I try to train the network from this great work https://github.com/Jiahao-UTS/SLPT-master.

When I modify the forward pass of the SLPT like follow, the training is stable very fast (arround NME = 30%)

```<code>        # stage_1
        ROI_anchor_1, bbox_size, start_anchor = self.ROI_1(initial_landmarks.detach())
        ROI_anchor_1 = ROI_anchor_1.view(bs, self.num_point * self.Sample_num * self.Sample_num, 2)
        ROI_feature_1 = self.interpolation(feature_map, ROI_anchor_1.detach()).view(bs, self.num_point, self.Sample_num,
                                                                            self.Sample_num, self.d_model)
        ROI_feature_1 = ROI_feature_1.view(bs * self.num_point, self.Sample_num, self.Sample_num,
                                     self.d_model).permute(0, 3, 2, 1)

        transformer_feature_1 = self.feature_extractor(ROI_feature_1).view(bs, self.num_point, self.d_model)

        offset_1 = self.Transformer(transformer_feature_1)
        offset_1 = self.out_layer(offset_1)

        landmarks_1 = start_anchor.unsqueeze(1) + bbox_size.unsqueeze(1) * offset_1
        output_list.append(landmarks_1)

        # stage_2
        ROI_anchor_2, bbox_size, start_anchor = self.ROI_2(landmarks_1[:, -1, :, :].detach())
        ROI_anchor_2 = ROI_anchor_2.view(bs, self.num_point * self.Sample_num * self.Sample_num, 2)
        ROI_feature_2 = self.interpolation(feature_map, ROI_anchor_2.detach()).view(bs, self.num_point, self.Sample_num,
                                                                                self.Sample_num, self.d_model)
        ROI_feature_2 = ROI_feature_2.view(bs * self.num_point, self.Sample_num, self.Sample_num,
                                           self.d_model).permute(0, 3, 2, 1)

        transformer_feature_2 = self.feature_extractor(ROI_feature_2).view(bs, self.num_point, self.d_model)

        offset_2 = self.Transformer(transformer_feature_2)
        offset_2 = self.out_layer(offset_2)

        landmarks_2 = start_anchor.unsqueeze(1) + bbox_size.unsqueeze(1) * offset_2
        output_list.append(landmarks_2)

        # stage_3
        ROI_anchor_3, bbox_size, start_anchor = self.ROI_3(landmarks_2[:, -1, :, :].detach())
        ROI_anchor_3 = ROI_anchor_3.view(bs, self.num_point * self.Sample_num * self.Sample_num, 2)
        ROI_feature_3= self.interpolation(feature_map, ROI_anchor_3.detach()).view(bs, self.num_point, self.Sample_num,
                                                                                self.Sample_num, self.d_model)
        ROI_feature_3 = ROI_feature_3.view(bs * self.num_point, self.Sample_num, self.Sample_num,
                                           self.d_model).permute(0, 3, 2, 1)

        transformer_feature_3 = self.feature_extractor(ROI_feature_3).view(bs, self.num_point, self.d_model)

        offset_3 = self.Transformer(transformer_feature_3)
        offset_3 = self.out_layer(offset_3)

        landmarks_3 = start_anchor.unsqueeze(1) + bbox_size.unsqueeze(1) * offset_3
        output_list.append(landmarks_3)
</code>```

And it doesn't converge to the expected results (arround NME = 4.1%). But if I don't change the original code, the training converge to the expected results.

So, my question is why the training result is different in this two case?

I try to train the network with reassign some variables in the forward pass.

Body:
I am new with pytorch and I have an issue when I try to train the network from this great work https://github.com/Jiahao-UTS/SLPT-master.

When I modify the forward pass of the SLPT like follow, the training is stable very fast (arround NME = 30%)

        # stage_1
        ROI_anchor_1, bbox_size, start_anchor = self.ROI_1(initial_landmarks.detach())
        ROI_anchor_1 = ROI_anchor_1.view(bs, self.num_point * self.Sample_num * self.Sample_num, 2)
        ROI_feature_1 = self.interpolation(feature_map, ROI_anchor_1.detach()).view(bs, self.num_point, self.Sample_num,
                                                                            self.Sample_num, self.d_model)
        ROI_feature_1 = ROI_feature_1.view(bs * self.num_point, self.Sample_num, self.Sample_num,
                                     self.d_model).permute(0, 3, 2, 1)

        transformer_feature_1 = self.feature_extractor(ROI_feature_1).view(bs, self.num_point, self.d_model)

        offset_1 = self.Transformer(transformer_feature_1)
        offset_1 = self.out_layer(offset_1)

        landmarks_1 = start_anchor.unsqueeze(1) + bbox_size.unsqueeze(1) * offset_1
        output_list.append(landmarks_1)

        # stage_2
        ROI_anchor_2, bbox_size, start_anchor = self.ROI_2(landmarks_1[:, -1, :, :].detach())
        ROI_anchor_2 = ROI_anchor_2.view(bs, self.num_point * self.Sample_num * self.Sample_num, 2)
        ROI_feature_2 = self.interpolation(feature_map, ROI_anchor_2.detach()).view(bs, self.num_point, self.Sample_num,
                                                                                self.Sample_num, self.d_model)
        ROI_feature_2 = ROI_feature_2.view(bs * self.num_point, self.Sample_num, self.Sample_num,
                                           self.d_model).permute(0, 3, 2, 1)

        transformer_feature_2 = self.feature_extractor(ROI_feature_2).view(bs, self.num_point, self.d_model)

        offset_2 = self.Transformer(transformer_feature_2)
        offset_2 = self.out_layer(offset_2)

        landmarks_2 = start_anchor.unsqueeze(1) + bbox_size.unsqueeze(1) * offset_2
        output_list.append(landmarks_2)

        # stage_3
        ROI_anchor_3, bbox_size, start_anchor = self.ROI_3(landmarks_2[:, -1, :, :].detach())
        ROI_anchor_3 = ROI_anchor_3.view(bs, self.num_point * self.Sample_num * self.Sample_num, 2)
        ROI_feature_3= self.interpolation(feature_map, ROI_anchor_3.detach()).view(bs, self.num_point, self.Sample_num,
                                                                                self.Sample_num, self.d_model)
        ROI_feature_3 = ROI_feature_3.view(bs * self.num_point, self.Sample_num, self.Sample_num,
                                           self.d_model).permute(0, 3, 2, 1)

        transformer_feature_3 = self.feature_extractor(ROI_feature_3).view(bs, self.num_point, self.d_model)

        offset_3 = self.Transformer(transformer_feature_3)
        offset_3 = self.out_layer(offset_3)

        landmarks_3 = start_anchor.unsqueeze(1) + bbox_size.unsqueeze(1) * offset_3
        output_list.append(landmarks_3)

And it doesn't converge to the expected results (arround NME = 4.1%). But if I don't change the original code, the training converge to the expected results.

So, my question is why the training result is different in this two case?

I try to train the network with reassign some variables in the forward pass.


问:
how do i get team report through Clockify API?
I want to get information like how much a particular employee worked this month on certain workspace ,so how can I use Clockify API to get this information?

Thanks in Advance


问:
How to change font size for markdown preview in vs code?
In settings, there is the font size configuration of markdown preview, but it does not work. How can I change it elsewhere?</p>


问:
Netlogo headless exporting world at each steps
I wrote my model in the GUI and want to run it with repetitions in the headless mode in a cluster.
The model has a go command that is repeated until we reach a specified step (at each go procedure, the year variable is incremented and when we reach 2070, the model stop running). At the end of the go procedure, the world is exported (and analysed in R).
If I run multiple repetitions on parallel cores, how can I export the worlds so they have different names ?

So far, I export the world with the following lines (when running only one time) :

```<code> let file-name (word scenario "_NETLOGO_" year ".csv")
 export-world (file-name)
</code>```

But if the model is run at the same time on several cores, there will be overlap and I would not know which file is coming from which repetition (assuming that the name would change with an extra (1)). I thought about creating folders to save the worlds,is that possible ? Is so, how is it possible to pimp the folder name according to the number of repetitions ?

Body:
I wrote my model in the GUI and want to run it with repetitions in the headless mode in a cluster.
The model has a go command that is repeated until we reach a specified step (at each go procedure, the year variable is incremented and when we reach 2070, the model stop running). At the end of the go procedure, the world is exported (and analysed in R).
If I run multiple repetitions on parallel cores, how can I export the worlds so they have different names ?

So far, I export the world with the following lines (when running only one time) :

 let file-name (word scenario "_NETLOGO_" year ".csv")
 export-world (file-name)

But if the model is run at the same time on several cores, there will be overlap and I would not know which file is coming from which repetition (assuming that the name would change with an extra (1)). I thought about creating folders to save the worlds,is that possible ? Is so, how is it possible to pimp the folder name according to the number of repetitions ?


问:
Countdown animation for LocalTime
```<code>  val dateNow = LocalDateTime.now()
                    val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
                    val dateTime = LocalDateTime.parse(it?.LastUpdated, formatter)
                    println("The date is :" + dateTime)

                        val duration = Duration.between(dateTime, dateNow).toMinutes()
                        val countDown = LocalTime.MIN.plus(
                        Duration.ofMinutes( duration )
                        ).toString()
</code>```

So I'm pulling LastUpdated using Retrofit then, I'm getting the difference between the two dates and then displaying it in minutes (HH:SS) format.
Let's say, for example, the output of countDown is 24:45.

How can one make that text count down with animation?

Title: Countdown animation for LocalTime

Body:
  val dateNow = LocalDateTime.now()
                    val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
                    val dateTime = LocalDateTime.parse(it?.LastUpdated, formatter)
                    println("The date is :" + dateTime)

                        val duration = Duration.between(dateTime, dateNow).toMinutes()
                        val countDown = LocalTime.MIN.plus(
                        Duration.ofMinutes( duration )
                        ).toString()

So I'm pulling LastUpdated using Retrofit then, I'm getting the difference between the two dates and then displaying it in minutes (HH:SS) format.
Let's say, for example, the output of countDown is 24:45.

How can one make that text count down with animation?


问:
Using default Activity transition animation inside a view Group
Is it possible to enable the default activity transition inside a view group.
Note that this effect can be achieved using a view transition which would replicate the default activity transition, however it turns out to be quite slow.

Any pointers on the same is appreciated. Thanks in advance.

ContentLicense: CC BY-SA 3.0


问:
Why does pip throw WinError 225 on moosegesture installing?
I'm trying to install moosegesture, using pip install moosegesture in PyCharm and I get this error:

ERROR: Error [WinError 225] The operation failed because the file contains a virus or potentially unwanted software while executing command python setup.py egg_info

So far using pip worked fine for me.

Can I install it some other way or what can I do with this error?


问:
Symfony 6, WebPack et Inputmask
Under Symphony 6 and with WebPack (WP), I am trying to add the InputMask(la librairie) library.

Newbie with WebPack (WP), I don't see how to configure WP to make inputmask work in my various TWIG files.

Sorry, but I can't find how to do this after many google searches.

Thanks for your help... because I'm lost

Eric

I have done a lot of research on the internet, test examples like below, but no success

```<code><script src="https://rawgit.com/RobinHerbots/Inputmask/5.x/dist/jquery.inputmask.js"></script>
<script language="javascript">
    var defaultScope = new function () {
        this.ready = function () {
            $("#demolnk").click(function () {
                $("#main").removeClass("fired");
                $("#demolnk").addClass("fired");
                $.get('demo.html', function (data) {
</code>```

Title: Symfony 6, WebPack et Inputmask


问:
exporting all sheets of a view as csv using TABCMD
I have a view in a tableau and want to export the view as a csv using TABCMD. I am able to generate all sheets as part of single pdf. In case of csv when I try to export I only get a single sheet. Not sure how to retrieve all sheets at once.

To sum up I am not able to find a command that could export me all sheets at once as a csv. I am also interested if there is a way to query a specific sheet as in Tableau UI.

Any insight on either approach would be helpful


问:
Azure function suddenly stopped working on Azure with no reason why
I am doing simple telegram echo bot on azure, which write telegramid of user to sql database.
I think i don't need to show code, but i can share with code to you if you require me to do this. I will explain by text.
I have function telegrambot which get response from telegram servers and send it to my UpdateService written by me where messages analyze and if message type is text i will write senders Id to my database.

Firstly i decide to just implement simple echo bot without database.
In startup file i write the next code

```<code>[assembly: FunctionsStartup(typeof(MyTelegramBot.Startup))]
namespace MyTelegramBot
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddScoped<UpdateService>();
            builder.Services.AddLogging();
        }
    }
}
</code>```

And i deploy it to Azure. Everything works fine, every message correctly come back to me.

Next i decide to Add database related files: entities, dbcontext
I have one table user and thats all.
Write operations was hold by IDbSaver

```<code>namespace MyTelegramBot.Interfaces
{
    public interface IDbSaver<T> where T : class
    {
        Task<AlertMessage> RegisterUser(T entity);
    }
}
</code>```

Implementation of IDbSaver

```<code>namespace MyTelegramBot.Services
{
    public class DbSaver<T> : IDbSaver<T> where T : class
    {
        protected DbSet<T> Dbset;
        private readonly MyContext _context;
        public DbSaver(MyContext context)
        {
            Dbset = context.Set<T>();
            _context = context;
        }
        public async Task<AlertMessage> RegisterUser(T entity)
        {
            await Dbset.AddAsync(entity);
            try
            {
                await _context.SaveChangesAsync();
                return new AlertMessage()
                {
                    Message = "Success."
                };
            }

            catch(DbUpdateException ex) when(ex.InnerException is SqlException e)
            {
                if(e.Number == 2601)
                {
                    return new AlertMessage()
                    {
                        Message = "Someone(maybe you?) registered same nickname."
                    };
                }
                return new AlertMessage()
                {
                    Message = "some text"
                };
            }
        }
    }
}
</code>```

Registered IDbSaver and Dbsaver in startup like

```<code>[assembly: FunctionsStartup(typeof(MyTelegramBot.Startup))]
namespace MyTelegramBot
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddScoped<UpdateService>();
            builder.Services.AddLogging();
            var connectionString = "connectionstring";
            builder.Services.AddDbContext<MyContext>(s => s.UseSqlServer(connectionString));
            builder.Services.AddScoped(typeof(IDbSaver<>), typeof(DbSaver<>));
        }
    }
}
</code>```

And when i deploy it to Azure, deployment process goes well, no errors during publishing it to azure, but in Azure page of my function Alerting message is
MyTelegramBot: Could not load file or assembly 'Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

In the nuget package menu i found that microsoft.extensions.logging with version 7 and installed it, deploy again but error message still alive.
Guys, can you please help me.

I have next installed packages:

Microsoft.Azure.Functions.Extensions(1.1.0)

Microsoft.EntityFrameworkCore(7.0.0)

Microsoft.EntityFrameworkCOre.SqlServer(7.0.0)

Microsoft.Extensions.Logging(7.0.0)

Microsoft.Net.Sdk.Function(4.1.1)

Telegram.Bot(18.0.0)

Using:
.net 6.0
functions version v4

Body:
I am doing simple telegram echo bot on azure, which write telegramid of user to sql database.
I think i don't need to show code, but i can share with code to you if you require me to do this. I will explain by text.
I have function telegrambot which get response from telegram servers and send it to my UpdateService written by me where messages analyze and if message type is text i will write senders Id to my database.

Firstly i decide to just implement simple echo bot without database.
In startup file i write the next code

[assembly: FunctionsStartup(typeof(MyTelegramBot.Startup))]
namespace MyTelegramBot
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddScoped<UpdateService>();
            builder.Services.AddLogging();
        }
    }
}

And i deploy it to Azure. Everything works fine, every message correctly come back to me.

Next i decide to Add database related files: entities, dbcontext
I have one table user and thats all.
Write operations was hold by IDbSaver

namespace MyTelegramBot.Interfaces
{
    public interface IDbSaver<T> where T : class
    {
        Task<AlertMessage> RegisterUser(T entity);
    }
}

Implementation of IDbSaver

namespace MyTelegramBot.Services
{
    public class DbSaver<T> : IDbSaver<T> where T : class
    {
        protected DbSet<T> Dbset;
        private readonly MyContext _context;
        public DbSaver(MyContext context)
        {
            Dbset = context.Set<T>();
            _context = context;
        }
        public async Task<AlertMessage> RegisterUser(T entity)
        {
            await Dbset.AddAsync(entity);
            try
            {
                await _context.SaveChangesAsync();
                return new AlertMessage()
                {
                    Message = "Success."
                };
            }

            catch(DbUpdateException ex) when(ex.InnerException is SqlException e)
            {
                if(e.Number == 2601)
                {
                    return new AlertMessage()
                    {
                        Message = "Someone(maybe you?) registered same nickname."
                    };
                }
                return new AlertMessage()
                {
                    Message = "some text"
                };
            }
        }
    }
}

Registered IDbSaver and Dbsaver in startup like

[assembly: FunctionsStartup(typeof(MyTelegramBot.Startup))]
namespace MyTelegramBot
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddScoped<UpdateService>();
            builder.Services.AddLogging();
            var connectionString = "connectionstring";
            builder.Services.AddDbContext<MyContext>(s => s.UseSqlServer(connectionString));
            builder.Services.AddScoped(typeof(IDbSaver<>), typeof(DbSaver<>));
        }
    }
}

And when i deploy it to Azure, deployment process goes well, no errors during publishing it to azure, but in Azure page of my function Alerting message is
MyTelegramBot: Could not load file or assembly 'Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

In the nuget package menu i found that microsoft.extensions.logging with version 7 and installed it, deploy again but error message still alive.
Guys, can you please help me.

I have next installed packages:

Microsoft.Azure.Functions.Extensions(1.1.0)

Microsoft.EntityFrameworkCore(7.0.0)

Microsoft.EntityFrameworkCOre.SqlServer(7.0.0)

Microsoft.Extensions.Logging(7.0.0)

Microsoft.Net.Sdk.Function(4.1.1)

Telegram.Bot(18.0.0)

Using:
.net 6.0
functions version v4


问:
onlineMeetingUrl is coming null and onlineMeetingProvider is 'unknown' while creating event for a user by using graph api, Why?
I am using graph api to create events for almost 50 users and for all users when i am creating event with
isOnlineMeeting: true  and  onlineMeetingProvider: 'teamsForBusiness' keys in request body events are creating successfully and returning the response

endpoint I am calling is

```<code>axios.post(`https://graph.microsoft.com/v1.0/users/${userId}/calendar/events`,requestBody,options)
</code>```

request body

```<code> requestBody = {
    subject:MeetSubject,
    start:{
        dateTime:isoStart,
        timezone:'UTC'
    },
    end:{
        dateTime:isoEnd,
        timezone:'UTC'
    },

    recurrence: recurrenceData,
    attendees: [
      {
        emailAddress: {
          address: attendeEmail,
          name: attendeName,
        },
        type: 'required',
      },
    ],
    isOnlineMeeting: true,
    onlineMeetingProvider: 'teamsForBusiness'
  };
</code>```

response

```<code>{
....
....
onlineMeetingProvider: 'teamsForBusiness',
onlineMeeting: {
      joinUrl: 'https://teams.microsoft.com/l...../.
    }
  }
}
</code>```

But for a perticular user when I am creating the event with simillar request body so event is created successfully but in the response event Object i am getting

response

```<code>{
....
....
onlineMeetingProvider: 'unknown',
onlineMeeting: null
}
</code>```

why it is like that
is there something which i am missing for that perticular i don't know what

and app has those permissions already

```<code>TeamSettings.Read.All
TeamSettings.ReasWrite.All
OnlineMeetings.Read
OnlineMeetings.ReadWrite
</code>```

Body:
I am using graph api to create events for almost 50 users and for all users when i am creating event with
isOnlineMeeting: true  and  onlineMeetingProvider: 'teamsForBusiness' keys in request body events are creating successfully and returning the response

endpoint I am calling is

axios.post(`https://graph.microsoft.com/v1.0/users/${userId}/calendar/events`,requestBody,options)

request body

 requestBody = {
    subject:MeetSubject,
    start:{
        dateTime:isoStart,
        timezone:'UTC'
    },
    end:{
        dateTime:isoEnd,
        timezone:'UTC'
    },

    recurrence: recurrenceData,
    attendees: [
      {
        emailAddress: {
          address: attendeEmail,
          name: attendeName,
        },
        type: 'required',
      },
    ],
    isOnlineMeeting: true,
    onlineMeetingProvider: 'teamsForBusiness'
  };

response

{
....
....
onlineMeetingProvider: 'teamsForBusiness',
onlineMeeting: {
      joinUrl: 'https://teams.microsoft.com/l...../.
    }
  }
}

But for a perticular user when I am creating the event with simillar request body so event is created successfully but in the response event Object i am getting

response

{
....
....
onlineMeetingProvider: 'unknown',
onlineMeeting: null
}

why it is like that
is there something which i am missing for that perticular i don't know what

and app has those permissions already

TeamSettings.Read.All
TeamSettings.ReasWrite.All
OnlineMeetings.Read
OnlineMeetings.ReadWrite


问:
I have configure the nodemailer with the godaddy but it's throw connect ETIMEDOUT 68.178.213.244:80 error
I have configure nodemailer with Gmail it's working finely. But when I change it to Godaddy  configuration it's throws connect timeout error. Don't get any proper solution over the internet. Also contact with the Godaddy help center. Seriously very bad experience.

```<code>const transport = nodemailer.createTransport({
    host: 'mailstore1.secureserver.net',
    port: 465,
    auth: {
      user: 'abc@xyz.com',
      pass: '12345678'
    }
});
</code>```
```<code>const transport = nodemailer.createTransport({
    host: 'mailstore1.secureserver.net',
    port: 465,
    auth: {
      user: 'abc@xyz.com',
      pass: '12345678'
    }
});
</code>```

Body:
I have configure nodemailer with Gmail it's working finely. But when I change it to Godaddy  configuration it's throws connect timeout error. Don't get any proper solution over the internet. Also contact with the Godaddy help center. Seriously very bad experience.

const transport = nodemailer.createTransport({
    host: 'mailstore1.secureserver.net',
    port: 465,
    auth: {
      user: 'abc@xyz.com',
      pass: '12345678'
    }
});

const transport = nodemailer.createTransport({
    host: 'mailstore1.secureserver.net',
    port: 465,
    auth: {
      user: 'abc@xyz.com',
      pass: '12345678'
    }
});


问:
JPA: Get visible elements in a tree relantionship in same table
I have a hierarchical table of people in which I will have three levels:

Level 1: Grandfather: This always has the parent attribute to NULL

Level 2: Father: The parent attribute is Grandfather (Level 1)

Level 3: Child: The parent attribute is Father (Level 2)

The Postgres database table is as follows:

```<code>CREATE TABLE person(
   cod_person varchar NOT NULL,
   cod_parent varchar NULL,
   visible bool NOT NULL,
   CONSTRAINT s_person_pk PRIMARY KEY (cod_person)
);
</code>```

And the JPA entity is as follows:

```<code>@Getter
@Entity
@EqualsAndHashCode(exclude = {"nodes"})
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "person")
public class Person implements Serializable {

    @Id
    @Column(name = "cod_person")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_parent")
    private Person parent;

    @OneToMany(mappedBy = "parent", fetch = FetchType.LAZY)
    @Fetch(FetchMode.JOIN)
    private Set<Person> childs = new HashSet<>();

    @Column(name = "visible")
    private Boolean isVisible;

}
</code>```

Using JPA/JPQL (but never native query) and execute only one query I need to retrieve the visible elements. Based on these examples:

Case A:

cod_person
cod_parent
visible

1
null
true

2
1
true

3
2
true

4
2
true

5
1
true

6
5
true

7
5
true

In this case, I need retrieve this object:

```<code>Person 1:
    parent: null
    childs:
        Person 2:
            parent: Person 1
            childs:
                Person 3
                Person 4
        Person 5:
            parent: Person 1
            childs:
                Person 6
                Person 7
</code>```

Case B:

cod_person
cod_parent
visible

1
null
true

2
1
true

3
2
true

4
2
true

5
1
true

6
5
false

7
5
false

In this case, I need retrieve this object:

```<code>Person 1:
    parent: null
    childs:
        Person 2:
            parent: Person 1
            childs:
                Person 3
                Person 4
        Person 5:
            parent: Person 1
            childs: EMPTY LIST
</code>```

I have this query in JPQL:

```<code>@Repository
public interface PersonRepository extends JpaRepository<Person, String> {

    @Query("SELECT DISTINCT granfather " +
            "FROM Person granfather " +
            "LEFT JOIN FETCH granfather.childs father " +
            "LEFT JOIN FETCH father.childs child " +
            "LEFT JOIN FETCH child.parent child_parent " + // To avoid new query to parent
            "WHERE granfather.parent IS NULL " +
            "AND granfather.isVisible = true " +
            "AND father.isVisible = true " +
            "AND child.isVisible = true ")
    List<Person> findFamily();
}
</code>```

With this query, case A works correctly, since all the Parents have children. The problem is in case B. When a Parent has no children, the query does not return this Parent and Person 5 is missing:

```<code>Person 1:
    parent: null
    childs:
        Person 2:
            parent: Person 1
            childs:
                Person 3
                Person 4
</code>```

I need to return this object since it is visible, with an empty child list.

How can I achieve this goal?

Body:
I have a hierarchical table of people in which I will have three levels:

Level 1: Grandfather: This always has the parent attribute to NULL

Level 2: Father: The parent attribute is Grandfather (Level 1)

Level 3: Child: The parent attribute is Father (Level 2)

The Postgres database table is as follows:

CREATE TABLE person(
   cod_person varchar NOT NULL,
   cod_parent varchar NULL,
   visible bool NOT NULL,
   CONSTRAINT s_person_pk PRIMARY KEY (cod_person)
);

And the JPA entity is as follows:

@Getter
@Entity
@EqualsAndHashCode(exclude = {"nodes"})
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "person")
public class Person implements Serializable {

    @Id
    @Column(name = "cod_person")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_parent")
    private Person parent;

    @OneToMany(mappedBy = "parent", fetch = FetchType.LAZY)
    @Fetch(FetchMode.JOIN)
    private Set<Person> childs = new HashSet<>();

    @Column(name = "visible")
    private Boolean isVisible;

}

Using JPA/JPQL (but never native query) and execute only one query I need to retrieve the visible elements. Based on these examples:

Case A:

cod_person
cod_parent
visible

1
null
true

2
1
true

3
2
true

4
2
true

5
1
true

6
5
true

7
5
true

In this case, I need retrieve this object:

Person 1:
    parent: null
    childs:
        Person 2:
            parent: Person 1
            childs:
                Person 3
                Person 4
        Person 5:
            parent: Person 1
            childs:
                Person 6
                Person 7

Case B:

cod_person
cod_parent
visible

1
null
true

2
1
true

3
2
true

4
2
true

5
1
true

6
5
false

7
5
false

In this case, I need retrieve this object:

Person 1:
    parent: null
    childs:
        Person 2:
            parent: Person 1
            childs:
                Person 3
                Person 4
        Person 5:
            parent: Person 1
            childs: EMPTY LIST

I have this query in JPQL:

@Repository
public interface PersonRepository extends JpaRepository<Person, String> {

    @Query("SELECT DISTINCT granfather " +
            "FROM Person granfather " +
            "LEFT JOIN FETCH granfather.childs father " +
            "LEFT JOIN FETCH father.childs child " +
            "LEFT JOIN FETCH child.parent child_parent " + // To avoid new query to parent
            "WHERE granfather.parent IS NULL " +
            "AND granfather.isVisible = true " +
            "AND father.isVisible = true " +
            "AND child.isVisible = true ")
    List<Person> findFamily();
}

With this query, case A works correctly, since all the Parents have children. The problem is in case B. When a Parent has no children, the query does not return this Parent and Person 5 is missing:

Person 1:
    parent: null
    childs:
        Person 2:
            parent: Person 1
            childs:
                Person 3
                Person 4

I need to return this object since it is visible, with an empty child list.

How can I achieve this goal?