问:
Using SQL Server to Export one table to data from a database to the same table in another database on the same SQL instance
I am using SQL Server Management Studio Export Data from one database to another on the same server. Everything ran
fine except the table below is taking hours to run. I have large tables that have 20,000+ records, but none
have taken as long as this. This table contains about 18,000 records.

Right now I am trying it again and only copying this table so no other tasks should be running.

When I select the tables to exprot from database A to MyDatabase, I check the edit mappings and enable identity insert,
which I have done for other tables and everything was fine.

Right the copying dialog box is saying "Executing" and "In Progress...".

```<code>USE [myDatabase]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[MyTable](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [errors] [varchar](max) NULL,
    [timestamp] [datetime] NULL,
    [productname] [varchar](50) NULL,
    [product_id] [varchar](10) NULL,
 CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
</code>```

Why is this taken so long and what should I do to attempt to fix it?

Body:
I am using SQL Server Management Studio Export Data from one database to another on the same server. Everything ran
fine except the table below is taking hours to run. I have large tables that have 20,000+ records, but none
have taken as long as this. This table contains about 18,000 records.

Right now I am trying it again and only copying this table so no other tasks should be running.

When I select the tables to exprot from database A to MyDatabase, I check the edit mappings and enable identity insert,
which I have done for other tables and everything was fine.

Right the copying dialog box is saying "Executing" and "In Progress...".

USE [myDatabase]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[MyTable](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [errors] [varchar](max) NULL,
    [timestamp] [datetime] NULL,
    [productname] [varchar](50) NULL,
    [product_id] [varchar](10) NULL,
 CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Why is this taken so long and what should I do to attempt to fix it?


来源: stackexchange

问:
Angular + HighCharts "ERROR TypeError: Cannot read properties of undefined ('xxxx') " but showing correct info
I have a dashboard with charts (Highcharts) in Angular. I can access to the data base with a PHP file, but I am getting an error when I inspect the result.
If I return a result in stocks() accessing to an Array, the data shows a chart correctly but with the following error after inspect:

Angular error  showing chart correctly

If I return a result in stocks() not accessing to an Array there are no errors, but no info in the final chart

I would like to get chart with correct info but without the error of the image.

This is the interface:

```<code>export class Aeropuerto {
    name: string;
    data?: [];
    color?: string;
    visible: string;
}
</code>```

Here is component.ts

```<code>stockChart  = [];

constructor(private dashboardService: DashboardService,private http:HttpClient ){}

 ngOnInit() {
    this.stockChart = this.stocks();
  };

  stocks() {
    return[

      this.getStock()[0].xxx //in this way shows chart with correct info but I get the error in the image.
                             //xxx can be changed for any value and the chart shows correct data

    //**this.getStock()    in this way show chart without info, and I get no error**
    ]
  }
  getStock(){
    return this.dashboardService.stockCharts().subscribe(
          stockChart => {
           this.stockChart = stockChart;
          }
    )
  }
</code>```

And service.ts

```<code>@Injectable({
  providedIn: 'root'
})

export class DashboardService {
  apiURL = `http://phpFile.php`;

  constructor(private http: HttpClient) { }

  stockCharts(): Observable<Aeropuerto[]> {
    return this.http.get<Aeropuerto[]>(this.apiURL);
  }
</code>```

And finally the html where the chart template (stock) get the data:

```<code><app-widget-stock  [data]="stockChart"></app-widget-stock>
</code>```

Edit: you can see the error in console  in the following  link

ContentLicense: CC BY-SA 4.0

Body:
I have a dashboard with charts (Highcharts) in Angular. I can access to the data base with a PHP file, but I am getting an error when I inspect the result.
If I return a result in stocks() accessing to an Array, the data shows a chart correctly but with the following error after inspect:

Angular error  showing chart correctly

If I return a result in stocks() not accessing to an Array there are no errors, but no info in the final chart

I would like to get chart with correct info but without the error of the image.

This is the interface:

export class Aeropuerto {
    name: string;
    data?: [];
    color?: string;
    visible: string;
}

Here is component.ts

stockChart  = [];

constructor(private dashboardService: DashboardService,private http:HttpClient ){}

 ngOnInit() {
    this.stockChart = this.stocks();
  };

  stocks() {
    return[

      this.getStock()[0].xxx //in this way shows chart with correct info but I get the error in the image.
                             //xxx can be changed for any value and the chart shows correct data

    //**this.getStock()    in this way show chart without info, and I get no error**
    ]
  }
  getStock(){
    return this.dashboardService.stockCharts().subscribe(
          stockChart => {
           this.stockChart = stockChart;
          }
    )
  }

And service.ts

@Injectable({
  providedIn: 'root'
})

export class DashboardService {
  apiURL = `http://phpFile.php`;

  constructor(private http: HttpClient) { }

  stockCharts(): Observable<Aeropuerto[]> {
    return this.http.get<Aeropuerto[]>(this.apiURL);
  }

And finally the html where the chart template (stock) get the data:

<app-widget-stock  [data]="stockChart"></app-widget-stock>

Edit: you can see the error in console  in the following  link


问:
Is there a way to produce back-to-back haptic vibrations?
I'm able to easily produce vibration with HapticFeedback.heavyImpact();, but I wanted to chain the vibrations to give two thumps back to back, doing

```<code>HapticFeedback.heavyImpact();
HapticFeedback.heavyImpact();
</code>```

Seems to still only produce one thump.

Any ideas?

Body:
I'm able to easily produce vibration with HapticFeedback.heavyImpact();, but I wanted to chain the vibrations to give two thumps back to back, doing

HapticFeedback.heavyImpact();
HapticFeedback.heavyImpact();

Seems to still only produce one thump.

Any ideas?


问:
SD : No such file
I'm using pyhdf.SD to import some hdf5 files to python. I'm able to import one file in a program

```<code>file=SD(file_path,SDC.READ)
</code>```

But after that, if I import another hdf5 file within the same program, it throws an error HDF4Error: SD: no such file.

I tried to reimport the pyhdf module after importing a hdf5 file, but the error persists.

What might have caused this?

The file I am dealing with cannot be imported through h5py module, so SD method seems to be the only way for now.

Title: SD : No such file

Body:
I'm using pyhdf.SD to import some hdf5 files to python. I'm able to import one file in a program

file=SD(file_path,SDC.READ)

But after that, if I import another hdf5 file within the same program, it throws an error HDF4Error: SD: no such file.

I tried to reimport the pyhdf module after importing a hdf5 file, but the error persists.

What might have caused this?

The file I am dealing with cannot be imported through h5py module, so SD method seems to be the only way for now.


问:
Build constructor for Stateful widget?
I'm trying to take kind of like a survey and I want to build widgets for each question and because it's like 20-30 different questions and I might want to change the UI I prefer to use a constructor.

The widget also fills a list for now and displays your 3 answers and automatically switches to the next question.

However because I need the Focusnode for the textfield and Texteditingcontroller as well it's hard for me to build a blueprint for the widgets.

This is the code that I have repeated like 18 times:

```<code>import 'package:flutter/material.dart';
import 'package:flutter_application_1/Screens/2Acceptance/Acceptance.dart';
import 'package:flutter_application_1/main.dart';

class FirstQuestionConciousness extends StatefulWidget {
  const FirstQuestionConciousness({super.key});

  @override
  _FirstQuestionConciousnessState createState() =>
      _FirstQuestionConciousnessState();
}

class _FirstQuestionConciousnessState extends State<FirstQuestionConciousness> {
  var msgController = TextEditingController();
  late FocusNode myFocusNode;

  @override
  void initState() {
    super.initState();
    myFocusNode = FocusNode();
  }

  @override
  List<String> entries = <String>[];
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      appBar: AppBar(title: const Text('Self Conciousness')),
      body: Center(
        child: SingleChildScrollView(
          child: Column(children: <Widget>[
            const Text('Write 3 completions to the following question:'),
            const Text(
              'Living conciously to me means...',
              style: TextStyle(fontSize: 25),
            ),
            TextField(
              controller: msgController,
              focusNode: myFocusNode,
              onSubmitted: (value) {
                setState(() {
                  entries.add(value);
                });
                myFocusNode.requestFocus();
                msgController.clear();
                if (entries.length > 2) {
                  Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) =>
                              const SecondQuestionConciousness()));
                }
              },
              autofocus: true,
              decoration: const InputDecoration(
                border: OutlineInputBorder(),
                hintText: 'answers...',
              ),
            ),
            Column(
              children: <Widget>[
                SizedBox(
                  height: 300,
                  child: ListView.builder(
                    itemCount: entries.length,
                    itemBuilder: (BuildContext context, int index) {
                      return Container(
                        height: 50,
                        color: Colors.amber,
                        child: Center(child: Text('${entries[index]}')),
                      );
                    },
                  ),
                )
              ],
            ),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) =>
                            const SecondQuestionConciousness()));
              },
              child: Text('Move on'),
            ),
          ]),
        ),
      ),
    );
  }
}
</code>```

So all that changes is the text of the question, can someone help me how to make a good constructor?

The main problem I'm having is that the class that I want to construct extends the state of the class it belongs to

I tried to make a constructor for the scaffold, however the textbox doesn't work properly because setstate() and the focusNode stop working then

Title: Build constructor for Stateful widget?

Body:
I'm trying to take kind of like a survey and I want to build widgets for each question and because it's like 20-30 different questions and I might want to change the UI I prefer to use a constructor.

The widget also fills a list for now and displays your 3 answers and automatically switches to the next question.

However because I need the Focusnode for the textfield and Texteditingcontroller as well it's hard for me to build a blueprint for the widgets.

This is the code that I have repeated like 18 times:

import 'package:flutter/material.dart';
import 'package:flutter_application_1/Screens/2Acceptance/Acceptance.dart';
import 'package:flutter_application_1/main.dart';

class FirstQuestionConciousness extends StatefulWidget {
  const FirstQuestionConciousness({super.key});

  @override
  _FirstQuestionConciousnessState createState() =>
      _FirstQuestionConciousnessState();
}

class _FirstQuestionConciousnessState extends State<FirstQuestionConciousness> {
  var msgController = TextEditingController();
  late FocusNode myFocusNode;

  @override
  void initState() {
    super.initState();
    myFocusNode = FocusNode();
  }

  @override
  List<String> entries = <String>[];
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      appBar: AppBar(title: const Text('Self Conciousness')),
      body: Center(
        child: SingleChildScrollView(
          child: Column(children: <Widget>[
            const Text('Write 3 completions to the following question:'),
            const Text(
              'Living conciously to me means...',
              style: TextStyle(fontSize: 25),
            ),
            TextField(
              controller: msgController,
              focusNode: myFocusNode,
              onSubmitted: (value) {
                setState(() {
                  entries.add(value);
                });
                myFocusNode.requestFocus();
                msgController.clear();
                if (entries.length > 2) {
                  Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) =>
                              const SecondQuestionConciousness()));
                }
              },
              autofocus: true,
              decoration: const InputDecoration(
                border: OutlineInputBorder(),
                hintText: 'answers...',
              ),
            ),
            Column(
              children: <Widget>[
                SizedBox(
                  height: 300,
                  child: ListView.builder(
                    itemCount: entries.length,
                    itemBuilder: (BuildContext context, int index) {
                      return Container(
                        height: 50,
                        color: Colors.amber,
                        child: Center(child: Text('${entries[index]}')),
                      );
                    },
                  ),
                )
              ],
            ),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) =>
                            const SecondQuestionConciousness()));
              },
              child: Text('Move on'),
            ),
          ]),
        ),
      ),
    );
  }
}

