问:
Group by in serializer in Django Rest Framework
In Django Rest Framework, I want to group my serializer data by date, How can I do that.

I have to group it by date on the basis of timestamp date.

my model: mongo model with some more fields also but only uses these two fields

```<code>class MyModel(Document):
    #mongo model

    candidate_id = StringField(required=True, db_field='c')
    timestamp = DateTimeField(required=True, db_field='d')
    ...
    ... more fields

</code>```

My Views: my views file

```<code>class MyView(generics.ListAPIView):
    serializer_class = MySerializer

    def get_queryset(self):
        recruiter_id = self.request.GET.get("recruiter_id")
        activity_list = MyModel.objects.filter(recruiter_id=str(recruiter_id)).order_by('-     timestamp')
        return activity_list

</code>```

my serializer: using serializermethod field to get data from other DB by using candidate id from activity model

```<code>class MySerializer(serializers.Serializer):

    candidate_id = serializers.CharField()
    name = serializers.SerializerMethodField()
    designation = serializers.SerializerMethodField()
    age = serializers.SerializerMethodField()
    timestamp = serializers.DateTimeField(format="%H:%M")

    def get_name(self, obj):
        return something

    def get_designation(self, obj):
        return something

    def get_age(self, obj):
        return something

</code>```

I want to group my response by Date like :

```<code>[
{
    "date": "2022-12-05",
    "candidates":[
      {
        "candidate_id": 1,
        "name": "One",
        "designation": "Lead",
        "age": 30,
        "timestamp": "14:30"
      }
    ]
  },
  {
    "date": "2022-12-04",
    "candidates":[
      {
        "candidate_id": 2,
        "name": "Two",
        "designation": "Lead",
        "age": 30,
        "timestamp": "14:30",
      }
    ]

  }
]
</code>```

my actual response is like:

```<code>[
  {
      "candidate_id": 1,
      "name": "One",
      "designation": "Lead",
      "age": 30,
      "activity_timestamp": "13:12"
  },
  {
      "candidate_id": 2,
      "name": "Two",
      "designation": "Lead",
      "age": 30,
      "activity_timestamp": "13:12"
  }
]
</code>```
```<code></code>```

Body:
In Django Rest Framework, I want to group my serializer data by date, How can I do that.

I have to group it by date on the basis of timestamp date.

my model: mongo model with some more fields also but only uses these two fields

class MyModel(Document):
    #mongo model

    candidate_id = StringField(required=True, db_field='c')
    timestamp = DateTimeField(required=True, db_field='d')
    ...
    ... more fields

My Views: my views file

class MyView(generics.ListAPIView):
    serializer_class = MySerializer

    def get_queryset(self):
        recruiter_id = self.request.GET.get("recruiter_id")
        activity_list = MyModel.objects.filter(recruiter_id=str(recruiter_id)).order_by('-     timestamp')
        return activity_list

my serializer: using serializermethod field to get data from other DB by using candidate id from activity model

class MySerializer(serializers.Serializer):

    candidate_id = serializers.CharField()
    name = serializers.SerializerMethodField()
    designation = serializers.SerializerMethodField()
    age = serializers.SerializerMethodField()
    timestamp = serializers.DateTimeField(format="%H:%M")

    def get_name(self, obj):
        return something

    def get_designation(self, obj):
        return something

    def get_age(self, obj):
        return something

I want to group my response by Date like :

[
{
    "date": "2022-12-05",
    "candidates":[
      {
        "candidate_id": 1,
        "name": "One",
        "designation": "Lead",
        "age": 30,
        "timestamp": "14:30"
      }
    ]
  },
  {
    "date": "2022-12-04",
    "candidates":[
      {
        "candidate_id": 2,
        "name": "Two",
        "designation": "Lead",
        "age": 30,
        "timestamp": "14:30",
      }
    ]

  }
]

my actual response is like:

[
  {
      "candidate_id": 1,
      "name": "One",
      "designation": "Lead",
      "age": 30,
      "activity_timestamp": "13:12"
  },
  {
      "candidate_id": 2,
      "name": "Two",
      "designation": "Lead",
      "age": 30,
      "activity_timestamp": "13:12"
  }
]


来源: stackexchange

