问:
Permission setting for ASP.NET MVC to access network disk drive files
I have encountered a webpage developed using Active Server Pages (ASP) in development, which can read and download folders and files in the network disk through the IIS virtual directory, and judge the user's ad identity authority. Does the web page have permission to read and download the files in the disk drive?

Now it is rewritten as ASP.NET MVC and can only read and download the files in the drive drive through the user permissions set in the IIS virtual directory. It cannot be targeted at users before the ad identity authority judges whether the webpage has the permission to read and download the files in the disk drive.

I would like to ask whether there is a way to judge whether the webpage has the permission to read and download the files in the disk drive based on the ad identity authority of individual users of the webpage?

Now rewritten in ASP.NET MVC, it can only read and download files in the disk drive through the user permissions set by the IIS virtual directory


来源: stackexchange

问:
Apache Hive can't Start metastore and WebUI
I want to start Apache Hive connect to Hadoop.

```<code>$ nohup hiveserver2 &
$tail -f nohup.out
</code>```

hive-site.xml

```<code><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>hive.metastore.local</name>
        <value>true</value>
    </property>

    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>/hive/warehouse</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>org.postgresql.Driver</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:postgresql://localhost:5432/hivemetastoredb</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>postgres</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>Passw0rd</value>
    </property>

    <property>
        <name>hive.server2.thrift.port</name>
        <value>10000</value>
    </property>

    <property>
        <name>hive.server2.enable.doAs</name>
        <value>true</value>
    </property>

    <property>
        <name>hive.execution.engine</name>
        <value>mr</value>
    </property>

    <property>
        <name>hive.metastore.port</name>
        <value>9083</value>
    </property>

    <property>
        <name>mapreduce.input.fileinputformat.input.dir.recursive</name>
        <value>true</value>
    </property>
</configuration>
</code>```

Error

```<code>2022-12-13T03:50:00,961  INFO [main] server.HiveServer2: Starting HiveServer2
**2022-12-13T03:50:01,016  WARN [main] conf.HiveConf: HiveConf of name hive.metastore.local does not exist**
2022-12-13T03:50:01,021  INFO [main] server.HiveServer2: Shutting down HiveServer2
2022-12-13T03:50:01,021  INFO [main] SessionState: Hive Session ID = 2b674a2c-1c6d-4ea5-b4db-fc7c065eb7ab
2022-12-13T03:50:01,021  INFO [main] server.HiveServer2: Stopping/Disconnecting tez sessions.
2022-12-13T03:50:01,022  WARN [main] server.HiveServer2: Error starting HiveServer2 on attempt 4, will retry in 60000ms
java.lang.RuntimeException: Error applying authorization policy on hive configuration: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
        at org.apache.hive.service.cli.CLIService.init(CLIService.java:118) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.CompositeService.init(CompositeService.java:59) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.init(HiveServer2.java:229) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:1038) [hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.access$1600(HiveServer2.java:139) [hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:1307) [hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:1151) [hive-service-3.1.3.jar:3.1.3]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323) [hadoop-common-3.3.4.jar:?]
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236) [hadoop-common-3.3.4.jar:?]
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
        at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:413) ~[hive-exec-3.1.3.jar:3.1.3]
        at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:389) ~[hive-exec-3.1.3.jar:3.1.3]
        at org.apache.hive.service.cli.CLIService.applyAuthorizationConfigPolicy(CLIService.java:128) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.cli.CLIService.init(CLIService.java:115) ~[hive-service-3.1.3.jar:3.1.3]

</code>```

Check port it not listen.

```<code>hive@namenode1:/data/hive/apache-hive-3.1.3-bin$ netstat -an |grep 9083
hive@namenode1:/data/hive/apache-hive-3.1.3-bin$ netstat -an |grep 10000
hive@namenode1:/data/hive/apache-hive-3.1.3-bin$ netstat -an |grep 10002
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I want to start Apache Hive connect to Hadoop.

$ nohup hiveserver2 &
$tail -f nohup.out

hive-site.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>hive.metastore.local</name>
        <value>true</value>
    </property>

    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>/hive/warehouse</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>org.postgresql.Driver</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:postgresql://localhost:5432/hivemetastoredb</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>postgres</value>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>Passw0rd</value>
    </property>

    <property>
        <name>hive.server2.thrift.port</name>
        <value>10000</value>
    </property>

    <property>
        <name>hive.server2.enable.doAs</name>
        <value>true</value>
    </property>

    <property>
        <name>hive.execution.engine</name>
        <value>mr</value>
    </property>

    <property>
        <name>hive.metastore.port</name>
        <value>9083</value>
    </property>

    <property>
        <name>mapreduce.input.fileinputformat.input.dir.recursive</name>
        <value>true</value>
    </property>
</configuration>

Error

2022-12-13T03:50:00,961  INFO [main] server.HiveServer2: Starting HiveServer2
**2022-12-13T03:50:01,016  WARN [main] conf.HiveConf: HiveConf of name hive.metastore.local does not exist**
2022-12-13T03:50:01,021  INFO [main] server.HiveServer2: Shutting down HiveServer2
2022-12-13T03:50:01,021  INFO [main] SessionState: Hive Session ID = 2b674a2c-1c6d-4ea5-b4db-fc7c065eb7ab
2022-12-13T03:50:01,021  INFO [main] server.HiveServer2: Stopping/Disconnecting tez sessions.
2022-12-13T03:50:01,022  WARN [main] server.HiveServer2: Error starting HiveServer2 on attempt 4, will retry in 60000ms
java.lang.RuntimeException: Error applying authorization policy on hive configuration: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
        at org.apache.hive.service.cli.CLIService.init(CLIService.java:118) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.CompositeService.init(CompositeService.java:59) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.init(HiveServer2.java:229) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:1038) [hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.access$1600(HiveServer2.java:139) [hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:1307) [hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:1151) [hive-service-3.1.3.jar:3.1.3]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323) [hadoop-common-3.3.4.jar:?]
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236) [hadoop-common-3.3.4.jar:?]
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
        at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:413) ~[hive-exec-3.1.3.jar:3.1.3]
        at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:389) ~[hive-exec-3.1.3.jar:3.1.3]
        at org.apache.hive.service.cli.CLIService.applyAuthorizationConfigPolicy(CLIService.java:128) ~[hive-service-3.1.3.jar:3.1.3]
        at org.apache.hive.service.cli.CLIService.init(CLIService.java:115) ~[hive-service-3.1.3.jar:3.1.3]

Check port it not listen.

hive@namenode1:/data/hive/apache-hive-3.1.3-bin$ netstat -an |grep 9083
hive@namenode1:/data/hive/apache-hive-3.1.3-bin$ netstat -an |grep 10000
hive@namenode1:/data/hive/apache-hive-3.1.3-bin$ netstat -an |grep 10002


问:
How to invoke PlantUML Jar methods to not output image when there is error
I am using PlantUML to generate a diagram dynamically in Java to write to a document. Sample code is as below.

```<code>ByteArrayOutputStream png = new ByteArrayOutputStream();
SourceStringReader reader = new SourceStringReader(sb.toString());
String imgDesc = reader.outputImage(png).getDescription();
</code>```

Since the syntax for the PlantUML text is generated at runtime, sometimes it throws an Error and the image contains the Error text. I would like to suppress the error and not display the error image if there is any issue. In command line mode, as noted in another answer, I see the option of -noerror. However, when invoking through method call, I do not see a similar method for SourceStringReader. Are there any options to suppress error messages when dynamically creating the image? Any help is appreciated.

Body:
I am using PlantUML to generate a diagram dynamically in Java to write to a document. Sample code is as below.

ByteArrayOutputStream png = new ByteArrayOutputStream();
SourceStringReader reader = new SourceStringReader(sb.toString());
String imgDesc = reader.outputImage(png).getDescription();

Since the syntax for the PlantUML text is generated at runtime, sometimes it throws an Error and the image contains the Error text. I would like to suppress the error and not display the error image if there is any issue. In command line mode, as noted in another answer, I see the option of -noerror. However, when invoking through method call, I do not see a similar method for SourceStringReader. Are there any options to suppress error messages when dynamically creating the image? Any help is appreciated.


问:
Why are there bullet points next to wtf-forms radio buttons?
I am working with Flask and wtf-forms to make a registration form. I am wondering where there are bullet points as if it were a list in a word processor in front of the radio button options? I am assuming that there is a syntax error somewhere, but I can't figure out where. I would like the radio buttons on the far left side to go away.

Here's the RegistrationForm

class RegisterForm(FlaskForm):
    firstname = StringField(label='First Name')
    lastname = StringField(label='Last Name')
    email_address = StringField(label='Email')
    password1 = PasswordField(label='Password')
    password2 = PasswordField(label='Confirm Password')
    patient_doctor = RadioField('Label', choices=[('Patient','PATIENT'),('Doctor','DOCTOR')])
    submit = SubmitField(label='Create Account')
```
<p>Here is the corresponding jinja2</p>
```{{ form.patient_doctor(class="form-button") }}

```