So all that changes is the text of the question, can someone help me how to make a good constructor?

The main problem I'm having is that the class that I want to construct extends the state of the class it belongs to

I tried to make a constructor for the scaffold, however the textbox doesn't work properly because setstate() and the focusNode stop working then


问:
Recording with python librtmp RTMP shrinks
The code for capturing a video stream using python librtmp is this:

```<code>import librtmp

conn = librtmp.RTMP('rtmp://some_program', live=True)
conn.connect()
stream = conn.create_stream(update_buffer=True)

f = open("my_program.flv", 'wb')
while True:
    try:
        data=stream.read(1024)
        if data:
            f.write(data)
            f.flush()
    except:
        print("Error during stream")
</code>```

The duration of the program is of 1 hour, but when i play the video, the duration becomes in 59 min and 52 secs or 59 min and 56 secs.... but in the most cases the duration is 1 hour exactly.

I noticed that the first record always is perfect but in some cases the second shrinks (when I use the function for second time or more)

First I thought the problem was on ffmpeg because I use it to encode the video but it isn't because the video without encoding (the raw capture) shrinks anyway and i have other program that capture the same video with duration of 1 hour every time.

What happens here? I suppose that there is a buffer that is not being emptied correctly or something like that.

Body:
The code for capturing a video stream using python librtmp is this:

import librtmp

conn = librtmp.RTMP('rtmp://some_program', live=True)
conn.connect()
stream = conn.create_stream(update_buffer=True)

f = open("my_program.flv", 'wb')
while True:
    try:
        data=stream.read(1024)
        if data:
            f.write(data)
            f.flush()
    except:
        print("Error during stream")

The duration of the program is of 1 hour, but when i play the video, the duration becomes in 59 min and 52 secs or 59 min and 56 secs.... but in the most cases the duration is 1 hour exactly.

I noticed that the first record always is perfect but in some cases the second shrinks (when I use the function for second time or more)

First I thought the problem was on ffmpeg because I use it to encode the video but it isn't because the video without encoding (the raw capture) shrinks anyway and i have other program that capture the same video with duration of 1 hour every time.

What happens here? I suppose that there is a buffer that is not being emptied correctly or something like that.


问:
NFC Nexus S, make readOnly Tag error
I try to make a NFC-V, NDEF tag to be readOnly. But it doesn't work.
I tried the formatReadOnly(...) method, but it doesn't work.

I also tried to test if the tag can be made read only with the method: canMakeReadOnly().
The answer is false.

So how can I protect my tags?
Does the problem come from the Nexus or from the tag itself?

Any ideas?

ContentLicense: CC BY-SA 3.0

Title: NFC Nexus S, make readOnly Tag error


问:
How to rotate objects using Unity’s AR Foundation Tracked Image
I am trying to perform a fairly simple task - spawning a 3D object using the AR Foundation Tracked Image Manager and then being able to scale and rotate it using Lean Touch (or any other method). For some reason, the Tracked Image Manager locks the object's position and rotation and I am unable to manipulate it. Is there any solution to this problem or is it simply not supported?
Thanks!</p>


问:
Can AnimatedContent work correctly if the identical target state is issued multiple times?
I'm implementing AnimatedContent and I'm noticing that when my state issues the same target as is currently displaying (when new paged results for a list are issued from the view model) AnimatedContent is performing its transition even though it is currently displaying the correct composable content. Is there a work around for this?

```<code>AnimatedContent(
    targetState = display, <- display is issued multiple times with updated paged data
    modifier = Modifier.fillMaxSize(),
    transitionSpec = {
        fadeIn() with fadeOut()
    },
    content = { display -> content(display) }
)
</code>```

Also, if I test for this condition (test if the current target is the same as the incoming target) and call content() outside of AnimatedContent, this seems to interrupt the transition if multiple states are issued in quick succession for this target state. This happens when I'm displaying a page that has sections of content that fill in async from different network api responses.

Body:
I'm implementing AnimatedContent and I'm noticing that when my state issues the same target as is currently displaying (when new paged results for a list are issued from the view model) AnimatedContent is performing its transition even though it is currently displaying the correct composable content. Is there a work around for this?

AnimatedContent(
    targetState = display, <- display is issued multiple times with updated paged data
    modifier = Modifier.fillMaxSize(),
    transitionSpec = {
        fadeIn() with fadeOut()
    },
    content = { display -> content(display) }
)

Also, if I test for this condition (test if the current target is the same as the incoming target) and call content() outside of AnimatedContent, this seems to interrupt the transition if multiple states are issued in quick succession for this target state. This happens when I'm displaying a page that has sections of content that fill in async from different network api responses.


问:
How do I get WinPython to install python packages locally using Pip instead of to my user directory?
I'm a new user of WinPython. I'm running the latest stable version on a Windows 11 computer. I wanted to use WinPython as a self-contained Python environment. How do I get WinPython to install packages in the local WinPython folder?

When I install packages using Pip from the WinPython command prompt, they install in my Windows user directory.


问:
How to display objectId ref data with $lookup and aggregate in mongodb
I have the following Schema and route. Although am able to display the data, clientdetails which is an objectId doesn't display its entire code, it only displays the objectId.My problem is that am not able to fully display entire clientdetails data.I would like to query the combined three collections with clientdetails.fullName. Moreover in the frontend i get empty arrays for both saleslocationInfo and billsInfo.

ClientSchema.Js

```<code>const mongoose = require('mongoose');

const ClientSchema = new mongoose.Schema({
    fullName:{
        type:String,
        required: true
    },
    gender:{
        type:String,
        required: true
    },
    nationality:{
        type:String,
        required: true
    },
    address:{
        type:String,
        required: true
    },
    date:{
        type:Date,
        default:Date.now
    }
});

module.exports = mongoose.model('Client', ClientSchema)

</code>```

BillSchema.Js

```<code>
const mongoose = require('mongoose');
var Schema = mongoose.Schema;

const billSchema = new Schema({
      paymentReferenceCode:{
        type: String,
        required: true
      },
      paymentType:{
        type: String,
        required: true
      },
     AmountPaid:{
        type: Number,
        required: true
      },
     Total:{
        type: Number,
        required: true
      },
    clientdetails: {
        ref: 'Client',
        type: mongoose.Schema.Types.ObjectId
    },

}, { timestamps: true })

module.exports = mongoose.model('Bill',billSchema);

</code>```

SaleslocationSchema.Js

```<code>const mongoose = require('mongoose');

const SalesLocationSchema = new mongoose.Schema({
    country:{
        type:String,
        required: true
    },
    city:{
        type:String,
        required: true
    },
    clientdetails: {
        ref: 'Client',
        type: mongoose.Schema.Types.ObjectId
    },
    date:{
        type:Date,
        default:Date.now
    }
});

module.exports = mongoose.model('Saleslocation', SalesLocationSchema)

</code>```

StaffSchema.Js

```<code>const mongoose = require('mongoose');

const StaffSchema = new mongoose.Schema({
    staffName:{
        type:String,
        required: true
    },
    staffDepartment:{
        type:String,
        required: true
    },
    clientdetails: {
        ref: 'Client',
        type: mongoose.Schema.Types.ObjectId
    },
    date:{
        type:Date,
        default:Date.now
    }
 });

 module.exports = mongoose.model('Staff', StaffSchema)

</code>```

