问:
Forward HTTP requests from my angular application deployed on Amazon CloudFront to different microservices deployed on my EC2 instance
I am deploying Angular application on Amazon CloudFront. From my Angular application, various REST APIs of my different microservices are being called. These microservices have been deployed on Amazon EC2 Instance. I have a question. Can I forward different requests from the Amazon CloudFront to different microservices by defining different Origins in the Amazon CloudFront with each Origin pointing to the specific microservice deployed on the EC2 instance and after this, I define Behaviors in the Amazon CloudFront in which I mention that which requests will be redirected to which microservices based on the request URL. Can I achieve this using that methodology? I am new to AWS that's why I am confused what is the best way to achieve this because there seems a lot of ways to do the same thing.</p>


来源: stackexchange

问:
How can I delete write permissions from Gamma role?
We are trying to make a decision on how to operate Superset within a whole company which has more than 10 divisions that will need each dashboard and datasets to view with only read-only Gamma role that won't allow users to create a new dashboard etc..

Is there a way to simply operate the roles and the permissions?

Thank you!

I read through the documentation and explored over the sites to find a solution but there seems no.

ContentLicense: CC BY-SA 4.0


问:
For Loop: How do I see plot for different columns in Spyder "Plots" Window?
Currently, I ran the below code in Spyder. And I only see the last plot (Age) in my "Plots" window. How can I see the plot for each column as the code loops through the columns?

Thank you

```<code>import pandas as pd
import seaborn as sns

df=pd.DataFrame ({'Sex': ['M', 'M', 'F'],
                  'Age': ['19', '88','14']
                  })

for col in df.columns:
    c=df.groupby(col)[col].count()

    sns.barplot(x=c.index,y=c.values)
</code>```

Body:
Currently, I ran the below code in Spyder. And I only see the last plot (Age) in my "Plots" window. How can I see the plot for each column as the code loops through the columns?

Thank you

import pandas as pd
import seaborn as sns

df=pd.DataFrame ({'Sex': ['M', 'M', 'F'],
                  'Age': ['19', '88','14']
                  })

for col in df.columns:
    c=df.groupby(col)[col].count()

    sns.barplot(x=c.index,y=c.values)


问:
Powershell, selenium, javascript automation click on link
Trying to automate Powershell, selenium on Chrome for a link that contains javascript.

I can open a link from the same page which doesn't have javascript in it but I can't get the javascript link to open.

This is the link text I get when I inspect it on Chrome.

```<code><a href="javascript:ShowMnt()" title="Perform the Administrative Functions" class="fade link-button">
                <i class="fas fa-tasks"></i>Maintenance        </a>
</code>```

This is the code I am using on the XPath that I get for the link.

```<code>$ChromeDriver.FindElement([OpenQa.Selenium.By]::XPath('/html/body/div[1]/div/div/div[1]/div/fieldset[1]/div[2]/table/tbody/tr[2]/td/div/a')).Click()
</code>```

This is the ERROR:
MethodInvocationException: Exception calling "FindElement" with "1" argument(s): "no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div/div[1]/div/fieldset[1]/div[2]/table/tbody/tr[2]/td/div/a"}

Can javascripts link be launched this way?
I have also tried using other links that have javascript in them on the same page and get a similar issue.

Thanks in advance.

Body:
Trying to automate Powershell, selenium on Chrome for a link that contains javascript.

I can open a link from the same page which doesn't have javascript in it but I can't get the javascript link to open.

This is the link text I get when I inspect it on Chrome.

                Maintenance

This is the code I am using on the XPath that I get for the link.

$ChromeDriver.FindElement([OpenQa.Selenium.By]::XPath('/html/body/div[1]/div/div/div[1]/div/fieldset[1]/div[2]/table/tbody/tr[2]/td/div/a')).Click()

This is the ERROR:
MethodInvocationException: Exception calling "FindElement" with "1" argument(s): "no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div/div[1]/div/fieldset[1]/div[2]/table/tbody/tr[2]/td/div/a"}

Can javascripts link be launched this way?
I have also tried using other links that have javascript in them on the same page and get a similar issue.

Thanks in advance.


问:
imGUI + VTK using the VS2019, it doesn't appear on the screen
I made sample code using the imGUI & VTK in visual studio 2019.

refference sites : https://github.com/trlsmax/imgui-vtk & https://github.com/ocornut/imgui

VTK version : 9.2(latest version)

I'm doing with VTK viewer in imGUI. But, I faced on the problems as below.

======
code

```<code>#pragma once

////#include <vtkAutoInit.h>
////
////#define vtkRederingCore_AUTOINIT 3(vtkRenderingOpenGL2, vtkInteractionStyle, vtkRenderingFreeType)
////#define vtkRenderingContext2D_AUTOINIT 1(vtkRenderingContextOpenGL2)

#include <vtkAutoInit.h>

#define vtkRenderingCore_AUTOINIT 3(vtkRenderingOpenGL2,vtkInteractionStyle, vtkRenderingFreeType)
#define vtkRenderingContext2D_AUTOINIT 1(vtkRenderingContextOpenGL2)

#include <vtkActor.h>
#include <vtkCylinderSource.h>
#include <vtkSmartPointer.h>
#include <vtkContourFilter.h>
#include <vtkMath.h>
#include <vtkNamedColors.h>
#include <vtkPointData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkShortArray.h>
#include <vtkStructuredPoints.h>

static vtkSmartPointer<vtkActor> SetupDemoCylinder()
{
    auto colors = vtkSmartPointer<vtkNamedColors>::New();

    // Set the background color.
    std::array<unsigned char, 4> bkg{ {26, 51, 102, 255} };
    colors->SetColor("BkgColor", bkg.data());

    // This creates a polygonal cylinder model with eight circumferential facets
    // (i.e, in practice an octagonal prism).
    auto cylinder = vtkSmartPointer<vtkCylinderSource>::New();
    cylinder->SetResolution(8);

    // The mapper is responsible for pushing the geometry into the graphics
    // library. It may also do color mapping, if scalars or other attributes are
    // defined.
    auto cylinderMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
    cylinderMapper->SetInputConnection(cylinder->GetOutputPort());

    // The actor is a grouping mechanism: besides the geometry (mapper), it
    // also has a property, transformation matrix, and/or texture map.
    // Here we set its color and rotate it around the X and Y axes.

    auto cylinderActor = vtkSmartPointer<vtkActor>::New();
    cylinderActor->SetMapper(cylinderMapper);
    cylinderActor->GetProperty()->SetColor(colors->GetColor4d("Tomato").GetData());
    cylinderActor->RotateX(30.0);
    cylinderActor->RotateY(-45.0);

    return cylinderActor;
}

main.cpp

    auto actor = SetupDemoCylinder();

    // Setup window
    glfwSetErrorCallback(glfw_error_callback);
    if (!glfwInit()) {
        return 1;
    }

    // Use GL 3.2 (All Platforms)
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

    // Decide GLSL version
#ifdef __APPLE__
  // GLSL 150
    const char* glsl_version = "#version 150";
#else
  // GLSL 130
    const char* glsl_version = "#version 130";
#endif

    // Create window with graphics context
    GLFWwindow* window = glfwCreateWindow(1280, 720, "Dear ImGui VTKViewer Example", NULL, NULL);
    if (window == NULL) {
        return 1;
    }
    glfwMakeContextCurrent(window);
    glfwSwapInterval(1); // Enable vsync

    // Initialize OpenGL loader
    if (gl3wInit() != 0) {
        fprintf(stderr, "Failed to initialize OpenGL loader!\n");
        return 1;
    }

    // Setup Dear ImGui context
    IMGUI_CHECKVERSION();
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;           // Enable Docking
    io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;         // Enable Multi-Viewport / Platform Windows'

    // Setup Dear ImGui style
    ImGui::StyleColorsDark();

    // Setup Platform/Renderer backends
    ImGui_ImplGlfw_InitForOpenGL(window, true);
    ImGui_ImplOpenGL3_Init(glsl_version);

    // Initialize VtkViewer objects
    VtkViewer vtkViewer1;
    vtkViewer1.addActor(actor);

    VtkViewer vtkViewer2;
    vtkViewer2.addActor(actor);
    vtkViewer2.getRenderer()->SetBackground(0, 0, 0); // Black background

    // Our state
    bool show_demo_window = true;
    bool show_another_window = false;
    bool vtk_2_open = true;
    ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);

</code>```