I would like the two bullet points on the very far left of the page to go away.

Body:
I am working with Flask and wtf-forms to make a registration form. I am wondering where there are bullet points as if it were a list in a word processor in front of the radio button options? I am assuming that there is a syntax error somewhere, but I can't figure out where. I would like the radio buttons on the far left side to go away.

Here's the RegistrationForm

class RegisterForm(FlaskForm):
    firstname = StringField(label='First Name')
    lastname = StringField(label='Last Name')
    email_address = StringField(label='Email')
    password1 = PasswordField(label='Password')
    password2 = PasswordField(label='Confirm Password')
    patient_doctor = RadioField('Label', choices=[('Patient','PATIENT'),('Doctor','DOCTOR')])
    submit = SubmitField(label='Create Account')

Here is the corresponding jinja2

{{ form.patient_doctor(class="form-button") }}

I would like the two bullet points on the very far left of the page to go away.


问:
"Dead-letter" messages in deleted queue in RabbitMQ?
I asked a question with similar architecture here: RabbitMQ sends message from one queue to another

But I'll write it here again anyway.

I have a chat application that uses RabbitMQ for the communication between servers. I'm using Consistent Hash Exchange to make sure that one message for a particular user will go to the same queue. And for one queue there is at most one consumer for that queue, hence ensuring message ordering. This means every consumer will create its own unique queue (auto-delete) and bind the newly created queue to the consistent hash exchange.

The problem is, when consumers die, maybe because of lost connection to the broker or any other reasons, the queue is gone, and unprocessed messages inside the queue is gone as well.

Is it possible to "dead-letter" those unprocessed messages? Or is there any better solutions?


问:
Deletion from Binary Tree C++
I have written a delete function in a binary tree implementation and am having trouble when a node has two children. It seems to copy the data I need into the node to be deleted, but when I go to delete the successor node, I get a seg fault.

Class Def

```<code>#include <iostream>

template <typename T>
class Set
{
private:
    class Node
    {
        public:
            T data;
            Node *left;
            Node *right;
            Node(T key)
            {
                this->data = key;
                this->left = this->right = nullptr;
            }
    };
    Node *root; int size;

public:
    Set();
    ~Set();
    void insert(T key);
    Node *insert(Node *&ptr, T key);
    void remove(T key);
    Node *remove(Node *&, T key);
    bool contains(T key);
    bool contains(Node *&ptr, T key);
    void cutDown(Node *ptr);
    int getSize();
    void print();
    void print(Node *ptr);
};

</code>```

Construct

```<code>template <typename T>
Set<T>::Set()
{
    root = nullptr; size = 0;
}
</code>```

Insert

```<code>template <typename T>
void Set<T>::insert(T key)
{
   // std::cout << "inserted...\n";
    insert(root, key);
}

template <typename T>
typename Set<T>::Node *Set<T>::insert(Node *&ptr, T key)
{
    if (contains(key) == false)
    {
        if (ptr == nullptr)
        {
            ++size;
            Node *temp = new Node(key);
            ptr = temp;
            return ptr;
        }
        else
        {
            Node *temp = ptr;
            if (key > temp->data)
            {
                temp->right = insert(temp->right, key);
            }
            else if (key < temp->data)
            {
                temp->left = insert(temp->left, key);
            }
        }
    }
    else
    {
        return nullptr;
    }
    return ptr;
}
</code>```

Remove

```<code>template <typename T>
void Set<T>::remove(T key)
{
    remove(root, key);
    std::cout << "deleted...\n\n";
    --size;
}

template <typename T>
typename Set<T>::Node *Set<T>::remove(Node *&ptr, T key)
{
    //std::cout << "data = " << root->right->data << "\n";
    if (key > ptr->data)
    {
        std::cout << "greater...\n";
        ptr->right = remove(ptr->right, key);
    }
    else if (key < ptr->data)
    {
        std::cout << "less...\n";
        ptr->left = remove(ptr->left, key);
    }
    else
    {
        if (!ptr->left && !ptr->right) //no children
        {
            std::cout << "case 1...\n";
            delete ptr;
            ptr = nullptr;
            //--size;
        }
        else if (ptr->left && ptr->right) //two children
        {
            std::cout << "case 2...\n";
            Node *child = ptr->right;
            //std::cout << "child data: " << child->data << "\n";
            Node *p = child;
            while (child->left != nullptr)
            {
                child = child->left;
            }
            ptr->data = child->data;
            //std::cout << "data = " << p->data << "\n";
            std::cout << "next data: " << p->left->data << "\n";
            p->left = remove(p->left, child->data);
            //child = nullptr;
        }
        else                             //one child
        {
            std::cout << "case 3...\n";
            Node *node = ptr;
            Node *hold = (ptr->left)? ptr->left : ptr->right;
            node = hold;
            delete hold;
            //--size;
           // return ptr;
        }
    }
    return ptr;
}
</code>```

Contains

```<code>template <typename T>
bool Set<T>::contains(T key)
{
    return contains(root, key);
}

template <typename T>
bool Set<T>::contains(Node *&ptr, T key)
{
   // std::cout << ptr << "\n";
    Node *hold = ptr;
    while (hold != nullptr)
    {
        if (hold->data == key)
        {
            return true;
        }

            if (hold->data > key)
            {
                hold = hold->left;
            }
            else
            {
                hold = hold->right;
            }

    }
    return false;
}
</code>```

getSize just returns size.

Title: Deletion from Binary Tree C++

Body:
I have written a delete function in a binary tree implementation and am having trouble when a node has two children. It seems to copy the data I need into the node to be deleted, but when I go to delete the successor node, I get a seg fault.

Class Def

#include <iostream>

template <typename T>
class Set
{
private:
    class Node
    {
        public:
            T data;
            Node *left;
            Node *right;
            Node(T key)
            {
                this->data = key;
                this->left = this->right = nullptr;
            }
    };
    Node *root; int size;

public:
    Set();
    ~Set();
    void insert(T key);
    Node *insert(Node *&ptr, T key);
    void remove(T key);
    Node *remove(Node *&, T key);
    bool contains(T key);
    bool contains(Node *&ptr, T key);
    void cutDown(Node *ptr);
    int getSize();
    void print();
    void print(Node *ptr);
};

Construct

template <typename T>
Set<T>::Set()
{
    root = nullptr; size = 0;
}

Insert

template <typename T>
void Set<T>::insert(T key)
{
   // std::cout << "inserted...\n";
    insert(root, key);
}

template <typename T>
typename Set<T>::Node *Set<T>::insert(Node *&ptr, T key)
{
    if (contains(key) == false)
    {
        if (ptr == nullptr)
        {
            ++size;
            Node *temp = new Node(key);
            ptr = temp;
            return ptr;
        }
        else
        {
            Node *temp = ptr;
            if (key > temp->data)
            {
                temp->right = insert(temp->right, key);
            }
            else if (key < temp->data)
            {
                temp->left = insert(temp->left, key);
            }
        }
    }
    else
    {
        return nullptr;
    }
    return ptr;
}

Remove

template <typename T>
void Set<T>::remove(T key)
{
    remove(root, key);
    std::cout << "deleted...\n\n";
    --size;
}

template <typename T>
typename Set<T>::Node *Set<T>::remove(Node *&ptr, T key)
{
    //std::cout << "data = " << root->right->data << "\n";
    if (key > ptr->data)
    {
        std::cout << "greater...\n";
        ptr->right = remove(ptr->right, key);
    }
    else if (key < ptr->data)
    {
        std::cout << "less...\n";
        ptr->left = remove(ptr->left, key);
    }
    else
    {
        if (!ptr->left && !ptr->right) //no children
        {
            std::cout << "case 1...\n";
            delete ptr;
            ptr = nullptr;
            //--size;
        }
        else if (ptr->left && ptr->right) //two children
        {
            std::cout << "case 2...\n";
            Node *child = ptr->right;
            //std::cout << "child data: " << child->data << "\n";
            Node *p = child;
            while (child->left != nullptr)
            {
                child = child->left;
            }
            ptr->data = child->data;
            //std::cout << "data = " <
data << "\n";
            std::cout << "next data: " <
left->data << "\n";
            p->left = remove(p->left, child->data);
            //child = nullptr;
        }
        else                             //one child
        {
            std::cout << "case 3...\n";
            Node *node = ptr;
            Node *hold = (ptr->left)? ptr->left : ptr->right;
            node = hold;
            delete hold;
            //--size;
           // return ptr;
        }
    }
    return ptr;
}