SalesRoute.js

```<code>
router.get('/query', (req, res, next) => {
staffs.aggregate([
     { "$lookup": {
             "from": "saleslocations",
             "localField": "clientdetails",
             "foreignField": "clientdetails",
             "as": "saleslocationsInfo"
     }},
     { "$lookup": {
       "from": "bills",
       "localField": "clientdetails",
       "foreignField": "clientdetails",
       "as": "billsInfo"
}},

 ],
 (err, data) => {
  if (err) {
      console.error(err);
  }
  res.json(data);
 }
 )}
)
</code>```
```<code>  Expected Output

        [
        {
            "_id": "",
            "staffName": "",
            "staffDepartment": "",
            "clientdetails": [{
                "fullName":"",
                "gender":"",
                "nationality":"",
                "address":"",
                "date":""
        }],
        "saleslocationInfo": [{
                 "country":"",
                  "city":"",
                  "clientdetails": [{
                    "fullName":"",
                    "gender":"",
                    "nationality":"",
                    "address":"",
                    "date":""
        }]}],
              "billsInfo":[{
                   "paymentReferenceCode":"",
                   "paymentType":"",
                   "AmountPaid":"",
                   "Total":"",
                    "clientdetails": [{
                        "fullName":"",
                        "gender":"",
                        "nationality":"",
                        "address":"",
                        "date":""
                        }]
        }]}]
</code>```

I would like to retrieve the entire clientdetails data as well. Currently am only getting objectID(633b2b8d3631a23bf5da9a9d). Moreover, i would like to solve the problem of empty arrays in the frontend for staff, saleslocationInfo and billsInfo. Thank you

Body:
I have the following Schema and route. Although am able to display the data, clientdetails which is an objectId doesn't display its entire code, it only displays the objectId.My problem is that am not able to fully display entire clientdetails data.I would like to query the combined three collections with clientdetails.fullName. Moreover in the frontend i get empty arrays for both saleslocationInfo and billsInfo.

ClientSchema.Js

const mongoose = require('mongoose');

const ClientSchema = new mongoose.Schema({
    fullName:{
        type:String,
        required: true
    },
    gender:{
        type:String,
        required: true
    },
    nationality:{
        type:String,
        required: true
    },
    address:{
        type:String,
        required: true
    },
    date:{
        type:Date,
        default:Date.now
    }
});

module.exports = mongoose.model('Client', ClientSchema)

BillSchema.Js

const mongoose = require('mongoose');
var Schema = mongoose.Schema;

const billSchema = new Schema({
      paymentReferenceCode:{
        type: String,
        required: true
      },
      paymentType:{
        type: String,
        required: true
      },
     AmountPaid:{
        type: Number,
        required: true
      },
     Total:{
        type: Number,
        required: true
      },
    clientdetails: {
        ref: 'Client',
        type: mongoose.Schema.Types.ObjectId
    },

}, { timestamps: true })

module.exports = mongoose.model('Bill',billSchema);

SaleslocationSchema.Js

const mongoose = require('mongoose');

const SalesLocationSchema = new mongoose.Schema({
    country:{
        type:String,
        required: true
    },
    city:{
        type:String,
        required: true
    },
    clientdetails: {
        ref: 'Client',
        type: mongoose.Schema.Types.ObjectId
    },
    date:{
        type:Date,
        default:Date.now
    }
});

module.exports = mongoose.model('Saleslocation', SalesLocationSchema)

StaffSchema.Js

const mongoose = require('mongoose');

const StaffSchema = new mongoose.Schema({
    staffName:{
        type:String,
        required: true
    },
    staffDepartment:{
        type:String,
        required: true
    },
    clientdetails: {
        ref: 'Client',
        type: mongoose.Schema.Types.ObjectId
    },
    date:{
        type:Date,
        default:Date.now
    }
 });

 module.exports = mongoose.model('Staff', StaffSchema)

SalesRoute.js

router.get('/query', (req, res, next) => {
staffs.aggregate([
     { "$lookup": {
             "from": "saleslocations",
             "localField": "clientdetails",
             "foreignField": "clientdetails",
             "as": "saleslocationsInfo"
     }},
     { "$lookup": {
       "from": "bills",
       "localField": "clientdetails",
       "foreignField": "clientdetails",
       "as": "billsInfo"
}},

 ],
 (err, data) => {
  if (err) {
      console.error(err);
  }
  res.json(data);
 }
 )}
)

  Expected Output

        [
        {
            "_id": "",
            "staffName": "",
            "staffDepartment": "",
            "clientdetails": [{
                "fullName":"",
                "gender":"",
                "nationality":"",
                "address":"",
                "date":""
        }],
        "saleslocationInfo": [{
                 "country":"",
                  "city":"",
                  "clientdetails": [{
                    "fullName":"",
                    "gender":"",
                    "nationality":"",
                    "address":"",
                    "date":""
        }]}],
              "billsInfo":[{
                   "paymentReferenceCode":"",
                   "paymentType":"",
                   "AmountPaid":"",
                   "Total":"",
                    "clientdetails": [{
                        "fullName":"",
                        "gender":"",
                        "nationality":"",
                        "address":"",
                        "date":""
                        }]
        }]}]

I would like to retrieve the entire clientdetails data as well. Currently am only getting objectID(633b2b8d3631a23bf5da9a9d). Moreover, i would like to solve the problem of empty arrays in the frontend for staff, saleslocationInfo and billsInfo. Thank you


问:
directionsRenderer.addListener("routeindex_changed",()=>{}) NO WORKING
`Greetings to all, I am trying to render 2 or more segments generated by the directionsService.route() method, and then make the change of the route, using the drag and drop of the routeindex_changed event and then save the polyline

Note: "The reason to generate more than 2 segments by the directions service, is due to the maximum of 25 waypoints and I have more than 40 waypoints"`

```<code> private drawRouteToTheMap(directionsResult: google.maps.DirectionsResult | SavedRoute, index) {
    console.log('directionsResult', directionsResult)
    if ('routes' in directionsResult) {
      let directionsRenderer = new google.maps.DirectionsRenderer({
        suppressMarkers: true,
        draggable: true,
        directions: directionsResult,
        markerOptions: {
          draggable: false,
        },
        routeIndex: index + 1,
        map: this.map
      });
      console.log('directionsRenderer.getRouteIndex()', directionsRenderer.getRouteIndex())
      directionsRenderer.addListener("routeindex_changed", () => {
        const directions = directionsRenderer.getRouteIndex();
        console.log('directions', directions)
        if (directions) {

        }
      });
    }
  }
</code>```
```<code>private calculateDirection(waypoints: google.maps.DirectionsWaypoint[], departureTime): Promise<google.maps.DirectionsResult> {
    return new Promise((resolve, reject) => {
      this.directionsService.route(
        {
          origin: waypoints[0].location,
          destination: waypoints[waypoints.length - 1].location,
          waypoints,
          travelMode: google.maps.TravelMode.DRIVING,
          optimizeWaypoints: this.optimize,
          drivingOptions: {
            departureTime,
            trafficModel: google.maps.TrafficModel.BEST_GUESS,
          },

        },
        (response, status) => {
          if (status === "OK") {
            console.log('status', status)
            let b = response
            if (this.optimize) this.swapMarkersOptimize();
            resolve(response);
          } else {
            reject(response);
          }
        }
      );
    });
  }
</code>```

IMG CONSOLE

I am rendering 2 or more segments and then edit it with the routeindex_changed event

Body:
`Greetings to all, I am trying to render 2 or more segments generated by the directionsService.route() method, and then make the change of the route, using the drag and drop of the routeindex_changed event and then save the polyline

Note: "The reason to generate more than 2 segments by the directions service, is due to the maximum of 25 waypoints and I have more than 40 waypoints"`

 private drawRouteToTheMap(directionsResult: google.maps.DirectionsResult | SavedRoute, index) {
    console.log('directionsResult', directionsResult)
    if ('routes' in directionsResult) {
      let directionsRenderer = new google.maps.DirectionsRenderer({
        suppressMarkers: true,
        draggable: true,
        directions: directionsResult,
        markerOptions: {
          draggable: false,
        },
        routeIndex: index + 1,
        map: this.map
      });
      console.log('directionsRenderer.getRouteIndex()', directionsRenderer.getRouteIndex())
      directionsRenderer.addListener("routeindex_changed", () => {
        const directions = directionsRenderer.getRouteIndex();
        console.log('directions', directions)
        if (directions) {

        }
      });
    }
  }

private calculateDirection(waypoints: google.maps.DirectionsWaypoint[], departureTime): Promise<google.maps.DirectionsResult> {
    return new Promise((resolve, reject) => {
      this.directionsService.route(
        {
          origin: waypoints[0].location,
          destination: waypoints[waypoints.length - 1].location,
          waypoints,
          travelMode: google.maps.TravelMode.DRIVING,
          optimizeWaypoints: this.optimize,
          drivingOptions: {
            departureTime,
            trafficModel: google.maps.TrafficModel.BEST_GUESS,
          },

        },
        (response, status) => {
          if (status === "OK") {
            console.log('status', status)
            let b = response
            if (this.optimize) this.swapMarkersOptimize();
            resolve(response);
          } else {
            reject(response);
          }
        }
      );
    });
  }

