问:
The problem with the size of stacked plots in matplotlib python
I am using python matplotlib to create a stacked plot that consists of two subplots one under another.
They must share the x-axis for convenient observation of a plot.

The code I have used first:

```<code># old code for plotting

fig = plt.figure()
gs = fig.add_gridspec(2, hspace=0, height_ratios=[1, 3])
axs = gs.subplots(sharex=True)

axs[0].plot(tr_df['tof'], tr_df['exp_trans'], label='signal')

axs[0].set_ylabel('Signal Amplitude', fontsize=10)
axs[0].set_title('Signal', fontsize=10)
axs[0].legend()
axs[0].grid()

cmap = plt.cm.seismic

im = axs[1].contourf(time_ar, frequencies, np.log2(pwr), contourlevels,  extend='both', cmap=cmap)

axs[1].set_xlabel('Time', fontsize=10)
axs[1].set_ylabel('Frequency', fontsize=10)

#plotting the positions of the peaks
for index, row in ladder_df.iterrows():
    axs[0].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)
    axs[1].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)

#plt.colorbar(im, ax=axs[1])
</code>```

The problem I have in this case - I use contourf and trying to provide a colormap to understand the difference between various power levels. And when I use it - the size of the second plot is changed and the x-axis between the two plots is shared but with different scale - see Fig. 2 for illustration.

How to solve this problem?

I have tried to use the ImageGrid approach (like Diziet Asahi provided here: colorbar changes the size of subplot in python)

But it doesn't work (really I don't get why).
# plotting the signal
fig = plt.figure(figsize=(8, 5))

```<code>grid = ImageGrid(fig, 211,
                nrows_ncols = (2,1),
                axes_pad = 0.05,
                cbar_location = "right",
                cbar_mode="single",
                cbar_size="5%",
                cbar_pad=0.05
                )

grid[0].plot(tr_df['tof'], tr_df['exp_trans'], label='signal')

grid[0].set_ylabel('Signal Amplitude', fontsize=10)
grid[0].set_title('Signal', fontsize=10)
grid[0].legend()
grid[0].grid()

imc = grid[1].contourf(time_ar, frequencies, np.log2(pwr), contourlevels,  extend='both', cmap=cmap)

grid[1].set_xlabel('Time', fontsize=10)
grid[1].set_ylabel('Frequency', fontsize=10)

#plotting the positions of the peaks
for index, row in ladder_df.iterrows():
    grid[0].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)
    grid[1].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)

plt.colorbar(imc, ax=grid[1])
</code>```

I have such an image as a result of this code:

Body:
I am using python matplotlib to create a stacked plot that consists of two subplots one under another.
They must share the x-axis for convenient observation of a plot.

The code I have used first:

# old code for plotting

fig = plt.figure()
gs = fig.add_gridspec(2, hspace=0, height_ratios=[1, 3])
axs = gs.subplots(sharex=True)

axs[0].plot(tr_df['tof'], tr_df['exp_trans'], label='signal')

axs[0].set_ylabel('Signal Amplitude', fontsize=10)
axs[0].set_title('Signal', fontsize=10)
axs[0].legend()
axs[0].grid()

cmap = plt.cm.seismic

im = axs[1].contourf(time_ar, frequencies, np.log2(pwr), contourlevels,  extend='both', cmap=cmap)

axs[1].set_xlabel('Time', fontsize=10)
axs[1].set_ylabel('Frequency', fontsize=10)

#plotting the positions of the peaks
for index, row in ladder_df.iterrows():
    axs[0].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)
    axs[1].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)

#plt.colorbar(im, ax=axs[1])

The problem I have in this case - I use contourf and trying to provide a colormap to understand the difference between various power levels. And when I use it - the size of the second plot is changed and the x-axis between the two plots is shared but with different scale - see Fig. 2 for illustration.

How to solve this problem?

I have tried to use the ImageGrid approach (like Diziet Asahi provided here: colorbar changes the size of subplot in python)

But it doesn't work (really I don't get why).
# plotting the signal
fig = plt.figure(figsize=(8, 5))

grid = ImageGrid(fig, 211,
                nrows_ncols = (2,1),
                axes_pad = 0.05,
                cbar_location = "right",
                cbar_mode="single",
                cbar_size="5%",
                cbar_pad=0.05
                )

grid[0].plot(tr_df['tof'], tr_df['exp_trans'], label='signal')

grid[0].set_ylabel('Signal Amplitude', fontsize=10)
grid[0].set_title('Signal', fontsize=10)
grid[0].legend()
grid[0].grid()

imc = grid[1].contourf(time_ar, frequencies, np.log2(pwr), contourlevels,  extend='both', cmap=cmap)

grid[1].set_xlabel('Time', fontsize=10)
grid[1].set_ylabel('Frequency', fontsize=10)

#plotting the positions of the peaks
for index, row in ladder_df.iterrows():
    grid[0].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)
    grid[1].axvline(x = row['tof'], color = 'r', linestyle = 'dashed', linewidth = 1.0, alpha=0.5)

plt.colorbar(imc, ax=grid[1])

I have such an image as a result of this code:


来源: stackexchange

问:
How to remove duplicate values and keys in list of nested dictionary in python?
I have a list of nested dictionaries like below:

```<code>data = [
   {
      "energy storage":[
         "pmvalidation9998+peter@gmail.com",
         "pmvalidation9998+pal@gmail.com"
      ]
   },
   {
      "energy storage":[
         "pmvalidation9998+pal@gmail.com",
         "pmvalidation9998+peter@gmail.com"
      ]
   },
   {
      "energy storage":[
         "pmvalidation9998+people@gmail.com",
         "neeta399@gmail.com"
      ]
   },
   {
      "sustainability":[

      ]
   }
  ]
</code>```

I want to remove duplicate keys and also duplicate values(if more values they should be in a list) like the one below.

```<code>**Expected O/P:**

 [
   {"energy storage":[
      "pmvalidation9998+peter@gmail.com", "pmvalidation9998+pal@gmail.com",
       "pmvalidation9998+people@gmail.com", "neeta399@gmail.com"]
   },
   {"sustainability":[]}
]
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a list of nested dictionaries like below:

data = [
   {
      "energy storage":[
         "pmvalidation9998+peter@gmail.com",
         "pmvalidation9998+pal@gmail.com"
      ]
   },
   {
      "energy storage":[
         "pmvalidation9998+pal@gmail.com",
         "pmvalidation9998+peter@gmail.com"
      ]
   },
   {
      "energy storage":[
         "pmvalidation9998+people@gmail.com",
         "neeta399@gmail.com"
      ]
   },
   {
      "sustainability":[

      ]
   }
  ]

I want to remove duplicate keys and also duplicate values(if more values they should be in a list) like the one below.

**Expected O/P:**

 [
   {"energy storage":[
      "pmvalidation9998+peter@gmail.com", "pmvalidation9998+pal@gmail.com",
       "pmvalidation9998+people@gmail.com", "neeta399@gmail.com"]
   },
   {"sustainability":[]}
]


问:
Save image and drawn shapes in picturebox
I have a picturebox in my form and draw shapes in picturebox by MouseDown and MouseUp events. Finally, I must save image of picturebox with drawn shapes in TIFF File. I use this code:

```<code>Dim bitmap = New Bitmap(PictureBox1.Width, PictureBox1.Height)
PictureBox1.DrawToBitmap(bitmap, PictureBox1.ClientRectangle)
Dim PATH = Application.StartupPath & "\TIFF\" & My.Settings.PATH & ".TIFF"
bitmap.Save(PATH, System.Drawing.Imaging.ImageFormat.Tiff)
</code>```

But the clarity and quality of the TIF image is much lower than the original image. I will link a part of the original image and the resulting TIFF for Comparison.

All of my codes:

```<code>Public Class Form5
    Private firstPage As Image
    Private bmp As Bitmap
    Private NewSegment As Segment
    Private Segments As New List(Of Segment)
    Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseDown
        NewSegment = New Segment(e.Location, e.Location)
        Segments.Add(NewSegment)
        PictureBox1.Invalidate()
    End Sub

    Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove
        If NewSegment Is Nothing Then Return
        NewSegment.Point2 = e.Location
    End Sub

    Private Sub PictureBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseUp
        NewSegment = Nothing
        PictureBox1.Invalidate()
    End Sub

    Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
        Dim g = System.Drawing.Graphics.FromImage(PictureBox1.Image)
        g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
        For Each segment As Segment In Segments
            segment.Draw(g, Nothing)
        Next
    End Sub

    Private Sub Form4_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        PictureBox1.Load("path and filename")
        bmp = New Bitmap(PictureBox1.Width, PictureBox1.Height)

        Using GR = System.Drawing.Graphics.FromImage(bmp)
            GR.SmoothingMode = SmoothingMode.HighQuality
            GR.InterpolationMode = InterpolationMode.HighQualityBicubic
            GR.PixelOffsetMode = PixelOffsetMode.HighQuality
            GR.DrawImage(PictureBox1.Image, New Rectangle(0, 0, PictureBox1.Width, PictureBox1.Height))
        End Using
        Panel1.Controls.Add(PictureBox1)
    End Sub

    Private Sub save_Click(sender As Object, e As EventArgs) Handles save.Click
        PictureBox1.Image.Save(Path, Imaging.ImageFormat.Tiff)
    End Sub

    Private Sub zoom_in_Click(sender As Object, e As EventArgs) Handles zoom_in.Click
        PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * 50 / 1000)
        PictureBox1.Height += Convert.ToInt32(PictureBox1.Height * 50 / 1000)
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    End Sub

    Private Sub zoom_out_Click(sender As Object, e As EventArgs) Handles zoom_out.Click
        PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * -50 / 1000)
        PictureBox1.Height += Convert.ToInt32(PictureBox1.Height * -50 / 1000)
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    End Sub

End Class