Contains

template <typename T>
bool Set<T>::contains(T key)
{
    return contains(root, key);
}

template <typename T>
bool Set<T>::contains(Node *&ptr, T key)
{
   // std::cout << ptr << "\n";
    Node *hold = ptr;
    while (hold != nullptr)
    {
        if (hold->data == key)
        {
            return true;
        }

            if (hold->data > key)
            {
                hold = hold->left;
            }
            else
            {
                hold = hold->right;
            }

    }
    return false;
}

getSize just returns size.


问:
Could Not push changes into Github from Git
warning: could not find UI helper 'GitHub.UI'

this is the message displayed in Git bash. I believe it is a problem of signing in the account using the default browser

does anyone know any fixes for this?


Title: Any dict-like mappable objects in Python that only show preview of contents when __repr__?

Body:
I'm looking for an object I can use to store largish dataframes and sklearn objects. Ideally I would like to store them as pd.Series because it has the behavior I'm looking for in that I can do the following:

Get the object using some key:value pair

Preview truncates large outputs

Can reveal the keys inside easily

I can use pd.Series objects but don't know if the practice of storing complicated objects as values is frowned upon.

Are there any other options I can use in the builtin library, pandas, numpy, scipy, or scikit-learn?

import numpy as np
x = np.arange(100)
y = list("abcde")*20
d = {"x":x, "y":y}
d
# {'x': array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]), 'y': ['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e']}

from collections import namedtuple
nt = namedtuple("Example", ["x","y"])
nt(x=x, y=y)
# Example(x=array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
#        17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
#        34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
#        51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
#        68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
#        85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]), y=['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e'])

from sklearn.utils import Bunch
b = Bunch(x=x, y=y)
b
# {'x': array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]), 'y': ['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e']}

import pandas as pd
pd.Series({"x":x, "y":y})
# x    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 7...
# y    [a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d, e, a, b, c, d...
# dtype: object


问:
How to calculate number of queries executed on a particular database for past 5 mins in MySQL
I want to know how many queries being executed in a particular database for a past 5 min(given time). I used a table performance_schema.events_statements_summary_by_digest to calculate the count, but the issue in that is for each query it has the sum_count(total number of time the query have been executed) i.e if a query is executed once in past 5 min, but executed 100 times before 5 mins, the count is returned as 101, i want only execution count for the past 5 min

the query i used :

```<code>SELECT IFNULL(SUM(COUNT_STAR),0) AS count,
       IFNULL(SUM(SUM_TIMER_WAIT)/1000000000,0) AS avg_waittime,
       IFNULL(SUM(SUM_LOCK_TIME)/1000000000,0) AS avg_locktime,
       IFNULL(SUM(SUM_ERRORS),0) AS avg_error,
       IFNULL(SUM(SUM_WARNINGS),0) AS avg_warning,
       IFNULL(SUM(SUM_ROWS_AFFECTED),0) AS avg_rows_affected,
       IFNULL(SUM(SUM_ROWS_SENT),0) AS avg_rows_sent,
       IFNULL(SUM(SUM_CREATED_TMP_DISK_TABLES),0) AS avg_tmp_disk_tb_crt,
       IFNULL(SUM(SUM_CREATED_TMP_TABLES),0) AS avg_tmp_tb_crt,
       IFNULL(SUM(SUM_ERRORS),0) as sum_error,
       IFNULL(SUM(SUM_WARNINGS),0) as sum_warning
FROM performance_schema.events_statements_summary_by_digest
WHERE SCHEMA_NAME='test_db'
AND LAST_SEEN > DATE_SUB(NOW(), INTERVAL 300 SECOND)
</code>```

please help me to find this

Body:
I want to know how many queries being executed in a particular database for a past 5 min(given time). I used a table performance_schema.events_statements_summary_by_digest to calculate the count, but the issue in that is for each query it has the sum_count(total number of time the query have been executed) i.e if a query is executed once in past 5 min, but executed 100 times before 5 mins, the count is returned as 101, i want only execution count for the past 5 min

the query i used :

SELECT IFNULL(SUM(COUNT_STAR),0) AS count,
       IFNULL(SUM(SUM_TIMER_WAIT)/1000000000,0) AS avg_waittime,
       IFNULL(SUM(SUM_LOCK_TIME)/1000000000,0) AS avg_locktime,
       IFNULL(SUM(SUM_ERRORS),0) AS avg_error,
       IFNULL(SUM(SUM_WARNINGS),0) AS avg_warning,
       IFNULL(SUM(SUM_ROWS_AFFECTED),0) AS avg_rows_affected,
       IFNULL(SUM(SUM_ROWS_SENT),0) AS avg_rows_sent,
       IFNULL(SUM(SUM_CREATED_TMP_DISK_TABLES),0) AS avg_tmp_disk_tb_crt,
       IFNULL(SUM(SUM_CREATED_TMP_TABLES),0) AS avg_tmp_tb_crt,
       IFNULL(SUM(SUM_ERRORS),0) as sum_error,
       IFNULL(SUM(SUM_WARNINGS),0) as sum_warning
FROM performance_schema.events_statements_summary_by_digest
WHERE SCHEMA_NAME='test_db'
AND LAST_SEEN > DATE_SUB(NOW(), INTERVAL 300 SECOND)

please help me to find this


问:
fill relation ManyToMany nestjs typeorm
I have a query, I'm trying to create a ManyToMany relationship between 2 tables (products and orders) the tables are created fine, but when I want to add the logic in the service to create the records I don't understand how it should be.
This is what I have written till now:

```<code>@Entity('pedido')
export class Pedido {
  @PrimaryGeneratedColumn()
  id: number;

  @ManyToMany(() => Product)
  @JoinTable({
    name: 'pedidos_products',
    joinColumn: {
      name: 'pedido_id',
    },
    inverseJoinColumn: {
      name: 'product_id',
    },
  })
  product: Product[];

  @Column('decimal')
  quantity: number;

  @Column('decimal')
  price: number;
}
</code>```
```<code>@Entity('product')
export class Product {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @ManyToOne(() => Category, (category) => category.product)
  category: Category;

  @ManyToMany(() => Pedido)
  pedido: Pedido[];
}
</code>```

Service:

```<code>async createPedido(body: any) {
    const pedidos = body;
    const pedidoInstance = new Pedido();
    const productsIds = [];
    pedidos.forEach(async (item: any) => {
      productsIds.push(item.product_id);
      pedidoInstance.price = item.price;
      pedidoInstance.quantity = item.quantity;
      pedidoInstance.product = productsIds;
      await this.pedidoRepository.save(pedidoInstance);
    });

    return {
      ok: true,
    };
  }
</code>```

Title: fill relation ManyToMany nestjs typeorm

Body:
I have a query, I'm trying to create a ManyToMany relationship between 2 tables (products and orders) the tables are created fine, but when I want to add the logic in the service to create the records I don't understand how it should be.
This is what I have written till now:

@Entity('pedido')
export class Pedido {
  @PrimaryGeneratedColumn()
  id: number;

  @ManyToMany(() => Product)
  @JoinTable({
    name: 'pedidos_products',
    joinColumn: {
      name: 'pedido_id',
    },
    inverseJoinColumn: {
      name: 'product_id',
    },
  })
  product: Product[];

  @Column('decimal')
  quantity: number;

  @Column('decimal')
  price: number;
}

@Entity('product')
export class Product {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @ManyToOne(() => Category, (category) => category.product)
  category: Category;

  @ManyToMany(() => Pedido)
  pedido: Pedido[];
}

Service:

async createPedido(body: any) {
    const pedidos = body;
    const pedidoInstance = new Pedido();
    const productsIds = [];
    pedidos.forEach(async (item: any) => {
      productsIds.push(item.product_id);
      pedidoInstance.price = item.price;
      pedidoInstance.quantity = item.quantity;
      pedidoInstance.product = productsIds;
      await this.pedidoRepository.save(pedidoInstance);
    });

    return {
      ok: true,
    };
  }


问:
Problems with Amplify and Vite
I am getting errors while setting up Amplify Authentication with React and Vite.

This is what I have tried already.

Packages used:

```<code>"@aws-amplify/ui-react": 4.2.0
"aws-amplify": 5.0.5
</code>```

Main.jsx

```<code>import Amplify from "aws-amplify"
import awsExports from "./aws-exports"
Amplify.configure(awsExports)
</code>```

