问:
Cannot read properties of undefined (reading 'local')
When trying to use the function chrome.storage.local.set I get error in console:

```<code>Cannot read properties of undefined (reading 'local')
</code>```

How it is possible to solve it?

What didn't work:

Adding /// <reference types="chrome"/> to my ts file.

npm install --save @types/chrome

Editing manifest.json:

```<code>{
 "permissions": [
    "tabs",
    "bookmarks",
    "storage",
    "unlimitedStorage"
  ],
  "optional_permissions": [
    "unlimitedStorage"
  ]
}
</code>```

Body:
When trying to use the function chrome.storage.local.set I get error in console:

Cannot read properties of undefined (reading 'local')

How it is possible to solve it?

What didn't work:

Adding /// <reference types="chrome"/> to my ts file.

npm install --save @types/chrome

Editing manifest.json:

{
 "permissions": [
    "tabs",
    "bookmarks",
    "storage",
    "unlimitedStorage"
  ],
  "optional_permissions": [
    "unlimitedStorage"
  ]
}


来源: stackexchange

问:
Android. Is there way to invert order of adding Fragments to LinearLayout?
I have a fragment containing LinearLayout, where programmaticaly added fragments using:

```<code>getFragmentManager().beginTransaction().add(R.id.linear_layout, CheckTemplateFragment.newInstance(*params*).commit();
</code>```

And it filling linear layout from Top to Bottom, but I need it in reverse, Bottom to Top, aka adding new Fragment to first position, on top if linear layout.

I know about .addView(View, index), and with index=0 it will work, BUT it works with Views only, not Fragment.newInstance()
I also tried to change in layout xml:

```<code>android:gravity="bottom"
</code>```

doesn't do trick
I also heared that 'wraping' fragment with View can do trick using .addView instead of .add.
But is there more clean way to do this?

Here xml of fragments that are being added:

```<code>    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/check_template"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:animateLayoutChanges="true"
    tools:context=".CheckTemplateFragment">

    <TextView
        android:id="@+id/btn_expand"
        android:layout_width="40dp"

        android:layout_height="40dp"
        android:layout_alignParentEnd="true"
        android:foreground="@drawable/button_expand" />

    <TextView
        android:id="@+id/check_date"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_alignParentStart="true"
        android:layout_toStartOf="@+id/btn_expand" />

    <WebView
        android:id="@+id/check_extra"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn_expand"
        android:background="@color/teal_200"/>
</RelativeLayout>
</code>```

I'm using fragment cause i need handle button onClick:

```<code>btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                isExpanded = !isExpanded;
                if(isExpanded){
                    extra.setVisibility(View.VISIBLE);
                    btn.startAnimation(anim_rot_cw);
                }
                else {
                    extra.setVisibility(View.GONE);
                    btn.startAnimation(anim_rot_ccw);
                }
            }
        });
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a fragment containing LinearLayout, where programmaticaly added fragments using:

getFragmentManager().beginTransaction().add(R.id.linear_layout, CheckTemplateFragment.newInstance(*params*).commit();

And it filling linear layout from Top to Bottom, but I need it in reverse, Bottom to Top, aka adding new Fragment to first position, on top if linear layout.

I know about .addView(View, index), and with index=0 it will work, BUT it works with Views only, not Fragment.newInstance()
I also tried to change in layout xml:

android:gravity="bottom"

doesn't do trick
I also heared that 'wraping' fragment with View can do trick using .addView instead of .add.
But is there more clean way to do this?

Here xml of fragments that are being added:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/check_template"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:animateLayoutChanges="true"
    tools:context=".CheckTemplateFragment">

    <TextView
        android:id="@+id/btn_expand"
        android:layout_width="40dp"

        android:layout_height="40dp"
        android:layout_alignParentEnd="true"
        android:foreground="@drawable/button_expand" />

    <TextView
        android:id="@+id/check_date"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_alignParentStart="true"
        android:layout_toStartOf="@+id/btn_expand" />

    <WebView
        android:id="@+id/check_extra"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn_expand"
        android:background="@color/teal_200"/>
</RelativeLayout>

I'm using fragment cause i need handle button onClick:

btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                isExpanded = !isExpanded;
                if(isExpanded){
                    extra.setVisibility(View.VISIBLE);
                    btn.startAnimation(anim_rot_cw);
                }
                else {
                    extra.setVisibility(View.GONE);
                    btn.startAnimation(anim_rot_ccw);
                }
            }
        });


问:
Instantiate object from browserify-bundled NPM package in JavaScriptCore in Swift
I have bundled up an NPM package using Browserify. Then, I import it into Swift

```<code> guard let npmPackage = Bundle.main.path(forResource: "mynpmpackage", ofType: "js") else {
            print("Unable to read resource file")
            return nil
}

npmContent = try String(contentsOfFile: npmPackage, encoding: String.Encoding.utf8)

let jsSource = "var window = this; \(npmContent)"
// I also tried executing npmContent directly below:
context?.evaluateScript(jsSource)

</code>```

Then I want to create an instance of the NPM object, would I need to pass it into the Javascriptcore function?

I don't seem to be able to access the browserify bundled objects, how can I create an instance?

```<code>    let jsCode =
"""
async function lookupDataUsingNPMPackage(myaddress, callback, alc) {
            try {
                const config = {
                  apiKey: "myapikey",
                  network: "mynetwork",
                };
                const myInstance = new mynpmpackage(config);
                console.log("hola")
                const { data } = await fetch(myInstance.data.getDataForOwner(myaddress));
                callback(data)
            } catch (error) {
                console.log( error);
            }
        };
    """
</code>```

Body:
I have bundled up an NPM package using Browserify. Then, I import it into Swift

 guard let npmPackage = Bundle.main.path(forResource: "mynpmpackage", ofType: "js") else {
            print("Unable to read resource file")
            return nil
}

npmContent = try String(contentsOfFile: npmPackage, encoding: String.Encoding.utf8)

let jsSource = "var window = this; \(npmContent)"
// I also tried executing npmContent directly below:
context?.evaluateScript(jsSource)

Then I want to create an instance of the NPM object, would I need to pass it into the Javascriptcore function?

I don't seem to be able to access the browserify bundled objects, how can I create an instance?

    let jsCode =
"""
async function lookupDataUsingNPMPackage(myaddress, callback, alc) {
            try {
                const config = {
                  apiKey: "myapikey",
                  network: "mynetwork",
                };
                const myInstance = new mynpmpackage(config);
                console.log("hola")
                const { data } = await fetch(myInstance.data.getDataForOwner(myaddress));
                callback(data)
            } catch (error) {
                console.log( error);
            }
        };
    """


问:
Ussd Post Request Keeps Giving Me Array To String Conversions Errors in postman
Route

```<code>Route::group(['prefix' => 'ussd'], function () {
        Route::post('/index', 'UssdController@index');
    });
</code>```

Controller

```<code>public function index(Request $request)
    {

I need to read the incoming post request and then store the session id against the msisdn
        $input = $request->all();

//         Read incoming data
        $ussd_id = $request->input('USERID');
        $msisdn = $request->input('MSISDN');
        $user_data = $request->input('USERDATA');
        $msgtype = $request->input('USERDATA');
        $id = Session::setId($msisdn);

        // Start session for the incoming request
        Session::start();
    }
</code>```

I have tried all i can think off but to no avail. I am new to Laravel and USSD as well

Body:
Route

Route::group(['prefix' => 'ussd'], function () {
        Route::post('/index', 'UssdController@index');
    });

Controller

public function index(Request $request)
    {

I need to read the incoming post request and then store the session id against the msisdn
        $input = $request->all();

//         Read incoming data
        $ussd_id = $request->input('USERID');
        $msisdn = $request->input('MSISDN');
        $user_data = $request->input('USERDATA');
        $msgtype = $request->input('USERDATA');
        $id = Session::setId($msisdn);

        // Start session for the incoming request
        Session::start();
    }

I have tried all i can think off but to no avail. I am new to Laravel and USSD as well


问:
How extract "Packet Bytes" of layer TLS from a pcap file using scapy / pyshark
I am trying to extract a specific data from the pcap
I want extract the packet byte of verify data in finished

enter image description here

I tried to do it with scapy

```<code>traffic = rdpcap("pcap/rene.pcap")
var = TLS(traffic[7].load)
hexdump(bytes(var))
and I got the byte of TCP layer
</code>```

I tried to do that also with pyshark:

```<code>Client_Key_Exchange = []
cap = pyshark.FileCapture('pcap/rene.pcap')
for pkt in cap:
  if "Client Key Exchange" in pkt.tls.handshake:
     Client_Key_Exchange.append(pkt)
</code>```

and somehow the line of verify data not apprear when I analanze the pcap.
enter image description here

```<code>

I need the packet byte of verify data for investigating