Class Segment

    Private Const RADIUS As Integer = 15
    Private Shared rc_r As New Rectangle(New Point(-RADIUS, -RADIUS), New Size(RADIUS * 1.5, RADIUS * 1.5)) 'for rectangle
    Private pt1, pt2 As Point
    Private angle As Double = 0
    Private length As Double = 0
    Private Shared pen1 As New Pen(Color.Black, 1.5)
    Private Shared drawFontF As New Font("times new roman", 8, style:=FontStyle.Bold)
    Private Shared SF As StringFormat
    Public Sub New(startPoint As Point, endPoint As Point)
        Point1 = startPoint
        Point2 = endPoint
    End Sub

    Public Property Point1 As Point
        Get
            Return pt1
        End Get
        Set(value As Point)
            pt1 = value
            UpdateAngleAndLength()
        End Set
    End Property

    Public Property Point2 As Point
        Get
            Return pt2
        End Get
        Set(value As Point)
            pt2 = value
            UpdateAngleAndLength()
        End Set
    End Property

    Private Sub UpdateAngleAndLength()
        angle = Math.Atan2(Point2.Y - Point1.Y, Point2.X - Point1.X) * 180.0 / Math.PI
        length = Math.Sqrt(Math.Pow(Point2.X - Point1.X, 2) + Math.Pow(Point2.Y - Point1.Y, 2))
    End Sub
    Public Sub Draw(gr As System.Drawing.Graphics, R As Rectangle)

        If Point1 = Point2 Then Return
        ' save the current state of the graphics
        Dim curState As GraphicsState = gr.Save()

        ' move the origin to the start point of the line
        gr.TranslateTransform(Point1.X, Point1.Y)
        ' rotate the whole surface
        gr.RotateTransform(angle)

        ' draw the line on the x-axis
        gr.DrawLine(pen1, 0, 0, CInt(length), 0)

        gr.Restore(curState)
    End Sub
End Class
</code>```

Body:
I have a picturebox in my form and draw shapes in picturebox by MouseDown and MouseUp events. Finally, I must save image of picturebox with drawn shapes in TIFF File. I use this code:

Dim bitmap = New Bitmap(PictureBox1.Width, PictureBox1.Height)
PictureBox1.DrawToBitmap(bitmap, PictureBox1.ClientRectangle)
Dim PATH = Application.StartupPath & "\TIFF\" & My.Settings.PATH & ".TIFF"
bitmap.Save(PATH, System.Drawing.Imaging.ImageFormat.Tiff)

But the clarity and quality of the TIF image is much lower than the original image. I will link a part of the original image and the resulting TIFF for Comparison.

All of my codes:

Public Class Form5
    Private firstPage As Image
    Private bmp As Bitmap
    Private NewSegment As Segment
    Private Segments As New List(Of Segment)
    Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseDown
        NewSegment = New Segment(e.Location, e.Location)
        Segments.Add(NewSegment)
        PictureBox1.Invalidate()
    End Sub

    Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove
        If NewSegment Is Nothing Then Return
        NewSegment.Point2 = e.Location
    End Sub

    Private Sub PictureBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseUp
        NewSegment = Nothing
        PictureBox1.Invalidate()
    End Sub

    Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
        Dim g = System.Drawing.Graphics.FromImage(PictureBox1.Image)
        g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
        For Each segment As Segment In Segments
            segment.Draw(g, Nothing)
        Next
    End Sub

    Private Sub Form4_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        PictureBox1.Load("path and filename")
        bmp = New Bitmap(PictureBox1.Width, PictureBox1.Height)

        Using GR = System.Drawing.Graphics.FromImage(bmp)
            GR.SmoothingMode = SmoothingMode.HighQuality
            GR.InterpolationMode = InterpolationMode.HighQualityBicubic
            GR.PixelOffsetMode = PixelOffsetMode.HighQuality
            GR.DrawImage(PictureBox1.Image, New Rectangle(0, 0, PictureBox1.Width, PictureBox1.Height))
        End Using
        Panel1.Controls.Add(PictureBox1)
    End Sub

    Private Sub save_Click(sender As Object, e As EventArgs) Handles save.Click
        PictureBox1.Image.Save(Path, Imaging.ImageFormat.Tiff)
    End Sub

    Private Sub zoom_in_Click(sender As Object, e As EventArgs) Handles zoom_in.Click
        PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * 50 / 1000)
        PictureBox1.Height += Convert.ToInt32(PictureBox1.Height * 50 / 1000)
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    End Sub

    Private Sub zoom_out_Click(sender As Object, e As EventArgs) Handles zoom_out.Click
        PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * -50 / 1000)
        PictureBox1.Height += Convert.ToInt32(PictureBox1.Height * -50 / 1000)
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    End Sub

End Class

Class Segment

    Private Const RADIUS As Integer = 15
    Private Shared rc_r As New Rectangle(New Point(-RADIUS, -RADIUS), New Size(RADIUS * 1.5, RADIUS * 1.5)) 'for rectangle
    Private pt1, pt2 As Point
    Private angle As Double = 0
    Private length As Double = 0
    Private Shared pen1 As New Pen(Color.Black, 1.5)
    Private Shared drawFontF As New Font("times new roman", 8, style:=FontStyle.Bold)
    Private Shared SF As StringFormat
    Public Sub New(startPoint As Point, endPoint As Point)
        Point1 = startPoint
        Point2 = endPoint
    End Sub

    Public Property Point1 As Point
        Get
            Return pt1
        End Get
        Set(value As Point)
            pt1 = value
            UpdateAngleAndLength()
        End Set
    End Property

    Public Property Point2 As Point
        Get
            Return pt2
        End Get
        Set(value As Point)
            pt2 = value
            UpdateAngleAndLength()
        End Set
    End Property

    Private Sub UpdateAngleAndLength()
        angle = Math.Atan2(Point2.Y - Point1.Y, Point2.X - Point1.X) * 180.0 / Math.PI
        length = Math.Sqrt(Math.Pow(Point2.X - Point1.X, 2) + Math.Pow(Point2.Y - Point1.Y, 2))
    End Sub
    Public Sub Draw(gr As System.Drawing.Graphics, R As Rectangle)

        If Point1 = Point2 Then Return
        ' save the current state of the graphics
        Dim curState As GraphicsState = gr.Save()

        ' move the origin to the start point of the line
        gr.TranslateTransform(Point1.X, Point1.Y)
        ' rotate the whole surface
        gr.RotateTransform(angle)

        ' draw the line on the x-axis
        gr.DrawLine(pen1, 0, 0, CInt(length), 0)

        gr.Restore(curState)
    End Sub
End Class


问:
Dag is not getting executed when using Dynamic Task Mapping within TaskGroups
Problem Statement Dag is not getting executed when using Dynamic Task Mapping within TaskGroups.

Use Case We have 1000 tables which are to be deleted after pipeline ends.
Each of these tables belongs to a particular group.
So we need to create a taskgroup for each of that group and then create dynamic tasks for the set of tables

Solution  Firstly I am getting the list of groups and then extracts the list of tables belonging to a particular group. Then I pass this list of tables to the operator BigQueryDeleteTableOperator using expand() function of  Dynamic Task Mapping

The Taskgroup is created at group level.

The below should give you an idea of what I have tried.

```<code>
def delete_unwanted_tables(<params>):

    ## Below function will return the list of groups
    comm_tables_list, running_config = community_tables_list(<some param>)

    ## This function loops over each group and return the list of tables belonging to a particular group.
    for group in comm_tables_list:
        list_of_tbls_delete = process_tables(grp=group)

        del_tbl_task_bq = BigQueryDeleteTableOperator.partial(
            task_id=f"""delete_tabls_{group}""",
            ignore_if_missing=True).expand(deletion_dataset_table=list_of_tbls_delete)
        del_tbl_task_bq

with dag:

    with TaskGroup("taskgroup", tooltip="taskgroup") as tg_tables_bq:
        delete_unwanted_tables(<params>)

    DummyOperator(task_id='start_dag') >> tg_tables_bq

</code>```

Image:

Note Similarly we have some 20 taskgroup and each of these taskgroups have 100's of tables.

When I try to load the graph view it takes 10-15 mins to load and sometimes even more than that.

Also, the task goes into None status.

Please let me know if this is the right way or I can optimize it and write a better code.

Body:
Problem Statement Dag is not getting executed when using Dynamic Task Mapping within TaskGroups.

Use Case We have 1000 tables which are to be deleted after pipeline ends.
Each of these tables belongs to a particular group.
So we need to create a taskgroup for each of that group and then create dynamic tasks for the set of tables

Solution  Firstly I am getting the list of groups and then extracts the list of tables belonging to a particular group. Then I pass this list of tables to the operator BigQueryDeleteTableOperator using expand() function of  Dynamic Task Mapping

The Taskgroup is created at group level.

The below should give you an idea of what I have tried.

def delete_unwanted_tables(<params>):

    ## Below function will return the list of groups
    comm_tables_list, running_config = community_tables_list(<some param>)

    ## This function loops over each group and return the list of tables belonging to a particular group.
    for group in comm_tables_list:
        list_of_tbls_delete = process_tables(grp=group)

        del_tbl_task_bq = BigQueryDeleteTableOperator.partial(
            task_id=f"""delete_tabls_{group}""",
            ignore_if_missing=True).expand(deletion_dataset_table=list_of_tbls_delete)
        del_tbl_task_bq

with dag:

    with TaskGroup("taskgroup", tooltip="taskgroup") as tg_tables_bq:
        delete_unwanted_tables(<params>)

    DummyOperator(task_id='start_dag') >> tg_tables_bq

Image:

Note Similarly we have some 20 taskgroup and each of these taskgroups have 100's of tables.

When I try to load the graph view it takes 10-15 mins to load and sometimes even more than that.

Also, the task goes into None status.

Please let me know if this is the right way or I can optimize it and write a better code.


问:
merge sort (only odd elements), how to realize this solution
Wrote the usual sorting, tried through a series of if , but nothing happened.```
I want to sort by this sorting only odd elements, and leave even ones in their places</p>
<p>`</p>
```    void mergeSort(std::vector<int>&vector1, int low, int high)
    {
        if (low < high)
        {
            int mid = (low + high) / 2;
            mergeSort(vector1, low, mid);
            mergeSort(vector1, mid+1, high);
            merge(vector1, low, high, mid);
        }
    }

    void merge(std::vector<int>&vector1, int low, int high, int mid)
    {
        int i = low;
        int k = low;
        int j = mid+1;
        std::vector<int>vectordop(high+1, 0);

        while(i <= mid && j <= high)
        {
            {
                if (vector1[i] < vector1[j])
                vectordop[k++] = vector1[i++];
            else
                vectordop[k++] = vector1[j++];
            }
        }
        while (i <= mid)
            vectordop[k++] = vector1[i++];
        while (j <= high)
            vectordop[k++] = vector1[j++];
        for (int i = low; i < k; i++)
            vector1[i] = vectordop[i];
    }
