问:
OpenCV & OpenCV contrib build Windows 11
I'm trying to play around with OpenCV and OpenCV Face (a contrib module). Unfortunately I'm bound to a Windows devivce. Furhermore the OpenCV Windows download does not contain the contrib modules e.g. the face one which I need, so I tried to build OpenCV with OpenCV contrib myself. The project itself should run on Windows & Linux.

If I use the prebuild OpenCV files (except the face module), everything works just fine.

Windows specs:

CMake file

```<code>cmake_minimum_required(VERSION 3.24)
project(smart_mirror)

set(CMAKE_CXX_STANDARD 23)
include(FetchContent)

add_compile_definitions(JM_DEBUG_MODE=true)

# Add the main target
add_executable(smart_mirror main.cpp src/CameraDevice.cpp "src/VideoProcessor.h" "src/MotionVideoProcessor.cpp" "src/FaceRecognitionVideoProcessor.cpp" "src/FaceDetectorVideoProcessor.cpp")

find_package(OpenCV REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core WebSockets)

FetchContent_Declare(
    spdlog
    GIT_REPOSITORY https://github.com/gabime/spdlog.git
    GIT_TAG v1.11.0
    FIND_PACKAGE_ARGS
)
FetchContent_MakeAvailable(spdlog)

# Add the OpenCV include directories to the main target
target_include_directories(smart_mirror PRIVATE ${OpenCV_INCLUDE_DIRS})

# Link the main target with OpenCV
target_link_libraries(smart_mirror ${OpenCV_LIBS} spdlog Qt6::Core Qt6::WebSockets)

message(STATUS "Add libs: ${OpenCV_LIBS} and includes: ${OpenCV_INCLUDE_DIRS}")
</code>```

Project CMake configure (contains a line with all OpenCV_LIBS printed as STATUS message for debugging)

```<code>1> CMake generation started for default configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="Y:\smart-mirror\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe"  -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "Y:\smart-mirror" 2>&1"
1> Working directory: Y:\smart-mirror\out\build\x64-Debug
1> [CMake] -- The C compiler identification is MSVC 19.34.31937.0
1> [CMake] -- The CXX compiler identification is MSVC 19.34.31937.0
1> [CMake] -- Detecting C compiler ABI info
1> [CMake] -- Detecting C compiler ABI info - done
1> [CMake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting C compile features
1> [CMake] -- Detecting C compile features - done
1> [CMake] -- Detecting CXX compiler ABI info
1> [CMake] -- Detecting CXX compiler ABI info - done
1> [CMake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting CXX compile features
1> [CMake] -- Detecting CXX compile features - done
1> [CMake] -- Found OpenCV: C:/opencv (found version "4.7.0")
1> [CMake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
1> [CMake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
1> [CMake] -- Looking for pthread_create in pthreads
1> [CMake] -- Looking for pthread_create in pthreads - not found
1> [CMake] -- Looking for pthread_create in pthread
1> [CMake] -- Looking for pthread_create in pthread - not found
1> [CMake] -- Found Threads: TRUE
1> [CMake] -- Performing Test HAVE_STDATOMIC
1> [CMake] -- Performing Test HAVE_STDATOMIC - Success
1> [CMake] -- Found WrapAtomic: TRUE
1> [CMake] -- Build spdlog: 1.11.0
1> [CMake] -- Build type: Debug
1> [CMake] -- Add libs: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_aruco;opencv_barcode;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dnn_superres;opencv_dpm;opencv_face;opencv_fuzzy;opencv_hfs;opencv_img_hash;opencv_intensity_transform;opencv_line_descriptor;opencv_mcc;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_quality;opencv_rapid;opencv_reg;opencv_rgbd;opencv_saliency;opencv_shape;opencv_stereo;opencv_structured_light;opencv_superres;opencv_surface_matching;opencv_text;opencv_tracking;opencv_videostab;opencv_wechat_qrcode;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto and includes: C:/opencv/include
1> [CMake] -- Configuring done
1> [CMake] -- Generating done
1> [CMake] -- Build files have been written to: Y:/smart-mirror/out/build/x64-Debug
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.
</code>```

CMake build command respectively with and without -DBUILD_opencv_world

```<code>cmake -B "build" -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENGL=ON -DWITH_QT=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=ON -DBUILD_JAVA=OFF -DBUILD_FAT_JAVA_LIB=OFF -DBUILD_DOCS=OFF -DVIDEOIO_PLUGIN_LIST=all -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -DBUILD_EXAMPLES=OFF .
</code>```

I encountered two error cases depending on the CMake settings

1. BUILD_opencv_world=ON

If I run cmake --build build --config Release to build the libs it stops kind of after building opencv_world. If I open the Visual Studio solution to build I get error messages related to opencv_world

Error output (cmake --build runs until the very first marked line and stop without any output, so first I thought everything built without error)

Error list

2. -DBUILD_opencv_world=OFF

Because I rooted the build issue cause at the opencv_world module (which normally comes with the prebuild binaries), I tried to build without them. This build works but then I get undefined reference error of the linker.

Linker error in Visual Studio while building my project

Edit

I also tried the combi ninja + clang but also no luck. Here it fails even earlier

Ninja + clang fail

Body:
I'm trying to play around with OpenCV and OpenCV Face (a contrib module). Unfortunately I'm bound to a Windows devivce. Furhermore the OpenCV Windows download does not contain the contrib modules e.g. the face one which I need, so I tried to build OpenCV with OpenCV contrib myself. The project itself should run on Windows & Linux.

If I use the prebuild OpenCV files (except the face module), everything works just fine.

Windows specs:

CMake file

cmake_minimum_required(VERSION 3.24)
project(smart_mirror)

set(CMAKE_CXX_STANDARD 23)
include(FetchContent)

add_compile_definitions(JM_DEBUG_MODE=true)

# Add the main target
add_executable(smart_mirror main.cpp src/CameraDevice.cpp "src/VideoProcessor.h" "src/MotionVideoProcessor.cpp" "src/FaceRecognitionVideoProcessor.cpp" "src/FaceDetectorVideoProcessor.cpp")

find_package(OpenCV REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core WebSockets)

FetchContent_Declare(
    spdlog
    GIT_REPOSITORY https://github.com/gabime/spdlog.git
    GIT_TAG v1.11.0
    FIND_PACKAGE_ARGS
)
FetchContent_MakeAvailable(spdlog)

# Add the OpenCV include directories to the main target
target_include_directories(smart_mirror PRIVATE ${OpenCV_INCLUDE_DIRS})

# Link the main target with OpenCV
target_link_libraries(smart_mirror ${OpenCV_LIBS} spdlog Qt6::Core Qt6::WebSockets)

message(STATUS "Add libs: ${OpenCV_LIBS} and includes: ${OpenCV_INCLUDE_DIRS}")

Project CMake configure (contains a line with all OpenCV_LIBS printed as STATUS message for debugging)

