问:
extract Min function is not working properly
I got an assignment but I'm stuck in the titled problem. It will be very glad that you will help me to solve this. The quick over review I have provided the classes and main file for which I have to implemented the function and run the code. There are two files named fheap.hpp and djstra.hpp and the main file.

```<code>int main(){

    // Fibonacci Heap

    FibonacciHeap<int> heap(3);
    std::cout<<(heap.get_min()==std::nullopt)<<std::endl;

    std::vector<int> inserted;

    for(int i = 0 ; i < 15 ; ++i) {
        int temp = rand() % 100+1;
        heap.insert(temp);
        cout << temp;
        cout << "inserted  & min :";
        cout << heap.get_min().value() << endl;

    }

    std::cout<<heap.get_min().value()<<std::endl;
    for (int j = 0; j < 15; ++j) {
        int min_value = heap.extract_min().value();
        cout << "min_value: ";
        std::cout << min_value;
        cout << "  size: ";
        cout << heap.size()<<endl;
    }

    // Dijkstra's Algorithm

    edges_t edges1 = {{0, 1, 3.0f},
                      {0, 2, 1.0f},
                      {1, 2, 7.0f},
                      {1, 3, 5.0f},
                      {1, 4, 1.0f},
                      {2, 3, 2.0f},
                      {3, 4, 7.0f}};

    Graph g1(5, edges1, GraphType::UNDIRECTED);

    std::unordered_map<vertex_t, std::optional<std::tuple<vertex_t, edge_weight_t>>> result
            = dijkstra_shortest_path(g1, 2);

    // Previous vertex of src are not checked.
    std::vector<vertex_t> previous = {2, 0, (vertex_t)-1, 2, 1};
    std::vector<edge_weight_t> dist = {1.0f, 4.0f, 0.0f, 2.0f, 5.0f};

    // The printed result should be same as above.

    for(size_t i = 0 ; i < 5 && i!=2 ; ++i) {
        std::cout<<"[vertex i] ";
        std::cout<<"previous: "<<std::get<0>(result[i].value())<<", ";
        std::cout<<"distance: "<<std::get<1>(result[i].value())<<std::endl;
    }

    return 0;

}
</code>```

Suprisingly the djstra part is giving me the required output. second file loop in the main section throws memory error Edit: ( meaning it exits the program with some memory address and sometimes show what() std:: optional error). The fheap class is below that are responsible for it are below:

```<code>#ifndef __FHEAP_H_
#define __FHEAP_H_

#include <iostream>
#include <initializer_list>
#include <optional>
#include <vector>
#include <cmath>
#include <memory>
#include <queue>
#include <list>

template <typename T>
class PriorityQueue {
public:
    virtual void insert(const T& item) = 0;
    virtual std::optional<T> extract_min() = 0;
    virtual bool is_empty() const = 0;
};

template <typename T>
class FibonacciNode {
public:
    // Constructors
    FibonacciNode()
            :key(), degree(0), marked(false), child(nullptr), right(nullptr) {}

    FibonacciNode(const T& item)
            :key(item), degree(0), marked(false), child(nullptr), right(nullptr) {}

    // Destructor
    ~FibonacciNode() = default;

    T key;
    size_t degree;
    bool marked;

    std::shared_ptr<FibonacciNode<T>> right;
    std::shared_ptr<FibonacciNode<T>> child;
    // NOTE: To prevent circular reference, left/parent pointer should be set to weak_ptr.
    std::shared_ptr<FibonacciNode<T>> left;
    std::shared_ptr<FibonacciNode<T>> parent;
};

template <typename T>
class FibonacciHeap : public PriorityQueue<T> {
public:
    // Constructors
    FibonacciHeap()
            : min_node(nullptr), size_(0) {}
    FibonacciHeap(const T& item)
            : min_node(nullptr), size_(0) { insert(item); }

    // Disable copy constructor.
    FibonacciHeap(const FibonacciHeap<T> &);

    // Destructor
    //~FibonacciHeap();

    void insert(const T& item) override;
    void insert(std::shared_ptr<FibonacciNode<T>>& node);

    // Return raw pointer of the min_node.
    FibonacciNode<T>* get_min_node() { return min_node.get(); }

    std::optional<T> get_min() const;

    std::optional<T> extract_min() override;
    std::optional<T> extract_min1();
    void decrease_key(std::shared_ptr<FibonacciNode<T>>& x, T new_key);

    void remove(std::shared_ptr<FibonacciNode<T>>& node);

    bool is_empty() const override { return !size_; }

    size_t size() const { return size_; }

private:

    std::shared_ptr<FibonacciNode<T>> min_node;
    std::shared_ptr<FibonacciNode<T>> min;
    size_t size_;

    void consolidate();
    void merge(std::shared_ptr<FibonacciNode<T>>& x, std::shared_ptr<FibonacciNode<T>>& y);
    void cut(std::shared_ptr<FibonacciNode<T>>& x);
    void recursive_cut(std::shared_ptr<FibonacciNode<T>>& x);

};

template <typename T>
void FibonacciHeap<T>::insert(const T& item) {
    std::shared_ptr<FibonacciNode<T>> node = std::make_shared<FibonacciNode<T>>(item);
    insert(node);
}
template <typename T>
std::optional<T> FibonacciHeap<T>::get_min() const {
    if (min_node) {
        return min_node->key;
    } else {
        return std::nullopt;
    }
}

template <typename T>
void FibonacciHeap<T>::insert(std::shared_ptr<FibonacciNode<T>>& node) {
// Make the new node the right sibling of the min_node, if it exists
    if (min_node) {
        node->right = min_node->right;
        min_node->right = node;
        node->left = min_node;
        node->right->left = node;
    }
// Otherwise, make the new node the min_node and its own right sibling
    else {
        min_node = node;
        node->right = node;
        node->left = node;
    }
// If the new node has a smaller key than the current min_node, update min_node
    if (node->key < min_node->key) {
        min_node = node;
    }
// Increase the size of the heap
    ++size_;
}

template <typename T>
std::optional<T> FibonacciHeap<T>::extract_min() {
    // Return nullopt if the heap is empty
    if (!min_node) {
        return std::nullopt;
    }

    // Store the min_node in a temporary variable
    std::shared_ptr<FibonacciNode<T>> z = min_node;

    // If the min_node has children, add them to the root list
    if (z->child) {
        std::shared_ptr<FibonacciNode<T>> child = z->child;
        do {
            child->parent.reset();
            child = child->right;
        } while (child != z->child);
        merge(min_node, z->child);
    }

    // Remove the min_node from the root list
    std::shared_ptr<FibonacciNode<T>> left = z->left;
    std::shared_ptr<FibonacciNode<T>> right = z->right;
    left->right = right;
    right->left = left;

    // If the min_node was the only node in the heap, set min_node to nullptr
    if (z == right) {
        min_node.reset();
    }
        // Otherwise, set the new min_node to be the node that was previously to the right of z
    else {
        min_node = right;
        consolidate();
    }

    // Decrease the size of the heap
    --size_;

    // Return the key of the extracted min_node
    return z->key;
}

template <typename T>
void FibonacciHeap<T>::decrease_key(std::shared_ptr<FibonacciNode<T>>& x, T new_key) {
// If the new key is greater than the current key, throw an exception
    if (new_key > x->key) {
        throw std::invalid_argument("New key is greater than current key.");
    }
// Update the key of the node
    x->key = new_key;
// If the node has a parent and its new key is smaller than its parent's key, cut it from its parent and add it to the root list
    auto parent = x->parent.lock();
    if (parent && x->key < parent->key) {
        cut(x);
    }
// If the node's new key is smaller than the current min_node's key, update min_node
    if (x->key < min_node->key) {
        min_node = x;
    }
}

template <typename T>
void FibonacciHeap<T>::remove(std::shared_ptr<FibonacciNode<T>>& x) {
    // Set the key of the node to be removed to the minimum value
    x->key = std::numeric_limits<T>::min();
    // Perform a decrease key operation on the node to be removed
    decrease_key(x, std::numeric_limits<T>::min());
    // Extract the minimum value, which should be the node to be removed
    extract_min();
}

template <typename T>
void FibonacciHeap<T>::consolidate() {
    float phi = (1 + sqrt(5)) / 2.0;
    int len = int(log(size_) / log(phi)) + 10;
    std::vector<std::shared_ptr<FibonacciNode<T>>> A(len, nullptr);

    std::shared_ptr<FibonacciNode<T>> w = min_node;
    std::shared_ptr<FibonacciNode<T>> x = w;
    do {
        x = x->right;
        std::shared_ptr<FibonacciNode<T>> y = x;
        int d = y->degree;
        while (A[d]) {
            std::shared_ptr<FibonacciNode<T>> z = A[d];
            if (y->key > z->key) {
                std::swap(y, z);
            }
            merge(y, z);
            A[d] = nullptr;
            ++d;
        }
        A[d] = y;
    } while (w != x);

    min_node.reset();
    for (int i = 0; i < len; ++i) {
        if (A[i]) {
            if (min_node) {
                A[i]->right = min_node->right;
                min_node->right = A[i];
                A[i]->left = min_node;
                A[i]->right->left = A[i];
                if (A[i]->key < min_node->key) {
                    min_node = A[i];
                }
            }
            else {
                min_node = A[i];
                min_node->right = min_node;
                min_node->left = min_node;
            }
        }
    }
}

template <typename T>
void FibonacciHeap<T>::merge(std::shared_ptr<FibonacciNode<T>>& x, std::shared_ptr<FibonacciNode<T>>& y) {
// Make x the right sibling of y
    x->right = y->right;
    y->right->left = x;
    y->right = x;
    x->left = y;
// If x has a smaller key than y, make x the new min_node
    if (x->key < y->key) {
        min_node = x;
    }
// Otherwise, make y the new min_node
    else {
        min_node = y;
    }
// Increase the size of the heap
    size_ += 2;
}

template <typename T>
void FibonacciHeap<T>::cut(std::shared_ptr<FibonacciNode<T>>& x) {
// Get a pointer to the parent of x
    auto parent = x->parent;
// If x has no parent, we do not need to cut it
    if (!parent) return;

// Remove x from the child list of parent
    if (x->right == x) {
        parent->child = nullptr;
    }
    else {
        x->right->left = x->left;
        x->left->right = x->right;
        if (parent->child == x) {
            parent->child = x->right;
        }
    }

// Decrease the degree of parent
    --parent->degree;

// Add x to the root list of the heap
    x->right = min_node->right;
    min_node->right = x;
    x->left = min_node;
    x->right->left = x;

// Clear the parent and marked fields of x
    x->parent.reset();
    x->marked = false;
}

template <typename T>
void FibonacciHeap<T>::recursive_cut(std::shared_ptr<FibonacciNode<T>>& x) {
    // Get the parent of the node
    auto parent = x->parent.lock();

    // If the node has a parent, cut it from the parent and perform a recursive cut on the parent
    if (parent) {
        if (x->marked) {
            // Cut the node from the parent
            cut(x);
            // Perform a recursive cut on the parent
            recursive_cut(parent);
        }
            // If the node is not marked, mark it
        else {
            x->marked = true;
        }
    }
}
#endif // __FHEAP_H_
</code>```