IMG CONSOLE

I am rendering 2 or more segments and then edit it with the routeindex_changed event


问:
_printf is being printed twice
I am attempting to use the _printf function, and everything works OK except for one thing: it prints the result twice. The issue is that I am not receiving any errors other than the unexpected behavior. I attempted to add a null terminated character but was unable to change the result. However, that should not be an issue since if I am not incorrect, the string should be defaulted to make the string null terminated.

I am compiling the code with:

```<code>as --32 ./bin/assembly.asm -o ./bin/a.o
ld -m i386pe ./bin/a.o -o ./bin/a -lmsvcrt
</code>```

The assembly code:

```<code>.section .text
    .global _start
_start:
    call main
    movl %eax, %ebx
    movl $1, %eax
.section .data
LC0:
    .string "hello\0"
.section .text
main:
    pushl %ebp
    movl %esp, %ebp
    sub $0, %esp
    pushl $LC0
    call _printf
    add $4, %esp
    movl $0, %eax
    leave
    ret
</code>```

The output:

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

I have tried to reinstall the msvcrt.dll but that did not help, have also tried to restart the computer, have also tried to use puts and putchar but with the same result.

Title: _printf is being printed twice

Body:
I am attempting to use the _printf function, and everything works OK except for one thing: it prints the result twice. The issue is that I am not receiving any errors other than the unexpected behavior. I attempted to add a null terminated character but was unable to change the result. However, that should not be an issue since if I am not incorrect, the string should be defaulted to make the string null terminated.

I am compiling the code with:

as --32 ./bin/assembly.asm -o ./bin/a.o
ld -m i386pe ./bin/a.o -o ./bin/a -lmsvcrt

The assembly code:

.section .text
    .global _start
_start:
    call main
    movl %eax, %ebx
    movl $1, %eax
.section .data
LC0:
    .string "hello\0"
.section .text
main:
    pushl %ebp
    movl %esp, %ebp
    sub $0, %esp
    pushl $LC0
    call _printf
    add $4, %esp
    movl $0, %eax
    leave
    ret

The output:

hellohello

I have tried to reinstall the msvcrt.dll but that did not help, have also tried to restart the computer, have also tried to use puts and putchar but with the same result.


问:
Why caret train function always return one .outcome when the model can have more than one dependent variable?
This is something very tricky and is related with other questions I did here (1, 2, 3).

Basically, I am comparing two neural network trainings:

One using directly the function neuralnet() from the neuralnet package.

One using the function train() from the caret package, and including method = "neuralnet".

The same formula in both models

In both cases, in the arguments to introduce the formula:

f <- as.formula(paste("DC1 + DC2 + DC3 ~", paste(n[!n %in% c("DC1","DC2","DC3")], collapse = " + ")))

If we see its structure, you can see that there are three DEPENDENT VARIABLES (DC1, DC2, DC3)

```<code>str(f)
Class 'formula'  language DC1 + DC2 + DC3 ~ DC4 + DC5 + DC6 + DC7 + DC8 + DC9 + DC10
  ..- attr(*, ".Environment")=<environment: R_GlobalEnv>
</code>```

Using neuralnet() (neuralnet)

This is the code

```<code>BestModel <- neuralnet(formula = f,
                 data = train_df,  # available in one of the links above
                 hidden = c(3,2,4) # random neurons per layer
                 learningrate = 0.01,
                 threshold = 0.01,
                 stepmax = 50000

)
</code>```

Using train() (caret)

This is the code (all the parameters are available in this question):

```<code>model <- train(f, data = predict(pre_mdl_df, train_df),
               method = "neuralnet",
               tuneGrid = tune.grid.neuralnet,
               metric = "RMSE",
               stepmax = 100000,
               learningrate = 0.01,
               threshold = 0.01,
               act.fct = softplus,
               trControl = caret::trainControl (
                 method = "repeatedcv",
                 number = 2,               # Number of folds of the cv
                 repeats = 1,              # Number of cv repetitions
                 verboseIter = TRUE,
                 savePredictions = TRUE,
                 allowParallel = TRUE))
</code>```

Here, we store as finalModel the final and best model obtained in the training:

```<code>finalModel <- model$finalModel
</code>```

Comparison of the outputs from neuralnet() and train()

Different structures

neuralnet(): str(BestModel) is a List of 14.

train(): str(FinalModel) is a List of 19

Different responses:

As you can see, the response from neuralnet() is having chr [1:3] "DC1" "DC2" "DC3", whereas from train() has chr ".outcome". I guess this will impact the results later, because the prediction will return different quantity of results.

```<code># neuralnet()
str(BestModel$response)
 num [1:26, 1:3] 4 5 6 8 11 11 11 6 8 5 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:26] "165" "167" "168" "172" ...
  ..$ : chr [1:3] "DC1" "DC2" "DC3"

# train()
str(finalModel$response)
 num [1:26, 1] 0.83 0.509 1.199 1.353 1.55 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:26] "X165" "X167" "X168" "X172" ...
  ..$ : chr ".outcome"
</code>```

Different model lists

```<code># neuralnet()
str(BestModel$model.list)
List of 2
 $ response : chr [1:3] "DC1" "DC2" "DC3"
 $ variables: chr [1:7] "DC4" "DC5" "DC6" "DC7" ...

# train()
str(finalModel$model.list)
List of 2
 $ response : chr ".outcome"
 $ variables: chr [1:7] "DC4" "DC5" "DC6" "DC7" ...
</code>```

Different plots

From neuralnet(): as expected, with three outputs representing the three dependent variables (DC1, DC2, DC3).

From train(): only one output, .outcome.

Different prediction variables

I expect to predict the three variables simultaneously, as it happens with neuralnet() but not with train(), that returns only one.

```<code># neuralnet()
head(predict(BestModel, train_df))
        [,1]     [,2]     [,3]
165 9.384303 10.38448 10.07678
167 9.384303 10.38448 10.07678
168 9.384303 10.38448 10.07678
172 9.384303 10.38448 10.07678
174 9.384303 10.38448 10.07678
176 9.384303 10.38448 10.07678

# train()
head(predict(finalModel, train_df))
         [,1]
165 0.8641611
167 1.3874627
168 0.8641579
172 1.1318320
174 0.8639903
176 1.7193986
</code>```

Key questions

After comparing both models, which were supposed to behave similarly, several questions come to my mind:

How can I make train() to work similarly as neuralnet()? This includes the plots and predictions.

Is there any way to modify the code from train()?

Is there a bug in train()?

How can I change .outcome to have the three dependent variables?

Please, I need help!

Body:
This is something very tricky and is related with other questions I did here (1, 2, 3).

Basically, I am comparing two neural network trainings:

One using directly the function neuralnet() from the neuralnet package.

One using the function train() from the caret package, and including method = "neuralnet".

The same formula in both models

In both cases, in the arguments to introduce the formula:

f <- as.formula(paste("DC1 + DC2 + DC3 ~", paste(n[!n %in% c("DC1","DC2","DC3")], collapse = " + ")))

If we see its structure, you can see that there are three DEPENDENT VARIABLES (DC1, DC2, DC3)

str(f)
Class 'formula'  language DC1 + DC2 + DC3 ~ DC4 + DC5 + DC6 + DC7 + DC8 + DC9 + DC10
  ..- attr(*, ".Environment")=<environment: R_GlobalEnv>

Using neuralnet() (neuralnet)

This is the code

BestModel <- neuralnet(formula = f,
                 data = train_df,  # available in one of the links above
                 hidden = c(3,2,4) # random neurons per layer
                 learningrate = 0.01,
                 threshold = 0.01,
                 stepmax = 50000

)

Using train() (caret)

This is the code (all the parameters are available in this question):

model <- train(f, data = predict(pre_mdl_df, train_df),
               method = "neuralnet",
               tuneGrid = tune.grid.neuralnet,
               metric = "RMSE",
               stepmax = 100000,
               learningrate = 0.01,
               threshold = 0.01,
               act.fct = softplus,
               trControl = caret::trainControl (
                 method = "repeatedcv",
                 number = 2,               # Number of folds of the cv
                 repeats = 1,              # Number of cv repetitions
                 verboseIter = TRUE,
                 savePredictions = TRUE,
                 allowParallel = TRUE))

Here, we store as finalModel the final and best model obtained in the training:

finalModel <- model$finalModel

Comparison of the outputs from neuralnet() and train()

Different structures

neuralnet(): str(BestModel) is a List of 14.

train(): str(FinalModel) is a List of 19

Different responses:

As you can see, the response from neuralnet() is having chr [1:3] "DC1" "DC2" "DC3", whereas from train() has chr ".outcome". I guess this will impact the results later, because the prediction will return different quantity of results.

# neuralnet()
str(BestModel$response)
 num [1:26, 1:3] 4 5 6 8 11 11 11 6 8 5 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:26] "165" "167" "168" "172" ...
  ..$ : chr [1:3] "DC1" "DC2" "DC3"

# train()
str(finalModel$response)
 num [1:26, 1] 0.83 0.509 1.199 1.353 1.55 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:26] "X165" "X167" "X168" "X172" ...
  ..$ : chr ".outcome"

Different model lists

# neuralnet()
str(BestModel$model.list)
List of 2
 $ response : chr [1:3] "DC1" "DC2" "DC3"
 $ variables: chr [1:7] "DC4" "DC5" "DC6" "DC7" ...

