问:
Updating product prices variable products doesn't work with woocommerce rest api
I have a webshop with variable products.

when I try to update the price of the product, the response of the post is OK (200).

But prices are not modified.

data is like this:

```<code>{'update': [{'id': 15305, 'price': 96.95},
  {'id': 15255, 'price': 40.95},
  {'id': 15254, 'price': 50.95},
  {'id': 15251, 'price': 107.95},
  {'id': 15252, 'price': 60.95},
  {'id': 15253, 'price': 45.95},
  {'id': 15250, 'price': 60.95},
  {'id': 15249, 'price': 60.95},
  {'id': 15247, 'price': 107.95}]}
</code>```

call is made with:

```<code>from woocommerce import API

wcapi = API(
  url="https://www.domain",
  consumer_key="key",
  consumer_secret="secret",
  timeout=500
)
response = wcapi.post("products/batch", data).json()
</code>```

why doesn't this to the job? Seems like woocommerce API doesn't support batch updates of varation properties.

Body:
I have a webshop with variable products.

when I try to update the price of the product, the response of the post is OK (200).

But prices are not modified.

data is like this:

{'update': [{'id': 15305, 'price': 96.95},
  {'id': 15255, 'price': 40.95},
  {'id': 15254, 'price': 50.95},
  {'id': 15251, 'price': 107.95},
  {'id': 15252, 'price': 60.95},
  {'id': 15253, 'price': 45.95},
  {'id': 15250, 'price': 60.95},
  {'id': 15249, 'price': 60.95},
  {'id': 15247, 'price': 107.95}]}

call is made with:

from woocommerce import API

wcapi = API(
  url="https://www.domain",
  consumer_key="key",
  consumer_secret="secret",
  timeout=500
)
response = wcapi.post("products/batch", data).json()

why doesn't this to the job? Seems like woocommerce API doesn't support batch updates of varation properties.


来源: stackexchange

问:
Publishing solution fails with unknown error after upgrade to DevExpress 22.2
After upgrading my winforms Net 6 solution to devexp 22.2 from 22.1 just using Project Converter, publishing fails.

Build is ok without errors. VS2022 just says that publish failed and is unable to tell what was wrong.
It is just a simple publish to folder, self contained, x64.

Last two entries in the output windows is "build success2, "publish failed" and a reference to a log file that just says that VS was unable to tell what was wrong.

Reversing to the commit just before the upgrade, it publishes just fine.
Nothing but the upgrade is changed.

Have checked all suggestions I have found from a search, but nope, no success.
Anyone have as idea?

ContentLicense: CC BY-SA 4.0


问:
Connection between multiple remote devices using OpenVPN Cloud
I need to connect to multiple Raspberry Pi's (Debian 11) from my Windows laptop to make some HTTP GET queries (read sensors data). I've decided to create a VPN for them to join, and the OpenVPN cloud seems to be a good choice. Using the dashboard, I made a network, and two connectors (one for a laptop and one for raspberry) and configured the clients using provided config. It seems that the devices are connecting to the VPN correctly, but the problem is that they do not see each other. I.e. I can not ping raspberry from my laptop and vice versa. There must be something obvious I am missing.

Connectors (windows laptop and raspberry pi):