// Main loop
while (!glfwWindowShouldClose(window))
{

```<code> // 4. Show a simple VtkViewer Instance (Always Open)
        ImGui::SetNextWindowSize(ImVec2(360, 240), ImGuiCond_FirstUseEver);
        ImGui::Begin("Vtk Viewer 1", nullptr, VtkViewer::NoScrollFlags());
        vtkViewer1.render(); // default render size = ImGui::GetContentRegionAvail()
        ImGui::End();

        // 5. Show a more complex VtkViewer Instance (Closable, Widgets in Window)
        ImGui::SetNextWindowSize(ImVec2(720, 480), ImGuiCond_FirstUseEver);
        if (vtk_2_open) {
            ImGui::Begin("Vtk Viewer 2", &vtk_2_open, VtkViewer::NoScrollFlags());

            // Other widgets can be placed in the same window as the VTKViewer
            // However, since the VTKViewer is rendered to size ImGui::GetContentRegionAvail(),
            // it is best to put all widgets first (i.e., render the VTKViewer last).
            // If you want the VTKViewer to be at the top of a window, you can manually calculate
            // and define its size, accounting for the space taken up by other widgets

            auto renderer = vtkViewer2.getRenderer();
            if (ImGui::Button("VTK Background: Black")) {
                renderer->SetBackground(0, 0, 0);
            }
            ImGui::SameLine();
            if (ImGui::Button("VTK Background: Red")) {
                renderer->SetBackground(1, 0, 0);
            }
            ImGui::SameLine();
            if (ImGui::Button("VTK Background: Green")) {
                renderer->SetBackground(0, 1, 0);
            }
            ImGui::SameLine();
            if (ImGui::Button("VTK Background: Blue")) {
                renderer->SetBackground(0, 0, 1);
            }
            static float vtk2BkgAlpha = 0.2f;
            ImGui::SliderFloat("Background Alpha", &vtk2BkgAlpha, 0.0f, 1.0f);
            renderer->SetBackgroundAlpha(vtk2BkgAlpha);

            vtkViewer2.render();

            ImGui::End();
        }

        ImGui::Render();

        int display_w, display_h;
        glfwGetFramebufferSize(window, &display_w, &display_h);
        glViewport(0, 0, display_w, display_h);
        glClear(GL_COLOR_BUFFER_BIT);
        ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());

        // Update and Render additional Platform Windows
        if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
        {
            GLFWwindow* backup_current_context = glfwGetCurrentContext();
            ImGui::UpdatePlatformWindows();
            ImGui::RenderPlatformWindowsDefault();
            glfwMakeContextCurrent(backup_current_context);
        }

        glfwSwapBuffers(window);
    }
</code>```

======
I attaced the code

enter image description here

I want to solve the ploblem.

Body:
I made sample code using the imGUI & VTK in visual studio 2019.

refference sites : https://github.com/trlsmax/imgui-vtk & https://github.com/ocornut/imgui

VTK version : 9.2(latest version)

I'm doing with VTK viewer in imGUI. But, I faced on the problems as below.

======
code

#pragma once

////#include <vtkAutoInit.h>
////
////#define vtkRederingCore_AUTOINIT 3(vtkRenderingOpenGL2, vtkInteractionStyle, vtkRenderingFreeType)
////#define vtkRenderingContext2D_AUTOINIT 1(vtkRenderingContextOpenGL2)

#include <vtkAutoInit.h>

#define vtkRenderingCore_AUTOINIT 3(vtkRenderingOpenGL2,vtkInteractionStyle, vtkRenderingFreeType)
#define vtkRenderingContext2D_AUTOINIT 1(vtkRenderingContextOpenGL2)

#include <vtkActor.h>
#include <vtkCylinderSource.h>
#include <vtkSmartPointer.h>
#include <vtkContourFilter.h>
#include <vtkMath.h>
#include <vtkNamedColors.h>
#include <vtkPointData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkShortArray.h>
#include <vtkStructuredPoints.h>

static vtkSmartPointer<vtkActor> SetupDemoCylinder()
{
    auto colors = vtkSmartPointer<vtkNamedColors>::New();

    // Set the background color.
    std::array<unsigned char, 4> bkg{ {26, 51, 102, 255} };
    colors->SetColor("BkgColor", bkg.data());

    // This creates a polygonal cylinder model with eight circumferential facets
    // (i.e, in practice an octagonal prism).
    auto cylinder = vtkSmartPointer<vtkCylinderSource>::New();
    cylinder->SetResolution(8);

    // The mapper is responsible for pushing the geometry into the graphics
    // library. It may also do color mapping, if scalars or other attributes are
    // defined.
    auto cylinderMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
    cylinderMapper->SetInputConnection(cylinder->GetOutputPort());

    // The actor is a grouping mechanism: besides the geometry (mapper), it
    // also has a property, transformation matrix, and/or texture map.
    // Here we set its color and rotate it around the X and Y axes.

    auto cylinderActor = vtkSmartPointer<vtkActor>::New();
    cylinderActor->SetMapper(cylinderMapper);
    cylinderActor->GetProperty()->SetColor(colors->GetColor4d("Tomato").GetData());
    cylinderActor->RotateX(30.0);
    cylinderActor->RotateY(-45.0);

    return cylinderActor;
}

main.cpp

    auto actor = SetupDemoCylinder();

    // Setup window
    glfwSetErrorCallback(glfw_error_callback);
    if (!glfwInit()) {
        return 1;
    }

    // Use GL 3.2 (All Platforms)
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

    // Decide GLSL version
#ifdef __APPLE__
  // GLSL 150
    const char* glsl_version = "#version 150";
#else
  // GLSL 130
    const char* glsl_version = "#version 130";
#endif

    // Create window with graphics context
    GLFWwindow* window = glfwCreateWindow(1280, 720, "Dear ImGui VTKViewer Example", NULL, NULL);
    if (window == NULL) {
        return 1;
    }
    glfwMakeContextCurrent(window);
    glfwSwapInterval(1); // Enable vsync

    // Initialize OpenGL loader
    if (gl3wInit() != 0) {
        fprintf(stderr, "Failed to initialize OpenGL loader!\n");
        return 1;
    }

    // Setup Dear ImGui context
    IMGUI_CHECKVERSION();
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;           // Enable Docking
    io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;         // Enable Multi-Viewport / Platform Windows'

    // Setup Dear ImGui style
    ImGui::StyleColorsDark();

    // Setup Platform/Renderer backends
    ImGui_ImplGlfw_InitForOpenGL(window, true);
    ImGui_ImplOpenGL3_Init(glsl_version);

    // Initialize VtkViewer objects
    VtkViewer vtkViewer1;
    vtkViewer1.addActor(actor);

    VtkViewer vtkViewer2;
    vtkViewer2.addActor(actor);
    vtkViewer2.getRenderer()->SetBackground(0, 0, 0); // Black background

    // Our state
    bool show_demo_window = true;
    bool show_another_window = false;
    bool vtk_2_open = true;
    ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);

// Main loop
while (!glfwWindowShouldClose(window))
{

 // 4. Show a simple VtkViewer Instance (Always Open)
        ImGui::SetNextWindowSize(ImVec2(360, 240), ImGuiCond_FirstUseEver);
        ImGui::Begin("Vtk Viewer 1", nullptr, VtkViewer::NoScrollFlags());
        vtkViewer1.render(); // default render size = ImGui::GetContentRegionAvail()
        ImGui::End();

        // 5. Show a more complex VtkViewer Instance (Closable, Widgets in Window)
        ImGui::SetNextWindowSize(ImVec2(720, 480), ImGuiCond_FirstUseEver);
        if (vtk_2_open) {
            ImGui::Begin("Vtk Viewer 2", &vtk_2_open, VtkViewer::NoScrollFlags());

            // Other widgets can be placed in the same window as the VTKViewer
            // However, since the VTKViewer is rendered to size ImGui::GetContentRegionAvail(),
            // it is best to put all widgets first (i.e., render the VTKViewer last).
            // If you want the VTKViewer to be at the top of a window, you can manually calculate
            // and define its size, accounting for the space taken up by other widgets

            auto renderer = vtkViewer2.getRenderer();
            if (ImGui::Button("VTK Background: Black")) {
                renderer->SetBackground(0, 0, 0);
            }
            ImGui::SameLine();
            if (ImGui::Button("VTK Background: Red")) {
                renderer->SetBackground(1, 0, 0);
            }
            ImGui::SameLine();
            if (ImGui::Button("VTK Background: Green")) {
                renderer->SetBackground(0, 1, 0);
            }
            ImGui::SameLine();
            if (ImGui::Button("VTK Background: Blue")) {
                renderer->SetBackground(0, 0, 1);
            }
            static float vtk2BkgAlpha = 0.2f;
            ImGui::SliderFloat("Background Alpha", &vtk2BkgAlpha, 0.0f, 1.0f);
            renderer->SetBackgroundAlpha(vtk2BkgAlpha);

            vtkViewer2.render();

            ImGui::End();
        }

        ImGui::Render();

        int display_w, display_h;
        glfwGetFramebufferSize(window, &display_w, &display_h);
        glViewport(0, 0, display_w, display_h);
        glClear(GL_COLOR_BUFFER_BIT);
        ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());

        // Update and Render additional Platform Windows
        if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
        {
            GLFWwindow* backup_current_context = glfwGetCurrentContext();
            ImGui::UpdatePlatformWindows();
            ImGui::RenderPlatformWindowsDefault();
            glfwMakeContextCurrent(backup_current_context);
        }

        glfwSwapBuffers(window);
    }

======
I attaced the code

enter image description here

I want to solve the ploblem.


问:
How to add 3D model object in 3Doccupancy map?
I have created a 3D occupancy map to model a region where I want to test some path planning algorithms for an autonomous robot. I have created a 3D map along with obstacles, but my requirement is to add 3D model (eg, human,car,tree etc anything) to my map.

The example is difficult to understand. Can somebody help me in adding some model.

Note: I have made these buildings but i want to add some sort of models (like humans, tree,car etc)
Also can we add png,or gif to our map?
GIF of a Car

My 3D map

I have created a 3D map along with obstacles, but my requirement is to add 3D model (eg, human,car,tree etc anything) to my map.


问:
Inspect method active_queues failed - celery flower
I brought together different components of a ML application using celery flower & worker, Fast API, redis and RabbitMQ into docker-compose, but I seem to be getting an error with the celery_flower component that affects any calls made to it. Unfortunately can't share the images of the ML and celery_flower services, but any inputs on possible bugs in my docker-compose file would be very helpful.

version: "3.9"

services:
  web:
    image: custom-image
    container_name: web_app
    ports:
      - 8080:8080
      - 14565:14565
    depends_on:
      - amqp
      - celery_worker
      - redis
  amqp:
    image: rabbitmq:3
    container_name: rabbit_mq_test
    ports:
      - 4369:4369
      - 5672:5672
      - 25672:25672
      - 15672:15672
  redis:
    image: redis
    container_name: redis_container
    ports:
      - 6379:6379
  celery_worker:
    image: custom-image
    working_dir: /webapp/endpoints/contents/
    container_name: celery_worker
    command: /opt/conda/envs/webapp/bin/celery -A router.celery_app worker --loglevel=info -P threads
    depends_on:
      - amqp
      - redis

  celery_flower:
    container_name: celery_flower
    working_dir: /webapp/endpoints/contents/
    image: mher/flower:latest
    command: celery --broker 'amqp://guest:guest@amqp:5672//' --result-backend 'rpc://' flower
    environment:
      - CELERY_BROKER_URL=amqp://guest:guest@amqp:5672//
      - FLOWER_PORT=5555
    ports:
      - 5555:5555
    depends_on:
      - amqp
      - redis