Can you please help me how can I do this?
</code>```

Body:
I am trying to extract a specific data from the pcap
I want extract the packet byte of verify data in finished

enter image description here

I tried to do it with scapy

traffic = rdpcap("pcap/rene.pcap")
var = TLS(traffic[7].load)
hexdump(bytes(var))
and I got the byte of TCP layer

I tried to do that also with pyshark:

Client_Key_Exchange = []
cap = pyshark.FileCapture('pcap/rene.pcap')
for pkt in cap:
  if "Client Key Exchange" in pkt.tls.handshake:
     Client_Key_Exchange.append(pkt)

and somehow the line of verify data not apprear when I analanze the pcap.
enter image description here

I need the packet byte of verify data for investigating

Can you please help me how can I do this?


问:
MVC who should pass parent view to the child in GUI?
I am trying to implement an application where i need the GUI framework to be easily swappable, so i decided to use a model-view-controller approach, and to keep the controller unchanged when swapping the view component, i decided to make the view responsible for contacting whatever GUI framework is used (tkinter,QT,web), the design is summarized in the image below.

Since the view element of the parent and the child will be created separately, they will need to be linked in order to be rendered, and the component that links them needs to know about both the parent and the child's view objects and how they work, so whose responsibility is it to link them ?

The code looks as following, using Pyside2 as an example, the locations where the parent gui can be linked to the child is all commented out.

```<code>from PySide2.QtWidgets import QWidget

class parentView:
    def __init__(self):
        self.gui = QWidget()
        # framework specific code to initialize layout
    def add_child(self,child):
        pass
        # child.gui.parent = self.gui
        # child.parent = self.gui

class parent_controller:
    def __init__(self):
        self.view = parentView()
        self.gui = QWidget()
        self.child = child_controller(self)
        # self.child.view.gui.parent = self.view.gui ?
        # self.view.add_child(self.child.view.gui) ?
        # self.view.add_child(self.child.view) ?

class childView:
    def __init__(self, controller):
        self.controller = controller
        self.gui = QWidget()  # QWdiget(self.parent.view.gui) ?
        # self.gui.parent = self.parent.view.gui ?

class child_controller:
    def __init__(self, parent):
        self.parent = parent
        self.view = childView(self)
        # self.view.gui.parent = self.parent.parent.view.gui ?
</code>```

Creating the link in the parent view makes sense to me as i can make it do a framework-specific logic when the framework is changed, but i wanted to know what is best in terms of ease of use and maintainability, as i think i am creating too many objects.

Body:
I am trying to implement an application where i need the GUI framework to be easily swappable, so i decided to use a model-view-controller approach, and to keep the controller unchanged when swapping the view component, i decided to make the view responsible for contacting whatever GUI framework is used (tkinter,QT,web), the design is summarized in the image below.

Since the view element of the parent and the child will be created separately, they will need to be linked in order to be rendered, and the component that links them needs to know about both the parent and the child's view objects and how they work, so whose responsibility is it to link them ?

The code looks as following, using Pyside2 as an example, the locations where the parent gui can be linked to the child is all commented out.

from PySide2.QtWidgets import QWidget

class parentView:
    def __init__(self):
        self.gui = QWidget()
        # framework specific code to initialize layout
    def add_child(self,child):
        pass
        # child.gui.parent = self.gui
        # child.parent = self.gui

class parent_controller:
    def __init__(self):
        self.view = parentView()
        self.gui = QWidget()
        self.child = child_controller(self)
        # self.child.view.gui.parent = self.view.gui ?
        # self.view.add_child(self.child.view.gui) ?
        # self.view.add_child(self.child.view) ?

class childView:
    def __init__(self, controller):
        self.controller = controller
        self.gui = QWidget()  # QWdiget(self.parent.view.gui) ?
        # self.gui.parent = self.parent.view.gui ?

class child_controller:
    def __init__(self, parent):
        self.parent = parent
        self.view = childView(self)
        # self.view.gui.parent = self.parent.parent.view.gui ?

Creating the link in the parent view makes sense to me as i can make it do a framework-specific logic when the framework is changed, but i wanted to know what is best in terms of ease of use and maintainability, as i think i am creating too many objects.


问:
Woocommerce - Custom Hook at "Place Order" Button
Sup hommies! I've been trying to make a "custom" verification on my checkout page in WooCommerce. To be honest i don't have lot of experience on PHP, but i have a good sigh about.

I've tried to make a simple custom hook using "woocommerce_checkout_order_processed" (during my search this one turned out to be the best option, like, if i'm not wrong this fuction is the first one to be executed after click at Place Order Button, please feel free to fix me if i'm wrong ).

And after it my custom function "unlogged_user_checkout_authenticator" gonna check if my user is logged, if not i'll open my Login/Sign Up modal (Id=640). But unfort didn't work =/

Someone could give me a light about what i've made wrong? Thank you so much guys <3

```<code>add_action( 'woocommerce_checkout_order_processed', 'unlogged_user_checkout_authenticator' );
function unlogged_user_checkout_authenticator() {
    if ( is_checkout() && ! is_user_logged_in() ) {
        ElementorPro\Modules\Popup\Module::add_popup_to_location( '640' ); // 234 is the popup id
        exit();
    }
}
</code>```
```<code></code>```

Body:
Sup hommies! I've been trying to make a "custom" verification on my checkout page in WooCommerce. To be honest i don't have lot of experience on PHP, but i have a good sigh about.

I've tried to make a simple custom hook using "woocommerce_checkout_order_processed" (during my search this one turned out to be the best option, like, if i'm not wrong this fuction is the first one to be executed after click at Place Order Button, please feel free to fix me if i'm wrong ).

And after it my custom function "unlogged_user_checkout_authenticator" gonna check if my user is logged, if not i'll open my Login/Sign Up modal (Id=640). But unfort didn't work =/

Someone could give me a light about what i've made wrong? Thank you so much guys <3

add_action( 'woocommerce_checkout_order_processed', 'unlogged_user_checkout_authenticator' );
function unlogged_user_checkout_authenticator() {
    if ( is_checkout() && ! is_user_logged_in() ) {
        ElementorPro\Modules\Popup\Module::add_popup_to_location( '640' ); // 234 is the popup id
        exit();
    }
}


问:
math equation to take variable and use it to mark up price when form switch is on
I have an online site I am building, but it is just for when we are in-store only rn. and I want to give the original price a mark-up of 2% of the actual price for when the customer sees it so they can see the actual price they will be paying. I want it to be set up to a form switch. but there may be a better way but I am unsure right now. I have the javascript that is able to get all of the prices for the items but I just don't know how to get it to have those prices be set to a new price when the form switch is on. Do i need to create a new const or function outside of this const renderQuantity or can i create it inside of it. and for either one how can i get it going?</p>
```<code><script>

 // const quantity = data.price_size.filter((item) => {
 //   return item.colorName === selectedColor
 // })
 // console.log("quantity", quantity)

 const SIZE = ['XS', 'S', 'M', 'L', 'XL', '2XL', '3XL', '4XL', '5XL', '6XL']
 const renderQuantity = () => {
//     let formSwitch = false;

// useEffect(() => {
//   document.getElementById("formSwitch").addEventListener("change", function() {
//     formSwitch = !formSwitch;
//     if (formSwitch) {
//       document.getElementById("itemPrice").innerHTML = `${item.price * 1.3}`;
//     } else {
//       document.getElementById("itemPrice").innerHTML = `${this.dataset.price}`;
//     }
//   });
// }, []);
   // console.log(data.size_quantity)
   return data.price_size.map((item, index) => {
     // console.log("selectedcolor", selectedColor)
     let count = item.size_quantity
     // console.log(count, "count")
     // console.log("ddssdsf", selectedColor, item.colorName)
     if (item.colorName === selectedColor && item.colorName !== "") {
       let k = 0;
       if (item.newArray[0].size !== 'OSFA' && item.newArray[0].size !== 'CUSTOM') {
         for (let i = 0; i < SIZE.length; i++) {
           for (let j = 0; j < item.newArray.length; j++) {
             if (item.newArray[j].size === SIZE[i]) {
               let temp = item.newArray[j]
               item.newArray[j] = item.newArray[k]
               item.newArray[k] = temp
               k++;
             }
           }
         }

         if (!productCost) {
           setProductCost(item.newArray[0].price)
         }
         if (!selectedQuantitySize) {
           setQuantitySize(item.newArray[0].size)
         }
         return (
           item.newArray.map((item, index) => {
             const isLastSize = item.length
             return (
               <>

                 <li

                   style={{

                     textAlign: 'center',
                   }}
                   key={item.size}>
                   <div className={classnames('d-inline-block setSize', {
                     'me-25 ': !isLastSize,
                     quantity_active: selectedQuantitySize ? item.size == selectedQuantitySize : item.size == data.price_size[0].newArray[0].size
                   })}

                     onClick={() => { selectedQuanity(item.size); setProductCost(item.price) }}>
                     <strong>{item.size}</strong></div>
                   <div key={item.count}><strong>{count.map((c) => {
                     return c.size === item.size ? c.count : ""
                   })}</strong></div>
                   <div key={item.price} style={{ paddingTop: '6px' }}><strong>{item.price}</strong></div>

                 </li>
               </>
             )

           })
         )
       }
       else {
         const isLastSize = '1'
         if (!productCost) {
           setProductCost(item.newArray[0].price)
         }
         if (!selectedQuantitySize) {
           setQuantitySize(item.newArray[0].size)
         }
         return (
           <>

             <li

               style={{

                 textAlign: 'center',

               }}
               key={item.newArray[0].size}>
               <div className={classnames('d-inline-block setSize', {
                 'me-25 ': !isLastSize,
                 quantity_active: selectedQuantitySize ? item.newArray[0].size == selectedQuantitySize : item.newArray[0].size == data.price_size[0].newArray[0].size
               })}

                 onClick={() => { selectedQuanity(item.newArray[0].size); setProductCost(item.newArray[0].price) }}>
                 <strong>{item.newArray[0].size}</strong></div>
               <div key={item.newArray[0].count}><strong>{count.map((c) => {
                 return c.size === item.newArray[0].size ? c.count : ""
               })}</strong></div>
               <div key={item.newArray[0].price} style={{ paddingTop: '6px'}}><strong>{item.newArray[0].price}</strong></div>

             </li>
           </>
         )
       }
     }
     else if (item.colorName === "" && item.newArray.size === "OSFA" || item.newArray.size === "CUSTOM") {
       const isLastSize = '1'
       if (!productCost) {
         setProductCost(item.newArray.price)
       }
       if (!selectedQuantitySize) {
         setQuantitySize(item.newArray.size)
       }
       return (
         <>

           <li

             style={{

               textAlign: 'center',
             }}
             key={item.newArray.size}>
             <div className={classnames('d-inline-block setSize', {
               'me-25 ': !isLastSize,
               quantity_active: selectedQuantitySize ? item.newArray.size == selectedQuantitySize : item.newArray.size == data.price_size[0].newArray.size
             })}

               onClick={() => { selectedQuanity(item.newArray.size); setProductCost(item.newArray.price) }}>
               <strong>{item.newArray.size}</strong></div>
             <div key={item.newArray.count}><strong>{count.map((c) => {
               return c.size === item.newArray.size ? c.count : ""
             })}</strong></div>
             <div key={item.newArray.price} style={{ paddingTop: '6px' }}><strong>{item.newArray.price}</strong></div>

           </li>
         </>
       )
     }
   })
     ;

 }