1> CMake generation started for default configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="Y:\smart-mirror\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe"  -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "Y:\smart-mirror" 2>&1"
1> Working directory: Y:\smart-mirror\out\build\x64-Debug
1> [CMake] -- The C compiler identification is MSVC 19.34.31937.0
1> [CMake] -- The CXX compiler identification is MSVC 19.34.31937.0
1> [CMake] -- Detecting C compiler ABI info
1> [CMake] -- Detecting C compiler ABI info - done
1> [CMake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting C compile features
1> [CMake] -- Detecting C compile features - done
1> [CMake] -- Detecting CXX compiler ABI info
1> [CMake] -- Detecting CXX compiler ABI info - done
1> [CMake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting CXX compile features
1> [CMake] -- Detecting CXX compile features - done
1> [CMake] -- Found OpenCV: C:/opencv (found version "4.7.0")
1> [CMake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
1> [CMake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
1> [CMake] -- Looking for pthread_create in pthreads
1> [CMake] -- Looking for pthread_create in pthreads - not found
1> [CMake] -- Looking for pthread_create in pthread
1> [CMake] -- Looking for pthread_create in pthread - not found
1> [CMake] -- Found Threads: TRUE
1> [CMake] -- Performing Test HAVE_STDATOMIC
1> [CMake] -- Performing Test HAVE_STDATOMIC - Success
1> [CMake] -- Found WrapAtomic: TRUE
1> [CMake] -- Build spdlog: 1.11.0
1> [CMake] -- Build type: Debug
1> [CMake] -- Add libs: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_aruco;opencv_barcode;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dnn_superres;opencv_dpm;opencv_face;opencv_fuzzy;opencv_hfs;opencv_img_hash;opencv_intensity_transform;opencv_line_descriptor;opencv_mcc;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_quality;opencv_rapid;opencv_reg;opencv_rgbd;opencv_saliency;opencv_shape;opencv_stereo;opencv_structured_light;opencv_superres;opencv_surface_matching;opencv_text;opencv_tracking;opencv_videostab;opencv_wechat_qrcode;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto and includes: C:/opencv/include
1> [CMake] -- Configuring done
1> [CMake] -- Generating done
1> [CMake] -- Build files have been written to: Y:/smart-mirror/out/build/x64-Debug
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.

CMake build command respectively with and without -DBUILD_opencv_world

cmake -B "build" -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENGL=ON -DWITH_QT=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=ON -DBUILD_JAVA=OFF -DBUILD_FAT_JAVA_LIB=OFF -DBUILD_DOCS=OFF -DVIDEOIO_PLUGIN_LIST=all -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -DBUILD_EXAMPLES=OFF .

I encountered two error cases depending on the CMake settings

1. BUILD_opencv_world=ON

If I run cmake --build build --config Release to build the libs it stops kind of after building opencv_world. If I open the Visual Studio solution to build I get error messages related to opencv_world

Error output (cmake --build runs until the very first marked line and stop without any output, so first I thought everything built without error)

Error list

2. -DBUILD_opencv_world=OFF

Because I rooted the build issue cause at the opencv_world module (which normally comes with the prebuild binaries), I tried to build without them. This build works but then I get undefined reference error of the linker.

Linker error in Visual Studio while building my project

Edit

I also tried the combi ninja + clang but also no luck. Here it fails even earlier

Ninja + clang fail


来源: stackexchange

问:
Angular Reactive Forms data rendering only in Mozilla Firefox
While fetching the data from the server into Angular reactive forms, everything works properly in Mozilla Firefox, but not in other browsers. Server endpoint is tested via Postman tool and it works fine. Below are the relevant code chunks that display the form definitions and their functionality.

This device selection displays Solar generators and by clicking on one, we call a getDevice() function that expects an id from a selected Solar Generator

```<code><form [formGroup]="createSolarGeneratorForm" (ngSubmit)="onSubmit()">
  <div class="form-group">
    <label for="select_device">Select device</label><br />
    <select name="deviceName" (change)="changeDeviceName($event)" formControlName="deviceName" class="custom-select"
      id="deviceName" required>
      <option name="deviceName" [value]="solar.deviceName" *ngFor="let solar of solars; index as i"
        (click)="getDevice(solar?.id)"> {{ solar.deviceName }}
      </option>
    </select>
  </div>
</form>
</code>```

getDevice() - a method that's supposed to patch values from the selected Solar to the current form

```<code>getDevice(id: number) {
  this.solarService.getSolarGeneratorById(id).subscribe(response => {
    this.selectedSolar
      = response;
    this.islandService.getIslandByName(this.selectedSolar?.island.islandName).subscribe(response => {
      this.island
        =
        response[0];
      this.createSolarGenerator Form.patchValue({
        currentPower: this.selectedSolar?.currentPower,
        temperatureIrradiance: this.selectedSolar?.temperatureIrradiance,
        island: this.island
      });
    })
  });
}
</code>```

These are the fields that should get patched

```<code><div class="form-group">
  <label for="name">Current power</label><br />
  <select name="currentPower" (change)="changeCurrentPower($event)" formControlName="currentPower" class="custom-select"
    id="currentPower">
    <option [selected]="true">{{ selectedSolar?.currentPower }}</option>
  </select>
</div>
<div class="form-group">
  <label for="name">Temperature irradiance</label><br />
  <select name="temperatureIrradiance" (change)="changeTemperatureIrradiance($event)"
    formControlName="temperatureIrradiance" class="custom-select" id="temperatureIrradiance">
    <option [selected]="true">{{ selectedSolar?.temperatureIrradiance }}</option>
  </select>
</div>
<div class="form-group">
  <label for="islandid">This device belongs to island</label><br />
  <select name="islandname" (change)="changeIslandId($event)" formControlName="island_name" class="custom-select"
    id="islandname">
    <option [selected]="true">{{ (selectedSolar)?.island.islandName}}</option>
  </select>
</div>
</code>```

This is the form's structure

```<code>createSolarGeneratorForm = this.fb.group({
  deviceName: ['', [Validators.required]],
  maxPower: ['', [Validators.required, Validators.min(0)]],
  currentPower: [''],
  temperatureIrradiance: [''],
  island: [''],
});
</code>```

API call from the service returning SolarGenerator by passing an id

```<code>getSolarGeneratorById(id: number) {
  let params = new HttpParams().set("id", id);
  return this.httpclient.get<SolarGenerator>(`~${API_URL}/api/solarGenerator/find_by_id`, {params});
}
</code>```

The API call works properly when called via Postman tool

I've tried testing in Chrome and Brave and nothing happens when a getDevice() function gets called by a user click.

ContentLicense: CC BY-SA 4.0

Body:
While fetching the data from the server into Angular reactive forms, everything works properly in Mozilla Firefox, but not in other browsers. Server endpoint is tested via Postman tool and it works fine. Below are the relevant code chunks that display the form definitions and their functionality.

This device selection displays Solar generators and by clicking on one, we call a getDevice() function that expects an id from a selected Solar Generator

<form [formGroup]="createSolarGeneratorForm" (ngSubmit)="onSubmit()">

    Select device

    <select name="deviceName" (change)="changeDeviceName($event)" formControlName="deviceName" class="custom-select"
      id="deviceName" required>
      <option name="deviceName" [value]="solar.deviceName" *ngFor="let solar of solars; index as i"
        (click)="getDevice(solar?.id)"> {{ solar.deviceName }}
      </option>
    </select>

</form>

getDevice() - a method that's supposed to patch values from the selected Solar to the current form

getDevice(id: number) {
  this.solarService.getSolarGeneratorById(id).subscribe(response => {
    this.selectedSolar
      = response;
    this.islandService.getIslandByName(this.selectedSolar?.island.islandName).subscribe(response => {
      this.island
        =
        response[0];
      this.createSolarGenerator Form.patchValue({
        currentPower: this.selectedSolar?.currentPower,
        temperatureIrradiance: this.selectedSolar?.temperatureIrradiance,
        island: this.island
      });
    })
  });
}

These are the fields that should get patched

  Current power

  <select name="currentPower" (change)="changeCurrentPower($event)" formControlName="currentPower" class="custom-select"
    id="currentPower">
    <option [selected]="true">{{ selectedSolar?.currentPower }}</option>
  </select>

  Temperature irradiance

  <select name="temperatureIrradiance" (change)="changeTemperatureIrradiance($event)"
    formControlName="temperatureIrradiance" class="custom-select" id="temperatureIrradiance">
    <option [selected]="true">{{ selectedSolar?.temperatureIrradiance }}</option>
  </select>

  This device belongs to island

  <select name="islandname" (change)="changeIslandId($event)" formControlName="island_name" class="custom-select"
    id="islandname">
    <option [selected]="true">{{ (selectedSolar)?.island.islandName}}</option>
  </select>

This is the form's structure

createSolarGeneratorForm = this.fb.group({
  deviceName: ['', [Validators.required]],
  maxPower: ['', [Validators.required, Validators.min(0)]],
  currentPower: [''],
  temperatureIrradiance: [''],
  island: [''],
});

API call from the service returning SolarGenerator by passing an id

getSolarGeneratorById(id: number) {
  let params = new HttpParams().set("id", id);
  return this.httpclient.get<SolarGenerator>(`~${API_URL}/api/solarGenerator/find_by_id`, {params});
}

The API call works properly when called via Postman tool

I've tried testing in Chrome and Brave and nothing happens when a getDevice() function gets called by a user click.


问:
Smoothly transitioning one mesh to another
I have two meshes Mesh1 and Mesh2. Mesh1 does not necessarily have the same amount of vertices or faces as Mesh2.

What is the best way to "transition" between these two meshes smoothly?

Obviously, I could do a linear interpolation of some sort. But there are some problems beyond this that I need to solve. One problem that I'm facing is the "not necessarily have the same amount of vertices or faces" part. Maybe I need to bypass this restriction by taking one of my faces in one of the meshes and subdividing it until there's the same amount of faces in both meshes (would this adjust the result in a weird way, like an "explosion" in the subdivided part?)

However, the main problem is choosing which faces on Mesh1 correspond to Mesh2. Is there any algorithm that can accomplish this?


问:
Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:2.6.6
please help me for this error...Thanks is advance...

Could not transfer artifacts from/to central maven repo when using Spring Framework Cloud

I tried all the way which mentioned in this link


问:
Pipeline Code for Querying Aurora Serverless in AWS AppSync
Before It was easy to write queries in request template and response template using statements. Now appsync resolver is connected to pipeline where the code has to be written. I am unable to figure out how to write the query inside the pipeline function. Could you please help me out?


问:
DBSCAN clustering of periodic (Cyclical) time data
I am using Matlab's DBSCAN function to cluster data collected from a workplace that shows the times of Customer In and CUstomer out (in hours). When I ran dbscan, it works fine for data points that has in and out times during the day. However, when customer in is near midnight (23:XX) and out is after midnight), due to high euclean distance, dbscan fails to group them together. Does anyone know how to introduce modulo (or something else another metric?) to handle this issue?
my code

```<code>idx = dbscan(data,0.7,35);
outliers = sum(idx==-1);
outlierPercentage = outliers / length(idx)
gscatter(data(:,1),data(:,2),idx);
 xlabel('Customer In (hour)')
 ylabel('Customer Out (Hour)')
</code>```

Sample Data

I am expecting a way to implent a way to cluster data efficiently by enabling periodicity.

Body:
I am using Matlab's DBSCAN function to cluster data collected from a workplace that shows the times of Customer In and CUstomer out (in hours). When I ran dbscan, it works fine for data points that has in and out times during the day. However, when customer in is near midnight (23:XX) and out is after midnight), due to high euclean distance, dbscan fails to group them together. Does anyone know how to introduce modulo (or something else another metric?) to handle this issue?
my code

idx = dbscan(data,0.7,35);
outliers = sum(idx==-1);
outlierPercentage = outliers / length(idx)
gscatter(data(:,1),data(:,2),idx);
 xlabel('Customer In (hour)')
 ylabel('Customer Out (Hour)')

Sample Data

I am expecting a way to implent a way to cluster data efficiently by enabling periodicity.


问:
How to set iteration limit for subsolver ipopt in mindtpy using pyomo?
i am new with using pyomo and mindtpy solver, and have a very basic question.
how can i set the iteration limit for a subsolver in mindtpy? I want to set the iteration limit of ipopt, but it seems like it is not possible.

I treid the following code:

result = opt.solve(model, strategy='OA', init_strategy='FP', iteration_limit=100000, time_limit=36000, constraint_tolerance=10e-5, fp_iteration_limit=10000, fp_mipgap=10e-3, mip_solver='cplex', heuristic_nonconvex=True, mip_solver_args={'timelimit': 36000, 'warmstart': True}, mip_solver_mipgap=0.001, nlp_solver='ipopt', nlp_solver_args={'timelimit': 36000, 'maxiter': 10000}, tee=True, mip_solver_tee=True, nlp_solver_tee=True)

Setting the timelimit works and iteration limit not! I also tried it with iteration_limit instead of maxiter or max_iter.

I always get the error: ValueError: ProblemWriter_nl passed unrecognized io_options: maxiter = 10000

Thank you very much!

Kind regards


问:
Visual Studio: New new project dialog?
I thought I saw on the web a few months back talk of a replacement for the Visual Studio "New Project" dialog that was foisted on us in 2019.
I have spent a while googling and looking through the VS Suggest A Feature site but now I can't see a new/preview version of the New Project dialog referenced anywhere.

Can anyone help on this?  Or did I dream that it was going to be replaced, and 2019 usability nightmare continues? :-)

Thank you!

Title: Visual Studio: New new project dialog?


问:
ReportViewer 15.0.0.0 shows scrollbar along the parameter and report body section
We have an MVC web application, and recently we migrated from Microsoft ReportViewer from 11.0.0.0 to 15.0.0.0 version.

We started having different issues in terms of UI, one of which is mentioned as below.

When we run the report from SSRS (SQL Server 2016), we can see that the vertical scroll bar is displayed only in the report body section, as shown in below image

However when we display this report from our MVC web application, the vertical scroll bar covers the parameter as well as report body section, as shown below

Any idea why we are facing such issue with ReportViewer 15.0.0.0 ? We were not facing such issue with ReportViewer 11.0.0.0

Following is the screenshot of how we have used ReportViewer control


问:
How to move files from inside app to outside
I try to move files from documentDirectory to SD Card(connected using a card reader and Lightning). I use UIDocumentPickerViewController. If I move a single file and it exists inside the destination SD Card folder, DocumentPicker gives options "Replace" and "Keep Both". But, If I move more than one file, I have no these options. It automatically uses the "Keep Both" option if it already exists.

How can I move files outside of the app, with "Replace" option? Replace SS

I used UIDocumentPickerViewController and also tried moving files, using FileManager(but I have no access to write). Tried moving files with NSFileCoordinator.


问:
Code won't be executed in the injector but only in devtools console
I have some troubles regarding the code. It will be succesfully executed if pasted directly in DevConsole, while the same code used to be injected by a injector (addon) gives an error:
De code is: $("XXXXXXX").updateCaseOwnertoSelf();

If executed from the plugin it gives an error

The same code pasted in DevTools Console goes OK - is there a plugin/addon which would paste the code in the console and execute it?
document.querySelector won't work so I use a dollar sign instead.

I may change the plugin but the problem is why there is a difference in the code execution between an addon and dev console.


问:
What information goes to app developer when user buys in-app purchase on ios 16?
What information goes to app developer when user buys in-app purchase (subscription)? Are anything of the following revealed to developers?

Unique Identifier

First and last name

Apple ID

Email

Age

Address

I'm asking from perspective of developing a protection from creating multiple premium accounts by one user.


问:
Newman Some request are not going to server
To run the Api collection Parallelly I am using Node, Postman and Newman library to do it.
Here I have 2 api collections saved in a collections folder. I have in total 5 -5 api request saved in a collection. When I am running the collection. I am seeing all the 5 request are ran successfully but data not updated in the backend</p>
```<code>    var path = require('path'),
async = require('async'),
newman = require('newman');

var parametersForTestRun = {
    collection: path.join('./collections/', 'cc1'), // your collection
    environment: path.join('./', 'env.json'), //your env
};

var parametersForTestRun2 = {
    collection: path.join('./collections/', 'cc2'), // your collection
    environment: path.join('./', 'env.json'), //your env
};

parallelCollectionRun = function (done) {
    newman.run(parametersForTestRun, done);
    setTimeout(function(){}, [4000]);

};

parallelCollectionRun2 = function (done) {
    newman.run(parametersForTestRun2, done);
    setTimeout(function(){}, [3000]);

};

// Runs the Postman sample collection thrice, in parallel.

async.parallel([
    parallelCollectionRun,
    parallelCollectionRun2

],
    function (err, results) {
        err && console.error(err);

        results.forEach(function (result) {
            var failures = result.run.failures;
            console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
                `${result.collection.name} ran successfully.`);
        });
    }
);
</code>```

Body:
To run the Api collection Parallelly I am using Node, Postman and Newman library to do it.
Here I have 2 api collections saved in a collections folder. I have in total 5 -5 api request saved in a collection. When I am running the collection. I am seeing all the 5 request are ran successfully but data not updated in the backend

    var path = require('path'),
async = require('async'),
newman = require('newman');

var parametersForTestRun = {
    collection: path.join('./collections/', 'cc1'), // your collection
    environment: path.join('./', 'env.json'), //your env
};

var parametersForTestRun2 = {
    collection: path.join('./collections/', 'cc2'), // your collection
    environment: path.join('./', 'env.json'), //your env
};

parallelCollectionRun = function (done) {
    newman.run(parametersForTestRun, done);
    setTimeout(function(){}, [4000]);

};

parallelCollectionRun2 = function (done) {
    newman.run(parametersForTestRun2, done);
    setTimeout(function(){}, [3000]);

};

// Runs the Postman sample collection thrice, in parallel.

async.parallel([
    parallelCollectionRun,
    parallelCollectionRun2

],
    function (err, results) {
        err && console.error(err);

        results.forEach(function (result) {
            var failures = result.run.failures;
            console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
                `${result.collection.name} ran successfully.`);
        });
    }
);


问:
Is it possible to connect Oracle SQL Developer Data Modeler to Microsoft SQL Server?
Is it possible to connect Oracle SQL Developer Data Modeler to Microsoft SQL Server? I want to retrieve all the database tables/columns to create a data model as a reference. If yes, how?

Thank you


问:
getting an Error. FileNotFoundError: [Errno 2] No such file or directory: 'data_images\\1 (1).jpg'
I'm working on object detection with YOLOV5. the last, when I saved the images and labels in the text in the folder, I got an Error. FileNotFoundError: [Errno 2] No such file or directory: 'data_images\\1 (1).jpg'

def save_data(filename, folder_path, group_obj):
    src = os.path.join('data_images',filename)
    dst = os.path.join(folder_path,filename)
    move(src,dst) # move image to the destination folder

    # save the labels
    text_filename = os.path.join(folder_path, os.path.splitext(filename)[0]+'.txt')
    group_obj.get_group(filename).set_index('filename').to_csv(text_filename,sep=' ',index=False,header=False)
```

How to solve. I checked the data is present.

Body:
I'm working on object detection with YOLOV5. the last, when I saved the images and labels in the text in the folder, I got an Error. FileNotFoundError: [Errno 2] No such file or directory: 'data_images\\1 (1).jpg'

def save_data(filename, folder_path, group_obj):
    src = os.path.join('data_images',filename)
    dst = os.path.join(folder_path,filename)
    move(src,dst) # move image to the destination folder

    # save the labels
    text_filename = os.path.join(folder_path, os.path.splitext(filename)[0]+'.txt')
    group_obj.get_group(filename).set_index('filename').to_csv(text_filename,sep=' ',index=False,header=False)

How to solve. I checked the data is present.


问:
Collect all pickups while passing on the street for the first time in Jsprit
I'm trying to solve a simple TSP with Jsprit. I only have 1 vehicle and a total of about 200 pickups.

This is my vehicle routing algorithm code:

val vrpBuilder = VehicleRoutingProblem.Builder.newInstance()
vrpBuilder.setFleetSize(VehicleRoutingProblem.FleetSize.FINITE)
vrpBuilder.setRoutingCost(costMatrix)
vrpBuilder.addAllVehicles(vehicles)
vrpBuilder.addAllJobs(pickups)

val vrp = vrpBuilder.build()

val builder = Jsprit.Builder.newInstance(vrp)

val stateManager = StateManager(vrp)
val constraintManager = ConstraintManager(vrp, stateManager)

constraintManager.addConstraint(object : HardActivityConstraint {
    override fun fulfilled(
        context: JobInsertionContext?,
        prevActivity: TourActivity?,
        newActivity: TourActivity?,
        nextActivity: TourActivity?,
        previousActivityDepartureTime: Double
    ): HardActivityConstraint.ConstraintsStatus {
        if (prevActivity !== null && newActivity !== null && nextActivity !== null && context !== null) {
            if (prevActivity.location.id === nextActivity.location.id) {
                return HardActivityConstraint.ConstraintsStatus.FULFILLED
            }

            val distanceBetweenPrevAndNew = costMatrix.getDistance(
                prevActivity.location,
                newActivity.location,
                prevActivity.endTime,
                context.newVehicle
            )
            val distanceBetweenPrevAndNext = costMatrix.getDistance(
                prevActivity.location,
                nextActivity.location,
                prevActivity.endTime,
                context.newVehicle
            )

            if (distanceBetweenPrevAndNext > distanceBetweenPrevAndNew) {
                return HardActivityConstraint.ConstraintsStatus.FULFILLED
            } else {
                return HardActivityConstraint.ConstraintsStatus.NOT_FULFILLED
            }

        }

        return HardActivityConstraint.ConstraintsStatus.FULFILLED
    }
}, ConstraintManager.Priority.CRITICAL)

builder.setProperty(Jsprit.Parameter.FAST_REGRET, true.toString())
builder.setProperty(Jsprit.Parameter.CONSTRUCTION, Construction.REGRET_INSERTION.toString())
builder.setProperty(Jsprit.Parameter.THREADS, threads.toString())
builder.setStateAndConstraintManager(stateManager, constraintManager)

val vra = builder.buildAlgorithm()
```

As routing cost i'm using a distance only FastVehicleRoutingTransportCostsMatrix built with the Graphhopper Matrix Api.

The vehicle should avoid passing in front of an uncollected pickup, I tried to set up an hard activity constraint that checks if the new inserted activity is further away than the next one. If it's not further away, the constraint is not fulfilled. However the constraint does not work quite well.

Here's an example of an optimized route with the constraint:

example

The correct order for my case should be: 46 43 45 44 , however Jsprit orders them in that way because after 44 the vehicle has to do an uturn and run through the street again to reach 47,48,49...

I'm not sure if setting up a constraint is the right way to solve this, do you have any advices?

Thanks

Body:
I'm trying to solve a simple TSP with Jsprit. I only have 1 vehicle and a total of about 200 pickups.

This is my vehicle routing algorithm code:

val vrpBuilder = VehicleRoutingProblem.Builder.newInstance()
vrpBuilder.setFleetSize(VehicleRoutingProblem.FleetSize.FINITE)
vrpBuilder.setRoutingCost(costMatrix)
vrpBuilder.addAllVehicles(vehicles)
vrpBuilder.addAllJobs(pickups)

val vrp = vrpBuilder.build()

val builder = Jsprit.Builder.newInstance(vrp)

val stateManager = StateManager(vrp)
val constraintManager = ConstraintManager(vrp, stateManager)

constraintManager.addConstraint(object : HardActivityConstraint {
    override fun fulfilled(
        context: JobInsertionContext?,
        prevActivity: TourActivity?,
        newActivity: TourActivity?,
        nextActivity: TourActivity?,
        previousActivityDepartureTime: Double
    ): HardActivityConstraint.ConstraintsStatus {
        if (prevActivity !== null && newActivity !== null && nextActivity !== null && context !== null) {
            if (prevActivity.location.id === nextActivity.location.id) {
                return HardActivityConstraint.ConstraintsStatus.FULFILLED
            }

            val distanceBetweenPrevAndNew = costMatrix.getDistance(
                prevActivity.location,
                newActivity.location,
                prevActivity.endTime,
                context.newVehicle
            )
            val distanceBetweenPrevAndNext = costMatrix.getDistance(
                prevActivity.location,
                nextActivity.location,
                prevActivity.endTime,
                context.newVehicle
            )

            if (distanceBetweenPrevAndNext > distanceBetweenPrevAndNew) {
                return HardActivityConstraint.ConstraintsStatus.FULFILLED
            } else {
                return HardActivityConstraint.ConstraintsStatus.NOT_FULFILLED
            }

        }

        return HardActivityConstraint.ConstraintsStatus.FULFILLED
    }
}, ConstraintManager.Priority.CRITICAL)

builder.setProperty(Jsprit.Parameter.FAST_REGRET, true.toString())
builder.setProperty(Jsprit.Parameter.CONSTRUCTION, Construction.REGRET_INSERTION.toString())
builder.setProperty(Jsprit.Parameter.THREADS, threads.toString())
builder.setStateAndConstraintManager(stateManager, constraintManager)

val vra = builder.buildAlgorithm()

As routing cost i'm using a distance only FastVehicleRoutingTransportCostsMatrix built with the Graphhopper Matrix Api.

The vehicle should avoid passing in front of an uncollected pickup, I tried to set up an hard activity constraint that checks if the new inserted activity is further away than the next one. If it's not further away, the constraint is not fulfilled. However the constraint does not work quite well.

Here's an example of an optimized route with the constraint:

example

The correct order for my case should be: 46 43 45 44 , however Jsprit orders them in that way because after 44 the vehicle has to do an uturn and run through the street again to reach 47,48,49...

I'm not sure if setting up a constraint is the right way to solve this, do you have any advices?

Thanks


问:
Including a step STM in textrecipes
How can I use STM in textrecipes? (tidymodels workflow)

I need this for my master's degree where I use textrecipes as the main package.
The link https://www.tidymodels.org/learn/develop/recipes/ shows how to create a new step in my recipe, but I can't get out of zero with that.

Title: Including a step STM in textrecipes


问:
Create a graph with dynamic dates in Power BI
I need to make a dynamic graphic in such a way:

if any record is selected in "year" (for example "2020"), I get a graph with purchases evolution by month

if any record is selected in "month_name" (for example, "February"), I get that graph by day of month


问:
In which file I can set flag immutable property react native android application?
We are facing error, "MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent". We did lots of troubleshoots and internet exploring but in vain. Please tell us where can I place below code? Thanks

val intent = Intent(intentAction)

// Or other component setting APIS e.g. setComponent, setClass
intent.setClassName(packageName, className)

PendingIntent pendingIntent =
PendingIntent.getActivity(
context,
/* requestCode = / 0,
intent, / flags = */ PendingIntent.FLAG_IMMUTABLE
)


问:
SSRS Subscription ParameterValueOrFieldReference Default Value
We have a .rdl file with parameters Available values coming from Query.

In the cascade drop down one of the parameter, we have set available values from query and also set default value -1
Screenshot

enter image description here

We are using reportinservice2010.asmx for creating subscription by passing parameters like below

List<ParameterValueOrFieldReference> parameters =
    new List<ParameterValueOrFieldReference>();
parameters.AddRange(
    rpt.ParameterNameMappings
    .Where(p => p.IsMappingFieldAlias)
    .Select(p => new ParameterFieldReference()
    {
       ParameterName = p.ParameterName,
       FieldAlias = p.ParameterFieldAliasOrValue }));
parameters.AddRange(
    rpt.ParameterNameMappings
    .Where(p => !p.IsMappingFieldAlias)
    .Select(p => new ParameterValue()
    {
       Name = p.ParameterName,
       Value = p.ParameterFieldAliasOrValue }));
```
<p>Above parameters we are using below:</p>
<pre class="lang-cs prettyprint-override"><code>rs.CreateDataDrivenSubscription(
    report.FullName
    , settings
    , report.ReportSubscription.SubscriptionDataRetrievalPlan
    , report.ReportSubscription.Description
    , report.ReportSubscription.EventType
    , report.ReportSubscription.MatchData
    , reportParameters)
</code>```

Problem : The subscription is getting created but the default values are not set in the screen of subscription edit. Other parameters which are not default are getting saved as Get Value from Dataset.

Solution : We need by default to set as "Use Default value"

enter image description here

Give solution to get use default values

Body:
We have a .rdl file with parameters Available values coming from Query.

In the cascade drop down one of the parameter, we have set available values from query and also set default value -1
Screenshot

enter image description here

We are using reportinservice2010.asmx for creating subscription by passing parameters like below

List<ParameterValueOrFieldReference> parameters =
    new List<ParameterValueOrFieldReference>();
parameters.AddRange(
    rpt.ParameterNameMappings
    .Where(p => p.IsMappingFieldAlias)
    .Select(p => new ParameterFieldReference()
    {
       ParameterName = p.ParameterName,
       FieldAlias = p.ParameterFieldAliasOrValue }));
parameters.AddRange(
    rpt.ParameterNameMappings
    .Where(p => !p.IsMappingFieldAlias)
    .Select(p => new ParameterValue()
    {
       Name = p.ParameterName,
       Value = p.ParameterFieldAliasOrValue }));

Above parameters we are using below:

rs.CreateDataDrivenSubscription(
    report.FullName
    , settings
    , report.ReportSubscription.SubscriptionDataRetrievalPlan
    , report.ReportSubscription.Description
    , report.ReportSubscription.EventType
    , report.ReportSubscription.MatchData
    , reportParameters)

Problem : The subscription is getting created but the default values are not set in the screen of subscription edit. Other parameters which are not default are getting saved as Get Value from Dataset.

Solution : We need by default to set as "Use Default value"

enter image description here

Give solution to get use default values


问:
Removing Partially Matched Duplicates from a List
I have a list of many email addresses. Formatted similarly as follows:

Business Name 01   email@business01.com; other@business01.com; info@business01.com; email@business01.com; other@business01.com; info@business01.com; other@business01.com; email@business01.com; other@business01.com; other@business01.com; email@business01.com;

Business Name 02   email@business02.com; info@business02.com; other@business02.com; email@business02.com; email@business02.com; other@business02.com; other@business02.com; info@business02.com; email@business02.com; info@business02.com; other@business02.com;

I am looking to delete the duplicate addresses. So the list should look like:

Business Name 01   email@business01.com; other@business01.com; info@business01.com;

Business Name 02   email@business02.com; info@business02.com; other@business02.com;

This has me stumped. Any ideas?


问:
Entity Framework Core 7 keeps creating the same migration for Nullable DateTime field
I have entities, where nullable UpdatedDate fields exist.

```<code>var defaultPolicy = new MatchingPolicy()
{
    Id = Guid.Parse("5cf3f8e5-50e1-47c8-aa42-40b1824ea099"),
    CompanyId = null,
    Name = "Name",
    Status = MatchingPolicyStatus.Draft,
    Type = MatchingPolicyType.Default,
    Description = "Blabla.",
    CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc).AddTicks(1258),
};

var defaultPolicyVersion = new MatchingPolicyVersion()
{
    Id = Guid.Parse("5cf3f8e5-50e1-47c8-aa42-40b1824ea098"),
    CreatedByUserName = "System",
    MatchingPolicyId = defaultPolicy.Id,
    ReviewerUserName = "System",
    Status = MatchingPolicyApprovalStatus.Approved,
    Version = 1,
    CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc),
    UpdatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc),
};

var defaultGroups = new[]
{
     new MatchingPolicyGroup
     {
         Id = Guid.Parse("1e93b3f9-4ed8-4b90-a859-31b6503ec89f"),
         MatchingPolicyVersionId = defaultPolicyVersion.Id,
         Group = MatchingPolicyGroupType.Full,
         CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc).AddTicks(1258),
     },
     new MatchingPolicyGroup
     {
         Id = Guid.Parse("b08f004f-a62d-409e-8025-337f0eb73054"),
         MatchingPolicyVersionId = defaultPolicyVersion.Id,
         Group = MatchingPolicyGroupType.Possible,
         CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc).AddTicks(1258),
     },
};
</code>```

And I'm trying to add them to db by using HasData

```<code>modelBuilder.Entity<MatchingPolicy>().HasData(defaultPolicy);
modelBuilder.Entity<MatchingPolicyVersion>().HasData(defaultPolicyVersion);
entity.HasData(defaultGroups);
modelBuilder.Entity<Scheme>().Property(u => u.MatchingPolicyId).HasDefaultValue(defaultPolicy.Id);
</code>```

But It always creates the same migration with updating UpdatedDate even if this migration already exists. How can I fix that?

```<code>using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DashboardISP.DAL.PostgreSQL.Migrations
{
    /// <inheritdoc />
    public partial class TestMigr : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.UpdateData(
                table: "matching_policies",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea099"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("1e93b3f9-4ed8-4b90-a859-31b6503ec89f"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("b08f004f-a62d-409e-8025-337f0eb73054"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_versions",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea098"),
                column: "updated_date",
                value: new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc));

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("0da103bd-4753-4e01-bc3b-9dd1316861f9"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("2f95ee66-ce3d-4c37-9c76-d89cb5a6114c"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("3b0768e4-c774-4228-8aad-150f9a6aed1b"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("4542bf1e-219f-4e2e-83a1-5064c627c919"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6811980f-9890-452f-a358-82678cfb34b4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6f77d0d9-0c2d-477c-9f0f-87b1e69bbda1"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("868feacb-f89f-4605-887b-ba068a1f05bc"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("93c1fbb6-6a86-4fdf-b298-3a32998045c4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("9d00f543-07c8-4938-8d2e-7157720c7840"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b3434fcc-aa01-4630-a620-7219515fb3b7"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b97737f0-0237-4d95-b8cb-86c706cd9e33"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("ff64a9ed-314a-49ff-821a-085c491bd7c1"),
                column: "updated_date",
                value: null);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.UpdateData(
                table: "matching_policies",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea099"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("1e93b3f9-4ed8-4b90-a859-31b6503ec89f"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("b08f004f-a62d-409e-8025-337f0eb73054"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_versions",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea098"),
                column: "updated_date",
                value: new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc));

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("0da103bd-4753-4e01-bc3b-9dd1316861f9"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("2f95ee66-ce3d-4c37-9c76-d89cb5a6114c"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("3b0768e4-c774-4228-8aad-150f9a6aed1b"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("4542bf1e-219f-4e2e-83a1-5064c627c919"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6811980f-9890-452f-a358-82678cfb34b4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6f77d0d9-0c2d-477c-9f0f-87b1e69bbda1"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("868feacb-f89f-4605-887b-ba068a1f05bc"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("93c1fbb6-6a86-4fdf-b298-3a32998045c4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("9d00f543-07c8-4938-8d2e-7157720c7840"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b3434fcc-aa01-4630-a620-7219515fb3b7"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b97737f0-0237-4d95-b8cb-86c706cd9e33"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("ff64a9ed-314a-49ff-821a-085c491bd7c1"),
                column: "updated_date",
                value: null);
        }
    }
}
</code>```

I tried to set it directly as nullable on the model builder, add NonGeneratedValue, and also tried to set UpdatedDate fields manually by adding specified Datetime to it, or null but I always have the same issue with re-creation same migration.

Body:
I have entities, where nullable UpdatedDate fields exist.

var defaultPolicy = new MatchingPolicy()
{
    Id = Guid.Parse("5cf3f8e5-50e1-47c8-aa42-40b1824ea099"),
    CompanyId = null,
    Name = "Name",
    Status = MatchingPolicyStatus.Draft,
    Type = MatchingPolicyType.Default,
    Description = "Blabla.",
    CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc).AddTicks(1258),
};

var defaultPolicyVersion = new MatchingPolicyVersion()
{
    Id = Guid.Parse("5cf3f8e5-50e1-47c8-aa42-40b1824ea098"),
    CreatedByUserName = "System",
    MatchingPolicyId = defaultPolicy.Id,
    ReviewerUserName = "System",
    Status = MatchingPolicyApprovalStatus.Approved,
    Version = 1,
    CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc),
    UpdatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc),
};