问:
Python socket web server: image requests stuck forever at pending on chrome
I'm working on a project to create a web server using python socket. The browser is the client that needs to load a page with 4 images. The browser just keeps pending on 1 or 2 images and i've tried everything, please send help :((

import socket

HOST = 'localhost'
PORT = 8080
content_type_dict = {
    "html": "text/html",
    "htm": "text/html",
    "txt": "text/plain",
    "jpg": "image/jpeg",
    "jpeg": "image/jpeg",
    "gif": "image/gif",
    "png": "image/png",
    "css": "text/css",
    "ico": "image/x-icon",
}

base_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
base_socket.bind((HOST, PORT))
base_socket.listen(1)

print("[LISTENING] Server is listening")

sub_socket, client_address = base_socket.accept()
print(f"[NEW CONNECTION] {client_address} connected.")

while True:
    request = sub_socket.recv(8192).decode()
    sub_socket.settimeout(100000)

    if not request:
        print("CLIENT STOPPED")
        break

    headers = request.split('\n')
    # print(headers[0])

    filename = headers[0].split()[1]

    if filename == '/':
        filename = '/index.html'

    with open("." + filename, 'rb') as f:
        content = f.read()

    file_type = filename.split('.')[1]

    if file_type not in content_type_dict:
        content_type = "application/octet-stream"
    else:
        content_type = content_type_dict[file_type]

    header = """HTTP/1.1 200 OK\r\nCache-Control: no-cache, no-store\r\nContent-Type: %s\r\nConnection: keep-alive, Keep-Alive\r\nKeep-Alive: timeout=100, max=100\r\nContent-Length: %s\r\n\r\n""" % (content_type, len(content))

    sub_socket.sendall(header.encode() + content)

```
<p>And here is the html code</p>
<pre class="lang-html prettyprint-override"><code><!DOCTYPE html>
<html>

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="./css/utils.css">

    <title>Images page</title>
</head>

<body>

    <h1>Images</h1>

    <!-- Photo Grid -->
    <div class="row">
        <div class="column">
            <img src="avatars/1.png" style="width:100%">
            <img src="avatars/2.png" style="width:100%">

        </div>
        <div class="column">
=            <img src="avatars/3.png" style="width:100%">
            <img src="avatars/4.png" style="width:100%">
        </div>

    </div>

</body>

</html>
</code>```

I tried adding more headers information, sending response again when recv function got timeout and many things more but so far nothing has worked out.

ContentLicense: CC BY-SA 4.0

Body:
I'm working on a project to create a web server using python socket. The browser is the client that needs to load a page with 4 images. The browser just keeps pending on 1 or 2 images and i've tried everything, please send help :((

import socket

HOST = 'localhost'
PORT = 8080
content_type_dict = {
    "html": "text/html",
    "htm": "text/html",
    "txt": "text/plain",
    "jpg": "image/jpeg",
    "jpeg": "image/jpeg",
    "gif": "image/gif",
    "png": "image/png",
    "css": "text/css",
    "ico": "image/x-icon",
}

base_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
base_socket.bind((HOST, PORT))
base_socket.listen(1)

print("[LISTENING] Server is listening")

sub_socket, client_address = base_socket.accept()
print(f"[NEW CONNECTION] {client_address} connected.")

while True:
    request = sub_socket.recv(8192).decode()
    sub_socket.settimeout(100000)

    if not request:
        print("CLIENT STOPPED")
        break

    headers = request.split('\n')
    # print(headers[0])

    filename = headers[0].split()[1]

    if filename == '/':
        filename = '/index.html'

    with open("." + filename, 'rb') as f:
        content = f.read()

    file_type = filename.split('.')[1]

    if file_type not in content_type_dict:
        content_type = "application/octet-stream"
    else:
        content_type = content_type_dict[file_type]

    header = """HTTP/1.1 200 OK\r\nCache-Control: no-cache, no-store\r\nContent-Type: %s\r\nConnection: keep-alive, Keep-Alive\r\nKeep-Alive: timeout=100, max=100\r\nContent-Length: %s\r\n\r\n""" % (content_type, len(content))

    sub_socket.sendall(header.encode() + content)

And here is the html code

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="./css/utils.css">

    <title>Images page</title>

Images

=

I tried adding more headers information, sending response again when recv function got timeout and many things more but so far nothing has worked out.


问:
Add LUT table into the plugin jar package for ImageJ
I am developing JAR package with a plugin for ImageJ. I tend to use one LUT (lookup table for coloring grayscale images) file, which is not default part of ImageJ/FIJI instalation. I would like to include the lut file into the jar package so that I don't have to include it to the luts directory of ImageJ after I put jar file with my plugin into plugins directory. Is there a way how to make plugin also to provide LUT?</p>


问:
How to make matplotlib's sequential colormaps "pop" more?
I want to use matplotlib's single-color colormaps (e.g. Blues), but I want the color to "pop" more. I'm not sure what the technical term is for this - higher contrast, increased brightness, something else.

My question: how, in matplotlib, can I make a single-color colormap more vibrant?

There's a toy script and output below. In the output, I want both blue and red to be less dull.

```<code>import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

num_units_per_rf = 1000

# Emulate Gaussian DF
gaussian_place_cell_rf_list = []
gaussian_score_90_by_neuron_list = []
for place_cell_rf in np.arange(start=1, stop=4, step=0.5):
    score_90_by_neuron = np.random.normal(loc=place_cell_rf, size=num_units_per_rf)
    gaussian_score_90_by_neuron_list.append(score_90_by_neuron)
    gaussian_place_cell_rf_list.append(np.full(fill_value=place_cell_rf, shape=num_units_per_rf))
gaussian_df = pd.DataFrame({
    'place_cell_rf': np.concatenate(gaussian_place_cell_rf_list),
    'score_90_by_neuron': np.concatenate(gaussian_score_90_by_neuron_list),
})

noise_place_cell_rf_list = []
noise_score_90_by_neuron_list = []
for place_cell_rf in np.arange(start=1, stop=4, step=0.5):
    score_90_by_neuron = np.random.normal(loc=-place_cell_rf, size=num_units_per_rf)
    noise_score_90_by_neuron_list.append(score_90_by_neuron)
    noise_place_cell_rf_list.append(np.full(fill_value=place_cell_rf, shape=num_units_per_rf))
noise_df = pd.DataFrame({
    'place_cell_rf': np.concatenate(noise_place_cell_rf_list),
    'score_90_by_neuron': np.concatenate(noise_score_90_by_neuron_list),
})

fig, ax = plt.subplots(figsize=(12, 8))

# Plot Gaussians and Noise.
g = sns.kdeplot(
    data=gaussian_df,
    x='score_90_by_neuron',
    common_norm=False,  # Ensure each sweep is normalized separately.
    cumulative=True,
    hue='place_cell_rf',
    palette='Reds',
    ax=ax)

sns.kdeplot(
    data=noise_df,
    x='score_90_by_neuron',
    common_norm=False,  # Ensure each sweep is normalized separately.
    cumulative=True,
    hue='place_cell_rf',
    palette='Blues',
    ax=g)

plt.show()
</code>```

I want the blues to "glow" more, like this subset of the hsv colormap:

I want the reds to "glow" more, like this subset of the hsv colormap:

Body:
I want to use matplotlib's single-color colormaps (e.g. Blues), but I want the color to "pop" more. I'm not sure what the technical term is for this - higher contrast, increased brightness, something else.

My question: how, in matplotlib, can I make a single-color colormap more vibrant?

There's a toy script and output below. In the output, I want both blue and red to be less dull.

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

num_units_per_rf = 1000

# Emulate Gaussian DF
gaussian_place_cell_rf_list = []
gaussian_score_90_by_neuron_list = []
for place_cell_rf in np.arange(start=1, stop=4, step=0.5):
    score_90_by_neuron = np.random.normal(loc=place_cell_rf, size=num_units_per_rf)
    gaussian_score_90_by_neuron_list.append(score_90_by_neuron)
    gaussian_place_cell_rf_list.append(np.full(fill_value=place_cell_rf, shape=num_units_per_rf))
gaussian_df = pd.DataFrame({
    'place_cell_rf': np.concatenate(gaussian_place_cell_rf_list),
    'score_90_by_neuron': np.concatenate(gaussian_score_90_by_neuron_list),
})

noise_place_cell_rf_list = []
noise_score_90_by_neuron_list = []
for place_cell_rf in np.arange(start=1, stop=4, step=0.5):
    score_90_by_neuron = np.random.normal(loc=-place_cell_rf, size=num_units_per_rf)
    noise_score_90_by_neuron_list.append(score_90_by_neuron)
    noise_place_cell_rf_list.append(np.full(fill_value=place_cell_rf, shape=num_units_per_rf))
noise_df = pd.DataFrame({
    'place_cell_rf': np.concatenate(noise_place_cell_rf_list),
    'score_90_by_neuron': np.concatenate(noise_score_90_by_neuron_list),
})

fig, ax = plt.subplots(figsize=(12, 8))

# Plot Gaussians and Noise.
g = sns.kdeplot(
    data=gaussian_df,
    x='score_90_by_neuron',
    common_norm=False,  # Ensure each sweep is normalized separately.
    cumulative=True,
    hue='place_cell_rf',
    palette='Reds',
    ax=ax)

sns.kdeplot(
    data=noise_df,
    x='score_90_by_neuron',
    common_norm=False,  # Ensure each sweep is normalized separately.
    cumulative=True,
    hue='place_cell_rf',
    palette='Blues',
    ax=g)

plt.show()

I want the blues to "glow" more, like this subset of the hsv colormap:

I want the reds to "glow" more, like this subset of the hsv colormap:


问:
How to detect and track random shapes in images
For a while i am working on image processing. I do image processing in C# and i use EmguCV.
What i need is to detect the line as shown in the picture and track that line for each frame captured from web cam.
I want to detect the edges of the figure and track for every frame taken with web cam.

What is the best way to do it?
What i am thinking is to do edge detection first with canny filter.
But then i am a bit confused about how to track the figure.
I tought about Hough Line but not sure that it is suitable method for curved lines.

Please help


问:
How to output each iteration of Newton's method in Python?
I was required to have the code output each iteration and discrepancy of the Newton method for systems of nonlinear equations.
I tried and nothing worked to rearrange and correct the code so that each step of the answer was output, and not the result itself completely.

The method code itself is sure that it works optimally and outputs the correct answer.

At first I tried to enter the lower code outside the function into the inside of def, but then the problem is:

```<code>root, iter_count = Newton_method_for_systems(f_array, Jacobi_matrix, start_point, eps)
</code>```

CODE:

```<code>import numpy as np
import math

def convergence_check_f(Jacobi_matrix: list, x: tuple) -> bool:
    Jacobi_matrix_x = [[df_i(*x) for df_i in row] for row in Jacobi_matrix]
    if np.linalg.det(Jacobi_matrix_x) != 0:
        return True
    return False

def Newton_method_for_systems(f_array: tuple, Jacobi_matrix: list, start_point: list, eps: float) -> list:
    ''' Find a root point of the system of non-linear equations using Newton's method.
        Returns an approximate root and the number of iterations.'''
    x_cur = np.array(start_point)
    iters = 0
    while True:
        if not convergence_check_f(Jacobi_matrix, x_cur):
            print('The condition of convergence hasn\'t been satistied: Jacobi matrix is not invertible.')
            exit()

        f_array_cur = np.array([f_i(*x_cur.tolist()) for f_i in f_array])
        Jacobi_matrix_cur = [[df_i(*x_cur.tolist()) for df_i in row] for row in Jacobi_matrix]

        # J(x^k) * delta(x^k) = -f(x^k), solve with respect to delta(x^k)
        delta_x_k = np.linalg.solve(Jacobi_matrix_cur, -f_array_cur)

        # delta(x^k) = x^(x+1) - x^k, so we get x^(k+1) from this equation
        x_next = delta_x_k + x_cur
        iters += 1
        if np.linalg.norm(x_next - x_cur) < eps:
            return x_next.tolist(), iters
        x_cur = np.copy(x_next)
        if __name__ == '__main__':
            start_point = []
            s1=float(input('Введите приближение x1:'))
            s2=float(input('Введите приближение x2:'))
            start_point.append(s1)
            start_point.append(s2)

            f_array = (lambda x1, x2: x1**2+x2**2-1, lambda x1, x2: math.log(x1)+2*x2+1)

            Jacobi_matrix = [
            [lambda x1, x2: 2*x1, lambda x1, x2: 2*x2],
            [lambda x1, x2: 1/x1, lambda x1, x2: 2]  ]
            eps = float('Точность:')
root, iter_count = Newton_method_for_systems(f_array, Jacobi_matrix, start_point, eps)
print(f'Root: {root}, iterations: {iter_count}')
</code>```

Body:
I was required to have the code output each iteration and discrepancy of the Newton method for systems of nonlinear equations.
I tried and nothing worked to rearrange and correct the code so that each step of the answer was output, and not the result itself completely.

The method code itself is sure that it works optimally and outputs the correct answer.

At first I tried to enter the lower code outside the function into the inside of def, but then the problem is:

root, iter_count = Newton_method_for_systems(f_array, Jacobi_matrix, start_point, eps)

CODE:

import numpy as np
import math

def convergence_check_f(Jacobi_matrix: list, x: tuple) -> bool:
    Jacobi_matrix_x = [[df_i(*x) for df_i in row] for row in Jacobi_matrix]
    if np.linalg.det(Jacobi_matrix_x) != 0:
        return True
    return False

def Newton_method_for_systems(f_array: tuple, Jacobi_matrix: list, start_point: list, eps: float) -> list:
    ''' Find a root point of the system of non-linear equations using Newton's method.
        Returns an approximate root and the number of iterations.'''
    x_cur = np.array(start_point)
    iters = 0
    while True:
        if not convergence_check_f(Jacobi_matrix, x_cur):
            print('The condition of convergence hasn\'t been satistied: Jacobi matrix is not invertible.')
            exit()

        f_array_cur = np.array([f_i(*x_cur.tolist()) for f_i in f_array])
        Jacobi_matrix_cur = [[df_i(*x_cur.tolist()) for df_i in row] for row in Jacobi_matrix]

        # J(x^k) * delta(x^k) = -f(x^k), solve with respect to delta(x^k)
        delta_x_k = np.linalg.solve(Jacobi_matrix_cur, -f_array_cur)

        # delta(x^k) = x^(x+1) - x^k, so we get x^(k+1) from this equation
        x_next = delta_x_k + x_cur
        iters += 1
        if np.linalg.norm(x_next - x_cur) < eps:
            return x_next.tolist(), iters
        x_cur = np.copy(x_next)
        if __name__ == '__main__':
            start_point = []
            s1=float(input('Введите приближение x1:'))
            s2=float(input('Введите приближение x2:'))
            start_point.append(s1)
            start_point.append(s2)

            f_array = (lambda x1, x2: x1**2+x2**2-1, lambda x1, x2: math.log(x1)+2*x2+1)

            Jacobi_matrix = [
            [lambda x1, x2: 2*x1, lambda x1, x2: 2*x2],
            [lambda x1, x2: 1/x1, lambda x1, x2: 2]  ]
            eps = float('Точность:')
root, iter_count = Newton_method_for_systems(f_array, Jacobi_matrix, start_point, eps)
print(f'Root: {root}, iterations: {iter_count}')


问:
How to create a yes no filter option on custom product option shopify liquid
I have products with an option set of initials, so a-z on the frontend category filter. This is obviously very long when expanded and was wondering if it could be set to a yes/no boolean instead?

Edit. The below image is what i'm looking to duplicate and have attached the code for that. I'm guessing I could copy but change the param name? but not sure what the param name would be.

```<code>{%- if filter.param_name == 'filter.v.availability' -%}
        <div class="filter-group filter-group--availability">
          <div class="filter-toggle filter-toggle--inline">
            <span class="filter-toggle__group-label">{{ 'collections.filtering.out_of_stock_label' | t }}</span>
            <div class="filter-toggle__options">

              <label class="filter-toggle__input-label">
                <input class="filter-toggle__input"
                  id="Filter-{{ filter.param_name }}-1"
                  type="radio"
                  name="{{ filter.param_name }}"
                  value=""
                  {% if filter.active_values == empty %}checked{% endif %}>
                <span class="filter-toggle__input-label-text">{{ 'collections.filtering.show_label' | t }}</span>
              </label>
              <label class="filter-toggle__input-label" id="second-filter-btn">
                <input class="filter-toggle__input"
                  id="Filter-{{ filter.param_name }}-2"
                  type="radio"
                  name="{{ filter.param_name }}"
                  value="1"
                  {% if filter.active_values != empty and filter.active_values.first.value == '1' %}checked{% endif %}>
                  <span class="filter-toggle__input-label-text">{{ 'collections.filtering.hide_label' | t }}</span>
              </label>
            </div>
          </div>
        </div>

      {%- else -%}
</code>```

Body:
I have products with an option set of initials, so a-z on the frontend category filter. This is obviously very long when expanded and was wondering if it could be set to a yes/no boolean instead?

Edit. The below image is what i'm looking to duplicate and have attached the code for that. I'm guessing I could copy but change the param name? but not sure what the param name would be.

{%- if filter.param_name == 'filter.v.availability' -%}

            {{ 'collections.filtering.out_of_stock_label' | t }}

                <input class="filter-toggle__input"
                  id="Filter-{{ filter.param_name }}-1"
                  type="radio"
                  name="{{ filter.param_name }}"
                  value=""
                  {% if filter.active_values == empty %}checked{% endif %}>
                {{ 'collections.filtering.show_label' | t }}

                <input class="filter-toggle__input"
                  id="Filter-{{ filter.param_name }}-2"
                  type="radio"
                  name="{{ filter.param_name }}"
                  value="1"
                  {% if filter.active_values != empty and filter.active_values.first.value == '1' %}checked{% endif %}>
                  {{ 'collections.filtering.hide_label' | t }}

      {%- else -%}


问:
How to create tooltips with intersect = false?
I created a chart with two y-axis and one x-axis and struggle to create tooltips with intersect = false, so it will start the tooltip when hovering over the line and not only the point of the chart

However, the whole settings for the tooltip, described on

https://www.chartjs.org/docs/latest/configuration/tooltip.html

Does not seem to have any effect for me. My code see below

I am using this code inside a NodeRed template node

```<code>
\<canvas id="myChart" width=912 height =370\>\</canvas\>
\<script\>
var textcolor = getComputedStyle(document.documentElement).getPropertyValue('--nr-dashboard-widgetTextColor');
var gridcolor = '#E6E6E6';
var linecolors = \['#333F50','#B55A11', '#90C050'\]
var backgroundColor = \['#999FA7','#DAAC88', '#C7DFA7'\]

var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',

    // The data for our dataset
    data: {
        labels: {{{payload.labels}}},
        datasets: [
            {
                label: 'Folie Länge Ist',
                backgroundColor: backgroundColor[0],
                borderColor: linecolors[0],
                data: {{{payload.eins}}},
                yAxisID: 'left-y-axis',
            },
            {
                label: 'Folie Länge Soll',
                backgroundColor: backgroundColor[1],
                borderColor: linecolors[1],
                data: {{{payload.zwei}}},
                yAxisID: 'left-y-axis',
            },
            {
                label: 'Aufwickler Durchmesser',
                backgroundColor: backgroundColor[2],
                borderColor: linecolors[2],
                data: {{{payload.drei}}},
                yAxisID: 'right-y-axis',
            }
        ]
    },

    // Configuration options
    options: {
        animation: false,
        legend: {
            display: true,
            position: "top"
        },
        elements: {
            point: {
                pointStyle: 'circle',
                radius: 0
            },
            line: {
                tension: 0,
                fill: false
            }
        },
        plugins: {
            tooltip: {
                mode: 'index',
                intersect: false
            }
        },
        scales: {
            yAxes: [
                {
                    gridLines :{display:false},
                    id: 'left-y-axis',
                    type: 'linear',
                    position: 'left',
                    ticks: {
                        fontColor: linecolors[0],
                        callback: function(value, index, ticks) {
                            return new Intl.NumberFormat('de-DE').format(value);
                        }
                    }
                },
                {
                    gridLines :{zeroLineColor:gridcolor,color:gridcolor,lineWidth:1},
                    id: 'right-y-axis',
                    type: 'linear',
                    position: 'right',
                    ticks: {
                        fontColor:linecolors[2],
                        callback: function(value, index, ticks) {
                            return new Intl.NumberFormat('de-DE').format(value);
                        }
                    }
                }
            ],
            xAxes: [
                {
                    ticks: {
                        autoSkip: true,
                        autoSkipPadding: 10,
                        maxRotation: 0,
                        minRotation: 0
                    }
                }
            ]
        }
    }

});
\</script\>

</code>```

Tried setting intersect = false, also enable = false just to test if these settings have an effect

Body:
I created a chart with two y-axis and one x-axis and struggle to create tooltips with intersect = false, so it will start the tooltip when hovering over the line and not only the point of the chart

However, the whole settings for the tooltip, described on

https://www.chartjs.org/docs/latest/configuration/tooltip.html

Does not seem to have any effect for me. My code see below

I am using this code inside a NodeRed template node

\<canvas id="myChart" width=912 height =370\>\</canvas\>
\

Tried setting intersect = false, also enable = false just to test if these settings have an effect


问:
Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start failed: String index out of range: -6
my project uses jgit to release the code to artifactory , how ever suddenly am facing the issue as Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start failed: String index out of range: -6
using below plugin:</p>
```<code><plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m5.1</version>
                <configuration>
                    <flowInitContext>
                        <masterBranchName>master</masterBranchName>
                        <developBranchName>develop</developBranchName>
                    </flowInitContext>
                    <username>xxxxxx</username>
                    <password>xxxxx</password>
                    <allowUntracked>true</allowUntracked>
                </configuration>
            </plugin>
</code>```

Body:
my project uses jgit to release the code to artifactory , how ever suddenly am facing the issue as Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start failed: String index out of range: -6
using below plugin:

<plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m5.1</version>
                <configuration>
                    <flowInitContext>
                        <masterBranchName>master</masterBranchName>
                        <developBranchName>develop</developBranchName>
                    </flowInitContext>
                    <username>xxxxxx</username>
                    <password>xxxxx</password>
                    <allowUntracked>true</allowUntracked>
                </configuration>
            </plugin>


问:
QuickFix: How to create a new custom group
Would you please advise what is the way to create (Java) custom group. For instance, i need a group consists of three element (2101, 2102, 2103) so that fix message will be:

```<code>35=D|....|2100=1|2101=ETRSJSD|2102=ABCD|2103=5|
</code>```

where 2100 include index of subgroup

QuickFix has similar NewSingleOrder.NoStrategyParameters()

Body:
Would you please advise what is the way to create (Java) custom group. For instance, i need a group consists of three element (2101, 2102, 2103) so that fix message will be:

35=D|....|2100=1|2101=ETRSJSD|2102=ABCD|2103=5|

where 2100 include index of subgroup

QuickFix has similar NewSingleOrder.NoStrategyParameters()


问:
Intellij Idea in debug mode throw java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64
I have my java project in Intellij Idea, the app in the project connect to a database (apache derby).

If I run the application not in debug mode I get no errors, no exceptions, it seems to work fine.

If I run the application in Intellij debug mode I get:

```<code>java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 8192 (inclusive). The specific key size 256 is not supported
</code>```

when this happen it asks to open Intellij decompiler. This happen when I try to connect to the database.

I don't understand what is the right behaviour, if there are some problems or not.
I have to consider the one in normal run or the one in debug mode?
Same jvm version is both the tests.

Thanks for the help

UPDATE:
Just to add another thing: if after this exception caught by the debugger I resume the program execution it seems to work with no problem. It doesn't throw it again, at lest from my tests.

Body:
I have my java project in Intellij Idea, the app in the project connect to a database (apache derby).

If I run the application not in debug mode I get no errors, no exceptions, it seems to work fine.

If I run the application in Intellij debug mode I get:

java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 8192 (inclusive). The specific key size 256 is not supported

when this happen it asks to open Intellij decompiler. This happen when I try to connect to the database.

I don't understand what is the right behaviour, if there are some problems or not.
I have to consider the one in normal run or the one in debug mode?
Same jvm version is both the tests.

Thanks for the help

UPDATE:
Just to add another thing: if after this exception caught by the debugger I resume the program execution it seems to work with no problem. It doesn't throw it again, at lest from my tests.


问:
Get table names in dataset after dataset truncate
It seems that the BigQuery CLI supports restoring tables in a dataset after they have been deleted by using BigQuery Time Travel functionality -- as in:

bq cp dataset.table@TIME_AGO_UNIX dataset.table
```

However, this assumes we know the names of the tables. I want to write a script to iterate over all the tables that were in the dataset at TIME_AGO_UNIX time.

How would I go about finding those tables at that time?

Body:
It seems that the BigQuery CLI supports restoring tables in a dataset after they have been deleted by using BigQuery Time Travel functionality -- as in:

bq cp dataset.table@TIME_AGO_UNIX dataset.table

However, this assumes we know the names of the tables. I want to write a script to iterate over all the tables that were in the dataset at TIME_AGO_UNIX time.

How would I go about finding those tables at that time?


问:
Why does mypy throw "Cannot instantiate abstract class"?
I have a made a change to a python codebase which is causing mypy to fail with error:

Cannot instantiate abstract class "Feature" with abstract attributes "aggregator", "column_expression", "default_value" and "description_subject"

and I don't know why. Its true that class Feature has those abstract attributes however I am not attempting to instantiate it (not intentionally anyway).

The code that mypy is objecting to is:

[
  f[0](as_at=self.as_at, feature_period=f[1])
  for f in (
    (cls, fp)
    for cls in self.FEATURE_CLASSES
    for fp in self.feature_periods
  )
]
```
<p>This code instantiates a collection of classes named in <code>self.FEATURE_CLASSES</code>. Each one of those classes is derived from abstract class <code>Feature</code>.</p>
<p>The only change I made in the commit that caused this mypy failure was to add a new class to <code>self.FEATURE_CLASSES</code>:
<img src="https://i.stack.imgur.com/npduT.png" alt="screenshot of diff" /></p>
<p>https://github.com/jamiekt/jstark/pull/4/files</p>
<p>classes <code>Count</code> & <code>GrossSpend</code> derive from the same base class as <code>RecencyDays</code> so I can't understand why mypy is throwing this error. Furthermore, if I remove one of the other classes so its like this:</p>
<p><code>FEATURE_CLASSES = [Count, RecencyDays]</code></p>
<p>then mypy no longer throws an error. Hence its not something specific to <code>RecencyDays</code> that is the problem, it seems to be the fact that <code>FEATURE_CLASSES</code> now contains 3 items.</p>
<p>One more bit of information - when I run the code it runs successfully and as expected, as is proven by the successful completion of the unit test suite. Only the linting job (which includes mypy) fails. The unit tests jobs and failed linting job can be seen at https://github.com/jamiekt/jstark/actions/runs/3650289374.</p>
<p>Can anyone explain to me why this is happening and what I can do to fix it?</p>
<p>To reproduce the problem:</p>
<ul>
<li>clone the repo</li>
<li>switch to the branch with the issue</li>
<li>create a virtualenv and activate it</li>
<li>install dependencies</li>
<li>install mypy</li>
<li>install stubs</li>
<li>run mypy:</li>
</ul>
<pre class="lang-bash prettyprint-override"><code>git clone https://github.com/jamiekt/jstark.git
cd jstark
git checkout recencydays-in-pfg
python3 -m venv venv
source venv/bin/activate
python3 -m pip install pyspark
python3 -m pip install mypy
mypy --install-types
mypy jstark/purchasing_feature_generator.py
</code>```

It should return error:

jstark/purchasing_feature_generator.py:44: error: Cannot instantiate abstract class "Feature" with abstract attributes "aggregator", "column_expression", "default_value" and "description_subject"  [abstract]

Found 1 error in 1 file (checked 1 source file)

Body:
I have a made a change to a python codebase which is causing mypy to fail with error:

Cannot instantiate abstract class "Feature" with abstract attributes "aggregator", "column_expression", "default_value" and "description_subject"

and I don't know why. Its true that class Feature has those abstract attributes however I am not attempting to instantiate it (not intentionally anyway).

The code that mypy is objecting to is:

[
  f[0](as_at=self.as_at, feature_period=f[1])
  for f in (
    (cls, fp)
    for cls in self.FEATURE_CLASSES
    for fp in self.feature_periods
  )
]

This code instantiates a collection of classes named in self.FEATURE_CLASSES. Each one of those classes is derived from abstract class Feature.

The only change I made in the commit that caused this mypy failure was to add a new class to self.FEATURE_CLASSES:

https://github.com/jamiekt/jstark/pull/4/files

classes Count & GrossSpend derive from the same base class as RecencyDays so I can't understand why mypy is throwing this error. Furthermore, if I remove one of the other classes so its like this:

FEATURE_CLASSES = [Count, RecencyDays]

then mypy no longer throws an error. Hence its not something specific to RecencyDays that is the problem, it seems to be the fact that FEATURE_CLASSES now contains 3 items.

One more bit of information - when I run the code it runs successfully and as expected, as is proven by the successful completion of the unit test suite. Only the linting job (which includes mypy) fails. The unit tests jobs and failed linting job can be seen at https://github.com/jamiekt/jstark/actions/runs/3650289374.

Can anyone explain to me why this is happening and what I can do to fix it?

To reproduce the problem:

clone the repo

switch to the branch with the issue

create a virtualenv and activate it

install dependencies

install mypy

install stubs

run mypy:

git clone https://github.com/jamiekt/jstark.git
cd jstark
git checkout recencydays-in-pfg
python3 -m venv venv
source venv/bin/activate
python3 -m pip install pyspark
python3 -m pip install mypy
mypy --install-types
mypy jstark/purchasing_feature_generator.py

It should return error:

jstark/purchasing_feature_generator.py:44: error: Cannot instantiate abstract class "Feature" with abstract attributes "aggregator", "column_expression", "default_value" and "description_subject"  [abstract]

Found 1 error in 1 file (checked 1 source file)


问:
Association of the file type with the plugin in ImageJ to allow drag and drop or click to view
I have created ImageJ plugin by modifying https://imagej.nih.gov/ij/plugins/raw-file-opener.html

I managed to get it associated with the ImageJ menu by providing new item File->Open Format

When I want to open this format, I have to click File->Open Format. My users would wish if drag and drop work out of the box and that my file is associated with ImageJ and ImageJ knows that my plugin is able to open it so that if user clicks in explorer it opens.

How to implement this? I am using this https://imagej.net/develop/building-a-pom to build jar package containing my package.


问:
Adding author names to a title page on R slides

I am trying to make a presentation in R and have the following code

title: "MA3419 Coursework 2\nPresentation"

author :

"first1 last1"

"first2 last2"

"first3 last3"

"first4 last4"

output: ioslides_presentation

date: '2022-12-08'

It has changed the format of the code when I have copied it over but the bullet points are - s in the code.
When I knit it it produces the slides but all the names have a - after them and when I remove the - from the code it doesn't run.
Can anyone suggest either another way to add author names to the title slides or a way to remove the - s


问:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process image
I know this question has been asked before but I have tried the responses to no avail. For my list of Id's I'm trying to download an image, get the image exif and stamp the image.

this is what my code looks like.

```<code>import os

for id in ids_list:
    print(id)
    for attach_id in attach_mgr.get_list(id):
        out_attach = attach_mgr.download(id, attach_id["id"], r"C:/arcgis/home")
        print(out_attach)
        print(attach_id)
        img = Image.open(out_attach[0])
        exif = get_exif(out_attach[0])
        print(exif)
        if (exif):
            if ('DateTime' in exif.keys()):
                print(exif['DateTime'])
                stampImage(out_attach[0].split("/")[-1], exif['DateTime'], "Center")
            else:
                print('No EXIF Data')
                stampImage(out_attach[0].split("/")[-1], "No Date in Exif", "Center")

        result = attach_mgr.update(id, attach_id["id"], out_attach[0])
        attach_mgr.delete(id, attach_id["id"])
        os.close(file_name)
        os.remove(out_attach[0])
        print(result)
</code>```

This is the error I get.

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:/arcgis/home\\20074NB.JPG'
```

Body:
I know this question has been asked before but I have tried the responses to no avail. For my list of Id's I'm trying to download an image, get the image exif and stamp the image.

this is what my code looks like.

import os

for id in ids_list:
    print(id)
    for attach_id in attach_mgr.get_list(id):
        out_attach = attach_mgr.download(id, attach_id["id"], r"C:/arcgis/home")
        print(out_attach)
        print(attach_id)
        img = Image.open(out_attach[0])
        exif = get_exif(out_attach[0])
        print(exif)
        if (exif):
            if ('DateTime' in exif.keys()):
                print(exif['DateTime'])
                stampImage(out_attach[0].split("/")[-1], exif['DateTime'], "Center")
            else:
                print('No EXIF Data')
                stampImage(out_attach[0].split("/")[-1], "No Date in Exif", "Center")

        result = attach_mgr.update(id, attach_id["id"], out_attach[0])
        attach_mgr.delete(id, attach_id["id"])
        os.close(file_name)
        os.remove(out_attach[0])
        print(result)

This is the error I get.

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:/arcgis/home\\20074NB.JPG'


问:
Xfoil Manual Setup Through setup.py raise "CMake Error: Error: generator : MinGW Makefiles"
Xfoil Manual Setup Through setup.py raise "CMake Error: Error: generator : MinGW Makefiles"

I have downloaded the python XFOIL library and made some modifications to the API, which is written in Fortran f90, in order to get the thickness attribute, which is calculated in the XFOIL fortran library but not transferred to python through the API, as follows:

```<code>    function get_thickness() bind(c, name='get_thickness')
        use m_xgeom, only: THICK
        integer(c_float) :: get_thickness
        get_thickness = THICK
    end function get_thickness
</code>```

Since I've made this modification, I have to make the installation manually rather than using pip install.

I tried:

```<code>$RepoPath\xfoil-python-master>python setup.py install
</code>```

But when I try to make the installation with python setup.py install, I get the following error:

```<code>running install
$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build, pip and other standards-based tools.
  setuptools.SetuptoolsDeprecationWarning,
$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\easy_install.py:147: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  EasyInstallDeprecationWarning,
running bdist_egg
running egg_info
writing xfoil.egg-info\PKG-INFO
writing dependency_links to xfoil.egg-info\dependency_links.txt
writing requirements to xfoil.egg-info\requires.txt
writing top-level names to xfoil.egg-info\top_level.txt
reading manifest file 'xfoil.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'xfoil.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build\\temp.win-amd64-cpython-37\\Release', '-DPYTHON_EXECUTABLE=C:\\Users\\kandemir\\Anaconda3\\envs\\py37\\python.exe', '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-G', 'MinGW Makefiles']
CMake Error: Error: generator : MinGW Makefiles
Does not match the generator used previously: NMake Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Traceback (most recent call last):
  File "setup.py", line 149, in <module>
    zip_safe=False
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install.py", line 74, in run
    self.do_egg_install()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install.py", line 123, in do_egg_install
    self.run_command('bdist_egg')
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\bdist_egg.py", line 165, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\bdist_egg.py", line 151, in call_command
    self.run_command(cmdname)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\command\install_lib.py", line 112, in build
    self.run_command('build_ext')
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
    _build_ext.run(self)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run
    self.build_extensions()
  File "setup.py", line 110, in build_extensions
    cwd=self.build_temp)
  File "$UserPath\Anaconda3\envs\py37\lib\subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '$RepoPath\\\xfoil-python-master', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build\\temp.win-amd64-cpython-37\\Release', '-DPYTHON_EXECUTABLE=C:\\Users\\kandemir\\Anaconda3\\envs\\py37\\python.exe', '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-G', 'MinGW Makefiles']' returned non-zero exit status 1.
</code>```

Could you please help me to find the solution to that?

Body:
Xfoil Manual Setup Through setup.py raise "CMake Error: Error: generator : MinGW Makefiles"

I have downloaded the python XFOIL library and made some modifications to the API, which is written in Fortran f90, in order to get the thickness attribute, which is calculated in the XFOIL fortran library but not transferred to python through the API, as follows:

    function get_thickness() bind(c, name='get_thickness')
        use m_xgeom, only: THICK
        integer(c_float) :: get_thickness
        get_thickness = THICK
    end function get_thickness

Since I've made this modification, I have to make the installation manually rather than using pip install.

I tried:

$RepoPath\xfoil-python-master>python setup.py install

But when I try to make the installation with python setup.py install, I get the following error:

running install
$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build, pip and other standards-based tools.
  setuptools.SetuptoolsDeprecationWarning,
$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\easy_install.py:147: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  EasyInstallDeprecationWarning,
running bdist_egg
running egg_info
writing xfoil.egg-info\PKG-INFO
writing dependency_links to xfoil.egg-info\dependency_links.txt
writing requirements to xfoil.egg-info\requires.txt
writing top-level names to xfoil.egg-info\top_level.txt
reading manifest file 'xfoil.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'xfoil.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build\\temp.win-amd64-cpython-37\\Release', '-DPYTHON_EXECUTABLE=C:\\Users\\kandemir\\Anaconda3\\envs\\py37\\python.exe', '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-G', 'MinGW Makefiles']
CMake Error: Error: generator : MinGW Makefiles
Does not match the generator used previously: NMake Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Traceback (most recent call last):
  File "setup.py", line 149, in <module>
    zip_safe=False
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install.py", line 74, in run
    self.do_egg_install()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install.py", line 123, in do_egg_install
    self.run_command('bdist_egg')
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\bdist_egg.py", line 165, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\bdist_egg.py", line 151, in call_command
    self.run_command(cmdname)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\command\install_lib.py", line 112, in build
    self.run_command('build_ext')
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
    _build_ext.run(self)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "$UserPath\Anaconda3\envs\py37\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run
    self.build_extensions()
  File "setup.py", line 110, in build_extensions
    cwd=self.build_temp)
  File "$UserPath\Anaconda3\envs\py37\lib\subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '$RepoPath\\\xfoil-python-master', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build\\temp.win-amd64-cpython-37\\Release', '-DPYTHON_EXECUTABLE=C:\\Users\\kandemir\\Anaconda3\\envs\\py37\\python.exe', '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$RepoPath\\\xfoil-python-master\\build\\lib.win-amd64-cpython-37\\xfoil', '-G', 'MinGW Makefiles']' returned non-zero exit status 1.

Could you please help me to find the solution to that?


问:
Extent report is not generating while running docker image
My dockerfile is like.

```<code>FROM maven:3.6.0-jdk-8-alpine
RUN apk add curl jq

#copying src from my framework
COPY src /home/SeleniumFramework/src/

#copying pom.xml of my framework
COPY pom.xml /home/SeleniumFramework/

RUN mvn -f /home/SeleniumFramework dependency:go-offline

#copying testng.xml of my framework
COPY testng.xml /home/SeleniumFramework/

ADD healthcheck.sh healthcheck.sh
#Running the suite
CMD  mvn -f /home/SeleniumFramework/pom.xml clean test
</code>```

I build an image and run using docker run -it  mayankluckym/selenium-5 , after execution Report and target folders are not generating.

but if I am using docker run -it --entrypoint sh mayankluckym/selenium-5
then I move into

```<code>/ # cd /home/SeleniumFramework/
</code>```

and I run Dockerfile Entrypoint on  / # cd /home/SeleniumFramework/ path

```<code> / # cd /home/SeleniumFramework/mvn -f /home/SeleniumFramework/pom.xml clean test
</code>```

in that case Reports and target folders got generated.

Body:
My dockerfile is like.

FROM maven:3.6.0-jdk-8-alpine
RUN apk add curl jq

#copying src from my framework
COPY src /home/SeleniumFramework/src/

#copying pom.xml of my framework
COPY pom.xml /home/SeleniumFramework/

RUN mvn -f /home/SeleniumFramework dependency:go-offline

#copying testng.xml of my framework
COPY testng.xml /home/SeleniumFramework/

ADD healthcheck.sh healthcheck.sh
#Running the suite
CMD  mvn -f /home/SeleniumFramework/pom.xml clean test

I build an image and run using docker run -it  mayankluckym/selenium-5 , after execution Report and target folders are not generating.

but if I am using docker run -it --entrypoint sh mayankluckym/selenium-5
then I move into

/ # cd /home/SeleniumFramework/

and I run Dockerfile Entrypoint on  / # cd /home/SeleniumFramework/ path

 / # cd /home/SeleniumFramework/mvn -f /home/SeleniumFramework/pom.xml clean test

in that case Reports and target folders got generated.


问:
Automate retrieving password from Ec2 windows instance that was launched from custom AMI
When the instance is launched from the custom AMI I could not retrieve password for the launched instance. This issue and resolution is discussed here and it worked.

These are the manual steps I performed:

Open the Amazon EC2 console, and then connect to the original Windows EC2 instance using Remote Desktop Protocol (RDP).

From the Windows Start menu, do the following:

For Windows Server 2008 through Windows Server 2012 R2, open EC2ConfigService Settings, and then choose the Image tab.

For Windows Server 2016 or later, open EC2 Launch Settings.

For Administrator Password, choose Random.

Select Shutdown without Sysprep *.

Select Yes.

Open the Amazon EC2 console, and then select Instances.

Wait until the instance state changes to Stopped, and then choose your instance.

Select Actions, Image, Create image.
For Image name, enter a name.
(Optional) For Image description, enter a description.

Choose Create image.

I wanted to know if steps from 1 to 5 can be automated?
The source instance has the following scripts, and wondering if any of these script will do the trick, if yes, then what parameter I need to pass

```<code>"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SendWindowsIsReady.ps1 -Schedule",
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule",
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SysprepInstance.ps1 -NoShutdown"
</code>```

Body:
When the instance is launched from the custom AMI I could not retrieve password for the launched instance. This issue and resolution is discussed here and it worked.

These are the manual steps I performed:

Open the Amazon EC2 console, and then connect to the original Windows EC2 instance using Remote Desktop Protocol (RDP).

From the Windows Start menu, do the following:

For Windows Server 2008 through Windows Server 2012 R2, open EC2ConfigService Settings, and then choose the Image tab.

For Windows Server 2016 or later, open EC2 Launch Settings.

For Administrator Password, choose Random.

Select Shutdown without Sysprep *.

Select Yes.

Open the Amazon EC2 console, and then select Instances.

Wait until the instance state changes to Stopped, and then choose your instance.

Select Actions, Image, Create image.
For Image name, enter a name.
(Optional) For Image description, enter a description.

Choose Create image.

I wanted to know if steps from 1 to 5 can be automated?
The source instance has the following scripts, and wondering if any of these script will do the trick, if yes, then what parameter I need to pass

"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SendWindowsIsReady.ps1 -Schedule",
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule",
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SysprepInstance.ps1 -NoShutdown"


问:
Ability to access Dart class from native code
I am in the process of migrating from Android/JNI to Flutter/Dart/FFI to build native apps. Currently in Android I have a Java class (ScanningHelper.java) which is modified during the program lifecycle. During native initialization, I send a jobject type using which in my C/C++ code, I am able to call different member functions or even access variables directly (depending on access).

Is something similar possible with Dart FFI? The closest I have come to is possibly creating a struct in native and then using multiple functions to set/get data from native. I though have a feeling that the amount of code to be written will be high including memory clean up on Dart every time a string/const char* is returned.

Appreciate any direction to accomplish something like below without needing to duplicate implementation across both languages.

```<code>// ScanningHelper.java
public class ScanningHelper {

   private String _mediaStorageDirectory;

   public void setMediaStorageDirectory(String path) { _mediaStorageDirectory = path; }
   public String getAppMediaStorageDirectory() { return _mediaStorageDirectory; }
   public double latitude;
   public double longitude;

   ...

   byte[] image1Bytes;

}
</code>```

I have some standard methods defined like getStringFromObjectMethod which allows reuse across different classes and return types;

```<code>// JNIMethods.cpp
std::string mediaDirectory = JNIMethods::getStringFromObjectMethod(jniEnv,_scanningHelper,"getAppMediaStorageDirectory"));

</code>```

Body:
I am in the process of migrating from Android/JNI to Flutter/Dart/FFI to build native apps. Currently in Android I have a Java class (ScanningHelper.java) which is modified during the program lifecycle. During native initialization, I send a jobject type using which in my C/C++ code, I am able to call different member functions or even access variables directly (depending on access).

Is something similar possible with Dart FFI? The closest I have come to is possibly creating a struct in native and then using multiple functions to set/get data from native. I though have a feeling that the amount of code to be written will be high including memory clean up on Dart every time a string/const char* is returned.

Appreciate any direction to accomplish something like below without needing to duplicate implementation across both languages.

// ScanningHelper.java
public class ScanningHelper {

   private String _mediaStorageDirectory;

   public void setMediaStorageDirectory(String path) { _mediaStorageDirectory = path; }
   public String getAppMediaStorageDirectory() { return _mediaStorageDirectory; }
   public double latitude;
   public double longitude;

   ...

   byte[] image1Bytes;

}

I have some standard methods defined like getStringFromObjectMethod which allows reuse across different classes and return types;

// JNIMethods.cpp
std::string mediaDirectory = JNIMethods::getStringFromObjectMethod(jniEnv,_scanningHelper,"getAppMediaStorageDirectory"));


问:
Can I use a cursor/pointer to navigate an n-ary linked tree with children of multiple types in Swift?
I'm working in Swift and I have the following code (bear with me):

class Node {
    var parent: Node? = nil
    var name: String = ""
    private var _size: Int = 0
    var size: Int { get { return _size } }
    init(name: String, size: Int = 0) {
        self.name = name
        self._size = size
    }
}

class Directory: Node {
    private var _children: [Node] = []
    var children: [Node] {
        get { return _children }
        set(children) {
            _children = children
            for child in _children {
                child.parent = self
            }
        }
    }
    override var size: Int {
        get { return children.map { $0.size }.reduce(0, +) }
    }

    func append(node: Node) {
        _children.append(node)
        node.parent = self
    }

    func remove(name: String) {
        if let i = _children.firstIndex(where: { $0.name == name }) {
            _children[i].parent = nil
            _children.remove(at: i)
        }
    }

    func remove(node: Node) {
        self.remove(name: node.name)
    }

    func findBy(name: String) -> Node? {
        if let i = _children.firstIndex(where: { $0.name == name }) {
            return _children[i]
        } else {
            return nil
        }
    }
}

class File: Node {}
```

So, that models a tree where Directory: Node contains an array of Nodes that can be Files or Directorys, which works just as expected when building it. Navigating it in a stateful way is a bit trickier.

Normally, in my previous C/C++ life, I'd have a Directory *pwd that I'd use to do stuff like pwd = (Directory *)pwd->findBy("myFancyName") which is not the prettiest solution but it works fine for my use case, and that would work if "myFancyName" is indeed a Directory, which I can pretty much guarantee based on my use case.

So I went on an made a var pwd: Directory? but that means I can't do pwd = pwd.findBy(name: "myFancyname") because that method returns a Node?. So I made pwd: Node? but that forces me to go around the place doing (pwd as! Directory) all the time I need to call a method from the Directory class, which kinda works but is a bit ugly.

Are there any better solutions?

Body:
I'm working in Swift and I have the following code (bear with me):

class Node {
    var parent: Node? = nil
    var name: String = ""
    private var _size: Int = 0
    var size: Int { get { return _size } }
    init(name: String, size: Int = 0) {
        self.name = name
        self._size = size
    }
}

class Directory: Node {
    private var _children: [Node] = []
    var children: [Node] {
        get { return _children }
        set(children) {
            _children = children
            for child in _children {
                child.parent = self
            }
        }
    }
    override var size: Int {
        get { return children.map { $0.size }.reduce(0, +) }
    }

    func append(node: Node) {
        _children.append(node)
        node.parent = self
    }

    func remove(name: String) {
        if let i = _children.firstIndex(where: { $0.name == name }) {
            _children[i].parent = nil
            _children.remove(at: i)
        }
    }

    func remove(node: Node) {
        self.remove(name: node.name)
    }

    func findBy(name: String) -> Node? {
        if let i = _children.firstIndex(where: { $0.name == name }) {
            return _children[i]
        } else {
            return nil
        }
    }
}

class File: Node {}

So, that models a tree where Directory: Node contains an array of Nodes that can be Files or Directorys, which works just as expected when building it. Navigating it in a stateful way is a bit trickier.

Normally, in my previous C/C++ life, I'd have a Directory *pwd that I'd use to do stuff like pwd = (Directory *)pwd->findBy("myFancyName") which is not the prettiest solution but it works fine for my use case, and that would work if "myFancyName" is indeed a Directory, which I can pretty much guarantee based on my use case.

So I went on an made a var pwd: Directory? but that means I can't do pwd = pwd.findBy(name: "myFancyname") because that method returns a Node?. So I made pwd: Node? but that forces me to go around the place doing (pwd as! Directory) all the time I need to call a method from the Directory class, which kinda works but is a bit ugly.

Are there any better solutions?


问:
Getting non-traceable NullPointerExceptions in an Apache Spark job
I'm running a Spark job on Databricks which issues a NullPointerException without traces of my job's code. Would anybody know what would be the best course of action when it comes to debugging these issue?

The job is a Scala job running on Databricks Runtime 11.3 LTS, Spark 3.3.0

In case it's related with the issue, the job targets both AWS S3 and AWS Redshift for I/O.

Here's one of the stack traces

```<code>    Job aborted due to stage failure: Task 267 in stage 30.0 failed 4 times, most recent failure: Lost task 267.3 in stage 30.0 (TID 6343) (10.218.226.53 executor 2): java.lang.NullPointerException
        at org.apache.spark.unsafe.map.BytesToBytesMap.safeLookup(BytesToBytesMap.java:534)
        at org.apache.spark.sql.execution.joins.UnsafeHashedRelation.get(HashedRelation.scala:231)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:761)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
        at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:195)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$3(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$1(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.scheduler.Task.doRunTask(Task.scala:169)
        at org.apache.spark.scheduler.Task.$anonfun$run$4(Task.scala:137)
        at com.databricks.unity.EmptyHandle$.runWithAndClose(UCSHandle.scala:104)
        at org.apache.spark.scheduler.Task.$anonfun$run$1(Task.scala:137)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.Task.run(Task.scala:96)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$13(Executor.scala:902)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1696)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:905)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:760)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

    Driver stacktrace:
    Caused by: NullPointerException:
    at org.apache.spark.unsafe.map.BytesToBytesMap.safeLookup(BytesToBytesMap.java:534)
        at org.apache.spark.sql.execution.joins.UnsafeHashedRelation.get(HashedRelation.scala:231)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:761)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
        at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:195)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$3(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$1(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.scheduler.Task.doRunTask(Task.scala:169)
        at org.apache.spark.scheduler.Task.$anonfun$run$4(Task.scala:137)
        at com.databricks.unity.EmptyHandle$.runWithAndClose(UCSHandle.scala:104)
        at org.apache.spark.scheduler.Task.$anonfun$run$1(Task.scala:137)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.Task.run(Task.scala:96)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$13(Executor.scala:902)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1696)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:905)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:760)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

    Driver stacktrace:
        at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:3312)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:3244)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:3235)
        at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
        at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
        at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:3235)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1(DAGScheduler.scala:1424)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1$adapted(DAGScheduler.scala:1424)
        at scala.Option.foreach(Option.scala:407)
        at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:1424)
        at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:3524)
        at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:3462)
        at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:3450)
        at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:51)
    Caused by: java.lang.NullPointerException
        at org.apache.spark.unsafe.map.BytesToBytesMap.safeLookup(BytesToBytesMap.java:534)
        at org.apache.spark.sql.execution.joins.UnsafeHashedRelation.get(HashedRelation.scala:231)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:761)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
        at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:195)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$3(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$1(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.scheduler.Task.doRunTask(Task.scala:169)
        at org.apache.spark.scheduler.Task.$anonfun$run$4(Task.scala:137)
        at com.databricks.unity.EmptyHandle$.runWithAndClose(UCSHandle.scala:104)
        at org.apache.spark.scheduler.Task.$anonfun$run$1(Task.scala:137)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.Task.run(Task.scala:96)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$13(Executor.scala:902)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1696)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:905)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:760)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