</script>

<div class="form-check form-switch">
 <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault"></input>
 <label class="form-check-label" for="flexSwitchCheckDefault">Default switch checkbox input</label>
</div>
</code>```

Body:
I have an online site I am building, but it is just for when we are in-store only rn. and I want to give the original price a mark-up of 2% of the actual price for when the customer sees it so they can see the actual price they will be paying. I want it to be set up to a form switch. but there may be a better way but I am unsure right now. I have the javascript that is able to get all of the prices for the items but I just don't know how to get it to have those prices be set to a new price when the form switch is on. Do i need to create a new const or function outside of this const renderQuantity or can i create it inside of it. and for either one how can i get it going?

 <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault"></input>
 Default switch checkbox input


问:
Is there a package for Abp.Application.Services.Dto for use in Shared class libraries?
I am trying to create a shared class library to be used by my front-end (MAUI / Blazor) and my back-end API in aspnetboilerplate.

I want the shared library to be as light as possible and was wondering if there was a standalone package for the Abp.Application.Services.Dtos namespace?


问:
jquery stop execution until image is loaded
Created a progress bar to show the progress of images uploaded to a browser. It progresses before the image has been completely uploaded. Can't seem to figure this one out.  Any ideas?

  var total_files = document.getElementById("files").files.length;
  var blobs = new Blob([]);

  for (var i = 0; i < total_files; i++) {
     blobs[i] = URL.createObjectURL(event.target.files[i]);
  }
     var $iframe = $('#image_preview');
     var step = parseFloat($("#progressbar_background").css("width")) / total_files;

     var idss = "";
     var newStep = step;
     var img = new Image;
     for (var i = 0; i < total_files; i++) {

        if (i == 0) {
           img = "";
           $iframe.contents().find("body").append(img);
           idss = "#image" + parseInt(i);
        }

        $iframe.contents().find("body").find(idss).promise().done(function () {
         $('#progressbar_foreground').css("width", newStep.toString());
            newStep = newStep + step;
           img = "";
           $iframe.contents().find("body").append(img);

           idss = "#image" + parseInt(i);
    });
                       ```


问:
MPI: How to use MPI_Reduce for several communicators independently?
I am trying to apply MPI_Reduce with MPI_SUM operation.
There are 12 processes. Using MPI_Comm_split I get 4 communicators by 3 processes.

Each process produces a value and sends the result to all other processes in the group. As a result, it is necessary to find the sum of the values for each group.

My code:

```<code>#include <iostream>
#include <cstdlib>
#include "mpi.h"

using namespace std;
int main(int argc, char** argv)
{
    int sum_score, player_score;

    MPI_Status status;
    MPI_Init(&argc, &argv);

    int world_rank, world_size;
    MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &world_size);

    int players = world_rank / 4;
    MPI_Comm team_comm;
    MPI_Comm_split(MPI_COMM_WORLD, players, world_rank, &team_comm);

    int team_rank, team_size;
    MPI_Comm_rank(team_comm, &team_rank);
    MPI_Comm_size(team_comm, &team_size);

    std::srand(world_rank);
    player_score = team_rank+1; // Some value

    printf("Team %d, player %2d, score %d \n", team_rank + 1, world_rank + 1, player_score);

    for (int i=0; i<world_size;++i) {
        MPI_Reduce(&player_score, &sum_score, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
    }

    if (world_rank == 0)
        cout << "Sum " << sum_score << endl;

    MPI_Comm_free(&team_comm);
    MPI_Finalize();

    return 0;
}
</code>```

I've tried many useless fors and ifs. And used MPI_Reduce as

```<code>MPI_Reduce(&player_score, &sum_score, 1, MPI_INT, MPI_SUM, team_rank, team_comm);
</code>```

But for now, it's only possible to summarize the results of all processes, not separately by groups.

What needs to be done to summarize the values within each group separately?
I expect:

```<code>Team 1: sum 11
Team 2: sum 26
Team 3: sum 24
Team 4: sum 28
</code>```

My console for now:

```<code>mpiexec -np 12 Project1.exe
Team 1, player  1, score 1
Sum 30
Team 3, player  3, score 3
Team 2, player  6, score 2
Team 1, player  5, score 1
Team 2, player 10, score 2
Team 2, player  2, score 2
Team 4, player  4, score 4
Team 3, player 11, score 3
Team 1, player  9, score 1
Team 4, player  8, score 4
Team 4, player 12, score 4
Team 3, player  7, score 3
</code>```

Body:
I am trying to apply MPI_Reduce with MPI_SUM operation.
There are 12 processes. Using MPI_Comm_split I get 4 communicators by 3 processes.

Each process produces a value and sends the result to all other processes in the group. As a result, it is necessary to find the sum of the values for each group.

My code:

#include <iostream>
#include <cstdlib>
#include "mpi.h"

using namespace std;
int main(int argc, char** argv)
{
    int sum_score, player_score;

    MPI_Status status;
    MPI_Init(&argc, &argv);

    int world_rank, world_size;
    MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &world_size);

    int players = world_rank / 4;
    MPI_Comm team_comm;
    MPI_Comm_split(MPI_COMM_WORLD, players, world_rank, &team_comm);

    int team_rank, team_size;
    MPI_Comm_rank(team_comm, &team_rank);
    MPI_Comm_size(team_comm, &team_size);

    std::srand(world_rank);
    player_score = team_rank+1; // Some value

    printf("Team %d, player %2d, score %d \n", team_rank + 1, world_rank + 1, player_score);

    for (int i=0; i<world_size;++i) {
        MPI_Reduce(&player_score, &sum_score, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
    }

    if (world_rank == 0)
        cout << "Sum " << sum_score << endl;

    MPI_Comm_free(&team_comm);
    MPI_Finalize();

    return 0;
}

I've tried many useless fors and ifs. And used MPI_Reduce as

MPI_Reduce(&player_score, &sum_score, 1, MPI_INT, MPI_SUM, team_rank, team_comm);

But for now, it's only possible to summarize the results of all processes, not separately by groups.

What needs to be done to summarize the values within each group separately?
I expect:

Team 1: sum 11
Team 2: sum 26
Team 3: sum 24
Team 4: sum 28

My console for now:

mpiexec -np 12 Project1.exe
Team 1, player  1, score 1
Sum 30
Team 3, player  3, score 3
Team 2, player  6, score 2
Team 1, player  5, score 1
Team 2, player 10, score 2
Team 2, player  2, score 2
Team 4, player  4, score 4
Team 3, player 11, score 3
Team 1, player  9, score 1
Team 4, player  8, score 4
Team 4, player 12, score 4
Team 3, player  7, score 3


问:
How to detect collision?
I’m doing a maze where I need to detect a collisions of the balloon and the walls.The maze is created in tkinter. I created the walls with c.create_line. And I have no idea how to write the code for the collision since I have 70 walls.

I’ve tried giving the walls tags and if the balloon==walls it would restart but nothing happens.

Title: How to detect collision?


问:
Number of nodes in segment tree
I'm just wondering how many nodes can be in segment tree. I know there is formula for it and it is: 2n-1. But for example if we have 5 data in a segment tree will there be 9 nodes in the tree or 15? So following that example whether the total number of members of the segment tree is equal to the binary sequence or not?

Title: Number of nodes in segment tree