var defaultGroups = new[]
{
     new MatchingPolicyGroup
     {
         Id = Guid.Parse("1e93b3f9-4ed8-4b90-a859-31b6503ec89f"),
         MatchingPolicyVersionId = defaultPolicyVersion.Id,
         Group = MatchingPolicyGroupType.Full,
         CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc).AddTicks(1258),
     },
     new MatchingPolicyGroup
     {
         Id = Guid.Parse("b08f004f-a62d-409e-8025-337f0eb73054"),
         MatchingPolicyVersionId = defaultPolicyVersion.Id,
         Group = MatchingPolicyGroupType.Possible,
         CreatedDate = new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc).AddTicks(1258),
     },
};

And I'm trying to add them to db by using HasData

modelBuilder.Entity<MatchingPolicy>().HasData(defaultPolicy);
modelBuilder.Entity<MatchingPolicyVersion>().HasData(defaultPolicyVersion);
entity.HasData(defaultGroups);
modelBuilder.Entity<Scheme>().Property(u => u.MatchingPolicyId).HasDefaultValue(defaultPolicy.Id);

But It always creates the same migration with updating UpdatedDate even if this migration already exists. How can I fix that?

using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DashboardISP.DAL.PostgreSQL.Migrations
{
    /// <inheritdoc />
    public partial class TestMigr : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.UpdateData(
                table: "matching_policies",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea099"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("1e93b3f9-4ed8-4b90-a859-31b6503ec89f"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("b08f004f-a62d-409e-8025-337f0eb73054"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_versions",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea098"),
                column: "updated_date",
                value: new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc));

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("0da103bd-4753-4e01-bc3b-9dd1316861f9"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("2f95ee66-ce3d-4c37-9c76-d89cb5a6114c"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("3b0768e4-c774-4228-8aad-150f9a6aed1b"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("4542bf1e-219f-4e2e-83a1-5064c627c919"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6811980f-9890-452f-a358-82678cfb34b4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6f77d0d9-0c2d-477c-9f0f-87b1e69bbda1"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("868feacb-f89f-4605-887b-ba068a1f05bc"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("93c1fbb6-6a86-4fdf-b298-3a32998045c4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("9d00f543-07c8-4938-8d2e-7157720c7840"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b3434fcc-aa01-4630-a620-7219515fb3b7"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b97737f0-0237-4d95-b8cb-86c706cd9e33"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("ff64a9ed-314a-49ff-821a-085c491bd7c1"),
                column: "updated_date",
                value: null);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.UpdateData(
                table: "matching_policies",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea099"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("1e93b3f9-4ed8-4b90-a859-31b6503ec89f"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_groups",
                keyColumn: "id",
                keyValue: new Guid("b08f004f-a62d-409e-8025-337f0eb73054"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_policy_versions",
                keyColumn: "id",
                keyValue: new Guid("5cf3f8e5-50e1-47c8-aa42-40b1824ea098"),
                column: "updated_date",
                value: new DateTime(2022, 8, 11, 11, 35, 8, 586, DateTimeKind.Utc));

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("0da103bd-4753-4e01-bc3b-9dd1316861f9"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("2f95ee66-ce3d-4c37-9c76-d89cb5a6114c"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("3b0768e4-c774-4228-8aad-150f9a6aed1b"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("4542bf1e-219f-4e2e-83a1-5064c627c919"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6811980f-9890-452f-a358-82678cfb34b4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("6f77d0d9-0c2d-477c-9f0f-87b1e69bbda1"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("868feacb-f89f-4605-887b-ba068a1f05bc"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("93c1fbb6-6a86-4fdf-b298-3a32998045c4"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("9d00f543-07c8-4938-8d2e-7157720c7840"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b3434fcc-aa01-4630-a620-7219515fb3b7"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("b97737f0-0237-4d95-b8cb-86c706cd9e33"),
                column: "updated_date",
                value: null);

            migrationBuilder.UpdateData(
                table: "matching_rule_templates",
                keyColumn: "id",
                keyValue: new Guid("ff64a9ed-314a-49ff-821a-085c491bd7c1"),
                column: "updated_date",
                value: null);
        }
    }
}

I tried to set it directly as nullable on the model builder, add NonGeneratedValue, and also tried to set UpdatedDate fields manually by adding specified Datetime to it, or null but I always have the same issue with re-creation same migration.


问:
How to add dependencies to remote github repo in vscode?
so im using the remote repo extension on vscode to edit my github to edit and im trying to install an npm dependency however I do not know how to connect my terminal to the github repo. Any help would be appreciated thanks!

Tried to use vs code remote repo extension to install dependency but dont know how.


问:
Is it possible to set output directory of EXPORT_COMPILE_COMMANDS without changing the BINARY_DIR?
CMake generates compile_commands.json in cmake build directory which means that my installation of YouCompleteMe or YCM cannot find it. For YCM to use it I need to move it from the build directory to the source or top level of the project.

```<code>Project
|- CMakeLists.txt
|- compile_commands.json (there is what i want)
|- build (this iw where i build my project)
|-- compile_commands.json (this is what i have)
|-- OtherCmakeGenerateStuff
|- src
|-- CMakeLists.txt
|-- main.cc (includes library not in project)
|-lib
|-- CMakeLists.txt
|-- math
|--- CMakeLists.txt
|--- math.cc
|--- math.hh
|-include
|-- globals.hh
|-- definitions.hh
</code>```

There may be mistakes in these files as I just typed it and haven't tested it. however, my focus is on the top level CMakeLists.txt file.

CMakeLists.txt (Top level)

```<code>cmake_minimum_require(VERSION 3.8)

project(just_some_project LANGUAGES CXX VERSION 1.0)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_subdirectory(src)
add_subdirectory(lib)
include_directories(include)
</code>```

src/CMakeLists.txt

```<code>cmake_minimum_require(VERSION 3.8)

project(just_some_project LANGUAGES CXX VERSION 1.0)

find_project(someotherlibrary REQUIRED)

add_executable(main main.cc)
target_include_directories(main PUBLIC math someotherlibraryfound)
</code>```

lib/CMakeLists.txt (Top level)

```<code>cmake_minimum_require(VERSION 3.8)

file(GLOB Headers "*.hh")
file(GLOB Sources "*.cc")

add_library(math STATIC $Sources $Headers)
</code>```

Body:
CMake generates compile_commands.json in cmake build directory which means that my installation of YouCompleteMe or YCM cannot find it. For YCM to use it I need to move it from the build directory to the source or top level of the project.

Project
|- CMakeLists.txt
|- compile_commands.json (there is what i want)
|- build (this iw where i build my project)
|-- compile_commands.json (this is what i have)
|-- OtherCmakeGenerateStuff
|- src
|-- CMakeLists.txt
|-- main.cc (includes library not in project)
|-lib
|-- CMakeLists.txt
|-- math
|--- CMakeLists.txt
|--- math.cc
|--- math.hh
|-include
|-- globals.hh
|-- definitions.hh

There may be mistakes in these files as I just typed it and haven't tested it. however, my focus is on the top level CMakeLists.txt file.

CMakeLists.txt (Top level)

cmake_minimum_require(VERSION 3.8)

project(just_some_project LANGUAGES CXX VERSION 1.0)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_subdirectory(src)
add_subdirectory(lib)
include_directories(include)

src/CMakeLists.txt

cmake_minimum_require(VERSION 3.8)

project(just_some_project LANGUAGES CXX VERSION 1.0)

find_project(someotherlibrary REQUIRED)

add_executable(main main.cc)
target_include_directories(main PUBLIC math someotherlibraryfound)

lib/CMakeLists.txt (Top level)

cmake_minimum_require(VERSION 3.8)

file(GLOB Headers "*.hh")
file(GLOB Sources "*.cc")

add_library(math STATIC $Sources $Headers)


问:
Why my navbar backgorund color is not changed?
I am kinda new to React Native, and I try to change the background color of my navbar as wel as the color of the name that's selected. Why this all does not work and what can I do to make it work?</p>
```<code>      <NavigationContainer>
        <Tab.Navigator
          screenOptions={{
            tabBarOptions: {
              style: {
                backgroundColor: 'red',
              },
            },
          }}
        >
          <Tab.Screen
            name="My Family"
            component={Family}
            options={{
              tabBarIcon: () => (
                <Ionicons style={styles.icon} name="people-outline" />
              ),
            }}
          />
          <Tab.Screen
            name="Edit Family"
            component={EditFamily}
            options={{
              tabBarIcon: () => (
                <Ionicons style={styles.icon} name="create-outline" />
              ),
            }}
          />
          <Tab.Screen
            name="My Profile"
            component={MyProfile}
            options={{
              tabBarIcon: () => (
                <Ionicons style={styles.icon} name="person-outline" />
              ),
            }}
          />
        </Tab.Navigator>
      </NavigationContainer>
</code>```

Body:
I am kinda new to React Native, and I try to change the background color of my navbar as wel as the color of the name that's selected. Why this all does not work and what can I do to make it work?

      <NavigationContainer>
        <Tab.Navigator
          screenOptions={{
            tabBarOptions: {
              style: {
                backgroundColor: 'red',
              },
            },
          }}
        >
          <Tab.Screen
            name="My Family"
            component={Family}
            options={{
              tabBarIcon: () => (
                <Ionicons style={styles.icon} name="people-outline" />
              ),
            }}
          />
          <Tab.Screen
            name="Edit Family"
            component={EditFamily}
            options={{
              tabBarIcon: () => (
                <Ionicons style={styles.icon} name="create-outline" />
              ),
            }}
          />
          <Tab.Screen
            name="My Profile"
            component={MyProfile}
            options={{
              tabBarIcon: () => (
                <Ionicons style={styles.icon} name="person-outline" />
              ),
            }}
          />
        </Tab.Navigator>
      </NavigationContainer>


问:
GRPC synchronous request error: call to deleted constructor
I am trying to configure a grpc::ClientContext as part of a syncrhonous request using GRPC. Note, without the context 'stuff' all is working fine.

My function looks like this:

grpc::Status Connection::syncLookup(Foo::LookupRequest &request, Foo::LookupResponse *response) {
    bool failure = false;
    grpc::ClientContext ctx;

    Clock::time_point now = Clock::now();
    auto time_since_epoch = std::chrono::duration_cast<Ms>(now.time_since_epoch()).count();

    if (rpc_timeout_ms_ > 0)
    {
        Clock::time_point deadline = now + Ms(rpc_timeout_ms_);
        ctx.set_deadline(deadline);
    }
    grpc::Status status = lookup_stub_->Lookup(&ctx, request, response);
    if (!status.ok())
    {
        failure = true;
        stats_worker_.record(time_since_epoch, failure, peerAddress(ctx));
        return status;
    }
    stats_worker_.record(time_since_epoch, failure, response->serverid());
    return status;
}
```
<p>The error I get is:</p>
<pre class="lang-bash prettyprint-override"><code>In file included from ~/.local/include/grpc++/grpc++.h:26:
In file included from ~/.local/include/grpcpp/grpcpp.h:53:
In file included from ~/.local/include/grpcpp/client_context.h:37:
~/.local/include/grpcpp/impl/codegen/client_context.h:275:24: error: call to deleted constructor of 'grpc::TimePoint<time_point<steady_clock, duration<long long, ratio<1, 1000000000>>>>'
    grpc::TimePoint<T> deadline_tp(deadline);
                       ^           ~~~~~~~~
~/dev/cpp/grpc/lookupv2/lookup.cc:104:17: note: in instantiation of function template specialization 'grpc::ClientContext::set_deadline<std::chrono::time_point<std::chrono::steady_clock, std::chrono::duration<long long, std::ratio<1, 1000000000>>>>' requested here
            ctx.set_deadline(deadline);
~/.local/include/grpcpp/impl/codegen/time.h:48:3: note: 'TimePoint' has been explicitly marked deleted here
  TimePoint(const T& /*time*/) = delete;

In file included from ~/.local/include/grpc++/grpc++.h:26:
In file included from ~/.local/include/grpcpp/grpcpp.h:53:
In file included from ~/.local/include/grpcpp/client_context.h:37:
~/.local/include/grpcpp/impl/codegen/client_context.h:276:29: error: attempt to use a deleted function
    deadline_ = deadline_tp.raw_time();
                            ^
~/.local/include/grpcpp/impl/codegen/time.h:49:16: note: 'raw_time' has been explicitly marked deleted here
  gpr_timespec raw_time() = delete;

</code>```

where it states:

~/dev/cpp/grpc/lookupv2/lookup.cc:104:17
```

is the line ctx.set_deadline(deadline);

From reading around the 'the internet' this is because a copy is trying to occur when there is no copy constructor present (or something). I believe the work around is to use a std_pointer or something, but now I'm slightly out of my depth now.

It seems this isn't a completely standard issue, or atleast i haven't found anything online to suggest there is a clear cut solution to this.

Any help in getting past this error would be greatly appreciated.

Body:
I am trying to configure a grpc::ClientContext as part of a syncrhonous request using GRPC. Note, without the context 'stuff' all is working fine.

My function looks like this:

grpc::Status Connection::syncLookup(Foo::LookupRequest &request, Foo::LookupResponse *response) {
    bool failure = false;
    grpc::ClientContext ctx;

    Clock::time_point now = Clock::now();
    auto time_since_epoch = std::chrono::duration_cast<Ms>(now.time_since_epoch()).count();

    if (rpc_timeout_ms_ > 0)
    {
        Clock::time_point deadline = now + Ms(rpc_timeout_ms_);
        ctx.set_deadline(deadline);
    }
    grpc::Status status = lookup_stub_->Lookup(&ctx, request, response);
    if (!status.ok())
    {
        failure = true;
        stats_worker_.record(time_since_epoch, failure, peerAddress(ctx));
        return status;
    }
    stats_worker_.record(time_since_epoch, failure, response->serverid());
    return status;
}

The error I get is:

In file included from ~/.local/include/grpc++/grpc++.h:26:
In file included from ~/.local/include/grpcpp/grpcpp.h:53:
In file included from ~/.local/include/grpcpp/client_context.h:37:
~/.local/include/grpcpp/impl/codegen/client_context.h:275:24: error: call to deleted constructor of 'grpc::TimePoint<time_point<steady_clock, duration<long long, ratio<1, 1000000000>>>>'
    grpc::TimePoint<T> deadline_tp(deadline);
                       ^           ~~~~~~~~
~/dev/cpp/grpc/lookupv2/lookup.cc:104:17: note: in instantiation of function template specialization 'grpc::ClientContext::set_deadline<std::chrono::time_point<std::chrono::steady_clock, std::chrono::duration<long long, std::ratio<1, 1000000000>>>>' requested here
            ctx.set_deadline(deadline);
~/.local/include/grpcpp/impl/codegen/time.h:48:3: note: 'TimePoint' has been explicitly marked deleted here
  TimePoint(const T& /*time*/) = delete;

In file included from ~/.local/include/grpc++/grpc++.h:26:
In file included from ~/.local/include/grpcpp/grpcpp.h:53:
In file included from ~/.local/include/grpcpp/client_context.h:37:
~/.local/include/grpcpp/impl/codegen/client_context.h:276:29: error: attempt to use a deleted function
    deadline_ = deadline_tp.raw_time();
                            ^
~/.local/include/grpcpp/impl/codegen/time.h:49:16: note: 'raw_time' has been explicitly marked deleted here
  gpr_timespec raw_time() = delete;

where it states:

~/dev/cpp/grpc/lookupv2/lookup.cc:104:17

is the line ctx.set_deadline(deadline);

From reading around the 'the internet' this is because a copy is trying to occur when there is no copy constructor present (or something). I believe the work around is to use a std_pointer or something, but now I'm slightly out of my depth now.

It seems this isn't a completely standard issue, or atleast i haven't found anything online to suggest there is a clear cut solution to this.

Any help in getting past this error would be greatly appreciated.


问:
Python-PANDAS dataframe- Datetime format
I am trying to get a specific format i.e. date-month-year eg: 01-12-2023 12:00:00;00 AM.
In my dataframe i have a column which is in a  datetime format i.e. 2023-12-01.
Here i tried to convert the datetime format into the format that i needed by using strftime ,however didnt want the datatype to be changed so  after converting using strftime , converted back again in datetime.
After doing so , again it went back datetime format i.e. 2023-12-01 instead of 01-12-2023 12:00:00;00 AM.
How can i  resolve this by getting the required format and not changing the datatype.
Checked few examples but didnt work.

Code:

```<code>Below code creates a new column DOB1   from the Month column which has a datetime format :

Dataframe bkp:

Month
2022-05-01
2023-06-01

bkp['DOB1'] = bkp['Month'].dt.strftime('%d-%m-%Y  %I:%M:%S %p')

Output:

Month          DOB1
2022-05-01     01-05-2022 12:00:00:00 AM
2023-06-01     01-06-2023 12:00:00:00 AM

bkp.dtypes >>>> Month : datetime64[ns] , DOB1 : object

# Converting to datetime format , to retain the original format

bkp['DOB1'] = pd.to_datetime(bkp['DOB1'])

Output:

Month          DOB1
2022-05-01     2022-05-01
2023-06-01     2023-06-01
</code>```

Could anyone suggest how to get the required format and have the datetime format still.

Body:
I am trying to get a specific format i.e. date-month-year eg: 01-12-2023 12:00:00;00 AM.
In my dataframe i have a column which is in a  datetime format i.e. 2023-12-01.
Here i tried to convert the datetime format into the format that i needed by using strftime ,however didnt want the datatype to be changed so  after converting using strftime , converted back again in datetime.
After doing so , again it went back datetime format i.e. 2023-12-01 instead of 01-12-2023 12:00:00;00 AM.
How can i  resolve this by getting the required format and not changing the datatype.
Checked few examples but didnt work.

Code:

Below code creates a new column DOB1   from the Month column which has a datetime format :

Dataframe bkp:

Month
2022-05-01
2023-06-01

bkp['DOB1'] = bkp['Month'].dt.strftime('%d-%m-%Y  %I:%M:%S %p')

Output:

Month          DOB1
2022-05-01     01-05-2022 12:00:00:00 AM
2023-06-01     01-06-2023 12:00:00:00 AM

bkp.dtypes >>>> Month : datetime64[ns] , DOB1 : object

# Converting to datetime format , to retain the original format

bkp['DOB1'] = pd.to_datetime(bkp['DOB1'])

Output:

Month          DOB1
2022-05-01     2022-05-01
2023-06-01     2023-06-01

Could anyone suggest how to get the required format and have the datetime format still.


问:
format date time from string
how can I format such a date:

2023-01-04T17:19:08+0100 in a string to a date in LocalDateTime using DateTimeFormatter or another tool ? It tries this way and throws a DateTimeParseException :

```<code>   private LocalDateTime parseLocalDateTime(String dateTime){

        final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:SS");
        return LocalDateTime.parse(dateTime, formatter);
    }
</code>```

Title: format date time from string

Body:
how can I format such a date:

2023-01-04T17:19:08+0100 in a string to a date in LocalDateTime using DateTimeFormatter or another tool ? It tries this way and throws a DateTimeParseException :

   private LocalDateTime parseLocalDateTime(String dateTime){

        final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:SS");
        return LocalDateTime.parse(dateTime, formatter);
    }


问:
Does Hibernate 5.6 no longer offer C3P0ConnectionProvider implementation?
C3P0ConnectionProvider is a known implementation in Hibernate 5.1. I checked the ConnectionProvider documentation for Hibernate 5.6 and I can't seem to find any implementation for C3P0 connection pooling.

So, as stated in the title, does Hibernate 5.6 no longer offer the C3P0ConnectionProvider implementation?

I'm just curious and wanted to know if anyone could give me more information on why. Maybe I'm not looking in the right place?


问:
convert string date to date format in laravel
I have the following date string

```<code> $date = '8 January, 2015';
</code>```

and i am trying to convert it into date format for my database

I want it like

```<code>2015-01-08
</code>```

i have tried the

```<code>Carbon::parse($date)->format('Y-m-d');
</code>```

it does convert the string but it is changing the year from 2015 to 2023

```<code>2023-01-08
</code>```

what could the possible solution and what is the reason for the changing year?

Body:
I have the following date string

 $date = '8 January, 2015';

and i am trying to convert it into date format for my database

I want it like

2015-01-08

i have tried the

Carbon::parse($date)->format('Y-m-d');

it does convert the string but it is changing the year from 2015 to 2023

2023-01-08

what could the possible solution and what is the reason for the changing year?


问:
RMarkdown ! Undefined control sequence
I am writing my PhD thesis in RMarkdown. Everything was rendering fine yesterday, today I added a few pieces of text with one reference (deleting it does not change the error message) and now, I get this error message:

! Undefined control sequence.  ...9}\selectfont {\global
\setmainfont
{DejaVu Sans}{}} l.3593 ...nt{\global\setmainfont{DejaVu Sans}{}}}}
& \multicolumn{3}{!{\colo...

The document consists of several child documents. I managed to track the error to one of the child documents by switching the individual child chunks off and on in the main document. BUT the line the error refers to seems to be from A DIFFERENT child document. All of the child documents knit OK when I try them separately.

I can get rid of the error when I use xelatex as the pdf engine but I would prefer to stick with pdflatex because of compatibility with some R packages.

My YAML:

```<code>title: ''
output:
  pdf_document:
        latex_engine: pdflatex
        number_sections: TRUE
        pandoc_args: ['--lua-filter=section-bibliographies.lua']
always_allow_html: true
geometry: "left = 4cm, right = 2cm, top = 2cm, bottom = 2cm"
fontsize: 11pt
header-includes:
  - \usepackage{float}
  - \usepackage{sectsty}
  - \usepackage{paralist}
  - \usepackage{setspace}\spacing{1.5}
  - \usepackage{fancyhdr}
  - \usepackage{lastpage}
  - \usepackage{dcolumn}
  - \usepackage{natbib}
  - \usepackage[nottoc, numbib]{tocbibind}
  - \usepackage{ragged2e}
  - \usepackage{pdflscape}
  - \usepackage{textgreek}
  - \usepackage{graphicx}
  - \usepackage{titlesec}
classoption: twoside
bibliography: library.bib
reference-section-title: References
section-bibs-level: 2
citation_package: biblatex
csl: journal-of-ecology.csl
</code>```

Any suggestion will be much appreciated!

Title: RMarkdown ! Undefined control sequence

Body:
I am writing my PhD thesis in RMarkdown. Everything was rendering fine yesterday, today I added a few pieces of text with one reference (deleting it does not change the error message) and now, I get this error message:

! Undefined control sequence.  ...9}\selectfont {\global
\setmainfont
{DejaVu Sans}{}} l.3593 ...nt{\global\setmainfont{DejaVu Sans}{}}}}
& \multicolumn{3}{!{\colo...

The document consists of several child documents. I managed to track the error to one of the child documents by switching the individual child chunks off and on in the main document. BUT the line the error refers to seems to be from A DIFFERENT child document. All of the child documents knit OK when I try them separately.

I can get rid of the error when I use xelatex as the pdf engine but I would prefer to stick with pdflatex because of compatibility with some R packages.

My YAML:

title: ''
output:
  pdf_document:
        latex_engine: pdflatex
        number_sections: TRUE
        pandoc_args: ['--lua-filter=section-bibliographies.lua']
always_allow_html: true
geometry: "left = 4cm, right = 2cm, top = 2cm, bottom = 2cm"
fontsize: 11pt
header-includes:
  - \usepackage{float}
  - \usepackage{sectsty}
  - \usepackage{paralist}
  - \usepackage{setspace}\spacing{1.5}
  - \usepackage{fancyhdr}
  - \usepackage{lastpage}
  - \usepackage{dcolumn}
  - \usepackage{natbib}
  - \usepackage[nottoc, numbib]{tocbibind}
  - \usepackage{ragged2e}
  - \usepackage{pdflscape}
  - \usepackage{textgreek}
  - \usepackage{graphicx}
  - \usepackage{titlesec}
classoption: twoside
bibliography: library.bib
reference-section-title: References
section-bibs-level: 2
citation_package: biblatex
csl: journal-of-ecology.csl

Any suggestion will be much appreciated!


问:
Why pyright doesn't allow str.join of a non-literal set?
The following code produces the error message:

Operator "|" not supported for types "set[str]" and "set[str]"

......    Operator "|" not supported for types "set[str]" and "set[str]" when expected type is "Iterable[LiteralString]"

```<code>def update_no_proxy():
    def _normalize_url(url: str) -> str:
        return urlparse(url).netloc

    old_no_proxy_urls = set(os.getenv('NO_PROXY', '').split(','))
    no_proxy_new_urls = {_normalize_url(url) for url in NO_PROXY_URLS}
    no_proxy_new_urls = {*no_proxy_new_urls, get_local_ip_address()}
    no_proxy_urls: str = ','.join(old_no_proxy_urls | no_proxy_new_urls)
    for env_name in NO_PROXY_ENV_NAMES:
        os.environ[env_name] = no_proxy_urls.strip(', ')
</code>```

However, the following code does not produce the error:

```<code>def update_no_proxy():
    def _normalize_url(url: str) -> str:
        return urlparse(url).netloc

    old_no_proxy_urls = set(os.getenv('NO_PROXY', '').split(','))
    no_proxy_new_urls = {_normalize_url(url) for url in NO_PROXY_URLS}
    no_proxy_new_urls = {*no_proxy_new_urls, get_local_ip_address()}
    all_no_proxy_urls = old_no_proxy_urls | no_proxy_new_urls
    no_proxy_urls = ','.join(all_no_proxy_urls)
    for env_name in NO_PROXY_ENV_NAMES:
        os.environ[env_name] = no_proxy_urls.strip(', ')
</code>```

Why putting all_no_proxy_urls in a new variable solves the problem?

Body:
The following code produces the error message:

Operator "|" not supported for types "set[str]" and "set[str]"

......    Operator "|" not supported for types "set[str]" and "set[str]" when expected type is "Iterable[LiteralString]"

def update_no_proxy():
    def _normalize_url(url: str) -> str:
        return urlparse(url).netloc

    old_no_proxy_urls = set(os.getenv('NO_PROXY', '').split(','))
    no_proxy_new_urls = {_normalize_url(url) for url in NO_PROXY_URLS}
    no_proxy_new_urls = {*no_proxy_new_urls, get_local_ip_address()}
    no_proxy_urls: str = ','.join(old_no_proxy_urls | no_proxy_new_urls)
    for env_name in NO_PROXY_ENV_NAMES:
        os.environ[env_name] = no_proxy_urls.strip(', ')

However, the following code does not produce the error:

def update_no_proxy():
    def _normalize_url(url: str) -> str:
        return urlparse(url).netloc

    old_no_proxy_urls = set(os.getenv('NO_PROXY', '').split(','))
    no_proxy_new_urls = {_normalize_url(url) for url in NO_PROXY_URLS}
    no_proxy_new_urls = {*no_proxy_new_urls, get_local_ip_address()}
    all_no_proxy_urls = old_no_proxy_urls | no_proxy_new_urls
    no_proxy_urls = ','.join(all_no_proxy_urls)
    for env_name in NO_PROXY_ENV_NAMES:
        os.environ[env_name] = no_proxy_urls.strip(', ')

Why putting all_no_proxy_urls in a new variable solves the problem?


问:
Detect equidistant lines on an image
I am trying to detect horizontal distance markers on a measurement plate like on the picture below. The marked area shows which lines I need to detect. You will notice there is a problem in the image, an extra line (marked with an arrow) that should not be there - it's just an artifact and it's messing with my initial algorithm to detect the "true lines" (the lines that have corresponding numbers to the left).

With kernel density estimation, I can establish what is the most common distance between the consecutive lines, e.g. 150 pixels. I am later looping through all lines, trying to find candidates for the ruler lines. The algorithm:

margin = 30 # in pixels
ruler_distance = 150 # established with kernel density estimation, we could use median too
candidates = defaultdict(list)
for i, line1 in enumerate(merged):
    candidates[i].append(line1)
    for j, line2 in enumerate(merged):
        if j > i:
            avg_y1 = (line1[1] + line1[3]) / 2 # line[1] and line[3] are y-coordinates
            avg_y2 = (line2[1] + line2[3]) / 2
            diff = avg_y2 - avg_y1
            if ruler_distance - margin <= diff <= ruler_distance + margin:
                candidates[i].append(line2)
                ruler_distance = diff + avg_ruler_distance
```
<p>The trouble is, the algorithm is very volatile. It works for <code>margin=30</code>, but if I change it by +/- 10, it will fall apart. Obviously the issue is perspective. The lines are equidistant in reality, but not with perspective.</p>
<p>Maybe I need a radically different approach? The presented image is a result of detecting horizontal lines, merging them together and finding coordinates with Hough transform (in OpenCV). It could be tempting to further erode the marked line, but following this method leads to eliminating some markers in other images.</p>
<p>Data (can be read with e.g. <code>numpy.loadtxt</code>):</p>
```23 18 882 17
1449 445 2841 454
508 625 1887 645
746 655 2092 670
548 1140 1998 1140
692 1180 1739 1180
480 1362 892 1362
807 1988 1234 1988
795 2116 1575 2116
783 2254 1717 2254
770 2395 1882 2395
756 2542 1878 2542
1008 2607 1332 2607
742 2695 1892 2695
729 2854 1900 2854
715 3016 1907 3016
387 3531 1949 3533
1515 4026 3023 4008
```

Title: Detect equidistant lines on an image

Body:
I am trying to detect horizontal distance markers on a measurement plate like on the picture below. The marked area shows which lines I need to detect. You will notice there is a problem in the image, an extra line (marked with an arrow) that should not be there - it's just an artifact and it's messing with my initial algorithm to detect the "true lines" (the lines that have corresponding numbers to the left).

With kernel density estimation, I can establish what is the most common distance between the consecutive lines, e.g. 150 pixels. I am later looping through all lines, trying to find candidates for the ruler lines. The algorithm:

margin = 30 # in pixels
ruler_distance = 150 # established with kernel density estimation, we could use median too
candidates = defaultdict(list)
for i, line1 in enumerate(merged):
    candidates[i].append(line1)
    for j, line2 in enumerate(merged):
        if j > i:
            avg_y1 = (line1[1] + line1[3]) / 2 # line[1] and line[3] are y-coordinates
            avg_y2 = (line2[1] + line2[3]) / 2
            diff = avg_y2 - avg_y1
            if ruler_distance - margin <= diff <= ruler_distance + margin:
                candidates[i].append(line2)
                ruler_distance = diff + avg_ruler_distance

The trouble is, the algorithm is very volatile. It works for margin=30, but if I change it by +/- 10, it will fall apart. Obviously the issue is perspective. The lines are equidistant in reality, but not with perspective.

Maybe I need a radically different approach? The presented image is a result of detecting horizontal lines, merging them together and finding coordinates with Hough transform (in OpenCV). It could be tempting to further erode the marked line, but following this method leads to eliminating some markers in other images.

Data (can be read with e.g. numpy.loadtxt):

23 18 882 17
1449 445 2841 454
508 625 1887 645
746 655 2092 670
548 1140 1998 1140
692 1180 1739 1180
480 1362 892 1362
807 1988 1234 1988
795 2116 1575 2116
783 2254 1717 2254
770 2395 1882 2395
756 2542 1878 2542
1008 2607 1332 2607
742 2695 1892 2695
729 2854 1900 2854
715 3016 1907 3016
387 3531 1949 3533
1515 4026 3023 4008


问:
D3 - TreeMap implementation on angular 14
I need a help to implement D3 Treemap in angular 14.

I have gone through D3 js documentation, however finding difficulty to implement Tree Map in angular

Expected : enter image description here

```<code>createSvg(): void {
    this.svg = d3
      .select("#treemap")
      .append("svg")
      .attr("width", this.width + this.margin * 2)
      .attr("height", this.height + this.margin * 2)
      .append("g")
      .attr("transform", "translate(" + this.margin + "," + this.margin + ")")
      .style("shape-rendering", "crispEdges");
    const grandparent = this.svg.append("g").attr("class", "grandparent");
    console.log(grandparent);
  }
 private drawBars(data: any): void {
    Create the X-axis band scale
    const x = d3.treemapBinary(data);
    console.log(x);
  }
</code>```

Body:
I need a help to implement D3 Treemap in angular 14.

I have gone through D3 js documentation, however finding difficulty to implement Tree Map in angular

Expected : enter image description here

createSvg(): void {
    this.svg = d3
      .select("#treemap")
      .append("svg")
      .attr("width", this.width + this.margin * 2)
      .attr("height", this.height + this.margin * 2)
      .append("g")
      .attr("transform", "translate(" + this.margin + "," + this.margin + ")")
      .style("shape-rendering", "crispEdges");
    const grandparent = this.svg.append("g").attr("class", "grandparent");
    console.log(grandparent);
  }
 private drawBars(data: any): void {
    Create the X-axis band scale
    const x = d3.treemapBinary(data);
    console.log(x);
  }


问:
Pandas Crosstab Plot Top N Elements
I have created a Pandas Crosstab with some data I am currently working with.

```<code>contingencyTable = pd.crosstab(index=dfBoolean['ColA'],
                            columns=dfBoolean['Category'],
                             margins=True)
</code>```

Some of the categories from both the primaryDistribution and the categoricalColumnName have a TON of categories--way too many to plot nicely on a single graph. Is it possible to select the top n (say, 5, for example) categories to plot in the cross tab? Thanks!

```<code>plt.rcParams.update({'font.size': 12})
bPlot = contingencyTable.plot.bar(rot=0, figsize=(9.2, 5.7))
</code>```

Here is some sample data:

Title: Pandas Crosstab Plot Top N Elements

Body:
I have created a Pandas Crosstab with some data I am currently working with.

contingencyTable = pd.crosstab(index=dfBoolean['ColA'],
                            columns=dfBoolean['Category'],
                             margins=True)

Some of the categories from both the primaryDistribution and the categoricalColumnName have a TON of categories--way too many to plot nicely on a single graph. Is it possible to select the top n (say, 5, for example) categories to plot in the cross tab? Thanks!

plt.rcParams.update({'font.size': 12})
bPlot = contingencyTable.plot.bar(rot=0, figsize=(9.2, 5.7))

Here is some sample data:


问:
Issue while using vrf-rs crate Rust,
I am using the vrf-rs library (https://github.com/witnet/vrf-rs) and am encountering an error when calling the BN_CTX_free method. This method is used to deallocate memory for the BN_CTX object, which is used internally by the library for allocating Big Numbers on the stack. The library uses foreign function interface (FFI) to call this method, but I am receiving the following error:

dyld[14628]: symbol not found in flat namespace '_BN_CTX_free'
I am not sure how to resolve this issue.Basically I am using the crate,The moment i use it( It relies on OpenSSL crate internally),Above mentioned error is encountered
Could anyone provide assistance or suggestions on how to fix this error?"

Additional Info Openssl version:
LibreSSL 3.3.6

Title: Issue while using vrf-rs crate Rust,