```

`

Wrote the usual sorting, tried through a series of if and else , but nothing happened.

Body:
Wrote the usual sorting, tried through a series of if , but nothing happened.```
I want to sort by this sorting only odd elements, and leave even ones in their places

`

    void mergeSort(std::vector<int>&vector1, int low, int high)
    {
        if (low < high)
        {
            int mid = (low + high) / 2;
            mergeSort(vector1, low, mid);
            mergeSort(vector1, mid+1, high);
            merge(vector1, low, high, mid);
        }
    }

    void merge(std::vector<int>&vector1, int low, int high, int mid)
    {
        int i = low;
        int k = low;
        int j = mid+1;
        std::vector<int>vectordop(high+1, 0);

        while(i <= mid && j <= high)
        {
            {
                if (vector1[i] < vector1[j])
                vectordop[k++] = vector1[i++];
            else
                vectordop[k++] = vector1[j++];
            }
        }
        while (i <= mid)
            vectordop[k++] = vector1[i++];
        while (j <= high)
            vectordop[k++] = vector1[j++];
        for (int i = low; i < k; i++)
            vector1[i] = vectordop[i];
    }

`

Wrote the usual sorting, tried through a series of if and else , but nothing happened.


问:
Implementing a neural network *discontinuous layer* using `torch`
Using torch, I’m trying to implement the following discontinuous layer proposed by a recent interesting paper, and I’m wondering whether I’m doing it correctly.

```<code>class DiscontLayer(nn.Module):

    def __init__(self, input_dim, output_dim):

        super().__init__()

        self.linear = nn.Linear(input_dim, output_dim)
        self.epsilon = nn.Parameter(torch.randn(output_dim))

    def forward(self, x):

        cont_part = nn.ReLU()(self.linear(x))

        discont_part = self.epsilon * torch.heaviside(self.linear(x),torch.ones_like(self.linear(x)))

        return cont_part + discont_part
</code>```

Trying to run it, I encountered an error due to backpropagating through the Heaviside activation function. The derivative of this function is should be 0 everywhere, except at the discontinuity, but this seems not being implemented. Then I found this post, suggesting to protect the torch.heaviside call with torch.no_grad(). So I tried in the following way:

```<code>class DiscontLayer(nn.Module):

    def __init__(self, input_dim, output_dim):

        super().__init__()

        self.linear = nn.Linear(input_dim, output_dim)
        self.epsilon = nn.Parameter(torch.randn(output_dim))

    def forward(self, x):

        cont_part = nn.ReLU()(self.linear(x))

        discont_part = self.linear(x)

        with torch.no_grad():

            discont_part = torch.heaviside(discont_part,torch.ones_like(discont_part))

        discont_part = self.epsilon * discont_part

        return cont_part + discont_part
</code>```

But I’m not yet sure that I have done that correctly.

Body:
Using torch, I’m trying to implement the following discontinuous layer proposed by a recent interesting paper, and I’m wondering whether I’m doing it correctly.

class DiscontLayer(nn.Module):

    def __init__(self, input_dim, output_dim):

        super().__init__()

        self.linear = nn.Linear(input_dim, output_dim)
        self.epsilon = nn.Parameter(torch.randn(output_dim))

    def forward(self, x):

        cont_part = nn.ReLU()(self.linear(x))

        discont_part = self.epsilon * torch.heaviside(self.linear(x),torch.ones_like(self.linear(x)))

        return cont_part + discont_part

Trying to run it, I encountered an error due to backpropagating through the Heaviside activation function. The derivative of this function is should be 0 everywhere, except at the discontinuity, but this seems not being implemented. Then I found this post, suggesting to protect the torch.heaviside call with torch.no_grad(). So I tried in the following way:

class DiscontLayer(nn.Module):

    def __init__(self, input_dim, output_dim):

        super().__init__()

        self.linear = nn.Linear(input_dim, output_dim)
        self.epsilon = nn.Parameter(torch.randn(output_dim))

    def forward(self, x):

        cont_part = nn.ReLU()(self.linear(x))

        discont_part = self.linear(x)

        with torch.no_grad():

            discont_part = torch.heaviside(discont_part,torch.ones_like(discont_part))

        discont_part = self.epsilon * discont_part

        return cont_part + discont_part

But I’m not yet sure that I have done that correctly.


问:
Next.js Static Html Export: Asset paths not working (CSS, custom fonts, images)
I created a Next.js project using next build && next export. When i open the index.html file from the 'out' folder in a browser, assets were not loaded. Not css, images and custom fonts. Because of wrong asset paths.

The exported paths are for example: /vercel.svg but should be ./vercel.svg to load properly. The problem is that the latter path gives an error on npm run dev, so can't be changed in the repo. What is the recommended way to use next export which leads to correct asset paths? The Static HTML Export documentation does not mention any requirements for configuration.

I already found out that adding assetPrefix: './' or assetPrefix: '.' to next.config.js makes CSS load correctly. But not custom fonts and images. But is that the recommended way to solve the problem partly? What approach should be used to solve the custom font and image paths?

I am aware of another workaround which works good for images: Changing paths by environment variable: process.env.NODE_ENV === 'development' ? '/vercel.svg' : './vercel.svg'

But I was still unable to find a solution for custom fonts. There are some discussions about this topic out there, but I couldn't find a satisfying answer.

Any recommendations?

Here is an example to work with:
https://github.com/aaRitsch/next-build-static-asset-path


问:
multiprocessing.Pool for multi-threading in Python don't run multiple cores
In a cluster with 96 cores, I need to run a python function, that I called readInfo(filename)  which read information from files. I have 90 files to read (each one requires 15 minutes to be read) and I used multiprocessing.Pool(processes=90) to parallelize the process on multiple threads. When I check from terminal with htop, I see only few cores running instead of 90. Why?


问:
How to remove berocket from url /shop/?filters=berocket_brand[arnold-son] in woocommerce
i want to remove berocket from url. I have tried a lot but i didn`t find any solution
currently my url is ?filters=berocket_brand[rolex]
and i want ?filters=brand[rolex]

i have tried with be rocket permalink manager but not find any solution


问:
Need to install node everytime after login in NGINX server
I am facing this issue again and again, when i use ssh root@____________ after that i run npm or any other node command it shows

node: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by node)`

i have to install node using nvm and then run it, the error goes.... but after that i have to install pm2 package again that causes my website backend to stop every time when VPS reboot by my hosting provider. front end works well but backend stops because node is not available and in reults pm2 also stops

i have tried to install it globally but failed i have also added node version in package.json file but still it shows error


问:
Linking one value of a in ipywidgets.FloatRangeSlider to a FloatText widget
In JupyterLab, using the IPyWidgets module, I am trying to link the lower value of a FloatRangeSlider to the value of a FloatText.

I tried this code:

```<code>from ipywidgets import link, FloatRangeSlider, FloatText
# Create the widgets
slider = FloatRangeSlider(min=0.0, max=100.0, value=(25.0, 75.0))
text = FloatText(value=slider.value[0])

# Link the value of the slider to the floattext box
link((text, 'value'),(slider, 'value'))

# Display the widgets
display(slider, text)
</code>```

but of course, FloatRangeSlider.value is a tuple containing 2 floats, while FloatText.value is a float.
'TraitError: The 'value' trait of a FloatRangeSlider instance expected a tuple, not the float 25.0.'

Using the transform argument:
link((text, 'value'),(slider, 'value'),transform=lambda x: x[0])
Also fails since the link is bidirectional (it works with a uni-directional dlink).
'TypeError: cannot unpack non-iterable function object'

How to do this? Thanks!

Body:
In JupyterLab, using the IPyWidgets module, I am trying to link the lower value of a FloatRangeSlider to the value of a FloatText.

I tried this code:

from ipywidgets import link, FloatRangeSlider, FloatText
# Create the widgets
slider = FloatRangeSlider(min=0.0, max=100.0, value=(25.0, 75.0))
text = FloatText(value=slider.value[0])

# Link the value of the slider to the floattext box
link((text, 'value'),(slider, 'value'))

# Display the widgets
display(slider, text)

but of course, FloatRangeSlider.value is a tuple containing 2 floats, while FloatText.value is a float.
'TraitError: The 'value' trait of a FloatRangeSlider instance expected a tuple, not the float 25.0.'

Using the transform argument:
link((text, 'value'),(slider, 'value'),transform=lambda x: x[0])
Also fails since the link is bidirectional (it works with a uni-directional dlink).
'TypeError: cannot unpack non-iterable function object'

How to do this? Thanks!


问:
How do I extract a binary pattern from a 1D signal?
I need help for my school project. I am taking pictures from a webcam and sampling the center of the picture to get a binary reading (0/1).

The signal looks like this:

000011111000000000000000011111000000111110000011111111110000000000011111111111111110000011111111110000000000011111000001111

I need this bit string that matches the sampled data:

010001010110011101100101

How do I sample the signal to get the bit string?

Plotting code:

```<code>fig, ax = plt.subplots(2, 1, sharex=True)
fig.set_size_inches(20, 10)
ax[0].step(np.arange(len(samples)), samples, 'o-', where='post')
ax[1].step(np.arange(len(desired)) * 5.2, desired, 'o-', where='post')
plt.show()
</code>```

Code that reads from a video camera and produces the 1D signal:

```<code>import cv2

cap = cv2.VideoCapture("test3.mp4")

binaries = []

def colorRecognizer():
    _, frame = cap.read()
    hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

    height, width, _ = frame.shape

    cx = int(width / 2)
    cy = int(height / 2)

    video_center = hsv_frame[cy, cx]
    hsv_value = video_center[2]

    cv2.circle(frame, (cx, cy), 20, (0, 242, 40), 6)
    cv2.imshow("Black/White recognition", frame)

    if hsv_value <= 10:
        color = "black"
        binaries.append(1)
    elif hsv_value >= 100:
        color = "white"
        binaries.append(0)
    else:
        color = "Undefined color"