# train()
str(finalModel$model.list)
List of 2
 $ response : chr ".outcome"
 $ variables: chr [1:7] "DC4" "DC5" "DC6" "DC7" ...

Different plots

From neuralnet(): as expected, with three outputs representing the three dependent variables (DC1, DC2, DC3).

From train(): only one output, .outcome.

Different prediction variables

I expect to predict the three variables simultaneously, as it happens with neuralnet() but not with train(), that returns only one.

# neuralnet()
head(predict(BestModel, train_df))
        [,1]     [,2]     [,3]
165 9.384303 10.38448 10.07678
167 9.384303 10.38448 10.07678
168 9.384303 10.38448 10.07678
172 9.384303 10.38448 10.07678
174 9.384303 10.38448 10.07678
176 9.384303 10.38448 10.07678

# train()
head(predict(finalModel, train_df))
         [,1]
165 0.8641611
167 1.3874627
168 0.8641579
172 1.1318320
174 0.8639903
176 1.7193986

Key questions

After comparing both models, which were supposed to behave similarly, several questions come to my mind:

How can I make train() to work similarly as neuralnet()? This includes the plots and predictions.

Is there any way to modify the code from train()?

Is there a bug in train()?

How can I change .outcome to have the three dependent variables?

Please, I need help!


问:
Typescript eslint getting wird errors
`010

List item

`ESlint errors on typescript

data it's not any

Don't know why eslint keep failing on this

```<code>type AuthenticateWithFingerprintCallParameters = {
    visitorId: string;
    userClaims: Record<string, string>;
  };
</code>```

That's how I'm calling the funciton

```<code>sendFetchAuthenticateWithFingerpint({ visitorId, userClaims })
</code>```

Title: Typescript eslint getting wird errors

Body:
`010

List item

`ESlint errors on typescript

data it's not any

Don't know why eslint keep failing on this

type AuthenticateWithFingerprintCallParameters = {
    visitorId: string;
    userClaims: Record<string, string>;
  };

That's how I'm calling the funciton

sendFetchAuthenticateWithFingerpint({ visitorId, userClaims })


问:
Gtk.TreeModelFilter, no automatic way to show parent when using VisibleFunc?
It seems that there are two mutually-exclusive ways to use filter:

Setting a function to determine visibility.

Setting a boolean column to denote visibility.

The problem of (1) is that if any of the ancestors does not match the function, matching children will not show. For example, if the VisibleFunc returns true when the current node's name contains "b" for the following tree, only "bc" will be shown, and "ab" will not, because its parent "a" does not have "b".

a

ab

ac

b

bc

I think that in most use cases, this would not be something the user wants. I saw an existing question, and the answer was using (2) instead. Basically, what the answer does seemed to be manually traversing the tree, and if the current node matches the criteria, iterating up to the root node and changing the visibilities of all ancestors. It would work, but it seems kind of awkward, because it needs to modify the TreeStore itself and doing manual traversals.

Since I think it would be a common use case to show a matching child node, even if not all of its ancestors match, doesn't (1) have any option for this? Like, keep applying the VisibleFunc to all the descendants of a node that does not match the function, anyway, and automatically make all ancestors visible? Or, is using (2) the only way?


问:
How do I change the color of the markers and width of the figure in this boxplot using seaborn?
Using seaborn I want to change the color of the outlier markers to red. I also want to reduce the width of the figure to get rid of the whitespcace.

This is my current code and the graph it produces:

import seaborn as sns
import matplotlib.pyplot as plt

rbp_box = sns.boxplot(data=df_raw, y="Resting blood pressure", color="red", flierprops={"marker": "x"}, width=0.2)
rbp_box.set(xlabel='', ylabel='mm Hg', title='Resting blood pressure box plot')
```

box plot

Body:
Using seaborn I want to change the color of the outlier markers to red. I also want to reduce the width of the figure to get rid of the whitespcace.

This is my current code and the graph it produces:

import seaborn as sns
import matplotlib.pyplot as plt

rbp_box = sns.boxplot(data=df_raw, y="Resting blood pressure", color="red", flierprops={"marker": "x"}, width=0.2)
rbp_box.set(xlabel='', ylabel='mm Hg', title='Resting blood pressure box plot')

box plot


问:
ModuleNotFoundError when using "openai.embeddings_utils import get_embedding" ModuleNotFoundError: No module named 'matplotlib'
I'm new to Python and trying to learn how to apply GPT3's embeddings and so am following a demo. I begin by importing the following:

```<code>import openai
import pickle
import pandas as pd
from keys import key
from openai.embeddings_utils import get_embedding
</code>```

And then when I run the code, I get the following error:

```<code>Traceback (most recent call last):
  File "/Users/noahvalens/PycharmProjects/PythonGPT3Tutorial/chat.py", line 5, in <module>
    from openai.embeddings_utils import get_embedding
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/embeddings_utils.py", line 4, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
</code>```

I already have openai and matplotlib installed with pip, so not sure what's causing this.

Another interesting fact is that, if I decide to delete the import matplotlib line from the following import list (this is found when I follow the second file link in the traceback above), it repeats the same error with each of the packages it's trying to import. This is even after I manually install each one with pip.

```<code>import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
from scipy import spatial
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.metrics import average_precision_score, precision_recall_curve
from tenacity import retry, stop_after_attempt, wait_random_exponential
</code>```

Body:
I'm new to Python and trying to learn how to apply GPT3's embeddings and so am following a demo. I begin by importing the following:

import openai
import pickle
import pandas as pd
from keys import key
from openai.embeddings_utils import get_embedding

And then when I run the code, I get the following error:

Traceback (most recent call last):
  File "/Users/noahvalens/PycharmProjects/PythonGPT3Tutorial/chat.py", line 5, in <module>
    from openai.embeddings_utils import get_embedding
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/embeddings_utils.py", line 4, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

I already have openai and matplotlib installed with pip, so not sure what's causing this.

Another interesting fact is that, if I decide to delete the import matplotlib line from the following import list (this is found when I follow the second file link in the traceback above), it repeats the same error with each of the packages it's trying to import. This is even after I manually install each one with pip.

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
from scipy import spatial
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.metrics import average_precision_score, precision_recall_curve
from tenacity import retry, stop_after_attempt, wait_random_exponential


问:
How to solve AttributeError: 'NoneType' object has no attribute 'tag'
I'm using the eyed3 and this is a part of my long code:

if new_file.exists():
            print(f'{data[i][0]} has been\033[1;32;40m successfully downloaded.\033[m  ')
            mySong = eyed3.core.load(new_file)
            print(new_file)
            print(mySong)
            if (mySong.tag == None):
                mySong.initTag()
            mySong.tag.images.set(type_=3, img_data=None ,mine_type=None,description=None,img_url=data[i][3] )
            mySong.tag.save()
```
<p>And I'm getting this error thousands of times:</p>
<pre class="lang-none prettyprint-override"><code>I Ain't Worried has been successfully downloaded.
C:\Users\elabr\Desktop\Folder\I Aint Worried.mp3
None
Traceback (most recent call last):
  File "C:\Users\elabr\youtube_api.py", line 60, in <module>
    if (mySong.tag == None):
AttributeError: 'NoneType' object has no attribute 'tag'
</code>```

I dont't know what im doing wrong tbh and would really appreaciate some help pls guys.

Body:
I'm using the eyed3 and this is a part of my long code:

if new_file.exists():
            print(f'{data[i][0]} has been\033[1;32;40m successfully downloaded.\033[m  ')
            mySong = eyed3.core.load(new_file)
            print(new_file)
            print(mySong)
            if (mySong.tag == None):
                mySong.initTag()
            mySong.tag.images.set(type_=3, img_data=None ,mine_type=None,description=None,img_url=data[i][3] )
            mySong.tag.save()

And I'm getting this error thousands of times:

I Ain't Worried has been successfully downloaded.
C:\Users\elabr\Desktop\Folder\I Aint Worried.mp3
None
Traceback (most recent call last):
  File "C:\Users\elabr\youtube_api.py", line 60, in <module>
    if (mySong.tag == None):
AttributeError: 'NoneType' object has no attribute 'tag'

I dont't know what im doing wrong tbh and would really appreaciate some help pls guys.


问:
TypeError: tuple indices must be integers or slices, not tuple
I am getting the error "TypeError: tuple indices must be integers or slices, not tuple" for a specific line in my python code when trying to plot certain values from a csv file, but the error is not consistent from all the plot. Below is the code I am having trouble with and the error pops up for line axs[0].bar(r-(width*2), Ruby[1:, 7], width=width,  color='w', alpha=1).

If I plot "Ruby" separately from the other files it works without error.

Any ideas why python would be reading certain lines as tuples from a csv file in certain plot but not in others?

```<code>with open("Ruby\Ruby.csv") as file_name:
    Ruby= np.genfromtxt(file_name, delimiter=",")

with open("Mine Slide\MS.csv") as file_name:
    MS = np.genfromtxt(file_name, delimiter=",")

dates = ['2021\n03 Oct\n15 Oct', '15 Oct\n27 Oct', '27 Oct\n08 Nov', '08 Nov\n20 Nov', '20 Nov\n02 Dec','2021\n02 Dec\n14 Dec']
ifg= [1,2,3,4,5,6]