The network (I haven't added any routs, no subnets, no domains)

Raspberry's IP config

Windows' IP config

Not pinging:


问:
Split a string in winform
I have this string
Sus=a1234/b5678/c9123/d8567

Iam using win app c#
I want to show
E: a1234
F: b5678
G: c9123
H: d8567
In richtextbox

To show how to split substring and show in richtextbox

Title: Split a string in winform


问:
Argument of type '(dispatch: any) => Promise<void>' is not assignable to parameter of type 'AnyAction'
While dispatching the event I am facing the issue "Argument of type '(dispatch: any) => Promise' is not assignable to parameter of type 'AnyAction'."
I am new to React 18 and redux toolkit. Using Redux-thunk, everything seems fine, but dispatching the event gives an error:
The error is shown in the Action file while dispatching . Seems the issue is with return type. Not able to find a solution for it.

```<code>import { Provider } from 'react-redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import { legacy_createStore as createStore , applyMiddleware  } from 'redux';
import thunk from 'redux-thunk';
const store = createStore(rootReducer,composeWithDevTools(applyMiddleware(thunk)));
    ReactDOM.render(<Provider store={store}>
      <App/>
    </Provider>,document.getElementById('root'));
</code>```

PlayerDetails.Action.tsx

```<code>import * as ACTION_TYPES from './action-types';
import * as CONSTANTS from '../utils/Constants'
const axios = require('axios');
const rax = require('retry-axios');

export const playerDetails_request = (data: any)=>{
    return {
        type: ACTION_TYPES.GET_PLAYER_DETAILS_REQUEST,
        payload : data
    }
}

export const playerDetails_success = (obj: any)=>{
    return {
        type: ACTION_TYPES.GET_PLAYER_DETAILS_SUCCESS,
        payload : obj
    }
}

export const playerDetails_failure = (err: any)=>{
    return {
        type: ACTION_TYPES.GET_PLAYER_DETAILS_FAILURE,
        payload : err
    }
}
export default function getPlayersDetails(data:any){
    return async function (dispatch:any) {
        dispatch(playerDetails_request(data));
        try{
            axios.defaults.withCredentials = true;
            const interceptorId = rax.attach();
            const response = await axios ({
                url:CONSTANTS.PLAYER_DETAILS,
                method:'GET',
                params: {page: '0', per_page: '25'},
                headers: CONSTANTS.header,
                //data:()

            });

            if(response !==null && response.status === 200){

                dispatch(playerDetails_success(response));
            }else{
                dispatch(playerDetails_failure(response));
            }
        }catch(error){
            console.log("ERROR");
            dispatch(playerDetails_failure("ERROR"))
        }
    }
}
</code>```

action-types.tsx

```<code>export const GET_PLAYER_DETAILS_REQUEST = "GET_PLAYER_DETAILS_REQUEST"
export const GET_PLAYER_DETAILS_SUCCESS = "GET_PLAYER_DETAILS_SUCCESS"
export const GET_PLAYER_DETAILS_FAILURE = "GET_PLAYER_DETAILS_FAILURE"
</code>```

Body:
While dispatching the event I am facing the issue "Argument of type '(dispatch: any) => Promise' is not assignable to parameter of type 'AnyAction'."
I am new to React 18 and redux toolkit. Using Redux-thunk, everything seems fine, but dispatching the event gives an error:
The error is shown in the Action file while dispatching . Seems the issue is with return type. Not able to find a solution for it.

import { Provider } from 'react-redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import { legacy_createStore as createStore , applyMiddleware  } from 'redux';
import thunk from 'redux-thunk';
const store = createStore(rootReducer,composeWithDevTools(applyMiddleware(thunk)));
    ReactDOM.render(<Provider store={store}>
      <App/>
    </Provider>,document.getElementById('root'));

PlayerDetails.Action.tsx

import * as ACTION_TYPES from './action-types';
import * as CONSTANTS from '../utils/Constants'
const axios = require('axios');
const rax = require('retry-axios');

export const playerDetails_request = (data: any)=>{
    return {
        type: ACTION_TYPES.GET_PLAYER_DETAILS_REQUEST,
        payload : data
    }
}

export const playerDetails_success = (obj: any)=>{
    return {
        type: ACTION_TYPES.GET_PLAYER_DETAILS_SUCCESS,
        payload : obj
    }
}

export const playerDetails_failure = (err: any)=>{
    return {
        type: ACTION_TYPES.GET_PLAYER_DETAILS_FAILURE,
        payload : err
    }
}
export default function getPlayersDetails(data:any){
    return async function (dispatch:any) {
        dispatch(playerDetails_request(data));
        try{
            axios.defaults.withCredentials = true;
            const interceptorId = rax.attach();
            const response = await axios ({
                url:CONSTANTS.PLAYER_DETAILS,
                method:'GET',
                params: {page: '0', per_page: '25'},
                headers: CONSTANTS.header,
                //data:()

            });

            if(response !==null && response.status === 200){

                dispatch(playerDetails_success(response));
            }else{
                dispatch(playerDetails_failure(response));
            }
        }catch(error){
            console.log("ERROR");
            dispatch(playerDetails_failure("ERROR"))
        }
    }
}

action-types.tsx

export const GET_PLAYER_DETAILS_REQUEST = "GET_PLAYER_DETAILS_REQUEST"
export const GET_PLAYER_DETAILS_SUCCESS = "GET_PLAYER_DETAILS_SUCCESS"
export const GET_PLAYER_DETAILS_FAILURE = "GET_PLAYER_DETAILS_FAILURE"


问:
Where should I put my new Bolt CMS theme to allow it to be committed?
I'm following this tutorial on creating a Bolt CMS theme ...

https://webdesign.tutsplus.com/courses/bolt-cms-theme-development/lessons/basic-theme-setup-and-intro-to-twig

... but I'm running into a problem: The tutorial tells me to create a new subdirectory inside of the /theme directory.

But this /theme directory is omitted from version control, along with all subdirectories!

I would like to treat my Bolt project as a monorepo, including my new custom theme.

Is there another place I can put my theme, such that I can store it in my monorepo? I really don't want to create a new repo just for a theme that's specific to my project.

Another option would be to change the .gitignore file that composer puts into place when I create a new Bolt project. I'll be happy to do that if there's not a better way, but I want to make sure I'm doing things the "right" way if possible.


问:
How to make custom border bottom for my hero section
I want to creat the hero section showed in the following picture :

But the problem is that i 't know how to add the border on the bottom surrounded with the red color, is it possible to make them with css property or how ?

I tried to cut that portion and added it as div background but the problem is that it is little bit hard to make it responsive and it dosen't look good.


问:
To Solve ..Please ? On Build Apk .. Build Failed with an Exception ,
What Went wrong :

Unable To Start The Deamon Process .

This Problem might be , Caused By the incorrect configuration of the daemon .

Need Answer To build my app


问:
kernelspec not found after setting JUPYTER_PATH
I am working in Google Vertex AI, which has a two-disk system of a boot disk and a data disk, the latter of which is mounted to /home/jupyter. I am trying to expose python venv environments with kernelspec files, and then keep those environments exposed across repeated stop-start cycles. All of the default locations for kernelspec files are on the boot disk, which is ephemeral and recreated each time the VM is started (i.e., the exposed kernels vaporize each time the VM is stopped). Conceptually, I want to use a VM start-up script to add a persistent data disk path to the JUPYTER_PATH variable, since, according to the documentation, "Jupyter uses a search path to find installable data files, such as kernelspecs and notebook extensions." During interactive testing in the Terminal, I have not found this to be true. I have also tried setting the data directory variable, but it does not help.

```<code>export JUPYTER_PATH=/home/jupyter/envs
export JUPYTER_DATA_DIR=/home/jupyter/envs
</code>```

I have a beginner's understanding of jupyter and of the important ramifications of using two-disk systems. Could someone please help me understand:

(1) Why is Jupyter failing to search for kernelspec files on the JUPYTER_PATH or in the JUPYTER_DATA_DIR?

(2) If I am mistaken about how the search paths work, what is the best strategy for maintaining virtual environment exposure when Jupyter is installed on an ephemeral boot disk? (Note, I am aware of nb_conda_kernels, which I am specifically avoiding)

A related post focused on the start-up script can be found at this url. Here I am more interested in the general Jupyter + two-disk use case.

Body:
I am working in Google Vertex AI, which has a two-disk system of a boot disk and a data disk, the latter of which is mounted to /home/jupyter. I am trying to expose python venv environments with kernelspec files, and then keep those environments exposed across repeated stop-start cycles. All of the default locations for kernelspec files are on the boot disk, which is ephemeral and recreated each time the VM is started (i.e., the exposed kernels vaporize each time the VM is stopped). Conceptually, I want to use a VM start-up script to add a persistent data disk path to the JUPYTER_PATH variable, since, according to the documentation, "Jupyter uses a search path to find installable data files, such as kernelspecs and notebook extensions." During interactive testing in the Terminal, I have not found this to be true. I have also tried setting the data directory variable, but it does not help.

export JUPYTER_PATH=/home/jupyter/envs
export JUPYTER_DATA_DIR=/home/jupyter/envs

I have a beginner's understanding of jupyter and of the important ramifications of using two-disk systems. Could someone please help me understand:

(1) Why is Jupyter failing to search for kernelspec files on the JUPYTER_PATH or in the JUPYTER_DATA_DIR?

(2) If I am mistaken about how the search paths work, what is the best strategy for maintaining virtual environment exposure when Jupyter is installed on an ephemeral boot disk? (Note, I am aware of nb_conda_kernels, which I am specifically avoiding)

A related post focused on the start-up script can be found at this url. Here I am more interested in the general Jupyter + two-disk use case.


问:
how I can evaluation the depth map result?
Code section 1

```<code>!mkdir -p inputs
!mkdir -p outputs_midas
!mkdir -p outputs_leres
</code>```

Code section 2

Clone git repo

```<code>!git clone https://github.com/compphoto/BoostingMonocularDepth.git

!wget https://sfu.ca/~yagiz/CVPR21/latest_net_G.pth
#!gdown https://drive.google.com/u/0/uc?id=1cU2y-kMbt0Sf00Ns4CN2oO9qPJ8BensP&export=download

# Downloading merge model weights
!mkdir -p /content/BoostingMonocularDepth/pix2pix/checkpoints/mergemodel/
!mv latest_net_G.pth /content/BoostingMonocularDepth/pix2pix/checkpoints/mergemodel/

# Downloading Midas weights
!wget https://github.com/AlexeyAB/MiDaS/releases/download/midas_dpt/midas_v21-f6b98070.pt
!mv midas_v21-f6b98070.pt /content/BoostingMonocularDepth/midas/model.pt

# # Downloading LeRes weights
!wget https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download
!mv download /content/BoostingMonocularDepth/res101.pth
</code>```

Code section 3

```<code>%cd BoostingMonocularDepth/
</code>```

Running the method using LeRes

```<code>!python run.py --Final --data_dir /content/inputs --output_dir  /content/outputs_leres/ --depthNet 2
</code>```

I applies this code to ceate depth map and this is my result I need way evalute the result
ther is part in github to evalution but I dont know how can I running this part

```<code>./evaluation/evaluatedataset.m
</code>```

code link:
!git clone https://github.com/compphoto/BoostingMonocularDepth.git

and this is the image and the rusult
enter image description here
enter image description here

Body:
Code section 1

!mkdir -p inputs
!mkdir -p outputs_midas
!mkdir -p outputs_leres

Code section 2

Clone git repo

!git clone https://github.com/compphoto/BoostingMonocularDepth.git

!wget https://sfu.ca/~yagiz/CVPR21/latest_net_G.pth
#!gdown https://drive.google.com/u/0/uc?id=1cU2y-kMbt0Sf00Ns4CN2oO9qPJ8BensP&export=download

# Downloading merge model weights
!mkdir -p /content/BoostingMonocularDepth/pix2pix/checkpoints/mergemodel/
!mv latest_net_G.pth /content/BoostingMonocularDepth/pix2pix/checkpoints/mergemodel/

# Downloading Midas weights
!wget https://github.com/AlexeyAB/MiDaS/releases/download/midas_dpt/midas_v21-f6b98070.pt
!mv midas_v21-f6b98070.pt /content/BoostingMonocularDepth/midas/model.pt

# # Downloading LeRes weights
!wget https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download
!mv download /content/BoostingMonocularDepth/res101.pth

Code section 3

%cd BoostingMonocularDepth/

Running the method using LeRes

!python run.py --Final --data_dir /content/inputs --output_dir  /content/outputs_leres/ --depthNet 2

I applies this code to ceate depth map and this is my result I need way evalute the result
ther is part in github to evalution but I dont know how can I running this part

./evaluation/evaluatedataset.m

code link:
!git clone https://github.com/compphoto/BoostingMonocularDepth.git

and this is the image and the rusult
enter image description here
enter image description here


问:
Expo app (Android) crashing on opening once downloaded
I've created a simple Android app with Expo. Here is the GitHub repo, and here it is on Play Store.

My problem: it does not even open. However, on my phones with the Expo app, both Android and iOS, it runs smoothly with no error or warning whatsoever, therefore I don't know what the cause of the bug may be.

For building, I used EAS successfully. The upload to Play Store, no issue either.

Any hint or help would be much appreciated.

Thank you all in advance.


问:
Create a lobby room and join to that room in unity using photon pun
Here is my code:

using UnityEngine;
using Photon.Pun;
using TMPro;
using UnityEngine.UI;
using Photon.Realtime;

public class RoomController : MonoBehaviourPunCallbacks
{
    public TextMeshProUGUI createRoomField;
    public TMP_InputField joinRoomField;
    public Button enterGameButton;

    public void CreatingRoom()
    {
        RoomOptions roomOptions = new RoomOptions();
        roomOptions.MaxPlayers = 2;
        PhotonNetwork.CreateRoom(createRoomField.text, roomOptions, TypedLobby.Default);
    }
    public override void OnCreatedRoom()
    {
        Debug.Log("on created rooom successfully ");
    }

    public override void OnCreateRoomFailed(short returnCode, string message)
    {
        Debug.Log("not created " + message);
    }

    public void JoinRoom()
    {
        PhotonNetwork.JoinRoom(joinRoomField.text);
        Debug.Log("Joined room");
    }

    public override void OnJoinedRoom()
    {
        enterGameButton.interactable = true;
        Debug.Log("Connected to room" + createRoomField.name);
    }
}

```

But I'm facing this issue

CreateRoom failed. Client is on MasterServer (must be Master Server
for matchmaking)but not ready for operations (State: PeerCreated).
Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError (object)
Photon.Pun.PhotonNetwork:CreateRoom
(string,Photon.Realtime.RoomOptions,Photon.Realtime.TypedLobby,string[])
(at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:1782)
RoomController:CreatingRoom () (at
Assets/Scripts/RoomController.cs:19)
UnityEngine.EventSystems.EventSystem:Update () (at
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)

I'm trying to create a room and join to that room when
CreatingRoom() is called using a button on click in inspector also room name is fetched from a text box ie,(TextMeshProUGUI createRoomField)

Body:
Here is my code:

using UnityEngine;
using Photon.Pun;
using TMPro;
using UnityEngine.UI;
using Photon.Realtime;

public class RoomController : MonoBehaviourPunCallbacks
{
    public TextMeshProUGUI createRoomField;
    public TMP_InputField joinRoomField;
    public Button enterGameButton;

    public void CreatingRoom()
    {
        RoomOptions roomOptions = new RoomOptions();
        roomOptions.MaxPlayers = 2;
        PhotonNetwork.CreateRoom(createRoomField.text, roomOptions, TypedLobby.Default);
    }
    public override void OnCreatedRoom()
    {
        Debug.Log("on created rooom successfully ");
    }

    public override void OnCreateRoomFailed(short returnCode, string message)
    {
        Debug.Log("not created " + message);
    }

    public void JoinRoom()
    {
        PhotonNetwork.JoinRoom(joinRoomField.text);
        Debug.Log("Joined room");
    }

    public override void OnJoinedRoom()
    {
        enterGameButton.interactable = true;
        Debug.Log("Connected to room" + createRoomField.name);
    }
}

But I'm facing this issue

CreateRoom failed. Client is on MasterServer (must be Master Server
for matchmaking)but not ready for operations (State: PeerCreated).
Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError (object)
Photon.Pun.PhotonNetwork:CreateRoom
(string,Photon.Realtime.RoomOptions,Photon.Realtime.TypedLobby,string[])
(at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:1782)
RoomController:CreatingRoom () (at
Assets/Scripts/RoomController.cs:19)
UnityEngine.EventSystems.EventSystem:Update () (at
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)

I'm trying to create a room and join to that room when
CreatingRoom() is called using a button on click in inspector also room name is fetched from a text box ie,(TextMeshProUGUI createRoomField)


问:
MySQL query for custom search engine question
I'm having two issues, this is the query:

```<code>    $sql = "SELECT *, SUM(MATCH(title, beskrivelse) AGAINST('$input' IN BOOLEAN MODE)) as score
    FROM search_posts
    WHERE MATCH(title, beskrivelse) AGAINST('$input' IN BOOLEAN MODE)
    GROUP BY title, beskrivelse
    ORDER BY score DESC";
</code>```

first issue, if I start out the query with a + or - sign, or do eg. "gold +" as query, I get fatal error:

syntax error, unexpected $end

How do I filter it so it won't make errors but allow the signs?.

second issue, if I have this word in database "Gold digger", and a lot of others then I search "g" and get a lot then "go" get nothing, then "gol" and maybe find one, then "gold" and finally get it, how do i modify this so it will show it and never return 0?

I tried adding %{$input}% but changed nothing, also modified mysql.ini and added

```<code>innodb_ft_min_token_size=1
ft_min_word_len=1
ft_stopword_file=""
</code>```

and rebuild the fulltext index, but didn't change anything.

Any help is appreciated, thanks

Body:
I'm having two issues, this is the query:

    $sql = "SELECT *, SUM(MATCH(title, beskrivelse) AGAINST('$input' IN BOOLEAN MODE)) as score
    FROM search_posts
    WHERE MATCH(title, beskrivelse) AGAINST('$input' IN BOOLEAN MODE)
    GROUP BY title, beskrivelse
    ORDER BY score DESC";

first issue, if I start out the query with a + or - sign, or do eg. "gold +" as query, I get fatal error:

syntax error, unexpected $end

How do I filter it so it won't make errors but allow the signs?.

second issue, if I have this word in database "Gold digger", and a lot of others then I search "g" and get a lot then "go" get nothing, then "gol" and maybe find one, then "gold" and finally get it, how do i modify this so it will show it and never return 0?

I tried adding %{$input}% but changed nothing, also modified mysql.ini and added

innodb_ft_min_token_size=1
ft_min_word_len=1
ft_stopword_file=""

and rebuild the fulltext index, but didn't change anything.

Any help is appreciated, thanks


问:
application.properties files not being read in Spring Framework 5.x
I am working on a migration of Spring Framework to Spring Boot. Right now configuration happens in multiple classes. The main configuration class has the following to ensure that files are read from the right location, but I can't use the lovely spring "hierarchical override" by specifying a profile. Here's the annotations on the main configuration class:

```<code>@Configuration("applicationthingyConfiguration")
@Order(Ordered.HIGHEST_PRECEDENCE)
@PropertySources({
  @PropertySource("classpath:application.properties")
})
</code>```

If I remove all BUT the configuration annotation from above AND use an @Import in the Datasource configuration class (different than above) like the following:

```<code>@Import(MainAPIConfiguration.class)
</code>```

and set a breakpoint in the constructor I see all the standard spring config sources, but NONE of my properties files are read in. What is the magical set of annotations I can use to get this to work?

At this breakpoint here is the property sources found by spring (I was expecting application.properties to be picked up)

Screenshot of debugger output at breakpoint mentioned above

Body:
I am working on a migration of Spring Framework to Spring Boot. Right now configuration happens in multiple classes. The main configuration class has the following to ensure that files are read from the right location, but I can't use the lovely spring "hierarchical override" by specifying a profile. Here's the annotations on the main configuration class:

@Configuration("applicationthingyConfiguration")
@Order(Ordered.HIGHEST_PRECEDENCE)
@PropertySources({
  @PropertySource("classpath:application.properties")
})

If I remove all BUT the configuration annotation from above AND use an @Import in the Datasource configuration class (different than above) like the following:

@Import(MainAPIConfiguration.class)

and set a breakpoint in the constructor I see all the standard spring config sources, but NONE of my properties files are read in. What is the magical set of annotations I can use to get this to work?

At this breakpoint here is the property sources found by spring (I was expecting application.properties to be picked up)

Screenshot of debugger output at breakpoint mentioned above


问:
How to perform geotargeting in puppeteer?
I am running puppeteer locally:

```<code>const puppeteer = require('puppeteer');
(async () => {

    const url = 'https://www.google.com/search?q=coffee';
    const browser = await puppeteer.launch({ headless: false });

    const page = await browser.newPage();

    await page.setGeolocation({ latitude: 40.7128, longitude: 74.0060, accuracy: 100 });

    await page.goto(url);
})();
</code>```

Above script worked for me when I tried it for the first time. But next time when I changed lat/long then it always started detecting my current location.

Any idea why does this happen?

Body:
I am running puppeteer locally:

const puppeteer = require('puppeteer');
(async () => {

    const url = 'https://www.google.com/search?q=coffee';
    const browser = await puppeteer.launch({ headless: false });

    const page = await browser.newPage();

    await page.setGeolocation({ latitude: 40.7128, longitude: 74.0060, accuracy: 100 });

    await page.goto(url);
})();

Above script worked for me when I tried it for the first time. But next time when I changed lat/long then it always started detecting my current location.

Any idea why does this happen?


问:
Android Studio Compilation with CMake and PkgConfig
Long story short: I'm attempting to use an existing CMake project I've been
working on for a while and use that as a subproject in an Android app.

As per the Android
documentation,
I simply add the project directory using add_subdirectory(). This works, but I
noticed that for some reason it was finding and picking up a lot of the optional
dependencies from the host system rather than the target Android device.

After debugging this for quite a while, I finally noticed that this came from
using the "PkgConfig" package in CMake:

```<code>find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW glfw3)
pkg_search_module(OpenEXR OpenEXR)
pkg_search_module(LIBPNG libpng)
pkg_search_module(IMGUI imgui)
pkg_search_module(LUA lua)
</code>```

All of these libraries are optional for the subproject, but since
pkg_search_module "finds" them anyways (on the host, not device) they are
inadvertently enabled, causing the compilation to fail during the header
inclusions or library linking steps.

So I guess my question is: What is the recommended approach for using the
PkgConfig CMake package in a cross-compilation setting, such as for Android
apps?

Body:
Long story short: I'm attempting to use an existing CMake project I've been
working on for a while and use that as a subproject in an Android app.

As per the Android
documentation,
I simply add the project directory using add_subdirectory(). This works, but I
noticed that for some reason it was finding and picking up a lot of the optional
dependencies from the host system rather than the target Android device.

After debugging this for quite a while, I finally noticed that this came from
using the "PkgConfig" package in CMake:

find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW glfw3)
pkg_search_module(OpenEXR OpenEXR)
pkg_search_module(LIBPNG libpng)
pkg_search_module(IMGUI imgui)
pkg_search_module(LUA lua)

All of these libraries are optional for the subproject, but since
pkg_search_module "finds" them anyways (on the host, not device) they are
inadvertently enabled, causing the compilation to fail during the header
inclusions or library linking steps.

So I guess my question is: What is the recommended approach for using the
PkgConfig CMake package in a cross-compilation setting, such as for Android
apps?


问:
Failed to convert value(s) to axis units: 'A'
I am tryng to plotting labelling data points in Seaborn Plots and I am facing a format problem.

Here is my code:

# plot line graph
sns.set(rc={'figure.figsize':(10,5)})
ax = sns.lineplot(x=bbCorpBRIT3['Quarter'], y=bbCorpBRIT3['Acessos'],data=bbCorpBRIT3,marker='*',color='#965786')
ax.set(title='Total Access')

# label points on the plot
for x, y in zip('Quarter','Acessos'):
     plt.text(x = x, # x-coordinate position of data label
              y = y, # y-coordinate position of data label, adjusted to be 150 below the data point
              s = '{}'.format(y), # data label, formatted to ignore decimals
              color = 'purple') # set colour of line
```
<p>Here is the dataframe info:</p>
```# Column   Non-Null Count  Dtype
--------------------------------
0   Quarter  22 non-null     object
1   Acessos  22 non-null     int64
dtypes: int64(1), object(1)
memory usage: 480.0+ bytes
```
<p>Bellow a part of the Dataframe:</p>
```Quarter
2021Q1     645407
2021Q1     659598
2021Q1     674821
2021Q2     697064
2021Q2     718105
2021Q2     736580
2021Q3     754477
2021Q3     772991
2021Q3     790731
```