vite.config.js

```<code>import { defineConfig } from 'vite'
import postcss from './postcss.config.js'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  define: {
    'process.env': process.env,
    'global': {}
  },
  css: {
    postcss,
  },
  plugins: [react()],
  resolve: {
    alias: [
      {
        find: /^~.+/,
        replacement: (val) => {
          return val.replace(/^~/, "");
        },
      },
      {
        find: './runtimeConfig', replacement: './runtimeConfig.browser',
      }
    ],
  },
  build: {
    commonjsOptions: {
      transformMixedEsModules: true,
    }
  }
})

</code>```

Running, npm run dev, app crashes and console has this error:

```<code>'Uncaught SyntaxError: The requested module '/node_modules/.vite/aws-amplify.js?v=d4f24853' does not provide an export named 'default' (at main.jsx:5:1)'
</code>```

Title: Problems with Amplify and Vite

Body:
I am getting errors while setting up Amplify Authentication with React and Vite.

This is what I have tried already.

Packages used:

"@aws-amplify/ui-react": 4.2.0
"aws-amplify": 5.0.5

Main.jsx

import Amplify from "aws-amplify"
import awsExports from "./aws-exports"
Amplify.configure(awsExports)

vite.config.js

import { defineConfig } from 'vite'
import postcss from './postcss.config.js'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  define: {
    'process.env': process.env,
    'global': {}
  },
  css: {
    postcss,
  },
  plugins: [react()],
  resolve: {
    alias: [
      {
        find: /^~.+/,
        replacement: (val) => {
          return val.replace(/^~/, "");
        },
      },
      {
        find: './runtimeConfig', replacement: './runtimeConfig.browser',
      }
    ],
  },
  build: {
    commonjsOptions: {
      transformMixedEsModules: true,
    }
  }
})

Running, npm run dev, app crashes and console has this error:

'Uncaught SyntaxError: The requested module '/node_modules/.vite/aws-amplify.js?v=d4f24853' does not provide an export named 'default' (at main.jsx:5:1)'


问:
How to select a one-or-more group ()+ to replace with the same group in VS Code regex
In the source code directory, I want to move a file into a subfolder in current directory
example:
from

```<code>root/index.js
</code>```

into

```<code>root/subfolder/index.js
</code>```

In index.js I have many import lines like this:

```<code>import Styles from '../../../Styles';
</code>```

The point is, I want to replace '../../../Styles'; with '../../../../Styles';

Can anyone help me with that? I tried to replace (\.\.\/)+ with ../$1 but It only returns ../../

replace with regex in Visual Studio Code

Body:
In the source code directory, I want to move a file into a subfolder in current directory
example:
from

root/index.js

into

root/subfolder/index.js

In index.js I have many import lines like this:

import Styles from '../../../Styles';

The point is, I want to replace '../../../Styles'; with '../../../../Styles';

Can anyone help me with that? I tried to replace (\.\.\/)+ with ../$1 but It only returns ../../

replace with regex in Visual Studio Code


问:
I have a problem with my dataset clasification
I latino so mi english is not so good, but i try to explain my problem.

I have a dataset with 3 clasess, but when i try validation the dataset with else image, only recognize a 1 class, but i have 3, i follow the tutorials but i think that the problem is the file coco128.yml when i try to custom.

```<code>train: /content/dataset-train/images/train
val: /content/dataset-train/images/validation
test:  # test images (optional)

# Classes
nc: 3
names:
  0: pitbull
  1: husky
  2: sanbernando

</code>```

this is my code, but only recognize the class "pitbull" someone can help me?

```<code>train: /content/dataset-train/images/train
val: /content/dataset-train/images/validation
test:  # test images (optional)

# Classes
nc: 3
names: ["pitbull","husky","sanbernando"]
</code>```

before try this way, but cant work same, i dont know how fix.

Body:
I latino so mi english is not so good, but i try to explain my problem.

I have a dataset with 3 clasess, but when i try validation the dataset with else image, only recognize a 1 class, but i have 3, i follow the tutorials but i think that the problem is the file coco128.yml when i try to custom.

train: /content/dataset-train/images/train
val: /content/dataset-train/images/validation
test:  # test images (optional)

# Classes
nc: 3
names:
  0: pitbull
  1: husky
  2: sanbernando

this is my code, but only recognize the class "pitbull" someone can help me?

train: /content/dataset-train/images/train
val: /content/dataset-train/images/validation
test:  # test images (optional)

# Classes
nc: 3
names: ["pitbull","husky","sanbernando"]

before try this way, but cant work same, i dont know how fix.


问:
How do I return variables in my Class with __str__ while not messing with the printed class?
```<code>class Amazon:
def __init__(self):
    self.bestsellers = []
def read_books_csv(self, path):
    with open(path, encoding='utf-8-sig') as csvfile:
        spam = csv.reader(csvfile)
        iterator = iter(spam)
        next(iterator)
        for x in spam:
            if x[6] == 'Fiction':
                print(x)
                self.bestsellers.append(FictionBook(*x[0:7]))
class FictionBook(Book):
def __init__(self, title, author, rating, reviews, price, year, genre):
    super().__init__(title, author, rating, reviews, price, year, genre)
def __str__(self):
    return f"{self.title} : {self.genre} {self.year[0]}"
</code>```

In my class FictionBook my str method returns 3 variables that have to stay that way when printed. However, I also have to created a bestseller list(bestsellers) in my 'Amazon' class with FictionBook objects inside that list. These objects need every attribute of FictionBook (title, author, rating, reviews, price, year, genre)

Now I only add title, genre and year to my bestseller list.

How do I go around this? My str in FictionBook can not change according to the assignment I have to do.

Body:
class Amazon:
def __init__(self):
    self.bestsellers = []
def read_books_csv(self, path):
    with open(path, encoding='utf-8-sig') as csvfile:
        spam = csv.reader(csvfile)
        iterator = iter(spam)
        next(iterator)
        for x in spam:
            if x[6] == 'Fiction':
                print(x)
                self.bestsellers.append(FictionBook(*x[0:7]))
class FictionBook(Book):
def __init__(self, title, author, rating, reviews, price, year, genre):
    super().__init__(title, author, rating, reviews, price, year, genre)
def __str__(self):
    return f"{self.title} : {self.genre} {self.year[0]}"

In my class FictionBook my str method returns 3 variables that have to stay that way when printed. However, I also have to created a bestseller list(bestsellers) in my 'Amazon' class with FictionBook objects inside that list. These objects need every attribute of FictionBook (title, author, rating, reviews, price, year, genre)

Now I only add title, genre and year to my bestseller list.

How do I go around this? My str in FictionBook can not change according to the assignment I have to do.


问:
innerHTML don't update tags
i want to see a icon , if both password are the same. But in my Javascript the inlineHTML don't update next to the label tag.

HTML Code
JavaScript Code

I tried in diffrent ways, but it is not reflect on browser and i don't have an error or something else.

Title: innerHTML don't update tags


问:
Excel file repeatedly repaired, but "we found a problem with some content" won't go away
I've tried repairing an Excel file repeatedly, but I keep getting the same error.  I've also copied all the tabs and modules to a new file.  And I've copied just the used cells to new tabs.  No approach permanently resolves the problem.  The initial error message is "We found a problem with some content in ."  After repairing, I get

The error log contains:

```<code><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error092360_04.xml</logFileName>
<summary>Errors were detected in file 'N:\Valuation Archive\MLA\SMI\2022-02-17
  \FinalData\FinalData2\Updates 2021\SMI PIT Data 2021 with UW window checks rep2.xlsm'</summary>
<repairedRecords><repairedRecord>Repaired Records: Table from /xl/tables/table6.xml part (Table)
  </repairedRecord></repairedRecords>
</recoveryLog>
</code>```

I've tried every online suggestion I could find, to no avail.

My question is, is there some way I can access the bad records in "/xl/tables/table6.xml part" and perhaps correct the problem there?  I have no idea where that would be.  Excel seems to be incapable of saving its corrections to that table.

Body:
I've tried repairing an Excel file repeatedly, but I keep getting the same error.  I've also copied all the tabs and modules to a new file.  And I've copied just the used cells to new tabs.  No approach permanently resolves the problem.  The initial error message is "We found a problem with some content in ."  After repairing, I get

The error log contains:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error092360_04.xml</logFileName>
Errors were detected in file 'N:\Valuation Archive\MLA\SMI\2022-02-17
  \FinalData\FinalData2\Updates 2021\SMI PIT Data 2021 with UW window checks rep2.xlsm'