I know, I'm asking a very long question. I've tried every approach but it's not solving.

I Tried debugging the code and introducing cout operations where I think is error after debugging is in the line
`

```<code>std::shared_ptr<FibonacciNode<T>> z = A[d];
</code>```

I tried ArrayList but still no change.

Edit: Second for loop means the 2nd loop in int main ()

Body:
I got an assignment but I'm stuck in the titled problem. It will be very glad that you will help me to solve this. The quick over review I have provided the classes and main file for which I have to implemented the function and run the code. There are two files named fheap.hpp and djstra.hpp and the main file.

int main(){

    // Fibonacci Heap

    FibonacciHeap<int> heap(3);
    std::cout<<(heap.get_min()==std::nullopt)<<std::endl;

    std::vector<int> inserted;

    for(int i = 0 ; i < 15 ; ++i) {
        int temp = rand() % 100+1;
        heap.insert(temp);
        cout << temp;
        cout << "inserted  & min :";
        cout << heap.get_min().value() << endl;

    }

    std::cout<<heap.get_min().value()<<std::endl;
    for (int j = 0; j < 15; ++j) {
        int min_value = heap.extract_min().value();
        cout << "min_value: ";
        std::cout << min_value;
        cout << "  size: ";
        cout << heap.size()<<endl;
    }

    // Dijkstra's Algorithm

    edges_t edges1 = {{0, 1, 3.0f},
                      {0, 2, 1.0f},
                      {1, 2, 7.0f},
                      {1, 3, 5.0f},
                      {1, 4, 1.0f},
                      {2, 3, 2.0f},
                      {3, 4, 7.0f}};

    Graph g1(5, edges1, GraphType::UNDIRECTED);

    std::unordered_map<vertex_t, std::optional<std::tuple<vertex_t, edge_weight_t>>> result
            = dijkstra_shortest_path(g1, 2);

    // Previous vertex of src are not checked.
    std::vector<vertex_t> previous = {2, 0, (vertex_t)-1, 2, 1};
    std::vector<edge_weight_t> dist = {1.0f, 4.0f, 0.0f, 2.0f, 5.0f};

    // The printed result should be same as above.

    for(size_t i = 0 ; i < 5 && i!=2 ; ++i) {
        std::cout<<"[vertex i] ";
        std::cout<<"previous: "<<std::get<0>(result[i].value())<<", ";
        std::cout<<"distance: "<<std::get<1>(result[i].value())<<std::endl;
    }

    return 0;

}

Suprisingly the djstra part is giving me the required output. second file loop in the main section throws memory error Edit: ( meaning it exits the program with some memory address and sometimes show what() std:: optional error). The fheap class is below that are responsible for it are below:

#ifndef __FHEAP_H_
#define __FHEAP_H_

#include <iostream>
#include <initializer_list>
#include <optional>
#include <vector>
#include <cmath>
#include <memory>
#include <queue>
#include <list>

template <typename T>
class PriorityQueue {
public:
    virtual void insert(const T& item) = 0;
    virtual std::optional<T> extract_min() = 0;
    virtual bool is_empty() const = 0;
};

template <typename T>
class FibonacciNode {
public:
    // Constructors
    FibonacciNode()
            :key(), degree(0), marked(false), child(nullptr), right(nullptr) {}

    FibonacciNode(const T& item)
            :key(item), degree(0), marked(false), child(nullptr), right(nullptr) {}

    // Destructor
    ~FibonacciNode() = default;

    T key;
    size_t degree;
    bool marked;

    std::shared_ptr<FibonacciNode<T>> right;
    std::shared_ptr<FibonacciNode<T>> child;
    // NOTE: To prevent circular reference, left/parent pointer should be set to weak_ptr.
    std::shared_ptr<FibonacciNode<T>> left;
    std::shared_ptr<FibonacciNode<T>> parent;
};

template <typename T>
class FibonacciHeap : public PriorityQueue<T> {
public:
    // Constructors
    FibonacciHeap()
            : min_node(nullptr), size_(0) {}
    FibonacciHeap(const T& item)
            : min_node(nullptr), size_(0) { insert(item); }

    // Disable copy constructor.
    FibonacciHeap(const FibonacciHeap<T> &);

    // Destructor
    //~FibonacciHeap();

    void insert(const T& item) override;
    void insert(std::shared_ptr<FibonacciNode<T>>& node);

    // Return raw pointer of the min_node.
    FibonacciNode<T>* get_min_node() { return min_node.get(); }

    std::optional<T> get_min() const;

    std::optional<T> extract_min() override;
    std::optional<T> extract_min1();
    void decrease_key(std::shared_ptr<FibonacciNode<T>>& x, T new_key);

    void remove(std::shared_ptr<FibonacciNode<T>>& node);

    bool is_empty() const override { return !size_; }

    size_t size() const { return size_; }

private:

    std::shared_ptr<FibonacciNode<T>> min_node;
    std::shared_ptr<FibonacciNode<T>> min;
    size_t size_;

    void consolidate();
    void merge(std::shared_ptr<FibonacciNode<T>>& x, std::shared_ptr<FibonacciNode<T>>& y);
    void cut(std::shared_ptr<FibonacciNode<T>>& x);
    void recursive_cut(std::shared_ptr<FibonacciNode<T>>& x);

};

template <typename T>
void FibonacciHeap<T>::insert(const T& item) {
    std::shared_ptr<FibonacciNode<T>> node = std::make_shared<FibonacciNode<T>>(item);
    insert(node);
}
template <typename T>
std::optional<T> FibonacciHeap<T>::get_min() const {
    if (min_node) {
        return min_node->key;
    } else {
        return std::nullopt;
    }
}

template <typename T>
void FibonacciHeap<T>::insert(std::shared_ptr<FibonacciNode<T>>& node) {
// Make the new node the right sibling of the min_node, if it exists
    if (min_node) {
        node->right = min_node->right;
        min_node->right = node;
        node->left = min_node;
        node->right->left = node;
    }
// Otherwise, make the new node the min_node and its own right sibling
    else {
        min_node = node;
        node->right = node;
        node->left = node;
    }
// If the new node has a smaller key than the current min_node, update min_node
    if (node->key < min_node->key) {
        min_node = node;
    }
// Increase the size of the heap
    ++size_;
}

template <typename T>
std::optional<T> FibonacciHeap<T>::extract_min() {
    // Return nullopt if the heap is empty
    if (!min_node) {
        return std::nullopt;
    }

    // Store the min_node in a temporary variable
    std::shared_ptr<FibonacciNode<T>> z = min_node;

    // If the min_node has children, add them to the root list
    if (z->child) {
        std::shared_ptr<FibonacciNode<T>> child = z->child;
        do {
            child->parent.reset();
            child = child->right;
        } while (child != z->child);
        merge(min_node, z->child);
    }

    // Remove the min_node from the root list
    std::shared_ptr<FibonacciNode<T>> left = z->left;
    std::shared_ptr<FibonacciNode<T>> right = z->right;
    left->right = right;
    right->left = left;

    // If the min_node was the only node in the heap, set min_node to nullptr
    if (z == right) {
        min_node.reset();
    }
        // Otherwise, set the new min_node to be the node that was previously to the right of z
    else {
        min_node = right;
        consolidate();
    }

    // Decrease the size of the heap
    --size_;

    // Return the key of the extracted min_node
    return z->key;
}

template <typename T>
void FibonacciHeap<T>::decrease_key(std::shared_ptr<FibonacciNode<T>>& x, T new_key) {
// If the new key is greater than the current key, throw an exception
    if (new_key > x->key) {
        throw std::invalid_argument("New key is greater than current key.");
    }
// Update the key of the node
    x->key = new_key;
// If the node has a parent and its new key is smaller than its parent's key, cut it from its parent and add it to the root list
    auto parent = x->parent.lock();
    if (parent && x->key < parent->key) {
        cut(x);
    }
// If the node's new key is smaller than the current min_node's key, update min_node
    if (x->key < min_node->key) {
        min_node = x;
    }
}

template <typename T>
void FibonacciHeap<T>::remove(std::shared_ptr<FibonacciNode<T>>& x) {
    // Set the key of the node to be removed to the minimum value
    x->key = std::numeric_limits<T>::min();
    // Perform a decrease key operation on the node to be removed
    decrease_key(x, std::numeric_limits<T>::min());
    // Extract the minimum value, which should be the node to be removed
    extract_min();
}

template <typename T>
void FibonacciHeap<T>::consolidate() {
    float phi = (1 + sqrt(5)) / 2.0;
    int len = int(log(size_) / log(phi)) + 10;
    std::vector<std::shared_ptr<FibonacciNode<T>>> A(len, nullptr);

    std::shared_ptr<FibonacciNode<T>> w = min_node;
    std::shared_ptr<FibonacciNode<T>> x = w;
    do {
        x = x->right;
        std::shared_ptr<FibonacciNode<T>> y = x;
        int d = y->degree;
        while (A[d]) {
            std::shared_ptr<FibonacciNode<T>> z = A[d];
            if (y->key > z->key) {
                std::swap(y, z);
            }
            merge(y, z);
            A[d] = nullptr;
            ++d;
        }
        A[d] = y;
    } while (w != x);

    min_node.reset();
    for (int i = 0; i < len; ++i) {
        if (A[i]) {
            if (min_node) {
                A[i]->right = min_node->right;
                min_node->right = A[i];
                A[i]->left = min_node;
                A[i]->right->left = A[i];
                if (A[i]->key < min_node->key) {
                    min_node = A[i];
                }
            }
            else {
                min_node = A[i];
                min_node->right = min_node;
                min_node->left = min_node;
            }
        }
    }
}

template <typename T>
void FibonacciHeap<T>::merge(std::shared_ptr<FibonacciNode<T>>& x, std::shared_ptr<FibonacciNode<T>>& y) {
// Make x the right sibling of y
    x->right = y->right;
    y->right->left = x;
    y->right = x;
    x->left = y;
// If x has a smaller key than y, make x the new min_node
    if (x->key < y->key) {
        min_node = x;
    }
// Otherwise, make y the new min_node
    else {
        min_node = y;
    }
// Increase the size of the heap
    size_ += 2;
}

template <typename T>
void FibonacciHeap<T>::cut(std::shared_ptr<FibonacciNode<T>>& x) {
// Get a pointer to the parent of x
    auto parent = x->parent;
// If x has no parent, we do not need to cut it
    if (!parent) return;

// Remove x from the child list of parent
    if (x->right == x) {
        parent->child = nullptr;
    }
    else {
        x->right->left = x->left;
        x->left->right = x->right;
        if (parent->child == x) {
            parent->child = x->right;
        }
    }

// Decrease the degree of parent
    --parent->degree;

// Add x to the root list of the heap
    x->right = min_node->right;
    min_node->right = x;
    x->left = min_node;
    x->right->left = x;

// Clear the parent and marked fields of x
    x->parent.reset();
    x->marked = false;
}

template <typename T>
void FibonacciHeap<T>::recursive_cut(std::shared_ptr<FibonacciNode<T>>& x) {
    // Get the parent of the node
    auto parent = x->parent.lock();

    // If the node has a parent, cut it from the parent and perform a recursive cut on the parent
    if (parent) {
        if (x->marked) {
            // Cut the node from the parent
            cut(x);
            // Perform a recursive cut on the parent
            recursive_cut(parent);
        }
            // If the node is not marked, mark it
        else {
            x->marked = true;
        }
    }
}
#endif // __FHEAP_H_

I know, I'm asking a very long question. I've tried every approach but it's not solving.

I Tried debugging the code and introducing cout operations where I think is error after debugging is in the line
`