I am following the script of https://medium.com/swlh/quick-guide-to-labelling-data-for-common-seaborn-plots-736e10bf14a9 and would try to get the same results.

Body:
I am tryng to plotting labelling data points in Seaborn Plots and I am facing a format problem.

Here is my code:

# plot line graph
sns.set(rc={'figure.figsize':(10,5)})
ax = sns.lineplot(x=bbCorpBRIT3['Quarter'], y=bbCorpBRIT3['Acessos'],data=bbCorpBRIT3,marker='*',color='#965786')
ax.set(title='Total Access')

# label points on the plot
for x, y in zip('Quarter','Acessos'):
     plt.text(x = x, # x-coordinate position of data label
              y = y, # y-coordinate position of data label, adjusted to be 150 below the data point
              s = '{}'.format(y), # data label, formatted to ignore decimals
              color = 'purple') # set colour of line

Here is the dataframe info:

# Column   Non-Null Count  Dtype
--------------------------------
0   Quarter  22 non-null     object
1   Acessos  22 non-null     int64
dtypes: int64(1), object(1)
memory usage: 480.0+ bytes

Bellow a part of the Dataframe:

Quarter
2021Q1     645407
2021Q1     659598
2021Q1     674821
2021Q2     697064
2021Q2     718105
2021Q2     736580
2021Q3     754477
2021Q3     772991
2021Q3     790731

I am following the script of https://medium.com/swlh/quick-guide-to-labelling-data-for-common-seaborn-plots-736e10bf14a9 and would try to get the same results.


问:
fabric 2: How to set default hosts in fabfile (using python code)?
In Fabric 1 this could be used in code to set up defult hosts, and it was recognized by all tasks:

```<code>env.hosts = ['host1', 'host2', 'host3']
</code>```

Whay is the equivalent in Fabric 2?

Body:
In Fabric 1 this could be used in code to set up defult hosts, and it was recognized by all tasks:

env.hosts = ['host1', 'host2', 'host3']

Whay is the equivalent in Fabric 2?


问:
Pro and Cons while comparing SSR using backend framework and fullstack framework
What would be micro level and macro level pro and cons when we would be comparing SSR (server-side rendering) using backend frameworks (like Django, flask etc) and fullstack framework (like Sveltekit, NuxtJS, NextJS etc)

Both type of frameworks do server SSR (server-side rendering) but there ways are very different. In case of backend framework we write our own HTML with some template engine and on other side modern fullstack framework have there own component system that generate HTML.
If we compare booth's working then what would be pro and cons of each?


问:
Error NG1010: Value at position 12 in the NgModule.declarations of HomeModule is not a reference Value could not be determined statically
In my Angular 15 app, I have a submodule that's imported into AppMoodule using lazy-loading as follows:

```<code>{ path: PathVariables.HOME, loadChildren: () => import('./home/home.module').then(m => m.HomeModule),canActivate
</code>```

The app running well from my dev env but when deploying on the Heroku server, the nested module an all its child components are not found.