while cap.isOpened():
    colorRecognizer()
    print(''.join(map(str,binaries)))

    key = cv2.waitKey(1)
    if key == 27:
        break

cap.release()
cv2.destroyAllWindows()
</code>```

Body:
I need help for my school project. I am taking pictures from a webcam and sampling the center of the picture to get a binary reading (0/1).

The signal looks like this:

000011111000000000000000011111000000111110000011111111110000000000011111111111111110000011111111110000000000011111000001111

I need this bit string that matches the sampled data:

010001010110011101100101

How do I sample the signal to get the bit string?

Plotting code:

fig, ax = plt.subplots(2, 1, sharex=True)
fig.set_size_inches(20, 10)
ax[0].step(np.arange(len(samples)), samples, 'o-', where='post')
ax[1].step(np.arange(len(desired)) * 5.2, desired, 'o-', where='post')
plt.show()

Code that reads from a video camera and produces the 1D signal:

import cv2

cap = cv2.VideoCapture("test3.mp4")

binaries = []

def colorRecognizer():
    _, frame = cap.read()
    hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

    height, width, _ = frame.shape

    cx = int(width / 2)
    cy = int(height / 2)

    video_center = hsv_frame[cy, cx]
    hsv_value = video_center[2]

    cv2.circle(frame, (cx, cy), 20, (0, 242, 40), 6)
    cv2.imshow("Black/White recognition", frame)

    if hsv_value <= 10:
        color = "black"
        binaries.append(1)
    elif hsv_value >= 100:
        color = "white"
        binaries.append(0)
    else:
        color = "Undefined color"

while cap.isOpened():
    colorRecognizer()
    print(''.join(map(str,binaries)))

    key = cv2.waitKey(1)
    if key == 27:
        break

cap.release()
cv2.destroyAllWindows()


问:
Refresh Android Emulator Camera
I am changing the default poster image in the emulator's virtual scene, but if I want the camera to refresh to the new image I have to close and open the camera app (if it is already open)

But in Android Studio there is an option to set the emulator's poster image and when you do it the camera updates immediately without reopening the camera app.
What can I do to update the camera immediately when I manually change the default image without the help of android studio?
Maybe using ADB?

Right now, I couldn't find a way to update the camera without reopening it when I am changing the default poster image.

Title: Refresh Android Emulator Camera


问:
How to force Android Chrome to load .js scripts
I have a website where a few .js scripts are extracted into the separate .js files.
It works perfectly on Windows Chrome, but doesn't load the .js file on my phone (using Chrome too).

Remote Debug (Android studio + laptop chrome://inspect/#devices) displays me a screen with an attempt to load Common.js, and missing FocusNextButtonOnPageLoad(), which is located exactly in the Common.js.

I'm trying to load Common.js with a code
The Common.js file exists in the Sources tab.
VM is android-25 x86 phone, Android 7.1.1.

How to load Common.js script on the mobile Chrome?


问:
Intellisense not working in Power Query for Excel
In Power Query for Excel, Intellisense does not work for me in any of the places where it should (Advanced Editor, Formula Bar, Add custom column dialog).

It was properly selected in Query Options:

This is a new computer with fresh installs of Windows 11 Professional 64 bit and Microsoft Office 365 64 bit.

I have Microsoft 365 Excel Version 2211 (Build 15831.20190 Click-to-Run) Current Channel (64 bit) running on Windows 11.

I have done an "online repair" of my Microsoft 365 installation.

I have no idea if this is relevant, but intellisense does work as expected in the PQ Editor in Power BI Desktop, just not in the PQ Editor in Excel.

edit: It seems this is workbook specific, as it does not occur in other workbooks than the one with the problem. But what could be causing it?


问:
how can I use the downloaded font package?
I have downloaded this otf file to my ./fonts folder.
I presume it is linked correctly as linter does not give any message.
However I cannot change the font family to the desired one.

```<code>@font-face {
  font-family: 'Fontin';
  src: url(@/fonts/Fontin-Regular.otf) format('font-opentype');
  font-weight: normal;
  font-style: normal;
}

h1 {
  font-family: Fontin;
}
</code>```

I cannot change the font type.

Body:
I have downloaded this otf file to my ./fonts folder.
I presume it is linked correctly as linter does not give any message.
However I cannot change the font family to the desired one.

@font-face {
  font-family: 'Fontin';
  src: url(@/fonts/Fontin-Regular.otf) format('font-opentype');
  font-weight: normal;
  font-style: normal;
}

h1 {
  font-family: Fontin;
}

I cannot change the font type.


问:
Giraph SimpleShortestPathComputation examples FAILED
I have installed and deployed giraph-1.4.0 using the Hadoop yarn profile with the following command

```<code>mvn -Phadoop_yarn -Dhadoop.version=2.7.0 -DskipTests package
</code>```

I tried running the SimpleShortestPathsComputation example

```<code>$HADOOP_HOME/bin/hadoop jar $GIRAPH_HOME/giraph-examples/target/giraph-examples-1.4.0-SNAPSHOT-for-hadoop-2.7.0-jar-with-dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleShortestPathsComputation -vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip /user/hduser/input/tiny_graph.txt -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/output/shortestpaths -w 1 -ca giraph.SplitMasterWorker=false,giraph.logLevel=debug
</code>```

My application completed with status

```<code>22/12/11 19:27:26 INFO yarn.GiraphYarnClient: Completed Giraph: org.apache.giraph.examples.SimpleShortestPathsComputation: FAILED, total running time: 10 minutes, 27 seconds.
</code>```

The error in the logs

```<code>22/12/11 19:05:54 INFO master.BspServiceMaster: setJobState: {"_applicationAttemptKey":-1,"_stateKey":"FAILED","_superstepKey":-1}
22/12/11 19:05:54 FATAL master.BspServiceMaster: failJob: Killing job giraph_yarn_application_1670740884304_0004
22/12/11 19:05:54 FATAL master.BspServiceMaster: failJob: exception java.lang.IllegalStateException: ******* WORKERS [Worker(hostname=lap13162 hostOrIp=lap13162, MRtaskID=1, port=30001)] FAILED *******
22/12/11 19:05:54 ERROR master.MasterThread: masterThread: Master algorithm failed with RuntimeException
java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run.
    at org.apache.giraph.master.BspServiceMaster.failJob(BspServiceMaster.java:376)
    at org.apache.giraph.master.BspServiceMaster.setJobStateFailed(BspServiceMaster.java:323)
    at org.apache.giraph.master.BspServiceMaster.barrierOnWorkerList(BspServiceMaster.java:1427)
    at org.apache.giraph.master.BspServiceMaster.coordinateSuperstep(BspServiceMaster.java:1661)
    at org.apache.giraph.master.MasterThread.run(MasterThread.java:131)
Caused by: java.lang.IllegalStateException: ******* WORKERS [Worker(hostname=lap13162 hostOrIp=lap13162, MRtaskID=1, port=30001)] FAILED *******
    ... 4 more
22/12/11 19:05:54 FATAL graph.GraphTaskManager: uncaughtException: OverrideExceptionHandler on thread org.apache.giraph.master.MasterThread, msg = java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run., exiting...
java.lang.IllegalStateException: java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run.
    at org.apache.giraph.master.MasterThread.run(MasterThread.java:204)
Caused by: java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run.
    at org.apache.giraph.master.BspServiceMaster.failJob(BspServiceMaster.java:376)
    at org.apache.giraph.master.BspServiceMaster.setJobStateFailed(BspServiceMaster.java:323)
    at org.apache.giraph.master.BspServiceMaster.barrierOnWorkerList(BspServiceMaster.java:1427)
    at org.apache.giraph.master.BspServiceMaster.coordinateSuperstep(BspServiceMaster.java:1661)
    at org.apache.giraph.master.MasterThread.run(MasterThread.java:131)
Caused by: java.lang.IllegalStateException: ******* WORKERS [Worker(hostname=lap13162 hostOrIp=lap13162, MRtaskID=1, port=30001)] FAILED *******
    ... 4 more
22/12/11 19:05:54 WARN server.NIOServerCnxn: caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
    at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228)
    at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
    at java.base/java.lang.Thread.run(Thread.java:829)
</code>```
```<code>Container id: container_1670740884304_0004_01_000003
Exit code: 2
Stack trace: ExitCodeException exitCode=2:
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:545)
    at org.apache.hadoop.util.Shell.run(Shell.java:456)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