std::shared_ptr<FibonacciNode<T>> z = A[d];

I tried ArrayList but still no change.

Edit: Second for loop means the 2nd loop in int main ()


来源: stackexchange

问:
How to make onchange submit for looping form in laravel 9
i'am new at laravel 9 and i'am trying to make an auto calculation field and submit if there is a change in the field form, i success make the auto calculation but not the submit, its only work for the first form (there is multiple form coz i do a loop).
Here is my code
`

```<code>@foreach($userCarts as $userCart)
    <p hidden>{{ $loop -> index }}</p>

        <div class="">
            <h5 class="mt-5">Product Name : {{ $userCart->prodName }} </h5>

            <!--Form Untuk ubah qty -->
            <form id="editQty" action="/userCart/{{$userCart->prodID}}/editQty" method="post">
                @method('put')
                @csrf

                 <!--QTY -->
                <div class="mb-3" style="width: 350px;">
                    <label for="qty" class="form-label">Qty</label>
                    <input type="number" name="qty" class="form-control" value="{{$userCart->qty}}" id="qty{{$loop->index}}"
                    onchange="hitungTotal({{$userCart->prodPrice}},'qty{{$loop->index}}', 'totalPrice{{$loop->index}}')"
                    min="1" max="999">
                </div>

                <!-- Harga -->
                <div class="mb-3" style="width: 350px;">
                    <label for="price" class="form-label">Price</label>
                    <input type="number" name="price" class="form-control" value="{{$userCart->prodPrice}}" id="price{{$loop->index}}" readonly>
                </div>

                <!-- Total Price -->
                <div class="mb-3" style="width: 350px;">
                    <label for="totalPrice" class="form-label">Total Price</label>
                    <input type="number" name="totalPrice" class="form-control" value="{{$userCart->qty * $userCart->prodPrice}}" id="totalPrice{{$loop->index}}">
                </div>

                <script>
                    function hitungTotal(harga,qty,totalPrice){
                        var quantity = document.getElementById(qty).value;
                        document.getElementById(totalPrice).value = harga*quantity;
                        document.getElementById('editQty').submit();
                        console.log(harga);
                    }
                </script>

                <!-- <button type="submit">
                    <p>Save Quantity</p>
                </button> -->

            </form>

            <!-- Untuk delete from cart -->
            <form action="/userCart/{{$userCart->prodID}}/delete" method="post">
                @method('delete')
                @csrf
                <button type="submit">
                    <i class="bi bi-trash3"></i>
                </button>
            </form>

        </div>
    @endforeach
</code>```

`
note : the button that i comment is working fine

i already try to add {{$loop->index}} for the form id and for the getElementByID in the script but didn't work.
#SorryForBadEnglish

i'am trying to make an auto calculation field and submit so i want every time user change the quantity, its will auto calculate the totalPrice (qty * price) but also change the quantity in the database.

ContentLicense: CC BY-SA 4.0

Body:
i'am new at laravel 9 and i'am trying to make an auto calculation field and submit if there is a change in the field form, i success make the auto calculation but not the submit, its only work for the first form (there is multiple form coz i do a loop).
Here is my code
`

@foreach($userCarts as $userCart)

{{ $loop -> index }}

Product Name : {{ $userCart->prodName }}

            <form id="editQty" action="/userCart/{{$userCart->prodID}}/editQty" method="post">
                @method('put')
                @csrf

                    Qty
                    <input type="number" name="qty" class="form-control" value="{{$userCart->qty}}" id="qty{{$loop->index}}"
                    onchange="hitungTotal({{$userCart->prodPrice}},'qty{{$loop->index}}', 'totalPrice{{$loop->index}}')"
                    min="1" max="999">

                    Price
                    <input type="number" name="price" class="form-control" value="{{$userCart->prodPrice}}" id="price{{$loop->index}}" readonly>

                    Total Price
                    <input type="number" name="totalPrice" class="form-control" value="{{$userCart->qty * $userCart->prodPrice}}" id="totalPrice{{$loop->index}}">

            </form>

            <form action="/userCart/{{$userCart->prodID}}/delete" method="post">
                @method('delete')
                @csrf
                <button type="submit">

                </button>
            </form>

    @endforeach

`
note : the button that i comment is working fine

i already try to add {{$loop->index}} for the form id and for the getElementByID in the script but didn't work.
#SorryForBadEnglish

i'am trying to make an auto calculation field and submit so i want every time user change the quantity, its will auto calculate the totalPrice (qty * price) but also change the quantity in the database.


问:
Ray doesn't work in a docker container (linux)
I have a python code that uses ray. It works locally on my mac, but once I try to run it inside a local docker container I get the following:

A warning:

```<code>WARNING services.py:1922 -- WARNING: The object store is using /tmp instead of /dev/shm
because /dev/shm has only 67108864 bytes available. This will harm performance! You may
be able to free up space by deleting files in /dev/shm. If you are inside a Docker
container, you can increase /dev/shm size by passing '--shm-size=2.39gb' to 'docker run'
(or add it to the run_options list in a Ray cluster config). Make sure to set this to
more than 30% of available RAM.
</code>```