```<code>Error: src/app/home/home.module.ts:18:48 - error TS2307: Cannot find module './authentification/gestion-des-permissions/gestion-des-permissions.component' or its corresponding type declarations.
18 import { GestionDesPermissionsComponent } from './authentification/gestion-des-permissions/gestion-des-permissions.component';
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/home/home.module.ts:19:37 - error TS2307: Cannot find module './authentification/roles/liste-roles/liste-roles.component' or its corresponding type declarations.
19 import { ListeRolesComponent } from './authentification/roles/liste-roles/liste-roles.component';
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/home/home.module.ts:22:39 - error TS2307: Cannot find module './authentification/roles/modification/modification.component' or its corresponding type declarations.
22 import { ModificationComponent } from './authentification/roles/modification/modification.component';
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/home/home.module.ts:31:17 - error NG1010: Value at position 12 in the NgModule.declarations of HomeModule is not a reference
  Value could not be determined statically.
 31   declarations: [
                    ~
 32        AdresseComponent,
    ~~~~~~~~~~~~~~~~~~~~~~~~
...
 50        ListeRolesComponent
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
 51   ],
    ~~~
  src/app/home/home.module.ts:44:8
    44        ActivitesComponent,
              ~~~~~~~~~~~~~~~~~~
    Unknown reference.
-----> Build failed
</code>```

We are on it but we are all new Angular devs.

Body:
In my Angular 15 app, I have a submodule that's imported into AppMoodule using lazy-loading as follows:

{ path: PathVariables.HOME, loadChildren: () => import('./home/home.module').then(m => m.HomeModule),canActivate

The app running well from my dev env but when deploying on the Heroku server, the nested module an all its child components are not found.

Error: src/app/home/home.module.ts:18:48 - error TS2307: Cannot find module './authentification/gestion-des-permissions/gestion-des-permissions.component' or its corresponding type declarations.
18 import { GestionDesPermissionsComponent } from './authentification/gestion-des-permissions/gestion-des-permissions.component';
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/home/home.module.ts:19:37 - error TS2307: Cannot find module './authentification/roles/liste-roles/liste-roles.component' or its corresponding type declarations.
19 import { ListeRolesComponent } from './authentification/roles/liste-roles/liste-roles.component';
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/home/home.module.ts:22:39 - error TS2307: Cannot find module './authentification/roles/modification/modification.component' or its corresponding type declarations.
22 import { ModificationComponent } from './authentification/roles/modification/modification.component';
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/home/home.module.ts:31:17 - error NG1010: Value at position 12 in the NgModule.declarations of HomeModule is not a reference
  Value could not be determined statically.
 31   declarations: [
                    ~
 32        AdresseComponent,
    ~~~~~~~~~~~~~~~~~~~~~~~~
...
 50        ListeRolesComponent
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
 51   ],
    ~~~
  src/app/home/home.module.ts:44:8
    44        ActivitesComponent,
              ~~~~~~~~~~~~~~~~~~
    Unknown reference.
-----> Build failed

We are on it but we are all new Angular devs.


问:
PyCharm: add Run/Debug Configuration for React front-end
For the React front-end of my Django project, I want to add a Run/Debug Configuration in PyCharm.

Inside package.json of the project, I defined the scripts for developement and production:

```<code>...
"scripts": {
    "dev": "webpack --config dev.webpack.config.js --mode development --entry ./src/index.js --output-path ./static/frontend",
    "build": "webpack --config prod.webpack.config.js --mode production --entry ./src/index.js --output-path ./static/frontend"
  },
...
</code>```

So, I can run npm run dev to bundle everything into a main.js file in development mode.

But how can I debug my React components and other JS-Code, since it gets bundled by npm run webpack ... [...] ?

Let's say, I wanted to be able to set breakpoints inside the code with the IDE.
How could that be achieved?

Body:
For the React front-end of my Django project, I want to add a Run/Debug Configuration in PyCharm.

Inside package.json of the project, I defined the scripts for developement and production:

...
"scripts": {
    "dev": "webpack --config dev.webpack.config.js --mode development --entry ./src/index.js --output-path ./static/frontend",
    "build": "webpack --config prod.webpack.config.js --mode production --entry ./src/index.js --output-path ./static/frontend"
  },
...

So, I can run npm run dev to bundle everything into a main.js file in development mode.

But how can I debug my React components and other JS-Code, since it gets bundled by npm run webpack ... [...] ?

Let's say, I wanted to be able to set breakpoints inside the code with the IDE.
How could that be achieved?


问:
@Click directive is calling the wrong event handler
In my vue.js project I have multiple pages, between which I am navegating using a router. I have a page, on which there are some buttons doing some actions on the page and two buttons, which are used to navegate between pages. The first button (back button) is always visible, the second button (finish button) is only visible, if one of the otherbuttons is currently active.

Now, in the following situations I get the expected behavior:

Not choosing any of the action buttons and clicking the back-button

Choosing one ore multiple button and clicking the finish-button

Choosing one or more buttons, deselecting them and clicking the back-button

In the last case, when selecting one or more buttons and then using the back-button, the button calls the event handler of the finish button (I figured this out because I used a debug statement in the event handlers).

I cannot make out the reason for this behaviour, help is appreciated.

Here are some parts of my code:

index.js:

```<code>import { createRouter, createWebHistory } from 'vue-router'
import Page1 from '../views/Page1'
import Page2 from '../views/Page2'
import Page3 from '../views/Page3'

const routes = [
  {
    path: '/',
    redirect: {
        name: 'Page1'
    }
  },
  {
    path: '/Page2',
    name: 'Page2',
    component: Page2
  },
  {
    path: '/Page3',
    name: 'Page3',
    component: Page3
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
})

export default router
</code>```

Page1.vue

```<code><template>
    <MultiButtons
        :titles = titles
        @toggle-button="toggle_button"
    />
    <BackButton
      @click.stop="$router.push({
        name: 'Page2'
      });;"
      text="Zurück"
    ></BackButton>
    <FinishButton
      @click.stop="$router.push({
        name: 'Page3',
        params:
          { chosenErrors: Array.from(this.activeButtons) }
      });"
      text="Fertig"
      :visible=ready
    ></FinishButton>
</template>

<script>

import MultiButtons from '../components/MultiButtons.vue'
import BackButton from "../components/BackButton.vue"
import Titles from "../assets/json/Beschreibungen_FehlerDokumentation.json"
import FinishButton from "../components/FinishButton.vue"

export default {
    name: 'Page1',
    props: {
    },
    components: {
        MultiButtons,
        BackButton,
        FinishButton
    },
    methods: {
      toggle_button(activeButtons){
        this.ready = (activeButtons.size != 0);
        this.activeButtons = activeButtons;
      }
    },
    data() {
        return {
            titles: Titles,
            ready: false,
            activeButtons: new Set([])
        }
    }
}
</script>
</code>```

FinishButton.vue

```<code><template>
    <div :style="visible ? { 'display': 'inline-flex' } : { 'display': 'none' }">
        <h3 class="descriptor">{{text}}</h3>
        <button/>
    </div>
</template>

<script>

    export default {
        name: 'FinishButton',
        props : {
            text: String,
            visible: Boolean
        }
    }

</script>
</code>```

Backbutton.vue

```<code><template>
    <div>
        <button/>
        <h3 class="descriptor">{{text}}</h3>
    </div>
</template>

<script>

    export default {
        name: 'BackButton',
        props : {
            text: String
        }
    }

</script>
</code>```

Multibuttons.vue

```<code><template>
    <div>
        <MultiButton
            v-for="(obj,index) in titles"
            :id=obj.id
            :title=obj.title
            @toggle-button="toggle_button"
        />
    </div>
</template>

<script>

    import MultiButton from './MultiButton.vue';

    export default {
        name: 'MultiButtons',
        components : {
            MultiButton,
        },
        props : {
            titles: Array
        },
        methods: {
            toggle_button(id) {
                this.activeButtons.has(id) ? this.activeButtons.delete(id) : this.activeButtons.add(id);
                this.$emit('toggle-button', this.activeButtons);
            },
        },
        data() {
            return {
                activeButtons: new Set([])
            }
        },
        emits:["toggle-button"]
    }

</script>
</code>```

MultiButton.vue

```<code><template>
        <button
            @click.stop="toggle()">
            <h2 class="multibtn_title" :style="{ color: isActive ? 'white' : 'black'}">{{title}}</h2>
        </button>
</template>

<script>
    export default {
        name: 'MultiButton',
        props : {
            title: String,
            id: Number
        },
        data() {
            return {
                isActive: false
            }
        },
        methods: {
            toggle() {
                this.isActive = !this.isActive;
                this.$emit('toggle-button', this.id);
            }
        },
        emits:["toggle-button"]
    }
</script>
</code>```

Body:
In my vue.js project I have multiple pages, between which I am navegating using a router. I have a page, on which there are some buttons doing some actions on the page and two buttons, which are used to navegate between pages. The first button (back button) is always visible, the second button (finish button) is only visible, if one of the otherbuttons is currently active.

Now, in the following situations I get the expected behavior:

Not choosing any of the action buttons and clicking the back-button

Choosing one ore multiple button and clicking the finish-button

Choosing one or more buttons, deselecting them and clicking the back-button

In the last case, when selecting one or more buttons and then using the back-button, the button calls the event handler of the finish button (I figured this out because I used a debug statement in the event handlers).

I cannot make out the reason for this behaviour, help is appreciated.

Here are some parts of my code:

index.js:

import { createRouter, createWebHistory } from 'vue-router'
import Page1 from '../views/Page1'
import Page2 from '../views/Page2'
import Page3 from '../views/Page3'

const routes = [
  {
    path: '/',
    redirect: {
        name: 'Page1'
    }
  },
  {
    path: '/Page2',
    name: 'Page2',
    component: Page2
  },
  {
    path: '/Page3',
    name: 'Page3',
    component: Page3
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
})

export default router

Page1.vue

<template>
    <MultiButtons
        :titles = titles
        @toggle-button="toggle_button"
    />
    <BackButton
      @click.stop="$router.push({
        name: 'Page2'
      });;"
      text="Zurück"
    ></BackButton>
    <FinishButton
      @click.stop="$router.push({
        name: 'Page3',
        params:
          { chosenErrors: Array.from(this.activeButtons) }
      });"
      text="Fertig"
      :visible=ready
    ></FinishButton>
</template>

FinishButton.vue

<template>

{{text}}

        <button/>

</template>

Backbutton.vue

<template>

        <button/>

{{text}}

</template>

Multibuttons.vue