</code>```

Any ideas as to why this has failed would be greatly appreciated!

Body:
I have installed and deployed giraph-1.4.0 using the Hadoop yarn profile with the following command

mvn -Phadoop_yarn -Dhadoop.version=2.7.0 -DskipTests package

I tried running the SimpleShortestPathsComputation example

$HADOOP_HOME/bin/hadoop jar $GIRAPH_HOME/giraph-examples/target/giraph-examples-1.4.0-SNAPSHOT-for-hadoop-2.7.0-jar-with-dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleShortestPathsComputation -vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip /user/hduser/input/tiny_graph.txt -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/output/shortestpaths -w 1 -ca giraph.SplitMasterWorker=false,giraph.logLevel=debug

My application completed with status

22/12/11 19:27:26 INFO yarn.GiraphYarnClient: Completed Giraph: org.apache.giraph.examples.SimpleShortestPathsComputation: FAILED, total running time: 10 minutes, 27 seconds.

The error in the logs

22/12/11 19:05:54 INFO master.BspServiceMaster: setJobState: {"_applicationAttemptKey":-1,"_stateKey":"FAILED","_superstepKey":-1}
22/12/11 19:05:54 FATAL master.BspServiceMaster: failJob: Killing job giraph_yarn_application_1670740884304_0004
22/12/11 19:05:54 FATAL master.BspServiceMaster: failJob: exception java.lang.IllegalStateException: ******* WORKERS [Worker(hostname=lap13162 hostOrIp=lap13162, MRtaskID=1, port=30001)] FAILED *******
22/12/11 19:05:54 ERROR master.MasterThread: masterThread: Master algorithm failed with RuntimeException
java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run.
    at org.apache.giraph.master.BspServiceMaster.failJob(BspServiceMaster.java:376)
    at org.apache.giraph.master.BspServiceMaster.setJobStateFailed(BspServiceMaster.java:323)
    at org.apache.giraph.master.BspServiceMaster.barrierOnWorkerList(BspServiceMaster.java:1427)
    at org.apache.giraph.master.BspServiceMaster.coordinateSuperstep(BspServiceMaster.java:1661)
    at org.apache.giraph.master.MasterThread.run(MasterThread.java:131)
Caused by: java.lang.IllegalStateException: ******* WORKERS [Worker(hostname=lap13162 hostOrIp=lap13162, MRtaskID=1, port=30001)] FAILED *******
    ... 4 more
22/12/11 19:05:54 FATAL graph.GraphTaskManager: uncaughtException: OverrideExceptionHandler on thread org.apache.giraph.master.MasterThread, msg = java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run., exiting...
java.lang.IllegalStateException: java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run.
    at org.apache.giraph.master.MasterThread.run(MasterThread.java:204)
Caused by: java.lang.RuntimeException: BspServiceMaster (YARN profile) is FAILING this task, throwing exception to end job run.
    at org.apache.giraph.master.BspServiceMaster.failJob(BspServiceMaster.java:376)
    at org.apache.giraph.master.BspServiceMaster.setJobStateFailed(BspServiceMaster.java:323)
    at org.apache.giraph.master.BspServiceMaster.barrierOnWorkerList(BspServiceMaster.java:1427)
    at org.apache.giraph.master.BspServiceMaster.coordinateSuperstep(BspServiceMaster.java:1661)
    at org.apache.giraph.master.MasterThread.run(MasterThread.java:131)
Caused by: java.lang.IllegalStateException: ******* WORKERS [Worker(hostname=lap13162 hostOrIp=lap13162, MRtaskID=1, port=30001)] FAILED *******
    ... 4 more
22/12/11 19:05:54 WARN server.NIOServerCnxn: caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
    at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228)
    at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
    at java.base/java.lang.Thread.run(Thread.java:829)

Container id: container_1670740884304_0004_01_000003
Exit code: 2
Stack trace: ExitCodeException exitCode=2:
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:545)
    at org.apache.hadoop.util.Shell.run(Shell.java:456)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Any ideas as to why this has failed would be greatly appreciated!


问:
getting started testing db functions pytest Process finished with exit code 5
I need to test loads of functions that used a sqlite db. To get started I want to use pytest for fixtures.

conftest.py:

```<code>import pytest
import sqlite3

@pytest.fixture
def session():
    connection = sqlite3.connect(":memory:")
    cursor = connection.cursor()
    cursor.execute("CREATE TABLE Investment (ID INTEGER PRIMARY KEY, name VARCHAR(120), ticker VARCHAR(10), exchange VARCHAR(10), type INTEGER, relativeAddress VARCHAR(50), sharesiesFundID VARCHAR(36))")
    cursor.execute("CREATE TABLE Orders (investmentID INTEGER NOT NULL, logTimestamp TIMESTAMP NOT NULL, amount INTEGER, PRIMARY KEY(investmentID, logTimestamp), FOREIGN KEY(investmentID) REFERENCES Investment(ID))")
    cursor.execute("CREATE TABLE InvestmentType (typeID INTEGER NOT NULL PRIMARY KEY , entryName VARCHAR(20))")
    cursor.execute("INSERT INTO InvestmentType (typeID, entryName) VALUES (0, 'Company'), (1, 'ETF'), (2, 'Managed Fund')")
    cursor.execute("INSERT INTO Investment (name, ticker, exchange, type, relativeAddress, sharesiesFundID) VALUES ('3M Co.', 'MMM', 'NYSE', 0, 'nyse-mmm', '94de52ef-324f-4d24-8a80-a5d2f00656bf'), ('a2 Milk Company', 'ATM', 'NZX', 0, 'atm', 'deff31bd-625b-4a82-bbc2-064c7b70b97c'), ('Abbott Laboratories', 'ABT', 'NYSE', 0, 'nyse-abt', 'a367613c-a9bd-4562-a8fd-459e7bd4f5ae')")
    connection.commit()
    yield cursor
    connection.close()

</code>```

test_db.py:

```<code>def get_entry(session):
    result = session.execute("SELECT name FROM Investment WHERE ID = 3").fetchone()
    assert result[0][1] == 'Abbott Laboratories'

</code>```

this keep resulting in "Process finished with exit code 5".

I've tried putting everything in the same file, and some other configurations for pytest.

Body:
I need to test loads of functions that used a sqlite db. To get started I want to use pytest for fixtures.

conftest.py:

import pytest
import sqlite3

@pytest.fixture
def session():
    connection = sqlite3.connect(":memory:")
    cursor = connection.cursor()
    cursor.execute("CREATE TABLE Investment (ID INTEGER PRIMARY KEY, name VARCHAR(120), ticker VARCHAR(10), exchange VARCHAR(10), type INTEGER, relativeAddress VARCHAR(50), sharesiesFundID VARCHAR(36))")
    cursor.execute("CREATE TABLE Orders (investmentID INTEGER NOT NULL, logTimestamp TIMESTAMP NOT NULL, amount INTEGER, PRIMARY KEY(investmentID, logTimestamp), FOREIGN KEY(investmentID) REFERENCES Investment(ID))")
    cursor.execute("CREATE TABLE InvestmentType (typeID INTEGER NOT NULL PRIMARY KEY , entryName VARCHAR(20))")
    cursor.execute("INSERT INTO InvestmentType (typeID, entryName) VALUES (0, 'Company'), (1, 'ETF'), (2, 'Managed Fund')")
    cursor.execute("INSERT INTO Investment (name, ticker, exchange, type, relativeAddress, sharesiesFundID) VALUES ('3M Co.', 'MMM', 'NYSE', 0, 'nyse-mmm', '94de52ef-324f-4d24-8a80-a5d2f00656bf'), ('a2 Milk Company', 'ATM', 'NZX', 0, 'atm', 'deff31bd-625b-4a82-bbc2-064c7b70b97c'), ('Abbott Laboratories', 'ABT', 'NYSE', 0, 'nyse-abt', 'a367613c-a9bd-4562-a8fd-459e7bd4f5ae')")
    connection.commit()
    yield cursor
    connection.close()

test_db.py:

def get_entry(session):
    result = session.execute("SELECT name FROM Investment WHERE ID = 3").fetchone()
    assert result[0][1] == 'Abbott Laboratories'

this keep resulting in "Process finished with exit code 5".

I've tried putting everything in the same file, and some other configurations for pytest.


问:
How can I setup email alerts in spark jobs using Java?
How can I send an email notification if error occurs in spark job? And how can I send email notification on completion of spark job?

I've tried using Java exceptions to generate email.


问:
CustomTkInter auto-py-to-exe conversion does not work. Can the issue be fixed or are the alternatives? (rewrite code in Tkinter?)
I tried to convert my file following those guideline:
https://github.com/TomSchimansky/CustomTkinter/wiki/Packaging#windows-pyinstaller-auto-py-to-exe

I used the latest versions for everything using Anaconda and Conda still runs with Python 3.9 due to some incompatibilities with other libraries (afaIk). Could this cause the error?

Unfortunately the conversion was not successful and I cannot understand the log:

```<code>Running auto-py-to-exe v2.23.1
Building directory: C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n
Provided command: pyinstaller --noconfirm --onedir --console --add-data "d:/anaconda3/lib/site-packages;customtkinter/"  "C:/Users/Useran Much/Desktop/Desktop/Python/testing/file organizer/UI_fileorganizer_v1_2.py"
Recursion Limit is set to 5000
Executing: pyinstaller --noconfirm --onedir --console --add-data d:/anaconda3/lib/site-packages;customtkinter/ C:/Users/Useran Much/Desktop/Desktop/Python/testing/file organizer/UI_fileorganizer_v1_2.py --distpath C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\application --workpath C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build --specpath C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n

