问:
How can I use xlsxwriter to create one textbox on a worksheet with multiple formats?
I am using xlswriter to create a textbox in a Excel worksheet as follows:

```<code>import xlsxwriter

text = 'this is line 1 \nthis is line 2 \nthis is line 3'
workbook = xlsxwriter.Workbook('c:/tmp/test.xlsx')
worksheet = workbook.add_worksheet('Information')
options = {
            'width':200,
            'height':200,
            'font': {
                      'bold': True,
                      'size': 12
                    }
}
worksheet.insert_textbox(1, 1,text,options)
workbook.close()

</code>```

the result is:

What I want is to format lines 1, 2 and 3 differently.
I can do it manually on Excel, by selecting the text and changing the font to look as follows:

How can I do this in Python?
I can achieve this if I write to a cell but how can I do multiple formats in a textbox?

Body:
I am using xlswriter to create a textbox in a Excel worksheet as follows:

import xlsxwriter

text = 'this is line 1 \nthis is line 2 \nthis is line 3'
workbook = xlsxwriter.Workbook('c:/tmp/test.xlsx')
worksheet = workbook.add_worksheet('Information')
options = {
            'width':200,
            'height':200,
            'font': {
                      'bold': True,
                      'size': 12
                    }
}
worksheet.insert_textbox(1, 1,text,options)
workbook.close()

the result is:

What I want is to format lines 1, 2 and 3 differently.
I can do it manually on Excel, by selecting the text and changing the font to look as follows:

How can I do this in Python?
I can achieve this if I write to a cell but how can I do multiple formats in a textbox?


来源: stackexchange

问:
Object Search in TS Unit Tests
I'm trying write a unit test that:
(a) creates a number of objects of different types & links between those objects
(b) passes two object sets (made up of the mocked objects) into a function and validates the output

My code generally looks like:

```<code>
import {
    MyFunctionLibrary
} from '../src/subfolder/file'

myFunctionLibrary = new MyFunctionLibrary()

test("do something", async () => {

    const x1 = Objects.create().xType("x1")
    const x2 = Objects.create().xType("x2")

    const y = Objects.create().zType("y")
    y.links.add(x1)
    y.links.add(x2)

    console.log(Objects.search().yType().all())
    console.log(await Objects.search().yType().allAsync())

    myFunctionsLibrary.doSomething(
         Objects.search().yType(), // OS1
         Objects.search().xType() // OS2
    )
})

</code>```

The code fails on an error in doSomething that checks that its first parameter (OS1) has exactly 1 object. Instead, the value of the first parameter's value is undefined. This is confirmed with the two console.logs

Confirmed with documentation at https://www.palantir.com/docs/foundry/functions/unit-test-stub-objects/ that you should be able to just create objects like normal.

N.B. Also tried mocking the results of a filter with the withObjectSet function. However, I really need the inputs to be ObjectSets and not arrays, so I couldn't mock the .take function.

ContentLicense: CC BY-SA 4.0

Title: Object Search in TS Unit Tests

Body:
I'm trying write a unit test that:
(a) creates a number of objects of different types & links between those objects
(b) passes two object sets (made up of the mocked objects) into a function and validates the output

My code generally looks like:

import {
    MyFunctionLibrary
} from '../src/subfolder/file'

myFunctionLibrary = new MyFunctionLibrary()

test("do something", async () => {

    const x1 = Objects.create().xType("x1")
    const x2 = Objects.create().xType("x2")

    const y = Objects.create().zType("y")
    y.links.add(x1)
    y.links.add(x2)

    console.log(Objects.search().yType().all())
    console.log(await Objects.search().yType().allAsync())

    myFunctionsLibrary.doSomething(
         Objects.search().yType(), // OS1
         Objects.search().xType() // OS2
    )
})

The code fails on an error in doSomething that checks that its first parameter (OS1) has exactly 1 object. Instead, the value of the first parameter's value is undefined. This is confirmed with the two console.logs

Confirmed with documentation at https://www.palantir.com/docs/foundry/functions/unit-test-stub-objects/ that you should be able to just create objects like normal.

N.B. Also tried mocking the results of a filter with the withObjectSet function. However, I really need the inputs to be ObjectSets and not arrays, so I couldn't mock the .take function.


问:
Django url template tag ovrwrite the last letter of the base address
When using the URL template tag I checked the source code of the html page and the url appears missing the last letter of the base address, see an example:
...

```<code><li><a href="{% url 'product' %}">Products</a></li>
</code>```

...
returns
...

```<code><li><a href="/dec/product/">Products</a></li>
</code>```

...
but the the base address is my-site.com/deck
...
so, why dont returns
...

```<code><li><a href="/deck/product/">Products</a></li>
</code>```

...

I checked my settings.py and urls.py and didn't see anything wrong, I don't know where else to look

my urls.py

```<code>from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path, re_path

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('principal.urls')),
    path('product/', include('products.urls'), name='product'),
] + static(settings.MEDIA_URL, document_root=settings.STATIC_ROOT)
</code>```

and the urls.py from app product

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

urlpatterns = [
    path('', views.ProductHTMxTableView.as_view(), name='products'),
    path('product/<int:pk>', views.ProductDetail.as_view(), name='product_detail'),
    path('show/', views.ProductShow.as_view(), name='product_show'),

]
</code>```

Body:
When using the URL template tag I checked the source code of the html page and the url appears missing the last letter of the base address, see an example:
...

Products

...
returns
...

Products

...
but the the base address is my-site.com/deck
...
so, why dont returns
...

Products

...

I checked my settings.py and urls.py and didn't see anything wrong, I don't know where else to look

my urls.py

from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path, re_path

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('principal.urls')),
    path('product/', include('products.urls'), name='product'),
] + static(settings.MEDIA_URL, document_root=settings.STATIC_ROOT)

and the urls.py from app product

from django.urls import path
from . import views

urlpatterns = [
    path('', views.ProductHTMxTableView.as_view(), name='products'),
    path('product/<int:pk>', views.ProductDetail.as_view(), name='product_detail'),
    path('show/', views.ProductShow.as_view(), name='product_show'),

]


问:
Caught signal 11 (Segmentation fault: address not mapped to object at address 0xff00000107)
Im practising in parallel programming using MPI and i developed a programm that is calculating the average and how many numbers of the array are greater or fewer than the average. Unfortunately when im trying to run it on linux ubuntu system i get this *Caught signal 11 (Segmentation fault: address not mapped to object at address 0xff00000107), backtrace(tid: 5699).</p>
```<code>#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"

int main(int argc, char** argv){
    int p, plithos, i, k, count_max,count_min, sunexeia;
    int *pinakas;
    int *final_res;
    int loc_matrix[100];
    int loc_num;
    int my_rank;
    int root, local_sum, sum, j, source;
    int tag1=50;
    int tag2=60;
    int tag3=70;
    int tag4=80;

    float average;

    MPI_Status status;
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &p);

    if (my_rank == 0) {
        printf("please give the size of the array: ");
        scanf("%d", &plithos);
        pinakas = (int *) malloc(plithos * sizeof(int));
        for (i = 0; i < plithos; i++) {
            printf("Give the %d number: ", i);
            scanf("%d", &pinakas[i]);
        }
    }

    root = 0;
    MPI_Bcast(&plithos, 1, MPI_INT, root, MPI_COMM_WORLD); // here we are sending the size of the array to the processors

    loc_num = plithos / p;
    root = 0;
    MPI_Scatter(&pinakas, loc_num, MPI_INT, &loc_matrix, loc_num, MPI_INT, root, MPI_COMM_WORLD); // here we are sending the amount of tasks that every processor must have

    local_sum=0; // here all processors will calculate their sums
    if (my_rank == 0) {
        int start = 0;
        int end = loc_num;
        for (i = start; i < end; i++){
            local_sum += pinakas[i];
        }
    }
    else{
        int start = my_rank * loc_num;
        int end = my_rank + loc_num;
        for (i = start; i < end; i++){
            local_sum += pinakas[i];
        }
    }

    MPI_Reduce(&local_sum, &sum, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); //here with the reduce we are caclulating all the sums from all processors

    if (my_rank == 0) { // processor 0 finds the average
        average = (double)sum / plithos;
    printf("The average is: %f\n", average);
    }

    root = 0;
    MPI_Bcast(&average, 1, MPI_FLOAT, root, MPI_COMM_WORLD); //edo stelnoume tin mesi timi stis upoloipes diergasies

    if (my_rank = 0){ //edo h diergasia 0 tha upologisei posa stoixeia exoun min kai max > tou average
        for(i=0; i<plithos; i++){
            if(pinakas[i]> average){
                count_max = count_max +1;
            }
            if(pinakas[i]< average){
                count_min = count_min +1;
            }
        }
        printf("To plithos ton stoixeion pou exoun megaluteri timi apo tin mesi timi einai: %d", count_max);
        printf("To plithos ton stoixeion pou exoun mikroteri timi apo tin mesi timi einai: %d", count_min);
    }

MPI_Finalize();
}

</code>```

Body:
Im practising in parallel programming using MPI and i developed a programm that is calculating the average and how many numbers of the array are greater or fewer than the average. Unfortunately when im trying to run it on linux ubuntu system i get this *Caught signal 11 (Segmentation fault: address not mapped to object at address 0xff00000107), backtrace(tid: 5699).

#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"

int main(int argc, char** argv){
    int p, plithos, i, k, count_max,count_min, sunexeia;
    int *pinakas;
    int *final_res;
    int loc_matrix[100];
    int loc_num;
    int my_rank;
    int root, local_sum, sum, j, source;
    int tag1=50;
    int tag2=60;
    int tag3=70;
    int tag4=80;

    float average;

    MPI_Status status;
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &p);

    if (my_rank == 0) {
        printf("please give the size of the array: ");
        scanf("%d", &plithos);
        pinakas = (int *) malloc(plithos * sizeof(int));
        for (i = 0; i < plithos; i++) {
            printf("Give the %d number: ", i);
            scanf("%d", &pinakas[i]);
        }
    }

    root = 0;
    MPI_Bcast(&plithos, 1, MPI_INT, root, MPI_COMM_WORLD); // here we are sending the size of the array to the processors

    loc_num = plithos / p;
    root = 0;
    MPI_Scatter(&pinakas, loc_num, MPI_INT, &loc_matrix, loc_num, MPI_INT, root, MPI_COMM_WORLD); // here we are sending the amount of tasks that every processor must have

    local_sum=0; // here all processors will calculate their sums
    if (my_rank == 0) {
        int start = 0;
        int end = loc_num;
        for (i = start; i < end; i++){
            local_sum += pinakas[i];
        }
    }
    else{
        int start = my_rank * loc_num;
        int end = my_rank + loc_num;
        for (i = start; i < end; i++){
            local_sum += pinakas[i];
        }
    }

    MPI_Reduce(&local_sum, &sum, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); //here with the reduce we are caclulating all the sums from all processors

    if (my_rank == 0) { // processor 0 finds the average
        average = (double)sum / plithos;
    printf("The average is: %f\n", average);
    }

    root = 0;
    MPI_Bcast(&average, 1, MPI_FLOAT, root, MPI_COMM_WORLD); //edo stelnoume tin mesi timi stis upoloipes diergasies

    if (my_rank = 0){ //edo h diergasia 0 tha upologisei posa stoixeia exoun min kai max > tou average
        for(i=0; i<plithos; i++){
            if(pinakas[i]> average){
                count_max = count_max +1;
            }
            if(pinakas[i]< average){
                count_min = count_min +1;
            }
        }
        printf("To plithos ton stoixeion pou exoun megaluteri timi apo tin mesi timi einai: %d", count_max);
        printf("To plithos ton stoixeion pou exoun mikroteri timi apo tin mesi timi einai: %d", count_min);
    }

MPI_Finalize();
}


问:
difflib.SequenceMatcher returns equal start and end indices for two lists comparison with only string elements
Given the following code, that compares differences between two lists, all values as string using SequenceMatcher:

```<code>dir1 = "testDir1"
dir2 = "testdir2"
files1 = ["test", "test2", "test3"]
files2 = ["test", "test2", "test3", "test4", "test5"]