<template>

        <MultiButton
            v-for="(obj,index) in titles"
            :id=obj.id
            :title=obj.title
            @toggle-button="toggle_button"
        />

</template>

MultiButton.vue

<template>
        <button
            @click.stop="toggle()">

{{title}}

        </button>
</template>


问:
Ajax call on checking checkbox, how to catch data?
I use the following code:

```<code><script>
    $(document).ready(function() {
  $('.model').click(function() {
    var formData = $('#myForm').serialize();
    console.log('Posting the following: ', formData);

    $.ajax({
      url: 'av_check.php',
      data: formData,
      type: 'post',
      dataType: 'html',
      success: function(data) {
        $('#html-container').html(data);
      }
    });
  });
});
</script>
</code>```

When I check a checkbox, it sends model=VALUE to av_check.php
But when I select multiple checkboxes, it sends the data like this:

?model=VALUE&model=VALUE&model=VALUE

But when I return $_POST['model'] , it just returns the first value of MODEL.
What can I do to read / use all the MODEL values.

See attachment for screenshot of the console log.

Console Log

I think it is more easy to use Json, but when I change dataType to Json, I don't get a response back to show in the DIV on the page that makes the call.

Body:
I use the following code:

When I check a checkbox, it sends model=VALUE to av_check.php
But when I select multiple checkboxes, it sends the data like this:

?model=VALUE&model=VALUE&model=VALUE

But when I return $_POST['model'] , it just returns the first value of MODEL.
What can I do to read / use all the MODEL values.

See attachment for screenshot of the console log.

Console Log

I think it is more easy to use Json, but when I change dataType to Json, I don't get a response back to show in the DIV on the page that makes the call.


问:
Testcontainers fiel in Docker does not found
Run test with mySql container and have some error

My log errors,

```<code>  16:04:35.810 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [CourseDaoTest]: using SpringBootContextLoader
16:04:35.816 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [spring.dao.CourseDaoTest]: no resource found for suffixes {-context.xml, Context.groovy}.
16:04:35.816 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [spring.dao.CourseDaoTest]: CourseDaoTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
16:04:35.850 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Using ContextCustomizers for test class [CourseDaoTest]: [ImportsContextCustomizer, ExcludeFilterContextCustomizer, DuplicateJsonObjectContextCustomizer, MockitoContextCustomizer, DisableAutoConfigurationContextCustomizer, DisableObservabilityContextCustomizer, TypeExcludeFiltersContextCustomizer, PropertyMappingContextCustomizer, Customizer, DynamicPropertiesContextCustomizer]
16:04:35.902 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\Java\eclipse-workspace\CourseSystem\target\classes\spring\CourseSystemApplication.class]
16:04:35.903 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration spring.CourseSystemApplication for test class spring.dao.CourseDaoTest
16:04:35.909 [main] DEBUG org.springframework.test.context.util.TestContextSpringFactoriesUtils - Skipping candidate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener] due to a missing dependency. Specify custom TestExecutionListener classes or make the default TestExecutionListener classes and their required dependencies available. Offending class: [jakarta/servlet/ServletContext]
16:04:35.918 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Using TestExecutionListeners for test class [CourseDaoTest]: [DirtiesContextBeforeModesTestExecutionListener, ApplicationEventsTestExecutionListener, MockitoTestExecutionListener, DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener, SqlScriptsTestExecutionListener, EventPublishingTestExecutionListener, ResetMocksTestExecutionListener, RestDocsTestExecutionListener, MockRestServiceServerResetTestExecutionListener, MockMvcPrintOnlyOnFailureTestExecutionListener, WebDriverTestExecutionListener, MockWebServiceServerTestExecutionListener]
16:04:35.919 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: class [CourseDaoTest], class annotated with @DirtiesContext [false] with mode [null]
16:04:35.999 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/C:/Users/Java/.testcontainers.properties
16:04:36.006 [main] WARN org.testcontainers.utility.TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/C:/Users/Java/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: C:\Users\Java\.testcontainers.properties (The system cannot find the file specified)
16:04:36.009 [main] INFO org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
16:04:36.029 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Trying out strategy: NpipeSocketClientProviderStrategy
16:04:36.030 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - DOCKER_HOST socket file '//./pipe/docker_engine' does not exist
16:04:36.030 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - strategy NpipeSocketClientProviderStrategy did not pass the test
16:04:36.033 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([C:/Users/Java/eclipseEE/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_18.0.1.v20220515-1614/jre/bin/server, C:/Users/Java/eclipseEE/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_18.0.1.v20220515-1614/jre/bin, C:\Program Files (x86)\Common Files\Oracle\Java\javapath, C:\Windows\System32, C:\Program Files\MySQL\MySQL Shell 8.0\bin\, C:\Users\Java\AppData\Local\GitHubDesktop\bin, C:\maven\tools\apache-maven-3.8.5\bin, C:\Program Files\Java\jdk1.8\bin, C:\Program Files\Git\cmd, C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR, C:\Program Files\Docker\Docker\resources\bin, C:\Program Files\MySQL\MySQL Shell 8.0\bin\, %USERPROFILE%\AppData\Local\Microsoft\WindowsApps, C:\Users\Java\AppData\Local\GitHubDesktop\bin, %M2%, C:Program Files\Java\jdk1.8\bin, C:\Program Files (x86)\KeyMan, C:\Users\Java\eclipseEE\eclipse])
16:04:36.034 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
16:04:36.034 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue
16:04:36.037 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test class: class [CourseDaoTest], class annotated with @DirtiesContext [false] with mode [null]
</code>```

Docker i am install on my Windows, also Linux Ubuntu extension install, in Docker setting choose Use the WSL 2 based engine (Windows Home can only run the WSL 2 backend); If somebody know where problem say me, tnx))

Body:
Run test with mySql container and have some error

My log errors,

  16:04:35.810 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [CourseDaoTest]: using SpringBootContextLoader
16:04:35.816 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [spring.dao.CourseDaoTest]: no resource found for suffixes {-context.xml, Context.groovy}.
16:04:35.816 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [spring.dao.CourseDaoTest]: CourseDaoTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
16:04:35.850 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Using ContextCustomizers for test class [CourseDaoTest]: [ImportsContextCustomizer, ExcludeFilterContextCustomizer, DuplicateJsonObjectContextCustomizer, MockitoContextCustomizer, DisableAutoConfigurationContextCustomizer, DisableObservabilityContextCustomizer, TypeExcludeFiltersContextCustomizer, PropertyMappingContextCustomizer, Customizer, DynamicPropertiesContextCustomizer]
16:04:35.902 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\Java\eclipse-workspace\CourseSystem\target\classes\spring\CourseSystemApplication.class]
16:04:35.903 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration spring.CourseSystemApplication for test class spring.dao.CourseDaoTest
16:04:35.909 [main] DEBUG org.springframework.test.context.util.TestContextSpringFactoriesUtils - Skipping candidate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener] due to a missing dependency. Specify custom TestExecutionListener classes or make the default TestExecutionListener classes and their required dependencies available. Offending class: [jakarta/servlet/ServletContext]
16:04:35.918 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Using TestExecutionListeners for test class [CourseDaoTest]: [DirtiesContextBeforeModesTestExecutionListener, ApplicationEventsTestExecutionListener, MockitoTestExecutionListener, DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener, SqlScriptsTestExecutionListener, EventPublishingTestExecutionListener, ResetMocksTestExecutionListener, RestDocsTestExecutionListener, MockRestServiceServerResetTestExecutionListener, MockMvcPrintOnlyOnFailureTestExecutionListener, WebDriverTestExecutionListener, MockWebServiceServerTestExecutionListener]
16:04:35.919 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: class [CourseDaoTest], class annotated with @DirtiesContext [false] with mode [null]
16:04:35.999 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/C:/Users/Java/.testcontainers.properties
16:04:36.006 [main] WARN org.testcontainers.utility.TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/C:/Users/Java/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: C:\Users\Java\.testcontainers.properties (The system cannot find the file specified)
16:04:36.009 [main] INFO org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
16:04:36.029 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Trying out strategy: NpipeSocketClientProviderStrategy
16:04:36.030 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - DOCKER_HOST socket file '//./pipe/docker_engine' does not exist
16:04:36.030 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - strategy NpipeSocketClientProviderStrategy did not pass the test
16:04:36.033 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([C:/Users/Java/eclipseEE/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_18.0.1.v20220515-1614/jre/bin/server, C:/Users/Java/eclipseEE/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_18.0.1.v20220515-1614/jre/bin, C:\Program Files (x86)\Common Files\Oracle\Java\javapath, C:\Windows\System32, C:\Program Files\MySQL\MySQL Shell 8.0\bin\, C:\Users\Java\AppData\Local\GitHubDesktop\bin, C:\maven\tools\apache-maven-3.8.5\bin, C:\Program Files\Java\jdk1.8\bin, C:\Program Files\Git\cmd, C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR, C:\Program Files\Docker\Docker\resources\bin, C:\Program Files\MySQL\MySQL Shell 8.0\bin\, %USERPROFILE%\AppData\Local\Microsoft\WindowsApps, C:\Users\Java\AppData\Local\GitHubDesktop\bin, %M2%, C:Program Files\Java\jdk1.8\bin, C:\Program Files (x86)\KeyMan, C:\Users\Java\eclipseEE\eclipse])
16:04:36.034 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
16:04:36.034 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - As no valid configuration was found, execution cannot continue
16:04:36.037 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test class: class [CourseDaoTest], class annotated with @DirtiesContext [false] with mode [null]

Docker i am install on my Windows, also Linux Ubuntu extension install, in Docker setting choose Use the WSL 2 based engine (Windows Home can only run the WSL 2 backend); If somebody know where problem say me, tnx))