<repairedRecords><repairedRecord>Repaired Records: Table from /xl/tables/table6.xml part (Table)
  </repairedRecord></repairedRecords>
</recoveryLog>

I've tried every online suggestion I could find, to no avail.

My question is, is there some way I can access the bad records in "/xl/tables/table6.xml part" and perhaps correct the problem there?  I have no idea where that would be.  Excel seems to be incapable of saving its corrections to that table.


问:
DbContext Lifetime Performance Difference
I am trying out how to use linq the proper way with Entity Framework DbContext, I made a simple query as below :

   public List<Category> FindAllCategories(int page, int pageSize, string name) {
        List<Category> categories;
        using (var dbContext = new NorthwindContext()) {
            IQueryable<Category> queryResult =
                from category
                    in dbContext.Categories
                where category.CategoryName.Contains(name)
                orderby category.CategoryName
                select category;

            queryResult
                .Skip(page - 1 * pageSize)
                .Take(pageSize);

            categories = queryResult.ToList();
        }
        return categories;
    }
```
<p>But I wonder is the <code>using</code> brackets are needed? Could I just write this and have the same performance result? Like this:</p>
```    public List<Category> FindAllCategories(int page, int pageSize, string name) {
        using var dbContext = new NorthwindContext();
        IQueryable<Category> queryResult =
            from category
                in dbContext.Categories
            where category.CategoryName.Contains(name)
            orderby category.CategoryName
            select category;

        queryResult
            .Skip(page - 1 * pageSize)
            .Take(pageSize);

        return queryResult.ToList();
    }
```

Will this produce a difference in terms of anything?

Body:
I am trying out how to use linq the proper way with Entity Framework DbContext, I made a simple query as below :

   public List<Category> FindAllCategories(int page, int pageSize, string name) {
        List<Category> categories;
        using (var dbContext = new NorthwindContext()) {
            IQueryable<Category> queryResult =
                from category
                    in dbContext.Categories
                where category.CategoryName.Contains(name)
                orderby category.CategoryName
                select category;

            queryResult
                .Skip(page - 1 * pageSize)
                .Take(pageSize);

            categories = queryResult.ToList();
        }
        return categories;
    }

But I wonder is the using brackets are needed? Could I just write this and have the same performance result? Like this:

    public List<Category> FindAllCategories(int page, int pageSize, string name) {
        using var dbContext = new NorthwindContext();
        IQueryable<Category> queryResult =
            from category
                in dbContext.Categories
            where category.CategoryName.Contains(name)
            orderby category.CategoryName
            select category;

        queryResult
            .Skip(page - 1 * pageSize)
            .Take(pageSize);

        return queryResult.ToList();
    }

Will this produce a difference in terms of anything?


问:
Using visual studio VB MVC and the dropdown menu is visible but not working
I am new to MVC and not sure what is going wrong here, but I feel it has something to do with popper.js and bootstrap. Everything looks good when I debug it, except the dropdown menu actually does not work.

I assume I am not loading the scripts properly, but I believe I am getting tripped up by the fact that NuGet does not have the most up to date version of popper.js for some reason, so I downloaded the file using the cdn reference, but there must be a way to link to the most up to date script.

This is a layout page if that has any impact.

```<code><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="#">App</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="navbar-collapse collapse" id="navbarSupportedContent" style="">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link active" href="~/Home">
                            Home
                            <span class="visually-hidden">(current)</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Features</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Pricing</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="~/Home/About">About</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</a>
                        <div class="dropdown-menu">
                            <a class="dropdown-item" href="#">Action</a>
                            <a class="dropdown-item" href="#">Another action</a>
                            <a class="dropdown-item" href="#">Something else here</a>
                            <div class="dropdown-divider"></div>
                            <a class="dropdown-item" href="#">Separated link</a>
                        </div>
                    </li>
                </ul>
                <form class="d-flex">
                    <input class="form-control me-sm-2" type="search" placeholder="Search">
                    <button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
                </form>
            </div>
        </div>
    </nav>
    <div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>© @DateTime.Now.Year - App</p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required:=False)

</body>
</html>
</code>```

Body:
I am new to MVC and not sure what is going wrong here, but I feel it has something to do with popper.js and bootstrap. Everything looks good when I debug it, except the dropdown menu actually does not work.

I assume I am not loading the scripts properly, but I believe I am getting tripped up by the fact that NuGet does not have the most up to date version of popper.js for some reason, so I downloaded the file using the cdn reference, but there must be a way to link to the most up to date script.

This is a layout page if that has any impact.

<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")

            App
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">

            </button>

                            Home
                            (current)

                        Features

                        Pricing

                        About

                        Dropdown

                            Action
                            Another action
                            Something else here

                            Separated link

                <form class="d-flex">
                    <input class="form-control me-sm-2" type="search" placeholder="Search">
                    <button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
                </form>

        @RenderBody()

© @DateTime.Now.Year - App

    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required:=False)


问:
ValueError: matmul: Input operand 0 does not have enough dimensions (has 0, gufunc core with signature (n?,k),(k,m?)->(n?,m?) requires 1)
I am new to the box and the A.I program, and I don't know how to solve this problem:

```<code>!rm -f winequality-red.csv winequality-white.csv
!wget https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv
!wget https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv

import pandas as pd
import numpy as np
import math, random
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d

df_red = pd.read_csv('winequality-red.csv',delimiter=";")

#Como estamos realizando una tarea de clasificación, les asignaremos a todos los vinos tintos la etiqueta 1
df_red["color"] = 1

#El método .head() es muy útil para previsualizar los datos
df_red.head()

df_white = pd.read_csv('winequality-white.csv',delimiter=";")
df_white["color"] = 0  #Asignaremos a todos los vinos blancos la etiqueta 0
df_white.head()

df = pd.concat([df_red, df_white])

#Y mezclamos los datos de los vinos blancos y los tintos
df = df.sample(frac=1).reset_index(drop=True)
df.head()

#Elegimos tres atributos en los que basar la predicción
input_columns = ["citric acid", "residual sugar", "total sulfur dioxide"]
output_columns = ["color"]

#Extraemos los atributos relevantes en los arrays x e y
X = df[input_columns].to_numpy()
Y = df[output_columns].to_numpy()
print("Shape of X:", X.shape)
print("Shape of Y:", Y.shape)
in_features = X.shape[1]

class SingleNeuronModel():
    def __init__(self, in_features):
        #self.w = np.zeros(in_features)
        #self.w_0 = 0.
        # Es preferible definir los pesos iniciales como valores pequeños distribuidos de forma normal
        self.w = 0.01 * np.random.randn(in_features)
        self.w_0 = 0.01 * np.random.randn()
        self.non_zero_tolerance = 1e-8 # add this to divisions to ensure we don't divide by 0

    def forward(self, x):
        # Calcular y guardar la preactivación z
        self.z = x @ self.w.T + self.w_0

        # Aplicar la función de activación y devolver
        self.a = self.activation(self.z)
        return self.a

    def activation(self, z):
        raise ImplementationError("activation method should be implemented by subclass")

    # Calcular y guardar el gradiente del output respecto a los pesos
    def gradient(self, x):
        raise ImplementationError("gradient method should be implemented by subclass")

    # Actualizar los pesos en función de los gradientes y la tasa de aprendizaje
    def update(self, grad_loss, learning_rate):
        model.w   -= grad_loss * self.grad_w   * learning_rate
        model.w_0 -= grad_loss * self.grad_w_0 * learning_rate

# Reimplementar el modelo de regresión de una sola neurona usando la base SingleNeuronModel
class SingleNeuronRegressionModel(SingleNeuronModel):
    # Función de activación lineal para el modelo de regresión
    def activation(self, z):
        return z

    # Gradiente del output respecto a los pesos para la activación lineal
    def gradient(self, x):
        self.grad_w = x
        self.grad_w_0 = 1.

# ¡Nueva implementación! Modelo de clasificación de una sola neurona
class SingleNeuronClassificationModel(SingleNeuronModel):
    # Función de activación sigmoide para la clasificación
    def activation(self, z):
        return 1 / (1 + np.exp(-z) + self.non_zero_tolerance)

    # Gradiente del output respecto a los pesos para la activación sigmoide
    def gradient(self, x):
        self.grad_w = self.a * (1-self.a) * x
        self.grad_w_0 = self.a * (1-self.a)