matcher = difflib.SequenceMatcher(None, files1, files2)
for tag, i1, i2, j1, j2 in matcher.get_opcodes():
    if tag == 'insert':
        print(' Following Files in', dir2, 'but not in', dir1)
        for i in range(i1, i2):
            print(files1[i])

    elif tag == 'delete':
        print(' Following Files in', dir1, 'but not in', dir2)
        for j in range(j1, j2):
            print(files1[j])
</code>```

Problem is the indices returned by matcher instance, i1 and i2, are the same, for this case, when files2 list has more items than files1, same happens if files1 has more items then fiesl2, but then j1 and j2 are equal.

Problem with i1 and i2 respectively j1, j2 being the same is that it won't properly display what files are extra (the names) i1 means starting index of the extra files i2 the end of it, but range of 1 and 1 gives nothing, therefore, it wont work.

I assume i1 and i2 should never be equal so I guess I m using seqMatcher wrong, from my knowledge if nothing is specified, it should match a == b

Body:
Given the following code, that compares differences between two lists, all values as string using SequenceMatcher:

dir1 = "testDir1"
dir2 = "testdir2"
files1 = ["test", "test2", "test3"]
files2 = ["test", "test2", "test3", "test4", "test5"]

matcher = difflib.SequenceMatcher(None, files1, files2)
for tag, i1, i2, j1, j2 in matcher.get_opcodes():
    if tag == 'insert':
        print(' Following Files in', dir2, 'but not in', dir1)
        for i in range(i1, i2):
            print(files1[i])

    elif tag == 'delete':
        print(' Following Files in', dir1, 'but not in', dir2)
        for j in range(j1, j2):
            print(files1[j])

Problem is the indices returned by matcher instance, i1 and i2, are the same, for this case, when files2 list has more items than files1, same happens if files1 has more items then fiesl2, but then j1 and j2 are equal.

Problem with i1 and i2 respectively j1, j2 being the same is that it won't properly display what files are extra (the names) i1 means starting index of the extra files i2 the end of it, but range of 1 and 1 gives nothing, therefore, it wont work.

I assume i1 and i2 should never be equal so I guess I m using seqMatcher wrong, from my knowledge if nothing is specified, it should match a == b


问:
Why doesn't bootstrap datatable render on mobile device
I'm using Datatables on my responsive website with bootstrap 4. I experience a strange behaviour when loading the page on any mobile device. The datatable is visible but it shows the information 'No data available in table'. This also happens on my laptop, but just for a brief second before the content is loaded into the table. As the table renders fine on my laptop I know that the ajax call is responding as expected, so the issue must be elsewhere. I have read forums on datatables.net and here on stackoverflow, but I cannot find a solution to this issue.  My code is posted below, and if you can point me in the right direction, please reply to this question: Why doesn't the table render on mobile device?

Ajax request with response handling:
`

```<code>$.ajax({
        url: '../../core/newslist/get_newslist.php',
        data: "",
        dataType: 'json',
        success: function(response)
        {
        var tableArray = response[0];

        var oTable = $("#dd_project_table").DataTable({
        "destroy": true,
        deferRender: true,
        dom: '<"top"i>rt<"bottom"lp><"clear">',
        "language": {
                    "lengthMenu": "Vis _MENU_ resultater per side",
                    "zeroRecords": "Ingen prosjekter å vise",
                    "info": "",
                    "infoFiltered": "",
                    "infoEmpty": "Ingen sider å vise",
                    "sSearch": "Hurtigsøk",
                    "paginate": {
                    "previous": "Forrige",
                    "next": "Neste"}
        },

            "responsive": true,
            "searching": true,
            "scrollX": false,
            "scrollY": "700px",
            "scrollCollapse": true,
            "autoWidth": true,
            "bSort":true,
            "lengthChange": false,
            "pageLength": 12,
            "cursor": "pointer",

             createdRow: function ( row, data, dataIndex, cells ) {
              $(row).attr('draggable', 'true');
            },
             drawCallback: function () {
              // Add HTML5 draggable event listeners to each row
              rows = document.querySelectorAll('#dd_project_table tbody tr');
                [].forEach.call(rows, function(row) {
                  row.addEventListener('dragstart', handleDragStart, false);
                  row.addEventListener('dragenter', handleDragEnter, false)
                  row.addEventListener('dragover', handleDragOver, false);
                  row.addEventListener('dragleave', handleDragLeave, false);
                 row.addEventListener('drop', handleDrop, false);
                  row.addEventListener('dragend', handleDragEnd, false);
                });
            },

            "aaData": tableArray
            });

});//end ajax
</code>```

Here is the table in my html file

```<code><table id="dd_project_table"  class="table table-hover table-striped display table-responsive">
<thead id="ddbox">
<tr>
  <th id="hname1" class="dd-datatable-heading" align="center"><b>#</b></th>
  <th id="hname2" class="dd-datatable-heading"><b>PROJECT</b></th>
  <th id="hname3" class="dd-datatable-heading"><b>LOCATION</b></th>
  <th id="hname4" class="dd-datatable-heading"><b>TYPE</b></th>
  <th id="hname6" class="dd-datatable-heading"><b>COST</b></th>
  <th id="hname8" class="dd-datatable-heading"><b>START</b></th>
  <th id="hname9" class="dd-datatable-heading"><b>END</b></th>
  <th id="hname10" class="dd-datatable-heading pull-right"><b>ACTIONS</b></th>
</tr>
</thead>
<tfoot>
</tfoot>
</table>
</code>```

I have tried different approaches by moving my code around, building the table rows dynamically ++, but no luck so far.

Body:
I'm using Datatables on my responsive website with bootstrap 4. I experience a strange behaviour when loading the page on any mobile device. The datatable is visible but it shows the information 'No data available in table'. This also happens on my laptop, but just for a brief second before the content is loaded into the table. As the table renders fine on my laptop I know that the ajax call is responding as expected, so the issue must be elsewhere. I have read forums on datatables.net and here on stackoverflow, but I cannot find a solution to this issue.  My code is posted below, and if you can point me in the right direction, please reply to this question: Why doesn't the table render on mobile device?

Ajax request with response handling:
`

$.ajax({
        url: '../../core/newslist/get_newslist.php',
        data: "",
        dataType: 'json',
        success: function(response)
        {
        var tableArray = response[0];

        var oTable = $("#dd_project_table").DataTable({
        "destroy": true,
        deferRender: true,
        dom: '<"top"i>rt<"bottom"lp><"clear">',
        "language": {
                    "lengthMenu": "Vis _MENU_ resultater per side",
                    "zeroRecords": "Ingen prosjekter å vise",
                    "info": "",
                    "infoFiltered": "",
                    "infoEmpty": "Ingen sider å vise",
                    "sSearch": "Hurtigsøk",
                    "paginate": {
                    "previous": "Forrige",
                    "next": "Neste"}
        },

            "responsive": true,
            "searching": true,
            "scrollX": false,
            "scrollY": "700px",
            "scrollCollapse": true,
            "autoWidth": true,
            "bSort":true,
            "lengthChange": false,
            "pageLength": 12,
            "cursor": "pointer",

             createdRow: function ( row, data, dataIndex, cells ) {
              $(row).attr('draggable', 'true');
            },
             drawCallback: function () {
              // Add HTML5 draggable event listeners to each row
              rows = document.querySelectorAll('#dd_project_table tbody tr');
                [].forEach.call(rows, function(row) {
                  row.addEventListener('dragstart', handleDragStart, false);
                  row.addEventListener('dragenter', handleDragEnter, false)
                  row.addEventListener('dragover', handleDragOver, false);
                  row.addEventListener('dragleave', handleDragLeave, false);
                 row.addEventListener('drop', handleDrop, false);
                  row.addEventListener('dragend', handleDragEnd, false);
                });
            },

            "aaData": tableArray
            });

});//end ajax

Here is the table in my html file

  #
  PROJECT
  LOCATION
  TYPE
  COST
  START
  END
  ACTIONS

I have tried different approaches by moving my code around, building the table rows dynamically ++, but no luck so far.


问:
My browser is not taking my Media query using saas
I'm working on my portfolio for responsiveness on mobile using scss. I tried to use padding or overflow: hidden; it's not working and I also tried to overwrite it using(!important), it's still not working. It's not taking any properties at all for this media query. but takes property for larger screen @media screen and (max-width: 950px) when I inspect from chrome browser. What do you think might be a solution to this problem?

I tried to use padding or overflow: hidden; it's not working and I also tried to overwrite it using(!important) and the justify-content:unset; it's still not working. I'm expecting it to take the property of the smaller screen. mobile size of 390 * 844, like iphone 12pro A51/71

here is what I've tried for smaller screen:

```<code>@media screen and (max-width: 400px) {
   .about-container {
      padding-top: 2.5rem;
   }
   .controls {
      overflow: hidden !important;
      justify-content: center !important;
   }
}
</code>```

but on inspection, it's not taking the properties and i tried other browser, it's still the same.

Body:
I'm working on my portfolio for responsiveness on mobile using scss. I tried to use padding or overflow: hidden; it's not working and I also tried to overwrite it using(!important), it's still not working. It's not taking any properties at all for this media query. but takes property for larger screen @media screen and (max-width: 950px) when I inspect from chrome browser. What do you think might be a solution to this problem?

I tried to use padding or overflow: hidden; it's not working and I also tried to overwrite it using(!important) and the justify-content:unset; it's still not working. I'm expecting it to take the property of the smaller screen. mobile size of 390 * 844, like iphone 12pro A51/71

here is what I've tried for smaller screen:

@media screen and (max-width: 400px) {
   .about-container {
      padding-top: 2.5rem;
   }
   .controls {
      overflow: hidden !important;
      justify-content: center !important;
   }
}

but on inspection, it's not taking the properties and i tried other browser, it's still the same.


问:
How to properly bundle an already compiled executable in Android app using CMake?
If I want to add a custom executable to an Android app using CMake to compile it, I can use the following:

```<code>add_executable(hello_world.so hello_world.cpp)
</code>```

This will bundle the compiled executable in the /lib/{ANDROID_ABI} folder of the APK.
Despite this being an executable, it NEEDS to be named .so, otherwise it won't be packed. There's probably a way to work around this, but this is not my issue at the moment, as the file is properly packed and executes properly with this setup.

However, I'm failing to bundle the executable in the case that I do not want CMake to compile it for me because I already have it. I tried the following:

```<code>add_executable(hello_world.so IMPORTED)