```
<p>Error logs from celery_flower:</p>
```celery_flower | [I 221213 19:33:42 command:162] Visit me at http://localhost:5555
celery_flower | [I 221213 19:33:42 command:170] Broker: amqp://guest:**@amqp:5672//
celery_flower | [I 221213 19:33:42 command:171] Registered tasks:
celery_flower |   ['celery.accumulate',
celery_flower |    'celery.backend_cleanup',
celery_flower |    'celery.chain',
celery_flower |    'celery.chord',
celery_flower |    'celery.chord_unlock',
celery_flower |    'celery.chunks',
celery_flower |    'celery.group',
celery_flower |    'celery.map',
celery_flower |    'celery.starmap']
celery_flower | [W 221213 19:33:42 command:177] Running without authentication
celery_flower | [I 221213 19:33:48 mixins:225] Connected to amqp://guest:**@amqp:5672//
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method active_queues failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method active failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method scheduled failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method reserved failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method registered failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method revoked failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method conf failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method stats failed
```

I cannot spot anything wrong with the celery flower dashboard too which is quite confusing.

Body:
I brought together different components of a ML application using celery flower & worker, Fast API, redis and RabbitMQ into docker-compose, but I seem to be getting an error with the celery_flower component that affects any calls made to it. Unfortunately can't share the images of the ML and celery_flower services, but any inputs on possible bugs in my docker-compose file would be very helpful.

version: "3.9"

services:
  web:
    image: custom-image
    container_name: web_app
    ports:
      - 8080:8080
      - 14565:14565
    depends_on:
      - amqp
      - celery_worker
      - redis
  amqp:
    image: rabbitmq:3
    container_name: rabbit_mq_test
    ports:
      - 4369:4369
      - 5672:5672
      - 25672:25672
      - 15672:15672
  redis:
    image: redis
    container_name: redis_container
    ports:
      - 6379:6379
  celery_worker:
    image: custom-image
    working_dir: /webapp/endpoints/contents/
    container_name: celery_worker
    command: /opt/conda/envs/webapp/bin/celery -A router.celery_app worker --loglevel=info -P threads
    depends_on:
      - amqp
      - redis

  celery_flower:
    container_name: celery_flower
    working_dir: /webapp/endpoints/contents/
    image: mher/flower:latest
    command: celery --broker 'amqp://guest:guest@amqp:5672//' --result-backend 'rpc://' flower
    environment:
      - CELERY_BROKER_URL=amqp://guest:guest@amqp:5672//
      - FLOWER_PORT=5555
    ports:
      - 5555:5555
    depends_on:
      - amqp
      - redis

Error logs from celery_flower:

celery_flower | [I 221213 19:33:42 command:162] Visit me at http://localhost:5555
celery_flower | [I 221213 19:33:42 command:170] Broker: amqp://guest:**@amqp:5672//
celery_flower | [I 221213 19:33:42 command:171] Registered tasks:
celery_flower |   ['celery.accumulate',
celery_flower |    'celery.backend_cleanup',
celery_flower |    'celery.chain',
celery_flower |    'celery.chord',
celery_flower |    'celery.chord_unlock',
celery_flower |    'celery.chunks',
celery_flower |    'celery.group',
celery_flower |    'celery.map',
celery_flower |    'celery.starmap']
celery_flower | [W 221213 19:33:42 command:177] Running without authentication
celery_flower | [I 221213 19:33:48 mixins:225] Connected to amqp://guest:**@amqp:5672//
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method active_queues failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method active failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method scheduled failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method reserved failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method registered failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method revoked failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method conf failed
celery_flower | [W 221213 19:33:49 inspector:42] Inspect method stats failed

I cannot spot anything wrong with the celery flower dashboard too which is quite confusing.


问:
Elasticsearch query_string breaks with case insensitive search
I have text messages like -  "@Someone please note%"

and i need to get the search results when searching - @someone or @Someone or @some or @someone note.

Also need to get when searched with special characters like % or @.

I'm using elasticsearch's BoolqueryBuilder with query_string for fetching.

Is there any way to make this search possible, or should I use any other methods like wildcard or matchquery.

There are some messages in my index -  document.

the key name is message.

and it can contain any type of texts.

Suppose if there is message - Hello@#$ ther5# @Someone

I need to get the match results when searched for the below keywords:

@someone, @Some, @some, @#, ther5#, @Someone

Im using java backend with BoolQueryBuilder


问:
Unity takes a very long time to launch
Unity takes a very long time to launch. It literally takes too long. My laptop's specs are far beyond the recommended specs. It takes more than 6 minutes to run. I installed it on the c drive, and the capacity is about 50GB, so it is sufficient.

I tried securing enough space and closing other programs, but nothing changed.

Title: Unity takes a very long time to launch


问:
Multiple sessions are recording in ms clarity for single user action
I have embedded Ms clarity in my website and i integrated my website in an iframe.

When a user enters my website and performs certain actions, Microsoft Clarity is recording these actions in multiple sessions rather than a single session.

Can anyone provide a possible solution or reason for this issue?

Here is the reference code: https://codesandbox.io/s/ms-clarity-testing-gd5fs0?file=/src/App.js


问:
Keras example MobileViT: Attention axes seems wrong

MobileViT Article

Keras example MobileViT code

Looking at the functions below, the code applies attention over axes 1 and 2.

```<code>def mobilevit_block(x, num_blocks, projection_dim, strides=1):
    # Local projection with convolutions.
    local_features = conv_block(x, filters=projection_dim, strides=strides)
    local_features = conv_block(
        local_features, filters=projection_dim, kernel_size=1, strides=strides
    )

    # Unfold into patches and then pass through Transformers.
    num_patches = int((local_features.shape[1] * local_features.shape[2]) / patch_size)
    non_overlapping_patches = layers.Reshape((patch_size, num_patches, projection_dim))(
        local_features
    )
    global_features = transformer_block(
        non_overlapping_patches, num_blocks, projection_dim
    )

    ...

def transformer_block(x, transformer_layers, projection_dim, num_heads=2):
    for _ in range(transformer_layers):
        # Layer normalization 1.
        x1 = layers.LayerNormalization(epsilon=1e-6)(x)
        # Create a multi-head attention layer.
        attention_output = layers.MultiHeadAttention(
            num_heads=num_heads, key_dim=projection_dim, dropout=0.1
        )(x1, x1)

    ...

</code>```

But according to the article, it seems to compute the attention over axes 2 (Note the computational cost is O({N^2} * P * d). So I think it should be:

```<code>def transformer_block(x, transformer_layers, projection_dim, num_heads=2):
    for _ in range(transformer_layers):
        # Layer normalization 1.
        x1 = layers.LayerNormalization(epsilon=1e-6)(x)
        # Create a multi-head attention layer.
        attention_output = layers.MultiHeadAttention(
            num_heads=num_heads, key_dim=projection_dim, dropout=0.1,
            attention_axes=2
        )(x1, x1)

    ...