def train_model_NLL_loss(model, input_data, output_data,
                         learning_rate, num_epochs):
    non_zero_tolerance = 1e-8 # Añadir esto a los cálculos de log para garantizar que no tomamos el log de 0
    num_samples = len(input_data)
    for epoch in range(1, num_epochs+1):
        total_loss = 0 # Hacer un seguimiento de la pérdida total en todo el conjunto de datos

        for i in range(num_samples):
            x = input_data[i,...]
            y = output_data[i]
            y_predicted = model.forward(x)

            # Función de pérdida de NLL
            loss = -(y * np.log(y_predicted + non_zero_tolerance) + (1-y) * np.log(1-y_predicted + non_zero_tolerance))
            total_loss += loss

            # Gradiente de la predicción respecto a los pesos
            model.gradient(x)

            # Gradiente de la pérdida respecto a la predicción para NLL
            grad_loss = (y_predicted - y)/(y_predicted * (1-y_predicted))

            #Actualizar el modelo en función del gradiente
            model.update(grad_loss, learning_rate)

        report_every = max(1, num_epochs // 10)
        if epoch == 1 or epoch % report_every == 0: # Cada pocos ciclos, generar un informe
            print("epoch", epoch, "has total loss", total_loss)

# Utilizaremos esta función para evaluar el rendimiento de nuestro clasificador entrenado
def evaluate_classification_accuracy(model, input_data, labels):
    # Contar el número de muestras clasificadas correctamente dado un conjunto de pesos
    correct = 0
    num_samples = len(input_data)
    for i in range(num_samples):
        x = input_data[i,...]
        y = labels[i]
        y_predicted = model.forward(x)
        label_predicted = 1 if y_predicted > 0.5 else 0
        if label_predicted == y:
            correct += 1

    accuracy = correct / num_samples
    print("Our model predicted", correct, "out of", num_samples,
          "correctly for", accuracy*100, "% accuracy")
    return accuracy

input_data = np.array(["citric acid", "residual sugar", "total sulfur dioxide"])
labels = ["color"]

def plot_3d_dataset(x, y):
    x_np_3d = np.array(x)
    x_np_3d.reshape(len(x),3)
    colors = []
    for label in y:
        if label == 0:
            colors.append("red")
        else:
            colors.append("blue")
    fig = plt.figure()
    ax = plt.axes(projection='3d')
    ax.scatter3D(x_np_3d[...,0], x_np_3d[...,1],x_np_3d[...,2], color = colors)
    return ax

def plot_3d_decision_boundary(ax, w, w_0):
  x = np.linspace(-1,4,10)
  y = np.linspace(-1,6,10)
  X,Y = np.meshgrid(x,y)
  Z = (-X*w[0] - Y*w[1] - w_0)/w[2]
  surf = ax.plot_surface(X, Y, Z)
  ax.set_zlim(-10,5)
  return

model = SingleNeuronClassificationModel(in_features=len(input_data[0]))
learning_rate =0.001
epochs = 200

train_model_NLL_loss(model, input_data, labels, learning_rate, epochs)
print("\nFinal weights:")
print(model.w, model.w_0)
evaluate_classification_accuracy(model, input_data, labels)
ax=plot_3d_dataset(input_data, labels)
plot_3d_decision_boundary(ax, model.w, model.w_0)
plt.show()

</code>```

Utilice Pandas para leer el archivo cvs en un marco de datos
Proceso de entrenamiento, utilizando la pérdida de log-verosimilitud negativa,más adecuada para problemas de clasificación
The class implementation of the single neuron classifier must be trained to carry out a binary classification of wine by color according to its characteristics.
I need help beacouse i´m new in this language.

The error is :

```<code>-------------------------------------------------------------------
enter code here       ValueError Traceback (most recent call last)
<ipython-input-19-e78d64c8d9e7> in <module>
      5 epochs = 200
      6
----> 7 train_model_NLL_loss(model, input_data, labels, learning_rate, epochs)
      8 print("\nFinal weights:")
      9 print(model.w, model.w_0)

1 frames
<ipython-input-14-654d498667a7> in train_model_NLL_loss(model, input_data, output_data, learning_rate, num_epochs)
     68             x = input_data[i,...]
     69             y = output_data[i]
---> 70             y_predicted = model.forward(x)
     71
     72             # Función de pérdida de NLL

<ipython-input-14-654d498667a7> in forward(self, x)
     11     def forward(self, x):
     12         # Calcular y guardar la preactivación z
---> 13         self.z = x @ self.w.T + self.w_0
     14
     15         # Aplicar la función de activación y devolver

ValueError: matmul: Input operand 0 does not have enough dimensions (has 0, gufunc core with signature (n?,k),(k,m?)->(n?,m?) requires 1)
</code>```

Body:
I am new to the box and the A.I program, and I don't know how to solve this problem:

!rm -f winequality-red.csv winequality-white.csv
!wget https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv
!wget https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv

import pandas as pd
import numpy as np
import math, random
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d

df_red = pd.read_csv('winequality-red.csv',delimiter=";")

#Como estamos realizando una tarea de clasificación, les asignaremos a todos los vinos tintos la etiqueta 1
df_red["color"] = 1

#El método .head() es muy útil para previsualizar los datos
df_red.head()

df_white = pd.read_csv('winequality-white.csv',delimiter=";")
df_white["color"] = 0  #Asignaremos a todos los vinos blancos la etiqueta 0
df_white.head()

df = pd.concat([df_red, df_white])

#Y mezclamos los datos de los vinos blancos y los tintos
df = df.sample(frac=1).reset_index(drop=True)
df.head()

#Elegimos tres atributos en los que basar la predicción
input_columns = ["citric acid", "residual sugar", "total sulfur dioxide"]
output_columns = ["color"]

#Extraemos los atributos relevantes en los arrays x e y
X = df[input_columns].to_numpy()
Y = df[output_columns].to_numpy()
print("Shape of X:", X.shape)
print("Shape of Y:", Y.shape)
in_features = X.shape[1]

class SingleNeuronModel():
    def __init__(self, in_features):
        #self.w = np.zeros(in_features)
        #self.w_0 = 0.
        # Es preferible definir los pesos iniciales como valores pequeños distribuidos de forma normal
        self.w = 0.01 * np.random.randn(in_features)
        self.w_0 = 0.01 * np.random.randn()
        self.non_zero_tolerance = 1e-8 # add this to divisions to ensure we don't divide by 0

    def forward(self, x):
        # Calcular y guardar la preactivación z
        self.z = x @ self.w.T + self.w_0

        # Aplicar la función de activación y devolver
        self.a = self.activation(self.z)
        return self.a

    def activation(self, z):
        raise ImplementationError("activation method should be implemented by subclass")

    # Calcular y guardar el gradiente del output respecto a los pesos
    def gradient(self, x):
        raise ImplementationError("gradient method should be implemented by subclass")

    # Actualizar los pesos en función de los gradientes y la tasa de aprendizaje
    def update(self, grad_loss, learning_rate):
        model.w   -= grad_loss * self.grad_w   * learning_rate
        model.w_0 -= grad_loss * self.grad_w_0 * learning_rate

# Reimplementar el modelo de regresión de una sola neurona usando la base SingleNeuronModel
class SingleNeuronRegressionModel(SingleNeuronModel):
    # Función de activación lineal para el modelo de regresión
    def activation(self, z):
        return z

    # Gradiente del output respecto a los pesos para la activación lineal
    def gradient(self, x):
        self.grad_w = x
        self.grad_w_0 = 1.

# ¡Nueva implementación! Modelo de clasificación de una sola neurona
class SingleNeuronClassificationModel(SingleNeuronModel):
    # Función de activación sigmoide para la clasificación
    def activation(self, z):
        return 1 / (1 + np.exp(-z) + self.non_zero_tolerance)

    # Gradiente del output respecto a los pesos para la activación sigmoide
    def gradient(self, x):
        self.grad_w = self.a * (1-self.a) * x
        self.grad_w_0 = self.a * (1-self.a)

def train_model_NLL_loss(model, input_data, output_data,
                         learning_rate, num_epochs):
    non_zero_tolerance = 1e-8 # Añadir esto a los cálculos de log para garantizar que no tomamos el log de 0
    num_samples = len(input_data)
    for epoch in range(1, num_epochs+1):
        total_loss = 0 # Hacer un seguimiento de la pérdida total en todo el conjunto de datos

        for i in range(num_samples):
            x = input_data[i,...]
            y = output_data[i]
            y_predicted = model.forward(x)

            # Función de pérdida de NLL
            loss = -(y * np.log(y_predicted + non_zero_tolerance) + (1-y) * np.log(1-y_predicted + non_zero_tolerance))
            total_loss += loss

            # Gradiente de la predicción respecto a los pesos
            model.gradient(x)

            # Gradiente de la pérdida respecto a la predicción para NLL
            grad_loss = (y_predicted - y)/(y_predicted * (1-y_predicted))

            #Actualizar el modelo en función del gradiente
            model.update(grad_loss, learning_rate)

        report_every = max(1, num_epochs // 10)
        if epoch == 1 or epoch % report_every == 0: # Cada pocos ciclos, generar un informe
            print("epoch", epoch, "has total loss", total_loss)

# Utilizaremos esta función para evaluar el rendimiento de nuestro clasificador entrenado
def evaluate_classification_accuracy(model, input_data, labels):
    # Contar el número de muestras clasificadas correctamente dado un conjunto de pesos
    correct = 0
    num_samples = len(input_data)
    for i in range(num_samples):
        x = input_data[i,...]
        y = labels[i]
        y_predicted = model.forward(x)
        label_predicted = 1 if y_predicted > 0.5 else 0
        if label_predicted == y:
            correct += 1

    accuracy = correct / num_samples
    print("Our model predicted", correct, "out of", num_samples,
          "correctly for", accuracy*100, "% accuracy")
    return accuracy

input_data = np.array(["citric acid", "residual sugar", "total sulfur dioxide"])
labels = ["color"]

def plot_3d_dataset(x, y):
    x_np_3d = np.array(x)
    x_np_3d.reshape(len(x),3)
    colors = []
    for label in y:
        if label == 0:
            colors.append("red")
        else:
            colors.append("blue")
    fig = plt.figure()
    ax = plt.axes(projection='3d')
    ax.scatter3D(x_np_3d[...,0], x_np_3d[...,1],x_np_3d[...,2], color = colors)
    return ax

def plot_3d_decision_boundary(ax, w, w_0):
  x = np.linspace(-1,4,10)
  y = np.linspace(-1,6,10)
  X,Y = np.meshgrid(x,y)
  Z = (-X*w[0] - Y*w[1] - w_0)/w[2]
  surf = ax.plot_surface(X, Y, Z)
  ax.set_zlim(-10,5)
  return

model = SingleNeuronClassificationModel(in_features=len(input_data[0]))
learning_rate =0.001
epochs = 200

train_model_NLL_loss(model, input_data, labels, learning_rate, epochs)
print("\nFinal weights:")
print(model.w, model.w_0)
evaluate_classification_accuracy(model, input_data, labels)
ax=plot_3d_dataset(input_data, labels)
plot_3d_decision_boundary(ax, model.w, model.w_0)
plt.show()

Utilice Pandas para leer el archivo cvs en un marco de datos
Proceso de entrenamiento, utilizando la pérdida de log-verosimilitud negativa,más adecuada para problemas de clasificación
The class implementation of the single neuron classifier must be trained to carry out a binary classification of wine by color according to its characteristics.
I need help beacouse i´m new in this language.

The error is :

-------------------------------------------------------------------
enter code here       ValueError Traceback (most recent call last)
<ipython-input-19-e78d64c8d9e7> in <module>
      5 epochs = 200
      6
----> 7 train_model_NLL_loss(model, input_data, labels, learning_rate, epochs)
      8 print("\nFinal weights:")
      9 print(model.w, model.w_0)

1 frames
<ipython-input-14-654d498667a7> in train_model_NLL_loss(model, input_data, output_data, learning_rate, num_epochs)
     68             x = input_data[i,...]
     69             y = output_data[i]
---> 70             y_predicted = model.forward(x)
     71
     72             # Función de pérdida de NLL

<ipython-input-14-654d498667a7> in forward(self, x)
     11     def forward(self, x):
     12         # Calcular y guardar la preactivación z
---> 13         self.z = x @ self.w.T + self.w_0
     14
     15         # Aplicar la función de activación y devolver

ValueError: matmul: Input operand 0 does not have enough dimensions (has 0, gufunc core with signature (n?,k),(k,m?)->(n?,m?) requires 1)


问:
Online Ruby editor outputs error “undefined method `chomp'” about gets.chomp
Usually when editing with Ruby I never would have to identify .chomp but now it needs me to define it and I don’t know how to define it properly to work the same way.

Code:

print "What's you're name?"
first_name= gets.chomp
print "What's you're last name?"
last_name= gets.chomp
print "What city are you from?"
city= gets.chomp
print "want to know you're name backwards?"
    yes = true
    no = false
if yes
    puts #{first_name.reverse}
else
    puts "Ok!"
    print "you're first name is" #{first_name!}
    print "you're last name is" #{last_name!}
    print "you're city is" #{city!}
end
```
<p>Editor:</p>
<p>https://www.jdoodle.com/execute-ruby-online/</p>
<p>I believe this may be an editor issue but please correct me if I’m wrong.</p>
<p>I was trying to make a questionnaire that takes the input then at the end spits it back out and asks if you would like to see your name backwards but instead I got an error I did not finish the other bit where it takes the information and spits it back out so ignore that. At first it just told me that chomp was not defined when using <code>gets.chomp</code> to take the input
but I never have to define <code>.chomp</code> before – this is a first. Please explain how to fix.</p>
<p>The error as seen in my code’s output:</p>
<pre class="lang-none prettyprint-override"><code>What's you're name?
jdoodle.rb:2:in `<main>': undefined method `chomp' for nil:NilClass (NoMethodError)
</code>```

Body:
Usually when editing with Ruby I never would have to identify .chomp but now it needs me to define it and I don’t know how to define it properly to work the same way.

Code:

print "What's you're name?"
first_name= gets.chomp
print "What's you're last name?"
last_name= gets.chomp
print "What city are you from?"
city= gets.chomp
print "want to know you're name backwards?"
    yes = true
    no = false
if yes
    puts #{first_name.reverse}
else
    puts "Ok!"
    print "you're first name is" #{first_name!}
    print "you're last name is" #{last_name!}
    print "you're city is" #{city!}
end

Editor:

https://www.jdoodle.com/execute-ruby-online/

I believe this may be an editor issue but please correct me if I’m wrong.

I was trying to make a questionnaire that takes the input then at the end spits it back out and asks if you would like to see your name backwards but instead I got an error I did not finish the other bit where it takes the information and spits it back out so ignore that. At first it just told me that chomp was not defined when using gets.chomp to take the input
but I never have to define .chomp before – this is a first. Please explain how to fix.

The error as seen in my code’s output:

What's you're name?
jdoodle.rb:2:in `<main>': undefined method `chomp' for nil:NilClass (NoMethodError)


问:
Spring Boot JWT authorization throws 401 even with a valid token
Below is my web security config class,

```<code>@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "authority")
@Profile({"cloud", "development", "release"})
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {

    private Map<String, String> data = new LinkedHashMap<>();
    private List<String> whiteList = new ArrayList<>();

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        http.authorizeRequests().antMatchers("/api/v1/students").authenticated()
                .and().authorizeRequests().antMatchers("/api/v1/students/*").authenticated()
                .and().authorizeRequests().antMatchers("/api/v1/students/*").access("hasRole('learning_management_admin_app1000000')")
                      .and().authorizeRequests().antMatchers("/api/v1/students").access("hasRole('learning_management_admin_app1000000')");

        http.csrf().disable().authorizeRequests().antMatchers(getWhiteList().toArray(new String[0]))
                .permitAll();

        http.cors();
        Okta.configureResourceServer401ResponseBody(http);
    }

    public List<String> getWhiteList() {
       ..
</code>```

And In the controller,

```<code>@Validated
@CrossOrigin("*")
@RestController
@RequestMapping("/api/v1")
@SecurityRequirement(name = "BearerAuth")
@PreAuthorize("isAuthenticated()")
public class StudentsController {

 @GetMapping("change-requests")
    @PreAuthorize("hasAuthority('learning_management_admin_app1000000')")
 public ResponseEntity<List<Student>> getStudents(
            @RequestParam(required = false) String name) {
</code>```

Here even with a valid token, it throws 401 Unauthorized exception from every endpoint. Even in the swagger ui, it throws 401 unauthorized with a valid token.

Body:
Below is my web security config class,

@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "authority")
@Profile({"cloud", "development", "release"})
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {

    private Map<String, String> data = new LinkedHashMap<>();
    private List<String> whiteList = new ArrayList<>();

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        http.authorizeRequests().antMatchers("/api/v1/students").authenticated()
                .and().authorizeRequests().antMatchers("/api/v1/students/*").authenticated()
                .and().authorizeRequests().antMatchers("/api/v1/students/*").access("hasRole('learning_management_admin_app1000000')")
                      .and().authorizeRequests().antMatchers("/api/v1/students").access("hasRole('learning_management_admin_app1000000')");

        http.csrf().disable().authorizeRequests().antMatchers(getWhiteList().toArray(new String[0]))
                .permitAll();

        http.cors();
        Okta.configureResourceServer401ResponseBody(http);
    }

    public List<String> getWhiteList() {
       ..

And In the controller,

@Validated
@CrossOrigin("*")
@RestController
@RequestMapping("/api/v1")
@SecurityRequirement(name = "BearerAuth")
@PreAuthorize("isAuthenticated()")
public class StudentsController {

 @GetMapping("change-requests")
    @PreAuthorize("hasAuthority('learning_management_admin_app1000000')")
 public ResponseEntity<List<Student>> getStudents(
            @RequestParam(required = false) String name) {

Here even with a valid token, it throws 401 Unauthorized exception from every endpoint. Even in the swagger ui, it throws 401 unauthorized with a valid token.


问:
Module in Azure Function
I am trying to bootstrap an ABP module in an Azure Function but I get an error:
Castle.MicroKernel.ComponentNotFoundException: 'No component for supporting the service System.IServiceProvider was found'

Stack Trace

```<code>[].EntityFrameworkCore.dll![].EntityFrameworkCore.Seed.SeedHelper.WithDbContext<[].EntityFrameworkCore.DbContext>(Abp.Dependency.IIocResolver iocResolver, System.Action<[].EntityFrameworkCore.DbContext> contextAction) Line 79
[].EntityFrameworkCore.dll![].EntityFrameworkCore.Seed.SeedHelper.SeedHostDb(Abp.Dependency.IIocResolver iocResolver) Line 35
[].EntityFrameworkCore.dll![].EntityFrameworkCore.EntityFrameworkModule.PostInitialize() Line 46
</code>```

So in the Function's Startup.Configure I use Host.CreateDefaultBuilder to initialize the module.  Everything seems to go great until the EntityFrameworkModule tries to complete initializing and seed the DB.  That's when I get the error above.

Here is my code:

```<code>[assembly: FunctionsStartup(typeof(JobProcessor.Startup))]
namespace JobProcessor
{
    public class Startup : FunctionsStartup
    {

        public override void Configure(IFunctionsHostBuilder builder)
        {
            Host.CreateDefaultBuilder()
                .ConfigureServices(services =>
                {
                    var abpBootstrapper = AbpBootstrapper.Create<JobProcessorModule>();
                    services.AddSingleton(abpBootstrapper);
                    abpBootstrapper.Initialize();
                })
                .UseCastleWindsor(IocManager.Instance.IocContainer)
                .Build()
                .Run();
        }
    }
}

namespace JobProcessor
{
    [DependsOn(
        typeof(EntityFrameworkModule),
        typeof(CoreModule),
        typeof(AbpAspNetCoreModule)
    )]
    public class JobProcessorModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(JobProcessorModule).GetAssembly());
        }
    }
}
</code>```

Any ideas?

Title: Module in Azure Function

Body:
I am trying to bootstrap an ABP module in an Azure Function but I get an error:
Castle.MicroKernel.ComponentNotFoundException: 'No component for supporting the service System.IServiceProvider was found'

Stack Trace

[].EntityFrameworkCore.dll![].EntityFrameworkCore.Seed.SeedHelper.WithDbContext<[].EntityFrameworkCore.DbContext>(Abp.Dependency.IIocResolver iocResolver, System.Action<[].EntityFrameworkCore.DbContext> contextAction) Line 79
[].EntityFrameworkCore.dll![].EntityFrameworkCore.Seed.SeedHelper.SeedHostDb(Abp.Dependency.IIocResolver iocResolver) Line 35
[].EntityFrameworkCore.dll![].EntityFrameworkCore.EntityFrameworkModule.PostInitialize() Line 46

So in the Function's Startup.Configure I use Host.CreateDefaultBuilder to initialize the module.  Everything seems to go great until the EntityFrameworkModule tries to complete initializing and seed the DB.  That's when I get the error above.

Here is my code:

[assembly: FunctionsStartup(typeof(JobProcessor.Startup))]
namespace JobProcessor
{
    public class Startup : FunctionsStartup
    {

        public override void Configure(IFunctionsHostBuilder builder)
        {
            Host.CreateDefaultBuilder()
                .ConfigureServices(services =>
                {
                    var abpBootstrapper = AbpBootstrapper.Create<JobProcessorModule>();
                    services.AddSingleton(abpBootstrapper);
                    abpBootstrapper.Initialize();
                })
                .UseCastleWindsor(IocManager.Instance.IocContainer)
                .Build()
                .Run();
        }
    }
}

namespace JobProcessor
{
    [DependsOn(
        typeof(EntityFrameworkModule),
        typeof(CoreModule),
        typeof(AbpAspNetCoreModule)
    )]
    public class JobProcessorModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(JobProcessorModule).GetAssembly());
        }
    }
}