fig, axs = plt.subplots(2, 1)
n=6
r=np.arange(n)
width= 0.07
axs[0].bar(r-(width*2), Ruby[1:, 8], width=width,  color='pink', alpha=0.5)
Ruby=axs[0].bar(r-(width*2), Ruby[1:, 4], width=width, label='Ruby Creek',  color='pink', alpha=0.5)
axs[0].bar(r-(width*2), Ruby[1:, 7], width=width,  color='w', alpha=1)
axs[0].bar(r-(width*1), MS[1:7, 8], width=width,  color='r', alpha=0.5)
MS1=axs[0].bar(r-(width*1), MS[1:7, 4], width=width, label='Mine Slide 1',  color='r', alpha=0.5)
axs[0].bar(r-(width*1), MS[1:7, 7], width=width,  color='w', alpha=1)
axs[0].bar(r-(width*0), MS[7:13, 8], width=width,  color='b', alpha=0.5)
MS2=axs[0].bar(r-(width*0), MS[7:13, 4], width=width, label='Mine Slide 2',  color='b', alpha=0.5)
axs[0].bar(r-(width*0), MS[7:13, 7], width=width,  color='w', alpha=1)
R2=axs[0].bar(r+(width*3), MS[25:, 4], width=width, label='Ruby 2',  color='m', alpha=0.5)
axs[0].bar(r+(width*3), MS[25:, 7], width=width,  color='w', alpha=1)
#axs[0].bar_label(Ruby, padding=1, rotation='vertical')
axs[0].bar_label(MS1, padding=1, rotation='vertical')
axs[0].bar_label(R2, padding=1, rotation='vertical')
axs[0].set_ylim(0, 1)
axs[0].set_yticks(np.arange(0, 1, step=0.2))
axs[0].set_xticks(np.arange(0, 6, step=1))
#axs[0].set_xticklabels(('Pre-Failure', 'Pre-Failure', 'Pre-Failure', 'Failure', 'Post-Failure', 'Post-Failure', 'Post-Failure'))
axs[0].set_ylabel('Coherence')
axs[0].set_xlabel('IFG NO.')

axs[1].plot(dates, Ruby[1:, 4], color='pink', label='Ruby Creek')
axs[1].plot(dates, MS[1:7, 4], color='r', label='Mine Slide 1')
axs[1].plot(dates, MS[7:13, 4], color='b', label='Mine Slide 2')
axs[1].plot(dates, MS[25:, 4], color='m', label='Ruby 2')
axs[1].title.set_text('November 2021- Asc- Master Varied-Slides-VV')
axs[1].set_ylim(0, 1)
axs[1].set_yticks(np.arange(0, 1, step=0.2))
axs[1].set_ylabel('Coherence')
axs[1].set_xlabel('Dates')
axs[1].legend(bbox_to_anchor=(1, 0.5), loc="center left")
</code>```

Tried plotting all files separately and and they work without issue

Body:
I am getting the error "TypeError: tuple indices must be integers or slices, not tuple" for a specific line in my python code when trying to plot certain values from a csv file, but the error is not consistent from all the plot. Below is the code I am having trouble with and the error pops up for line axs[0].bar(r-(width*2), Ruby[1:, 7], width=width,  color='w', alpha=1).

If I plot "Ruby" separately from the other files it works without error.

Any ideas why python would be reading certain lines as tuples from a csv file in certain plot but not in others?

with open("Ruby\Ruby.csv") as file_name:
    Ruby= np.genfromtxt(file_name, delimiter=",")

with open("Mine Slide\MS.csv") as file_name:
    MS = np.genfromtxt(file_name, delimiter=",")

dates = ['2021\n03 Oct\n15 Oct', '15 Oct\n27 Oct', '27 Oct\n08 Nov', '08 Nov\n20 Nov', '20 Nov\n02 Dec','2021\n02 Dec\n14 Dec']
ifg= [1,2,3,4,5,6]

fig, axs = plt.subplots(2, 1)
n=6
r=np.arange(n)
width= 0.07
axs[0].bar(r-(width*2), Ruby[1:, 8], width=width,  color='pink', alpha=0.5)
Ruby=axs[0].bar(r-(width*2), Ruby[1:, 4], width=width, label='Ruby Creek',  color='pink', alpha=0.5)
axs[0].bar(r-(width*2), Ruby[1:, 7], width=width,  color='w', alpha=1)
axs[0].bar(r-(width*1), MS[1:7, 8], width=width,  color='r', alpha=0.5)
MS1=axs[0].bar(r-(width*1), MS[1:7, 4], width=width, label='Mine Slide 1',  color='r', alpha=0.5)
axs[0].bar(r-(width*1), MS[1:7, 7], width=width,  color='w', alpha=1)
axs[0].bar(r-(width*0), MS[7:13, 8], width=width,  color='b', alpha=0.5)
MS2=axs[0].bar(r-(width*0), MS[7:13, 4], width=width, label='Mine Slide 2',  color='b', alpha=0.5)
axs[0].bar(r-(width*0), MS[7:13, 7], width=width,  color='w', alpha=1)
R2=axs[0].bar(r+(width*3), MS[25:, 4], width=width, label='Ruby 2',  color='m', alpha=0.5)
axs[0].bar(r+(width*3), MS[25:, 7], width=width,  color='w', alpha=1)
#axs[0].bar_label(Ruby, padding=1, rotation='vertical')
axs[0].bar_label(MS1, padding=1, rotation='vertical')
axs[0].bar_label(R2, padding=1, rotation='vertical')
axs[0].set_ylim(0, 1)
axs[0].set_yticks(np.arange(0, 1, step=0.2))
axs[0].set_xticks(np.arange(0, 6, step=1))
#axs[0].set_xticklabels(('Pre-Failure', 'Pre-Failure', 'Pre-Failure', 'Failure', 'Post-Failure', 'Post-Failure', 'Post-Failure'))
axs[0].set_ylabel('Coherence')
axs[0].set_xlabel('IFG NO.')

axs[1].plot(dates, Ruby[1:, 4], color='pink', label='Ruby Creek')
axs[1].plot(dates, MS[1:7, 4], color='r', label='Mine Slide 1')
axs[1].plot(dates, MS[7:13, 4], color='b', label='Mine Slide 2')
axs[1].plot(dates, MS[25:, 4], color='m', label='Ruby 2')
axs[1].title.set_text('November 2021- Asc- Master Varied-Slides-VV')
axs[1].set_ylim(0, 1)
axs[1].set_yticks(np.arange(0, 1, step=0.2))
axs[1].set_ylabel('Coherence')
axs[1].set_xlabel('Dates')
axs[1].legend(bbox_to_anchor=(1, 0.5), loc="center left")

Tried plotting all files separately and and they work without issue


问:
Send and receive websockets at the same time
Im trying to send and receive at the same time from websockets. But the while-loop is blocking my received websockets. Im using python 3.6 so I cannot use asyncio.run but have to stick to asyncio.get_event_loop()

```<code>websocket.recv()
</code>```

receives the message only once. After that it is blocked by the while loop

Here is my code.

```<code>import asyncio
import websockets
import json

async def hello(websocket, path):
    name = await websocket.recv()
    print(f"< {name}")

    count = 2

    while True:
        count = count + 1
        counting = json.dumps(count)

        await websocket.send(counting)
        await asyncio.sleep(0.1)

start_server = websockets.serve(hello, "192.168.1.104", 5678)

asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
</code>```

How can I separate the processes and run them in parallell with asyncio?

Body:
Im trying to send and receive at the same time from websockets. But the while-loop is blocking my received websockets. Im using python 3.6 so I cannot use asyncio.run but have to stick to asyncio.get_event_loop()

websocket.recv()

receives the message only once. After that it is blocked by the while loop

Here is my code.

import asyncio
import websockets
import json

async def hello(websocket, path):
    name = await websocket.recv()
    print(f"< {name}")

    count = 2

    while True:
        count = count + 1
        counting = json.dumps(count)

        await websocket.send(counting)
        await asyncio.sleep(0.1)

start_server = websockets.serve(hello, "192.168.1.104", 5678)

asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()

How can I separate the processes and run them in parallell with asyncio?


问:
Swiper conflicts with a scrollable list
I have Swiper handle two horizontal slides which I can move with the mouse wheel. I added, to the second slide, a Bootstrap vertical list which used to scroll up and down with the mouse wheel with no problem in a previous product. I mean both widgets work fine separately but when I put them together the wheel moves the slides but ignores the list. What can I do to get both to work? Thank you!</p>

Title: Swiper conflicts with a scrollable list


问:
Github pages gives InvalidDNSError for google domains custom URL
I have a web app I deployed on my github pages website under

shreyj1729.github.io/pairprogram.me
which resolves to
shreyjoshi.com/pairprogram.me since I have my own domain name. I recently got the domain pairprogram.app on google domains which I'm trying to link to the repo, but I keep getting the following error:

Here is my DNS records on google domains:

I am not sure what's going wrong. I've tried different CNAMEs on google domains to no avail. The app itself runs fine at the new URL but the error on github pages persists. How can I fix this?


问:
Oracle ordering with IN clause
In Oracle 12c, I have a select statement that uses  the IN keyword with a long list of serial numbers as part of the IN clause. Is there a way to keep the order of the results the same as the order of the list in the IN clause?

Tried different Order By clauses, but no success.

Title: Oracle ordering with IN clause


问:
error while creating mount source path '/var/lib/rancher'
I installed Rancher Server in a Docker. In the configurations steps, as it's necessary, I am trying to add host:

But when I run the command below, it results in the following error:

docker: Error response from daemon: error while creating mount source path '/var/lib/rancher': mkdir /var/lib/rancher: read-only file system.


问:
increase reading speed for python for read data from 7 sensors via comport
I have connected 7 devices by COM port (9600, 4800 baud rates) in my laptop, and I need to record data from all devices. I created a python script - to collect data via pandas in an excel table, but the speed is not good (I have 5 FPS, but I need 20 FPS). I tried to connect one sensor through the thread and pyperclip library, and it is a little better (FPS - 7), but still, the FPS is low. How else can you use it?
For good, do all data need to write data to the buffer via thread or not?


问:
instagram script AMP page for nextjs
run instagram and twitter embed inside a Nextjs AMP page application.

I have a div like this

that inside the "text" has a blockquote, but as in AMP it cannot load scripts I put all the necessary ones in the  of nextjs as it is only allowed by AMP but even so any blockquote that comes does not become an instagram or twitter embed .

does anyone have any suggestions?

Title: instagram script AMP page for nextjs


问:
Memory Error in SwiftUI that goes way over my head
I'm learning SwiftUI over break for fun over youtube, trying to build a fun little app to learn stuff and i'm attempting to make a custom tab bar at the bottom to control views, and have objects (i made a Person object) that i owuld like to be able to access and modify throughout all my views. From what I can tell, I've achieved that, as it runs perfectly well as I expect it to on the Simulator, but when I try to run on my iPhone I get the error "Thread 1: EXC_BAD_ACCESS (code=257, address=0x481bdfee88082008)"

I'm not familiar with reading memory addresses, i'm just trying to screw around with building apps for fun with my downtime

myTestApp.swift

```<code>import SwiftUI

