问:
Tkinter .after() method freezes and dont update gui after sometime
Firstly, I'm new python and tkinter. I want to read some values with OPC XML DA and show them on tkinter gui with automatic update every ten seconds. But OPC XML DA response takes too long time. Because of this I parse them so I have two scripts. First script read values and write logs to .txt and its works fine. Second one is, read this value from .txt and show them tkinter GUI. The problem is start here, Second script works fine but after some time or if ı minimize to icon status, GUI is freezes. Program is running background fine but Tkinter GUI freezes.

Here's my code:

```<code>import tkinter as tk
from datetime import datetime
import json

timeperiod=10
my_w = tk.Tk()
my_w.title(" ALARM MONITOR")
my_w.geometry("1500x800")

def window():

            with open("alarm_log3.txt", "r") as fp:
                b = json.load(fp)

                now=datetime.now()
                date_time = now.strftime("%Y-%m-%d ")
                date_time1 = now.strftime("%H:%M:%S")
                ss_namex = tk.Label(my_w, text= date_time, width=10, fg='white', bg='blue', font=('Arial',15))
                ss_namex.grid(row=0,column=4)
                ss_namex1 = tk.Label(my_w, text= date_time1, width=10, fg='white', bg='blue', font=('Arial',15))
                ss_namex1.grid(row=0,column=5)
                for i in range (0,21,1):

                    if ( b[i][3] == 'FM0' and ( b[i][4] == 'false' and b[i][5] == 'false' and b[i][6] == 'false' and b[i][7] == 'false' and b[i][8] == 'false'  and b[i][9] == 'false' )):
                        color ='green2'
                    elif( b[i][3] == 'FM0' and ( b[i][4] != 'false' or b[i][5] != 'false' or b[i][6] != 'false' or b[i][7] != 'false' or b[i][8] != 'false'  or b[i][9] != 'false' )):
                        color ='yellow2'
                    elif b[i][3] != 'FM0' :
                        color= 'red2'
                    else:
                        color='blue2'

                    baslik1 = tk.Label(my_w, text='ST', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik1.grid(row=1,column=1)

                    baslik2 = tk.Label(my_w, text='STA' , width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik2.grid(row=1,column=2)

                    baslik3 = tk.Label(my_w, text='STB', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik3.grid(row=1,column=3)

                    baslik4 = tk.Label(my_w, text='STC', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik4.grid(row=1,column=4)

                    baslik5 = tk.Label(my_w, text='Codex', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik5.grid(row=1,column=5)

                    baslik6 = tk.Label(my_w, text='Codey' , width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik6.grid(row=1,column=6)

                    baslik7 = tk.Label(my_w, text='Codez', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik7.grid(row=1,column=7)

                    baslik8 = tk.Label(my_w, text='Codea', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik8.grid(row=1,column=8)

                    baslik9 = tk.Label(my_w, text='Codeb', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik9.grid(row=1,column=9)

                    baslik10 = tk.Label(my_w, text='Codec' , width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik10.grid(row=1,column=10)

                    ss_name1=('ss{y}1'.format(y=i))
                    ss_name2=('ss{y}2'.format(y=i))
                    ss_name3=('ss{y}3'.format(y=i))
                    ss_name4=('ss{y}4'.format(y=i))
                    ss_name5=('ss{y}5'.format(y=i))
                    ss_name6=('ss{y}6'.format(y=i))
                    ss_name7=('ss{y}7'.format(y=i))
                    ss_name8=('ss{y}8'.format(y=i))
                    ss_name9=('ss{y}9'.format(y=i))
                    ss_name10=('ss{y}10'.format(y=i))

                    ss_name1 = tk.Label(my_w, text=(i+1), width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name1.grid(row=i+2,column=1)

                    ss_name2 = tk.Label(my_w, text=b[(i)][1], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name2.grid(row=i+2,column=2)

                    ss_name3 = tk.Label(my_w, text=b[(i)][2], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name3.grid(row=i+2,column=3)

                    ss_name4 = tk.Label(my_w, text=b[(i)][3], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name4.grid(row=i+2,column=4)

                    ss_name5 = tk.Label(my_w, text=b[(i)][4], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name5.grid(row=i+2,column=5)

                    ss_name6 = tk.Label(my_w, text=b[(i)][5], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name6.grid(row=i+2,column=6)

                    ss_name7 = tk.Label(my_w, text=b[(i)][6], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name7.grid(row=i+2,column=7)

                    ss_name8 = tk.Label(my_w, text=b[(i)][7], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name8.grid(row=i+2,column=8)

                    ss_name9 = tk.Label(my_w, text=b[(i)][8], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name9.grid(row=i+2,column=9)

                    ss_name10 = tk.Label(my_w, text=b[(i)][9], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name10.grid(row=i+2,column=10)

            my_w.after(10000, window)

window()

my_w.mainloop()

</code>```

sample image

Thank you,

i tried many things but i couldn't figure it out.

Body:
Firstly, I'm new python and tkinter. I want to read some values with OPC XML DA and show them on tkinter gui with automatic update every ten seconds. But OPC XML DA response takes too long time. Because of this I parse them so I have two scripts. First script read values and write logs to .txt and its works fine. Second one is, read this value from .txt and show them tkinter GUI. The problem is start here, Second script works fine but after some time or if ı minimize to icon status, GUI is freezes. Program is running background fine but Tkinter GUI freezes.

Here's my code:

import tkinter as tk
from datetime import datetime
import json

timeperiod=10
my_w = tk.Tk()
my_w.title(" ALARM MONITOR")
my_w.geometry("1500x800")