</code>```

Is this a right correction? Also, please let me know if this example is wrong. Thanks in advance.

Body:
MobileViT Article

Keras example MobileViT code

Looking at the functions below, the code applies attention over axes 1 and 2.

def mobilevit_block(x, num_blocks, projection_dim, strides=1):
    # Local projection with convolutions.
    local_features = conv_block(x, filters=projection_dim, strides=strides)
    local_features = conv_block(
        local_features, filters=projection_dim, kernel_size=1, strides=strides
    )

    # Unfold into patches and then pass through Transformers.
    num_patches = int((local_features.shape[1] * local_features.shape[2]) / patch_size)
    non_overlapping_patches = layers.Reshape((patch_size, num_patches, projection_dim))(
        local_features
    )
    global_features = transformer_block(
        non_overlapping_patches, num_blocks, projection_dim
    )

    ...

def transformer_block(x, transformer_layers, projection_dim, num_heads=2):
    for _ in range(transformer_layers):
        # Layer normalization 1.
        x1 = layers.LayerNormalization(epsilon=1e-6)(x)
        # Create a multi-head attention layer.
        attention_output = layers.MultiHeadAttention(
            num_heads=num_heads, key_dim=projection_dim, dropout=0.1
        )(x1, x1)

    ...

But according to the article, it seems to compute the attention over axes 2 (Note the computational cost is O({N^2} * P * d). So I think it should be:

def transformer_block(x, transformer_layers, projection_dim, num_heads=2):
    for _ in range(transformer_layers):
        # Layer normalization 1.
        x1 = layers.LayerNormalization(epsilon=1e-6)(x)
        # Create a multi-head attention layer.
        attention_output = layers.MultiHeadAttention(
            num_heads=num_heads, key_dim=projection_dim, dropout=0.1,
            attention_axes=2
        )(x1, x1)

    ...

Is this a right correction? Also, please let me know if this example is wrong. Thanks in advance.


问:
Pass data with react-location from one page to another page
Heyy,
Currently I am using react-location for routing and I am new with it.
I want to pass data from one page to another.
Is there any way to do it.I have read the documents but i am unable to find solution of my problem.
Thanks in advance.

I used navigation like this,

```<code>navigate({to: `/auth/reset-password`})
</code>```

and with this i want to pass entered email field data.

Body:
Heyy,
Currently I am using react-location for routing and I am new with it.
I want to pass data from one page to another.
Is there any way to do it.I have read the documents but i am unable to find solution of my problem.
Thanks in advance.

I used navigation like this,

navigate({to: `/auth/reset-password`})

and with this i want to pass entered email field data.


问:
Rails 6.1 gives extra precision value on upgrade
I was upgrading the Ruby on Rails application from 6.0 to 6.1. When checking the start_date which is having having extra precision value when it comes to 6.1

```<code>2.7.0 :001 > User.last.created_at
  User Load (11.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT $1  [["LIMIT", 1]]
 => Sat, 10 Oct 2015 11:36:14.042865000 UTC +00:00
2.7.0 :002 >
</code>```

When it comes to 6.0, we are no longer has this issue, it is having below values.

```<code>2.7.0 :001 > User.last.created_at
  User Load (2.0ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT $1  [["LIMIT", 1]]
 => Sat, 10 Oct 2015 11:36:14 UTC +00:00
2.7.0 :002 >
</code>```

Which is causing all the specs to fails. The database used is postgres and I have research on this and there is not much of a fix on this. The field is timestamp field and it is not a precision value encoded.

Body:
I was upgrading the Ruby on Rails application from 6.0 to 6.1. When checking the start_date which is having having extra precision value when it comes to 6.1

2.7.0 :001 > User.last.created_at
  User Load (11.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT $1  [["LIMIT", 1]]
 => Sat, 10 Oct 2015 11:36:14.042865000 UTC +00:00
2.7.0 :002 >

When it comes to 6.0, we are no longer has this issue, it is having below values.

2.7.0 :001 > User.last.created_at
  User Load (2.0ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT $1  [["LIMIT", 1]]
 => Sat, 10 Oct 2015 11:36:14 UTC +00:00
2.7.0 :002 >

Which is causing all the specs to fails. The database used is postgres and I have research on this and there is not much of a fix on this. The field is timestamp field and it is not a precision value encoded.


问:
Unable to resolve module react-number-format
New to react native, but I've seen the "unable to resolve module" error a lot.
This time, I got the error with the react-number-format module after I tried to install react-native-imaged-card-view from this link https://github.com/WrathChaos/react-native-imaged-card-view using npm.

I would like tips on how to troubleshoot this issue and any other unable to resolve issue, because this happens quite frequently.

```<code>iOS Bundling failed 20323ms
Unable to resolve module react-number-format from /Users/davidooooo/Documents/redoKoho/NewKoho/node_modules/react-native-star-review/lib/src/components/StarReview.js: react-number-format could not be found within the project or in these directories:
  node_modules
  ../../../node_modules
  3 | import styles, { _reviewTextStyle } from "./StarReview.style";
  4 | import { View, Text } from "react-native";
> 5 | import NumberFormat from "react-number-format";
    |                           ^
  6 | import Icon from "react-native-dynamic-vector-icons";
  7 |
  8 | const StarReview = props => {
</code>```

Body:
New to react native, but I've seen the "unable to resolve module" error a lot.
This time, I got the error with the react-number-format module after I tried to install react-native-imaged-card-view from this link https://github.com/WrathChaos/react-native-imaged-card-view using npm.

I would like tips on how to troubleshoot this issue and any other unable to resolve issue, because this happens quite frequently.

iOS Bundling failed 20323ms
Unable to resolve module react-number-format from /Users/davidooooo/Documents/redoKoho/NewKoho/node_modules/react-native-star-review/lib/src/components/StarReview.js: react-number-format could not be found within the project or in these directories:
  node_modules
  ../../../node_modules
  3 | import styles, { _reviewTextStyle } from "./StarReview.style";
  4 | import { View, Text } from "react-native";
> 5 | import NumberFormat from "react-number-format";
    |                           ^
  6 | import Icon from "react-native-dynamic-vector-icons";
  7 |
  8 | const StarReview = props => {


问:
Add Vue 3 with Laravel
I am trying to install VueJS with Laravel.  My app.js file is like below.

```<code>import Vue from 'vue'
window.Vue = Vue;
require('./bootstrap');

Vue.component('mosque-component', require('./components/MosqueComponent.vue').default);
Vue.component('prayer-component', require('./components/PrayerComponent.vue').default);
Vue.component('time-component', require('./components/TimeComponent.vue').default);

const app = new Vue({
    el: '#content',
});
</code>```

I attached VueJS component like below.

```<code>@section('content')
    <div>
        <mosque-component />
    </div>
@endsection
</code>```

I added app.js file like below.

```<code><script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
</code>```

My package.json file is like below.

```<code>{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "resolve-url-loader": "^5.0.0",
        "sass": "^1.56.2",
        "sass-loader": "^12.6.0",
        "vue-loader": "^16.8.3"
    },
    "dependencies": {
        "vue": "^3.2.45"
    }
}
</code>```

I am getting error like this Uncaught TypeError: vue__WEBPACK_IMPORTED_MODULE_0__.default is undefined.

Title: Add Vue 3 with Laravel

Body:
I am trying to install VueJS with Laravel.  My app.js file is like below.

import Vue from 'vue'
window.Vue = Vue;
require('./bootstrap');

Vue.component('mosque-component', require('./components/MosqueComponent.vue').default);
Vue.component('prayer-component', require('./components/PrayerComponent.vue').default);
Vue.component('time-component', require('./components/TimeComponent.vue').default);

const app = new Vue({
    el: '#content',
});

I attached VueJS component like below.

@section('content')

        <mosque-component />

@endsection

I added app.js file like below.

My package.json file is like below.

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "resolve-url-loader": "^5.0.0",
        "sass": "^1.56.2",
        "sass-loader": "^12.6.0",
        "vue-loader": "^16.8.3"
    },
    "dependencies": {
        "vue": "^3.2.45"
    }
}

I am getting error like this Uncaught TypeError: vue__WEBPACK_IMPORTED_MODULE_0__.default is undefined.


问:
How to get Throughput and Delay in the results?
I ran a simulation of the VEINS example in OMNET++ and in the results window under browse data, I cannot see the option of throughput or delay. What should I add in the code to include these in the results?

I there any other module I should add? If so how should go about that?


问:
the histograms in Joint Plot
I want to plot a Scatterplot using joint plot where I am using Hue. But the KDE plots on the axes are not desired. Instead of those, I need to plot the histogram containing the aggregate count in the range of specific x and y. How can I do that?

In the above Image, instead of these kde plots, I need histogram plotted for aggregate number of count of points in that x and y range

Title: the histograms in Joint Plot


问:
Can I preset targetSdk while creating new project in Android Studio Dolphin?
During the installation of Android Studio Dolphin 2021.3.1.17 the SDK platform 33 is default.

[Default SDK platform image]

Next when I try to create a new project, its default target SDK is 32, so it starts downloading SDK platform 32 automatically.

[SDK downloading image]

Then IDE recommends to upgrade SDK platform version to 33.

[Highlighted problem image]
[Problem description image]

I think the IDE is acting strange.

Can I choose specific target SDK while(before) creating a new projects?
Can I choose specific default SDK version during Android Studio installation?

Thank you!


问:
Firebase x NextJS deploymnet SSG only
I want to deploy my NextJS SSG build into Firebase but after enabling webframeworks experiment Firebase CLI runs its own build commands and try to deploy to my free plan Firebase project, and fails at the end saying that I need to enable Functions. How can I deploy my SSG website to firebase in Firebase CLI?

BTW, I dont have any functions folder, nor is it specified in firebase config. I user Mantine for UI and it supports SSG. Looks like the CLI does some assuming to check for funcitons too (after reading the docs I disabled NextJS Image optimization and I dont have any  redirects, rewrites, or headers in next.config.js). If possible can I disable this automatic creation of a functions?

Here is my firebase.json;

```<code>{
  "hosting": {
    "site": "xxxxxxxxxxx",
    "source": ".",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}
</code>```

Here is my next.config.js;

```<code>/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  images: {
    unoptimized: true
  }
}

module.exports = nextConfig
</code>```

Title: Firebase x NextJS deploymnet SSG only

Body:
I want to deploy my NextJS SSG build into Firebase but after enabling webframeworks experiment Firebase CLI runs its own build commands and try to deploy to my free plan Firebase project, and fails at the end saying that I need to enable Functions. How can I deploy my SSG website to firebase in Firebase CLI?

BTW, I dont have any functions folder, nor is it specified in firebase config. I user Mantine for UI and it supports SSG. Looks like the CLI does some assuming to check for funcitons too (after reading the docs I disabled NextJS Image optimization and I dont have any  redirects, rewrites, or headers in next.config.js). If possible can I disable this automatic creation of a functions?

Here is my firebase.json;

{
  "hosting": {
    "site": "xxxxxxxxxxx",
    "source": ".",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

Here is my next.config.js;

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  images: {
    unoptimized: true
  }
}

module.exports = nextConfig


问:
XCode getting stuck in build if using OrderedDictionary in swift
if use OrderedDictionary in swift xcode getting stuck in build. once will remove project running successfully.

i have using xcode 13.2
and swift 5
enter image description here

i need to maintain OrderedDictionary


问:
Unicode shapes in Shiny ggplot show up locally but fail in Docker and Shinyapps.io
I am working on a shinyapp that involves using the shape argument in geom_point to plot unicode symbols. The plots look as intended when I run the app locally on my laptop (running Linux Mint) but I cannot get the symbols to plot correctly either on shinyapps.io or in a docker container. I found some suggestions to use geom_text instead of geom_point but I get the same issue with that.
A small example using the baby bottle unicode character:
app.r

```<code>library(shiny)
library(tidyr)
library(ggplot2)

ui<-fluidPage(plotOutput("plot"),
              plotOutput("plot2"))
server <- function(input, output, session) {
  df<-data.frame(x=0:10,
                 y=0:10)
  # plot using unicode symbols as shapes
  output$plot<-renderPlot({
    df%>%
      ggplot()+
      geom_point(aes(x=x,y=y),shape="\U0001F37C",size=20)+
      scale_shape_manual(values="\U0001F37C")
  })
  # plot using built in ggplot shapes
  output$plot2<-renderPlot({
    df%>%
      ggplot()+
      geom_point(aes(x=x,y=y),shape=18,size=20)
  })

}
shinyApp(ui, server)
</code>```

Dockerfile for container (I tried setting the language to see if that would solve it)

```<code># get shiny server and R from the rocker project
FROM rocker/shiny-verse

RUN apt-get update && apt-get install -y \
    libcurl4-gnutls-dev \
    libssl-dev
RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN R -e 'install.packages(c(\
              "shiny", \
              "tidyr", \
              "ggplot2"\
            ))'

# copy all files into a directory called app
COPY . /app

CMD ["R", "-e", "shiny::runApp('/app', host = '0.0.0.0', port = 4848)"]
</code>```

The page appears fine locally:

But the shapes do not show up correctly if I run the docker container, or if I deploy the same app to shinyapps.io.

Session info when run locally:

```<code>R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ggplot2_3.3.5 tidyr_1.2.1   shiny_1.7.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8       bslib_0.4.0      compiler_4.1.2   pillar_1.8.1     later_1.3.0      jquerylib_0.1.4
 [7] icons_0.2.0      tools_4.1.2      digest_0.6.30    gtable_0.3.0     tibble_3.1.8     jsonlite_1.8.3
[13] memoise_2.0.1    lifecycle_1.0.3  pkgconfig_2.0.3  rlang_1.0.6      DBI_1.1.2        cli_3.4.1
[19] rstudioapi_0.14  xfun_0.34        fastmap_1.1.0    withr_2.5.0      stringr_1.4.1    dplyr_1.0.10
[25] knitr_1.40       generics_0.1.3   sass_0.4.2       vctrs_0.5.0      rappdirs_0.3.3   grid_4.1.2
[31] tidyselect_1.2.0 glue_1.6.2       R6_2.5.1         fansi_1.0.3      purrr_0.3.5      magrittr_2.0.3
[37] scales_1.1.1     promises_1.2.0.1 htmltools_0.5.3  ellipsis_0.3.2   assertthat_0.2.1 colorspace_2.0-2
[43] mime_0.12        xtable_1.8-4     httpuv_1.6.6     utf8_1.2.2       stringi_1.7.8    munsell_0.5.0
[49] cachem_1.0.6
</code>```

Session info from docker container:

```<code>R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ggplot2_3.4.0 tidyr_1.2.1   shiny_1.7.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9       pillar_1.8.1     compiler_4.2.2   later_1.3.0
 [5] tools_4.2.2      digest_0.6.30    lifecycle_1.0.3  tibble_3.1.8
 [9] gtable_0.3.1     pkgconfig_2.0.3  rlang_1.0.6      cli_3.4.1
[13] DBI_1.1.3        fastmap_1.1.0    withr_2.5.0      dplyr_1.0.10
[17] generics_0.1.3   vctrs_0.5.0      grid_4.2.2       tidyselect_1.2.0
[21] glue_1.6.2       R6_2.5.1         fansi_1.0.3      purrr_0.3.5
[25] magrittr_2.0.3   scales_1.2.1     promises_1.2.0.1 ellipsis_0.3.2
[29] htmltools_0.5.3  assertthat_0.2.1 mime_0.12        xtable_1.8-4
[33] colorspace_2.0-3 httpuv_1.6.6     utf8_1.2.2       munsell_0.5.0
</code>```

Edit: based on @SamR's comment, I updated my dockerfile to match the package versions in my local session exactly, and I'm still getting the same error. Updated dockerfile:

```<code># get shiny server and R from the rocker project
FROM rocker/shiny-verse:4.1.2
# system libraries
# Try to only install system libraries you actually need
# Package Manager is a good resource to help discover system deps
RUN apt-get update && apt-get install -y \
    libcurl4-gnutls-dev \
    libssl-dev
RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN R -e 'install.packages(c(\
"https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.3.5.tar.gz",\
"https://cran.r-project.org/src/contrib/tidyr_1.2.1.tar.gz",\
"https://cran.r-project.org/src/contrib/Archive/shiny/shiny_1.7.3.tar.gz"),\
          repos=NULL,type="source")'
# copy all files into a directory called app
COPY . /app

CMD ["R", "-e", "shiny::runApp('/app', host = '0.0.0.0', port = 4849)"]
</code>```

@JosefZ mentioned this is a font issue, so I tried manually specifying several different fonts instead, they all still run fine on my local machine and do not run in the container.

Example with font specified in geom_text:

```<code>    df%>%
      ggplot()+
      geom_text(aes(x=x,y=y),label="\U0001F37C",size=20,
                family = "Lucida Sans Unicode")
</code>```

Body:
I am working on a shinyapp that involves using the shape argument in geom_point to plot unicode symbols. The plots look as intended when I run the app locally on my laptop (running Linux Mint) but I cannot get the symbols to plot correctly either on shinyapps.io or in a docker container. I found some suggestions to use geom_text instead of geom_point but I get the same issue with that.
A small example using the baby bottle unicode character:
app.r

library(shiny)
library(tidyr)
library(ggplot2)

ui<-fluidPage(plotOutput("plot"),
              plotOutput("plot2"))
server <- function(input, output, session) {
  df<-data.frame(x=0:10,
                 y=0:10)
  # plot using unicode symbols as shapes
  output$plot<-renderPlot({
    df%>%
      ggplot()+
      geom_point(aes(x=x,y=y),shape="\U0001F37C",size=20)+
      scale_shape_manual(values="\U0001F37C")
  })
  # plot using built in ggplot shapes
  output$plot2<-renderPlot({
    df%>%
      ggplot()+
      geom_point(aes(x=x,y=y),shape=18,size=20)
  })

}
shinyApp(ui, server)

Dockerfile for container (I tried setting the language to see if that would solve it)

# get shiny server and R from the rocker project
FROM rocker/shiny-verse

RUN apt-get update && apt-get install -y \
    libcurl4-gnutls-dev \
    libssl-dev
RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN R -e 'install.packages(c(\
              "shiny", \
              "tidyr", \
              "ggplot2"\
            ))'

# copy all files into a directory called app
COPY . /app

CMD ["R", "-e", "shiny::runApp('/app', host = '0.0.0.0', port = 4848)"]

The page appears fine locally:

But the shapes do not show up correctly if I run the docker container, or if I deploy the same app to shinyapps.io.

Session info when run locally:

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ggplot2_3.3.5 tidyr_1.2.1   shiny_1.7.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8       bslib_0.4.0      compiler_4.1.2   pillar_1.8.1     later_1.3.0      jquerylib_0.1.4
 [7] icons_0.2.0      tools_4.1.2      digest_0.6.30    gtable_0.3.0     tibble_3.1.8     jsonlite_1.8.3
[13] memoise_2.0.1    lifecycle_1.0.3  pkgconfig_2.0.3  rlang_1.0.6      DBI_1.1.2        cli_3.4.1
[19] rstudioapi_0.14  xfun_0.34        fastmap_1.1.0    withr_2.5.0      stringr_1.4.1    dplyr_1.0.10
[25] knitr_1.40       generics_0.1.3   sass_0.4.2       vctrs_0.5.0      rappdirs_0.3.3   grid_4.1.2
[31] tidyselect_1.2.0 glue_1.6.2       R6_2.5.1         fansi_1.0.3      purrr_0.3.5      magrittr_2.0.3
[37] scales_1.1.1     promises_1.2.0.1 htmltools_0.5.3  ellipsis_0.3.2   assertthat_0.2.1 colorspace_2.0-2
[43] mime_0.12        xtable_1.8-4     httpuv_1.6.6     utf8_1.2.2       stringi_1.7.8    munsell_0.5.0
[49] cachem_1.0.6

Session info from docker container:

R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ggplot2_3.4.0 tidyr_1.2.1   shiny_1.7.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9       pillar_1.8.1     compiler_4.2.2   later_1.3.0
 [5] tools_4.2.2      digest_0.6.30    lifecycle_1.0.3  tibble_3.1.8
 [9] gtable_0.3.1     pkgconfig_2.0.3  rlang_1.0.6      cli_3.4.1
[13] DBI_1.1.3        fastmap_1.1.0    withr_2.5.0      dplyr_1.0.10
[17] generics_0.1.3   vctrs_0.5.0      grid_4.2.2       tidyselect_1.2.0
[21] glue_1.6.2       R6_2.5.1         fansi_1.0.3      purrr_0.3.5
[25] magrittr_2.0.3   scales_1.2.1     promises_1.2.0.1 ellipsis_0.3.2
[29] htmltools_0.5.3  assertthat_0.2.1 mime_0.12        xtable_1.8-4
[33] colorspace_2.0-3 httpuv_1.6.6     utf8_1.2.2       munsell_0.5.0

Edit: based on @SamR's comment, I updated my dockerfile to match the package versions in my local session exactly, and I'm still getting the same error. Updated dockerfile:

# get shiny server and R from the rocker project
FROM rocker/shiny-verse:4.1.2
# system libraries
# Try to only install system libraries you actually need
# Package Manager is a good resource to help discover system deps
RUN apt-get update && apt-get install -y \
    libcurl4-gnutls-dev \
    libssl-dev
RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN R -e 'install.packages(c(\
"https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.3.5.tar.gz",\
"https://cran.r-project.org/src/contrib/tidyr_1.2.1.tar.gz",\
"https://cran.r-project.org/src/contrib/Archive/shiny/shiny_1.7.3.tar.gz"),\
          repos=NULL,type="source")'
# copy all files into a directory called app
COPY . /app

CMD ["R", "-e", "shiny::runApp('/app', host = '0.0.0.0', port = 4849)"]

@JosefZ mentioned this is a font issue, so I tried manually specifying several different fonts instead, they all still run fine on my local machine and do not run in the container.

Example with font specified in geom_text:

    df%>%
      ggplot()+
      geom_text(aes(x=x,y=y),label="\U0001F37C",size=20,
                family = "Lucida Sans Unicode")


问:
How to use rsync to replace scp to transfer files?
```<code>rsync xx.xxx.x.xxx::/data/file.txt .
</code>```

For example, I am seeing others set such a way to transfer files from the /data/ directory without even requiring userid/password. I typically use scp to do:

```<code>scp -P 33 root@xx.xxx.x.xxx:/data/ .
</code>```

The scp requires port and password. How to set rsync as the first case does?

Body:
rsync xx.xxx.x.xxx::/data/file.txt .

For example, I am seeing others set such a way to transfer files from the /data/ directory without even requiring userid/password. I typically use scp to do:

scp -P 33 root@xx.xxx.x.xxx:/data/ .

The scp requires port and password. How to set rsync as the first case does?


问:
Flutter event channel not working in background with bluetooth
I am using native android code to scan and connect to a BLE device and after connection it listens for data in characteristic and used broadcast to sent data back to the flutter event channel.
When I use it while app is running it perfectly sends data without problem and is also receiving in flutter event channel stream but when app is minimised and use the same procedure its not getting data anymore in the event channel.
I have also tried to invoke event channel when in background by scheduling a workmanager task but still no data.</p>
```<code>Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: plex ring event channel
</code>```

Body:
I am using native android code to scan and connect to a BLE device and after connection it listens for data in characteristic and used broadcast to sent data back to the flutter event channel.
When I use it while app is running it perfectly sends data without problem and is also receiving in flutter event channel stream but when app is minimised and use the same procedure its not getting data anymore in the event channel.
I have also tried to invoke event channel when in background by scheduling a workmanager task but still no data.

Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: plex ring event channel


问:
I am having error while trying top add a divider between my v-list items
I am getting an error on :key="index" in  that said  key should be placed on the  tag. Can any please suggest a slution.

<template v-for="(key, index) in filteredKeys">
  <v-list-item :key="index">
      <v-list-item-content :class="{ 'blue--text': sortBy === key }">
          {{ key }} :
      </v-list-item-content>
      <v-list-item-content class="align-end" :class="{ 'blue--text': sortBy === key }">
          {{ item[key.toLowerCase()] }}
      </v-list-item-content>
  </v-list-item>
  <v-divider v-if="index < filteredKeys.length - 1" :key="`${index}-divider`"></v-divider>
</template>
```


问:
How to add recurring object elements in javascript
I had a question, I needed optimal options to solve this problem

Problem:

```<code>const laptops = [{acer: 4}, {mac: 5}, {asus: 8}, {acer: 6}, {mac: 3} ];
</code>```

output: [{acer: 10}, {mac: 8}, {asus: 8}];

the answer must be dynamic for any array

Body:
I had a question, I needed optimal options to solve this problem

Problem:

const laptops = [{acer: 4}, {mac: 5}, {asus: 8}, {acer: 6}, {mac: 3} ];

output: [{acer: 10}, {mac: 8}, {asus: 8}];

the answer must be dynamic for any array


问:
For Bearer token i tried in postman am getting token....but same way am trying in ORACLE APEX in PL/SQL process am getting below error
```<code>DECLARE
V_TARGET_URI VARCHAR2(100);
L_CLOB CLOB;
V_REQ VARCHAR2(500);

v_grant_type varchar2(400) := 'client_credentials';
v_client_id varchar2(500) := 'my client id';
v_client_secret varchar2(500) := 'my client secret';
v_resource varchar2(300) :='all'; --'https://graph.microsoft.com';

BEGIN

V_TARGET_URI := 'https://login.microsoftonline.com/<tenet_id>/oauth2/token';

APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).NAME := 'Content-Type';
APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).VALUE := 'application/x-www-form-urlencoded';

L_CLOB := APEX_WEB_SERVICE.MAKE_REST_REQUEST(P_URL => V_TARGET_URI
                                                , P_HTTP_METHOD => 'POST'
                                                , P_USERNAME => NULL
                                                , P_PASSWORD =>NULL
                                                ,      p_parm_name   => apex_util.string_to_table('grant_type:client_id:client_secret:scope')
                                                , p_parm_value  => apex_util.string_to_table(v_grant_type||':'||v_client_id||':'||v_client_secret||':'||v_resource)
                                                , P_BODY => NULL
                                                , P_WALLET_PATH =>'<my wallet path>'
                                                , P_WALLET_PWD =>'<my wallet password>');

END;
</code>```

Am getting below error

"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <TITLE>Length Required</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
Length Required

HTTP Error 411. The request must be chunked or have a content length.
 "

Body:
DECLARE
V_TARGET_URI VARCHAR2(100);
L_CLOB CLOB;
V_REQ VARCHAR2(500);

v_grant_type varchar2(400) := 'client_credentials';
v_client_id varchar2(500) := 'my client id';
v_client_secret varchar2(500) := 'my client secret';
v_resource varchar2(300) :='all'; --'https://graph.microsoft.com';

BEGIN

V_TARGET_URI := 'https://login.microsoftonline.com/<tenet_id>/oauth2/token';

APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).NAME := 'Content-Type';
APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).VALUE := 'application/x-www-form-urlencoded';