@main
struct myTestApp: App {

    var testPerson = Person(name: "Stinky", age: 69)

    var body: some Scene {
        WindowGroup {
            ContentView()
                .environmentObject(testPerson)
        }
    }
}

</code>```

ContentView.swift

```<code>
import SwiftUI

struct ContentView: View {

    @State var selectedIndex = 0

    let icons = [
        "house", "person", "doc", "dice", "gear"
    ]

    let tabNames = [
        "Home", "People", "Overview", "Activities", "Settings"
    ]

    var body: some View {
        VStack {
            ZStack {
                switch selectedIndex {
                case 0: HomeView()
                case 1: PeopleView()
                case 2: OverView()
                case 3: ActivitiesView()
                case 4: SettingsView()
                default: HomeView()
                }

            }

            Divider()
                .frame(height: 2.0)

            HStack {
                ForEach(0..<5, id: \.self) { i in
                    Spacer()

                    VStack {
                        Image(systemName: icons[i])
                            .frame(height: 20.0)
                            .font(.system(size:23))
                            .foregroundColor(self.selectedIndex == i ? Color("SelectedColor") : Color("AccentColor"))
                        Text("\(tabNames[i])")
                            .font(.system(size:10, weight: .medium, design: .default))
                            .foregroundColor(self.selectedIndex == i ? Color("SelectedColor") : Color("AccentColor"))
                            .padding(.top, 1.0)
                    }
                    .onTapGesture {
                        selectedIndex = i
                    }

                    .frame(width: 70.0, height: 60.0)
                    Spacer()
                }
            }
            .frame(height: 41.0)
        }
    }

}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
</code>```

Views.swift

```<code>
import SwiftUI

struct HomeView: View {

    @EnvironmentObject var testPerson: Person

    var body: some View {

        NavigationView {
            VStack {
                ScrollView {
                    VStack {
                        Text(testPerson.name + " \(testPerson.age)")
                        ForEach(0..<5) { i in
                            Text("The Train Has Arrived!")
                                .padding(.all, 3.0)
                        }
                    }
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
                    .cornerRadius(20)
                    .background(Color.gray)
                }

                Button(action: {
                    testPerson.age += 1
                }, label: {
                    Text("Age: \(testPerson.age)")
                        .font(.system(size: 20))
                        .foregroundColor(.white)
                        .frame(maxWidth: .infinity)
                })
                .frame(maxWidth: .infinity, maxHeight: 50)
                .foregroundColor(.blue)
                .background(.blue)
                .cornerRadius(15)
                .padding(.horizontal)

            }
            .navigationTitle("Age: \(testPerson.age)")

        }
    }
}

struct PeopleView: View {

    @EnvironmentObject var testPerson: Person
    @State var newPersonCreation = false
    var body: some View {
        NavigationView {
            VStack {
                ZStack {
                    Spacer().fullScreenCover(isPresented: $newPersonCreation, content: {
                        Button("ass", action: {
                            self.newPersonCreation.toggle()
                        })
                    })
                }
                Text("Age: \(testPerson.age)")

            }
            .navigationTitle("People")
            .toolbar {
                Button(action: {
                    self.newPersonCreation.toggle()
                }, label: {
                    Image(systemName: "plus")
                        .foregroundColor(.white)

                })

            }
        }
    }
}

struct OverView: View {
    var body: some View {
        NavigationView {
            VStack {

            }
            .navigationTitle("Overview")
        }
    }
}

struct ActivitiesView : View {
    var body: some View {
        NavigationView {
            VStack {

            }
            .navigationTitle("Activities")
        }
    }
}

struct SettingsView: View {
    var body: some View {
        NavigationView {
            VStack {

            }
            .navigationTitle("Settings")
        }
    }
}

struct Previews_Views_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
</code>```

Person.swift

```<code>import SwiftUI

class Person: ObservableObject {
    @Published var name = "Anonymous"
    @Published var age = 1

    init(name: String, age: Int) {
        self.name = name
        self.age = age
    }

}