问:
Xcode Debug: cannot find 'imageURL' in scope when I can see imageURL in the variable list

I have been scratching my head for an hour, still cannot figure out why this happens.

Also same issue with string variables defined inside if statements (holdCountString, copyCountString, isbn, upc)

I have tried cleaning build folder, cleaning Xcode cache, restart the computer, and reopen Xcode, however, the debugger still says "cannot find 'imageURL' in scope".

```<code>    static func newSearchResult(from record: SwiftSoup.Element) async throws -> SearchResult? {
        let title = try record.select(CSSSelector.title.rawValue).text()
        let author = try record.select(CSSSelector.author.rawValue).text()

        let typeString = try record.select(CSSSelector.type.rawValue).text()
        let type = ItemType(rawValue: typeString)

        if type == nil {
            return nil
        }

        var releaseYear = try record.select(CSSSelector.releaseYear.rawValue).text()
        if releaseYear.last == "." { releaseYear.removeLast() }

        let description = try record.select(CSSSelector.description.rawValue).text()
        let itemRelativePath = try record.select(CSSSelector.itemRelativePath.rawValue).attr(AttributeKey.href.rawValue)

        var holdCount = 0
        var copyCount = 0

        var imageURL: URL? = nil
        let sizeCode = try record.select(CSSSelector.mainImage.rawValue).attr(AttributeKey.imageSizeCode.rawValue)

        if type == .ebook {
            let overdriveID = try record.select(CSSSelector.overdriveImage.rawValue).attr(AttributeKey.overdriveID.rawValue)

            let availability = try await overdriveAvailability(forID: overdriveID)
            holdCount = availability.holdCount
            copyCount = availability.copyCount

            let overdriveImage = try await overdriveCoverImage(forID: overdriveID)
            imageURL = URL(string: overdriveImage.src)

        } else if type != .elearning && type != .evideo {
            let holdCountString = try record.select(CSSSelector.holdCount.rawValue).text()
            if holdCountString != "" { holdCount = Int(holdCountString.split(separator: " ")[0])! }

            let copyCountString = try record.select(CSSSelector.copyCount.rawValue).text()
            if copyCountString != "" { copyCount = Int(copyCountString.split(separator: " ")[0])! }

            let isbn = try record.select(CSSSelector.mainImage.rawValue).attr(AttributeKey.isbn.rawValue)
            let upc = try record.select(CSSSelector.mainImage.rawValue).attr(AttributeKey.upc.rawValue)

            imageURL = TPLAPI.syndeticsImageURL(usingISBN: isbn, orUPC: upc, withSizeCode: sizeCode)
        }

        return SearchResult(
            imageURL: imageURL, title: title, author: author,
            type: type!, releaseYear: releaseYear,
            description: description, copyCount: copyCount,
            holdCount: holdCount, itemRelativePath: itemRelativePath
        )
    }
</code>```

newSearchResult(from:) is called inside another function searchResults(for:) which is in charge of downloading a HTML file, then processing it using SwiftSoup to extract all the container elements for every search result, then use newSearchResult(from:) to process each container element. Both functions are asynchronous.

the search view uses the following code to call searchResults(for:):

```<code>.onSubmit {
    Task {
        do {
            showProgressView.toggle()

            print("task started running for input: \(input)")

            searchResults = try await TPLAPI.searchResults(for: input)
            showProgressView.toggle()
        } catch {
            print(error.localizedDescription)
        }
    }
}
</code>```

Body:
I have been scratching my head for an hour, still cannot figure out why this happens.

Also same issue with string variables defined inside if statements (holdCountString, copyCountString, isbn, upc)

I have tried cleaning build folder, cleaning Xcode cache, restart the computer, and reopen Xcode, however, the debugger still says "cannot find 'imageURL' in scope".

    static func newSearchResult(from record: SwiftSoup.Element) async throws -> SearchResult? {
        let title = try record.select(CSSSelector.title.rawValue).text()
        let author = try record.select(CSSSelector.author.rawValue).text()

        let typeString = try record.select(CSSSelector.type.rawValue).text()
        let type = ItemType(rawValue: typeString)

        if type == nil {
            return nil
        }

        var releaseYear = try record.select(CSSSelector.releaseYear.rawValue).text()
        if releaseYear.last == "." { releaseYear.removeLast() }

        let description = try record.select(CSSSelector.description.rawValue).text()
        let itemRelativePath = try record.select(CSSSelector.itemRelativePath.rawValue).attr(AttributeKey.href.rawValue)

        var holdCount = 0
        var copyCount = 0

        var imageURL: URL? = nil
        let sizeCode = try record.select(CSSSelector.mainImage.rawValue).attr(AttributeKey.imageSizeCode.rawValue)

        if type == .ebook {
            let overdriveID = try record.select(CSSSelector.overdriveImage.rawValue).attr(AttributeKey.overdriveID.rawValue)

            let availability = try await overdriveAvailability(forID: overdriveID)
            holdCount = availability.holdCount
            copyCount = availability.copyCount

            let overdriveImage = try await overdriveCoverImage(forID: overdriveID)
            imageURL = URL(string: overdriveImage.src)

        } else if type != .elearning && type != .evideo {
            let holdCountString = try record.select(CSSSelector.holdCount.rawValue).text()
            if holdCountString != "" { holdCount = Int(holdCountString.split(separator: " ")[0])! }

            let copyCountString = try record.select(CSSSelector.copyCount.rawValue).text()
            if copyCountString != "" { copyCount = Int(copyCountString.split(separator: " ")[0])! }

            let isbn = try record.select(CSSSelector.mainImage.rawValue).attr(AttributeKey.isbn.rawValue)
            let upc = try record.select(CSSSelector.mainImage.rawValue).attr(AttributeKey.upc.rawValue)

            imageURL = TPLAPI.syndeticsImageURL(usingISBN: isbn, orUPC: upc, withSizeCode: sizeCode)
        }

        return SearchResult(
            imageURL: imageURL, title: title, author: author,
            type: type!, releaseYear: releaseYear,
            description: description, copyCount: copyCount,
            holdCount: holdCount, itemRelativePath: itemRelativePath
        )
    }

newSearchResult(from:) is called inside another function searchResults(for:) which is in charge of downloading a HTML file, then processing it using SwiftSoup to extract all the container elements for every search result, then use newSearchResult(from:) to process each container element. Both functions are asynchronous.

the search view uses the following code to call searchResults(for:):

.onSubmit {
    Task {
        do {
            showProgressView.toggle()

            print("task started running for input: \(input)")

            searchResults = try await TPLAPI.searchResults(for: input)
            showProgressView.toggle()
        } catch {
            print(error.localizedDescription)
        }
    }
}


问:
How to get a personal LinkedIn Posting with the shareUrn?
I have built an automation that posts my LinkedIn posts from an Airtable to LinkedIn.

After posting, I want to write the URL from the post to the table.

It seems like I can't build the URL together with the POST ID. Instead, I guess it's necessary to make a GET request with the ID to hopefully get the URL with it.

When I make a LinkedIn API call with make.com, I use the following endpoint GET https://api.linkedin.com/rest/posts/{encoded ugcPostUrn|shareUrn}

I used this documentation: Get Posts by URN

Unfortunately, I always get the following error message from make.com:

403: Accessing the UGC resource is forbidden. Please check your
permissions for this resource

I don't understand why the API forbids me access here?

In the documentation I found the above API call under "Page Management" could this be the problem? Since this is a personal posting?

Do you know how I solve my use case for personal posting?


问:
Change refresh rate of wall screen/home screen on android
I am currently making custom widgets for my android device to customize my home screen. I tried to add a digital clock that included seconds and it would only refresh every 20-30 seconds. I thought it was an issue with the widget app I was using (KWGT), but upon looking at their forums, I realized it was an android issue. I'm okay with rooting my device, but I don't know the next step here. I'd like to have my widgets updated once a second while I'm looking at the home page. Any help is welcome.</p>


问:
wp_head not injecting css (wordpress)
I'm trying to inject a style.css script into my front-page.php. I am able to load front-page's content by not link the style.css.

When you inspect page source, all the CSS should be there, but it simply shows the wp_head() script without injecting anything.

My functions.php, front-page.php, and style.css are all in the same root directory.

front-page.php

```<code>     <head>
        <php?
            wp_head();
        ?>
    </head>
</code>```

**
Edited the functions.php file**

```<code>    <?php

        function load_scripts(){
            wp_enqueue_style('style', './style.css' );
        }

        add_action( 'wp_enqueue_scripts', 'load_scripts');
    ?>
</code>```

Added <php? wp_head(); ?> to the front-page.php in the head tag.

```<code>    <head>
        <php? wp_head(); ?>
    </head>
</code>```

style.css sheet

```<code>/*
Theme Name: InfluencerSite
Text Domain: InfluencerSite
Version: 1.0
Description: Fancy stuff
Tags: left-sidebar, responsive, fancy
Author: Shawn Esquivel
Author URI: github.com/shawnesquivel
*/

.testing {
  color: red;
}

</code>```

Other Things I tried adding into the functions.php script

```<code>    wp_enqueue_style('anydescription', get_stylesheet_uri(), array(), "1.0", 'all');

    wp_enqueue_style('any-style-name', get_stylesheet_uri());

    wp_enqueue_style("style", get_template_directory_uri() . "./style.css");
</code>```