L_CLOB := APEX_WEB_SERVICE.MAKE_REST_REQUEST(P_URL => V_TARGET_URI
                                                , P_HTTP_METHOD => 'POST'
                                                , P_USERNAME => NULL
                                                , P_PASSWORD =>NULL
                                                ,      p_parm_name   => apex_util.string_to_table('grant_type:client_id:client_secret:scope')
                                                , p_parm_value  => apex_util.string_to_table(v_grant_type||':'||v_client_id||':'||v_client_secret||':'||v_resource)
                                                , P_BODY => NULL
                                                , P_WALLET_PATH =>'<my wallet path>'
                                                , P_WALLET_PWD =>'<my wallet password>');

END;

Am getting below error

"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <TITLE>Length Required</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
Length Required

HTTP Error 411. The request must be chunked or have a content length.
 "


问:
Unhandled error event: Error: connect ETIMEDOUT
Encountering ioredis connection timeout when using cloud function in console

Error message below

Unhandled error event: Error: connect ETIMEDOUT

```<code>at TLSSocket.\<anonymous\> (/workspace/node_modules/ioredis/built/Redis.js:168:41)

at Object.onceWrapper (node:events:627:28)

at TLSSocket.emit (node:events:513:28)

at TLSSocket.emit (node:domain:552:15)

at TLSSocket.Socket.\_onTimeout (node:net:550:8)

at listOnTimeout (node:internal/timers:559:17)

at processTimers (node:internal/timers:502:7)

</code>```