</code>```

Body:
I'm running a Spark job on Databricks which issues a NullPointerException without traces of my job's code. Would anybody know what would be the best course of action when it comes to debugging these issue?

The job is a Scala job running on Databricks Runtime 11.3 LTS, Spark 3.3.0

In case it's related with the issue, the job targets both AWS S3 and AWS Redshift for I/O.

Here's one of the stack traces

    Job aborted due to stage failure: Task 267 in stage 30.0 failed 4 times, most recent failure: Lost task 267.3 in stage 30.0 (TID 6343) (10.218.226.53 executor 2): java.lang.NullPointerException
        at org.apache.spark.unsafe.map.BytesToBytesMap.safeLookup(BytesToBytesMap.java:534)
        at org.apache.spark.sql.execution.joins.UnsafeHashedRelation.get(HashedRelation.scala:231)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:761)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
        at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:195)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$3(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$1(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.scheduler.Task.doRunTask(Task.scala:169)
        at org.apache.spark.scheduler.Task.$anonfun$run$4(Task.scala:137)
        at com.databricks.unity.EmptyHandle$.runWithAndClose(UCSHandle.scala:104)
        at org.apache.spark.scheduler.Task.$anonfun$run$1(Task.scala:137)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.Task.run(Task.scala:96)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$13(Executor.scala:902)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1696)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:905)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:760)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

    Driver stacktrace:
    Caused by: NullPointerException:
    at org.apache.spark.unsafe.map.BytesToBytesMap.safeLookup(BytesToBytesMap.java:534)
        at org.apache.spark.sql.execution.joins.UnsafeHashedRelation.get(HashedRelation.scala:231)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:761)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
        at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:195)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$3(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$1(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.scheduler.Task.doRunTask(Task.scala:169)
        at org.apache.spark.scheduler.Task.$anonfun$run$4(Task.scala:137)
        at com.databricks.unity.EmptyHandle$.runWithAndClose(UCSHandle.scala:104)
        at org.apache.spark.scheduler.Task.$anonfun$run$1(Task.scala:137)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.Task.run(Task.scala:96)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$13(Executor.scala:902)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1696)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:905)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:760)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

    Driver stacktrace:
        at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:3312)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:3244)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:3235)
        at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
        at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
        at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:3235)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1(DAGScheduler.scala:1424)
        at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1$adapted(DAGScheduler.scala:1424)
        at scala.Option.foreach(Option.scala:407)
        at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:1424)
        at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:3524)
        at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:3462)
        at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:3450)
        at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:51)
    Caused by: java.lang.NullPointerException
        at org.apache.spark.unsafe.map.BytesToBytesMap.safeLookup(BytesToBytesMap.java:534)
        at org.apache.spark.sql.execution.joins.UnsafeHashedRelation.get(HashedRelation.scala:231)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
        at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
        at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.hasNext(WholeStageCodegenExec.scala:761)
        at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
        at org.apache.spark.shuffle.sort.UnsafeShuffleWriter.write(UnsafeShuffleWriter.java:195)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$3(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.$anonfun$runTask$1(ShuffleMapTask.scala:81)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
        at org.apache.spark.scheduler.Task.doRunTask(Task.scala:169)
        at org.apache.spark.scheduler.Task.$anonfun$run$4(Task.scala:137)
        at com.databricks.unity.EmptyHandle$.runWithAndClose(UCSHandle.scala:104)
        at org.apache.spark.scheduler.Task.$anonfun$run$1(Task.scala:137)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.scheduler.Task.run(Task.scala:96)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$13(Executor.scala:902)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1696)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:905)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at com.databricks.spark.util.ExecutorFrameProfiler$.record(ExecutorFrameProfiler.scala:110)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:760)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)


问:
Unable to receive mail sent via sendgrid
I'm creating a  contact form using Nextjs and SendGrid, according to this header status

```<code>    202
  {
  server: 'nginx',
  date: 'Thu, 08 Dec 2022 16:29:25 GMT',
  'content-length': '0',
  connection: 'close',
  'x-message-id': 'CaVdpVAURza6JrUF7yIQQA',
  'access-control-allow-origin': 'https://sendgrid.api-docs.io',
  'access-control-allow-methods': 'POST',
  'access-control-allow-headers': 'Authorization, Content-Type, On-behalf-
   of, x-sg-elas-acl',
  'access-control-max-age': '600',
  'x-no-cors-reason':
  'https://sendgrid.com/docs/Classroom/Basics/API/cors.html',
  'strict-transport-security': 'max-age=600; includeSubDomains'
  }