Any ideas?


问:
The view articles.views.article_detail didn't return an HttpResponse object. It returned None instead
My django project has this articles app in it which has the following urls.py

```<code>from django.urls import path
from . import views

urlpatterns = [
    path('',views.articles_list),
    path("<slug:slug>/",views.article_detail),
]
</code>```

and the following is the views.py

```<code>from django.shortcuts import render
from .models import Article
from django.http import HttpResponse

def articles_list(request):
    articles=Article.objects.all().order_by('date')
    return render(request,'articles\list.html',{'Articles':articles})

def article_detail(request,slug):
    HttpResponse(slug)
</code>```

Now when I request for /articles/hello-world/ my desired output is a webpage with hello-world but that is not the case. It shows value error.

Now when I request for /articles/hello-world/ my desired output is a webpage with hello-world but that is not the case. It shows value error.

Body:
My django project has this articles app in it which has the following urls.py

from django.urls import path
from . import views

urlpatterns = [
    path('',views.articles_list),
    path("<slug:slug>/",views.article_detail),
]

and the following is the views.py

from django.shortcuts import render
from .models import Article
from django.http import HttpResponse

def articles_list(request):
    articles=Article.objects.all().order_by('date')
    return render(request,'articles\list.html',{'Articles':articles})

def article_detail(request,slug):
    HttpResponse(slug)