the part of my code for connecting to redis instance is as below

```<code>        const REDISHOST = process.env.REDISHOST;
        const REDISPORT = process.env.REDISPORT;
        const REDISAUTH = process.env.AUTHSTRING;
        const REDISKEY = process.env.REDISKEY;

        const client = redis.createClient({
            host: REDISHOST,
            port: REDISPORT,
            password: REDISAUTH,
             tls: {
                ca: REDISKEY
            }
</code>```

Any help would be appreciated

Body:
Encountering ioredis connection timeout when using cloud function in console

Error message below

Unhandled error event: Error: connect ETIMEDOUT

at TLSSocket.\<anonymous\> (/workspace/node_modules/ioredis/built/Redis.js:168:41)

at Object.onceWrapper (node:events:627:28)

at TLSSocket.emit (node:events:513:28)

at TLSSocket.emit (node:domain:552:15)

at TLSSocket.Socket.\_onTimeout (node:net:550:8)

at listOnTimeout (node:internal/timers:559:17)

at processTimers (node:internal/timers:502:7)

the part of my code for connecting to redis instance is as below

        const REDISHOST = process.env.REDISHOST;
        const REDISPORT = process.env.REDISPORT;
        const REDISAUTH = process.env.AUTHSTRING;
        const REDISKEY = process.env.REDISKEY;

        const client = redis.createClient({
            host: REDISHOST,
            port: REDISPORT,
            password: REDISAUTH,
             tls: {
                ca: REDISKEY
            }

Any help would be appreciated


问:
How do I update a react-final-forms internal state to what my apps state is?
I'm aware of FormSpy to update based on subscriptions to the form's changed input values.
I'm just not 100% sure on implementation for it. I also tried mutations but that didn't update the state values.

```<code>  <Field name="city">
                      {({ input, meta }) => (
                          <label
                          >
                            City
                          </label>
                          <input
                            {...input}
                            type="text"
                            placeholder="123 Main Street"
                            id="city"
                            onChange={(e) => updatedLocationValues(e)}
                            value={location.city}
                          />
                      )}
                    </Field>
</code>```

This field is tied to state and is auto-populated by another field (users can still change it if they want through manual inputs)

The onChange is updating the state.

However React-final-form doesn't know about this state change. This is where FormSpy is supposed to come in but i'm not sure how to integrate it here.

Body:
I'm aware of FormSpy to update based on subscriptions to the form's changed input values.
I'm just not 100% sure on implementation for it. I also tried mutations but that didn't update the state values.

  <Field name="city">
                      {({ input, meta }) => (

                            City

                          <input
                            {...input}
                            type="text"
                            placeholder="123 Main Street"
                            id="city"
                            onChange={(e) => updatedLocationValues(e)}
                            value={location.city}
                          />
                      )}
                    </Field>

This field is tied to state and is auto-populated by another field (users can still change it if they want through manual inputs)

The onChange is updating the state.

However React-final-form doesn't know about this state change. This is where FormSpy is supposed to come in but i'm not sure how to integrate it here.


问:
how to plot geo data with nodes and edges in networkx
I am trying to plot a warehouse location data using networkx.
My sample dataset is as follows,

src_node
dest_node
src_edge
dest_edge
src_lat-src_lon
dest_lat-dest_lon

1
3
a
x
38.89-77.03
38.91-77.05

3
2
b
y
38.91-77.05
38.82-77.01

4
1
c
z
38.93-77.06
38.89-77.03

I tried this:

```<code>import network as nx
import matplotlib.pyplot as plt

data = [[1, 3, 'a', 'x', '38.89-77.03', '38.91-77.05'],[3, 2, 'b', 'y', '38.91-77.05', '38.82-77.01'],[4, 1, 'c', 'z', '38.93-77.06', '38.89-77.03']]
temp = pd.DataFrame(data, columns=['src_node', 'dest_node','src_edge','dest_edge','src_lat-src_lon', 'dest_lat-dest_lon'])

def plot_graph(nodes, edges, labels=False, node_size=False, node_color='r'):
    plt.figure(figsize=(10,10))
    G = nx.DiGraph()
    G.add_nodes_from(nodes)
    G.add_edges_from(edges)
    nx.draw(G, with_labels=labels, node_color=node_color)
    plt.show()

plot_graph(nodes=pd.unique(temp['src_node'].append(temp['dest_node'])),
           edges=[tuple(row) for row in temp[['src_node','dest_node']].values],
           labels=True,
           node_color='orange')

</code>```

However, i could only plot the nodes.
i want to arrange these according to the lat and long values in the map and how to name the starting of the arrow with "src_edge" and exit of the arrow as "dest_edge".
I want the plot for analyzing the neighbor relation and i am new to networkx, appreciate if i can get some help.
thanks.

Body:
I am trying to plot a warehouse location data using networkx.
My sample dataset is as follows,

src_node
dest_node
src_edge
dest_edge
src_lat-src_lon
dest_lat-dest_lon

1
3
a
x
38.89-77.03
38.91-77.05

3
2
b
y
38.91-77.05
38.82-77.01

4
1
c
z
38.93-77.06
38.89-77.03

I tried this:

import network as nx
import matplotlib.pyplot as plt

data = [[1, 3, 'a', 'x', '38.89-77.03', '38.91-77.05'],[3, 2, 'b', 'y', '38.91-77.05', '38.82-77.01'],[4, 1, 'c', 'z', '38.93-77.06', '38.89-77.03']]
temp = pd.DataFrame(data, columns=['src_node', 'dest_node','src_edge','dest_edge','src_lat-src_lon', 'dest_lat-dest_lon'])

def plot_graph(nodes, edges, labels=False, node_size=False, node_color='r'):
    plt.figure(figsize=(10,10))
    G = nx.DiGraph()
    G.add_nodes_from(nodes)
    G.add_edges_from(edges)
    nx.draw(G, with_labels=labels, node_color=node_color)
    plt.show()

plot_graph(nodes=pd.unique(temp['src_node'].append(temp['dest_node'])),
           edges=[tuple(row) for row in temp[['src_node','dest_node']].values],
           labels=True,
           node_color='orange')

However, i could only plot the nodes.
i want to arrange these according to the lat and long values in the map and how to name the starting of the arrow with "src_edge" and exit of the arrow as "dest_edge".
I want the plot for analyzing the neighbor relation and i am new to networkx, appreciate if i can get some help.
thanks.


问:
How can I use firebase MFA for adding extra layer of auth for a specific feature?
I want to be able to add an extra layer of security when a user tries to use a special feature, basically following firebase docs for MFA: Require adding a second factor incrementally when the user wants to access features with increased security requirements

However, (and to many, maybe obviously) after the user has been enrolled into MFA,
it seems to always ask the user for the MFA during login as well.
Is it possible to only ask for it during a specific user action, like click of a button?


问:
Reference error: bodyData is not defined at eval
there are 2 block of ejs code on my html page that I'm trying to display data from nodejs, 1 is for dropdown menu, another one is for displaying table. the dropdown was fine, but for some reason, table is not working.

```<code>node.js

 case "ucgw2":
        axios.get(apiurl+"/api/cdr-ucgw2",{
        data: {starttime:starttime, endtime:endtime, setlimit:setlimit, customer:customer}
      })
        .then(function (body) {

          // handle success

          console.log("channel data = ",body.data)
          res.render('html-cdr',{bodyData:body.data, startday:startday, startmonth:startmonth, startyear:startyear, starthour:starthour, startmin:startmin, endday:endday, endmonth:endmonth, endyear:endyear,endhour:endhour, endmin:endmin, customer:customer});
        })
        .catch(function (error) {

          // handle error

          req.flash('error', error);
          res.render('html-cdr',{bodyData:body.data, startday:startday, startmonth:startmonth, startyear:startyear, starthour:starthour, startmin:startmin, endday:endday, endmonth:endmonth, endyear:endyear,endhour:endhour, endmin:endmin, customer:customer});
        })

html table (ejs)
         <%
                    if(bodyData !== "" && bodyData !== null){
                    var i=1;
                    bodyData.forEach(function(body){
                %>
                <tr>
                    <td><%=body.company_name %></td>
                </tr>
                <%  i++; }) %>
                <% } else{ %>
                <% } %>
</code>```

i tried changing to another variable but it still not working, error says body data undefined, i made sure that i double checked everything without leaving out stuff

Body:
there are 2 block of ejs code on my html page that I'm trying to display data from nodejs, 1 is for dropdown menu, another one is for displaying table. the dropdown was fine, but for some reason, table is not working.

node.js

 case "ucgw2":
        axios.get(apiurl+"/api/cdr-ucgw2",{
        data: {starttime:starttime, endtime:endtime, setlimit:setlimit, customer:customer}
      })
        .then(function (body) {

          // handle success

          console.log("channel data = ",body.data)
          res.render('html-cdr',{bodyData:body.data, startday:startday, startmonth:startmonth, startyear:startyear, starthour:starthour, startmin:startmin, endday:endday, endmonth:endmonth, endyear:endyear,endhour:endhour, endmin:endmin, customer:customer});
        })
        .catch(function (error) {

          // handle error

          req.flash('error', error);
          res.render('html-cdr',{bodyData:body.data, startday:startday, startmonth:startmonth, startyear:startyear, starthour:starthour, startmin:startmin, endday:endday, endmonth:endmonth, endyear:endyear,endhour:endhour, endmin:endmin, customer:customer});
        })

html table (ejs)
         <%
                    if(bodyData !== "" && bodyData !== null){
                    var i=1;
                    bodyData.forEach(function(body){
                %>

                    <%=body.company_name %>

                <%  i++; }) %>
                <% } else{ %>
                <% } %>

i tried changing to another variable but it still not working, error says body data undefined, i made sure that i double checked everything without leaving out stuff


问:
Why does my programmatic approach to changing CSS animation duration not work?
I have a collection of animations that have their duration assigned to a variable with the starting value of zero. After their first run (which is upon page loading), I would like to be able to change that duration to a non-zero value to get the animation effect I'm going for.

The following code should allow me to set the value of --real-dock-animation-time (what the animations use) to the value of --dock-animation-time after all of their first run, so that the previous value of zero can be changed to animate the desired changes only after the page is loaded.

```<code>let animationTimeDetermined = false;
function determineAnimationTime() {
  if (!animationTimeDetermined) {
    animationTimeDetermined = true;
    let r = document.querySelector(':root');
    let time = getComputedStyle(r).getPropertyValue("--dock-animation-time");
    r.style.setProperty('--real-dock-animation-time', time);
  }
}

document.addEventListener("DOMContentLoaded", () =>
  Promise.all(document.getElementsByClassName("dynamicHeader")[0].getAnimations().map((anim) => anim.finished)).then(
    determineAnimationTime()
  ))
</code>```

What ends up happening, though, is it just appears as if it was the non-zero value to begin with and it animates on page load. How can I change the value only after I'm sure the animations' first runs are completed?

I have tried using setTimeout and parsing the CSS's non-zero value to milliseconds, but the imprecise nature of the timer system makes it flicker when the page loads.

If there's another way to get what I'm after that doesn't involve using JS to change the animation times, please let me know. The CSS's values are changed at the very beginning of the page's lifetime because I am setting attributes within the JS.

Body:
I have a collection of animations that have their duration assigned to a variable with the starting value of zero. After their first run (which is upon page loading), I would like to be able to change that duration to a non-zero value to get the animation effect I'm going for.

The following code should allow me to set the value of --real-dock-animation-time (what the animations use) to the value of --dock-animation-time after all of their first run, so that the previous value of zero can be changed to animate the desired changes only after the page is loaded.

let animationTimeDetermined = false;
function determineAnimationTime() {
  if (!animationTimeDetermined) {
    animationTimeDetermined = true;
    let r = document.querySelector(':root');
    let time = getComputedStyle(r).getPropertyValue("--dock-animation-time");
    r.style.setProperty('--real-dock-animation-time', time);
  }
}

document.addEventListener("DOMContentLoaded", () =>
  Promise.all(document.getElementsByClassName("dynamicHeader")[0].getAnimations().map((anim) => anim.finished)).then(
    determineAnimationTime()
  ))

What ends up happening, though, is it just appears as if it was the non-zero value to begin with and it animates on page load. How can I change the value only after I'm sure the animations' first runs are completed?

I have tried using setTimeout and parsing the CSS's non-zero value to milliseconds, but the imprecise nature of the timer system makes it flicker when the page loads.

If there's another way to get what I'm after that doesn't involve using JS to change the animation times, please let me know. The CSS's values are changed at the very beginning of the page's lifetime because I am setting attributes within the JS.


问:
How to create pyspark session in Jupyter Notebook (under Dataproc Cluster) with avro datasource extension?
Via Concord, we can automatically spawn clusters with pyspark enabled dataproc clusters.

In these pyspark notebooks, spark version is 2.4.8

But, by default spark does not have .avro datasource extension. Without Avro extension, we can not read .avro files. We tried with the following setups in configuration but did not work.

Pyspark Session Configuration

```<code>from pyspark.sql import SparkSession
from pyspark import SparkConf
import os

# Set the python paths
os.environ['PYSPARK_PYTHON'] = './PYENV1/pyenv1/bin/python3'
os.environ['PYSPARK_DRIVER_PYTHON'] = './PYENV1/pyenv1/bin/python3'

# If your notebook's kernel is PySpark, stop the active spark app
spark.sparkContext.stop()

conf = SparkConf()

# Add the following variable to the spark config - this will let worker nodes find the installed packages
conf.setAll([
    ("spark.app.name", "Avro Testing"), \
    ("spark.jars.packages","org.apache.spark:spark-avro_2.12:2.4.8"), \
    # ("spark.yarn.dist.archives", "/opt/conda/anaconda/envs/d0d01af1.zip#D0D01AF1"), \
    # ('spark.executor.cores', '2'),\
    # ('spark.driver.memory','5g'),\
    # ('spark.task.maxFailures','100'), \
    # ('spark.executor.instances', '100'), \
    # ('spark.driver.maxResultSize','20g'), \
    # ('spark.sql.shuffle.partitions','2048'),\
    # ('spark.default.parallelism','2048'), \
    # ('spark.dynamicAllocation.enabled','False'), \
    # ("spark.files.overwrite", "True"), \
    # ("spark.sql.broadcastTimeout", "36000"), \
    # ("spark.sql.autoBroadcastJoinThreshold", -1), \
    # ("spark.sql.hive.convertMetastoreOrc", "False")
])

# conf.set("spark.jars","org.apache.spark:spark-avro_2.12:2.4.8")

</code>```

Code for read data

```<code>GCSPATH = "gs://gcs_bucket/file.avro"
spark.read.format("avro").load(GCS_PATH)
</code>```

Error

```<code>---------------------------------------------------------------------------
Py4JJavaError                             Traceback (most recent call last)
/usr/lib/spark/python/pyspark/sql/utils.py in deco(*a, **kw)
     62         try:
---> 63             return f(*a, **kw)
     64         except py4j.protocol.Py4JJavaError as e:

/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
    327                     "An error occurred while calling {0}{1}{2}.\n".
--> 328                     format(target_id, ".", name), value)
    329             else:

Py4JJavaError: An error occurred while calling o622.load.
: org.apache.spark.sql.AnalysisException: Failed to find data source: avro. Avro is built-in but external data source module since Spark 2.4. Please deploy the application as per the deployment section of "Apache Avro Data Source Guide".;
    at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:665)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:213)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:238)
    at java.lang.Thread.run(Thread.java:750)
</code>```
```<code></code>```

Body:
Via Concord, we can automatically spawn clusters with pyspark enabled dataproc clusters.

In these pyspark notebooks, spark version is 2.4.8

But, by default spark does not have .avro datasource extension. Without Avro extension, we can not read .avro files. We tried with the following setups in configuration but did not work.

Pyspark Session Configuration

from pyspark.sql import SparkSession
from pyspark import SparkConf
import os

# Set the python paths
os.environ['PYSPARK_PYTHON'] = './PYENV1/pyenv1/bin/python3'
os.environ['PYSPARK_DRIVER_PYTHON'] = './PYENV1/pyenv1/bin/python3'

# If your notebook's kernel is PySpark, stop the active spark app
spark.sparkContext.stop()

conf = SparkConf()

# Add the following variable to the spark config - this will let worker nodes find the installed packages
conf.setAll([
    ("spark.app.name", "Avro Testing"), \
    ("spark.jars.packages","org.apache.spark:spark-avro_2.12:2.4.8"), \
    # ("spark.yarn.dist.archives", "/opt/conda/anaconda/envs/d0d01af1.zip#D0D01AF1"), \
    # ('spark.executor.cores', '2'),\
    # ('spark.driver.memory','5g'),\
    # ('spark.task.maxFailures','100'), \
    # ('spark.executor.instances', '100'), \
    # ('spark.driver.maxResultSize','20g'), \
    # ('spark.sql.shuffle.partitions','2048'),\
    # ('spark.default.parallelism','2048'), \
    # ('spark.dynamicAllocation.enabled','False'), \
    # ("spark.files.overwrite", "True"), \
    # ("spark.sql.broadcastTimeout", "36000"), \
    # ("spark.sql.autoBroadcastJoinThreshold", -1), \
    # ("spark.sql.hive.convertMetastoreOrc", "False")
])

# conf.set("spark.jars","org.apache.spark:spark-avro_2.12:2.4.8")

Code for read data

GCSPATH = "gs://gcs_bucket/file.avro"
spark.read.format("avro").load(GCS_PATH)

Error

---------------------------------------------------------------------------
Py4JJavaError                             Traceback (most recent call last)
/usr/lib/spark/python/pyspark/sql/utils.py in deco(*a, **kw)
     62         try:
---> 63             return f(*a, **kw)
     64         except py4j.protocol.Py4JJavaError as e:

/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
    327                     "An error occurred while calling {0}{1}{2}.\n".
--> 328                     format(target_id, ".", name), value)
    329             else:

Py4JJavaError: An error occurred while calling o622.load.
: org.apache.spark.sql.AnalysisException: Failed to find data source: avro. Avro is built-in but external data source module since Spark 2.4. Please deploy the application as per the deployment section of "Apache Avro Data Source Guide".;
    at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:665)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:213)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:238)
    at java.lang.Thread.run(Thread.java:750)