Title: wp_head not injecting css (wordpress)

Body:
I'm trying to inject a style.css script into my front-page.php. I am able to load front-page's content by not link the style.css.

When you inspect page source, all the CSS should be there, but it simply shows the wp_head() script without injecting anything.

My functions.php, front-page.php, and style.css are all in the same root directory.

front-page.php

        <php?
            wp_head();
        ?>

**
Edited the functions.php file**

    <?php

        function load_scripts(){
            wp_enqueue_style('style', './style.css' );
        }

        add_action( 'wp_enqueue_scripts', 'load_scripts');
    ?>

Added <php? wp_head(); ?> to the front-page.php in the head tag.

        <php? wp_head(); ?>

style.css sheet

/*
Theme Name: InfluencerSite
Text Domain: InfluencerSite
Version: 1.0
Description: Fancy stuff
Tags: left-sidebar, responsive, fancy
Author: Shawn Esquivel
Author URI: github.com/shawnesquivel
*/

.testing {
  color: red;
}

Other Things I tried adding into the functions.php script

    wp_enqueue_style('anydescription', get_stylesheet_uri(), array(), "1.0", 'all');

    wp_enqueue_style('any-style-name', get_stylesheet_uri());

    wp_enqueue_style("style", get_template_directory_uri() . "./style.css");


问:
Python : Error on getting List of 8 Highest (max value) Elements from an Array
I've applied a logistic regression model on my dataset in Python, I'm predicting on the train set, to achieve a list of 8 elements that have the maximum value from that array. I've applied a sort method to get all the values in the descending order to achieve this but I get an error on the key keyword.

Any help would be appreciated. I've attached photos of my data frame as well as the code.

 Photo : Data Frame

 Photo : Array of values predicted by the Model

 Photo : Sorted Values

```<code>x= df[['Hour','Minute','Seconds','Month','Year']]
y= df['Target']

xtrain, xtest, ytrain, ytest = train_test_split(x,y,test_size=0.20,random_state=10,
shuffle=True)

from sklearn.linear_model import LogisticRegression
lr = LogisticRegression()
lr.fit(xtrain , ytrain)
predicting=lr.predict_proba(xtrain)
predicting[0,:]
predicting.sort()

arr = predicting
arr.sort(key=lambda x:x[0,:],reverse=True)
</code>```

Body:
I've applied a logistic regression model on my dataset in Python, I'm predicting on the train set, to achieve a list of 8 elements that have the maximum value from that array. I've applied a sort method to get all the values in the descending order to achieve this but I get an error on the key keyword.

Any help would be appreciated. I've attached photos of my data frame as well as the code.

 Photo : Data Frame

 Photo : Array of values predicted by the Model

 Photo : Sorted Values

x= df[['Hour','Minute','Seconds','Month','Year']]
y= df['Target']

xtrain, xtest, ytrain, ytest = train_test_split(x,y,test_size=0.20,random_state=10,
shuffle=True)

from sklearn.linear_model import LogisticRegression
lr = LogisticRegression()
lr.fit(xtrain , ytrain)
predicting=lr.predict_proba(xtrain)
predicting[0,:]
predicting.sort()

arr = predicting
arr.sort(key=lambda x:x[0,:],reverse=True)


问:
How to load different images inside very grid view in flutter?
```<code>import 'package:ecommerce_app/screens/home/item_details.dart';
import 'package:flutter/material.dart';

import 'catalog.dart';

class GridItems extends StatelessWidget {
  const GridItems({super.key});

  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: GridView.builder(
        itemCount: items.length,
        shrinkWrap: true,
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 2,
        ),
        itemBuilder: (context, index) {
          return InkWell(
              onTap: () {
                Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) => ItemDetails(Item: items[index]),
                    ));
              },
              child: Padding(
                padding: const EdgeInsets.only(right: 15.0),
                child: Container(
                  margin: const EdgeInsets.all(10),
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(15),
                      color: items[index].color,
                      boxShadow: const [
                        BoxShadow(
                            color: Colors.black,
                            blurRadius: 4,
                            spreadRadius: 2),
                      ]),
                  child: Padding(
                    padding: const EdgeInsets.all(10.0),
                    child: Column(
                      children: [
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text(
                              items[index].detail,
                              style: const TextStyle(
                                  fontFamily: 'Anton',
                                  fontWeight: FontWeight.bold),
                            ),
                            const Icon(
                              Icons.favorite,
                              color: Color.fromARGB(255, 247, 101, 90),
                            )
                          ],
                        ),
                        const Padding(padding: EdgeInsets.all(10)),
                        InkWell(
                          onTap: () {},
                          child: Image.asset(
                            items[index].image,
                            height: 100,
                            width: 100,
                          ),
                        ),
                        const SizedBox(
                          height: 8,
                        ),
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text(items[index].title,
                                style: const TextStyle(
                                    fontFamily: 'Anton',
                                    fontWeight: FontWeight.bold)),
                            const Text('\$100',
                                style: TextStyle(
                                  fontFamily: 'SecularOne',
                                )),
                          ],
                        ),
                      ],
                    ),
                  ),
                ),
              ));
        },
      ),
    );
  }
}

</code>```
```<code>import 'package:ecommerce_app/screens/home/grid/catalog.dart';
import 'package:flutter/material.dart';
import 'package:flutter_image_slideshow/flutter_image_slideshow.dart';

class ItemDetails extends StatelessWidget {
  const ItemDetails({
    super.key,
    required Item Item,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
          child: Column(
        children: [
          Container(
            height: MediaQuery.of(context).size.height / 2,
            width: MediaQuery.of(context).size.width,
            decoration: const BoxDecoration(
              color: Color.fromARGB(255, 226, 220, 220),
              borderRadius: BorderRadius.only(
                bottomLeft: Radius.circular(30),
                bottomRight: Radius.circular(30),
              ),
            ),
            child: Stack(
              children: [
                Center(
                  child: ImageSlideshow(
                      indicatorColor: Colors.red,
                      indicatorBackgroundColor: Colors.white,
                      indicatorRadius: 4,
                      isLoop: true,
                      height: 300,
                      autoPlayInterval: 3000,
                      children: [
                        Image.asset('assets/images/Sneakers1.png'),
                        Image.asset('assets/images/Sneakers2.png'),
                        Image.asset('assets/images/Sneakers4.png'),
                        Image.asset('assets/images/Sneakers7.png'),
                        Image.asset('assets/images/Sneakers9.png'),
                      ]),
                ),
                const Padding(padding: EdgeInsets.only(left: 15, top: 20)),
                InkWell(
                  onTap: () {
                    Navigator.pop(context);
                  },
                  child: const Icon(Icons.arrow_back, size: 25),
                )
              ],
            ),
          ),
          const SizedBox(height: 8),
          const Padding(padding: EdgeInsets.all(20)),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: const [
              Text(
                'White Sneakers',
                style: TextStyle(
                    fontFamily: 'LibreBaskerville',
                    fontWeight: FontWeight.bold),
              )
            ],
          )
        ],
      )),
    );
  }
}

</code>```
```<code>import 'package:flutter/material.dart';

class Item {
  final String image, title, description, detail;
  final int id, price;
  final Color color;

  Item({
    required this.image,
    required this.detail,
    required this.title,
    required this.description,
    required this.color,
    required this.id,
    required this.price,
  });
}

List<Item> items = [
  Item(
    title: "White Sneakers",
    image: "assets/images/Sneakers.png",
    description: 'dumytext',
    color: const Color.fromARGB(255, 190, 223, 245),
    detail: '20% off',
    id: 1,
    price: 100,
  ),
  Item(
    title: "Denim Jacket",
    image: "assets/images/Jackets.png",
    description: 'dumytext',
    color: const Color.fromARGB(255, 190, 223, 245),
    detail: '30% off',
    id: 2,
    price: 100,
  ),
  Item(
    title: "Chelsea Boots",
    image: "assets/images/Boots.png",
    description: 'dumytext',
    color: const Color.fromARGB(255, 190, 223, 245),
    detail: '30% off',
    id: 3,
    price: 150,
  ),
  Item(
      title: "Flannel Shirts",
      image: "assets/images/Shirts.png",
      description: 'dumytext',
      color: const Color.fromARGB(255, 190, 223, 245),
      detail: '20% off',
      id: 4,
      price: 60),
];

</code>```

This was my code. And I want to show different 4,5 images in every single grid view in flutter. Now I have added my code and everything. I just want to know that how to add every different image in different section of grid. like in "white sneakers" grid, I just want to add the images of white sneakers only.

Body:
import 'package:ecommerce_app/screens/home/item_details.dart';
import 'package:flutter/material.dart';

import 'catalog.dart';