问:
I try to build apk in unity but show error every time How can i solve it?
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details

Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:checkReleaseManifest UP-TO-DATE
Task :launcher:prepareLintJar UP-TO-DATE
Task :unityLibrary:processReleaseManifest UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :unityLibrary:generateReleaseRFile UP-TO-DATE
Task :unityLibrary:prepareLintJar UP-TO-DATE
Task :unityLibrary:generateReleaseSources UP-TO-DATE
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :launcher:checkReleaseManifest UP-TO-DATE
Task :launcher:generateReleaseBuildConfig UP-TO-DATE
Task :launcher:generateReleaseSources UP-TO-DATE
Task :launcher:mainApkListPersistenceRelease UP-TO-DATE
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :launcher:generateReleaseResources UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
Task :launcher:mergeReleaseResources UP-TO-DATE
Task :unityLibrary:compileReleaseJavaWithJavac UP-TO-DATE
Task :unityLibrary:bundleLibCompileRelease UP-TO-DATE
Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
Task :unityLibrary:compileReleaseShaders UP-TO-DATE
Task :unityLibrary:generateReleaseAssets UP-TO-DATE
Task :launcher:javaPreCompileRelease
Task :launcher:processReleaseManifest UP-TO-DATE
Task :unityLibrary:packageReleaseAssets
Task :unityLibrary:bundleLibRuntimeRelease UP-TO-DATE
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResRelease UP-TO-DATE
Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
Task :unityLibrary:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
Task :unityLibrary:transformNativeLibsWithStripDebugSymbolForRelease UP-TO-DATE
Task :unityLibrary:transformNativeLibsWithIntermediateJniLibsForRelease UP-TO-DATE
Task :launcher:processReleaseResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
31 actionable tasks: 3 executed, 28 up-to-date

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

I try baseProject changed to 3.4.0 but not works


问:
Titlebar of JFrame not recognizing mouse events
I have a user that uses 3 monitors of different sizes, I want to use a mouse dragged event listener to detect when the user drags the window to another screen and resize it based on that screens size. When I add a mouse event listener to the jframe doesn't detect events on the title bar. Is there a way to detect titlebar events? or a better approach to this problem?

I tried also tried using AWTEventListener but had the same problem where it won't detect events in the titlebar.

Test Code showing issue:

```<code>import javax.swing.*;
import java.awt.event.*;

public class FrameTest extends JFrame
{
   JPanel pnl;
   JLabel lbl;

   public FrameTest()
   {
      setSize(1100,800);
      setLocationRelativeTo(null);
      setTitle("Frame Test");

      pnl = new JPanel();
      lbl = new JLabel("This is my Frame");

      add(pnl);
      pnl.add(lbl);

      setVisible(true);
      FrameTest.this.addMouseListener(new MouseMotionEvents());
      FrameTest.this.addMouseMotionListener(new MouseMotionEvents());

   }

   public class MouseMotionEvents implements MouseListener, MouseMotionListener
   {

     public MouseMotionEvents()
     {
       addMouseListener(this);
       addMouseMotionListener(this);
     }

     public void mouseClicked(MouseEvent me)
     {
     }

     public void mouseEntered(MouseEvent me)
     {
     }

     public void mouseExited(MouseEvent me)
     {
     }

     public void mousePressed(MouseEvent me)
     {
     }

     public void mouseReleased(MouseEvent me)
     {

     }

     public void mouseDragged(MouseEvent me)
     {
      System.out.println("Mouse Dragged Event Triggered");
     }

     public void mouseMoved(MouseEvent me)
     {
     }
   }

   public static void main( String[] args )
   {
      new FrameTest();
   }
}
</code>```

Body:
I have a user that uses 3 monitors of different sizes, I want to use a mouse dragged event listener to detect when the user drags the window to another screen and resize it based on that screens size. When I add a mouse event listener to the jframe doesn't detect events on the title bar. Is there a way to detect titlebar events? or a better approach to this problem?

I tried also tried using AWTEventListener but had the same problem where it won't detect events in the titlebar.

Test Code showing issue:

import javax.swing.*;
import java.awt.event.*;

public class FrameTest extends JFrame
{
   JPanel pnl;
   JLabel lbl;

   public FrameTest()
   {
      setSize(1100,800);
      setLocationRelativeTo(null);
      setTitle("Frame Test");

      pnl = new JPanel();
      lbl = new JLabel("This is my Frame");

      add(pnl);
      pnl.add(lbl);

      setVisible(true);
      FrameTest.this.addMouseListener(new MouseMotionEvents());
      FrameTest.this.addMouseMotionListener(new MouseMotionEvents());

   }

   public class MouseMotionEvents implements MouseListener, MouseMotionListener
   {

     public MouseMotionEvents()
     {
       addMouseListener(this);
       addMouseMotionListener(this);
     }

     public void mouseClicked(MouseEvent me)
     {
     }

     public void mouseEntered(MouseEvent me)
     {
     }

     public void mouseExited(MouseEvent me)
     {
     }

     public void mousePressed(MouseEvent me)
     {
     }

     public void mouseReleased(MouseEvent me)
     {

     }

     public void mouseDragged(MouseEvent me)
     {
      System.out.println("Mouse Dragged Event Triggered");
     }

     public void mouseMoved(MouseEvent me)
     {
     }
   }

   public static void main( String[] args )
   {
      new FrameTest();
   }
}


问:
Collections.sort with comparator inside runnable return duplicated items?
i am trying to sort a list of contacts(android/car/telephony/common/Contact.java) that does not contain duplicated items:

```<code>    private void updateSortedContactList() {
    if (mContactListLiveData.getValue() == null && getValue() == null) {
        return;
    }

    if (mContactListLiveData.getValue() == null
            || mContactListLiveData.getValue().isEmpty()) {
        setValue(null);
        return;
    }
        List<Contact> contactList = mContactListLiveData.getValue();

    if (mRunnableFuture != null) {
        mRunnableFuture.cancel(true);
    }
    Runnable runnable = () -> {
        Collections.sort(contactList, comparator);
        postValue(new Pair<>(sortMethod, contactList));
    };
    mRunnableFuture = mExecutorService.submit(runnable);
}
</code>```

as a result of this method, some times( not frequently) i get the same size list but with items that were removed, and items that were duplicated,

ps: it's not always the same items that where duplicated/removed

Body:
i am trying to sort a list of contacts(android/car/telephony/common/Contact.java) that does not contain duplicated items:

    private void updateSortedContactList() {
    if (mContactListLiveData.getValue() == null && getValue() == null) {
        return;
    }

    if (mContactListLiveData.getValue() == null
            || mContactListLiveData.getValue().isEmpty()) {
        setValue(null);
        return;
    }
        List<Contact> contactList = mContactListLiveData.getValue();

    if (mRunnableFuture != null) {
        mRunnableFuture.cancel(true);
    }
    Runnable runnable = () -> {
        Collections.sort(contactList, comparator);
        postValue(new Pair<>(sortMethod, contactList));
    };
    mRunnableFuture = mExecutorService.submit(runnable);
}

as a result of this method, some times( not frequently) i get the same size list but with items that were removed, and items that were duplicated,

ps: it's not always the same items that where duplicated/removed


问:
hvplot is not working for pyinstaller. Invalid version: 'None'
I need bar diagram with different filter options that I want to create with python and make it available as an executable with pyinstaller.
So I came across hvplot and it works, very well, but it doesn't run as an executable at all.

The problem is the import of hvplot.pandas which leads to the following error when executing the executable:

```<code> File "packaging\version.py", line 197, in __init__.
packaging.version.InvalidVersion: Invalid version: 'None'
[15440] Failed to execute script 'fail' due to unhandled exception!
</code>```

This can be reproduced with the following code:

```<code>import hvplot.pandas
from bokeh.sampledata.penguins import data as df

hvexplorer = hvplot.explorer(df)
hvexplorer.show()
</code>```

I upgraded and re-installed packages without success.

Body:
I need bar diagram with different filter options that I want to create with python and make it available as an executable with pyinstaller.
So I came across hvplot and it works, very well, but it doesn't run as an executable at all.

The problem is the import of hvplot.pandas which leads to the following error when executing the executable:

 File "packaging\version.py", line 197, in __init__.
packaging.version.InvalidVersion: Invalid version: 'None'
[15440] Failed to execute script 'fail' due to unhandled exception!

This can be reproduced with the following code:

import hvplot.pandas
from bokeh.sampledata.penguins import data as df

hvexplorer = hvplot.explorer(df)
hvexplorer.show()

I upgraded and re-installed packages without success.


问:
Linking Data directory containg csv files to CLion project
How can I use a directory that contains .csv files (containing some data) inside the program? I think I need to configure the cmake but I don't know how to do it.

I tried adding folder to cmake and hoping that it would run it program could not access that files inside the folder.


问:
Error feedback on AWS Cloudfront deployment
I am trying to add prisma to my remix app using SST but when I deploy my app I'm getting

"errorMessage": "ENOENT: no such file or directory, open '/var/task/schema.prisma'",
```

error please how to resolve this

Body:
I am trying to add prisma to my remix app using SST but when I deploy my app I'm getting

"errorMessage": "ENOENT: no such file or directory, open '/var/task/schema.prisma'",

error please how to resolve this


问:
Socket emitting increments everytime connection is established
I want the list of users whenever I login but the socket.emit("getUsers") keeps on incrementing , on the first login I get the list one time , on second login the list gets logs 2 times and keeps incrementing instead of single emit on each login.

P.S: socket.connect() is only in Home.js where user is redirected after authentication

Socket Provider

```<code>import { createContext } from 'react';
import { io } from 'socket.io-client';

const socket = io("http://localhost:8900", { withCredentials: true })
const SocketContext = createContext(socket);

const SocketProvider = ({ children }) => {
    return (
        <SocketContext.Provider value={socket}>
            {children}
        </SocketContext.Provider>
    );
};
export { SocketContext, SocketProvider };
</code>```

Home.js

```<code>    useEffect(() => {
        socket.connect();
    }, [socket])
</code>```

RecentChats.js

```<code>    useEffect(() => {
        socket.on("getUsers", (data) => console.log(data))
    }, [socket])
</code>```

Socket Server

```<code>const io = require("socket.io")(8900, { cors: { origin: 'http://localhost:3000', credentials: true } });
const jwt = require("jsonwebtoken")
require("dotenv").config()

let users = [];

const addUser = (userId, socketId) => {
    !users.some((user) => user.userId === userId) && users.push({ userId, socketId });
}

const removeUser = (socketId) => {
    users = users.filter(user => user.socketId !== socketId);
}

io.use((socket, next) => {

    const token = socket.handshake.headers.cookie.split("=")[1]
    const user = jwt.verify(token, process.env.JWT_KEY)

    if (!user.id) return next(new Error("Invalid User"))
    addUser(user.id, socket.id);
    socket.userId = user.id
    next();
})