def window():

            with open("alarm_log3.txt", "r") as fp:
                b = json.load(fp)

                now=datetime.now()
                date_time = now.strftime("%Y-%m-%d ")
                date_time1 = now.strftime("%H:%M:%S")
                ss_namex = tk.Label(my_w, text= date_time, width=10, fg='white', bg='blue', font=('Arial',15))
                ss_namex.grid(row=0,column=4)
                ss_namex1 = tk.Label(my_w, text= date_time1, width=10, fg='white', bg='blue', font=('Arial',15))
                ss_namex1.grid(row=0,column=5)
                for i in range (0,21,1):

                    if ( b[i][3] == 'FM0' and ( b[i][4] == 'false' and b[i][5] == 'false' and b[i][6] == 'false' and b[i][7] == 'false' and b[i][8] == 'false'  and b[i][9] == 'false' )):
                        color ='green2'
                    elif( b[i][3] == 'FM0' and ( b[i][4] != 'false' or b[i][5] != 'false' or b[i][6] != 'false' or b[i][7] != 'false' or b[i][8] != 'false'  or b[i][9] != 'false' )):
                        color ='yellow2'
                    elif b[i][3] != 'FM0' :
                        color= 'red2'
                    else:
                        color='blue2'

                    baslik1 = tk.Label(my_w, text='ST', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik1.grid(row=1,column=1)

                    baslik2 = tk.Label(my_w, text='STA' , width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik2.grid(row=1,column=2)

                    baslik3 = tk.Label(my_w, text='STB', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik3.grid(row=1,column=3)

                    baslik4 = tk.Label(my_w, text='STC', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik4.grid(row=1,column=4)

                    baslik5 = tk.Label(my_w, text='Codex', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik5.grid(row=1,column=5)

                    baslik6 = tk.Label(my_w, text='Codey' , width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik6.grid(row=1,column=6)

                    baslik7 = tk.Label(my_w, text='Codez', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik7.grid(row=1,column=7)

                    baslik8 = tk.Label(my_w, text='Codea', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik8.grid(row=1,column=8)

                    baslik9 = tk.Label(my_w, text='Codeb', width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik9.grid(row=1,column=9)

                    baslik10 = tk.Label(my_w, text='Codec' , width=10, fg='white', bg='blue2', font=('Arial',15))
                    baslik10.grid(row=1,column=10)

                    ss_name1=('ss{y}1'.format(y=i))
                    ss_name2=('ss{y}2'.format(y=i))
                    ss_name3=('ss{y}3'.format(y=i))
                    ss_name4=('ss{y}4'.format(y=i))
                    ss_name5=('ss{y}5'.format(y=i))
                    ss_name6=('ss{y}6'.format(y=i))
                    ss_name7=('ss{y}7'.format(y=i))
                    ss_name8=('ss{y}8'.format(y=i))
                    ss_name9=('ss{y}9'.format(y=i))
                    ss_name10=('ss{y}10'.format(y=i))

                    ss_name1 = tk.Label(my_w, text=(i+1), width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name1.grid(row=i+2,column=1)

                    ss_name2 = tk.Label(my_w, text=b[(i)][1], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name2.grid(row=i+2,column=2)

                    ss_name3 = tk.Label(my_w, text=b[(i)][2], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name3.grid(row=i+2,column=3)

                    ss_name4 = tk.Label(my_w, text=b[(i)][3], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name4.grid(row=i+2,column=4)

                    ss_name5 = tk.Label(my_w, text=b[(i)][4], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name5.grid(row=i+2,column=5)

                    ss_name6 = tk.Label(my_w, text=b[(i)][5], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name6.grid(row=i+2,column=6)

                    ss_name7 = tk.Label(my_w, text=b[(i)][6], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name7.grid(row=i+2,column=7)

                    ss_name8 = tk.Label(my_w, text=b[(i)][7], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name8.grid(row=i+2,column=8)

                    ss_name9 = tk.Label(my_w, text=b[(i)][8], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name9.grid(row=i+2,column=9)

                    ss_name10 = tk.Label(my_w, text=b[(i)][9], width=10, fg='black', bg=color, font=('Arial',15))
                    ss_name10.grid(row=i+2,column=10)

            my_w.after(10000, window)

window()

my_w.mainloop()

sample image

Thank you,

i tried many things but i couldn't figure it out.


来源: stackexchange

问:
How to direct user back to the app screen from webView by using onBackPressed (Kotlin)?
I've used this but this is not what I want. Since I have only one privacy policy webpage to show there is no use of  canGoBack() and it closes the app on back press. I want to just close the webView.

```<code>override fun onBackPressed() {
    val webView= findViewById<WebView>(R.id.webView)

      if (webView.canGoBack()){
          webView.goBack()}
else{
    super.onBackPressed();
    }
</code>```

So if you have any solution in Kotlin please help!!

ContentLicense: CC BY-SA 4.0

Body:
I've used this but this is not what I want. Since I have only one privacy policy webpage to show there is no use of  canGoBack() and it closes the app on back press. I want to just close the webView.

override fun onBackPressed() {
    val webView= findViewById<WebView>(R.id.webView)

      if (webView.canGoBack()){
          webView.goBack()}
else{
    super.onBackPressed();
    }

So if you have any solution in Kotlin please help!!


问:
Android Studio(last version) - Linking Failed
Has anyone ever appeared to you this kind of problem ?
The program was running so far just made a change and gave me this error.
I creat a new project but cant build and appeared the same error .

I wonder how can I solve this error.


问:
How do I unload some native feature imports when I switch to another feature in my product that wants a different set of Monaco feature imports
So I have a use case that we have two separate products that uses Monaco Editor.

Product A

Product B

They live in the same package but different page.

Product A requires certain set of Monaco Native features e.g.

```<code>import 'monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js';
</code>```

Product B doesn't want it and want to implement it's own codeAction UI.

How can I unload the import of product A as it seems register the contribution on a global variable and there's no function to unload it.

I tried to dynamic import codeActionContributions.js when Product A loads but after that when you switch to Product B it will conflict.

I would expect Monaco has some functions that can unload the codeAction registry when I unload Product A for example. Is there a way to do that?

Body:
So I have a use case that we have two separate products that uses Monaco Editor.

Product A

Product B

They live in the same package but different page.

Product A requires certain set of Monaco Native features e.g.

import 'monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js';

Product B doesn't want it and want to implement it's own codeAction UI.

How can I unload the import of product A as it seems register the contribution on a global variable and there's no function to unload it.

I tried to dynamic import codeActionContributions.js when Product A loads but after that when you switch to Product B it will conflict.

I would expect Monaco has some functions that can unload the codeAction registry when I unload Product A for example. Is there a way to do that?


问:
Need a method for deleting/ignoring Solr index records with a particular string in a field
This is a bit hard to explain so bear with me. We have a website that uses a built-in Solr product to index or remove content when it is added/updated/deleted. Standard web content is specifically tagged as published or private, so it is easy to exclude private content from our custom search engine. However, binary files (DOCs, PDFs, etc.) do not have a public/private workflow state. The only way we can determine if a file is private is that, for some reason, the CMS doubles-up the FullURL string. So the URL will have two instances of "http" in the string. Not sure why that happens, but it's a good thing b/c it's the only way to tell if a file is published or private.

Because the Solr install that's packaged with the CMS is so wonky, and b/c we have numerous other sites in other CMSes, we have a "catalog" Solr install in AWS that aggregates content from our various web properties using a data import handler. So what I'm looking for is a way, using the DIH data-config.xml file, to exclude any index records that have "http" in the URL string twice. I'm currently using a filter query (fq) field in the  tag to filter out certain records, but I don't know how to write a fq to do what I'm suggesting above or if that's even possible. My hunch is that I'd need a function query, but that's a level of Solr knowledge I haven't yet achieved. If anyone has an advice or knows how to write a function query that would exclude a url field with two instances of "http" in the string I'd appreciate it!


问:
Airflow 2.1.4 Composer V2 GKE kubernetes in custom VPC Subnet returning 404
So I have two V2 Composers running in the same project, the only difference in these two is that in one of them I'm using the default subnet and default values/autogenerated values for cluster-ipv4-cidr & services-ipv4-cidr. In the other one I've created another subnet in the same (default VPC) which is in the same region, but a different IP range, and I reference this subnet when creating the Composer, additionally I give it the services-ipv4-cidr=xx.44.0.0/17 and services-ipv4-cidr=xx.45.4.0/22.

Everything else is the same between these two Composer environments. In the environment where I have a custom subnet I'm not able to run any KubernetsPodOperator jobs, they return the error:

```<code>ERROR - Exception when attempting to create Namespaced Pod:
Traceback (most recent call last):
  File "/opt/python3.8/lib/python3.8/site-packages/airflow/providers/cncf/kubernetes/utils/pod_manager.py", line 111, in run_pod_async
    resp = self._client.create_namespaced_pod(
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api/core_v1_api.py", line 6174, in create_namespaced_pod
    (data) = self.create_namespaced_pod_with_http_info(namespace, body, **kwargs)  # noqa: E501
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api/core_v1_api.py", line 6251, in create_namespaced_pod_with_http_info
    return self.api_client.call_api(
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 340, in call_api
    return self.__call_api(resource_path, method,
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 172, in __call_api
    response_data = self.request(
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 382, in request
    return self.rest_client.POST(url,
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/rest.py", line 272, in POST
    return self.request("POST", url,
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/rest.py", line 231, in request
    raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (404)
</code>```

and this pod does not appear if I go to GKE to check workloads. These two GKE envs use same composer service account, K8s service account and namespaces, but from my understand that is not an issue. Jobs outside of the K8sPodOperator work fine. I had a theory that perhaps the non-default subnet needed additional permissions but I wasn't able to confirm or deny this theory yet.

From the log I can see that the KubernetesPodOperator can't locate the worker, even though from the UI I can find it, and also non-KubernetesPodOperator jobs do this succesfully.

Would appreciate some guidance on what to do/where to look?

Body:
So I have two V2 Composers running in the same project, the only difference in these two is that in one of them I'm using the default subnet and default values/autogenerated values for cluster-ipv4-cidr & services-ipv4-cidr. In the other one I've created another subnet in the same (default VPC) which is in the same region, but a different IP range, and I reference this subnet when creating the Composer, additionally I give it the services-ipv4-cidr=xx.44.0.0/17 and services-ipv4-cidr=xx.45.4.0/22.

Everything else is the same between these two Composer environments. In the environment where I have a custom subnet I'm not able to run any KubernetsPodOperator jobs, they return the error:

ERROR - Exception when attempting to create Namespaced Pod:
Traceback (most recent call last):
  File "/opt/python3.8/lib/python3.8/site-packages/airflow/providers/cncf/kubernetes/utils/pod_manager.py", line 111, in run_pod_async
    resp = self._client.create_namespaced_pod(
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api/core_v1_api.py", line 6174, in create_namespaced_pod
    (data) = self.create_namespaced_pod_with_http_info(namespace, body, **kwargs)  # noqa: E501
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api/core_v1_api.py", line 6251, in create_namespaced_pod_with_http_info
    return self.api_client.call_api(
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 340, in call_api
    return self.__call_api(resource_path, method,
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 172, in __call_api
    response_data = self.request(
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 382, in request
    return self.rest_client.POST(url,
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/rest.py", line 272, in POST
    return self.request("POST", url,
  File "/opt/python3.8/lib/python3.8/site-packages/kubernetes/client/rest.py", line 231, in request
    raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (404)

and this pod does not appear if I go to GKE to check workloads. These two GKE envs use same composer service account, K8s service account and namespaces, but from my understand that is not an issue. Jobs outside of the K8sPodOperator work fine. I had a theory that perhaps the non-default subnet needed additional permissions but I wasn't able to confirm or deny this theory yet.

From the log I can see that the KubernetesPodOperator can't locate the worker, even though from the UI I can find it, and also non-KubernetesPodOperator jobs do this succesfully.

Would appreciate some guidance on what to do/where to look?


问:
How to draw a cube with a coordinate system in Swing
I have a cube and there is a need to add a 3D coordinate system to it.

There is an example my coordinate system with a cube should approximtely look like:

Unfortunately, my progress seems so far from this example:

Maybe, I can find out how to draw X and Y axis, but I have no idea how to add the Z axis.
So, how to build the right coordinate sytem?

My code:

```<code>import java.awt.*;
import static java.lang.Math.*;
import javax.swing.*;

public class Cube extends JPanel {
    double[][] nodes = {{-1, -1, -1}, {-1, -1, 1}, {-1, 1, -1}, {-1, 1, 1},
            {1, -1, -1}, {1, -1, 1}, {1, 1, -1}, {1, 1, 1}};

    int[][] edges = {{0, 1}, {1, 3}, {3, 2}, {2, 0}, {4, 5}, {5, 7}, {7, 6},
            {6, 4}, {0, 4}, {1, 5}, {2, 6}, {3, 7}};

    public Cube() {
        setPreferredSize(new Dimension(640, 640));
        setBackground(Color.white);

        scale(50);
        rotateCube(Math.toRadians(60), Math.toRadians(10), Math.toRadians(0));
    }

    final void scale(double s) {
        for (double[] node : nodes) {
            node[0] *= s;
            node[1] *= s;
            node[2] *= s;
        }
    }

    final void rotateCube(double angleX, double angleY, double angleZ) {
        double sinX = sin(angleX);
        double cosX = cos(angleX);

        double sinY = sin(angleY);
        double cosY = cos(angleY);

        double sinZ = sin(angleZ);
        double cosZ = cos(angleZ);

        for (double[] node : nodes) {
            double x = node[0];
            double y = node[1];
            double z = node[2];

            node[0] = x * cosX - z * sinX;
            node[2] = z * cosX + x * sinX;

            z = node[2];

            node[1] = y * cosY - z * sinY;
            node[2] = y * sinY + z * cosY;

            x = node[0];
            y = node[1];

            node[0] = x * cosZ + y * sinZ;
            node[1] = y * cosZ - x * sinZ;
        }
    }

    void drawCube(Graphics2D g) {
        g.translate(getWidth() / 2, getHeight() / 2);

        g.setColor(Color.BLACK);
        for (int[] edge : edges) {
            double[] xy1 = nodes[edge[0]];
            double[] xy2 = nodes[edge[1]];
            g.drawLine((int) round(xy1[0]), (int) round(xy1[1]),
                    (int) round(xy2[0]), (int) round(xy2[1]));
        }

        for (double[] node : nodes)
            g.fillOval((int) round(node[0]) - 4, (int) round(node[1]) - 4, 8, 8);
    }

    void drawAxis(Graphics2D g) {
        int x_c = getWidth() / 2;
        int y_c = getHeight() / 2;

        // X - axis
        g.setColor(Color.green);
        g.drawLine(round(x_c + 300), round(y_c), round(x_c), round(y_c));

        // Y- axis
        g.setColor(Color.blue);
        g.drawLine(round(x_c), round(y_c), round(x_c), round(y_c) + 300);
    }

    @Override
    public void paintComponent(Graphics gg) {
        super.paintComponent(gg);
        Graphics2D g = (Graphics2D) gg;
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        drawAxis(g);
        drawCube(g);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setTitle("Rotating Cube");
            f.setResizable(false);
            f.add(new Cube(), BorderLayout.CENTER);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        });
    }
}
</code>```

Body:
I have a cube and there is a need to add a 3D coordinate system to it.

There is an example my coordinate system with a cube should approximtely look like:

Unfortunately, my progress seems so far from this example:

Maybe, I can find out how to draw X and Y axis, but I have no idea how to add the Z axis.
So, how to build the right coordinate sytem?

My code:

import java.awt.*;
import static java.lang.Math.*;
import javax.swing.*;

public class Cube extends JPanel {
    double[][] nodes = {{-1, -1, -1}, {-1, -1, 1}, {-1, 1, -1}, {-1, 1, 1},
            {1, -1, -1}, {1, -1, 1}, {1, 1, -1}, {1, 1, 1}};

    int[][] edges = {{0, 1}, {1, 3}, {3, 2}, {2, 0}, {4, 5}, {5, 7}, {7, 6},
            {6, 4}, {0, 4}, {1, 5}, {2, 6}, {3, 7}};

    public Cube() {
        setPreferredSize(new Dimension(640, 640));
        setBackground(Color.white);

        scale(50);
        rotateCube(Math.toRadians(60), Math.toRadians(10), Math.toRadians(0));
    }

    final void scale(double s) {
        for (double[] node : nodes) {
            node[0] *= s;
            node[1] *= s;
            node[2] *= s;
        }
    }

    final void rotateCube(double angleX, double angleY, double angleZ) {
        double sinX = sin(angleX);
        double cosX = cos(angleX);

        double sinY = sin(angleY);
        double cosY = cos(angleY);

        double sinZ = sin(angleZ);
        double cosZ = cos(angleZ);

        for (double[] node : nodes) {
            double x = node[0];
            double y = node[1];
            double z = node[2];

            node[0] = x * cosX - z * sinX;
            node[2] = z * cosX + x * sinX;

            z = node[2];

            node[1] = y * cosY - z * sinY;
            node[2] = y * sinY + z * cosY;

            x = node[0];
            y = node[1];

            node[0] = x * cosZ + y * sinZ;
            node[1] = y * cosZ - x * sinZ;
        }
    }

    void drawCube(Graphics2D g) {
        g.translate(getWidth() / 2, getHeight() / 2);

        g.setColor(Color.BLACK);
        for (int[] edge : edges) {
            double[] xy1 = nodes[edge[0]];
            double[] xy2 = nodes[edge[1]];
            g.drawLine((int) round(xy1[0]), (int) round(xy1[1]),
                    (int) round(xy2[0]), (int) round(xy2[1]));
        }

        for (double[] node : nodes)
            g.fillOval((int) round(node[0]) - 4, (int) round(node[1]) - 4, 8, 8);
    }

    void drawAxis(Graphics2D g) {
        int x_c = getWidth() / 2;
        int y_c = getHeight() / 2;

        // X - axis
        g.setColor(Color.green);
        g.drawLine(round(x_c + 300), round(y_c), round(x_c), round(y_c));

        // Y- axis
        g.setColor(Color.blue);
        g.drawLine(round(x_c), round(y_c), round(x_c), round(y_c) + 300);
    }

    @Override
    public void paintComponent(Graphics gg) {
        super.paintComponent(gg);
        Graphics2D g = (Graphics2D) gg;
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        drawAxis(g);
        drawCube(g);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setTitle("Rotating Cube");
            f.setResizable(false);
            f.add(new Cube(), BorderLayout.CENTER);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        });
    }
}


问:
How to load a PDF passed by Django to Angular?
In Django I have this function that returns a pdf to me

```<code>def get(self, request):
        with open(filepath, 'rb') as f:
            pdf = f.read()

        return HttpResponse(pdf, content_type='application/pdf')
</code>```

In Angular i have

```<code>this.http.get(apiUrl, { responseType: 'arraybuffer' }).subscribe(
      response => {
        // Create a blob object that represents the PDF file
        var blob = new Blob([response], { type: 'application/pdf' });

        // Create an object URL that points to the blob
        var objectURL = URL.createObjectURL(blob);

        // Use the object URL as the src attribute for an <iframe> element
        // to display the PDF file
        document.getElementById('iframe').src = objectURL;
      },
      error => {
        console.log(error)
      }
    );
</code>```

In the  I get "Unable to upload PDF document"

What am i doing wrong?

Body:
In Django I have this function that returns a pdf to me

def get(self, request):
        with open(filepath, 'rb') as f:
            pdf = f.read()

        return HttpResponse(pdf, content_type='application/pdf')

In Angular i have

this.http.get(apiUrl, { responseType: 'arraybuffer' }).subscribe(
      response => {
        // Create a blob object that represents the PDF file
        var blob = new Blob([response], { type: 'application/pdf' });

        // Create an object URL that points to the blob
        var objectURL = URL.createObjectURL(blob);

        // Use the object URL as the src attribute for an  element
        // to display the PDF file
        document.getElementById('iframe').src = objectURL;
      },
      error => {
        console.log(error)
      }
    );

In the  I get "Unable to upload PDF document"

What am i doing wrong?


问:
SWIFTUI Local Notification navigates to (sheet or modal) View
I got local notifications to work. Asking permission, setting, removing, etc. What I can't seem to get right is navigating to a (detail) view upon clicking the notification.

I have the following code:

```<code>func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { gotoview }
</code>```

Body:
I got local notifications to work. Asking permission, setting, removing, etc. What I can't seem to get right is navigating to a (detail) view upon clicking the notification.

I have the following code:

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { gotoview }


问:
Trying to display single user
I'm trying to create this logic a whole day and can't find anything helpful.. A small introduce of my app: While studying, I'm creating my local date app as practical job to improve more skills and logics. The problem is that I'm trying to get single user in main(home) page, when user login it should see already loaded single user from MongoDB where he can click like or dislike button. When user clicks one of them this user will push in user liked or dislike array and next user displays. I don't have like system yet, cause I can't get a single user. So  later I wanna do filter method if user already liked or disliked other user, that one user didn't appear anymore and let users view his liked and disliked users.

So the main thing is that I have a get method where I'm getting all users and tried to create different routes to get only one of them, but can't imagine how to create correct logic of that.. 4-5 hours ago I tried to make for, map, forEach cycles but still can't understand the main logic here..

Here's my code, if it's not enough to understand just ask me for more code.

mainController(back-end):

getSingleUser: async (req, res) => {
    const { secret } = req.params;
    const findUser = await UserSchema.findOne({ secret });
    if (findUser) {
        return res.send({ error: false, message: 'User found', data: findUser });
    }
    return res.send({ error: true, message: 'User not found', data: null });
},
getAllUsers: async (req, res) => {
    try {
        const allUser = await UserSchema.find({});
        res.status(200).json(allUser);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
}```
</div>
</div>
</p>
<p>mainRouter(back-end):</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const express = require('express')

const { login, register, getSingleUser, getAllUsers } = require("../controller/mainController")
const { loginValidate, registerValidate } = require("../middleware/authValidator")

const mainRouter = express.Router()

mainRouter.post('/register', registerValidate, register);

mainRouter.post('/login', loginValidate, login);

mainRouter.get('/api', getAllUsers)

mainRouter.get('/user/:secret', getSingleUser)

module.exports = mainRouter;</code>```

HomePage(front-end):

import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import Toolbar from '../components/Toolbar';
import { get } from '../helper/helper';
import SingleUser from '../components/SingleUser';

export default function HomePage() {
    const [allUsers, getAllUsers] = useState([])
    const secret = window.localStorage.getItem('secret')
    useEffect(() => {
        async function fetchUsers() {
            const resp = await get('api')
            getAllUsers(resp)
        }
        fetchUsers()
    }, [])
    return (

            <Toolbar />

                {allUsers && allUsers.filter(user => user.secret !== secret).map((users, i) => <SingleUser users={users} key={i} />)}

All rights reserved by Cartoon Match organization. To read more about our policy <Link to='/policy'>click here</Link>.

    )
}```
</div>
</div>
</p>
<p>This is result of HomePage users fetch:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>[
    {
        "_id": "638e31a2579ba2a13b454943",
        "image": [
            "https://picsum.photos/id/377/4884/3256",
            "https://picsum.photos/id/378/5000/3333"
        ],
        "username": "testas",
        "firstName": "testas",
        "lastName": "testas",
        "email": "test@gmail.com",
        "gender": "male",
        "city": "asdadas",
        "country": "aasdasd",
        "birth": "2020-02-20",
        "phone": "65asd15a6sd",
        "password": "$2b$04$zpqQVU7cFUfdA9DCfKmFYOOdY93OVPXoQq08kM87ehwwxD25/pl6q",
        "likes": [],
        "liked": [],
        "secret": "Ey2_-dVlpg",
        "__v": 0
    },
    {
        "_id": "639130a43c2e51dc08531019",
        "image": [
            "https://www.1zoom.me/big2/98/183590-20043.jpg",
            "https://pngimg.com/uploads/shrek/shrek_PNG22.png"
        ],
        "username": "SirShrek",
        "firstName": "Sir",
        "lastName": "Shrek",
        "email": "callmeshrek@swamp.com",
        "gender": "male",
        "city": "Swamp",
        "country": "Fairy-Tale Land Of Duloc",
        "birth": "1999-02-27",
        "phone": "830-476-5664",
        "password": "$2b$04$u1jacGrx6yWOMxfkllMxWO.5in4rQDFIbbCMMixzHqV9rObtq1tKG",
        "likes": [],
        "liked": [],
        "secret": "FP8Rd4izgQ",
        "__v": 0
    },
    {
        "_id": "6391c8df7f83052432e2d939",
        "image": [
            "https://static.wikia.nocookie.net/vsbattles/images/e/e8/Dexter_Rendered.png/revision/latest?cb=20180919045250",
            "https://i.ebayimg.com/images/g/VesAAOSwrohehKhn/s-l1600.jpg"
        ],
        "username": "Dexter",
        "firstName": "Dexter",
        "lastName": "Michael Louis McPherson lll",
        "email": "dexter@science.com",
        "gender": "male",
        "city": "Genius Grove",
        "country": "Peter Lorre",
        "birth": "2014-12-31",
        "phone": "555-0100",
        "password": "$2b$04$BMUidKOaRBtWDNKH.NduB.gkgzUhPNuXVk10ip7lPo/N/1k/8sxvW",
        "likes": [],
        "liked": [],
        "dislike":[],
        "secret": "9k6ilC2ZZg",
        "__v": 0
    }]</code>```

This is SingleUser component:

import React, { useEffect, useState } from "react";
import MainContext from '../context/MainContext'
import { get, put } from '../helper/helper'

export default function SingleUser({ users }) {

    return (

{users.firstName} {users.lastName}

{users.gender}

            <button>Dislike</button>
            <button onClick={postLikes}>Like</button>

    );
}```

Title: Trying to display single user

Body:
I'm trying to create this logic a whole day and can't find anything helpful.. A small introduce of my app: While studying, I'm creating my local date app as practical job to improve more skills and logics. The problem is that I'm trying to get single user in main(home) page, when user login it should see already loaded single user from MongoDB where he can click like or dislike button. When user clicks one of them this user will push in user liked or dislike array and next user displays. I don't have like system yet, cause I can't get a single user. So  later I wanna do filter method if user already liked or disliked other user, that one user didn't appear anymore and let users view his liked and disliked users.

So the main thing is that I have a get method where I'm getting all users and tried to create different routes to get only one of them, but can't imagine how to create correct logic of that.. 4-5 hours ago I tried to make for, map, forEach cycles but still can't understand the main logic here..

Here's my code, if it's not enough to understand just ask me for more code.

mainController(back-end):

getSingleUser: async (req, res) => {
    const { secret } = req.params;
    const findUser = await UserSchema.findOne({ secret });
    if (findUser) {
        return res.send({ error: false, message: 'User found', data: findUser });
    }
    return res.send({ error: true, message: 'User not found', data: null });
},
getAllUsers: async (req, res) => {
    try {
        const allUser = await UserSchema.find({});
        res.status(200).json(allUser);
    } catch (error) {
        res.status(400).json({ message: error.message });
    }
}

mainRouter(back-end):

const express = require('express')

const { login, register, getSingleUser, getAllUsers } = require("../controller/mainController")
const { loginValidate, registerValidate } = require("../middleware/authValidator")

const mainRouter = express.Router()

mainRouter.post('/register', registerValidate, register);

mainRouter.post('/login', loginValidate, login);

mainRouter.get('/api', getAllUsers)

mainRouter.get('/user/:secret', getSingleUser)

module.exports = mainRouter;

HomePage(front-end):

import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import Toolbar from '../components/Toolbar';
import { get } from '../helper/helper';
import SingleUser from '../components/SingleUser';

export default function HomePage() {
    const [allUsers, getAllUsers] = useState([])
    const secret = window.localStorage.getItem('secret')
    useEffect(() => {
        async function fetchUsers() {
            const resp = await get('api')
            getAllUsers(resp)
        }
        fetchUsers()
    }, [])
    return (

            <Toolbar />

                {allUsers && allUsers.filter(user => user.secret !== secret).map((users, i) => <SingleUser users={users} key={i} />)}

All rights reserved by Cartoon Match organization. To read more about our policy <Link to='/policy'>click here</Link>.

    )
}

This is result of HomePage users fetch:

[
    {
        "_id": "638e31a2579ba2a13b454943",
        "image": [
            "https://picsum.photos/id/377/4884/3256",
            "https://picsum.photos/id/378/5000/3333"
        ],
        "username": "testas",
        "firstName": "testas",
        "lastName": "testas",
        "email": "test@gmail.com",
        "gender": "male",
        "city": "asdadas",
        "country": "aasdasd",
        "birth": "2020-02-20",
        "phone": "65asd15a6sd",
        "password": "$2b$04$zpqQVU7cFUfdA9DCfKmFYOOdY93OVPXoQq08kM87ehwwxD25/pl6q",
        "likes": [],
        "liked": [],
        "secret": "Ey2_-dVlpg",
        "__v": 0
    },
    {
        "_id": "639130a43c2e51dc08531019",
        "image": [
            "https://www.1zoom.me/big2/98/183590-20043.jpg",
            "https://pngimg.com/uploads/shrek/shrek_PNG22.png"
        ],
        "username": "SirShrek",
        "firstName": "Sir",
        "lastName": "Shrek",
        "email": "callmeshrek@swamp.com",
        "gender": "male",
        "city": "Swamp",
        "country": "Fairy-Tale Land Of Duloc",
        "birth": "1999-02-27",
        "phone": "830-476-5664",
        "password": "$2b$04$u1jacGrx6yWOMxfkllMxWO.5in4rQDFIbbCMMixzHqV9rObtq1tKG",
        "likes": [],
        "liked": [],
        "secret": "FP8Rd4izgQ",
        "__v": 0
    },
    {
        "_id": "6391c8df7f83052432e2d939",
        "image": [
            "https://static.wikia.nocookie.net/vsbattles/images/e/e8/Dexter_Rendered.png/revision/latest?cb=20180919045250",
            "https://i.ebayimg.com/images/g/VesAAOSwrohehKhn/s-l1600.jpg"
        ],
        "username": "Dexter",
        "firstName": "Dexter",
        "lastName": "Michael Louis McPherson lll",
        "email": "dexter@science.com",
        "gender": "male",
        "city": "Genius Grove",
        "country": "Peter Lorre",
        "birth": "2014-12-31",
        "phone": "555-0100",
        "password": "$2b$04$BMUidKOaRBtWDNKH.NduB.gkgzUhPNuXVk10ip7lPo/N/1k/8sxvW",
        "likes": [],
        "liked": [],
        "dislike":[],
        "secret": "9k6ilC2ZZg",
        "__v": 0
    }]

This is SingleUser component:

import React, { useEffect, useState } from "react";
import MainContext from '../context/MainContext'
import { get, put } from '../helper/helper'

export default function SingleUser({ users }) {

    return (

{users.firstName} {users.lastName}

{users.gender}

            <button>Dislike</button>
            <button onClick={postLikes}>Like</button>

    );
}


问:
vert.x The number of connections in the x connection pool has skyrocketed
io.vertx.core.http.HttpClosedException: Connection was closed

The number of connections in the connection pool has skyrocketed. I found some connection closed errors in the early stage。

The following is my connection pool configuration

```<code>WebClientOptions().setMaxPoolSize(10000)
    .setKeepAlive(true)
    .setKeepAliveTimeout(60 * 10)
    .setTrustAll(true)
    .setPoolCleanerPeriod(200)
    .setPoolEventLoopSize(4)
    .setIdleTimeoutUnit(TimeUnit.MILLISECONDS)
    .setIdleTimeout(500)
    .setMaxWaitQueueSize(10000)
    .setConnectTimeout(2000)
</code>```

Body:
io.vertx.core.http.HttpClosedException: Connection was closed

The number of connections in the connection pool has skyrocketed. I found some connection closed errors in the early stage。

The following is my connection pool configuration

WebClientOptions().setMaxPoolSize(10000)
    .setKeepAlive(true)
    .setKeepAliveTimeout(60 * 10)
    .setTrustAll(true)
    .setPoolCleanerPeriod(200)
    .setPoolEventLoopSize(4)
    .setIdleTimeoutUnit(TimeUnit.MILLISECONDS)
    .setIdleTimeout(500)
    .setMaxWaitQueueSize(10000)
    .setConnectTimeout(2000)


问:
Error downloading large AppService log file in Azure Storage Explorer when file is actively written to
In my attempt to troubleshoot a website production issue, I want to download the latest hourly log file from an Azure Storage Blob container that is heavily written to by this live website.  I'm using Microsoft Azure Storage Explorer latest version (1.27.0, AzCopy version 10.16.2) by double-clicking the file from the GUI.  The file is about 50 MB.

But I keep getting the same error after 12 seconds, trying at least 3 times:

Transfer of 'xxxxapplogs/xxxxx/2022/12/09/14/xxxxx_xxxx.txt' to 'C:\Users\xxxx\AppData\Local\Temp\xxxx' failed: 0 items transferred (used SAS, discovery completed)  Started at: 12/9/2022 7:49 AM, Duration: 12 seconds.

Here's the output from the AzCopy Log file:

```<code>2022/12/09 14:53:03 ==> REQUEST/RESPONSE (Try=1/118.9608ms, OpTime=309.6046ms) -- RESPONSE SUCCESSFULLY RECEIVED GET  ....
2022/12/09 14:53:11 ==> REQUEST/RESPONSE (Try=1/61.8583ms, OpTime=295.8292ms) -- RESPONSE SUCCESSFULLY RECEIVED GET  ....
   X-Ms-Request-Id: [9d763303-001e-00ad-23dd-0b980b000000]

2022/12/09 14:53:11 ERR: [P#0-T#0] DOWNLOADFAILED: https://xxxx.blob.core.windows.net/xxxx/xxxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04 : 412 : 412 The condition specified using HTTP conditional header(s) is not met.. When Downloading response body. X-Ms-Request-Id: 9d763303-001e-00ad-23dd-0b980b000000

   Dst: \\?\C:\Users\xxxx\AppData\Local\Temp\16705975815589\f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxxx.txt
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 10755605  Count: 6021611 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 27602682  Count: 5951750 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 2398248  Count: 5990360 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 19441939  Count: 5723885 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04 Deleting incomplete destination file Dst: \\?\C:\Users\xxxx\AppData\Local\Temp\16705975815589\f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt
2022/12/09 14:53:11 JobID=bcdd96fa-d096-3e47-4ba6-782673dbb4ea, Part#=0, TransfersDone=1 of 1
2022/12/09 14:53:11 all parts of entire Job bcdd96fa-d096-3e47-4ba6-782673dbb4ea successfully completed, cancelled or paused
2022/12/09 14:53:11 is part of Job which 1 total number of parts done
2022/12/09 14:53:13 PERF: primary performance constraint is Unknown. States: C:  0, R:  0, W:  0, F:  0, H:  2, B:  0, S:  0, P:  0, Q:  0, D:  0, E:  0, T:  2, GRs: 16
2022/12/09 14:53:13 0.0 %, 0 Done, 1 Failed, 0 Pending, 0 Skipped, 1 Total, 2-sec Throughput (Mb/s): 7.366157482975328e+13
</code>```

To rule out network issue or other things:

I tried downloading the log file from previous hour (2022/12/09/13) which is also about 50 MB, it was SUCCESSFUL.

After Azure AppService create a new log file for 2022/12/09/15, I tried downloading the file from the 14th hour, and it was SUCCESSFUL.

Since it is now the 15th hour, I tried downloading the log file for 2022/12/09/15 which is still small (7.7 MB), and to my surprise it was SUCCESSFUL.

A few minutes later I tried to download the 15th hour log file again which now has grown to 17 MB, and it FAILED.

Did anyone has this experience too?

Question: Is it because the file is too big, too active, or something else?

Body:
In my attempt to troubleshoot a website production issue, I want to download the latest hourly log file from an Azure Storage Blob container that is heavily written to by this live website.  I'm using Microsoft Azure Storage Explorer latest version (1.27.0, AzCopy version 10.16.2) by double-clicking the file from the GUI.  The file is about 50 MB.

But I keep getting the same error after 12 seconds, trying at least 3 times:

Transfer of 'xxxxapplogs/xxxxx/2022/12/09/14/xxxxx_xxxx.txt' to 'C:\Users\xxxx\AppData\Local\Temp\xxxx' failed: 0 items transferred (used SAS, discovery completed)  Started at: 12/9/2022 7:49 AM, Duration: 12 seconds.

Here's the output from the AzCopy Log file:

2022/12/09 14:53:03 ==> REQUEST/RESPONSE (Try=1/118.9608ms, OpTime=309.6046ms) -- RESPONSE SUCCESSFULLY RECEIVED GET  ....
2022/12/09 14:53:11 ==> REQUEST/RESPONSE (Try=1/61.8583ms, OpTime=295.8292ms) -- RESPONSE SUCCESSFULLY RECEIVED GET  ....
   X-Ms-Request-Id: [9d763303-001e-00ad-23dd-0b980b000000]

2022/12/09 14:53:11 ERR: [P#0-T#0] DOWNLOADFAILED: https://xxxx.blob.core.windows.net/xxxx/xxxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04 : 412 : 412 The condition specified using HTTP conditional header(s) is not met.. When Downloading response body. X-Ms-Request-Id: 9d763303-001e-00ad-23dd-0b980b000000

   Dst: \\?\C:\Users\xxxx\AppData\Local\Temp\16705975815589\f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxxx.txt
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 10755605  Count: 6021611 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 27602682  Count: 5951750 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 2398248  Count: 5990360 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] Error reading body of reply. Next try (if any) will be Try=2. Will NOT retry. Error: context canceled. Offset: 19441939  Count: 5723885 URL: https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04
2022/12/09 14:53:11 INFO: [P#0-T#0] https://xxxx.blob.core.windows.net/xxxx/xxx/2022/12/09/14/f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt?se=2023-01-08T14%3A53%3A01Z&sig=-REDACTED-&sp=rl&sr=c&sv=2021-10-04 Deleting incomplete destination file Dst: \\?\C:\Users\xxxx\AppData\Local\Temp\16705975815589\f3fa9d65bbfa688d29a1a91ccdec91ae26ed93dc3155948db01783a752e0543f_xxx.txt
2022/12/09 14:53:11 JobID=bcdd96fa-d096-3e47-4ba6-782673dbb4ea, Part#=0, TransfersDone=1 of 1
2022/12/09 14:53:11 all parts of entire Job bcdd96fa-d096-3e47-4ba6-782673dbb4ea successfully completed, cancelled or paused
2022/12/09 14:53:11 is part of Job which 1 total number of parts done
2022/12/09 14:53:13 PERF: primary performance constraint is Unknown. States: C:  0, R:  0, W:  0, F:  0, H:  2, B:  0, S:  0, P:  0, Q:  0, D:  0, E:  0, T:  2, GRs: 16
2022/12/09 14:53:13 0.0 %, 0 Done, 1 Failed, 0 Pending, 0 Skipped, 1 Total, 2-sec Throughput (Mb/s): 7.366157482975328e+13

To rule out network issue or other things:

I tried downloading the log file from previous hour (2022/12/09/13) which is also about 50 MB, it was SUCCESSFUL.

After Azure AppService create a new log file for 2022/12/09/15, I tried downloading the file from the 14th hour, and it was SUCCESSFUL.

Since it is now the 15th hour, I tried downloading the log file for 2022/12/09/15 which is still small (7.7 MB), and to my surprise it was SUCCESSFUL.

A few minutes later I tried to download the 15th hour log file again which now has grown to 17 MB, and it FAILED.

Did anyone has this experience too?

Question: Is it because the file is too big, too active, or something else?


问:
JS date string inside an object automatically gets converted to object if field name is time
I'm trying to use lightweight-charts and I need a field name time. So the structure should be something like this: {time: '2022-05-05', value: 51.21}

For some reason the date string I supply to time field automatically gets converted to an object like this: {day: 9, month: 12, year: 2022} even when it is clearly saved as a string. I changed the field name to something different like date and it goes back to just being a plain string like this: 2022-12-05. But I wouldn't be able to use lightweight-charts with that field name.

My question is where is this auto-converting coming from? the dates come from momentjs using the format function like so: moment(item.date).format('YYYY-MM-DD').toString(). I'm using react (if it has something to do with it).

EDIT:
I basically have an array of these objects: {time: '2022-05-05', value: 51.21} and I basically just push them into an array like this: dataset.push({value: item.value, time: moment(item.date).format('YYYY-MM-DD')}) Nothing special. I printed this array and it would spit out something like this: [{value: 51.15, time: {day: 9, month: 12, year: 2022}}]. but when I changed the field to date it prints this out: [{value: 51.15, time:'2022-12-09'].

I also tried creating a formatter function and saving it as string literal. So it loops through the dataset again and save it like this: time: '${item.time}' and it prints out: [{value: 53.1, time: [Object object]}] so we can confirm that it is automatically being converted as an object

this is basically just the code:

```<code>while (moment(latestTime).diff(oldestTime, 'day') >= 0) {
  dataset.push({ time: `${moment(latestTime).format('yyyy-MM-DD').toString()}` })
  latestTime = moment(latestTime).subtract(1, 'day')
}
</code>```

Another EDIT:
This is the entire code:

// mock response data
const response = { data: [{create_tz: "2022-12-09T12:50:43.853156+00:00"}, {create_tz: "2022-12-08T12:50:43.853156+00:00"}, {create_tz: "2022-12-06T12:50:43.853156+00:00"}] }
// actual code follows
const { data } = response // this is from an API response
const dataset = []
const oldestTime = moment(data[data.length - 1].create_tz)
let latestTime = moment(data[0].create_tz)
while (moment(latestTime).diff(oldestTime, 'day') >= 0) {
  dataset.push({value: 51.6, time: `${moment(latestTime).format('yyyy-MM-DD').toString()}` })
  latestTime = moment(latestTime).subtract(1, 'day')
}
console.log(dataset)```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script></code>```

Body:
I'm trying to use lightweight-charts and I need a field name time. So the structure should be something like this: {time: '2022-05-05', value: 51.21}

For some reason the date string I supply to time field automatically gets converted to an object like this: {day: 9, month: 12, year: 2022} even when it is clearly saved as a string. I changed the field name to something different like date and it goes back to just being a plain string like this: 2022-12-05. But I wouldn't be able to use lightweight-charts with that field name.

My question is where is this auto-converting coming from? the dates come from momentjs using the format function like so: moment(item.date).format('YYYY-MM-DD').toString(). I'm using react (if it has something to do with it).

EDIT:
I basically have an array of these objects: {time: '2022-05-05', value: 51.21} and I basically just push them into an array like this: dataset.push({value: item.value, time: moment(item.date).format('YYYY-MM-DD')}) Nothing special. I printed this array and it would spit out something like this: [{value: 51.15, time: {day: 9, month: 12, year: 2022}}]. but when I changed the field to date it prints this out: [{value: 51.15, time:'2022-12-09'].

I also tried creating a formatter function and saving it as string literal. So it loops through the dataset again and save it like this: time: '${item.time}' and it prints out: [{value: 53.1, time: [Object object]}] so we can confirm that it is automatically being converted as an object

this is basically just the code:

while (moment(latestTime).diff(oldestTime, 'day') >= 0) {
  dataset.push({ time: `${moment(latestTime).format('yyyy-MM-DD').toString()}` })
  latestTime = moment(latestTime).subtract(1, 'day')
}

Another EDIT:
This is the entire code:

// mock response data
const response = { data: [{create_tz: "2022-12-09T12:50:43.853156+00:00"}, {create_tz: "2022-12-08T12:50:43.853156+00:00"}, {create_tz: "2022-12-06T12:50:43.853156+00:00"}] }
// actual code follows
const { data } = response // this is from an API response
const dataset = []
const oldestTime = moment(data[data.length - 1].create_tz)
let latestTime = moment(data[0].create_tz)
while (moment(latestTime).diff(oldestTime, 'day') >= 0) {
  dataset.push({value: 51.6, time: `${moment(latestTime).format('yyyy-MM-DD').toString()}` })
  latestTime = moment(latestTime).subtract(1, 'day')
}
console.log(dataset)


问:
Filling a matrix after doing the row and column comparison in R
May I ask you how can I compare a table (which has these attributes: initial machine name, destination machine name and incremental numeric ID) and an empty array (which has as attributes: arrival machine name in the columns and the target machine name start in lines).

If there is this correspondence between the departure and the arrival, then I have to fill with the incremental id value inside the array.

enter image description here

enter image description here

```<code>for (i in nrow(rownames(tabellaMatrice))) {
  for (j in ncol(colnames(tabellaMatrice))) {
    for (r in nrow(tab2$Da)) {
      ifelse(tab2$Da[r]==rownames(tabellaMatrice)[i],
             for (o in nrow(tab2$A)) {
               ifelse(tab2$A[o]==colnames(tabellaMatrice),
                      for (p in nrow(tab2$`Numero incrementale`)) {
                        tabellaMatrice[i,j]<-tab2$`Numero incrementale`[p]

                      }
                      ,"")

             },"")

    }

  }

}
</code>```

I'm trying to do this with for loops

I expect that inside the array is incremental id.

Body:
May I ask you how can I compare a table (which has these attributes: initial machine name, destination machine name and incremental numeric ID) and an empty array (which has as attributes: arrival machine name in the columns and the target machine name start in lines).

If there is this correspondence between the departure and the arrival, then I have to fill with the incremental id value inside the array.

enter image description here

enter image description here

for (i in nrow(rownames(tabellaMatrice))) {
  for (j in ncol(colnames(tabellaMatrice))) {
    for (r in nrow(tab2$Da)) {
      ifelse(tab2$Da[r]==rownames(tabellaMatrice)[i],
             for (o in nrow(tab2$A)) {
               ifelse(tab2$A[o]==colnames(tabellaMatrice),
                      for (p in nrow(tab2$`Numero incrementale`)) {
                        tabellaMatrice[i,j]<-tab2$`Numero incrementale`[p]

                      }
                      ,"")

             },"")

    }

  }

}

I'm trying to do this with for loops

I expect that inside the array is incremental id.


问:
how do i sort my list of objects according to alphabetical order?
So I am trying to sort a list containing objects, with attributes: name, grade and age.
For my program I must have two classes and one of the is blueprint for an object (student) and another class is used to save these object in a list which is inside an init method.

```<code>class Student:
    def __init__(self, name, grade, age):
        self.name = name
        self.grade = grade
        self.age = age
    def __repr__(self):
        return repr((self.name, self.grade, self.age))

class Objects:
    def __init__(self):
        self.student_objects = [
    Student('john', 'A', 15),
    Student('jane', 'B', 12),
    Student('dave', 'B', 10),
]
new_list = sorted(Objects.student_objects, key=lambda student: student.age)

print(new_list)
</code>```

I am trying to print a new list which should be sorted in alphabetical order.

i tried to do:

```<code>new_list = sorted(Objects.student_objects, key=lambda student: student.age)

print(new_list)
</code>```

And i was expecting:
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]

but instead I am getting:
AttributeError: type object 'Objects' has no attribute 'student_objects'

How am i supposed to sort the list in alphabetical order?

Body:
So I am trying to sort a list containing objects, with attributes: name, grade and age.
For my program I must have two classes and one of the is blueprint for an object (student) and another class is used to save these object in a list which is inside an init method.

class Student:
    def __init__(self, name, grade, age):
        self.name = name
        self.grade = grade
        self.age = age
    def __repr__(self):
        return repr((self.name, self.grade, self.age))

class Objects:
    def __init__(self):
        self.student_objects = [
    Student('john', 'A', 15),
    Student('jane', 'B', 12),
    Student('dave', 'B', 10),
]
new_list = sorted(Objects.student_objects, key=lambda student: student.age)

print(new_list)

I am trying to print a new list which should be sorted in alphabetical order.

i tried to do:

new_list = sorted(Objects.student_objects, key=lambda student: student.age)

print(new_list)

And i was expecting:
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]

but instead I am getting:
AttributeError: type object 'Objects' has no attribute 'student_objects'

How am i supposed to sort the list in alphabetical order?


问:
Python Indexing to print two list on the same line with an input
How should I print out 2 list with indexing on the same line based on Input value? Right now the output is A  1 B 2 C 3 but i dont want that</p>
```<code>Alphabets = ["A","B","C"]
Numbers = [1,2,3]
Input = [0,0,0]

print("1.A == 1\n2.B == 2\n3.C == 3")

Num_choice = 3
n = 1

Times = int(input("How many tries?:"))

while Times >= n:
    for index in range(Num_choice):
        choice = input(f"Give the code{index + 1}:")
        if choice == "1":
            Input[0] += 1
        if choice == "2":
            Input[1] += 1
        if choice == "3":
            Input[2] += 1

    for index in range(Num_choice):
        print(Alphabets[index] + "\t" + str(Numbers[index]))
    n += 1

print(Input)

#what im trying to get is
#Input[0] == 1, output is A     1
#Input[1] == 1, output is B     2
#Input[2] == 1, output is C     3
#Input[0] == 2, output is A     1 but twice
#and so on for other Input
</code>```

Body:
How should I print out 2 list with indexing on the same line based on Input value? Right now the output is A  1 B 2 C 3 but i dont want that

Alphabets = ["A","B","C"]
Numbers = [1,2,3]
Input = [0,0,0]

print("1.A == 1\n2.B == 2\n3.C == 3")

Num_choice = 3
n = 1

Times = int(input("How many tries?:"))

while Times >= n:
    for index in range(Num_choice):
        choice = input(f"Give the code{index + 1}:")
        if choice == "1":
            Input[0] += 1
        if choice == "2":
            Input[1] += 1
        if choice == "3":
            Input[2] += 1

    for index in range(Num_choice):
        print(Alphabets[index] + "\t" + str(Numbers[index]))
    n += 1

print(Input)

#what im trying to get is
#Input[0] == 1, output is A     1
#Input[1] == 1, output is B     2
#Input[2] == 1, output is C     3
#Input[0] == 2, output is A     1 but twice
#and so on for other Input


问:
HFSQL - Get current database name
I wanted to know if it was possible to get the database name (HFSQL) using a SQL Query.
I tried to use the MySQL "SELECT DATABASE();" (had little hope but tried anyway) and wanted to know if there was a similar method because the only method I saw online was using a specific HFSQL function (HListDatabase) HFSQL HListDatabase and in the project I'm currently working on I can't use it.

thanks

Title: HFSQL - Get current database name


问:
Connecting Cypress to Oracle Database
I've been trying to configure cypress.config.js in order to connect to an oracle database. But I've been facing the following error :

Cypress.PluginEvents, config

Can someone help me with this issue?

Thank you!

Title: Connecting Cypress to Oracle Database


问:
Have we any best practice for standardising key naming across platforms and/or frameworks?
Have we any best practice for standardising key naming across platforms and/or frameworks?

Expecting advice from peoples experience


问:
Loopback 4 - JWT authentication - error with given UserRepository
First of all, I have to say I'm new to TypeScript and moreover that since I cannot find a single tutorial about LB and JWT authentication that seems to work correctly from the beginning to the end I had to follow more than one and try to put the pieces together while coding.

Started following this article on Medium, but did feels as something were missing, so switched to @loopback/authentication-jwt documentation and find out I had to make my own (empty) User model that extends LB's one just to have its table created, so far so good, so got back to Medium.

The real problem arise when trying to add the controller: copy-pasted the linked controller file and fixed any import to use @loopback/authentication-jwt own UserRepository class, but I when trying to register a new user via the /signup route I get back a 500 response with an error at line #156 of given controller file:

```<code>Request POST /signup failed with status code 500. TypeError: this.userRepository.userCredentials is not a function
    at UserController.signUp (/home/node/app/dist/controllers/user.controller.js:78:35)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /home/node/app/node_modules/@loopback/rest/dist/providers/invoke-method.provider.js:37:32
    at async /home/node/app/node_modules/@loopback/express/dist/middleware-interceptor.js:82:25
    at async /home/node/app/node_modules/@loopback/express/dist/middleware-interceptor.js:82:25
    at async /home/node/app/node_modules/@loopback/rest/dist/providers/send.provider.js:39:32
    at async MySequence.handle (/home/node/app/node_modules/@loopback/rest/dist/sequence.js:201:9)
    at async HttpHandler._handleRequest (/home/node/app/node_modules/@loopback/rest/dist/http-handler.js:64:9)
</code>```

Inspecting UserRepository code I can see that

export declare class UserRepository extends DefaultCrudRepository<User, typeof User.prototype.id, UserRelations> {
    // ...
    readonly userCredentials: HasOneRepositoryFactory<UserCredentials, typeof User.prototype.id>;
    // ...
}
```
<p>and digging deeper inspecting <code>HasOneRepositoryFactory</code> I see this:</p>
<pre class="lang-js prettyprint-override"><code>export interface HasOneRepositoryFactory<Target extends Entity, ForeignKeyType> {
    /**
     * Invoke the function to obtain HasOneRepository.
     */
    (fkValue: ForeignKeyType): HasOneRepository<Target>;
    /**
     * Use `resolver` property to obtain an InclusionResolver for this relation.
     */
    inclusionResolver: InclusionResolver<Entity, Target>;
}
</code>```

Maybe I'm missing something about TS syntax, but to me the given user controller code seems to be correct and calling  this.userRepository.userCredentials(savedUser.id) at line 156 should not give any error, but still I get it.

Probably I'm missing something else about LB itself, but can't figure out what.

Update #1

@ShubhamP find out an issue about my problem:

https://github.com/loopbackio/loopback-next/issues/6964

Update #2

Created Github repo with current project state: https://github.com/xfudox/test-lb4

Just start the project with docker compose up -d --build, then log into the node container, install the dependancies and run with npm run start

Body:
First of all, I have to say I'm new to TypeScript and moreover that since I cannot find a single tutorial about LB and JWT authentication that seems to work correctly from the beginning to the end I had to follow more than one and try to put the pieces together while coding.

Started following this article on Medium, but did feels as something were missing, so switched to @loopback/authentication-jwt documentation and find out I had to make my own (empty) User model that extends LB's one just to have its table created, so far so good, so got back to Medium.

The real problem arise when trying to add the controller: copy-pasted the linked controller file and fixed any import to use @loopback/authentication-jwt own UserRepository class, but I when trying to register a new user via the /signup route I get back a 500 response with an error at line #156 of given controller file:

Request POST /signup failed with status code 500. TypeError: this.userRepository.userCredentials is not a function
    at UserController.signUp (/home/node/app/dist/controllers/user.controller.js:78:35)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /home/node/app/node_modules/@loopback/rest/dist/providers/invoke-method.provider.js:37:32
    at async /home/node/app/node_modules/@loopback/express/dist/middleware-interceptor.js:82:25
    at async /home/node/app/node_modules/@loopback/express/dist/middleware-interceptor.js:82:25
    at async /home/node/app/node_modules/@loopback/rest/dist/providers/send.provider.js:39:32
    at async MySequence.handle (/home/node/app/node_modules/@loopback/rest/dist/sequence.js:201:9)
    at async HttpHandler._handleRequest (/home/node/app/node_modules/@loopback/rest/dist/http-handler.js:64:9)

Inspecting UserRepository code I can see that

export declare class UserRepository extends DefaultCrudRepository<User, typeof User.prototype.id, UserRelations> {
    // ...
    readonly userCredentials: HasOneRepositoryFactory<UserCredentials, typeof User.prototype.id>;
    // ...
}

and digging deeper inspecting HasOneRepositoryFactory I see this:

export interface HasOneRepositoryFactory<Target extends Entity, ForeignKeyType> {
    /**
     * Invoke the function to obtain HasOneRepository.
     */
    (fkValue: ForeignKeyType): HasOneRepository<Target>;
    /**
     * Use `resolver` property to obtain an InclusionResolver for this relation.
     */
    inclusionResolver: InclusionResolver<Entity, Target>;
}

Maybe I'm missing something about TS syntax, but to me the given user controller code seems to be correct and calling  this.userRepository.userCredentials(savedUser.id) at line 156 should not give any error, but still I get it.

Probably I'm missing something else about LB itself, but can't figure out what.

Update #1

@ShubhamP find out an issue about my problem:

https://github.com/loopbackio/loopback-next/issues/6964

Update #2

Created Github repo with current project state: https://github.com/xfudox/test-lb4

Just start the project with docker compose up -d --build, then log into the node container, install the dependancies and run with npm run start


问:
How to sum an array of bytes in assembly?
I'm trying to sum an array using this code

I don't know what register to use in order to sum the array.

I tried to use ax,bx,cx,dx but really I don't know what to do anymore

```<code>.MODEL SMALL
DATA SEGMENT
arr DB 0,0,0,0,0,0,0,0,0,0
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA

start:
MOV AX,DATA
MOV DS,AX
MOV AX,0
MOV BX, OFFSET arr
mov cx, 9

input:
mov ah,1
int 21h
mov [bx],al
inc bx

loop input

mov bx, OFFSET arr
mov cx,9
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h

mov ax,[bx]
inc bx

cal:
add ax,[bx]
inc bx

loop cal

mov ah,2
mov dl,al
int 21h

MOV AH,4Ch
INT 21h
CODE ENDS
END start
</code>```

Body:
I'm trying to sum an array using this code

I don't know what register to use in order to sum the array.

I tried to use ax,bx,cx,dx but really I don't know what to do anymore

.MODEL SMALL
DATA SEGMENT
arr DB 0,0,0,0,0,0,0,0,0,0
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA

start:
MOV AX,DATA
MOV DS,AX
MOV AX,0
MOV BX, OFFSET arr
mov cx, 9

input:
mov ah,1
int 21h
mov [bx],al
inc bx

loop input

mov bx, OFFSET arr
mov cx,9
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h

mov ax,[bx]
inc bx

cal:
add ax,[bx]
inc bx

loop cal

mov ah,2
mov dl,al
int 21h

MOV AH,4Ch
INT 21h
CODE ENDS
END start


问:
Selecting the next line in a file
I'm trying to extract information from a txt file. Particularly I need the line that is immediately beneath the line that starts with the number (71). Currently, I'm selecting the line that starts with 71 and deleting the line feed by hand in the txt file. How can I select the line that follows the one that starts with 71 automatically? I'm a complete beginner, I apologize if it is a dumb question.

```<code>fhand = input('Ingrese nombre de archivo: ')
file = open(fhand, encoding='utf8')

pais = dict()
provincia = dict()

for line in file :
    if line.startswith('(71)') :
      line = line.rstrip()
      lista = line.split(' ')
      pais[lista[-1]] = pais.get(lista[-1], 0) + 1
      if pais == 'AR':
        provincia[lista[-2]] = provincia.get(lista[-2], 0 ) + 1

print(pais)
print(provincia)
print(count, cuenta)
</code>```

I'm manually deleting the line feed in order to obtain the information I need. I would like to automate this process.

Title: Selecting the next line in a file

Body:
I'm trying to extract information from a txt file. Particularly I need the line that is immediately beneath the line that starts with the number (71). Currently, I'm selecting the line that starts with 71 and deleting the line feed by hand in the txt file. How can I select the line that follows the one that starts with 71 automatically? I'm a complete beginner, I apologize if it is a dumb question.

fhand = input('Ingrese nombre de archivo: ')
file = open(fhand, encoding='utf8')

pais = dict()
provincia = dict()

for line in file :
    if line.startswith('(71)') :
      line = line.rstrip()
      lista = line.split(' ')
      pais[lista[-1]] = pais.get(lista[-1], 0) + 1
      if pais == 'AR':
        provincia[lista[-2]] = provincia.get(lista[-2], 0 ) + 1

print(pais)
print(provincia)
print(count, cuenta)

I'm manually deleting the line feed in order to obtain the information I need. I would like to automate this process.


问:
How to use ParaView to display this format file: xdmf with binary?
After using the lb/fluid module of lammps to calculate MD, I got the following files (fflow.xdmf fflow.raw), but I couldn't find the relevant opening solutions in the paraview manual.

Several lines in the xdmf file (fflow.xdmf) look like this：
`

```<code>        <Attribute Name="density">
          <DataItem ItemType="Function" Function="$0 * 0.001000" Dimensions="11 11 11">
            <DataItem Precision="8" Format="Binary" Seek="0" Dimensions="11 11 11">
              fflow.raw
            </DataItem>
          </DataItem>
        </Attribute>
</code>```

`
The document is placed in the attachment.
fflow.xdmf
fflow.raw

When I use paraview, it seems that fflow.raw does not load normally.

Body:
After using the lb/fluid module of lammps to calculate MD, I got the following files (fflow.xdmf fflow.raw), but I couldn't find the relevant opening solutions in the paraview manual.

Several lines in the xdmf file (fflow.xdmf) look like this：
`

        <Attribute Name="density">
          <DataItem ItemType="Function" Function="$0 * 0.001000" Dimensions="11 11 11">
            <DataItem Precision="8" Format="Binary" Seek="0" Dimensions="11 11 11">
              fflow.raw
            </DataItem>
          </DataItem>
        </Attribute>

`
The document is placed in the attachment.
fflow.xdmf
fflow.raw

When I use paraview, it seems that fflow.raw does not load normally.


问:
How to unshelve changes into another branch using TFS?
I am working on an application where I want to unshelve changes from one branch to another branch using TFS. I am attaching different images which contain my branches, shelve set name, and shelve set details. I want to unshelve changes at 05-PartnerIntergration branch.

Shelve Set name is Krone Integration

Here are the branches shown below in image.


问:
Need to apply multiple themes to react story book
We have been using react storybook in my projects. As part of design upgradation, we are creating new components without disturbing the existing components.
old stories are in mpg-component folder for new component stories we have created mpg-component-new.
our preview js decorator is defined as below.

```<code> export const decorators = [
  (Story) => (
    <div class="mpg-component-container">
      <Story />
    </div>
  ),
];
</code>```

In my case, I would like to apply a different root class for mpg-component-new.
As I need to change a few designs for the newly added components.
Is there any way to apply different classes for the mpg-component and mpg-component-new.
Please suggest.

Body:
We have been using react storybook in my projects. As part of design upgradation, we are creating new components without disturbing the existing components.
old stories are in mpg-component folder for new component stories we have created mpg-component-new.
our preview js decorator is defined as below.

 export const decorators = [
  (Story) => (

      <Story />

  ),
];

In my case, I would like to apply a different root class for mpg-component-new.
As I need to change a few designs for the newly added components.
Is there any way to apply different classes for the mpg-component and mpg-component-new.
Please suggest.


问:
How to create a Pandas dataframe using values selectively taken from another dataframe?
I have a dataframe d1 like this:

From this, i want to extract another dataframe d2 like:

Naively, i'm trying the below code:

```<code>d2 = pd.DataFrame(index=d1['X'].unique(), columns=d1['Y'].unique())
for i in d1['X'].unique():
    for j in d1['Y'].unique():
        d2.loc[i,j]=d1[(d1['X']==i) & (d1['Y']==j)]['Z']
</code>```

But in gives: ValueError: Incompatible indexer with Series

I'm a beginner and any help would mean a lot! Thanks.

Body:
I have a dataframe d1 like this:

From this, i want to extract another dataframe d2 like:

Naively, i'm trying the below code:

d2 = pd.DataFrame(index=d1['X'].unique(), columns=d1['Y'].unique())
for i in d1['X'].unique():
    for j in d1['Y'].unique():
        d2.loc[i,j]=d1[(d1['X']==i) & (d1['Y']==j)]['Z']

But in gives: ValueError: Incompatible indexer with Series

I'm a beginner and any help would mean a lot! Thanks.


问:
How to make StyleCop allow "_" discard in LINQ query syntax?
StyleCop returns the warning

Variable '_' should begin with lower-case letter

when the '_' is used as a discard in a LINQ query-syntax block:

Is there any way to globally configure StyleCop in a Visual Studio project/solution to allow underscores to be used like this, without a warning, please?

Using StyleCop.Analysers 1.1.118


问:
What can be the reason trimmer analyzer does not emit warnings, but trimmer itself does?
I have an assembly which uses reflection. I want to publish its trimmed version (<PublishTrimmed>true</PublishTrimmed>), but I cannot. I get errors when publishing; trimmer complains about code which is not properly marked with trim-related attributes:

BeforeCommitDomainEventPublisher.d__5.MoveNext(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'System.Type.InvokeMember(String, BindingFlags, Binder, Object, Object[])'. The field 'System.ValueTuple<T1,T2>.Item1' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

However, when I just build my solution the build is successful, and analyzer does not show any warning or error. What is the reason for it? I'd expect errors here as well.