after the warning it says: INFO worker.py:1528 -- Started a local Ray instance.

and a few seconds later I get this error:

```<code>core_worker.cc:179: Failed to register worker
01000000ffffffffffffffffffffffffffffffffffffffffffffffff to Raylet. IOError:
[RayletClient] Unable to register worker with raylet. No such file or directory
</code>```

I already tried:

increasing the /dev/shm as explained

limit the number of cpus in the ray.init() command (as mentioned here)

use ray.init(_plasma_directory = 'dev/shm/')

I use version 2.1.0 of ray.

The first line of my dockerfile: FROM --platform=linux/amd64 python:3.10.9-slim-bullseye
(without the --platform I can't pip install ray)

Any ideas what can I do to solve it?
Thanks for you help

Body:
I have a python code that uses ray. It works locally on my mac, but once I try to run it inside a local docker container I get the following:

A warning:

WARNING services.py:1922 -- WARNING: The object store is using /tmp instead of /dev/shm
because /dev/shm has only 67108864 bytes available. This will harm performance! You may
be able to free up space by deleting files in /dev/shm. If you are inside a Docker
container, you can increase /dev/shm size by passing '--shm-size=2.39gb' to 'docker run'
(or add it to the run_options list in a Ray cluster config). Make sure to set this to
more than 30% of available RAM.

after the warning it says: INFO worker.py:1528 -- Started a local Ray instance.

and a few seconds later I get this error:

core_worker.cc:179: Failed to register worker
01000000ffffffffffffffffffffffffffffffffffffffffffffffff to Raylet. IOError:
[RayletClient] Unable to register worker with raylet. No such file or directory

I already tried:

increasing the /dev/shm as explained

limit the number of cpus in the ray.init() command (as mentioned here)

use ray.init(_plasma_directory = 'dev/shm/')

I use version 2.1.0 of ray.

The first line of my dockerfile: FROM --platform=linux/amd64 python:3.10.9-slim-bullseye
(without the --platform I can't pip install ray)

Any ideas what can I do to solve it?
Thanks for you help


问:
pixi how to calculate bounds when set DropShadowFilter，contain shadow radius
enter image description here

```<code>const shadowFilter = new DropShadowFilter({
        rotation: 0,
        color: Utils.hex2int(colorHex),
        blur: 5,
        alpha: 1,
        distance: 0,
        quality: 10,
    });
    const blurFilter = new PIXI.filters.BlurFilter(1, 100, 1);
    blurFilter.padding = 50;

sprite.filters = [shadowFilter];
</code>```

When i set blur and quality，how i get the new bounds with shadow.

there have a way to calculate this shadow radius？

thank you very much!

Body:
enter image description here

const shadowFilter = new DropShadowFilter({
        rotation: 0,
        color: Utils.hex2int(colorHex),
        blur: 5,
        alpha: 1,
        distance: 0,
        quality: 10,
    });
    const blurFilter = new PIXI.filters.BlurFilter(1, 100, 1);
    blurFilter.padding = 50;

sprite.filters = [shadowFilter];

When i set blur and quality，how i get the new bounds with shadow.

there have a way to calculate this shadow radius？

thank you very much!


问:
how to make a telegram bot whice send daily random text to a private group
Hello I'm a complete beginner in this field. I made a private telegram group, where I wanted to share daily some quotes as scheduled at 10 am. So I wanted to paste these text in the bot, and the bot will randomly sent it daily to a specific time to the group. How can I do that? Please help me.

I tried BotFather. But I don't know the eject way to do it.


问:
Problem while configuring wildFly-18 Server on Eclipse
I'm new in the company and they were helping me while I setup the enviroment, I got this error when I started WildFly server (they gave me their wildfly 18):

`

```<code>09:47:20,106 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0493: EJB subsystem suspension complete
09:47:20,124 INFO  [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) IJ020018: Enabling <validate-on-match> for java:/goljagen
09:47:20,124 INFO  [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-8) IJ020018: Enabling <validate-on-match> for java:/goljagra
09:47:20,129 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:/agepos]
09:47:20,129 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:/goljagen]
09:47:20,130 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:/goljagra]
09:47:22,425 INFO  [org.jboss.as.patching] (MSC service thread 1-1) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
09:47:22,439 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Program Files\wildfly-18.0.0.Final\standalone\deployments
09:47:22,458 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "archiconEar.ear" (runtime-name: "archiconEar.ear")
09:47:22,760 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
09:47:23,436 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3)
09:47:25,221 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."archiconEar.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
    at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
    at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
    at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:327)
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:221)
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
    ... 8 more

09:47:25,728 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "archiconEar.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"archiconEar.ear\".STRUCTURE" => "WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"archiconEar.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb"}}
09:47:25,747 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0010: Deployed "archiconEar.ear" (runtime-name : "archiconEar.ear")
09:47:25,748 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"

09:47:25,820 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
09:47:25,823 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:47:25,824 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:47:25,824 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 18.0.0.Final (WildFly Core 10.0.0.Final) started (with errors) in 18868ms - Started 597 of 859 services (1 services failed or missing dependencies, 408 services are lazy, passive or on-demand)

</code>```

`

We whatched in the jboss-deployment-structur and we have this:

`

```<code><?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
 <sub-deployment name="archiconWeb.war">
  <dependencies>
   <!-- <module name="org.apache.poi" /> -->
   <module name="org.apache.commons.codec" />
  </dependencies>
 </sub-deployment>
</jboss-deployment-structure>

</code>```

`

this is the pom.xml:

```<code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>it.sisal</groupId>
    <artifactId>archicon</artifactId>
    <version>0.0.39-SNAPSHOT</version>
  </parent>

  <artifactId>archiconEar</artifactId>
  <packaging>ear</packaging>

   <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>${version.ear.plugin}</version>
                <configuration>
                    <wtpContextName>archicon</wtpContextName>
                    <!-- Tell Maven we are using Java EE 7 -->
                    <version>7</version>
                    <!-- Use Java EE ear libraries as needed. Java EE ear libraries
                        are in easy way to package any libraries needed in the ear, and automatically
                        have any modules (EJB-JARs and WARs) use them -->
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <outputFileNameMapping>@{artifactId}@</outputFileNameMapping>
                    <contextRoot>/archicon</contextRoot>
                </configuration>
            </plugin>
           </plugins>
    </build>

   <dependencies>
    <dependency>
        <groupId>it.sisal</groupId>
        <artifactId>archiconWeb</artifactId>
        <version>0.0.39-SNAPSHOT</version>
        <type>war</type>
    </dependency>
   </dependencies>
</project>
</code>```

Everyone else got the same file, Do you have any Idea which file should I check and how I can solve this problem.

Thanks to all!!!!

They told me to do:
mvn build, on eclipse do:

mvn update;

Project -> clean;

Project -> build All;

On the right click on the server I selected: clean than Publish.

Body:
I'm new in the company and they were helping me while I setup the enviroment, I got this error when I started WildFly server (they gave me their wildfly 18):

`

09:47:20,106 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0493: EJB subsystem suspension complete
09:47:20,124 INFO  [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) IJ020018: Enabling <validate-on-match> for java:/goljagen
09:47:20,124 INFO  [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-8) IJ020018: Enabling <validate-on-match> for java:/goljagra
09:47:20,129 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:/agepos]
09:47:20,129 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:/goljagen]
09:47:20,130 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:/goljagra]
09:47:22,425 INFO  [org.jboss.as.patching] (MSC service thread 1-1) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
09:47:22,439 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Program Files\wildfly-18.0.0.Final\standalone\deployments
09:47:22,458 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "archiconEar.ear" (runtime-name: "archiconEar.ear")
09:47:22,760 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
09:47:23,436 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3)
09:47:25,221 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."archiconEar.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
    at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
    at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
    at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:327)
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:221)
    at org.jboss.as.server@10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
    ... 8 more

09:47:25,728 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "archiconEar.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"archiconEar.ear\".STRUCTURE" => "WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"archiconEar.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb"}}
09:47:25,747 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0010: Deployed "archiconEar.ear" (runtime-name : "archiconEar.ear")
09:47:25,748 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"

09:47:25,820 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
09:47:25,823 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:47:25,824 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:47:25,824 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 18.0.0.Final (WildFly Core 10.0.0.Final) started (with errors) in 18868ms - Started 597 of 859 services (1 services failed or missing dependencies, 408 services are lazy, passive or on-demand)

`

We whatched in the jboss-deployment-structur and we have this:

`

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

  <dependencies>

   <module name="org.apache.commons.codec" />
  </dependencies>

</jboss-deployment-structure>

`

this is the pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>it.sisal</groupId>
    <artifactId>archicon</artifactId>
    <version>0.0.39-SNAPSHOT</version>
  </parent>

  <artifactId>archiconEar</artifactId>
  <packaging>ear</packaging>

   <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>${version.ear.plugin}</version>
                <configuration>
                    <wtpContextName>archicon</wtpContextName>

                    <version>7</version>

                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <outputFileNameMapping>@{artifactId}@</outputFileNameMapping>
                    <contextRoot>/archicon</contextRoot>
                </configuration>
            </plugin>
           </plugins>
    </build>

   <dependencies>
    <dependency>
        <groupId>it.sisal</groupId>
        <artifactId>archiconWeb</artifactId>
        <version>0.0.39-SNAPSHOT</version>
        <type>war</type>
    </dependency>
   </dependencies>