问:
How to Install Python3.9-Dev Package with Miniconda in Ubuntu 18.0.4
I have a pip package which required to have Python3.9-dev package to be installed. I am using miniconda to setup the environment. However, I could not find any command that can install the Python3.9-dev package with miniconda. Have any idea of installing the package with miniconda?</p>


问:
How to change from horizontal scroll to vertocal scroll : reactJs in modile view
i have used the following tag to set the page to horizontal view thisworks well in dektop and laptop screens.
<HorizontalScroll>...</HorizontalScroll>
this tag allows the components to scroll in the x-axis only.

In mobile view the components should be moving in the y-axis. i.e, the contents should only move up and down in the devices with max-width of 570px. Is there any way that the up-down scroll can be applied ??

The code.

App.js

```<code>import HorizontalScroll from 'react-scroll-horizontal';

<HorizontalScroll>
   <LandingPage />
   <PDP />
   <Onboarding />
   <Execution1 />
</HorizontalScroll>
</code>```

Body:
i have used the following tag to set the page to horizontal view thisworks well in dektop and laptop screens.
<HorizontalScroll>...</HorizontalScroll>
this tag allows the components to scroll in the x-axis only.

In mobile view the components should be moving in the y-axis. i.e, the contents should only move up and down in the devices with max-width of 570px. Is there any way that the up-down scroll can be applied ??

The code.

App.js