io.on("connection", (socket) => {

    console.log(socket.userId, "user connected")

    // all online users when user connects to server
    socket.emit("getUsers", users);

    // new user connected
    socket.broadcast.emit("newConnection", socket.userId);

    // when user disconnects from server
    socket.on("disconnect", () => {
        console.log(socket.userId, "user disconnected")
        removeUser(socket.id)
        socket.broadcast.emit("disconnectedUser", socket.userId);
    })

})
</code>```

I already tried by io.emit(socket.id).emit("getUsers", users) but the issue still persists.

Further on i verified the user connections with

```<code>io.fetchSockets()
</code>```

incase of duplicated user connections due to socket.connect() but there is only one connection which is getting removed after logout.

```<code>socket.disconnect(true)
</code>```

Body:
I want the list of users whenever I login but the socket.emit("getUsers") keeps on incrementing , on the first login I get the list one time , on second login the list gets logs 2 times and keeps incrementing instead of single emit on each login.

P.S: socket.connect() is only in Home.js where user is redirected after authentication

Socket Provider

import { createContext } from 'react';
import { io } from 'socket.io-client';

const socket = io("http://localhost:8900", { withCredentials: true })
const SocketContext = createContext(socket);

const SocketProvider = ({ children }) => {
    return (
        <SocketContext.Provider value={socket}>
            {children}
        </SocketContext.Provider>
    );
};
export { SocketContext, SocketProvider };

Home.js

    useEffect(() => {
        socket.connect();
    }, [socket])

RecentChats.js

    useEffect(() => {
        socket.on("getUsers", (data) => console.log(data))
    }, [socket])

Socket Server

const io = require("socket.io")(8900, { cors: { origin: 'http://localhost:3000', credentials: true } });
const jwt = require("jsonwebtoken")
require("dotenv").config()

let users = [];

const addUser = (userId, socketId) => {
    !users.some((user) => user.userId === userId) && users.push({ userId, socketId });
}

const removeUser = (socketId) => {
    users = users.filter(user => user.socketId !== socketId);
}

io.use((socket, next) => {

    const token = socket.handshake.headers.cookie.split("=")[1]
    const user = jwt.verify(token, process.env.JWT_KEY)

    if (!user.id) return next(new Error("Invalid User"))
    addUser(user.id, socket.id);
    socket.userId = user.id
    next();
})

io.on("connection", (socket) => {

    console.log(socket.userId, "user connected")

    // all online users when user connects to server
    socket.emit("getUsers", users);

    // new user connected
    socket.broadcast.emit("newConnection", socket.userId);

    // when user disconnects from server
    socket.on("disconnect", () => {
        console.log(socket.userId, "user disconnected")
        removeUser(socket.id)
        socket.broadcast.emit("disconnectedUser", socket.userId);
    })

})

I already tried by io.emit(socket.id).emit("getUsers", users) but the issue still persists.

Further on i verified the user connections with

io.fetchSockets()

incase of duplicated user connections due to socket.connect() but there is only one connection which is getting removed after logout.

socket.disconnect(true)


问:
spring.jpa.open-in-view is enabled by default
I received this error when trying to create tables in spring boot
spring.jpa.open-in-view is enabled by default.Therefore database queries may be rendered during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning.

Reading old post here but to no avail


问:
Strategies to deal with overflowing in logical clocks?
I'm building a database, and I'm working on the storage format. For each record I have a logical clock which increases by 1 every time there's a write operation, and I would like to be able to compare the clocks of two writes to understand which happened first.

How can I deal with overflowing/wrapping of the counter?

Solutions I thought:

Use a very large counter (u64?) and ignore the possibility of overflow

Use a second "epoch counter" in order to keep track of overflows

Periodically reset all the counters when I deem it safe

Use BigInt and variable length encoding

All the strategies I envisioned have ugly drawbacks. I saw in some papers that overflowing counters are considered a solved problem, without mentioning how they would solve it, which makes me think I'm missing something. Any advice on how to deal with this problem?


问:
How to pass function result which includes this in Javascript
To simply things, I have a class:

```<code>class Show {
    heading;
    another;

    constructor() {
        this.heading = document.querySelector('.foo');
        this.another = document.querySelector('.bar');
    {

    render(name, text) {
      this.name.textContent = text;
    }
}
</code>```

I want to receive the name of the HTML element to edit from another class and set the text. This is so I can use OOP and modules.
I keep getting error messages in the console saying "this.name" is not set.
If I wrap everything in back-ticks:

```<code>`this.${name}.textContent = ${text}`
</code>```

it also doesn't work. It seems to evaluate to a string and doesn't recognise 'this'. ( I have looked at how to remove wrapping quotation marks to no avail.
Is what I want to do possible in Javascript? Thanks.

Body:
To simply things, I have a class:

class Show {
    heading;
    another;

    constructor() {
        this.heading = document.querySelector('.foo');
        this.another = document.querySelector('.bar');
    {

    render(name, text) {
      this.name.textContent = text;
    }
}

I want to receive the name of the HTML element to edit from another class and set the text. This is so I can use OOP and modules.
I keep getting error messages in the console saying "this.name" is not set.
If I wrap everything in back-ticks:

`this.${name}.textContent = ${text}`

it also doesn't work. It seems to evaluate to a string and doesn't recognise 'this'. ( I have looked at how to remove wrapping quotation marks to no avail.
Is what I want to do possible in Javascript? Thanks.


问:
Gurobi/CVXPY Contraints to Integer Variable
I have a big MILP that I want to solve. It has a vector of binary variables. I can reduce the number of variables the problem has to try out by about half. Meaning I can put half of the values to 0 by default. I have done this by adding constraints to the problem that constraint each variable I can reduce to 0.

My problem is that it does not seem to improve the performance by any means.

The part of the problem looks like this  mx5@u where mx5 is a block matrix and u is my binary variable.

Theoretically reducing the integer variable should net huge improvements so I'm a bit confused why this is not helping at all.

Futhermore I wouldn't really know of any way to reduce the integer variable in a different way since this would mean my vector u would still have to be of length L and my integer variable u_red would have length L-L/2.

Anybody has some idea?


问:
Why is this Windows API code causing heap corruption?
This simple program displays a multi-file properties dialog for a single file.

When I compile this code in Visual Studio 2019 with address sanitizer enabled (/fsanitize=address)), I get the following exception on the line `MessageBoxW(...)' in some system DLL:

Unhandled exception at 0x77BCC97F (ntdll.dll) in ConsoleApplication2.exe: 0xC0000374:  A heap has been corrupted (parameters: 0x77C0A918).

There is no error if compiled without sanitizer or with VS2022.

```<code>#include <windows.h>
#include <Shlobj.h>

int main()
{
    CoInitialize(nullptr);
    IShellFolder* pDesktop; // namespace root for parsing the path
    HRESULT hr = SHGetDesktopFolder(&pDesktop);

    if (!SUCCEEDED(hr)) {
        return 0;
    }

    HWND m_hWnd = {};
    LPCWSTR fileName = L"c:\\Windows\\notepad.exe";
    LPWSTR fileNameDup = _wcsdup(fileName);

    LPITEMIDLIST newPIdL;

    IDataObject* pDataObject = {};
    hr = pDesktop->ParseDisplayName(m_hWnd, nullptr, fileNameDup, nullptr, &newPIdL, nullptr);
    if (SUCCEEDED(hr)) {
        LPCITEMIDLIST list[] = { newPIdL };
        hr = pDesktop->GetUIObjectOf(m_hWnd, 1, list, IID_IDataObject, nullptr, reinterpret_cast<void**>(&pDataObject));

        if (SUCCEEDED(hr)) {

            hr = SHMultiFileProperties(pDataObject, 0);

            if (SUCCEEDED(hr)) {
                MessageBoxW(nullptr, L"Test", L"Test", 0);
            }
            pDataObject->Release();
        }
        CoTaskMemFree(newPIdL);
    }

    pDesktop->Release();
    free(fileNameDup);

    CoUninitialize();
    return 0;
}
</code>```

Is there something wrong in this code?

What else could be causing this error?

Body:
This simple program displays a multi-file properties dialog for a single file.

When I compile this code in Visual Studio 2019 with address sanitizer enabled (/fsanitize=address)), I get the following exception on the line `MessageBoxW(...)' in some system DLL:

Unhandled exception at 0x77BCC97F (ntdll.dll) in ConsoleApplication2.exe: 0xC0000374:  A heap has been corrupted (parameters: 0x77C0A918).

There is no error if compiled without sanitizer or with VS2022.

#include <windows.h>
#include <Shlobj.h>

int main()
{
    CoInitialize(nullptr);
    IShellFolder* pDesktop; // namespace root for parsing the path
    HRESULT hr = SHGetDesktopFolder(&pDesktop);

    if (!SUCCEEDED(hr)) {
        return 0;
    }

    HWND m_hWnd = {};
    LPCWSTR fileName = L"c:\\Windows\\notepad.exe";
    LPWSTR fileNameDup = _wcsdup(fileName);

    LPITEMIDLIST newPIdL;

    IDataObject* pDataObject = {};
    hr = pDesktop->ParseDisplayName(m_hWnd, nullptr, fileNameDup, nullptr, &newPIdL, nullptr);
    if (SUCCEEDED(hr)) {
        LPCITEMIDLIST list[] = { newPIdL };
        hr = pDesktop->GetUIObjectOf(m_hWnd, 1, list, IID_IDataObject, nullptr, reinterpret_cast<void**>(&pDataObject));

        if (SUCCEEDED(hr)) {

            hr = SHMultiFileProperties(pDataObject, 0);

            if (SUCCEEDED(hr)) {
                MessageBoxW(nullptr, L"Test", L"Test", 0);
            }
            pDataObject->Release();
        }
        CoTaskMemFree(newPIdL);
    }

    pDesktop->Release();
    free(fileNameDup);

    CoUninitialize();
    return 0;
}

Is there something wrong in this code?

What else could be causing this error?


问:
Docker compose Jupyter notebook module not found error
I have created a docker compose for jupyter notebook along with the requirements/depenceny to be installed. After composing the docker the dependency was installed in the terminal. But, when i import the dependency in the dockerized jupyter notebook i get ModuleNotFoundError.</p>


问:
CardinalComm SDK 60 Warning Template - Id Bridging in Flutter
I am using the CardinalComm SDK in my Flutter application, and I am seeing a warning message that says "Id Bridging". Google gave me this warning and I need help to resolve it.

I have reviewed the documentation for the CardinalComm SDK and the Flutter packages that I am using, but I cannot find any information on how to address this warning. I have also checked the logs and debugging output from my application, but I cannot find any additional clues about the cause of the problem.

Does anyone have experience with this issue and know how to resolve it? Any suggestions or guidance would be greatly appreciated. Thank you

Here's my pubsec yaml

```<code>
</code>```

`

```<code>name: Iweydii
description:Buy and sell in Somalia.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.6.0+7
publish_to: none

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  carousel_slider: 4.0.0
  collection: ^1.15.0-nullsafety.4
  community_material_icon: ^5.9.55
  connectivity: 3.0.6
#  easy_localization: 3.0.0
  easy_localization: any
  file_picker: 4.2.4
  firebase_auth: 3.1.5
  firebase_core: 1.19.1
  firebase_database: 8.1.0
  firebase_dynamic_links: 3.0.0
  firebase_messaging: 11.0.0
  flutter:
   sdk: flutter
  flutter_better_camera: 1.0.2+1
  flutter_braintree: 2.1.0
  flutter_credit_card: 3.0.1
  flutter_datetime_picker:
    path: packages/flutter_datetime_picker
  flutter_facebook_auth: 3.5.6
  flutter_html: 2.2.1
  flutter_linkify: 5.0.2
  flutter_localizations:
    sdk: flutter
  flutter_map: 0.14.0
  flutter_map_tappable_polyline: 3.1.0
  flutter_native_image: 0.0.6+1
  flutter_paystack: ^1.0.5+1
  flutter_stripe: 2.1.0
  flutter_svg: 0.23.0+1
  flutter_tabler_icons: ^1.1.1
  flutter_video_info: 1.2.0
  fluttericon: 2.0.0
  lottie: ^1.2.0
  fluttertoast: 8.0.8
  geocode: 1.0.1
  geolocator: 8.0.1
  google_maps_flutter: 2.1.0
  google_mobile_ads: ^1.2.0
  google_sign_in: 5.2.1
  group_radio_button: 1.1.0
  http: 0.13.4
  in_app_purchase: 1.0.9
  intl: 0.17.0
  latlong2: 0.8.1
  launch_review: 3.0.1
  multi_image_picker: 4.8.1
  ntp: 2.0.0
  optimized_cached_image: 3.0.0
  package_info: 2.0.2
  path_provider: 2.0.6
  permission_handler: 8.3.0
  permission_handler_platform_interface: 3.7.0
  photo_view: 0.13.0
  progress_dialog_null_safe: 1.0.6
  provider: 6.0.1
  razorpay_flutter: 1.2.7
  rename: ^2.0.1
  sembast: 3.1.1
  share: 2.0.4
  shared_preferences: 2.0.8
  shimmer: 2.0.0
  the_apple_sign_in: 1.1.1
  theme_manager: 1.1.0
  url_launcher: 6.0.12
  video_player: 2.2.7
  video_thumbnail: 0.4.3
  visibility_detector: 0.2.2
  firebase_analytics: ^8.1.1
  webview_flutter: ^2.2.0
  share_files_and_screenshot_widgets: ^1.0.6
  showcaseview: ^1.1.8
  scroll_navigation: ^1.3.2
  cloud_firestore: ^1.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter
#  flutter_test:
sdk: flutter

dependency_overrides:
  firebase_messaging_platform_interface: 3.1.6
  firebase_auth_platform_interface: 6.1.11
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/placeholder_circle_image.png
    - assets/images/placeholder_image.png
    - assets/langs/en-US.json
    - assets/langs/so-SO.json

    # - assets/images/verify_email_icon.jpg
    - assets/images/down.png
    # - assets/images/baesline_access_time_black_24.png
    # - assets/images/baseline_check_green_24.png
    - assets/images/baseline_graph_black_24.png
    - assets/images/baseline_price_down_black_24.png
    # - assets/images/chat.png
    - assets/images/seo.png
    - assets/images/upload.png
    - assets/images/baseline_price_up_black_24.png
    - assets/images/baseline_empty_item_grey_24.png

    # - assets/images/home_icon/easy_payment.png
    # - assets/images/home_icon/featured_products.png
    # - assets/images/home_icon/free_download.png
    - assets/images/trending.png
    - assets/images/flutter_buy_and_sell_logo.png
    - assets/images/flutter_buy_and_sell_logo_light.png
    - assets/images/baseline_pin_black_24.png
    - assets/images/baseline_favourite_grey_24.png
    - assets/images/default_image.png
    # - assets/images/baseline_promotion_color_74.png
    - assets/images/user_default_photo.png
    - assets/images/loaction_illustration.svg
    - assets/images/slider_1.svg
    - assets/images/slider_2.svg
    - assets/images/slider_3.svg
    # icons for the app
    # - assets/images/app_icons/search.svg
    - assets/lottie/loginaccount.json

  # example:
  fonts:
    - family: Product Sans
      fonts:
        - asset: assets/fonts/Product-Sans-Regular.ttf
        - asset: assets/fonts/Product-Sans-Bold-Italic.ttf
        - asset: assets/fonts/Product-Sans-Bold.ttf
        - asset: assets/fonts/Product-Sans-Italic.ttf
  # fonts:

  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages
</code>```

`

```<code>
</code>```

I couldnt solve on my own

Body:
I am using the CardinalComm SDK in my Flutter application, and I am seeing a warning message that says "Id Bridging". Google gave me this warning and I need help to resolve it.

I have reviewed the documentation for the CardinalComm SDK and the Flutter packages that I am using, but I cannot find any information on how to address this warning. I have also checked the logs and debugging output from my application, but I cannot find any additional clues about the cause of the problem.

Does anyone have experience with this issue and know how to resolve it? Any suggestions or guidance would be greatly appreciated. Thank you

Here's my pubsec yaml

`

name: Iweydii
description:Buy and sell in Somalia.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.6.0+7
publish_to: none

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  carousel_slider: 4.0.0
  collection: ^1.15.0-nullsafety.4
  community_material_icon: ^5.9.55
  connectivity: 3.0.6
#  easy_localization: 3.0.0
  easy_localization: any
  file_picker: 4.2.4
  firebase_auth: 3.1.5
  firebase_core: 1.19.1
  firebase_database: 8.1.0
  firebase_dynamic_links: 3.0.0
  firebase_messaging: 11.0.0
  flutter:
   sdk: flutter
  flutter_better_camera: 1.0.2+1
  flutter_braintree: 2.1.0
  flutter_credit_card: 3.0.1
  flutter_datetime_picker:
    path: packages/flutter_datetime_picker
  flutter_facebook_auth: 3.5.6
  flutter_html: 2.2.1
  flutter_linkify: 5.0.2
  flutter_localizations:
    sdk: flutter
  flutter_map: 0.14.0
  flutter_map_tappable_polyline: 3.1.0
  flutter_native_image: 0.0.6+1
  flutter_paystack: ^1.0.5+1
  flutter_stripe: 2.1.0
  flutter_svg: 0.23.0+1
  flutter_tabler_icons: ^1.1.1
  flutter_video_info: 1.2.0
  fluttericon: 2.0.0
  lottie: ^1.2.0
  fluttertoast: 8.0.8
  geocode: 1.0.1
  geolocator: 8.0.1
  google_maps_flutter: 2.1.0
  google_mobile_ads: ^1.2.0
  google_sign_in: 5.2.1
  group_radio_button: 1.1.0
  http: 0.13.4
  in_app_purchase: 1.0.9
  intl: 0.17.0
  latlong2: 0.8.1
  launch_review: 3.0.1
  multi_image_picker: 4.8.1
  ntp: 2.0.0
  optimized_cached_image: 3.0.0
  package_info: 2.0.2
  path_provider: 2.0.6
  permission_handler: 8.3.0
  permission_handler_platform_interface: 3.7.0
  photo_view: 0.13.0
  progress_dialog_null_safe: 1.0.6
  provider: 6.0.1
  razorpay_flutter: 1.2.7
  rename: ^2.0.1
  sembast: 3.1.1
  share: 2.0.4
  shared_preferences: 2.0.8
  shimmer: 2.0.0
  the_apple_sign_in: 1.1.1
  theme_manager: 1.1.0
  url_launcher: 6.0.12
  video_player: 2.2.7
  video_thumbnail: 0.4.3
  visibility_detector: 0.2.2
  firebase_analytics: ^8.1.1
  webview_flutter: ^2.2.0
  share_files_and_screenshot_widgets: ^1.0.6
  showcaseview: ^1.1.8
  scroll_navigation: ^1.3.2
  cloud_firestore: ^1.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter
#  flutter_test:
sdk: flutter

dependency_overrides:
  firebase_messaging_platform_interface: 3.1.6
  firebase_auth_platform_interface: 6.1.11
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/placeholder_circle_image.png
    - assets/images/placeholder_image.png
    - assets/langs/en-US.json
    - assets/langs/so-SO.json

    # - assets/images/verify_email_icon.jpg
    - assets/images/down.png
    # - assets/images/baesline_access_time_black_24.png
    # - assets/images/baseline_check_green_24.png
    - assets/images/baseline_graph_black_24.png
    - assets/images/baseline_price_down_black_24.png
    # - assets/images/chat.png
    - assets/images/seo.png
    - assets/images/upload.png
    - assets/images/baseline_price_up_black_24.png
    - assets/images/baseline_empty_item_grey_24.png

    # - assets/images/home_icon/easy_payment.png
    # - assets/images/home_icon/featured_products.png
    # - assets/images/home_icon/free_download.png
    - assets/images/trending.png
    - assets/images/flutter_buy_and_sell_logo.png
    - assets/images/flutter_buy_and_sell_logo_light.png
    - assets/images/baseline_pin_black_24.png
    - assets/images/baseline_favourite_grey_24.png
    - assets/images/default_image.png
    # - assets/images/baseline_promotion_color_74.png
    - assets/images/user_default_photo.png
    - assets/images/loaction_illustration.svg
    - assets/images/slider_1.svg
    - assets/images/slider_2.svg
    - assets/images/slider_3.svg
    # icons for the app
    # - assets/images/app_icons/search.svg
    - assets/lottie/loginaccount.json

  # example:
  fonts:
    - family: Product Sans
      fonts:
        - asset: assets/fonts/Product-Sans-Regular.ttf
        - asset: assets/fonts/Product-Sans-Bold-Italic.ttf
        - asset: assets/fonts/Product-Sans-Bold.ttf
        - asset: assets/fonts/Product-Sans-Italic.ttf
  # fonts:

  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

`

I couldnt solve on my own


问:
P2P connection between devices in different networks
I'm struggling with P2P connection, i have searched a lot but still can't find how 2 devices from different networks can directly connect between them, how does bitcoin makes that?, i understand the theory, but can't find where to learn how to practically speaking do that.

tried with sockets in python, but can't connect devices that are not in the same network.