</project>

Everyone else got the same file, Do you have any Idea which file should I check and how I can solve this problem.

Thanks to all!!!!

They told me to do:
mvn build, on eclipse do:

mvn update;

Project -> clean;

Project -> build All;

On the right click on the server I selected: clean than Publish.


问:
ElasticSearch sorting based with wildcard in key
I have a data structure something like this from query. I want to apply a sort based on the date in the object values.

```<code>{
  users: {
    "1234": {
      name: "User 1",
      joining_date: "2022-12-28T11:37:00.000Z"
    },
    "3456": {
      name: "User 2",
      joining_date: "2022-12-18T11:37:00.000Z"
    }
  }
}
</code>```

This is my query so far.

```<code>GET /_search
{
  "sort" : [ {
    "users.*.joining_date": {
      "order": "desc",
      "format": "date",
      "unmapped_type": "long"
  } }
  ],
  "query": {
    "query_string": {
      "query": "_schema:users"
    }
  }
}
</code>```

The problem is with using a wildcard in the key. I have tried multiple combinations from the documentation but nothing worked so far. I will be grateful for any help.

Body:
I have a data structure something like this from query. I want to apply a sort based on the date in the object values.

{
  users: {
    "1234": {
      name: "User 1",
      joining_date: "2022-12-28T11:37:00.000Z"
    },
    "3456": {
      name: "User 2",
      joining_date: "2022-12-18T11:37:00.000Z"
    }
  }
}

This is my query so far.

GET /_search
{
  "sort" : [ {
    "users.*.joining_date": {
      "order": "desc",
      "format": "date",
      "unmapped_type": "long"
  } }
  ],
  "query": {
    "query_string": {
      "query": "_schema:users"
    }
  }
}

The problem is with using a wildcard in the key. I have tried multiple combinations from the documentation but nothing worked so far. I will be grateful for any help.


问:
Shared html template without server running
In my html page I want to add footer and header for all the pages

This app need to run by opening the file and not with server running.

I add to my code

```<code>fetch('shared/header.html')
.then((response) => {
    return response.text();
})
.then((html) => {
    document.body.innerHTML = html
});
</code>```

but I got cors error

```<code>Access to fetch at 'file:///D:/projects/javascriptApp/shared/header.html' from origin 'null' has been blocked by CORS policy:
</code>```

How can I add shared html files into another file with vanilla javascript

Body:
In my html page I want to add footer and header for all the pages

This app need to run by opening the file and not with server running.

I add to my code

fetch('shared/header.html')
.then((response) => {
    return response.text();
})
.then((html) => {
    document.body.innerHTML = html
});

but I got cors error

Access to fetch at 'file:///D:/projects/javascriptApp/shared/header.html' from origin 'null' has been blocked by CORS policy:

How can I add shared html files into another file with vanilla javascript


问:
Doxygen warning when I use `class A : public B<A>`
I've the folloging header file:

```<code>#ifndef MYACTOR_HPP_
#define MYACTOR_HPP_

#include "SomeApp/Core/ActorThread.hpp"

namespace SomeApp {
namespace Application {

class MyActor : public Core::ActorThread<MyActor> {
public:

  using MessageToCGFDelegate = Core::Delegate<void(const Comm::MessageToCGF&)>;

public:

  MyActor() = delete;
  MyActor(Aclass comm);
  MyActor(const MyActor&) = delete;
  MyActor(MyActor&&) = delete;
  virtual ~MyActor() = default;

public:

  MyActor& operator=(const MyActor&) = delete;
  MyActor& operator=(MyActor&&) = delete;

private:

  friend Core::ActorThread<MyActor>;

private:

  Aclass m_comm;
};

} // namespace Application
} // namespace SomeApp

#endif // !MYACTOR_HPP_

///////////////////////////////////////////////////////////////////////////////
// DOCUMENTATION                                                             //
///////////////////////////////////////////////////////////////////////////////

/** \addtogroup System
 *  @{
 */

/**
 * @class SomeApp::Application::MyActor
 *
 * @brief Actor containing the communication plugin.
 */

/** @}*/
</code>```

When I run doxygen, I obtain a warning:

```<code>Parsing file SomeApp/Application/CommActor.hpp:33: error: no uniquely matching class member found for
    ActorThread< CommActor >
  Possible candidates:
    'SomeApp::Core::ActorThread< Runnable >::ActorThread()' at line 198 of file SomeApp/Core/ActorThread.hpp
    'SomeApp::Core::ActorThread< Runnable >::ActorThread(const ActorThread &)=delete' at line 313 of file SomeApp/Core/ActorThread.hpp
</code>```

I don't know how to get rid of this warning (that blocks the compilation because we thread warnings as errors in our doxygen configuration.)

I'm using doxygen 1.9.5 (actually the latest version).

How can I solve this problem?

Body:
I've the folloging header file:

#ifndef MYACTOR_HPP_
#define MYACTOR_HPP_

#include "SomeApp/Core/ActorThread.hpp"

namespace SomeApp {
namespace Application {

class MyActor : public Core::ActorThread<MyActor> {
public:

  using MessageToCGFDelegate = Core::Delegate<void(const Comm::MessageToCGF&)>;

public:

  MyActor() = delete;
  MyActor(Aclass comm);
  MyActor(const MyActor&) = delete;
  MyActor(MyActor&&) = delete;
  virtual ~MyActor() = default;

public:

  MyActor& operator=(const MyActor&) = delete;
  MyActor& operator=(MyActor&&) = delete;

private:

  friend Core::ActorThread<MyActor>;

private:

  Aclass m_comm;
};

} // namespace Application
} // namespace SomeApp

#endif // !MYACTOR_HPP_

///////////////////////////////////////////////////////////////////////////////
// DOCUMENTATION                                                             //
///////////////////////////////////////////////////////////////////////////////

/** \addtogroup System
 *  @{
 */

/**
 * @class SomeApp::Application::MyActor
 *
 * @brief Actor containing the communication plugin.
 */

/** @}*/

When I run doxygen, I obtain a warning:

Parsing file SomeApp/Application/CommActor.hpp:33: error: no uniquely matching class member found for
    ActorThread< CommActor >
  Possible candidates:
    'SomeApp::Core::ActorThread< Runnable >::ActorThread()' at line 198 of file SomeApp/Core/ActorThread.hpp
    'SomeApp::Core::ActorThread< Runnable >::ActorThread(const ActorThread &)=delete' at line 313 of file SomeApp/Core/ActorThread.hpp

I don't know how to get rid of this warning (that blocks the compilation because we thread warnings as errors in our doxygen configuration.)

I'm using doxygen 1.9.5 (actually the latest version).

How can I solve this problem?


问:
.NET 7 Output caching in IIS
I am using OutputCache in .NET7. Outputcache seems not working on IIS while it is working in my local or docker. Is there any configuration to set for IIS server?</p>
```<code>builder.Services.AddOutputCache(options =>
{
    options.AddBasePolicy(builder =>
    {
        builder.Expire(TimeSpan.FromDays(1));
    });
});
app.UseOutputCache();

</code>```
```<code>        [HttpGet]
        [OutputCache]
        public async Task<IActionResult> getsomefunction()
        {
            return Ok(somefunction());
        }

</code>```

Title: .NET 7 Output caching in IIS

Body:
I am using OutputCache in .NET7. Outputcache seems not working on IIS while it is working in my local or docker. Is there any configuration to set for IIS server?

builder.Services.AddOutputCache(options =>
{
    options.AddBasePolicy(builder =>
    {
        builder.Expire(TimeSpan.FromDays(1));
    });
});
app.UseOutputCache();

        [HttpGet]
        [OutputCache]
        public async Task<IActionResult> getsomefunction()
        {
            return Ok(somefunction());
        }


问:
How to hide currency symbol in input field in Gravity Forms
I am using Gravity forms plugin with WordPress.

I have a product field in which user can enter their desired amount and make a donation.

The input field automatically gets the '€' symbol on the right side. I do not want this to appear in the input field.

I have added a code to functions.php file but it the plugin/theme seems to override it. Here's the code I added

```<code>add_filter( 'gform_currencies', function( $currencies ) {
 $currencies['EUR']['symbol_left'] = '';
 $currencies['EUR']['symbol_right'] = '';
 return $currencies;
} );
</code>```

But the symbol keeps on appearing on the right side automatically.

I have also tried using jQuery but it messes up the predefined values and makes it a blank field. Here's my jQuery code.

```<code><script type="text/javascript">
jQuery(".ginput_amount").click(function() {
var text = jQuery( this ).text().replace('€','');
jQuery(".ginput_amount").val(text);
});
</script>
</code>```

Has anyone faced a similar issue with gravity forms before? Would really appreciate your help.

Body:
I am using Gravity forms plugin with WordPress.

I have a product field in which user can enter their desired amount and make a donation.

The input field automatically gets the '€' symbol on the right side. I do not want this to appear in the input field.

I have added a code to functions.php file but it the plugin/theme seems to override it. Here's the code I added

add_filter( 'gform_currencies', function( $currencies ) {
 $currencies['EUR']['symbol_left'] = '';
 $currencies['EUR']['symbol_right'] = '';
 return $currencies;
} );