class GridItems extends StatelessWidget {
  const GridItems({super.key});

  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: GridView.builder(
        itemCount: items.length,
        shrinkWrap: true,
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 2,
        ),
        itemBuilder: (context, index) {
          return InkWell(
              onTap: () {
                Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) => ItemDetails(Item: items[index]),
                    ));
              },
              child: Padding(
                padding: const EdgeInsets.only(right: 15.0),
                child: Container(
                  margin: const EdgeInsets.all(10),
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(15),
                      color: items[index].color,
                      boxShadow: const [
                        BoxShadow(
                            color: Colors.black,
                            blurRadius: 4,
                            spreadRadius: 2),
                      ]),
                  child: Padding(
                    padding: const EdgeInsets.all(10.0),
                    child: Column(
                      children: [
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text(
                              items[index].detail,
                              style: const TextStyle(
                                  fontFamily: 'Anton',
                                  fontWeight: FontWeight.bold),
                            ),
                            const Icon(
                              Icons.favorite,
                              color: Color.fromARGB(255, 247, 101, 90),
                            )
                          ],
                        ),
                        const Padding(padding: EdgeInsets.all(10)),
                        InkWell(
                          onTap: () {},
                          child: Image.asset(
                            items[index].image,
                            height: 100,
                            width: 100,
                          ),
                        ),
                        const SizedBox(
                          height: 8,
                        ),
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text(items[index].title,
                                style: const TextStyle(
                                    fontFamily: 'Anton',
                                    fontWeight: FontWeight.bold)),
                            const Text('\$100',
                                style: TextStyle(
                                  fontFamily: 'SecularOne',
                                )),
                          ],
                        ),
                      ],
                    ),
                  ),
                ),
              ));
        },
      ),
    );
  }
}

import 'package:ecommerce_app/screens/home/grid/catalog.dart';
import 'package:flutter/material.dart';
import 'package:flutter_image_slideshow/flutter_image_slideshow.dart';

class ItemDetails extends StatelessWidget {
  const ItemDetails({
    super.key,
    required Item Item,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
          child: Column(
        children: [
          Container(
            height: MediaQuery.of(context).size.height / 2,
            width: MediaQuery.of(context).size.width,
            decoration: const BoxDecoration(
              color: Color.fromARGB(255, 226, 220, 220),
              borderRadius: BorderRadius.only(
                bottomLeft: Radius.circular(30),
                bottomRight: Radius.circular(30),
              ),
            ),
            child: Stack(
              children: [
                Center(
                  child: ImageSlideshow(
                      indicatorColor: Colors.red,
                      indicatorBackgroundColor: Colors.white,
                      indicatorRadius: 4,
                      isLoop: true,
                      height: 300,
                      autoPlayInterval: 3000,
                      children: [
                        Image.asset('assets/images/Sneakers1.png'),
                        Image.asset('assets/images/Sneakers2.png'),
                        Image.asset('assets/images/Sneakers4.png'),
                        Image.asset('assets/images/Sneakers7.png'),
                        Image.asset('assets/images/Sneakers9.png'),
                      ]),
                ),
                const Padding(padding: EdgeInsets.only(left: 15, top: 20)),
                InkWell(
                  onTap: () {
                    Navigator.pop(context);
                  },
                  child: const Icon(Icons.arrow_back, size: 25),
                )
              ],
            ),
          ),
          const SizedBox(height: 8),
          const Padding(padding: EdgeInsets.all(20)),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: const [
              Text(
                'White Sneakers',
                style: TextStyle(
                    fontFamily: 'LibreBaskerville',
                    fontWeight: FontWeight.bold),
              )
            ],
          )
        ],
      )),
    );
  }
}

import 'package:flutter/material.dart';

class Item {
  final String image, title, description, detail;
  final int id, price;
  final Color color;

  Item({
    required this.image,
    required this.detail,
    required this.title,
    required this.description,
    required this.color,
    required this.id,
    required this.price,
  });
}

List<Item> items = [
  Item(
    title: "White Sneakers",
    image: "assets/images/Sneakers.png",
    description: 'dumytext',
    color: const Color.fromARGB(255, 190, 223, 245),
    detail: '20% off',
    id: 1,
    price: 100,
  ),
  Item(
    title: "Denim Jacket",
    image: "assets/images/Jackets.png",
    description: 'dumytext',
    color: const Color.fromARGB(255, 190, 223, 245),
    detail: '30% off',
    id: 2,
    price: 100,
  ),
  Item(
    title: "Chelsea Boots",
    image: "assets/images/Boots.png",
    description: 'dumytext',
    color: const Color.fromARGB(255, 190, 223, 245),
    detail: '30% off',
    id: 3,
    price: 150,
  ),
  Item(
      title: "Flannel Shirts",
      image: "assets/images/Shirts.png",
      description: 'dumytext',
      color: const Color.fromARGB(255, 190, 223, 245),
      detail: '20% off',
      id: 4,
      price: 60),
];

This was my code. And I want to show different 4,5 images in every single grid view in flutter. Now I have added my code and everything. I just want to know that how to add every different image in different section of grid. like in "white sneakers" grid, I just want to add the images of white sneakers only.


问:
How to get list of classes belonging to a specific namespace from inside the Symfony Kernel?
Using Symfony 6.2

I have few enums inside App\Entity\Enum namespace (src/Entity/Enum folder). I need to get list of all these enums from inside my Kernel::process() function:

class Kernel extends BaseKernel implements CompilerPassInterface
{
    use MicroKernelTrait;

    public function process(ContainerBuilder $container): void
    {
        // get the list of enums from App\Entity\Enum namespace
    }
```
<p>I would prefer to be able to find the class (enum) names through the namespace.</p>
<p>My initial idea was to use <code>services.yaml</code></p>
<pre class="lang-yaml prettyprint-override"><code>services:
    _instanceof:
        BackedEnum:
            tags: [ 'app.tagged_enum' ]
</code>```

But enums are never tagged.

I tried also this kernel function:

protected function build(ContainerBuilder $container): void
{
    $container->registerForAutoconfiguration(\BackedEnum::class)
        ->addTag('app.tagged_enum')
    ;
}
```
<p>which also did not work.</p>
<p>If I then try to get the list inside <code>Kernel::process()</code> I get an empty array:</p>
<pre class="lang-php prettyprint-override"><code>$taggedEnums = $container->findTaggedServiceIds('app.tagged_enum');
</code>```

Body:
Using Symfony 6.2

I have few enums inside App\Entity\Enum namespace (src/Entity/Enum folder). I need to get list of all these enums from inside my Kernel::process() function:

class Kernel extends BaseKernel implements CompilerPassInterface
{
    use MicroKernelTrait;