Now when I request for /articles/hello-world/ my desired output is a webpage with hello-world but that is not the case. It shows value error.

Now when I request for /articles/hello-world/ my desired output is a webpage with hello-world but that is not the case. It shows value error.


问:
Running an exe file in teamcity
I am new to teamcity and I have the requirement below:

I have a console application as part of my solution along with other projects.

The console application is interactive. Let's say it needs a string as an input and saves the string in a file.

Can I achieve this in teamcity where i can run the console application within the teamcity and publish the generated file to artifact?

Title: Running an exe file in teamcity


问:
macOS Docker ssh failed
I want to use ssh to access the docker container on my Mac (docker is also installed on the Mac).

I don't know how to solve this problem, if you have a way, I will sincerely appreciate it.

```<code>ssh: connect to host 172.17.0.2 port 9999: Operation timed out
</code>```

I have a docker image of ubuntu1804, I tried it in the following way：

```<code>1. docker run -itd -p 192.168.31.151:9999:22 slamcabbage/221212_ubuntu1804 /bin/bash
</code>```
```<code>2. docker exec -it 95a3f4c876b00 /bin/bash
</code>```

After entering the container, i tried below：

```<code>apt-get update
apt-get install passwd openssl openssh-server openssh-client
passwd
echo "Port 22" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
</code>```

finally

```<code>service ssh restart
</code>```

After that, I try to ssh in macos terminal：

```<code>ssh root@172.17.0.2 -p9999
ssh: connect to host 172.17.0.2 port 9999: Operation timed out
</code>```

Title: macOS Docker ssh failed

Body:
I want to use ssh to access the docker container on my Mac (docker is also installed on the Mac).

I don't know how to solve this problem, if you have a way, I will sincerely appreciate it.

ssh: connect to host 172.17.0.2 port 9999: Operation timed out

I have a docker image of ubuntu1804, I tried it in the following way：

1. docker run -itd -p 192.168.31.151:9999:22 slamcabbage/221212_ubuntu1804 /bin/bash

2. docker exec -it 95a3f4c876b00 /bin/bash

After entering the container, i tried below：

apt-get update
apt-get install passwd openssl openssh-server openssh-client
passwd
echo "Port 22" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

finally

service ssh restart

After that, I try to ssh in macos terminal：

ssh root@172.17.0.2 -p9999
ssh: connect to host 172.17.0.2 port 9999: Operation timed out


问:
Can we hide the parameter but the url remains dynamic
I want to hide the parameter - store user id from the users so that they can see their own data only not of others but It should be shown in the url so that we can give the value to it and change it to different users.

I tried to change the parameter type to drop_list and number type but still user can see the parameter and are able to change the parameter