</code>```

the email is sent but I find nothing in my inbox,

and this error occurs in the terminal

```<code>API resolved without sending a response for /api/contact, this may result in stalled requests.
</code>```

I don't know what mistake I've done but. I invite you to look at my code bellow:

API :

```<code>import sgMail from "@sendgrid/mail";

export default function handler(req, res) {

if (req.method !== "POST") {
    res.status(405).json({ message: "INVALID_METHOD" });
    return;
}

// Variables from the client side

var name = req.body.name;
var email= req.body.email;
var subject= req.body.subject;
var content = req.body.content;

// auto line break message
const message = content
    .replace(/\n/g, "<br>")
    .replace(/\r/g, "<br>")
    .replace(/\t/g, "<br>")
    .replace(/<(?!br\s*\/?)[^>]+>/g, "");

// giving the api key API
sgMail.setApiKey(process.env.KEY_SENDGRID);

// Creating message
const sendGridMail = {
    to: "arotiana4612@gmail.com",
    from: "kaspersky2mahanaima@gmail.com",
    subject: subject,
    templateId: "d-b48909edf062437e8442f861a4c8be29",
    dynamic_template_data: {
        name: name,
        email: email,
        subject: subject,
        content: message,
    },
};
// SENDING MESSAGE VIA SENDGRID
(async () => {
    try {

        await sgMail.send(sendGridMail)
                    .then((response) => {
                        console.log(response[0].statusCode)
                        console.log(response[0].headers)
                    })
                    .catch((error) => {
                        console.error(error)
                    })
    } catch (err){
        console.error(err);
        res.status(500).json({
            error:JSON.stringify(err),
            message: "ERROR_WITH_SENDGRID",
        });

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

}

And this is the method from the client side that from which I get the data:

```<code>  const onSubmit: SubmitHandler<Inputs> = async (formData) => {

 if (!isLoading) {
  setIsLoading(true);
  const response = await fetch("/api/contact", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(formData),
  });

  const result = await response.json();

  setIsLoading(false);
  if (!response.ok) {
    console.log("error sending email:",result);
  } else {
    console.log("ok");
  }
    return result;

}
</code>```

};

I want to receive the mail in my inbox.  Your help would be very appreciated,  I'm strugling

Body:
I'm creating a  contact form using Nextjs and SendGrid, according to this header status

    202
  {
  server: 'nginx',
  date: 'Thu, 08 Dec 2022 16:29:25 GMT',
  'content-length': '0',
  connection: 'close',
  'x-message-id': 'CaVdpVAURza6JrUF7yIQQA',
  'access-control-allow-origin': 'https://sendgrid.api-docs.io',
  'access-control-allow-methods': 'POST',
  'access-control-allow-headers': 'Authorization, Content-Type, On-behalf-
   of, x-sg-elas-acl',
  'access-control-max-age': '600',
  'x-no-cors-reason':
  'https://sendgrid.com/docs/Classroom/Basics/API/cors.html',
  'strict-transport-security': 'max-age=600; includeSubDomains'
  }

the email is sent but I find nothing in my inbox,

and this error occurs in the terminal

API resolved without sending a response for /api/contact, this may result in stalled requests.

I don't know what mistake I've done but. I invite you to look at my code bellow:

API :

import sgMail from "@sendgrid/mail";

export default function handler(req, res) {

if (req.method !== "POST") {
    res.status(405).json({ message: "INVALID_METHOD" });
    return;
}

// Variables from the client side

var name = req.body.name;
var email= req.body.email;
var subject= req.body.subject;
var content = req.body.content;

// auto line break message
const message = content
    .replace(/\n/g, "
")
    .replace(/\r/g, "
")
    .replace(/\t/g, "
")
    .replace(/<(?!br\s*\/?)[^>]+>/g, "");

// giving the api key API
sgMail.setApiKey(process.env.KEY_SENDGRID);

// Creating message
const sendGridMail = {
    to: "arotiana4612@gmail.com",
    from: "kaspersky2mahanaima@gmail.com",
    subject: subject,
    templateId: "d-b48909edf062437e8442f861a4c8be29",
    dynamic_template_data: {
        name: name,
        email: email,
        subject: subject,
        content: message,
    },
};
// SENDING MESSAGE VIA SENDGRID
(async () => {
    try {

        await sgMail.send(sendGridMail)
                    .then((response) => {
                        console.log(response[0].statusCode)
                        console.log(response[0].headers)
                    })
                    .catch((error) => {
                        console.error(error)
                    })
    } catch (err){
        console.error(err);
        res.status(500).json({
            error:JSON.stringify(err),
            message: "ERROR_WITH_SENDGRID",
        });

    }
})();

}

And this is the method from the client side that from which I get the data:

  const onSubmit: SubmitHandler<Inputs> = async (formData) => {

 if (!isLoading) {
  setIsLoading(true);
  const response = await fetch("/api/contact", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(formData),
  });

  const result = await response.json();

  setIsLoading(false);
  if (!response.ok) {
    console.log("error sending email:",result);
  } else {
    console.log("ok");
  }
    return result;

}

};

I want to receive the mail in my inbox.  Your help would be very appreciated,  I'm strugling


问:
Restored Project = broken dashboard
We had some projects deleted in Azure DevOps and we restored them, however all the widgets in the dashboard are broken.  Is there a way to recover them or do we have to rebuild?

The dashboard does report across 3 projects, all of which were deleted then restored.

I receive a message about a / in a project title, but the project title I see does not have a /.

I have searched the User Guide and cannot seem to find the answer on this or one that explains the error message.

enter image description here

@wadezhou  Cloud service. The error message says 'Widget error 400: The query configuration is invalid or number of work items returned exceeds the size limit.' (link above) I don't believe it is due to work items because I don't believe any work items have been added (these projects are just a proof of concept) and it was working before they were deleted. I have not tried to create a new widget - I will try that and see if it works and let you know. I'm not sure to tell if it's TFVC or git? It is Agile.

Here is a screenshot of the error where it mentions the / (when I go into the query):

error detailing /

When I try to create new widgets on the dashboard one works and one doesn't:

enter image description here

From what I can tell - it seems Git is the default type, and I have not changed it from whatever default would be.

Title: Restored Project = broken dashboard


问:
Create menu context with jquery or query selector
I want to create a menu context. But I am stuck while clicking and then hiding. I am using ul li for menu

I have used addeventlistner and mousedown function which hides menu. I have used a little bit this code.

```<code><div class="context">
  <ul>
    <li>add</li>
    <li>copy</li>
    <li>paste</li>
  </ul>
</div>
<script>
  var context = queryselector(".context")
  function showmenu(){
    document.addeventlistner("mousedown", onmousedown, false)
  }
  function mousedown(){
    menuhide()
    document.removeeventlistner("mousedown", onmousedown)
  }
</script>
</code>```

Body:
I want to create a menu context. But I am stuck while clicking and then hiding. I am using ul li for menu

I have used addeventlistner and mousedown function which hides menu. I have used a little bit this code.

add

copy

paste