    public function process(ContainerBuilder $container): void
    {
        // get the list of enums from App\Entity\Enum namespace
    }

I would prefer to be able to find the class (enum) names through the namespace.

My initial idea was to use services.yaml

services:
    _instanceof:
        BackedEnum:
            tags: [ 'app.tagged_enum' ]

But enums are never tagged.

I tried also this kernel function:

protected function build(ContainerBuilder $container): void
{
    $container->registerForAutoconfiguration(\BackedEnum::class)
        ->addTag('app.tagged_enum')
    ;
}

which also did not work.

If I then try to get the list inside Kernel::process() I get an empty array:

$taggedEnums = $container->findTaggedServiceIds('app.tagged_enum');


问:
Passport google Oauth redirect to installed pwa app breaks login
I have created a webapp where I use passport.js google strategy everything works well. the only problem is when I set display mode to standalone in manifest and then install the PWA app next time when I try to login  using google Oauth the redirect callback link opens in pwa app and this break the login returns internal server error

How can I fix this everything works as expected in display mode browser


问:
Excel VBA - MSXML2.XMLHTTP60 Log on and change to 2nd URL
I am trying to log on a scrape our member directory with MSXML2.XMLHTTP60 (4,000 entries).  Back when IE was still an option,  I simply logged on with IE, got authorization, and did the XML download.  Without IE, I have tried the same process with selenium.  Its NO-GO.  I know almost nothing about XMLHTTP60 and APIs, but I am trying to learn. I have had a similar situation on the USGA GHIN site that I resolved with help as follows

```<code>    Const URL = "https://api2.ghin.com/api/v1/public/login.json?"
    Const Link = "https://api2.ghin.com/api/v1/followed_golfers/"
    Dim http As New XMLHTTP60, ghinNum$, lastName$
    Dim AdminGHINnumber As String, AdminLASTNAME As String

 On Error GoTo 1000
    AdminGHINnumber = ThisWorkbook.Worksheets("Data").Range("I5").Value
    AdminLASTNAME = ThisWorkbook.Worksheets("Data").Range("I3").Value

    ghinNum = AdminGHINnumber           'put your ghinNum here
    lastName = AdminLASTNAME

    'ghinNum = "XXXXXXXX"            'put your ghinNum here
    'lastName = "YYYYYY"

    With http
        .Open "GET", URL & "ghinNumber=" & ghinNum & "&lastName=" & lastName & "&remember_me=false", False
        .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
        .setRequestHeader "Referer", "https://www.ghin.com/login"
        .Send
        .Open "GET", Link & ghinNum & ".json", False
        .Send
    End With

    'MsgBox Http.responseText
    Debug.Print http.responseText
    Sheets("GHIN_Input").Range("A2").Value = http.responseText

</code>```

Can someone suggest a similar scheme to get me loged on to to the new site with the Code below?"

```<code>**TROUBLE CODE I am TRYING TO SOLVE BELOW **
**LOG On URL:  https://www.pgawest.com/club/scripts/login/login.asp
Next URL: https://www.pgawest.com/member-home/profiles?LET=A**
```''''''''''''''''''''''''''''''''''''''
**TROUBLE CODE I am TRYING TO SOLVE BELOW **
```''''''''''''''''''''''''''''''''''''''

Sub PGAWest_XML2()
'https://www.youtube.com/watch?v=sGw6r5GVA5g&t=519s
Dim XMLReq As New MSXML2.XMLHTTP60
Dim HTMLDoc As New MSHTML.HTMLDocument
Dim NextHRef As String
Dim NextURL As String

If MsgBox("First IE and Log in on the Site.  Then Leave the broweser open on the desktop. -- Is that done?" & Chr(iChar) & vbCrLf & vbCrLf & "Next Letter ?", vbQuestion + vbYesNo, " ") = vbYes Then
        GoTo 100
    Else
        Exit Sub
End If

XMLReq.Open "GET", PGAWestMemURL & Chr(65), False
XMLReq.send

If XMLReq.Status <> 200 Then
    MsgBox "Problem" & vbNewLine & XMLReq.Status & " - " & XMLReq.statusText
    Exit Sub
End If ' 7:05

HTMLDoc.body.innerHTML = XMLReq.responseText
Set XMLReq = Nothing

100
Call Delete_WS

ActiveSheet.Name = "A"

'******************************* LETTER CHANGER ON MENU BAR - Set New Worksheet ****************************************
For iChar = 65 To 90
Stop
PGAWestMemURL = "https://www.pgawest.com/member-home/profiles?LET=A"
    XMLReq.Open "GET", PGAWestMemURL '& Chr(iChar), False 'https://www.pgawest.com/member-home/profiles?LET=A
    XMLReq.send
 Application.Wait (Now + TimeValue("0:00:10"))
If XMLReq.Status <> 200 Then
    MsgBox "Problem" & vbNewLine & XMLReq.Status & " - " & XMLReq.statusText
    Exit Sub
End If '
Application.Wait (Now + TimeValue("0:00:10"))

HTMLDoc.body.innerHTML = XMLReq.responseText
</code>```

'''etc - all of the rest of the code has worked fine in the past

No data comes back in the request

Body:
I am trying to log on a scrape our member directory with MSXML2.XMLHTTP60 (4,000 entries).  Back when IE was still an option,  I simply logged on with IE, got authorization, and did the XML download.  Without IE, I have tried the same process with selenium.  Its NO-GO.  I know almost nothing about XMLHTTP60 and APIs, but I am trying to learn. I have had a similar situation on the USGA GHIN site that I resolved with help as follows

    Const URL = "https://api2.ghin.com/api/v1/public/login.json?"
    Const Link = "https://api2.ghin.com/api/v1/followed_golfers/"
    Dim http As New XMLHTTP60, ghinNum$, lastName$
    Dim AdminGHINnumber As String, AdminLASTNAME As String

 On Error GoTo 1000
    AdminGHINnumber = ThisWorkbook.Worksheets("Data").Range("I5").Value
    AdminLASTNAME = ThisWorkbook.Worksheets("Data").Range("I3").Value

    ghinNum = AdminGHINnumber           'put your ghinNum here
    lastName = AdminLASTNAME

    'ghinNum = "XXXXXXXX"            'put your ghinNum here
    'lastName = "YYYYYY"

    With http
        .Open "GET", URL & "ghinNumber=" & ghinNum & "&lastName=" & lastName & "&remember_me=false", False
        .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
        .setRequestHeader "Referer", "https://www.ghin.com/login"
        .Send
        .Open "GET", Link & ghinNum & ".json", False
        .Send
    End With

    'MsgBox Http.responseText
    Debug.Print http.responseText
    Sheets("GHIN_Input").Range("A2").Value = http.responseText

Can someone suggest a similar scheme to get me loged on to to the new site with the Code below?"

**TROUBLE CODE I am TRYING TO SOLVE BELOW **
**LOG On URL:  https://www.pgawest.com/club/scripts/login/login.asp
Next URL: https://www.pgawest.com/member-home/profiles?LET=A**
```''''''''''''''''''''''''''''''''''''''
**TROUBLE CODE I am TRYING TO SOLVE BELOW **
```''''''''''''''''''''''''''''''''''''''

Sub PGAWest_XML2()
'https://www.youtube.com/watch?v=sGw6r5GVA5g&t=519s
Dim XMLReq As New MSXML2.XMLHTTP60
Dim HTMLDoc As New MSHTML.HTMLDocument
Dim NextHRef As String
Dim NextURL As String

If MsgBox("First IE and Log in on the Site.  Then Leave the broweser open on the desktop. -- Is that done?" & Chr(iChar) & vbCrLf & vbCrLf & "Next Letter ?", vbQuestion + vbYesNo, " ") = vbYes Then
        GoTo 100
    Else
        Exit Sub
End If

XMLReq.Open "GET", PGAWestMemURL & Chr(65), False
XMLReq.send

If XMLReq.Status <> 200 Then
    MsgBox "Problem" & vbNewLine & XMLReq.Status & " - " & XMLReq.statusText
    Exit Sub
End If ' 7:05

HTMLDoc.body.innerHTML = XMLReq.responseText
Set XMLReq = Nothing

100
Call Delete_WS

ActiveSheet.Name = "A"

'******************************* LETTER CHANGER ON MENU BAR - Set New Worksheet ****************************************
For iChar = 65 To 90
Stop
PGAWestMemURL = "https://www.pgawest.com/member-home/profiles?LET=A"
    XMLReq.Open "GET", PGAWestMemURL '& Chr(iChar), False 'https://www.pgawest.com/member-home/profiles?LET=A
    XMLReq.send
 Application.Wait (Now + TimeValue("0:00:10"))
If XMLReq.Status <> 200 Then
    MsgBox "Problem" & vbNewLine & XMLReq.Status & " - " & XMLReq.statusText
    Exit Sub
End If '
Application.Wait (Now + TimeValue("0:00:10"))

HTMLDoc.body.innerHTML = XMLReq.responseText

'''etc - all of the rest of the code has worked fine in the past

No data comes back in the request


问:
retrieve the date of the economic announcement
how are you ?

I have a question for pinescript

It's possible to retrieve the date of the economic announcement ?

I tried to search everywhere on the internet, I can't find a solution, so I turn to you


问:
Yarn Install not working during docker build There appears to be trouble with your network connection. Retrying
I am newbie in docker and have been trying to run my react with docker using docker build.

`

```<code>Step 1/9 : FROM node:18.12.1-alpine
 ---> 6d7b7852bcd3
Step 2/9 : WORKDIR /app
 ---> Using cache
 ---> 52bdc49c2014
Step 3/9 : COPY package.json .
 ---> Using cache
 ---> 3920b54c5ec9
Step 4/9 : RUN yarn config set network-timeout 600000 -g
 ---> Running in 374a0b1cd0f9
yarn config v1.22.19
success Set "network-timeout" to "600000".
Done in 0.04s.
Removing intermediate container 374a0b1cd0f9
 ---> 00499f342961
Step 5/9 : RUN yarn install --verbose
 ---> Running in 223d0d40490c
yarn install v1.22.19
verbose 0.232714456 Checking for configuration file "/app/.npmrc".
verbose 0.233075334 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.23327504 Checking for configuration file "/usr/local/etc/npmrc".
verbose 0.233483662 Checking for configuration file "/root/.npmrc".
verbose 0.233677765 Checking for configuration file "/app/.npmrc".
verbose 0.234698832 Checking for configuration file "/app/.yarnrc".
verbose 0.235102797 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.235299537 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.235636309 Checking for configuration file "/usr/local/etc/yarnrc".
verbose 0.236023201 Checking for configuration file "/root/.yarnrc".
verbose 0.236307171 Checking for configuration file "/app/.yarnrc".
verbose 0.248050692 current time: 2022-12-18T19:09:37.677Z
info No lockfile found.
[1/4] Resolving packages...
verbose 0.304465887 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 134.153645027 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 267.268788936 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 400.388013951 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 533.508365167 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
verbose 663.62858393 Error: connect ETIMEDOUT 2606:4700::6810:1923:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
error An unexpected error occurred: "https://registry.yarnpkg.com/@react-spring%2ftypes: connect ETIMEDOUT 2606:4700::6810:1923:443".
info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn install --verbose' returned a non-zero code: 1
</code>```

`

It gives me There appears to be trouble with your network connection. Retrying.

I tried setting network-timeout and clearing cache but still giving me the same error.

However, it is working on my WSL2 but not on my Ubuntu 22.04.1 LTS

Body:
I am newbie in docker and have been trying to run my react with docker using docker build.

`

Step 1/9 : FROM node:18.12.1-alpine
 ---> 6d7b7852bcd3
Step 2/9 : WORKDIR /app
 ---> Using cache
 ---> 52bdc49c2014
Step 3/9 : COPY package.json .
 ---> Using cache
 ---> 3920b54c5ec9
Step 4/9 : RUN yarn config set network-timeout 600000 -g
 ---> Running in 374a0b1cd0f9
yarn config v1.22.19
success Set "network-timeout" to "600000".
Done in 0.04s.
Removing intermediate container 374a0b1cd0f9
 ---> 00499f342961
Step 5/9 : RUN yarn install --verbose
 ---> Running in 223d0d40490c
yarn install v1.22.19
verbose 0.232714456 Checking for configuration file "/app/.npmrc".
verbose 0.233075334 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.23327504 Checking for configuration file "/usr/local/etc/npmrc".
verbose 0.233483662 Checking for configuration file "/root/.npmrc".
verbose 0.233677765 Checking for configuration file "/app/.npmrc".
verbose 0.234698832 Checking for configuration file "/app/.yarnrc".
verbose 0.235102797 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.235299537 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.235636309 Checking for configuration file "/usr/local/etc/yarnrc".
verbose 0.236023201 Checking for configuration file "/root/.yarnrc".
verbose 0.236307171 Checking for configuration file "/app/.yarnrc".
verbose 0.248050692 current time: 2022-12-18T19:09:37.677Z
info No lockfile found.
[1/4] Resolving packages...
verbose 0.304465887 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 134.153645027 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 267.268788936 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 400.388013951 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
info There appears to be trouble with your network connection. Retrying...
verbose 533.508365167 Performing "GET" request to "https://registry.yarnpkg.com/@react-spring%2ftypes".
verbose 663.62858393 Error: connect ETIMEDOUT 2606:4700::6810:1923:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
error An unexpected error occurred: "https://registry.yarnpkg.com/@react-spring%2ftypes: connect ETIMEDOUT 2606:4700::6810:1923:443".
info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn install --verbose' returned a non-zero code: 1

`

It gives me There appears to be trouble with your network connection. Retrying.

I tried setting network-timeout and clearing cache but still giving me the same error.

However, it is working on my WSL2 but not on my Ubuntu 22.04.1 LTS


问:
Bitbucket stash REST api: path query parameter missing
I am trying to follow this example:

https://developer.atlassian.com/server/bitbucket/rest/v806/api-group-pull-requests/#api-api-latest-projects-projectkey-repos-repositoryslug-pull-requests-pullrequestid-comments-post

and I have modified my code to this:

def create_comment(pr_id, comment):
    url = f"http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pr_id}/comments"
    headers = {"Accept": "application/json", "Content-Type": "application/json"}
    payload = json.dumps({"text": comment})