But the symbol keeps on appearing on the right side automatically.

I have also tried using jQuery but it messes up the predefined values and makes it a blank field. Here's my jQuery code.

Has anyone faced a similar issue with gravity forms before? Would really appreciate your help.


问:
Show the commit history for a specific tag using the simple-git library
How to show the commit history for a specific tag using the simple-git library.

```<code>Type 'boolean' is not assignable to type 'OptionsValues'.
</code>```
```<code>const log = await git.log({
  'v1.0.0': true
});
</code>```
```<code>git tag
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0
</code>```

Trying to get the time and date of the git tags.

Basically, I want the equivalent of this git command in simple-git.

```<code>git log -1 --format=%ai v1.0.0
</code>```

Body:
How to show the commit history for a specific tag using the simple-git library.

Type 'boolean' is not assignable to type 'OptionsValues'.

const log = await git.log({
  'v1.0.0': true
});

git tag
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0

Trying to get the time and date of the git tags.

Basically, I want the equivalent of this git command in simple-git.

git log -1 --format=%ai v1.0.0


问:
Django How can I upload a csv file?
I do that :

With that whenf i click on Envoyée , i do'nt have modal for choice my csv file . Can you help me please ?

forms.py

```<code>    class CSVUploadForm(forms.Form):
        csv_file = forms.FileField()
</code>```

views.py

```<code>      def upload_csv(request):
            form = forms.CSVUploadForm(instance=request.user)
            if request.method == 'POST':
                form = CSVUploadForm(request.POST, request.FILES, instance=request.user)
                if form.is_valid():
                    # do something with the file
                    form.save()
                    csv_file = request.FILES['csv_file']

                    return render(request, 'password_change_done.html',)
            else:
                form = CSVUploadForm()
           return render(request, 'Paramétres.html', {'form': form})
</code>```

Paramétres.html

```<code>
             <form method="post" enctype="multipart/form-data">

                    {{ form.as_p }}
                    {% csrf_token %}

{#                 \<input type="submit" value="Upload"\>#}
\<button  class="btn btn-primary btnSendPP" type="submit" \>Envoyé\</button\>
\</form\>
</code>```
```<code></code>```

Title: Django How can I upload a csv file?

Body:
I do that :

With that whenf i click on Envoyée , i do'nt have modal for choice my csv file . Can you help me please ?

forms.py

    class CSVUploadForm(forms.Form):
        csv_file = forms.FileField()

views.py

      def upload_csv(request):
            form = forms.CSVUploadForm(instance=request.user)
            if request.method == 'POST':
                form = CSVUploadForm(request.POST, request.FILES, instance=request.user)
                if form.is_valid():
                    # do something with the file
                    form.save()
                    csv_file = request.FILES['csv_file']

                    return render(request, 'password_change_done.html',)
            else:
                form = CSVUploadForm()
           return render(request, 'Paramétres.html', {'form': form})

Paramétres.html

             <form method="post" enctype="multipart/form-data">

                    {{ form.as_p }}
                    {% csrf_token %}

{#                 \<input type="submit" value="Upload"\>#}
\<button  class="btn btn-primary btnSendPP" type="submit" \>Envoyé\</button\>
\</form\>


问:
ERR_SSL_PROTOCOL_ERROR when using AWS NLB in front of ALB
I'm trying to get static IP addresses for an app running behind an ALB by deploying a Network Load Balancer in front of it.

This is my setup:

I'm using an Application load balancer to serve http and https requests on the top of two EC2 instances.

I created a Network Load Balancer(with the target group as Application load balancer) as I wanted static ip address
for the Application load balancer.

I have added port 80,443, and at the network load balancer.

I have allowed tcp 80 and 443.

I have used AWS ACM certificate at my application load balancer

Unfortunately, I'm getting an ERR_SSL_PROTOCOL_ERROR when I'm trying to access through my domain or elatic ip address.

What am I missing?


问:
How do I prevent other users of excel file from interfering with me saving same file while we have it open at the same time?
We are using office 365. The file is saved on sharepoint site and synced to onedrive business. Currently I tried to set permissions on folder and excel file to read-only. Regardless, any time we have the file open simultaneously my version doesn't get uploaded to cloud, unless other users close the file. How do I restrict their access, so they can view the content of the file without interfering with me saving it?

I set permissions from sharepoint admin center to view and excel file to read-only. Still the problem remains.


问:
Meta transaction sometime get timeout in nodejs app
I am trying to create a meta-transaction system using alchemy rpc. It is working 50% of the time.

If I try to mint for the first time it works, second time it doesn't, third time works again.

sometimes the error - timeout error, some time it gives a cors error, regardless, nor issue is found by try catch

This is my aws lambda code -

```<code>const Web3 = require('web3');
const Provider = require('@truffle/hdwallet-provider');
const provider = new Provider(process.env.OWNER_WALLET_PRIVATE_KEY , 'https-link of alchemy polygon mumbai key');
function starts -
    const web3 = new Web3(provider);
    const networkId = await web3.eth.net.getId();
    // const gasPrice = await web3.eth.getGasPrice()
    console.log(networkId," networkid")

    const myContract = new web3.eth.Contract(
        abi,
      contractAddress
    );
console.log(pool.received_amount,pool.recipient,`Old data value: ${await myContract.methods.totalSupply().call()}`);
    const receipt = await myContract.methods.mint(received_amount,recipient).send({ from:owner_wallet_id,gasPrice: String(gasPrice), gasLimit:String(gasLimit) });
</code>```

now I am really confused is it an coding issue or an aws issue or an alchemy issue. I have done this meta transaction system very first time. So I might not understand every aspects of it.
Let me know if I have missed something to provide here.

Body:
I am trying to create a meta-transaction system using alchemy rpc. It is working 50% of the time.

If I try to mint for the first time it works, second time it doesn't, third time works again.

sometimes the error - timeout error, some time it gives a cors error, regardless, nor issue is found by try catch

This is my aws lambda code -

const Web3 = require('web3');
const Provider = require('@truffle/hdwallet-provider');
const provider = new Provider(process.env.OWNER_WALLET_PRIVATE_KEY , 'https-link of alchemy polygon mumbai key');
function starts -
    const web3 = new Web3(provider);
    const networkId = await web3.eth.net.getId();
    // const gasPrice = await web3.eth.getGasPrice()
    console.log(networkId," networkid")

    const myContract = new web3.eth.Contract(
        abi,
      contractAddress
    );
console.log(pool.received_amount,pool.recipient,`Old data value: ${await myContract.methods.totalSupply().call()}`);
    const receipt = await myContract.methods.mint(received_amount,recipient).send({ from:owner_wallet_id,gasPrice: String(gasPrice), gasLimit:String(gasLimit) });

now I am really confused is it an coding issue or an aws issue or an alchemy issue. I have done this meta transaction system very first time. So I might not understand every aspects of it.
Let me know if I have missed something to provide here.


问:
FastAPI cannot receive requests when many threads are running
I am using the FastAPI, but it does not respond in the following situations.

When one request is received, one thread runs and exits after a few minutes.

If 600 requests are received, 600 threads will be started. Then FastAPI cannot return requests immediately.

Is there a way to make API response the highest priority in this situation? thanks.

sorry for my bad english.


问:
using ajax post request to pass values to php but database receives null values
SOLVED
I followed the solution proposed by @Quantin now all works as expected.
Thanks!

"
//convert form data to json — There's your problem. PHP doesn't support that. The duplicate explains how to work around that but, frankly, just pass formData to send and remove xhr.setRequestHeader('Content-Type', 'application/json'); and all the code to convert to JSON.
"

I have an html form that I'm using ajax POST request to pass its values to a php file which sends the data to a Phpmyadmin database.

although I can see in the developer tools / Network tab that the request sent to PHP contains the Json data of the form in the request body, PHP sends null values to my database and I can't figure out why.

Codes:

HTML Form + Ajax:
`

```<code><form id="myForm">
          <p class="question">
            Is this the first time you have visited the website?
          </p>
          <div class="question-answer">
            <label><input type="radio" value="true" name="visited" /> Yes</label>
            <label><input type="radio" value="false" name="visited" /> No</label>
          </div>
              <p class="question">
            How would you rate your experience so far?
          </p>
          <div class="question-answer">
            <label><input type="radio" value="Very bad" name="experience"/> Very bad</label>
            <label><input type="radio" value="Bad" name="experience" /> Bad</label>
            <label><input type="radio" value="Average" name="experience" /> Average</label>
            <label><input type="radio" value="Good" name="experience" /> Good</label>
            <label><input type="radio" value="Very good" name="experience" /> Very good</label>
          </div>
          <p class="question">
            What is the likelihood that you will visit the website again?
          </p>
          <div class="question-answer">
            <label>
              <input type="radio" value="Not at all likely" name="likelihood" /> Not at all
              likely
            </label>
            <label>
              <input type="radio" value="Slightly likely" name="likelihood" /> Slightly
              likely
            </label>
            <label>
              <input type="radio" value="oderately likely" name="likelihood" /> Moderately
              likely
            </label>
            <label>
              <input type="radio" value="Very likely" name="likelihood" /> Very likely
            </label>
            <label>
              <input type="radio" value="Extremely likely" name="likelihood" /> Extremely
              likely
            </label>
          </div>
          <p class="question">
            Please recommend one feature, design change, anything that you would like to see us change or add to the website
          </p>
          <textarea rows="3" cols="50" name="recommendation"></textarea>
          <div class="submit">
            <input type="submit" href=""></input>
          </div>
        </form>

    <script>

    document.getElementById('myForm').addEventListener('submit', function(event) {
    event.preventDefault();
    //retreive form data
    const formData = new FormData(myForm);
    //convert form data to json
    const data = {};
    for (const [key, value] of formData.entries()) {
      data[key] = value;
    }
    // Send a request to the server to process the form data
    var xhr = new XMLHttpRequest();
    xhr.open('POST', 'form.php', true);
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.onload = function() {
    if (xhr.status === 200) {
    const response = JSON.parse(this.responseText);
      document.querySelector("body > div.returning-user-wrapper > div > div > h2").innerHTML =    response.title
      //  `You Are Awesome!`
       document.getElementById('myForm').innerHTML = response.message
     }
     localStorage.setItem("form","submitted");
      };
     xhr.send(JSON.stringify(data));
     });

            </script>
</code>```

PHP:

```<code>   $mysqli = new mysqli($servername, $username, $password, $database);

    $visited = $_POST['visited'];
    $experience = $_POST['experience'];
    $likelihood = $_POST['likelihood'];
    $recommendation = $_POST['recommendation'];
    }

    // Prepare the INSERT statement
    $stmt = $mysqli->prepare("INSERT INTO sudoku_feedback (first_time, experience, return_likelihood,recommendation) VALUES (?,?,?,?)");

    // Bind the values to the placeholders
    $stmt->bind_param("ssss", $visited, $experience, $likelihood, $recommendation);

    // Execute the statement
    $stmt->execute();