set_target_properties(
        hello_world.so
        PROPERTIES IMPORTED_LOCATION
        ${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI}/hello_world.so)
</code>```

However, in this case, it won't be packed in the APK. The variables and paths are correct. In fact I can use a similar set_target_properties (with same variables and path) to successfully include in the final APK a library added with add_library(lib.so SHARED IMPORTED).

What am I doing wrong?

Body:
If I want to add a custom executable to an Android app using CMake to compile it, I can use the following:

add_executable(hello_world.so hello_world.cpp)

This will bundle the compiled executable in the /lib/{ANDROID_ABI} folder of the APK.
Despite this being an executable, it NEEDS to be named .so, otherwise it won't be packed. There's probably a way to work around this, but this is not my issue at the moment, as the file is properly packed and executes properly with this setup.

However, I'm failing to bundle the executable in the case that I do not want CMake to compile it for me because I already have it. I tried the following:

add_executable(hello_world.so IMPORTED)

set_target_properties(
        hello_world.so
        PROPERTIES IMPORTED_LOCATION
        ${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI}/hello_world.so)

However, in this case, it won't be packed in the APK. The variables and paths are correct. In fact I can use a similar set_target_properties (with same variables and path) to successfully include in the final APK a library added with add_library(lib.so SHARED IMPORTED).

What am I doing wrong?


问:
Is there a way of not showing anything other than the date text on 'input type=datetime-local'
I have removed the date icon with the following css

```<code>input[type="datetime-local"]::-webkit-calendar-picker-indicator {
            display: none;
}
</code>```

This resolves my problems for chrome but in mozilla everytime the input is clicked a date-picker opens up. Also, a clear icon is visible whenever a date value is entered. Is there a way to not show these...

PS: I only care about modern browsers

Body:
I have removed the date icon with the following css

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
            display: none;
}

This resolves my problems for chrome but in mozilla everytime the input is clicked a date-picker opens up. Also, a clear icon is visible whenever a date value is entered. Is there a way to not show these...

PS: I only care about modern browsers


问:
Access to media folder
Which permission is required to read/write files inside folder
/storage/emulated/0/Android/media/packagename/
in Android 11 and Android 13?
It is not for my app, for the folder of another app.
Do you have a little example (some lines of code) for me?</p>

Title: Access to media folder


问:
I can't understand why is the output is -96 of this code
I actually expect that output should be 101 during the first iteration and 3 during the second iteration but it's actually -96 for both iterations.
Here is the code</p>
```<code>const arr = [];

for (var i = 100; i > 0; i = i - 99) {
  arr.push(function () {
    console.log(i);
  });
  i = i + 1;
}

arr.forEach((item) => item());
</code>```

Body:
I actually expect that output should be 101 during the first iteration and 3 during the second iteration but it's actually -96 for both iterations.
Here is the code

const arr = [];

for (var i = 100; i > 0; i = i - 99) {
  arr.push(function () {
    console.log(i);
  });
  i = i + 1;
}

arr.forEach((item) => item());


问:
cant upload file to s3 with cloudfront if access is restricted
I have s3 bucket with restricter put method with only signed url:

```<code>    {
        "Sid": "2",
        "Effect": "Deny",
        "Principal": "*",
        "Action": "s3:PutObject",
        "Resource": "arn:aws:s3:::bucketname/*",
        "Condition": {
            "StringNotLike": {
                "aws:username": "username"
            }
        }
    },
</code>```

I want to allow putObject with cloudfront signed url but it doesnt work and I dont know how to make it work.
So my question is: how to allow cloudfront upload if put method is restricted.

Body:
I have s3 bucket with restricter put method with only signed url:

    {
        "Sid": "2",
        "Effect": "Deny",
        "Principal": "*",
        "Action": "s3:PutObject",
        "Resource": "arn:aws:s3:::bucketname/*",
        "Condition": {
            "StringNotLike": {
                "aws:username": "username"
            }
        }
    },

I want to allow putObject with cloudfront signed url but it doesnt work and I dont know how to make it work.
So my question is: how to allow cloudfront upload if put method is restricted.


问:
How to run Script from "Build Phases" section in archived (deployed) app?
so I'm trying to build a macOS menu bar app that executes a binary (a small server) and closes it when the app is closed. I added "path/to/server >/dev/null 2>&1 &" to the "Run Script"-section in "Build Phases" and it works perfectly when executing the app from Xcode. Now I wanted to store it locally in my Applications-Folder ("Archive" -> "Distribute App" -> "Copy App"). But when I start the app from there, the server does not start. I only found solutions for executing the script before archiving, but it needs to run every time I open the application. (macOS Ventura, Xcode 14)

What do I need to do?

Thanks a lot,
Nicolas


问:
Can't Map An Entity in EfCore
I am Working on a Spa Project using Asp.net core API
So Users Can Enter WebSite And Booking An Health Program
Without Payment
Each Health program has its own duration, the duration of which is the time that the guest will spend in the spa with his Health Program, Each Duration has two Room And DurationType, DurationType is An Enum representing (Week Or nights)
Each Room Has its Owe Room type And Price And Discount
Like Single Room And Shared Room

My Problem
How To Map Booking In Database With EFcore

the booking must Contain one Health Program With one Duration And One Room
And The Relations is Health program has A collection  Form Durations
And Durations have A collection Of Rooms

this is My Implementation

First Ef core Entity

HealthProgram

```<code>public class HealthProgram: BaseEntity
        {
            public string Name { get; set; }
            public string Description { get; set; }
            public string EXPECT { get; set; }
            public string BENEFITS { get; set; }
            public string PACKAGE { get; set; }
            public string NameAR { get; set; }
            public string DescriptionAr { get; set; }
            public string EXPECTAr { get; set; }
            public string BENEFITSAR { get; set; }
            public string PACKAGEAr { get; set; }
            public virtual ICollection<Duration> duration { get; set; }
            public virtual ICollection<ProgramImages> ProgramImages { get; set; }
    }
</code>```

Duration

```<code>public class Duration: BaseEntity
{
    public DurationType DurationType { get; set; }
    public int DurationNumbers { get;set; }
    public int HealthProgramId { get; set; }
    public virtual HealthProgram program { get; set; }
    public virtual ICollection<Room> rooms { get; set; }

}
</code>```

Room

```<code>public class Room: BaseEntity
{
    public RoomType Type { get; set; }
    public decimal Price { get; set; }
    public decimal Discount { get; set; }
    public int durationId { get; set; }
    public virtual Duration duration { get; set; }
}
</code>```

Gust

```<code>public class Gust:BaseEntity
{
    public string FristName { get; set; }
    public string LastName { get; set; }
    public int Age { get; set; }
    public string PhoneNumber { get; set; }
    public string Email { get; set; }
    public int Height { get; set; }
    public int Weight { get; set; }
    public bool cardiovascular_disease { get; set; }
    public bool taking_medications { get; set; }
    public bool practicing_sport { get; set; }
    public bool allergies { get; set; }
    public bool Any_illness { get; set; }
    public int BookedProgramId { get; set; }
    public virtual Booking Booking { get; set; }

}
</code>```

BookedProgram

```<code>public class BookedProgram: BaseEntity
{
    public string ProgramName { get; set; }
    public string ProgramNameAr { get; set; }
    public string duration { get; set; }
    public RoomType Room { get; set; }
    public int RoomId {get;set;}
    [Column(TypeName = "decimal(18,4)")]
    public decimal Price { get; set; }
    public virtual Booking booking { get; set; }
}
</code>```

Booking

```<code>public class Booking:BaseEntity
{
    public int GistId { get; set; }
    public virtual Gust gust { get; set; }
    public int BookedProgramId { get; set; }
    public virtual BookedProgram BookedProgram { get; set; }
    public decimal TotalPrice { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }

}
</code>```

Title: Can't Map An Entity in EfCore

Body:
I am Working on a Spa Project using Asp.net core API
So Users Can Enter WebSite And Booking An Health Program
Without Payment
Each Health program has its own duration, the duration of which is the time that the guest will spend in the spa with his Health Program, Each Duration has two Room And DurationType, DurationType is An Enum representing (Week Or nights)
Each Room Has its Owe Room type And Price And Discount
Like Single Room And Shared Room

My Problem
How To Map Booking In Database With EFcore

the booking must Contain one Health Program With one Duration And One Room
And The Relations is Health program has A collection  Form Durations
And Durations have A collection Of Rooms

this is My Implementation

First Ef core Entity

HealthProgram

public class HealthProgram: BaseEntity
        {
            public string Name { get; set; }
            public string Description { get; set; }
            public string EXPECT { get; set; }
            public string BENEFITS { get; set; }
            public string PACKAGE { get; set; }
            public string NameAR { get; set; }
            public string DescriptionAr { get; set; }
            public string EXPECTAr { get; set; }
            public string BENEFITSAR { get; set; }
            public string PACKAGEAr { get; set; }
            public virtual ICollection<Duration> duration { get; set; }
            public virtual ICollection<ProgramImages> ProgramImages { get; set; }
    }

Duration

public class Duration: BaseEntity
{
    public DurationType DurationType { get; set; }
    public int DurationNumbers { get;set; }
    public int HealthProgramId { get; set; }
    public virtual HealthProgram program { get; set; }
    public virtual ICollection<Room> rooms { get; set; }

}

Room

public class Room: BaseEntity
{
    public RoomType Type { get; set; }
    public decimal Price { get; set; }
    public decimal Discount { get; set; }
    public int durationId { get; set; }
    public virtual Duration duration { get; set; }
}

Gust

public class Gust:BaseEntity
{
    public string FristName { get; set; }
    public string LastName { get; set; }
    public int Age { get; set; }
    public string PhoneNumber { get; set; }
    public string Email { get; set; }
    public int Height { get; set; }
    public int Weight { get; set; }
    public bool cardiovascular_disease { get; set; }
    public bool taking_medications { get; set; }
    public bool practicing_sport { get; set; }
    public bool allergies { get; set; }
    public bool Any_illness { get; set; }
    public int BookedProgramId { get; set; }
    public virtual Booking Booking { get; set; }

}

BookedProgram

public class BookedProgram: BaseEntity
{
    public string ProgramName { get; set; }
    public string ProgramNameAr { get; set; }
    public string duration { get; set; }
    public RoomType Room { get; set; }
    public int RoomId {get;set;}
    [Column(TypeName = "decimal(18,4)")]
    public decimal Price { get; set; }
    public virtual Booking booking { get; set; }
}

Booking

public class Booking:BaseEntity
{
    public int GistId { get; set; }
    public virtual Gust gust { get; set; }
    public int BookedProgramId { get; set; }
    public virtual BookedProgram BookedProgram { get; set; }
    public decimal TotalPrice { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }

}


问:
spark stream stream join error on restart: Provided schema doesn't match to the schema for existing state
I have two stream sources and trying to have s stream stream inner join, it is working as expected when the spark session is running.

after session ends if no new file is added in any of the read stream location then it starts smoothly but if a file is added while the spark session is restarting then it throws the following error inside spark.

SPARK UI ERROR:

```<code>org.apache.spark.sql.execution.streaming.state.StateSchemaNotCompatible: Provided schema doesn't match to the schema for existing state! Please note that Spark allow difference of field name: check count of fields and data type of each field.
Provided key schema: StructType(StructField(field0,LongType,true), StructField(index,LongType,true))
Existing key schema: StructType(StructField(field0,LongType,true), StructField(index,LongType,true))
Provided value schema: StructType(StructField(first_name,StringType,true), StructField(id,LongType,true), StructField(last_name,StringType,true), StructField(status,StringType,true), StructField(matched,BooleanType,true))
Existing value schema: StructType(StructField(first_name,StringType,true), StructField(id,LongType,false), StructField(last_name,StringType,true), StructField(status,StringType,true), StructField(matched,BooleanType,true))
</code>```

In the notebook console shows this message:

```<code>StreamingQueryException: Job aborted. Streaming Query === Identifier: [id = ab5d802a-wxyz, runId = 4496d07c-abcd] Current Committed Offsets: {FileStreamSource[/src2]: {"logOffset":1},FileStreamSource[/src1]: {"logOffset":2}} Current Available Offsets: {FileStreamSource[/src2]: {"logOffset":2},FileStreamSource[/src1]: {"logOffset":2}}