    response = requests.request(
        "POST",
        url,
        data=payload,
        headers=headers,
        verify=False,
        auth=HTTPKerberosAuth(mutual_authentication=OPTIONAL),
    )

    print(response.status_code)

    print(
        json.dumps(
            json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")
        )
    )
```
<p>But as a response I always get:</p>
```400
{
    "errors": [
        {
            "context": null,
            "exceptionName": null,
            "message": "The path query parameter is required when retrieving comments."
        }
    ]
}
```

What am I doing wrong here? I am not trying to retrieve comments. I am trying to add a comment. I can add a ?path=/ to my url, but then I only get an empty list of comments.

Body:
I am trying to follow this example:

https://developer.atlassian.com/server/bitbucket/rest/v806/api-group-pull-requests/#api-api-latest-projects-projectkey-repos-repositoryslug-pull-requests-pullrequestid-comments-post

and I have modified my code to this:

def create_comment(pr_id, comment):
    url = f"http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pr_id}/comments"
    headers = {"Accept": "application/json", "Content-Type": "application/json"}
    payload = json.dumps({"text": comment})

    response = requests.request(
        "POST",
        url,
        data=payload,
        headers=headers,
        verify=False,
        auth=HTTPKerberosAuth(mutual_authentication=OPTIONAL),
    )

    print(response.status_code)

    print(
        json.dumps(
            json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")
        )
    )

But as a response I always get:

400
{
    "errors": [
        {
            "context": null,
            "exceptionName": null,
            "message": "The path query parameter is required when retrieving comments."
        }
    ]
}

What am I doing wrong here? I am not trying to retrieve comments. I am trying to add a comment. I can add a ?path=/ to my url, but then I only get an empty list of comments.


问:
Scroll bar disappears after loading specific div
I'm using windows.load function to load a specific div after the operation it all works fine but when the div is reloaded the scroll bar just disappears and I can't scroll whereas there is more data under the page but scroll bar doesn't shows up</p>
```<code>$('#addemployee').click(function(e) {
        //sending the data gathered from input of user to php file where api is called
        e.preventDefault();
            $.ajax({
                url: "php/insertPersonnel.php",
                type: 'POST',

                data: {
                    firstName: $('#fname').val(),
                    lastName:$('#lname').val(),
                    jobTitle:$('#Jtitle').val(),
                    email:$('#email').val(),
                    departmentID:$('#dept').val()
                },
                //if user enters correct data and api gives back the data then we run success funtion
                success: function(result) {

                    console.log(result);

                    //if status of data is ok we fetch the data from fields and put them in results table in html
                    if (result.status.name == "ok") {

                        //fetching fields from api and showing them in html table
                        Swal.fire({
                            title:"Added",
                            text:"Added",
                            type:"success"
                          }).then(function(){

                            $("#addemployeemodal").modal("hide");
                            $('.modal-backdrop').removeClass('modal-backdrop');
                            $('#employeestable').load(location.href + " #employeestable>*")
                             getallemployees();

                          });

                    }else{
                        //if the upper condition  fails
                        console.log("error");

                    }

                },
                //if there is no success in retrieving data from api
                error: function(jqXHR, textStatus, errorThrown) {

                    console.log("error");
                    $('#txterror').html("Enter Valid Id");
                }
            });

        });
</code>```

Body:
I'm using windows.load function to load a specific div after the operation it all works fine but when the div is reloaded the scroll bar just disappears and I can't scroll whereas there is more data under the page but scroll bar doesn't shows up

$('#addemployee').click(function(e) {
        //sending the data gathered from input of user to php file where api is called
        e.preventDefault();
            $.ajax({
                url: "php/insertPersonnel.php",
                type: 'POST',

                data: {
                    firstName: $('#fname').val(),
                    lastName:$('#lname').val(),
                    jobTitle:$('#Jtitle').val(),
                    email:$('#email').val(),
                    departmentID:$('#dept').val()
                },
                //if user enters correct data and api gives back the data then we run success funtion
                success: function(result) {

                    console.log(result);

                    //if status of data is ok we fetch the data from fields and put them in results table in html
                    if (result.status.name == "ok") {

                        //fetching fields from api and showing them in html table
                        Swal.fire({
                            title:"Added",
                            text:"Added",
                            type:"success"
                          }).then(function(){

                            $("#addemployeemodal").modal("hide");
                            $('.modal-backdrop').removeClass('modal-backdrop');
                            $('#employeestable').load(location.href + " #employeestable>*")
                             getallemployees();

                          });

                    }else{
                        //if the upper condition  fails
                        console.log("error");

                    }

                },
                //if there is no success in retrieving data from api
                error: function(jqXHR, textStatus, errorThrown) {

                    console.log("error");
                    $('#txterror').html("Enter Valid Id");
                }
            });

        });


问:
Update field inside an array in Firestore
I want to update the booked field (best would be toogle). The booked field is inside a map wich itself is inside an array.
I have the index of the map, i just dont get how to navigate to the "booked" field.
I can also read the doc etc. no problem there.

If relevant the code is in react

I really tried a lot of different ways.
How hard can it be to update a field in a db.
So i thought anyways.

every help is highly appreciated


问:
Cloning git keeps loading
It's my first time trying to clone a git from GitLab into VSCode on my windows pc. The cloning process keeps loading for over 15 minutes on end every single time (I've tried multiple times). Any suggestions of what I could be doing wrong?

Click the clone button in GitLab, click on VSCode (html) and select a destination folder. It starts cloning and I would expect this to finish at some point...

Title: Cloning git keeps loading


问:
Django multiple SMTP accounts
Here are the Django simple SMTP backend settings for just 1 email account

```<code>    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = "mail.mysmtpserver.somewhere"
    EMAIL_PORT = 587
    EMAIL_HOST_USER = "my@login"
    EMAIL_HOST_PASSWORD = "mypassword"
    EMAIL_USE_TLS = True
</code>```

How is it possible to use 2 or more email accounts on the same server instead of one?

```<code>    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = "mail.mysmtpserver.somewhere"
    EMAIL_PORT =587
    EMAIL_HOST_USER = "my@login2"
    EMAIL_HOST_PASSWORD = "mypassword2"
    EMAIL_USE_TLS = True
</code>```

I just need to send different emails based on the subject by different email account.

I checked the Django documentation but there was nothing

Title: Django multiple SMTP accounts

Body:
Here are the Django simple SMTP backend settings for just 1 email account

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = "mail.mysmtpserver.somewhere"
    EMAIL_PORT = 587
    EMAIL_HOST_USER = "my@login"
    EMAIL_HOST_PASSWORD = "mypassword"
    EMAIL_USE_TLS = True

How is it possible to use 2 or more email accounts on the same server instead of one?

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = "mail.mysmtpserver.somewhere"
    EMAIL_PORT =587
    EMAIL_HOST_USER = "my@login2"
    EMAIL_HOST_PASSWORD = "mypassword2"
    EMAIL_USE_TLS = True

I just need to send different emails based on the subject by different email account.

I checked the Django documentation but there was nothing