</code>```

I Read a lot online but couldn't find anything that could help me.
I tried using isset on the key names, which didn't help.

If I replace the '?' with text values, they are passed correctly to the database.

Body:
SOLVED
I followed the solution proposed by @Quantin now all works as expected.
Thanks!

"
//convert form data to json — There's your problem. PHP doesn't support that. The duplicate explains how to work around that but, frankly, just pass formData to send and remove xhr.setRequestHeader('Content-Type', 'application/json'); and all the code to convert to JSON.
"

I have an html form that I'm using ajax POST request to pass its values to a php file which sends the data to a Phpmyadmin database.

although I can see in the developer tools / Network tab that the request sent to PHP contains the Json data of the form in the request body, PHP sends null values to my database and I can't figure out why.

Codes:

HTML Form + Ajax:
`

<form id="myForm">

            Is this the first time you have visited the website?

            <input type="radio" value="true" name="visited" /> Yes
            <input type="radio" value="false" name="visited" /> No

            How would you rate your experience so far?

            <input type="radio" value="Very bad" name="experience"/> Very bad
            <input type="radio" value="Bad" name="experience" /> Bad
            <input type="radio" value="Average" name="experience" /> Average
            <input type="radio" value="Good" name="experience" /> Good
            <input type="radio" value="Very good" name="experience" /> Very good

            What is the likelihood that you will visit the website again?

              <input type="radio" value="Not at all likely" name="likelihood" /> Not at all
              likely

              <input type="radio" value="Slightly likely" name="likelihood" /> Slightly
              likely

              <input type="radio" value="oderately likely" name="likelihood" /> Moderately
              likely

              <input type="radio" value="Very likely" name="likelihood" /> Very likely

              <input type="radio" value="Extremely likely" name="likelihood" /> Extremely
              likely

            Please recommend one feature, design change, anything that you would like to see us change or add to the website

          <textarea rows="3" cols="50" name="recommendation"></textarea>

            <input type="submit" href=""></input>

        </form>

PHP:

   $mysqli = new mysqli($servername, $username, $password, $database);

    $visited = $_POST['visited'];
    $experience = $_POST['experience'];
    $likelihood = $_POST['likelihood'];
    $recommendation = $_POST['recommendation'];
    }

    // Prepare the INSERT statement
    $stmt = $mysqli->prepare("INSERT INTO sudoku_feedback (first_time, experience, return_likelihood,recommendation) VALUES (?,?,?,?)");

    // Bind the values to the placeholders
    $stmt->bind_param("ssss", $visited, $experience, $likelihood, $recommendation);

    // Execute the statement
    $stmt->execute();

I Read a lot online but couldn't find anything that could help me.
I tried using isset on the key names, which didn't help.

If I replace the '?' with text values, they are passed correctly to the database.


问:
Serve files on route with react native for web for stripe apple pay verification
I am currently working on a React Native App, which uses React Native Web to serve the same codebase as a web app. In my project I implemented Stripe as my payment system and to use apple pay, and for the web part, I need to upload a merchant verification file to /.well-known/{fileName}. The file is a document without any file extension.

Since the project is React Native, there is no public folder, where I could put the file and since I am using Amplify to host the project, there is now way of creating the folder and file directly on the server.

So, to sum up my question: How can I add a folder and file to my React Native Web project, which is hosted on AWS Amplify?

I tried creating a new screen/route with React Navigation and put a WebView in there, put that just seems overkill


问:
Can you apply Chrome Policy with Selenium Webdriver
Currently I don't think it is supported. But I need to be able to update a bunch a registry settings that get stored in chrome://policy for the browser user.But I dont believe it is possible to do this. I know you can add a profile via ChromeOptions user-data-dir=

I am currently using SeleniumWebDriver in javascript.  This chrome policy setting get used by the extension.

I cant find any reference in selenium for adding chrome://policy settings with webdriver


问:
My Apple ID not connected after adding my email to the app as an app manager
I'm new to Apple development but I have an app pushed to Apple store already with my companies apple ID which I manage. But recently I was given access to push to update already pushed app on app connect but after signing in to Apple id in xcode, xcode throws an error that I don't have access to that bundle id. ,Funny thing when I login to app connect i can see that app on the list of app I have access to.

I have tried creating a provisional certificate but didn't work.


问:
Does changing flush.size of the Confluent s3 sink invalidate EOS?
I have a Kafka Connect cluster running the Confluent s3 Sink Connector, configured for EOS.

Our current flush.size is set to a rather high number which was ideal for reading in historical data. After having caught up to the current upstream, this high value obviously causes high latency in transferring the records.

I don't see a reason why - all other things being equal, changing the flush.size should invalidate EOS. It perhaps wouldn't be "exactly-once" in the meta-sense that the files would not look exactly the same if I were to restart from the beginning, but I don't see a reason why the actual file content would be impacted in this case. However, with cases such as these the devil is often in the details...

I do have some ways to check this, but it would entail a lot more work in identifying and cleaning up the duplicates since there are no automatic processes in place at the moment (under the verified assumption that the connector provides EOS).

Am I wrong? Would changing (only) flush.size invalidate EOS?


问:
Heroku successfully deploying, but receiving application error when loading site
The logs don't show any errors, but I'm receiving the following error when loading the website:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail

You can find the logs below. Am I doing something wrong here?

```<code>-----> Building on the Heroku-22 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in runtime.txt
-----> No change in requirements detected, installing from cache
-----> Using cached install of python-3.10.9
-----> Installing pip 22.3.1, setuptools 63.4.3 and wheel 0.37.1
-----> Installing SQLite3
-----> Installing requirements with pip
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 66.3M
-----> Launching...
       Released v461
       https://deleidel.herokuapp.com/ deployed to Heroku
</code>```

The heroku logs don't show any errors, but I'm receiving the following error when loading the website:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail

Body:
The logs don't show any errors, but I'm receiving the following error when loading the website:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail

You can find the logs below. Am I doing something wrong here?

-----> Building on the Heroku-22 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in runtime.txt
-----> No change in requirements detected, installing from cache
-----> Using cached install of python-3.10.9
-----> Installing pip 22.3.1, setuptools 63.4.3 and wheel 0.37.1
-----> Installing SQLite3
-----> Installing requirements with pip
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 66.3M
-----> Launching...
       Released v461
       https://deleidel.herokuapp.com/ deployed to Heroku

The heroku logs don't show any errors, but I'm receiving the following error when loading the website:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail


问:
C# Project "Any CPU" question

Possible Duplicate:

  Visual Studio “Any CPU” target

If I mark my project as "Any CPU" will it always run as 64bit executable on a 64bit Windows?

ContentLicense: CC BY-SA 3.0

Title: C# Project "Any CPU" question


问:
How to use Python to directly download a csv file which is exported through a submit button from a html form element?
I've been trying to write a script that pulls a .csv export file from a webpage through beautifulsoup directly into python without saving it locally but I am, admittedly, an extreme novice in this area.

The page in question allows you to search for matching records with various filters and gives you an option to download a .csv or excel file of the search results (link).

My current attempts have been to use the requests.get() method with the below URL (that is generated on button click) but it just returns the page source code even though when pasted in the browser it triggers the file download.

```<code>https://training.gov.au/Search?id=po2ttdwopen4lfzbxekm42xk&exportSearchCsvSubmit=CSV&SearchType=Rto&searchTitleOrCode=&anzsco=&asced=&registrationStatus=0&registrationStatus=2&ScopeNationalCode=FNSACC602&IncludeImplicitScope'
</code>```