109548 INFO: PyInstaller: 5.1
109552 INFO: Python: 3.9.7 (conda)
109583 INFO: Platform: Windows-10-10.0.19045-SP0
109599 INFO: wrote C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\UI_fileorganizer_v1_2.spec
109604 INFO: UPX is not available.
109617 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Useran Much\\Desktop\\Desktop\\Python\\testing\\file organizer']
111140 INFO: checking Analysis
111143 INFO: Building Analysis because Analysis-00.toc is non existent
111145 INFO: Initializing module dependency graph...
111155 INFO: Caching module graph hooks...
111182 INFO: Analyzing base_library.zip ...
116636 INFO: Processing pre-find module path hook distutils from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
116650 INFO: distutils: retargeting to non-venv dir 'D:\\anaconda3\\lib'
120906 INFO: Caching module dependency graph...
121174 INFO: running Analysis Analysis-00.toc
121194 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by D:\anaconda3\python.exe
121473 INFO: Analyzing C:\Users\Useran Much\Desktop\Desktop\Python\testing\file organizer\UI_fileorganizer_v1_2.py
131603 INFO: Processing pre-find module path hook site from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
131606 INFO: site: retargeting to fake-dir 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\fake-modules'
157203 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
166429 INFO: Processing pre-safe import module hook six.moves from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
181273 INFO: Processing pre-safe import module hook win32com from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
192037 INFO: Processing module hooks...
192044 INFO: Loading module hook 'hook-appdirs.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192065 INFO: Loading module hook 'hook-bcrypt.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192068 INFO: Loading module hook 'hook-certifi.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192081 INFO: Loading module hook 'hook-cryptography.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192759 INFO: Loading module hook 'hook-docutils.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
196379 INFO: Loading module hook 'hook-eel.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
196952 INFO: Loading module hook 'hook-IPython.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
198697 INFO: Loading module hook 'hook-jedi.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200371 INFO: Loading module hook 'hook-jinja2.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200398 INFO: Loading module hook 'hook-jsonschema.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200435 INFO: Loading module hook 'hook-nacl.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200468 INFO: Loading module hook 'hook-nbconvert.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200609 INFO: Loading module hook 'hook-nbformat.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200673 INFO: Loading module hook 'hook-notebook.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204213 INFO: Loading module hook 'hook-parso.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204238 INFO: Loading module hook 'hook-py.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204774 INFO: Loading module hook 'hook-pycparser.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204823 INFO: Loading module hook 'hook-pytest.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
205856 INFO: Loading module hook 'hook-pythoncom.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
206820 INFO: Loading module hook 'hook-pywintypes.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
207871 INFO: Loading module hook 'hook-regex.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
207886 INFO: Loading module hook 'hook-win32com.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
208950 INFO: Loading module hook 'hook-zmq.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
209727 INFO: Loading module hook 'hook-babel.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
209999 INFO: Loading module hook 'hook-difflib.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210015 INFO: Loading module hook 'hook-distutils.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210019 INFO: Loading module hook 'hook-distutils.util.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210032 INFO: Loading module hook 'hook-encodings.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210152 INFO: Loading module hook 'hook-gevent.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210863 INFO: Determining a mapping of distributions to packages...
324842 WARNING: Unable to find package for requirement zope.interface from package gevent.
324849 WARNING: Unable to find package for requirement zope.event from package gevent.
324864 INFO: Packages required by gevent:
['cffi', 'setuptools', 'greenlet']
326539 INFO: Loading module hook 'hook-heapq.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326567 INFO: Loading module hook 'hook-importlib_metadata.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326592 INFO: Loading module hook 'hook-lib2to3.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326652 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326668 INFO: Matplotlib backend selection method: automatic discovery of used backends
327175 INFO: Trying determine the default backend as first importable candidate from the list: ['Qt5Agg', 'Gtk3Agg', 'TkAgg', 'WxAgg']
327860 INFO: Selected matplotlib backends: ['Qt5Agg']
328077 INFO: Loading module hook 'hook-matplotlib.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328600 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328611 INFO: Loading module hook 'hook-numpy.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328711 INFO: Import to be excluded not found: 'f2py'
328774 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328795 INFO: Loading module hook 'hook-packaging.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328816 INFO: Loading module hook 'hook-pickle.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328842 INFO: Loading module hook 'hook-PIL.Image.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329383 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329406 INFO: Loading module hook 'hook-PIL.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329443 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329469 INFO: Loading module hook 'hook-pkg_resources.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
332325 WARNING: Hidden import "pkg_resources.py2_warn" not found!
332330 WARNING: Hidden import "pkg_resources.markers" not found!
332343 INFO: Loading module hook 'hook-platform.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
332370 INFO: Loading module hook 'hook-pygments.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
335016 INFO: Loading module hook 'hook-PyQt5.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
335760 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
335966 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
336312 INFO: Loading module hook 'hook-PyQt5.QtSvg.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
336662 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
337117 INFO: Loading module hook 'hook-pytz.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
337380 INFO: Loading module hook 'hook-scipy.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
337393 INFO: Loading module hook 'hook-setuptools.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
340597 INFO: Loading module hook 'hook-sphinx.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349465 INFO: Loading module hook 'hook-sqlite3.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349595 INFO: Loading module hook 'hook-sysconfig.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349610 INFO: Loading module hook 'hook-wcwidth.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349623 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350198 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350203 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350209 INFO: Loading module hook 'hook-xml.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350222 INFO: Loading module hook 'hook-zope.interface.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350245 INFO: Loading module hook 'hook-_tkinter.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350468 INFO: checking Tree
350489 INFO: Building Tree because Tree-00.toc is non existent
350494 INFO: Building Tree Tree-00.toc
350577 INFO: checking Tree
350583 INFO: Building Tree because Tree-01.toc is non existent
350599 INFO: Building Tree Tree-01.toc
350719 INFO: checking Tree
350725 INFO: Building Tree because Tree-02.toc is non existent
350729 INFO: Building Tree Tree-02.toc
350749 INFO: Loading module hook 'hook-lxml.etree.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
350755 INFO: Loading module hook 'hook-lxml.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
353683 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
353696 INFO: Loading module hook 'hook-lxml.isoschematron.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
353711 INFO: Loading module hook 'hook-lxml.objectify.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
353751 INFO: Looking for ctypes DLLs
353807 WARNING: Ignoring AppKit.framework/AppKit imported from D:\anaconda3\lib\site-packages\darkdetect\_mac_detect.py - only basenames are supported with ctypes imports!
354072 INFO: Analyzing run-time hooks ...
354083 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
354102 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
354122 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
354135 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
354152 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32api.py'
354166 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
354177 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
354197 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
354228 INFO: Looking for dynamic libraries
356628 INFO: Looking for eggs
356643 INFO: Using Python library D:\anaconda3\python39.dll
356658 INFO: Found binding redirects:
[]
356684 INFO: Warnings written to C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\warn-UI_fileorganizer_v1_2.txt
356905 INFO: Graph cross-reference written to C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\xref-UI_fileorganizer_v1_2.html
356949 INFO: Appending 'datas' from .spec
384807 INFO: checking PYZ
384825 INFO: Building PYZ because PYZ-00.toc is non existent
384841 INFO: Building PYZ (ZlibArchive) C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\PYZ-00.pyz
386367 INFO: Building PYZ (ZlibArchive) C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\PYZ-00.pyz completed successfully.
386396 INFO: checking PKG
386402 INFO: Building PKG because PKG-00.toc is non existent
386409 INFO: Building PKG (CArchive) UI_fileorganizer_v1_2.pkg
386449 INFO: Building PKG (CArchive) UI_fileorganizer_v1_2.pkg completed successfully.
386474 INFO: Bootloader D:\anaconda3\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
386488 INFO: checking EXE
386503 INFO: Building EXE because EXE-00.toc is non existent
386510 INFO: Building EXE from EXE-00.toc
386520 INFO: Copying bootloader EXE to C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\UI_fileorganizer_v1_2.exe.notanexecutable
386544 INFO: Copying icon to EXE
386551 INFO: Copying icons from ['D:\\anaconda3\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
386567 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
386574 INFO: Writing RT_ICON 1 resource with 3752 bytes
386582 INFO: Writing RT_ICON 2 resource with 2216 bytes
386597 INFO: Writing RT_ICON 3 resource with 1384 bytes
386613 INFO: Writing RT_ICON 4 resource with 37019 bytes
386628 INFO: Writing RT_ICON 5 resource with 9640 bytes
386643 INFO: Writing RT_ICON 6 resource with 4264 bytes
386648 INFO: Writing RT_ICON 7 resource with 1128 bytes
386665 INFO: Copying 0 resources to EXE
386674 INFO: Embedding manifest in EXE
386689 INFO: Updating manifest in C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\UI_fileorganizer_v1_2.exe.notanexecutable
386696 INFO: Updating resource type 24 name 1 language 0
386711 INFO: Appending PKG archive to EXE
388302 INFO: Building EXE from EXE-00.toc completed successfully.
388403 INFO: checking COLLECT
388424 INFO: Building COLLECT because COLLECT-00.toc is non existent
388431 INFO: Building COLLECT COLLECT-00.toc
1101679 INFO: Building COLLECT COLLECT-00.toc completed successfully.
</code>```

If there is no easy solution to this, would it help if I rewrote everything (from CustomTkinter to Tkinter?)

Thank you very much in advance!

Body:
I tried to convert my file following those guideline:
https://github.com/TomSchimansky/CustomTkinter/wiki/Packaging#windows-pyinstaller-auto-py-to-exe

I used the latest versions for everything using Anaconda and Conda still runs with Python 3.9 due to some incompatibilities with other libraries (afaIk). Could this cause the error?

Unfortunately the conversion was not successful and I cannot understand the log:

Running auto-py-to-exe v2.23.1
Building directory: C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n
Provided command: pyinstaller --noconfirm --onedir --console --add-data "d:/anaconda3/lib/site-packages;customtkinter/"  "C:/Users/Useran Much/Desktop/Desktop/Python/testing/file organizer/UI_fileorganizer_v1_2.py"
Recursion Limit is set to 5000
Executing: pyinstaller --noconfirm --onedir --console --add-data d:/anaconda3/lib/site-packages;customtkinter/ C:/Users/Useran Much/Desktop/Desktop/Python/testing/file organizer/UI_fileorganizer_v1_2.py --distpath C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\application --workpath C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build --specpath C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n

109548 INFO: PyInstaller: 5.1
109552 INFO: Python: 3.9.7 (conda)
109583 INFO: Platform: Windows-10-10.0.19045-SP0
109599 INFO: wrote C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\UI_fileorganizer_v1_2.spec
109604 INFO: UPX is not available.
109617 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Useran Much\\Desktop\\Desktop\\Python\\testing\\file organizer']
111140 INFO: checking Analysis
111143 INFO: Building Analysis because Analysis-00.toc is non existent
111145 INFO: Initializing module dependency graph...
111155 INFO: Caching module graph hooks...
111182 INFO: Analyzing base_library.zip ...
116636 INFO: Processing pre-find module path hook distutils from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
116650 INFO: distutils: retargeting to non-venv dir 'D:\\anaconda3\\lib'
120906 INFO: Caching module dependency graph...
121174 INFO: running Analysis Analysis-00.toc
121194 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by D:\anaconda3\python.exe
121473 INFO: Analyzing C:\Users\Useran Much\Desktop\Desktop\Python\testing\file organizer\UI_fileorganizer_v1_2.py
131603 INFO: Processing pre-find module path hook site from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
131606 INFO: site: retargeting to fake-dir 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\fake-modules'
157203 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
166429 INFO: Processing pre-safe import module hook six.moves from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
181273 INFO: Processing pre-safe import module hook win32com from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
192037 INFO: Processing module hooks...
192044 INFO: Loading module hook 'hook-appdirs.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192065 INFO: Loading module hook 'hook-bcrypt.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192068 INFO: Loading module hook 'hook-certifi.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192081 INFO: Loading module hook 'hook-cryptography.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
192759 INFO: Loading module hook 'hook-docutils.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
196379 INFO: Loading module hook 'hook-eel.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
196952 INFO: Loading module hook 'hook-IPython.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
198697 INFO: Loading module hook 'hook-jedi.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200371 INFO: Loading module hook 'hook-jinja2.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200398 INFO: Loading module hook 'hook-jsonschema.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200435 INFO: Loading module hook 'hook-nacl.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200468 INFO: Loading module hook 'hook-nbconvert.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200609 INFO: Loading module hook 'hook-nbformat.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
200673 INFO: Loading module hook 'hook-notebook.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204213 INFO: Loading module hook 'hook-parso.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204238 INFO: Loading module hook 'hook-py.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204774 INFO: Loading module hook 'hook-pycparser.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
204823 INFO: Loading module hook 'hook-pytest.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
205856 INFO: Loading module hook 'hook-pythoncom.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
206820 INFO: Loading module hook 'hook-pywintypes.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
207871 INFO: Loading module hook 'hook-regex.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
207886 INFO: Loading module hook 'hook-win32com.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
208950 INFO: Loading module hook 'hook-zmq.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
209727 INFO: Loading module hook 'hook-babel.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
209999 INFO: Loading module hook 'hook-difflib.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210015 INFO: Loading module hook 'hook-distutils.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210019 INFO: Loading module hook 'hook-distutils.util.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210032 INFO: Loading module hook 'hook-encodings.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210152 INFO: Loading module hook 'hook-gevent.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
210863 INFO: Determining a mapping of distributions to packages...
324842 WARNING: Unable to find package for requirement zope.interface from package gevent.
324849 WARNING: Unable to find package for requirement zope.event from package gevent.
324864 INFO: Packages required by gevent:
['cffi', 'setuptools', 'greenlet']
326539 INFO: Loading module hook 'hook-heapq.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326567 INFO: Loading module hook 'hook-importlib_metadata.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326592 INFO: Loading module hook 'hook-lib2to3.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326652 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
326668 INFO: Matplotlib backend selection method: automatic discovery of used backends
327175 INFO: Trying determine the default backend as first importable candidate from the list: ['Qt5Agg', 'Gtk3Agg', 'TkAgg', 'WxAgg']
327860 INFO: Selected matplotlib backends: ['Qt5Agg']
328077 INFO: Loading module hook 'hook-matplotlib.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328600 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328611 INFO: Loading module hook 'hook-numpy.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328711 INFO: Import to be excluded not found: 'f2py'
328774 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328795 INFO: Loading module hook 'hook-packaging.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328816 INFO: Loading module hook 'hook-pickle.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
328842 INFO: Loading module hook 'hook-PIL.Image.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329383 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329406 INFO: Loading module hook 'hook-PIL.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329443 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
329469 INFO: Loading module hook 'hook-pkg_resources.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
332325 WARNING: Hidden import "pkg_resources.py2_warn" not found!
332330 WARNING: Hidden import "pkg_resources.markers" not found!
332343 INFO: Loading module hook 'hook-platform.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
332370 INFO: Loading module hook 'hook-pygments.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
335016 INFO: Loading module hook 'hook-PyQt5.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
335760 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
335966 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
336312 INFO: Loading module hook 'hook-PyQt5.QtSvg.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
336662 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
337117 INFO: Loading module hook 'hook-pytz.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
337380 INFO: Loading module hook 'hook-scipy.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
337393 INFO: Loading module hook 'hook-setuptools.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
340597 INFO: Loading module hook 'hook-sphinx.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349465 INFO: Loading module hook 'hook-sqlite3.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349595 INFO: Loading module hook 'hook-sysconfig.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349610 INFO: Loading module hook 'hook-wcwidth.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
349623 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350198 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350203 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350209 INFO: Loading module hook 'hook-xml.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350222 INFO: Loading module hook 'hook-zope.interface.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350245 INFO: Loading module hook 'hook-_tkinter.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
350468 INFO: checking Tree
350489 INFO: Building Tree because Tree-00.toc is non existent
350494 INFO: Building Tree Tree-00.toc
350577 INFO: checking Tree
350583 INFO: Building Tree because Tree-01.toc is non existent
350599 INFO: Building Tree Tree-01.toc
350719 INFO: checking Tree
350725 INFO: Building Tree because Tree-02.toc is non existent
350729 INFO: Building Tree Tree-02.toc
350749 INFO: Loading module hook 'hook-lxml.etree.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
350755 INFO: Loading module hook 'hook-lxml.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
353683 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
353696 INFO: Loading module hook 'hook-lxml.isoschematron.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
353711 INFO: Loading module hook 'hook-lxml.objectify.py' from 'D:\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
353751 INFO: Looking for ctypes DLLs
353807 WARNING: Ignoring AppKit.framework/AppKit imported from D:\anaconda3\lib\site-packages\darkdetect\_mac_detect.py - only basenames are supported with ctypes imports!
354072 INFO: Analyzing run-time hooks ...
354083 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
354102 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
354122 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
354135 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
354152 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32api.py'
354166 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
354177 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
354197 INFO: Including run-time hook 'D:\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
354228 INFO: Looking for dynamic libraries
356628 INFO: Looking for eggs
356643 INFO: Using Python library D:\anaconda3\python39.dll
356658 INFO: Found binding redirects:
[]
356684 INFO: Warnings written to C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\warn-UI_fileorganizer_v1_2.txt
356905 INFO: Graph cross-reference written to C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\xref-UI_fileorganizer_v1_2.html
356949 INFO: Appending 'datas' from .spec
384807 INFO: checking PYZ
384825 INFO: Building PYZ because PYZ-00.toc is non existent
384841 INFO: Building PYZ (ZlibArchive) C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\PYZ-00.pyz
386367 INFO: Building PYZ (ZlibArchive) C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\PYZ-00.pyz completed successfully.
386396 INFO: checking PKG
386402 INFO: Building PKG because PKG-00.toc is non existent
386409 INFO: Building PKG (CArchive) UI_fileorganizer_v1_2.pkg
386449 INFO: Building PKG (CArchive) UI_fileorganizer_v1_2.pkg completed successfully.
386474 INFO: Bootloader D:\anaconda3\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
386488 INFO: checking EXE
386503 INFO: Building EXE because EXE-00.toc is non existent
386510 INFO: Building EXE from EXE-00.toc
386520 INFO: Copying bootloader EXE to C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\UI_fileorganizer_v1_2.exe.notanexecutable
386544 INFO: Copying icon to EXE
386551 INFO: Copying icons from ['D:\\anaconda3\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
386567 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
386574 INFO: Writing RT_ICON 1 resource with 3752 bytes
386582 INFO: Writing RT_ICON 2 resource with 2216 bytes
386597 INFO: Writing RT_ICON 3 resource with 1384 bytes
386613 INFO: Writing RT_ICON 4 resource with 37019 bytes
386628 INFO: Writing RT_ICON 5 resource with 9640 bytes
386643 INFO: Writing RT_ICON 6 resource with 4264 bytes
386648 INFO: Writing RT_ICON 7 resource with 1128 bytes
386665 INFO: Copying 0 resources to EXE
386674 INFO: Embedding manifest in EXE
386689 INFO: Updating manifest in C:\Users\KORBIN~1\AppData\Local\Temp\tmpriqn1v9n\build\UI_fileorganizer_v1_2\UI_fileorganizer_v1_2.exe.notanexecutable
386696 INFO: Updating resource type 24 name 1 language 0
386711 INFO: Appending PKG archive to EXE
388302 INFO: Building EXE from EXE-00.toc completed successfully.
388403 INFO: checking COLLECT
388424 INFO: Building COLLECT because COLLECT-00.toc is non existent
388431 INFO: Building COLLECT COLLECT-00.toc
1101679 INFO: Building COLLECT COLLECT-00.toc completed successfully.

If there is no easy solution to this, would it help if I rewrote everything (from CustomTkinter to Tkinter?)

Thank you very much in advance!


问:
GitHub: Grouping projects under single repo and private .git folders
I keep my assignment projects in a private repo called assignment. However, the .git is only under this repo and I removed the .git folders from each of the projects under this repo.

But in this situation, when I just want to keep a project under this repo, this project does not have its own git folder. But I want to make all the projects have its private repo while keeping them under assignment repo.

So, how can I make such structure? I just want to rely on specific git folders for each project instead of under assignment. But I think assignment must have git folder as it is repo and I will push my assignments into it. Any idea?


问:
PHP Unlink multiple files with the same column title name
How do I Unlink multiple file with the same column name? All still I can do is one file.

`

```<code>if (isset($_POST['delete'])) {
  include "db_conn.php";

  $ext_title = $_POST['ext_title'];
  $id = $_POST['id'];
  $file = $_POST['file'];

        $sql = "DELETE FROM extension WHERE ext_title = '$ext_title' ";
        mysqli_query($conn, $sql);
          If (unlink("files/$file")) {
            echo "
          <script> alert('Successfully deleted!');
          window.location.href='../admin/extension-table.php';
          </script>";
          } else {
            echo "
          <script> alert('Deleted!');
          window.location.href='../admin/extension-table.php';
          </script>";
          }

</code>```

`

With these code, only POST file were only unlinked and the rest with the same 'ext_title' row were wiped out from database.

Body:
How do I Unlink multiple file with the same column name? All still I can do is one file.

`

if (isset($_POST['delete'])) {
  include "db_conn.php";

  $ext_title = $_POST['ext_title'];
  $id = $_POST['id'];
  $file = $_POST['file'];

        $sql = "DELETE FROM extension WHERE ext_title = '$ext_title' ";
        mysqli_query($conn, $sql);
          If (unlink("files/$file")) {
            echo "
          ";
          } else {
            echo "
          ";
          }

`

With these code, only POST file were only unlinked and the rest with the same 'ext_title' row were wiped out from database.


问:
How to insert OGR Feature into SQL Server database by GDAL C#
I want to insert GDAL OSGeo.OGR feature into my SQL Server database. I make a connection to SQL Server and retrieve some features from table by GDAL OGR and I want to insert these rows (Geometry) besides some columns values into another table:

```<code>string sqlConn = "MSSQL:server=[MyServer];database=[MyDB];driver={ODBC Driver 13 for SQL Server};UId=[MyUI];PWD=[MyPWD];";

Ogr.RegisterAll();

DataSource ds = Ogr.Open(sqlConn, 0);

string request = "SELECT * FROM [MyTable] WHERE [MyCondition]";

Layer serverLayer = ds.ExecuteSQL(request, null, "");

Feature memFeature;

while ((memFeature = serverLayer.GetNextFeature()) != null)
{
  Geometry memGeom = memFeature.GetGeometryRef();
}
</code>```

How to insert this Geometry (OSGeo.OGR.Geometry) besides some columns values into a SQL Server database?

Body:
I want to insert GDAL OSGeo.OGR feature into my SQL Server database. I make a connection to SQL Server and retrieve some features from table by GDAL OGR and I want to insert these rows (Geometry) besides some columns values into another table:

string sqlConn = "MSSQL:server=[MyServer];database=[MyDB];driver={ODBC Driver 13 for SQL Server};UId=[MyUI];PWD=[MyPWD];";

Ogr.RegisterAll();

DataSource ds = Ogr.Open(sqlConn, 0);

string request = "SELECT * FROM [MyTable] WHERE [MyCondition]";

Layer serverLayer = ds.ExecuteSQL(request, null, "");

Feature memFeature;

while ((memFeature = serverLayer.GetNextFeature()) != null)
{
  Geometry memGeom = memFeature.GetGeometryRef();
}

How to insert this Geometry (OSGeo.OGR.Geometry) besides some columns values into a SQL Server database?


问:
Postgres 13 regexp_match() returns null values
I'm reading a book about Postgres and there is an exercise with regex. So, I created table and loaded csv into it.

```<code>CREATE TABLE crime_reports (
    crime_id bigserial PRIMARY KEY,
    date_1 timestamp with time zone,
    date_2 timestamp with time zone,
    street varchar(250),
    city varchar(100),
    crime_type varchar(100),
    description text,
    case_number varchar(50),
    original_text text NOT NULL
);

COPY crime_reports (original_text)
FROM 'C:\YourDirectory\crime_reports.csv'
WITH (FORMAT CSV, HEADER OFF, QUOTE '"');
</code>```

Here is CSV:

```<code>"4/16/17-4/17/17
2100-0900 hrs.
46000 Block Ashmere Sq.
Sterling
Larceny: The victim reported that a
bicycle was stolen from their opened
garage door during the overnight hours.
C0170006614"
"4/8/17
1600 hrs.
46000 Block Potomac Run Plz.
Sterling
Destruction of Property: The victim
reported that their vehicle was spray
painted and the trim was ripped off while
it was parked at this location.
C0170006162"
"4/4/17
1400-1500 hrs.
24000 Block Hawthorn Thicket Ter.
Sterling
Larceny: The complainant reported that
multiple windows were stolen from this home
under construction. C0170006079"
"04/10/17
1605 hrs.
21800 block Newlin Mill Rd.
Middleburg
Larceny: A license plate was reported
stolen from a vehicle.
SO170006250"
"04/09/17
1200 hrs.
470000 block Fairway Dr.
Sterling
Destruction of Property: Unknown
subject(s) wrote graffiti on a sign in the
area.
SO170006211"
</code>```

And when I'm trying to execute this query I have a lot of NULL values returned.

```<code>SELECT
    regexp_match(original_text, '(?:C0|SO)[0-9]+') AS case_number,
    regexp_match(original_text, '\d{1,2}\/\d{1,2}\/\d{2}') AS date_1,
    regexp_match(original_text, '\n(?:\w+ \w+|\w+)\n(.*):') AS crime_type,
    regexp_match(original_text, '(?:Sq.|Plz.|Dr.|Ter.|Rd.)\n(\w+ \w+|\w+)\n')
        AS city
FROM crime_reports;
</code>```

If I use explicit string the query works well:

```<code>SELECT  regexp_match(
'4/16/17-4/17/17
2100-0900 hrs.
46000 Block Ashmere Sq.
Sterling
Larceny: The victim reported that a
bicycle was stolen from their opened
garage door during the overnight hours.
C0170006614',   '\n(?:\w+ \w+|\w+)\n(.*):');
</code>```

But in my case there are NULL values:

```<code>SELECT crime_id,
       regexp_match(original_text, '\d{1,2}\/\d{1,2}\/\d{2}') AS date_1,
       CASE WHEN EXISTS (SELECT regexp_matches(original_text, '-(\d{1,2}\/\d{1,2}\/\d{1,2})'))
            THEN regexp_match(original_text, '-(\d{1,2}\/\d{1,2}\/\d{1,2})')
            ELSE NULL
            END AS date_2,
       regexp_match(original_text, '\/\d{2}\n(\d{4})') AS hour_1,
       CASE WHEN EXISTS (SELECT regexp_matches(original_text, '\/\d{2}\n\d{4}-(\d{4})'))
            THEN regexp_match(original_text, '\/\d{2}\n\d{4}-(\d{4})')
            ELSE NULL
            END AS hour_2,
       regexp_match(original_text, 'hrs.\n(\d+ .+(?:Sq.|Plz.|Dr.|Ter.|Rd.))') AS street,
       regexp_match(original_text, '(?:Sq.|Plz.|Dr.|Ter.|Rd.)\n(\w+ \w+|\w+)\n') AS city,
       regexp_match(original_text, '\n(?:\w+ \w+|\w+)\n(.*):') AS crime_type,
       regexp_match(original_text, ':\s(.+)(?:C0|SO)') AS description,
       regexp_match(original_text, '(?:C0|SO)[0-9]+') AS case_number
FROM crime_reports;
</code>```

This is what I have:

What should be:

So what am I doing wrong?

I dont' know what to do

By the way I remembered that when I execute:

```<code>SELECT original_text FROM crime_reports;
</code>```

I receive this:

Instead of this like in a book:

And it doesn't display popup msg with a full text.
Does that matter?

Body:
I'm reading a book about Postgres and there is an exercise with regex. So, I created table and loaded csv into it.

CREATE TABLE crime_reports (
    crime_id bigserial PRIMARY KEY,
    date_1 timestamp with time zone,
    date_2 timestamp with time zone,
    street varchar(250),
    city varchar(100),
    crime_type varchar(100),
    description text,
    case_number varchar(50),
    original_text text NOT NULL
);

COPY crime_reports (original_text)
FROM 'C:\YourDirectory\crime_reports.csv'
WITH (FORMAT CSV, HEADER OFF, QUOTE '"');

Here is CSV:

"4/16/17-4/17/17
2100-0900 hrs.
46000 Block Ashmere Sq.
Sterling
Larceny: The victim reported that a
bicycle was stolen from their opened
garage door during the overnight hours.
C0170006614"
"4/8/17
1600 hrs.
46000 Block Potomac Run Plz.
Sterling
Destruction of Property: The victim
reported that their vehicle was spray
painted and the trim was ripped off while
it was parked at this location.
C0170006162"
"4/4/17
1400-1500 hrs.
24000 Block Hawthorn Thicket Ter.
Sterling
Larceny: The complainant reported that
multiple windows were stolen from this home
under construction. C0170006079"
"04/10/17
1605 hrs.
21800 block Newlin Mill Rd.
Middleburg
Larceny: A license plate was reported
stolen from a vehicle.
SO170006250"
"04/09/17
1200 hrs.
470000 block Fairway Dr.
Sterling
Destruction of Property: Unknown
subject(s) wrote graffiti on a sign in the
area.
SO170006211"

And when I'm trying to execute this query I have a lot of NULL values returned.

SELECT
    regexp_match(original_text, '(?:C0|SO)[0-9]+') AS case_number,
    regexp_match(original_text, '\d{1,2}\/\d{1,2}\/\d{2}') AS date_1,
    regexp_match(original_text, '\n(?:\w+ \w+|\w+)\n(.*):') AS crime_type,
    regexp_match(original_text, '(?:Sq.|Plz.|Dr.|Ter.|Rd.)\n(\w+ \w+|\w+)\n')
        AS city
FROM crime_reports;

If I use explicit string the query works well:

SELECT  regexp_match(
'4/16/17-4/17/17
2100-0900 hrs.
46000 Block Ashmere Sq.
Sterling
Larceny: The victim reported that a
bicycle was stolen from their opened
garage door during the overnight hours.
C0170006614',   '\n(?:\w+ \w+|\w+)\n(.*):');

But in my case there are NULL values:

SELECT crime_id,
       regexp_match(original_text, '\d{1,2}\/\d{1,2}\/\d{2}') AS date_1,
       CASE WHEN EXISTS (SELECT regexp_matches(original_text, '-(\d{1,2}\/\d{1,2}\/\d{1,2})'))
            THEN regexp_match(original_text, '-(\d{1,2}\/\d{1,2}\/\d{1,2})')
            ELSE NULL
            END AS date_2,
       regexp_match(original_text, '\/\d{2}\n(\d{4})') AS hour_1,
       CASE WHEN EXISTS (SELECT regexp_matches(original_text, '\/\d{2}\n\d{4}-(\d{4})'))
            THEN regexp_match(original_text, '\/\d{2}\n\d{4}-(\d{4})')
            ELSE NULL
            END AS hour_2,
       regexp_match(original_text, 'hrs.\n(\d+ .+(?:Sq.|Plz.|Dr.|Ter.|Rd.))') AS street,
       regexp_match(original_text, '(?:Sq.|Plz.|Dr.|Ter.|Rd.)\n(\w+ \w+|\w+)\n') AS city,
       regexp_match(original_text, '\n(?:\w+ \w+|\w+)\n(.*):') AS crime_type,
       regexp_match(original_text, ':\s(.+)(?:C0|SO)') AS description,
       regexp_match(original_text, '(?:C0|SO)[0-9]+') AS case_number
FROM crime_reports;

This is what I have:

What should be:

So what am I doing wrong?

I dont' know what to do

By the way I remembered that when I execute:

SELECT original_text FROM crime_reports;

I receive this:

Instead of this like in a book:

And it doesn't display popup msg with a full text.
Does that matter?


问:
deployment for forge viewer web application
i'm trying to deploy forge app ( from "view hub models" tutorials - viewer and dashboards that shows  data from the model - takes models from bim360 hub)
what is the the most simple and cost worthy way of deployment? ( changing the URL from localhost3000 to actual server,  and being able to share the web site )
in the old forge tutorials, they used  microsoft azure, but the tutorial is no longer available..)

what are the steps requiered to deploy after creating an app in azure?

where can  i find documentations or tutorials that well explains the proccess?

my project in github:
https://github.com/levir10/Forge-BI

thank you!


问:
Sitecore package installation wizard not loading in azure Cm instance for paas installation
I have a Sitecore 10.0 instance installed in azure pass, I am able to load the content editor however on loading the installation wizard from Sitecore desktop->development tools i get a blank screen, I observed the same with any other pop us such as user manager as well.

enter image description here

I tried comparing the config to a working instance that i have and also the dll's but i dont seem to find anything missing from that front.