import HorizontalScroll from 'react-scroll-horizontal';

<HorizontalScroll>
   <LandingPage />
   <PDP />
   <Onboarding />
   <Execution1 />
</HorizontalScroll>


问:
FastAPI: Every new request to the API is taking twice the time, if a prior request hasn't completed yet
I am trying to execute a longer task (the_longer_function) in the background, and return the response immediately without waiting for the execution of primary function to complete.

Here's the basic code line that I have created:

```<code>@app.post("/something/something_test", response_class=JSONResponse)
@validate_token
async def home(request: Request, background_tasks: BackgroundTasks):
    try:
        request_params = await request.json()
        background_tasks.add_task(the_longer_function, request_params)

        return JSONResponse({
            "Result": "Execution Started!"
        }, status_code=200)
    except Exception as ex:
        return {
            "Result": f"Error in starting execution. Error {ex}"
        }
</code>```

Here's the definition of the_longer_function:

```<code>def the_longer_function(request_params):
    variable = None
    try:
        variable = request_params.get('variable', None)
        executionId = str(uuid.uuid4())
        bot_message['ExecutionId'] = executionId
        """
        EXPENSIVE BUSINESS LOGIC HERE
        """
        publish_bot_scan_data(request_params, variable)
    except (JSONDecodeError, Exception) as ex:
        log.error(f"Error {ex}")
</code>```

I want the API to respond immediately as soon as it adds the task for the new request in the background.

But I have observed, that if the prior request is running, the API is holding the call back and waiting for the previous one to complete and then is returning to the caller.

Have tried, async, trio, parallelism and concurrency but I don't think these are solution to what I am looking for.

Will appreciate the help and input.

Some sources that studied for above:

[https://medium.com/cuddle-ai/concurrency-with-fastapi-1bd809916130](Concurrency-With-FastAPI)

[https://fastapi.tiangolo.com/async/#asynchronous-code](Concurrnecy-and-async/await)

[https://anyio.readthedocs.io/en/stable/](AnyIO)

Body:
I am trying to execute a longer task (the_longer_function) in the background, and return the response immediately without waiting for the execution of primary function to complete.

Here's the basic code line that I have created:

@app.post("/something/something_test", response_class=JSONResponse)
@validate_token
async def home(request: Request, background_tasks: BackgroundTasks):
    try:
        request_params = await request.json()
        background_tasks.add_task(the_longer_function, request_params)

        return JSONResponse({
            "Result": "Execution Started!"
        }, status_code=200)
    except Exception as ex:
        return {
            "Result": f"Error in starting execution. Error {ex}"
        }

Here's the definition of the_longer_function:

def the_longer_function(request_params):
    variable = None
    try:
        variable = request_params.get('variable', None)
        executionId = str(uuid.uuid4())
        bot_message['ExecutionId'] = executionId
        """
        EXPENSIVE BUSINESS LOGIC HERE
        """
        publish_bot_scan_data(request_params, variable)
    except (JSONDecodeError, Exception) as ex:
        log.error(f"Error {ex}")

I want the API to respond immediately as soon as it adds the task for the new request in the background.

But I have observed, that if the prior request is running, the API is holding the call back and waiting for the previous one to complete and then is returning to the caller.

Have tried, async, trio, parallelism and concurrency but I don't think these are solution to what I am looking for.

Will appreciate the help and input.

Some sources that studied for above:

[https://medium.com/cuddle-ai/concurrency-with-fastapi-1bd809916130](Concurrency-With-FastAPI)

[https://fastapi.tiangolo.com/async/#asynchronous-code](Concurrnecy-and-async/await)

[https://anyio.readthedocs.io/en/stable/](AnyIO)


问:
Chrome not started with Python Selenium webdriver
I got this error when running my code. BTW, I am running this behind a VPN.
Can anyone tell me how can I fix it?
BTW, I try --headless, but weird that only the default profile is started with headless.

selenium.common.exceptions.WebDriverException: Message: unknown error:
Chrome failed to start: exited normally.   (unknown error:
DevToolsActivePort file doesn't exist)   (The process started from
chrome location C:\Program Files\Google\Chrome\Application\chrome.exe
is no longer running, so ChromeDriver is assuming that Chrome has
crashed.)

```<code>from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import os

os.environ['WDM_SSL_VERIFY'] = '0'
os.environ["HTTPS_PROXY"] = "http://127.0.0.1:4780"

options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
# options.add_argument('--headless')
options.add_argument(r"--user-data-dir=C:\Users\nuc\AppData\Local\Google\Chrome\User Data") #e.g. C:\Users\You\AppData\Local\Google\Chrome\User Data
options.add_argument(r'--profile-directory=Profile 5') #e.g. Profile 3
# options.binary_location
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.switch_to.new_window('tab')
driver.get("https://www.youtube.com/")
driver.save_screenshot('ss.png')
</code>```

Body:
I got this error when running my code. BTW, I am running this behind a VPN.
Can anyone tell me how can I fix it?
BTW, I try --headless, but weird that only the default profile is started with headless.

selenium.common.exceptions.WebDriverException: Message: unknown error:
Chrome failed to start: exited normally.   (unknown error:
DevToolsActivePort file doesn't exist)   (The process started from
chrome location C:\Program Files\Google\Chrome\Application\chrome.exe
is no longer running, so ChromeDriver is assuming that Chrome has
crashed.)

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import os

os.environ['WDM_SSL_VERIFY'] = '0'
os.environ["HTTPS_PROXY"] = "http://127.0.0.1:4780"

options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
# options.add_argument('--headless')
options.add_argument(r"--user-data-dir=C:\Users\nuc\AppData\Local\Google\Chrome\User Data") #e.g. C:\Users\You\AppData\Local\Google\Chrome\User Data
options.add_argument(r'--profile-directory=Profile 5') #e.g. Profile 3
# options.binary_location
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.switch_to.new_window('tab')
driver.get("https://www.youtube.com/")
driver.save_screenshot('ss.png')


问:
After downgrade my flutter project I am facing "Using 'maxBy((T) -> R): T?' is an error. Use maxByOrNull instead." error
After downgrade my flutter project I am facing

.....\sdks\flutter.pub-cache\hosted\pub.dartlang.org\geofence_service-1.0.3\android\src\main\kotlin\com\pravera\geofence_service\activity_recognition\ActivityRecognitionIntentService.kt:
(26, 49): Using 'maxBy((T) -> R): T?' is an error. Use maxByOrNull
instead.

This error:


问:
On Microsoft teams when I click allow permission to download file. I got something went wrong message

Describe the bug

On Microsoft teams application. After I followed and ran 56.teams-file-upload, I have click allowed  and it shows the something went wrong message

To Reproduce

Steps to reproduce the behavior:

Execute 56.teams-file-upload example

type something on the bot

Press allow in the upload permission

See error

Upon clicking it, it should not show the something went wrong


问:
How can I design an appropriate table if I want a group to have permission to operate multiple files?

What I want to do

I want to define an appropriate table definition that satisfies the following.

I want to use RDBMS (PostgreSQL)

group table has permissions to operate multiple files

There are two operating permissions that the group wants to have: read and edit

What I'm thinking

First I tried to have two columns in the groups table, one to hold multiple readable file ids (column name: can_read_file_ids) and one to hold multiple writable file ids (column name: can_edit_file_ids)

However, I thought that one column should not have multiple values (many-to-many relationship), so I decided to prepare two intermediate tables each and one files table.

The following is the ER diagram described in mermaid and its image

```<code>erDiagram
    groups ||--o{ can_read_group_files: ""
    groups ||--o{ can_edit_group_files: ""
    files ||--o{ can_read_group_files: ""
    files ||--o{ can_edit_group_files: ""
    groups {
        int id PK
        string name "Name of group"
    }
    can_read_group_files {
        int id PK
        int group_id FK
        int file_id FK "Readable file ID"
    }
    can_edit_group_files {
        int id PK
        int group_id FK
        int file_id FK "Editable file ID"
    }
    files {
        int id PK
        string name
    }
</code>```

enter image description here

I then thought of adding a permissons table, with only one intermediate table, and adding a permissons_id column. This way, I thought, it would be possible to handle more permissions in the future. (For now, only read and edit permissions are needed.)

The following is the ER diagram described in mermaid and its image

```<code>erDiagram
    groups ||--o{ group_files: ""
    permissions ||--o{ group_files: ""
    files ||--o{ group_files: ""
    groups {
        int id PK
        string name "Name of group"
    }
    group_files {
        int id PK
        int group_id FK
        int file_id FK "ID of file"
        int permisson_id FK
    }
    permissions {
        int id PK
        string name
        string description
    }
    files {
        int id PK
        string name
    }
</code>```

enter image description here

What I want to know

I would like to know two things

Can I set more than 4 columns in the intermediate table? (In the second ER diagram, I set up three columns for foreign keys.)

Which table definition should I adopt? Or is there a better table definition?

Body:
What I want to do

I want to define an appropriate table definition that satisfies the following.

I want to use RDBMS (PostgreSQL)

group table has permissions to operate multiple files

There are two operating permissions that the group wants to have: read and edit

What I'm thinking

First I tried to have two columns in the groups table, one to hold multiple readable file ids (column name: can_read_file_ids) and one to hold multiple writable file ids (column name: can_edit_file_ids)

However, I thought that one column should not have multiple values (many-to-many relationship), so I decided to prepare two intermediate tables each and one files table.

The following is the ER diagram described in mermaid and its image

erDiagram
    groups ||--o{ can_read_group_files: ""
    groups ||--o{ can_edit_group_files: ""
    files ||--o{ can_read_group_files: ""
    files ||--o{ can_edit_group_files: ""
    groups {
        int id PK
        string name "Name of group"
    }
    can_read_group_files {
        int id PK
        int group_id FK
        int file_id FK "Readable file ID"
    }
    can_edit_group_files {
        int id PK
        int group_id FK
        int file_id FK "Editable file ID"
    }
    files {
        int id PK
        string name
    }

enter image description here

I then thought of adding a permissons table, with only one intermediate table, and adding a permissons_id column. This way, I thought, it would be possible to handle more permissions in the future. (For now, only read and edit permissions are needed.)

The following is the ER diagram described in mermaid and its image

erDiagram
    groups ||--o{ group_files: ""
    permissions ||--o{ group_files: ""
    files ||--o{ group_files: ""
    groups {
        int id PK
        string name "Name of group"
    }
    group_files {
        int id PK
        int group_id FK
        int file_id FK "ID of file"
        int permisson_id FK
    }
    permissions {
        int id PK
        string name
        string description
    }
    files {
        int id PK
        string name
    }

enter image description here

What I want to know

I would like to know two things

Can I set more than 4 columns in the intermediate table? (In the second ER diagram, I set up three columns for foreign keys.)

Which table definition should I adopt? Or is there a better table definition?