I'm sure there's likely a simple explanation on why this behaviour is occuring... but I haven't been able to find a solution that doesn't include using selenium to download the file locally and access it that way.

Ultimately - I want to be able to pass through 1 or more ScopeNationalCode values and download the associated .csv results file directly in python without saving it locally. Right now I just want to know how to download the single file (link) from the below webpage?

How can I get the .csv file directly in python without saving it to my local device first or is selenium the only solution?

Body:
I've been trying to write a script that pulls a .csv export file from a webpage through beautifulsoup directly into python without saving it locally but I am, admittedly, an extreme novice in this area.

The page in question allows you to search for matching records with various filters and gives you an option to download a .csv or excel file of the search results (link).

My current attempts have been to use the requests.get() method with the below URL (that is generated on button click) but it just returns the page source code even though when pasted in the browser it triggers the file download.

https://training.gov.au/Search?id=po2ttdwopen4lfzbxekm42xk&exportSearchCsvSubmit=CSV&SearchType=Rto&searchTitleOrCode=&anzsco=&asced=&registrationStatus=0&registrationStatus=2&ScopeNationalCode=FNSACC602&IncludeImplicitScope'

I'm sure there's likely a simple explanation on why this behaviour is occuring... but I haven't been able to find a solution that doesn't include using selenium to download the file locally and access it that way.

Ultimately - I want to be able to pass through 1 or more ScopeNationalCode values and download the associated .csv results file directly in python without saving it locally. Right now I just want to know how to download the single file (link) from the below webpage?

How can I get the .csv file directly in python without saving it to my local device first or is selenium the only solution?


问:
WooCommerce Rest API Create Order doesn't fires Emails
I am having problems with WooCommerce in the latest version. Every time a order is created and updated to processing, WooCommerce isn't firing the New Order Mail. I found a solution here from 2020 but it isn't working.

Anyone had the same problem and found a solution for this? I also tried with a new installation on a different server, but the same problem.

Thank you in advance.


问:
Adding Spell Check wysiwyg editor
This works great for spell checking textaras but I want to attach it to a wysiwyg editor

Tried adding the iframe id with no luck

```<code>< textarea name="TextArea1" id="futured" cols="20" rows="2"></textarea>
< a href="#check-textarea" id="check-textarea">check</a>

<script type="text/javascript">

    // check the spelling on a textarea
    $("#check-textarea").click(function(e){
        e.preventDefault();
        $(".loading").show();

        $("#futured")
        .spellchecker({
            lang: "en",
            engine: "google",
            suggestBoxPosition: "above"
        })
        .spellchecker("check", function(result){
            $(".loading").hide();
            if (result) {
                alert('There are no incorrectly spelt words.');
            }
        });
    });

</script>
</code>```

Title: Adding Spell Check wysiwyg editor

Body:
This works great for spell checking textaras but I want to attach it to a wysiwyg editor

Tried adding the iframe id with no luck

< textarea name="TextArea1" id="futured" cols="20" rows="2"></textarea>
check


问:
How to use ion-select with custom button instead of given art style?
I have a custom button and some ion-select options like below in html.

```<code><ion-button (click)="openSelect()">open</ion-button>
<ion-select multiple=" true" #mySelect>
  <ion-select-option> today </ion-select-option>
  <ion-select-option> tommorow </ion-select-option>
  <ion-select-option> weekend </ion-select-option>
</ion-select>
</code>```

And the typescript is like this.

```<code>import { IonSelect } from '@ionic/angular';

@ViewChild('mySelect', { static: false }) selectRef: IonSelect;

openSelect() {
  this.selectRef.open()
}
</code>```

The result of this html is that the ion-select section expands to whole div but ignoring the button.
How can I apply ion-select to a button instead of its native art and even disable its original art and replace it with my custom button? thankyou.

Body:
I have a custom button and some ion-select options like below in html.

<ion-button (click)="openSelect()">open</ion-button>
<ion-select multiple=" true" #mySelect>
  <ion-select-option> today </ion-select-option>
  <ion-select-option> tommorow </ion-select-option>
  <ion-select-option> weekend </ion-select-option>
</ion-select>

And the typescript is like this.

import { IonSelect } from '@ionic/angular';

@ViewChild('mySelect', { static: false }) selectRef: IonSelect;

openSelect() {
  this.selectRef.open()
}

The result of this html is that the ion-select section expands to whole div but ignoring the button.
How can I apply ion-select to a button instead of its native art and even disable its original art and replace it with my custom button? thankyou.


问:
Histogram and pie chart didn't show and output table changed in jupiter notebook's vscode
i'm doing some basic data sciences with pandas in vscode. At first, everything ok. Histogram and pie chart appear at the output and when i want to shown my dataframe in output, it will show as a table. Suddenly when i'm doing poc-hoc test with statsmodels, the histogram and pie chart didn't show, and when i want to show dataframe in table, it didn't appear as table again (i will attach the image). Not only that, when i'm trying to run code there's always strange sound come from the vscode.

When i upload the .ipynb file in google collab, it looks pretty normal and good, the histogram, chart, and table, all of them is appear.

What happen with my VScode?

I attach the following source code and images (as proof) below:

for dataframe output, with same code, like this:

```<code>print("Nomor 2: Tabel frekuensi dan proporsi jenis kelamin\n")
df1a = pd.DataFrame(df1a_records, columns = ["Jenis Kelamin", "Frekuensi", "Proporsi"])

df1a.head()
</code>```

This is my Table output look like in VScode: Table Output in Vscode

This is my Table output look like in Google Collab: Table output in google collab

for pie chart output, with same code:

```<code>frekp = df[df["Jenis Kelamin"].str.contains("Pria", na=False)].count()
frekp = frekp["Jenis Kelamin"]
frekw = df[df["Jenis Kelamin"].str.contains("Wanita", na=False)].count()
frekw = frekw["Jenis Kelamin"]

frekt = frekp + frekw
propp = (frekp / frekt)
propw = (frekw / frekt)

df1a_records = {
    "Jenis Kelamin" : ["Pria", "Wanita"],
    "Frekuensi" : [frekp, frekw],
    "Proporsi" : [propp, propw]
}

df1a = pd.DataFrame(df1a_records, columns = ["Jenis Kelamin", "Frekuensi", "Proporsi"])

print("Nomor 1: Pie Chart proporsi jenis kelamin\n")
plt.pie(df1a["Frekuensi"], labels = ["Pria", "Wanita"])
plt.show()
</code>```

This is my pie chart output in Vscode: Pie chart in vscode

This is my pie chart output in Google Collab: Pie Chart in google collab

Body:
i'm doing some basic data sciences with pandas in vscode. At first, everything ok. Histogram and pie chart appear at the output and when i want to shown my dataframe in output, it will show as a table. Suddenly when i'm doing poc-hoc test with statsmodels, the histogram and pie chart didn't show, and when i want to show dataframe in table, it didn't appear as table again (i will attach the image). Not only that, when i'm trying to run code there's always strange sound come from the vscode.

When i upload the .ipynb file in google collab, it looks pretty normal and good, the histogram, chart, and table, all of them is appear.

What happen with my VScode?

I attach the following source code and images (as proof) below:

for dataframe output, with same code, like this:

print("Nomor 2: Tabel frekuensi dan proporsi jenis kelamin\n")
df1a = pd.DataFrame(df1a_records, columns = ["Jenis Kelamin", "Frekuensi", "Proporsi"])

df1a.head()

This is my Table output look like in VScode: Table Output in Vscode

This is my Table output look like in Google Collab: Table output in google collab

for pie chart output, with same code:

frekp = df[df["Jenis Kelamin"].str.contains("Pria", na=False)].count()
frekp = frekp["Jenis Kelamin"]
frekw = df[df["Jenis Kelamin"].str.contains("Wanita", na=False)].count()
frekw = frekw["Jenis Kelamin"]

frekt = frekp + frekw
propp = (frekp / frekt)
propw = (frekw / frekt)

df1a_records = {
    "Jenis Kelamin" : ["Pria", "Wanita"],
    "Frekuensi" : [frekp, frekw],
    "Proporsi" : [propp, propw]
}

df1a = pd.DataFrame(df1a_records, columns = ["Jenis Kelamin", "Frekuensi", "Proporsi"])

print("Nomor 1: Pie Chart proporsi jenis kelamin\n")
plt.pie(df1a["Frekuensi"], labels = ["Pria", "Wanita"])
plt.show()

This is my pie chart output in Vscode: Pie chart in vscode

This is my pie chart output in Google Collab: Pie Chart in google collab


问:
Acumatica - Copy Paste Function not working on Rich Text
I added the copy-paste function to the tasks screen (CR306020) but somehow the detail section richtextbox of it wasn't being copied.

I tried to override the PXSelect view of it by removing the

```<code>        [PXCopyPasteHiddenFields(typeof(CRActivity.body))]
</code>```

and declared it as a public new PXSelect. but somehow it doesn't work.

any suggestion or ideas on how to make it work would be appreciated.

Body:
I added the copy-paste function to the tasks screen (CR306020) but somehow the detail section richtextbox of it wasn't being copied.

I tried to override the PXSelect view of it by removing the

        [PXCopyPasteHiddenFields(typeof(CRActivity.body))]

and declared it as a public new PXSelect. but somehow it doesn't work.

any suggestion or ideas on how to make it work would be appreciated.