Current State: ACTIVE Thread State: RUNNABLE

Logical Plan: Project [id#67L, first_name#66, last_name#68, status#69, addr1#80, addr2#81] Join Inner, (id#67L = id#82L) StreamingExecutionRelation FileStreamSource[/src1], [first_name#66, id#67L, last_name#68, status#69] StreamingExecutionRelation FileStreamSource[/src2], [addr1#80, addr2#81, id#82L]
</code>```

src1 location json file schema : id(unique key), first_name, last_name, status
src2 location json file schema : id(unique key), addr1, addr2

pyspark join code:

```<code>joined_table=(
    src1_read.join(src2_read, ["id"])
    .writeStream
    .format("delta")
    .option("readChangeFeed", "true")\
    .option("checkpointLocation", f"{change_path}/_checkpoint")
    .start(change_path)
)
joined_table.awaitTermination()
</code>```

I want to create a spark stream stream join that is fault tolerant and can restart smoothly even if data is added to the src1 or src2 location after the session stops.

Body:
I have two stream sources and trying to have s stream stream inner join, it is working as expected when the spark session is running.

after session ends if no new file is added in any of the read stream location then it starts smoothly but if a file is added while the spark session is restarting then it throws the following error inside spark.

SPARK UI ERROR:

org.apache.spark.sql.execution.streaming.state.StateSchemaNotCompatible: Provided schema doesn't match to the schema for existing state! Please note that Spark allow difference of field name: check count of fields and data type of each field.
Provided key schema: StructType(StructField(field0,LongType,true), StructField(index,LongType,true))
Existing key schema: StructType(StructField(field0,LongType,true), StructField(index,LongType,true))
Provided value schema: StructType(StructField(first_name,StringType,true), StructField(id,LongType,true), StructField(last_name,StringType,true), StructField(status,StringType,true), StructField(matched,BooleanType,true))
Existing value schema: StructType(StructField(first_name,StringType,true), StructField(id,LongType,false), StructField(last_name,StringType,true), StructField(status,StringType,true), StructField(matched,BooleanType,true))

In the notebook console shows this message:

StreamingQueryException: Job aborted. Streaming Query === Identifier: [id = ab5d802a-wxyz, runId = 4496d07c-abcd] Current Committed Offsets: {FileStreamSource[/src2]: {"logOffset":1},FileStreamSource[/src1]: {"logOffset":2}} Current Available Offsets: {FileStreamSource[/src2]: {"logOffset":2},FileStreamSource[/src1]: {"logOffset":2}}

Current State: ACTIVE Thread State: RUNNABLE

Logical Plan: Project [id#67L, first_name#66, last_name#68, status#69, addr1#80, addr2#81] Join Inner, (id#67L = id#82L) StreamingExecutionRelation FileStreamSource[/src1], [first_name#66, id#67L, last_name#68, status#69] StreamingExecutionRelation FileStreamSource[/src2], [addr1#80, addr2#81, id#82L]

src1 location json file schema : id(unique key), first_name, last_name, status
src2 location json file schema : id(unique key), addr1, addr2

pyspark join code:

joined_table=(
    src1_read.join(src2_read, ["id"])
    .writeStream
    .format("delta")
    .option("readChangeFeed", "true")\
    .option("checkpointLocation", f"{change_path}/_checkpoint")
    .start(change_path)
)
joined_table.awaitTermination()

I want to create a spark stream stream join that is fault tolerant and can restart smoothly even if data is added to the src1 or src2 location after the session stops.


问:
ethers.js- balanceOf returns a hex string that ignores floats upon conversion
I am using ethers.js to get the balance of a token in my wallet. The balance is: 7628094279162.26502

```<code>const balance = await this.contract.balanceOf(this.signer.getAddress())
</code>```

returns:

```<code>BigNumber {_hex: '0x019d8512e385c0373e9a', _isBigNumber: true}
</code>```

Which parseInt(balance) evaluates to: 7.628094279162265e+21

When formatting balance like this:

```<code>const numForm = Intl.NumberFormat("en-US");
console.log(numForm.format(balance))
</code>```

the result is: 7,628,094,279,162,265,026,202
As you can see, this is ignoring the decimal place-

I should be seeing: 7,628,094,279,162.265026202 and 7e12

I have tried- balance.toLocaleString({params}) as well as Number(balance).toFixed(20) but that returns the same result as parseInt(balance).

I think the issue is the hex value, as converting the hex to a number here: https://www.rapidtables.com/convert/number/hex-to-decimal.html
also ignores the decimal place.

I'm looking to get this number (decimal points don't matter): 7,628,094,279,162

I have tried using this for conversion but no luck.
https://docs.ethers.org/v5/api/utils/bignumber/

Body:
I am using ethers.js to get the balance of a token in my wallet. The balance is: 7628094279162.26502

const balance = await this.contract.balanceOf(this.signer.getAddress())

returns:

BigNumber {_hex: '0x019d8512e385c0373e9a', _isBigNumber: true}

Which parseInt(balance) evaluates to: 7.628094279162265e+21

When formatting balance like this:

const numForm = Intl.NumberFormat("en-US");
console.log(numForm.format(balance))

the result is: 7,628,094,279,162,265,026,202
As you can see, this is ignoring the decimal place-

I should be seeing: 7,628,094,279,162.265026202 and 7e12

I have tried- balance.toLocaleString({params}) as well as Number(balance).toFixed(20) but that returns the same result as parseInt(balance).

I think the issue is the hex value, as converting the hex to a number here: https://www.rapidtables.com/convert/number/hex-to-decimal.html
also ignores the decimal place.

I'm looking to get this number (decimal points don't matter): 7,628,094,279,162

I have tried using this for conversion but no luck.
https://docs.ethers.org/v5/api/utils/bignumber/


问:
eSIM profile disabling issues on Android since API level 33
We are developing an application that downloads and manage eSIM profiles. Since Android 13, we have an issue when compiling the app to API level 33. Reproduced on Pixel 7 and Samsung S20.

From Android 13, the switchToSubscription method has a portIndex parameter.
EuiccManager API reference.

Getting the port index and verifying that we have the entitlement to manage the eSIM works fine.
The profile was downloaded using the same app, so it has carrier privileges.

It works from the system obviously. It works also fine when targeting API level 32 and using the previous switchToSubscription interface.

With:

```<code>public void switchToSubscription (int subscriptionId, int portIndex, PendingIntent callbackIntent)
</code>```

The error we are getting from API level 33 on Android 13:

```<code>FATAL EXCEPTION: main
[...], PID: 22231
java.lang.SecurityException: Must have carrier privileges to use switchToSubscription with portIndex
at android.telephony.evicc.EviccManager.switchToSubscription(EuiccManager.java:1297)
</code>```

Strange fact:

The SubscriptionManager.canManageSubscription(subscriptionInfo) answers true.

The TelephonyManager.hasCarrierPrivileges() answers false
although from the Telephony manager doc:

hasCarrierPrivileges is a superset of the checks done in SubscriptionManager#canManageSubscription

Would anyone knows a way to make this work?

Thanks

Body:
We are developing an application that downloads and manage eSIM profiles. Since Android 13, we have an issue when compiling the app to API level 33. Reproduced on Pixel 7 and Samsung S20.

From Android 13, the switchToSubscription method has a portIndex parameter.
EuiccManager API reference.

Getting the port index and verifying that we have the entitlement to manage the eSIM works fine.
The profile was downloaded using the same app, so it has carrier privileges.

It works from the system obviously. It works also fine when targeting API level 32 and using the previous switchToSubscription interface.

With:

public void switchToSubscription (int subscriptionId, int portIndex, PendingIntent callbackIntent)

The error we are getting from API level 33 on Android 13:

FATAL EXCEPTION: main
[...], PID: 22231
java.lang.SecurityException: Must have carrier privileges to use switchToSubscription with portIndex
at android.telephony.evicc.EviccManager.switchToSubscription(EuiccManager.java:1297)

Strange fact:

The SubscriptionManager.canManageSubscription(subscriptionInfo) answers true.

The TelephonyManager.hasCarrierPrivileges() answers false
although from the Telephony manager doc:

hasCarrierPrivileges is a superset of the checks done in SubscriptionManager#canManageSubscription

Would anyone knows a way to make this work?

Thanks


问:
PowerShell Array error Index was outside the bounds of the array
Hi all I get the following error when running my script:

```<code> Vorgesetzer: 1
Index was outside the bounds of the array.
At line:87 char:20
+         for ($z=0; $z -le $lst_ma_vrg_grp[$i].count-1;$z++){
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], IndexOutOfRangeException
    + FullyQualifiedErrorId : System.IndexOutOfRangeException
</code>```

The Code is:

```<code>#List of Teams and ther Supervisor , "1"  is the Team number

$lst_ma_vrg_grp = @(("1",("Department","Supervisor","Supervisor2","Supervisor3"),("Department2","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department3","Supervisor","Supervisor2","Supervisor3","Supervisor4"),
("2",("Department","Supervisor","Supervisor2","Supervisor3"),("Department2","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department3","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department4","Supervisor","Supervisor2","Supervisor3","Supervisor4"),
("3",("Department4","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department3","Supervisor","Supervisor2","Supervisor3","Supervisor4"),
("4",("Department","Supervisor")))

#All supervisors from all teams with their AD location

$lst_ma_path = @(
("Supervirsor name 1","CN=,OU=,OU=,OU=,DC=,DC=,DC="),
("Supervirsor name 2","CN=,OU=,OU=,OU=,DC=,DC=,DC="),
("Supervirsor name 3","CN=,OU=,OU=,OU=,DC=,DC=,DC="))

#All Departments with their deafult Job Title

$lst_title = @(("Department","Jobtitle1","AJobtitle2","Jobtitle3"),("Department2",""Jobtitle1","AJobtitle2","Jobtitle3","Jobtitle4","AJobtitle5","Jobtitle6"),("Department3",""Jobtitle1","AJobtitle2","Jobtitle3","Jobtitle4","AJobtitle5","Jobtitle6"))
[And so on, it was cut]

cls
$auswahlTeam = Read-Host -Prompt "Welches Team? (1,2,3,4)"
$externer = Read-Host -Prompt "Freelancer? (yes / no): "
$vorname = Read-Host -Prompt "Firstname"
$nachname = Read-Host -Prompt "Lastname"
for ($i=0;$i -le $lst_title.Length-1; $i++)
    {Write-Host $i":" $lst_title[$i][0]}
Write-Output "","----------------------------------"
$numabt = Read-Host -Prompt "Department"
$global:abteilung = $lst_title[$numabt][0]

for ( $i=0;$i -le $lst_ma_vrg_grp.Length-1;$i++){
    if ($auswahlTeam -eq $lst_ma_vrg_grp[$i][0]){
        for ($z=0; $z -le $lst_ma_vrg_grp[$i].count-1;$z++){
            if ($abteilung -eq $lst_ma_vrg_grp[$i][$z][0]){
                for ($c=1;$c -le $lst_ma_vrg_grp[$i][$z].count-1; $c++) {
                    Write-Host $c":" $lst_ma_vrg_grp[$i][$z][$c]
                    }
                Write-Output "","----------------------------------"
                $vorgesetzer = Read-Host -Prompt "Vorgesetzer"
                $vorgesetzer = $lst_ma_vrg_grp[$i][$z][$vorgesetzer]

                for ($i=0;$i -le $lst_ma_path.Length-1;$i++){
                    if ($vorgesetzer -eq $lst_ma_path[$i][0]){
                     $global:vorgesetzer = $lst_ma_path[$i][1]
}}}}}}
</code>```

This script should automatically create users based on the entries you have previously made.

We have different teams that have different departments. The departments have different people who can be a supervisor.

I hope you can help me with the error message, I do not know how to fix it.

Body:
Hi all I get the following error when running my script:

 Vorgesetzer: 1
Index was outside the bounds of the array.
At line:87 char:20
+         for ($z=0; $z -le $lst_ma_vrg_grp[$i].count-1;$z++){
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], IndexOutOfRangeException
    + FullyQualifiedErrorId : System.IndexOutOfRangeException

The Code is:

#List of Teams and ther Supervisor , "1"  is the Team number

$lst_ma_vrg_grp = @(("1",("Department","Supervisor","Supervisor2","Supervisor3"),("Department2","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department3","Supervisor","Supervisor2","Supervisor3","Supervisor4"),
("2",("Department","Supervisor","Supervisor2","Supervisor3"),("Department2","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department3","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department4","Supervisor","Supervisor2","Supervisor3","Supervisor4"),
("3",("Department4","Supervisor","Supervisor2","Supervisor3","Supervisor4"),("Department3","Supervisor","Supervisor2","Supervisor3","Supervisor4"),
("4",("Department","Supervisor")))

#All supervisors from all teams with their AD location

$lst_ma_path = @(
("Supervirsor name 1","CN=,OU=,OU=,OU=,DC=,DC=,DC="),
("Supervirsor name 2","CN=,OU=,OU=,OU=,DC=,DC=,DC="),
("Supervirsor name 3","CN=,OU=,OU=,OU=,DC=,DC=,DC="))

#All Departments with their deafult Job Title

$lst_title = @(("Department","Jobtitle1","AJobtitle2","Jobtitle3"),("Department2",""Jobtitle1","AJobtitle2","Jobtitle3","Jobtitle4","AJobtitle5","Jobtitle6"),("Department3",""Jobtitle1","AJobtitle2","Jobtitle3","Jobtitle4","AJobtitle5","Jobtitle6"))
[And so on, it was cut]

cls
$auswahlTeam = Read-Host -Prompt "Welches Team? (1,2,3,4)"
$externer = Read-Host -Prompt "Freelancer? (yes / no): "
$vorname = Read-Host -Prompt "Firstname"
$nachname = Read-Host -Prompt "Lastname"
for ($i=0;$i -le $lst_title.Length-1; $i++)
    {Write-Host $i":" $lst_title[$i][0]}
Write-Output "","----------------------------------"
$numabt = Read-Host -Prompt "Department"
$global:abteilung = $lst_title[$numabt][0]

for ( $i=0;$i -le $lst_ma_vrg_grp.Length-1;$i++){
    if ($auswahlTeam -eq $lst_ma_vrg_grp[$i][0]){
        for ($z=0; $z -le $lst_ma_vrg_grp[$i].count-1;$z++){
            if ($abteilung -eq $lst_ma_vrg_grp[$i][$z][0]){
                for ($c=1;$c -le $lst_ma_vrg_grp[$i][$z].count-1; $c++) {
                    Write-Host $c":" $lst_ma_vrg_grp[$i][$z][$c]
                    }
                Write-Output "","----------------------------------"
                $vorgesetzer = Read-Host -Prompt "Vorgesetzer"
                $vorgesetzer = $lst_ma_vrg_grp[$i][$z][$vorgesetzer]

                for ($i=0;$i -le $lst_ma_path.Length-1;$i++){
                    if ($vorgesetzer -eq $lst_ma_path[$i][0]){
                     $global:vorgesetzer = $lst_ma_path[$i][1]
}}}}}}

This script should automatically create users based on the entries you have previously made.

We have different teams that have different departments. The departments have different people who can be a supervisor.

I hope you can help me with the error message, I do not know how to fix it.


问:
How can I plot a Chord diagram from my pandas df?
I'm trying to create a Chord Diagram that will represent the relation between two different users, exactly as you can see on the image below;

I read the Plotly tutorial https://plotly.com/python/v3/filled-chord-diagram/ but unfortunately, it's not working well;

I would like to know if someone has experience with this chart or has a good reference that I can use to understand how to implement it

Below is the sample data:

```<code>import pandas as pd

data_dict=[{'users_relation': '5ddd6939<->f3c525e3',
  'user_0_idx': '5ddd6939',
  'user_1_idx': 'f3c525e3',
  'score': 0.8205884909272926,
  'time_order': 0},
 {'users_relation': '5ddd6939<->825b50dc',
  'user_0_idx': '5ddd6939',
  'user_1_idx': '825b50dc',
  'score': 0.7253207649551456,
  'time_order': 0},
 {'users_relation': 'f3c525e3<->825b50dc',
  'user_0_idx': 'f3c525e3',
  'user_1_idx': '825b50dc',
  'score': 0.7933140542847614,
  'time_order': 0}]

chord_diag_data=pd.DataFrame.from_dict(data_dict)

</code>```

Any help/suggestion will be really appreciated and welcome;

**Please note, you can ignore the "time" part, as my focus in building the chart;

Regards,

Body:
I'm trying to create a Chord Diagram that will represent the relation between two different users, exactly as you can see on the image below;

I read the Plotly tutorial https://plotly.com/python/v3/filled-chord-diagram/ but unfortunately, it's not working well;

I would like to know if someone has experience with this chart or has a good reference that I can use to understand how to implement it

Below is the sample data:

import pandas as pd

data_dict=[{'users_relation': '5ddd6939<->f3c525e3',
  'user_0_idx': '5ddd6939',
  'user_1_idx': 'f3c525e3',
  'score': 0.8205884909272926,
  'time_order': 0},
 {'users_relation': '5ddd6939<->825b50dc',
  'user_0_idx': '5ddd6939',
  'user_1_idx': '825b50dc',
  'score': 0.7253207649551456,
  'time_order': 0},
 {'users_relation': 'f3c525e3<->825b50dc',
  'user_0_idx': 'f3c525e3',
  'user_1_idx': '825b50dc',
  'score': 0.7933140542847614,
  'time_order': 0}]

chord_diag_data=pd.DataFrame.from_dict(data_dict)

Any help/suggestion will be really appreciated and welcome;

**Please note, you can ignore the "time" part, as my focus in building the chart;

Regards,


问:
JasperReports: paddings misbehave in table body cells
I have a problem with correctly setting paddings in JasperReports tables.

I'm using styles to uniformly configure text boxes of the same purpose, eg. for displaying currency. However, the paddings behave differently in text fields in table body and table footer. Inside the table, the top and bottom padding works correcly, however, left and right not. The 2 pixels are ignored, so I'd have to use 4 to get 2.

In table footer, paddings work normally, which makes numbers misaligned. But the whole footer cell looks to be shifted.

This is my JRXML fragment:

```<code><jr:tableFooter style="Table_TH" height="16" rowSpan="1">
    <textField>
        <reportElement style="Custom_Currency" x="0" y="0" width="105" height="16" isRemoveLineWhenBlank="true"/>
        <textFieldExpression><![CDATA[$P{taxTotal}]]></textFieldExpression>
    </textField>
</jr:tableFooter>
<jr:detailCell style="Table_TD" height="16">
    <textField>
        <reportElement style="Custom_Currency" x="0" y="0" width="105" height="16" />
        <textFieldExpression><![CDATA[$F{tax}]]></textFieldExpression>
    </textField>
</jr:detailCell>

<style name="Custom_Text" mode="Opaque" backcolor="#EBEBEB" pattern="" isBlankWhenNull="true" fontSize="8">
    <box topPadding="2" leftPadding="2" bottomPadding="2" rightPadding="2">
        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
    </box>
</style>
<style name="Custom_Currency" style="DF_Text" hTextAlign="Right" pattern="#,##0.00">
    <box topPadding="2" leftPadding="4" bottomPadding="2" rightPadding="4"/>
</style>
</code>```

and this is how it looks in action:

How should I declare paddings so that they work consistently in my whole report?

Body:
I have a problem with correctly setting paddings in JasperReports tables.

I'm using styles to uniformly configure text boxes of the same purpose, eg. for displaying currency. However, the paddings behave differently in text fields in table body and table footer. Inside the table, the top and bottom padding works correcly, however, left and right not. The 2 pixels are ignored, so I'd have to use 4 to get 2.

In table footer, paddings work normally, which makes numbers misaligned. But the whole footer cell looks to be shifted.

This is my JRXML fragment:

<jr:tableFooter style="Table_TH" height="16" rowSpan="1">
    <textField>
        <reportElement style="Custom_Currency" x="0" y="0" width="105" height="16" isRemoveLineWhenBlank="true"/>
        <textFieldExpression><![CDATA[$P{taxTotal}]]></textFieldExpression>
    </textField>
</jr:tableFooter>
<jr:detailCell style="Table_TD" height="16">
    <textField>
        <reportElement style="Custom_Currency" x="0" y="0" width="105" height="16" />
        <textFieldExpression><![CDATA[$F{tax}]]></textFieldExpression>
    </textField>
</jr:detailCell>

and this is how it looks in action:

How should I declare paddings so that they work consistently in my whole report?


问:
How to build a DataDriven (CMS) Driven Navigation with Next Js?
The navigation links for my website come from a CMS API end point. They could change at any time so they always need to be up-to-date based on what the API returns.

I tried to use getServerSideProps() inside my _app.js file, but it turns out that Nextjs doesn't allow you to do this.

So my question is how do you build a navigation that will be rendered on every page that is driven via fetching data from an API?


问:
SQL Transaction Log Full when running ShrinkFile SQL Server
I am having an issue with DB Log Full and going through all the things trying to figure out why this is happening. I have of course implemented the backup here.

I run the backup commands for the shrink of the database log, the odd thing is that sometimes the script runs and at other times I get an error.

```<code>  USE [MYDB];
  BACKUP DATABASE [MYDB] TO DISK = 'L:\Backup\MYDB_DB_2023_01_05__T08_10_21.bak' ;
  BACKUP LOG [MYDB] TO DISK = 'L:\Backup\MYDB_log_2023_01_05__T08_10_21.bak'  WITH INIT;
  ALTER DATABASE [MYDB]
  SET RECOVERY SIMPLE;
  DBCC SHRINKFILE(MY_Log, 3000);
  ALTER DATABASE [MYDB]
  SET RECOVERY FULL;
</code>```

I have no idea why I am seeing the error message below since I am running this to backup / truncate the Log.
My DB Log size is set to 3GB & Autogrow with Limit 7GB, SQL Express version is 2017

Msg 3013, Level 16, State 1, Line 4
BACKUP DATABASE is terminating abnormally.  [I don't know why this occurs]

Processed 894794 pages for database 'MYDB', file 'MY_Log' on file 1.
BACKUP LOG successfully processed 894794 pages in 97.732 seconds (71.528 MB/sec).

(1 row affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

(1 row affected)
Msg 9002, Level 17, State 2, Line 4
The transaction log for database 'MYDB' is full due to 'LOG_BACKUP'.

/ Yes I know the Log is full that is why I am running this script! //

EDIT: Comment Requested Info.

Body:
I am having an issue with DB Log Full and going through all the things trying to figure out why this is happening. I have of course implemented the backup here.

I run the backup commands for the shrink of the database log, the odd thing is that sometimes the script runs and at other times I get an error.

  USE [MYDB];
  BACKUP DATABASE [MYDB] TO DISK = 'L:\Backup\MYDB_DB_2023_01_05__T08_10_21.bak' ;
  BACKUP LOG [MYDB] TO DISK = 'L:\Backup\MYDB_log_2023_01_05__T08_10_21.bak'  WITH INIT;
  ALTER DATABASE [MYDB]
  SET RECOVERY SIMPLE;
  DBCC SHRINKFILE(MY_Log, 3000);
  ALTER DATABASE [MYDB]
  SET RECOVERY FULL;

I have no idea why I am seeing the error message below since I am running this to backup / truncate the Log.
My DB Log size is set to 3GB & Autogrow with Limit 7GB, SQL Express version is 2017

Msg 3013, Level 16, State 1, Line 4
BACKUP DATABASE is terminating abnormally.  [I don't know why this occurs]

Processed 894794 pages for database 'MYDB', file 'MY_Log' on file 1.
BACKUP LOG successfully processed 894794 pages in 97.732 seconds (71.528 MB/sec).

(1 row affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

(1 row affected)
Msg 9002, Level 17, State 2, Line 4
The transaction log for database 'MYDB' is full due to 'LOG_BACKUP'.

/ Yes I know the Log is full that is why I am running this script! //

EDIT: Comment Requested Info.


问:
Azure Bot added to Microsoft Teams returning "The bot is not part of the conversation roster" error
I have an Azure bot that we are using to build a message extension functionality in Microsoft Teams.

Users access it via the conversation feature in team channel.  It works by taking a search string entered by a user in the message extension, searching our database for matching entries, and once an entry is selected posting a message into a team channel linking to the resource.

It is working as expected in all environments except for Production, where we see the following behaviour:

Some search strings return the expected ("nothing found") response

But most search strings return a 502 error. The bot's log says "The bot is not part of the conversation roster"

We are sideloading the manifest for the bot and its associated tab app. As far as I can tell, there are no differences in bot or app setup between Production and the other apps we setup (QA, staging, etc)

I've checked the other SO posts and those on the Microsoft PowerUsers forum. They mostly say that the bot needs to be added to Teams in Azure, but this has been done. And it's working for all of our environments except for Production...

This is the manifest. It references the eduMe app already published in AppSource:

{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
  "manifestVersion": "1.11",
  "version": "1.1.3",
  "id": "28beac77-2765-4248-8a25-02779d7242ca",
  "packageName": "com.microsoft.teams.extension",
  "developer": {
    "name": "eduMe",
    "websiteUrl": "https://edume.com",
    "privacyUrl": "https://edume.com",
    "termsOfUseUrl": "https://edume.com"
  },
  "icons": {
    "color": "resources/edume-hexamark.png",
    "outline": "resources/edume-outline-hexamark.png"
  },
  "name": {
    "short": "eduMe Beta_test2",
    "full": "eduMe Beta_test2"
  },
  "description": {
    "short": "Giving the deskless workforce seamless access to relevant knowledge",
    "full": "Training your workforce doesn't need to be painful. No more clunky authoring tools and dated, desktop based learning. eduMe helps you deliver the training when and where your workforce need it."
  },
  "accentColor": "#F3F3FF",
  "bots": [
    {
      "botId": "e9aa4df6-ed17-423f-bb7a-5cb1f6f090d7",
      "scopes": ["personal", "team", "groupchat"],
      "supportsFiles": false,
      "isNotificationOnly": true
    }
  ],
  "composeExtensions": [
    {
      "botId": "29b96f25-2032-4fa4-8abd-5ac8f652699f",
      "commands": [
        {
          "id": "searchQuery",
          "context": ["compose", "commandBox"],
          "description": "Command to search courses.",
          "title": "Search",
          "type": "query",
          "parameters": [
            {
              "name": "searchQuery",
              "title": "Search Query",
              "description": "Your search query",
              "inputType": "text"
            }
          ]
        }
      ]
    }
  ],
  "configurableTabs": [
    {
      "configurationUrl": "https://edume-ms-teams.herokuapp.com/index.html#/config",
      "canUpdateConfiguration": true,
      "scopes": ["team", "groupchat"]
    }
  ],
  "staticTabs": [
    {
      "entityId": "index",
      "name": "Home",
      "contentUrl": "https://edume-ms-teams.herokuapp.com/index.html#/tab",
      "websiteUrl": "https://edume-ms-teams.herokuapp.com/index.html#/tab",
      "scopes": ["personal"]
    }
  ],
  "permissions": ["identity", "messageTeamMembers"],
  "validDomains": [
    "localhost",
    "*.microsoftonline.com",
    "*.herokuapp.com",
    "*.botframework.com",
    "edume.com"
  ],
  "webApplicationInfo": {
    "id": "29b96f25-2032-4fa4-8abd-5ac8f652699f",
    "resource": "api://edume-ms-teams.herokuapp.com/29b96f25-2032-4fa4-8abd-5ac8f652699f"
  }
}
```


问:
Keycloak(20.0) Authorization - Update your own profile
I am using a keycloak version 20.0.1. I have given my user the realm-admin and manage-users roles, but I can't update my own profile (for example changing my name). When I sent a request I got an error - 403 Forbidden.

I sent a PUT request with a payload to the following URL:

http://127.0.0.1:9090/admin/realms/{my-realm}/users/{user-id}

However, it's working if I send the same request from the backend using a service account(SAT). What other roles should I give the user to achieve this functionality?


问:
Android build-tools 32.0.0 not avaiable to download on linux distributions?
Is it possible to download Android build-tools version 32.0.0? Or is there a way to install it by command line? I have a virtual machine build linux distribution (Ubuntu 18.04.4, only SSH terminal available).

Running sdkmanager command android list sdk --all, the results does not list version 32.0.0. I also couldn`t find distro downloads on Android developers oficial website.


问:
Google Cloud logging misses some composer logs
I am monitoring dag runs in cloud composer using Cloud logging. It has airflow task run shows logs most of the times but once in awhile some logs are missing in cloud logging side. I check the Airflow and task logs are there but not in Cloud logging. It happens in TriggerDagRunOperator specifically. Some of them have full logs but some don't so it is random. Is this bug or I am missing something.
Log query:
resource.type="cloud_composer_environment" AND resource.labels.environment_name=sddasdadad AND log_name="projects/pd-sdesdsdsaed/logs/airflow-worker" AND labels.workflow="dadAsdadsadAsdASd" AND labels.execution-date = "2023-01-05T17:00:00+00:00"

I expect to see composer logs on Cloud logging side


问:
e_validation_failure: validation exception adonisjs
I am facing this error "e_validation_failure: validation exception" only on prod enviroment... I am using Adonis 5, in my local everything runs correctly, in stage as well.

my controller looks like this:

```<code>public async store({ request, response }: HttpContextContract) {
    response.header('Cache-Control', 'no-cache, no-store');
    try {
      const payload = await request.validate(SignupUserValidator);
      await UserService.store(payload);

      return responseWithSuccess(response);
    } catch (error) {
      return responseWithError(response, error.message);
    }
  }
</code>```

my validator looks like this:

```<code>import { schema, rules } from '@ioc:Adonis/Core/Validator';
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
import { UserRoleEnum } from 'Contracts/enums';

export default class SignupUserValidator {
  constructor(protected ctx: HttpContextContract) {}

  public schema = schema.create({
    first_name: schema.string({ trim: true }, [rules.minLength(2)]),
    last_name: schema.string({ trim: true }, [rules.minLength(2)]),
    password: schema.string({}, [rules.minLength(8), rules.confirmed()]),
    email: schema.string({}, [
      rules.email(),
      rules.unique({ table: 'users', column: 'email' }),
    ]),
    role: schema.enum([UserRoleEnum.CLIENT, UserRoleEnum.COWORKING] as const),
    photo_id: schema.number.optional([rules.exists({ table: 'photos', column: 'id' })]),
    personal_address: schema.object.optional().members({
      fulltext: schema.string.optional({ trim: true }),
      latitude: schema.number.optional(),
      longitude: schema.number.optional(),
      city: schema.string.optional(),
      state: schema.string.optional(),
      country: schema.string.optional({ trim: true }),
    }),
    personal_phone: schema.string({}, [rules.maxLength(14), rules.minLength(10)]),
    cowork: schema.object
      .optional([rules.requiredWhen('role', '=', UserRoleEnum.COWORKING)])
      .members({
        name: schema.string({ trim: true }),
        email: schema.string.optional({}, [
          rules.email(),
          rules.unique({ table: 'cowork_accounts', column: 'email' }),
        ]),
        phone: schema.string.optional({}, [rules.maxLength(14), rules.minLength(10)]),
        photo_id: schema.number.optional([
          rules.exists({ table: 'photos', column: 'id' }),
        ]),
      }),
    client: schema.object
      .optional([rules.requiredWhen('role', '=', UserRoleEnum.CLIENT)])
      .members({
        company_name: schema.string.optional({ trim: true }),
        company_email: schema.string.optional({}, [rules.email()]),
        company_phone: schema.string.optional({}, [
          rules.maxLength(14),
          rules.minLength(10),
        ]),
        company_address: schema.object.optional().members({
          fulltext: schema.string.optional({ trim: true }),
          latitude: schema.number.optional(),
          longitude: schema.number.optional(),
          country: schema.string.optional({ trim: true }),
        }),
        company_photo_id: schema.number.optional([
          rules.exists({ table: 'photos', column: 'id' }),
        ]),
      }),
  });

  public messages = {
    minLength: 'The {{ field }} must be at least {{ options.minLength }} characters',
    maxLength: 'The {{ field }} must have at most {{ options.maxLength }} characters',
    required: 'The {{ field }} is required',
    exists: 'The {{ field }} is invalid',
    number: 'The {{ field }} must be a number',
    string: 'The {{ string }} must be a string',

    'password_confirmation.confirmed': 'The passwords are different',
    'email.email': 'The email is not valid',
    'email.unique': 'User with email address already exists',
    'cowork.requiredWhen': 'The cowork object must be sent when the user is a coworking',
    'cowork.email.email': 'The email is not valid',
    'cowork.email.unique': 'Company with email address already exists',
    'client.requiredWhen': 'The client object must be sent when the user is a client',
  };
</code>```

My request looks like this:

```<code>{
"first_name": "Dan",
"last_name": "Abreu",
"password": "secret1233",
"password_confirmation": "secret1233",
"email": "test@gmail.com",
"role": "CLIENT",
"personal_phone": "1234567890",
"photo_id": null,
"personal_address": {
    "fulltext": "Rua do Lead",
    "city":"Gravatá",
    "state":"Pe",
    "country":"Brazil",
    "longitude": -10.00,
    "latitude": 1.00
},
"client": {
    "company_name": "my company",
    "company_email": "test1@gmail.com",
    "company_phone": "10800-0000",
    "company_photo_id": null,
    "company_address": {
        "fulltext": "Rua do labrador",
        "longitude": -10.00,
        "latitude": 1.00
    }
}
</code>```

I am following the rules when creating the validator:

node ace make:validator SignupUserValidator

is anyone facing the same issue on aws ec2 enviroment?

I tried to validate the request with the validator I created and everything works fine on my local and stage env but on prod it does not work.

Body:
I am facing this error "e_validation_failure: validation exception" only on prod enviroment... I am using Adonis 5, in my local everything runs correctly, in stage as well.

my controller looks like this:

public async store({ request, response }: HttpContextContract) {
    response.header('Cache-Control', 'no-cache, no-store');
    try {
      const payload = await request.validate(SignupUserValidator);
      await UserService.store(payload);

      return responseWithSuccess(response);
    } catch (error) {
      return responseWithError(response, error.message);
    }
  }

my validator looks like this:

import { schema, rules } from '@ioc:Adonis/Core/Validator';
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
import { UserRoleEnum } from 'Contracts/enums';

export default class SignupUserValidator {
  constructor(protected ctx: HttpContextContract) {}

  public schema = schema.create({
    first_name: schema.string({ trim: true }, [rules.minLength(2)]),
    last_name: schema.string({ trim: true }, [rules.minLength(2)]),
    password: schema.string({}, [rules.minLength(8), rules.confirmed()]),
    email: schema.string({}, [
      rules.email(),
      rules.unique({ table: 'users', column: 'email' }),
    ]),
    role: schema.enum([UserRoleEnum.CLIENT, UserRoleEnum.COWORKING] as const),
    photo_id: schema.number.optional([rules.exists({ table: 'photos', column: 'id' })]),
    personal_address: schema.object.optional().members({
      fulltext: schema.string.optional({ trim: true }),
      latitude: schema.number.optional(),
      longitude: schema.number.optional(),
      city: schema.string.optional(),
      state: schema.string.optional(),
      country: schema.string.optional({ trim: true }),
    }),
    personal_phone: schema.string({}, [rules.maxLength(14), rules.minLength(10)]),
    cowork: schema.object
      .optional([rules.requiredWhen('role', '=', UserRoleEnum.COWORKING)])
      .members({
        name: schema.string({ trim: true }),
        email: schema.string.optional({}, [
          rules.email(),
          rules.unique({ table: 'cowork_accounts', column: 'email' }),
        ]),
        phone: schema.string.optional({}, [rules.maxLength(14), rules.minLength(10)]),
        photo_id: schema.number.optional([
          rules.exists({ table: 'photos', column: 'id' }),
        ]),
      }),
    client: schema.object
      .optional([rules.requiredWhen('role', '=', UserRoleEnum.CLIENT)])
      .members({
        company_name: schema.string.optional({ trim: true }),
        company_email: schema.string.optional({}, [rules.email()]),
        company_phone: schema.string.optional({}, [
          rules.maxLength(14),
          rules.minLength(10),
        ]),
        company_address: schema.object.optional().members({
          fulltext: schema.string.optional({ trim: true }),
          latitude: schema.number.optional(),
          longitude: schema.number.optional(),
          country: schema.string.optional({ trim: true }),
        }),
        company_photo_id: schema.number.optional([
          rules.exists({ table: 'photos', column: 'id' }),
        ]),
      }),
  });

  public messages = {
    minLength: 'The {{ field }} must be at least {{ options.minLength }} characters',
    maxLength: 'The {{ field }} must have at most {{ options.maxLength }} characters',
    required: 'The {{ field }} is required',
    exists: 'The {{ field }} is invalid',
    number: 'The {{ field }} must be a number',
    string: 'The {{ string }} must be a string',

    'password_confirmation.confirmed': 'The passwords are different',
    'email.email': 'The email is not valid',
    'email.unique': 'User with email address already exists',
    'cowork.requiredWhen': 'The cowork object must be sent when the user is a coworking',
    'cowork.email.email': 'The email is not valid',
    'cowork.email.unique': 'Company with email address already exists',
    'client.requiredWhen': 'The client object must be sent when the user is a client',
  };

My request looks like this:

{
"first_name": "Dan",
"last_name": "Abreu",
"password": "secret1233",
"password_confirmation": "secret1233",
"email": "test@gmail.com",
"role": "CLIENT",
"personal_phone": "1234567890",
"photo_id": null,
"personal_address": {
    "fulltext": "Rua do Lead",
    "city":"Gravatá",
    "state":"Pe",
    "country":"Brazil",
    "longitude": -10.00,
    "latitude": 1.00
},
"client": {
    "company_name": "my company",
    "company_email": "test1@gmail.com",
    "company_phone": "10800-0000",
    "company_photo_id": null,
    "company_address": {
        "fulltext": "Rua do labrador",
        "longitude": -10.00,
        "latitude": 1.00
    }
}

I am following the rules when creating the validator:

node ace make:validator SignupUserValidator

is anyone facing the same issue on aws ec2 enviroment?

I tried to validate the request with the validator I created and everything works fine on my local and stage env but on prod it does not work.


问:
Glide how can I do so that the views that were left off the screen are deleted in recyclerview
I am developing a Gallery app. And I'm using the GLIDE library to load thumbnails in a typical Recyclerview with an adapter. Everything is going very well Glide actually loads the thumbnails when I'm scrolling down but when I go back up the images are still loaded and what I want is that the items or view that were left off the screen are deleted and when I return they are loaded again and removed if off screen I hope your great help thank you very much`

```<code>here is my code
</code>```

@Override
public void onBindViewHolder(@NonNull AlbumsAdapter.ViewHolder holder, @SuppressLint("RecyclerView") int position) {

```<code>    holder.miniature.setLayoutParams(new RelativeLayout.LayoutParams(width,width));
    Glide.with(context).load(list.get(position).getPath()).into(holder.miniature);
    holder.album.setText(list.get(position).getDisplayName());

}
</code>```
```<code>type here
</code>```

@Override

```<code>protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_list_album);

    re=(RecyclerView)findViewById(R.id.recycler_list_album);

    re.setHasFixedSize(true);

    re.setItemViewCacheSize(3);

    re.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);

    re.setNestedScrollingEnabled(false);
</code>```

albumsAdapter=new AlbumsAdapter(ListAlbum.this,Albums,itemWidth);

```<code>        re.setAdapter(albumsAdapter);

        re.setAdapter(albumsAdapter);
</code>```

The problem that the images loaded that were left off the screen remain because the size of the application increases as more images are loaded

Body:
I am developing a Gallery app. And I'm using the GLIDE library to load thumbnails in a typical Recyclerview with an adapter. Everything is going very well Glide actually loads the thumbnails when I'm scrolling down but when I go back up the images are still loaded and what I want is that the items or view that were left off the screen are deleted and when I return they are loaded again and removed if off screen I hope your great help thank you very much`

here is my code

@Override
public void onBindViewHolder(@NonNull AlbumsAdapter.ViewHolder holder, @SuppressLint("RecyclerView") int position) {

    holder.miniature.setLayoutParams(new RelativeLayout.LayoutParams(width,width));
    Glide.with(context).load(list.get(position).getPath()).into(holder.miniature);
    holder.album.setText(list.get(position).getDisplayName());

}

type here

@Override

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_list_album);

    re=(RecyclerView)findViewById(R.id.recycler_list_album);

    re.setHasFixedSize(true);

    re.setItemViewCacheSize(3);

    re.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);

    re.setNestedScrollingEnabled(false);

albumsAdapter=new AlbumsAdapter(ListAlbum.this,Albums,itemWidth);

        re.setAdapter(albumsAdapter);

        re.setAdapter(albumsAdapter);

The problem that the images loaded that were left off the screen remain because the size of the application increases as more images are loaded


问:
NextJS + ScrollTrigger (Locomotive)
I'm using NextJS, react-locomotive-scroll and ScrollTrigger’s pin function to pin a testimonial, scroll through it horizontally and then move further down. However, due to react-locomotive-scroll, I need to use the data-scroll-container attribute on my container, which does not work with pin: true in ScrollTrigger, as it makes the element position: fixed and the element therefore disappears. Here is a minimal demo:
https://codesandbox.io/s/cool-noyce-108h6c?file=/pages/index.tsx

When manually setting it to position: absolute the element is there again – this of course does only work as long as you’re not scrolling. Is it related to the data-scroll-container attribute? Is there a fix to pin it?

Thanks in advance!

Title: NextJS + ScrollTrigger (Locomotive)


问:
Logarithmic Transformation in Linear Regression Model Problem - Accuracy of Values at the Exponential Level
I have a problem that I am sure people with more mathematical knowledge may be able to solve fairly easily.  I have a simple model I have built between two variables where an exponential relationship exists.  I have taken the natural log of my target variable and built a linear model.  I am using it to predict on new data.  The predictions are fairly accurate on values up to a certain point (probably at the point of the exponential curve where there is still a somewhat linear relationship), but the larger the independent variable, the less accurate the prediction is.  This makes intuitive sense (I think) - the farther up the exponential curve the values go, the less accurate the model is going to predict, even when log-transforming.

Is there a way to improve the accuracy on all predictions?  Am I approaching this correctly? Can I improve my question?  I can also supply an example if that helps.  Thank you in advance, this is vexing me.

I have tried segmenting my models out - building a linear model for values under a certain point, and values over a certain point.  Naturally the model for the values over a certain point is not as strong.


问:
MudBlazor - Unexpected results when using MudAutocomplete
I am using MudAutocomplete to provide to the user some input suggestions in search box.
I also use MudCard to display the results of filtered items based on the user selected value the list suggestions or search box. The markup is below:

```<code><MudAutocomplete T="string" Placeholder="Search.." @bind-Value="SearchText"
    SearchFunc="@GetSearchSugestions"
    ResetValueOnEmptyText="true"
    CoerceText="true" CoerceValue="true"
    AdornmentIcon="@Icons.Material.Filled.Search" AdornmentColor="Color.Primary" />

@foreach(var item in FilteredItems)
{
   <MudCard>
     <MudCardContent>
        <MudText Typo="Typo.h6">@item.GroupName</MudText>
        <MudText Typo="Typo.subtitle2">@item.Question</MudText>
        <MudText Typo="Typo.body1">@item.Answer</MudText>
     </MudCardContent>
   </MudCard>
   <MudDivider />
}
</code>```

The code behind is

`@code
{

```<code> public string SearchText { get; set; } = string.Empty;
 public List<string> Suggestions { get; set; } = new List<string>();
 public List<Faq> Items {get; set;} = default!;

 public List<Faq> FilteredItems {get; set;} = default!;

 protected override void OnInitialized()
 {
    Items = new List<Faq>()
    {
        new Faq()
        {
            GroupName = "AI",
            Question = "How soon AI will change human labour?",
            Answer = "Very soon"
        },
        new Faq()
        {
            GroupName = "AI",
            Question = "is ChatGP a threat to humanity?",
            Answer = "No, ChatGPT is there to help humanity"
        },
        new Faq()
        {
            GroupName = "War",
            Question = "Is world war 3 inevitable?",
            Answer = "Yes"
        },
        new Faq()
        {
            GroupName = "War",
            Question = "how did world war 2 started?",
            Answer = "Escalation in Europe"
        }
    };

    FilteredItems = Items;
 }

 private async Task<IEnumerable<string>> GetSearchSugestions(string text)
 {
    //..Simulating API call
    await Task.Delay(2);

    var suggestions = new List<string>();

    if(!string.IsNullOrEmpty(text))
    {
        //..Logic for filtering and making suggestions
        var filteredItems = FindFaqsBySearchText(text);
        foreach (var faq in filteredItems)
        {
            if (faq.Question.Contains(text.ToLower()))
            {
                suggestions.Add(faq.Question);
            }

            var words = faq.Answer.Split().Select(a => a.Trim());
            foreach (var word in words)
            {
                if (word.Contains(text.ToLower()) && !suggestions.Contains(text))
                {
                    suggestions.Add(word);
                }
            }
        }
    }

    return (IEnumerable<string>) suggestions;

 }

 private List<Faq> FindFaqsBySearchText(string text)
 {
    FilteredItems = Items.Where(f => f.Question.ToLower().Contains(text.ToLower())
                                    || f.Answer.ToLower().Contains(text.ToLower())
                                    || f.GroupName.ToLower().Contains(text.ToLower()))
                             .ToList();

    return FilteredItems;
 }
</code>```

}`
There are two unexpected results :

If i clear the search box after typing , the area of of the mudcard should display the initial list of content.

2.If i select the suggetion in the search box, i should be provided corresponding exact content not a list of content .
You have to play with my demo in order to see this kind of behaviour.
Thank you for the feedback, i appreciate.
The working demo is https://try.mudblazor.com/snippet/wacdYFuqTPFFlJpF

Body:
I am using MudAutocomplete to provide to the user some input suggestions in search box.
I also use MudCard to display the results of filtered items based on the user selected value the list suggestions or search box. The markup is below:

<MudAutocomplete T="string" Placeholder="Search.." @bind-Value="SearchText"
    SearchFunc="@GetSearchSugestions"
    ResetValueOnEmptyText="true"
    CoerceText="true" CoerceValue="true"
    AdornmentIcon="@Icons.Material.Filled.Search" AdornmentColor="Color.Primary" />

@foreach(var item in FilteredItems)
{
   <MudCard>
     <MudCardContent>
        <MudText Typo="Typo.h6">@item.GroupName</MudText>
        <MudText Typo="Typo.subtitle2">@item.Question</MudText>
        <MudText Typo="Typo.body1">@item.Answer</MudText>
     </MudCardContent>
   </MudCard>
   <MudDivider />
}

The code behind is

`@code
{

 public string SearchText { get; set; } = string.Empty;
 public List<string> Suggestions { get; set; } = new List<string>();
 public List<Faq> Items {get; set;} = default!;

 public List<Faq> FilteredItems {get; set;} = default!;

 protected override void OnInitialized()
 {
    Items = new List<Faq>()
    {
        new Faq()
        {
            GroupName = "AI",
            Question = "How soon AI will change human labour?",
            Answer = "Very soon"
        },
        new Faq()
        {
            GroupName = "AI",
            Question = "is ChatGP a threat to humanity?",
            Answer = "No, ChatGPT is there to help humanity"
        },
        new Faq()
        {
            GroupName = "War",
            Question = "Is world war 3 inevitable?",
            Answer = "Yes"
        },
        new Faq()
        {
            GroupName = "War",
            Question = "how did world war 2 started?",
            Answer = "Escalation in Europe"
        }
    };

    FilteredItems = Items;
 }

 private async Task<IEnumerable<string>> GetSearchSugestions(string text)
 {
    //..Simulating API call
    await Task.Delay(2);

    var suggestions = new List<string>();

    if(!string.IsNullOrEmpty(text))
    {
        //..Logic for filtering and making suggestions
        var filteredItems = FindFaqsBySearchText(text);
        foreach (var faq in filteredItems)
        {
            if (faq.Question.Contains(text.ToLower()))
            {
                suggestions.Add(faq.Question);
            }

            var words = faq.Answer.Split().Select(a => a.Trim());
            foreach (var word in words)
            {
                if (word.Contains(text.ToLower()) && !suggestions.Contains(text))
                {
                    suggestions.Add(word);
                }
            }
        }
    }

    return (IEnumerable<string>) suggestions;

 }

 private List<Faq> FindFaqsBySearchText(string text)
 {
    FilteredItems = Items.Where(f => f.Question.ToLower().Contains(text.ToLower())
                                    || f.Answer.ToLower().Contains(text.ToLower())
                                    || f.GroupName.ToLower().Contains(text.ToLower()))
                             .ToList();

    return FilteredItems;
 }

}`
There are two unexpected results :

If i clear the search box after typing , the area of of the mudcard should display the initial list of content.

2.If i select the suggetion in the search box, i should be provided corresponding exact content not a list of content .
You have to play with my demo in order to see this kind of behaviour.
Thank you for the feedback, i appreciate.
The working demo is https://try.mudblazor.com/snippet/wacdYFuqTPFFlJpF


问:
How do I configure multiple pattern matchers for a VS Code Task?
I'm trying to setup a Visual Studio Code CMake / Ninja project using GNU_ARM_10_2020-q4-major. With the base problem matcher set to "$gcc" it misses a lot messages and I can't figure out multiple patterns.

The following extract from the build output has two messages (saved to test.txt):

```<code>C:/Repos/ProjectN/ProjectN/Dave/Generated/ETH_LWIP/lwip/port/sys_arch.c: In function 'sys_sem_signal':
C:/Repos/ProjectN/ProjectN/Dave/Generated/ETH_LWIP/lwip/port/sys_arch.c:550:14: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  550 |   osStatus_t ret;
      |              ^~~
c:/gnu_arm_10_2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: c:\repos\ProjectN\gfx-src\include/gfx_drawing.hpp:3203: undefined reference to `gfx::font::operator[](int) const'
</code>```

The problem matcher (for testing) is set to:

```<code>        {
            "label": "build",
            "type": "shell",
            "command": "cmd /C type test.txt",
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": {
                "fileLocation": "absolute",
                "severity": "error",
                "pattern": [
                    {
                        "regexp": "(.*):(\\d+):(\\d+): (.*): (.*)",
                        "file": 1,
                        "line": 2,
                        "column": 3,
                        "severity": 4,
                        "message": 5
                    },
                    {
                        "regexp": "(.*ld\\.exe): (.*):(\\d+): (.*)",
                        "file": 2,
                        "line": 3,
                        "message": 4
                    }
                ]
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
</code>```

The above does not match any lines.

If I remove the first pattern, the seconds works and I see an item in the Problems view. If I remove the second pattern, the first works and again I see an item in the Problems view.

Does anyone know what I'm doing wrong here?

Body:
I'm trying to setup a Visual Studio Code CMake / Ninja project using GNU_ARM_10_2020-q4-major. With the base problem matcher set to "$gcc" it misses a lot messages and I can't figure out multiple patterns.

The following extract from the build output has two messages (saved to test.txt):

C:/Repos/ProjectN/ProjectN/Dave/Generated/ETH_LWIP/lwip/port/sys_arch.c: In function 'sys_sem_signal':
C:/Repos/ProjectN/ProjectN/Dave/Generated/ETH_LWIP/lwip/port/sys_arch.c:550:14: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  550 |   osStatus_t ret;
      |              ^~~
c:/gnu_arm_10_2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: c:\repos\ProjectN\gfx-src\include/gfx_drawing.hpp:3203: undefined reference to `gfx::font::operator[](int) const'

The problem matcher (for testing) is set to:

        {
            "label": "build",
            "type": "shell",
            "command": "cmd /C type test.txt",
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": {
                "fileLocation": "absolute",
                "severity": "error",
                "pattern": [
                    {
                        "regexp": "(.*):(\\d+):(\\d+): (.*): (.*)",
                        "file": 1,
                        "line": 2,
                        "column": 3,
                        "severity": 4,
                        "message": 5
                    },
                    {
                        "regexp": "(.*ld\\.exe): (.*):(\\d+): (.*)",
                        "file": 2,
                        "line": 3,
                        "message": 4
                    }
                ]
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }

The above does not match any lines.

If I remove the first pattern, the seconds works and I see an item in the Problems view. If I remove the second pattern, the first works and again I see an item in the Problems view.

Does anyone know what I'm doing wrong here?


问:
New Image asset dialog does not open in android studio 3.1
Be informed, we are encountering a freak error in our android studio ide since a week. Whenever we right click "res/" folder and click new image asset, the new image asset dialog just does not open up. We tried opening it in different android projects but everywhere the IDE just stands still not opening any dialog. We are at loss as where this problem could be. Is there a need to upgrade to new android studio perhaps ? Any guidance on this issue would
be appreciated.</p>


问:
How to collect sets as values from a map in java stream?
I have such structure:

```<code>Map<Integer, Set<Integer>> structureIdWithUserIds
</code>```

And I need to process all values(Sets) and concatinate them in one Set of Integers. What is the easiest way to do that?

Body:
I have such structure:

Map<Integer, Set<Integer>> structureIdWithUserIds

And I need to process all values(Sets) and concatinate them in one Set of Integers. What is the easiest way to do that?