</code>```

Body:
I'm learning SwiftUI over break for fun over youtube, trying to build a fun little app to learn stuff and i'm attempting to make a custom tab bar at the bottom to control views, and have objects (i made a Person object) that i owuld like to be able to access and modify throughout all my views. From what I can tell, I've achieved that, as it runs perfectly well as I expect it to on the Simulator, but when I try to run on my iPhone I get the error "Thread 1: EXC_BAD_ACCESS (code=257, address=0x481bdfee88082008)"

I'm not familiar with reading memory addresses, i'm just trying to screw around with building apps for fun with my downtime

myTestApp.swift

import SwiftUI

@main
struct myTestApp: App {

    var testPerson = Person(name: "Stinky", age: 69)

    var body: some Scene {
        WindowGroup {
            ContentView()
                .environmentObject(testPerson)
        }
    }
}

ContentView.swift

import SwiftUI

struct ContentView: View {

    @State var selectedIndex = 0

    let icons = [
        "house", "person", "doc", "dice", "gear"
    ]

    let tabNames = [
        "Home", "People", "Overview", "Activities", "Settings"
    ]

    var body: some View {
        VStack {
            ZStack {
                switch selectedIndex {
                case 0: HomeView()
                case 1: PeopleView()
                case 2: OverView()
                case 3: ActivitiesView()
                case 4: SettingsView()
                default: HomeView()
                }

            }

            Divider()
                .frame(height: 2.0)

            HStack {
                ForEach(0..<5, id: \.self) { i in
                    Spacer()

                    VStack {
                        Image(systemName: icons[i])
                            .frame(height: 20.0)
                            .font(.system(size:23))
                            .foregroundColor(self.selectedIndex == i ? Color("SelectedColor") : Color("AccentColor"))
                        Text("\(tabNames[i])")
                            .font(.system(size:10, weight: .medium, design: .default))
                            .foregroundColor(self.selectedIndex == i ? Color("SelectedColor") : Color("AccentColor"))
                            .padding(.top, 1.0)
                    }
                    .onTapGesture {
                        selectedIndex = i
                    }

                    .frame(width: 70.0, height: 60.0)
                    Spacer()
                }
            }
            .frame(height: 41.0)
        }
    }

}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Views.swift

import SwiftUI

struct HomeView: View {

    @EnvironmentObject var testPerson: Person

    var body: some View {

        NavigationView {
            VStack {
                ScrollView {
                    VStack {
                        Text(testPerson.name + " \(testPerson.age)")
                        ForEach(0..<5) { i in
                            Text("The Train Has Arrived!")
                                .padding(.all, 3.0)
                        }
                    }
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
                    .cornerRadius(20)
                    .background(Color.gray)
                }

                Button(action: {
                    testPerson.age += 1
                }, label: {
                    Text("Age: \(testPerson.age)")
                        .font(.system(size: 20))
                        .foregroundColor(.white)
                        .frame(maxWidth: .infinity)
                })
                .frame(maxWidth: .infinity, maxHeight: 50)
                .foregroundColor(.blue)
                .background(.blue)
                .cornerRadius(15)
                .padding(.horizontal)

            }
            .navigationTitle("Age: \(testPerson.age)")

        }
    }
}

struct PeopleView: View {

    @EnvironmentObject var testPerson: Person
    @State var newPersonCreation = false
    var body: some View {
        NavigationView {
            VStack {
                ZStack {
                    Spacer().fullScreenCover(isPresented: $newPersonCreation, content: {
                        Button("ass", action: {
                            self.newPersonCreation.toggle()
                        })
                    })
                }
                Text("Age: \(testPerson.age)")

            }
            .navigationTitle("People")
            .toolbar {
                Button(action: {
                    self.newPersonCreation.toggle()
                }, label: {
                    Image(systemName: "plus")
                        .foregroundColor(.white)

                })

            }
        }
    }
}

struct OverView: View {
    var body: some View {
        NavigationView {
            VStack {

            }
            .navigationTitle("Overview")
        }
    }
}

struct ActivitiesView : View {
    var body: some View {
        NavigationView {
            VStack {

            }
            .navigationTitle("Activities")
        }
    }
}

struct SettingsView: View {
    var body: some View {
        NavigationView {
            VStack {

            }
            .navigationTitle("Settings")
        }
    }
}

struct Previews_Views_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Person.swift

import SwiftUI

class Person: ObservableObject {
    @Published var name = "Anonymous"
    @Published var age = 1

    init(name: String, age: Int) {
        self.name = name
        self.age = age
    }

}


问:
How to replace the arrow by tirangle in mat-paginator?
I created a mat-paginator like that

but I want to modify the icons in the form of a triangle (as shown in the photo) => i want replace the arrow by tirnagle

how do i change the icon to a triangle ?

file.ts :

```<code>@ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
@ViewChild(MatSort, {static: true}) sort: MatSort;
</code>```

file.html:

```<code><mat-paginator [pageSizeOptions]="[5, 10, 15, 20]"></mat-paginator>
</code>```

Body:
I created a mat-paginator like that

but I want to modify the icons in the form of a triangle (as shown in the photo) => i want replace the arrow by tirnagle

how do i change the icon to a triangle ?

file.ts :

@ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
@ViewChild(MatSort, {static: true}) sort: MatSort;

file.html:

<mat-paginator [pageSizeOptions]="[5, 10, 15, 20]"></mat-paginator>


问:
Keep financial data even when removing user from data base
I'm working on a system that manages clubs and associations.

One key factor of this system is that one person can be a member of more than one club.

Right now, I'm facing an issue where my system is loosing financial records references when one user is longer a member of an association. To visualize it a little better, I made a simplified version of the tables related to finances.

So basically I have one table that has the associations, one that has each group of associates, so the associate would be the identification for the family and then the members, that would be the dad, mom, son, etc. Each associate needs to have one and just one responsible, who would receive all the communication, manage the associate certificate, pay the bills.

All the associations work on a monthly subscription, paid by the member responsible, and it can also have others expenses, such as restaurants, rental of barbecue areas, party room, etc.

These finances are stored in the tb_finance table, which references the tb_associate. This is where my problem is today.

If one family decides they no longer wants to be part of the association, or (I think it's worse), they decide to sell their Certificate to another family, the finances will break.

I'm not loosing all info, but I'll lose the link between them. tb_associate and tb_user will never have their info deleted. But tb_associate_member will.

I thought about creating another table to create a direct reference with the user's and finances, for example, like this:

This way tb_associate_finance will never be deleted, thus keeping its user's reference.

I just don't feel like this is the best way to solve this problem. It seems to have a better and simple way to achieve this result.

For each member responsible, it's possible that they have an apiKey used by an external third party system integrated (similar to PayPal) to generate the bills for credit card, etc., to be paid.


问:
how to call wrap method when block-tune menu button clicked in Editor.js
Now I'm trying to create Nest function by block-tune-plugin in Editor.js.
To do so, I wrote below code.

```<code> render() {
    const wrapper = Dom.make("div");
    const button = document.createElement("button");
    button.classList.add(this.api.styles.settingsButton);
    button.innerHTML = "nest";
    button.type = "button";
    wrapper.appendChild(button);

    this.api.listeners.on(button, "click", (event) => {
      this.distance = this.distance + this.base;
      this.padding = this.distance + "rem";
      button.classList.toggle(this.api.styles.settingsButtonActive);
      this.wrap(event);
    });
    return wrapper;
  }

  wrap(blockContent) {
    this.wrapper = Dom.make("div");
    this.wrapper.style.paddingLeft = this.padding;
    this.wrapper.append(blockContent);
    return this.wrapper;
  }
</code>```

However if I push button that is in block tune menu, the block don't act.
What is the problem of this code?

I tried with this code.
In this wrap(), I set the default postion and try to toggle CSS class by count up variable.
But in this way, I could change the classname but I can't get CSS effect

```<code>render() {
    this.api.listeners.on(button, "click", (event) => {
      this.data = this.count;
      this.count += 1;
      this.wrap(event);
    });
    return wrapper;
  }

 wrap(blockContent) {
this.wrapper.classList.toggle(this.CSS.nest[this.data]);
    if (this.count === 2) {
      this.wrapper.style.paddingLeft = "10rem";
    }
   this.wrapper.style.paddingLeft = "5rem";
</code>```

Body:
Now I'm trying to create Nest function by block-tune-plugin in Editor.js.
To do so, I wrote below code.

 render() {
    const wrapper = Dom.make("div");
    const button = document.createElement("button");
    button.classList.add(this.api.styles.settingsButton);
    button.innerHTML = "nest";
    button.type = "button";
    wrapper.appendChild(button);

    this.api.listeners.on(button, "click", (event) => {
      this.distance = this.distance + this.base;
      this.padding = this.distance + "rem";
      button.classList.toggle(this.api.styles.settingsButtonActive);
      this.wrap(event);
    });
    return wrapper;
  }

  wrap(blockContent) {
    this.wrapper = Dom.make("div");
    this.wrapper.style.paddingLeft = this.padding;
    this.wrapper.append(blockContent);
    return this.wrapper;
  }

However if I push button that is in block tune menu, the block don't act.
What is the problem of this code?

I tried with this code.
In this wrap(), I set the default postion and try to toggle CSS class by count up variable.
But in this way, I could change the classname but I can't get CSS effect

render() {
    this.api.listeners.on(button, "click", (event) => {
      this.data = this.count;
      this.count += 1;
      this.wrap(event);
    });
    return wrapper;
  }

 wrap(blockContent) {
this.wrapper.classList.toggle(this.CSS.nest[this.data]);
    if (this.count === 2) {
      this.wrapper.style.paddingLeft = "10rem";
    }
   this.wrapper.style.paddingLeft = "5rem";


问:
How to save pyspark DataFrame to Elasticsearch (Running on Docker) using elastisearch-hadoop
I am trying to write a pyspark DataFrame to an Elasticsearch instance running on Docker. I am unable to successfully connect to the Elasticsearch instance using elasticsearch-hadoop. When I try to save the DataFrame, I get an error that Elasticsearch could not be found. I suspect it has to do with security, and I noticed that the instance was secured by default (as of es version 8).

I set up the single node Elasticsearch instance on Docker by following the docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html

I did confirm the cluster is healthy with curl --cacert http_ca.crt -u elastic https://localhost:9200/_cluster/health.

I am running Pyspark 3.3.1, using the elasticsearch-spark-30_2.12 jar, and using Elasticsearch 8.5.

I tried to use basic auth with user and pass, like below. My expectation is that I need to specify the correct es security parameters, but I have been unsuccessful so far. I have been reading through the configuration docs to try and figure out what to do: https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html.

```<code>df \
    .write \
    .format("es") \
    .option("es.nodes.wan.only", "true") \
    .option("es.net.http.auth.user", "elastic") \
    .option("es.net.http.auth.pass", "...") \
    .option("es.nodes", "localhost") \
    .option("es.port", "9200") \
    .option('es.resource',"spark/test") \
    .save()
</code>```

When running the above, I get this error in logging output:

```<code>22/12/21 16:07:02 ERROR NetworkClient: Node [localhost:9200] failed (org.elasticsearch.hadoop.thirdparty.apache.commons.httpclient.NoHttpResponseException: The server localhost failed to respond); no other nodes left - aborting...
</code>```

I also get this error from py4j:

```<code>org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.only'
</code>```

I suspect I may need to use es.net.ssl.keystore instead, but I don't know much about this. Any help is appreciated.

Body:
I am trying to write a pyspark DataFrame to an Elasticsearch instance running on Docker. I am unable to successfully connect to the Elasticsearch instance using elasticsearch-hadoop. When I try to save the DataFrame, I get an error that Elasticsearch could not be found. I suspect it has to do with security, and I noticed that the instance was secured by default (as of es version 8).

I set up the single node Elasticsearch instance on Docker by following the docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html

I did confirm the cluster is healthy with curl --cacert http_ca.crt -u elastic https://localhost:9200/_cluster/health.

I am running Pyspark 3.3.1, using the elasticsearch-spark-30_2.12 jar, and using Elasticsearch 8.5.

I tried to use basic auth with user and pass, like below. My expectation is that I need to specify the correct es security parameters, but I have been unsuccessful so far. I have been reading through the configuration docs to try and figure out what to do: https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html.

df \
    .write \
    .format("es") \
    .option("es.nodes.wan.only", "true") \
    .option("es.net.http.auth.user", "elastic") \
    .option("es.net.http.auth.pass", "...") \
    .option("es.nodes", "localhost") \
    .option("es.port", "9200") \
    .option('es.resource',"spark/test") \
    .save()

When running the above, I get this error in logging output:

22/12/21 16:07:02 ERROR NetworkClient: Node [localhost:9200] failed (org.elasticsearch.hadoop.thirdparty.apache.commons.httpclient.NoHttpResponseException: The server localhost failed to respond); no other nodes left - aborting...

I also get this error from py4j:

org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.only'

I suspect I may need to use es.net.ssl.keystore instead, but I don't know much about this. Any help is appreciated.