问:
Objectbox configuration for Swift Package
I would like to use objectbox inside a swift package, not inside a project, but on the documentation I couldn't find a procedure to follow to complete the operation.

I found no problem adding the library as a dependency:
.package(url: "https://github.com/objectbox/objectbox-swift", from: "1.8.0")
My problem is finding the correct strategy to use the code generator.

The documentation and scripts in the package say to call Sourcery like this:
"$sourcery" --xcode-project "${PROJECT_FILE_PATH}" --xcode-target "${TARGETNAME}" $MODULENAME1 $MODULENAME2 $@

In my case, the entities are present in my Package, so inside a directory, it would be correct if I use the Sourcery based ObjectBox code generator indicating the path "source" and the "output" instead of the project "--xcode-project " and of the "target"?

If this is not the correct way to go, do you have alternative ideas?


来源: stackexchange

问:
How to export gradle project with google api dependencies in eclipse
this is my build.gradle

```<code>plugins {
    // Apply the java-library plugin for API and implementation separation.
    id 'java-library'
    id 'java'
    id 'application'
}

mainClassName = 'myproject.Main'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {

    // Use JUnit Jupiter for testing.
    testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'

    // This dependency is exported to consumers, that is to say found on their compile classpath.
    api 'org.apache.commons:commons-math3:3.6.1'

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation 'com.google.guava:guava:31.1-jre'

    implementation 'com.google.api-client:google-api-client:1.18.0'
    implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1'
    implementation 'com.google.apis:google-api-services-sheets:v4-rev20220927-2.0.0'
}

jar {
    exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/DEPENDENCIES', 'META-INF/NOTICE', 'META-INF/NOTICE.txt'
    manifest {
        attributes 'Main-Class':'myproject.Main'
        }
    from{
        configurations.runtimeClasspath.collect{ it.isDirectory()? it : zipTree(it) }
    }
}
</code>```

after i export my project using eclipse, it got problem when i run it. It seems that it has problem with the dependencies.

i want to export it into runnable jar file that can get data from google spreadsheets

ContentLicense: CC BY-SA 4.0

Body:
this is my build.gradle

plugins {
    // Apply the java-library plugin for API and implementation separation.
    id 'java-library'
    id 'java'
    id 'application'
}

mainClassName = 'myproject.Main'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {

    // Use JUnit Jupiter for testing.
    testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'

    // This dependency is exported to consumers, that is to say found on their compile classpath.
    api 'org.apache.commons:commons-math3:3.6.1'

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation 'com.google.guava:guava:31.1-jre'

    implementation 'com.google.api-client:google-api-client:1.18.0'
    implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1'
    implementation 'com.google.apis:google-api-services-sheets:v4-rev20220927-2.0.0'
}

jar {
    exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/DEPENDENCIES', 'META-INF/NOTICE', 'META-INF/NOTICE.txt'
    manifest {
        attributes 'Main-Class':'myproject.Main'
        }
    from{
        configurations.runtimeClasspath.collect{ it.isDirectory()? it : zipTree(it) }
    }
}

after i export my project using eclipse, it got problem when i run it. It seems that it has problem with the dependencies.

i want to export it into runnable jar file that can get data from google spreadsheets


问:
image inside of  makes the whole header clickable
I have an image inside anchor link and anchor is inside header. When I set the image size in pixels I can only click on image (as it should) but when I set image size as percentage the whole header becomes clickable. How can I prevent that?

header {
  display: flex;
  justify-content: space-between;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.container {
  position: relative;
  padding: 0 15px;
  margin: 0 auto;
}

header a {
  display: flex;
  color: #000000;
  text-decoration: none;
}

header a img {
  vertical-align: middle;
}

header button {
  width: 32px;
  height: 32px;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  padding: 0;
  line-height: 34px;
  position: absolute;
  top: 50%;
  right: 20px;
  margin-top: -16px;
}

header button svg {
  width: 9px;
  height: auto;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><header class="container">

    <img width="10%" src="img/logo.png" alt="Logo">

  <button>
            <svg element></svg>
        </button>
</header></code>```

Title: image inside of <a> makes the whole header clickable

Body:
I have an image inside anchor link and anchor is inside header. When I set the image size in pixels I can only click on image (as it should) but when I set image size as percentage the whole header becomes clickable. How can I prevent that?

header {
  display: flex;
  justify-content: space-between;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.container {
  position: relative;
  padding: 0 15px;
  margin: 0 auto;
}

header a {
  display: flex;
  color: #000000;
  text-decoration: none;
}

header a img {
  vertical-align: middle;
}

header button {
  width: 32px;
  height: 32px;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  padding: 0;
  line-height: 34px;
  position: absolute;
  top: 50%;
  right: 20px;
  margin-top: -16px;
}

header button svg {
  width: 9px;
  height: auto;
}

  <button>
            <svg element></svg>
        </button>


问:
How can we render HTML and CSS from TS file in Angular? Where Code for HTML and CSS will get from the API Response
The Scenario is I am having my component Template code for HTML and CSS in Database which I will get on call of API (response). When I will get code from API response I just want to render that on my template preview but there is one more challenge that after rendering it data bindings should work like conditional directives ( *ngIf or *ngFor ) need to work properly (code in response came with conditions and variable names). I just want to render and bind data in .ts file and change data on Runtime by passing data in form and reflect in the template preview.</p>


问:
Double-formatting in com.fasterxml.jackson.databind.ObjectMapper
I have an application, which loads a data row from a SQL Server database and should transmit that content JSON-encoded to a webservice. I used ObjectMapper to do the JSON conversion. There is some infrastructure behind this project, namely I get the data from the db as a Hashmap<string,object> where the keys are the column-names from the db-table.

Is there a way to tell com.fasterxml.jackson.databind.ObjectMapper how to format double-values upon serialization, when you can not use annotations?

I did a simple

```<code>ObjectMapper o = new ObjectMapper();
String jsonStr = o.writeValueAsString(m); // m is my hashmap-instance
</code>```

While in theory this works quite nicely, I have a problem with the serialization of doubles. In the db there is a column of type float  (which corresponds to double in Java, java-float would be real in SQL Server) with the value 402.4818. If I let ObjectMapper serialize this, I get 402.48179999999996 in JSON.

How can I customize the double-formatting / precision in ObjectMapper? I have already used setDateFormat(new SimpleDateFormat("yyyy-MM-dd")) to get my dates right, is there any way to do something similar for double?
Most examples in the net serialize POJOs where you can use annotations to specify how specific properties should be serialized, but I have a HashMap here.

Please don't tell me that I have to go through the hassle of creating a POJO, fill it with the DB-Data and serialize it for every row I want to send via this API. (This is a db-row which has > 30 columns and the project is nearly done, besides this little double-formatting-problem.)

So what do I need to do to tell ObjectMapper to round to the 4. decimal point before serializing or give some custom DecimalFormat? Documentation on this is quite sparse.

Body:
I have an application, which loads a data row from a SQL Server database and should transmit that content JSON-encoded to a webservice. I used ObjectMapper to do the JSON conversion. There is some infrastructure behind this project, namely I get the data from the db as a Hashmap<string,object> where the keys are the column-names from the db-table.

Is there a way to tell com.fasterxml.jackson.databind.ObjectMapper how to format double-values upon serialization, when you can not use annotations?

I did a simple

ObjectMapper o = new ObjectMapper();
String jsonStr = o.writeValueAsString(m); // m is my hashmap-instance

While in theory this works quite nicely, I have a problem with the serialization of doubles. In the db there is a column of type float  (which corresponds to double in Java, java-float would be real in SQL Server) with the value 402.4818. If I let ObjectMapper serialize this, I get 402.48179999999996 in JSON.

How can I customize the double-formatting / precision in ObjectMapper? I have already used setDateFormat(new SimpleDateFormat("yyyy-MM-dd")) to get my dates right, is there any way to do something similar for double?
Most examples in the net serialize POJOs where you can use annotations to specify how specific properties should be serialized, but I have a HashMap here.

Please don't tell me that I have to go through the hassle of creating a POJO, fill it with the DB-Data and serialize it for every row I want to send via this API. (This is a db-row which has > 30 columns and the project is nearly done, besides this little double-formatting-problem.)

So what do I need to do to tell ObjectMapper to round to the 4. decimal point before serializing or give some custom DecimalFormat? Documentation on this is quite sparse.


问:
Flutter lost focus on phone if Android Auto runs Waze
I launch Waze from App with this code with button click:

```<code>   void launchWaze(String lat, String lng) async {
    Uri url = Uri.parse(
        'https://waze.com/ul?ll=$lat,$lng&navigate=yes');

    Uri fallbackUrl =
        Uri.parse('https://waze.com/ul?ll=$lat,$lng&navigate=yes');

    try {
      bool launched = await launchUrl(
        url,
        mode: LaunchMode.externalApplication,  // or externalNonBrowserApplication,

      );
    } catch (e) {
      await launchUrl(fallbackUrl);
    }
  }
</code>```

Waze launched from app, on Android Auto starts and route is fine, but the focus not in my app anymore so I can not use the app to start other location, only a text you use Waze on Android Auto. Back button not working...

Is there any solution to navigate on Android Auto and use the app on phone the same time?

Body:
I launch Waze from App with this code with button click:

   void launchWaze(String lat, String lng) async {
    Uri url = Uri.parse(
        'https://waze.com/ul?ll=$lat,$lng&navigate=yes');

    Uri fallbackUrl =
        Uri.parse('https://waze.com/ul?ll=$lat,$lng&navigate=yes');

    try {
      bool launched = await launchUrl(
        url,
        mode: LaunchMode.externalApplication,  // or externalNonBrowserApplication,

      );
    } catch (e) {
      await launchUrl(fallbackUrl);
    }
  }

Waze launched from app, on Android Auto starts and route is fine, but the focus not in my app anymore so I can not use the app to start other location, only a text you use Waze on Android Auto. Back button not working...

Is there any solution to navigate on Android Auto and use the app on phone the same time?


问:
PDFBOX - Extract highlighted text that has been set with microsoft word
I have a PDF file, this file contains some text and some highlighted text. The highligthed text has not been set with a PDF editor but with Microsoft Word (so this file is a "Print to PDF" word file).

I would like to extract/detect the highlighted text, and if it's possible the color.

I searched and tried different code and my results are :

I can extract the highlighted text if it has been highlighted with PDF editor

I can't extract the highlighted text if it has been highlighted with word

I would like to know if you have any idea how to extract this highlighted text that isn't set with a PDF editor.

I followed this thread :

Identifying the text based on the output in PDF using PDFBOX

I would like to get (if possible) a result like this :

H{FILL:RGB 0.102 0.101 0.095;}E{FILL:RGB 0.102 0.101 0.095;}L{FILL:RGB
0.102 0.101 0.095;}L{FILL:RGB 0.102 0.101 0.095;}O{FILL:RGB 0.102 0.101 0.095;}

But with the highlighted color of each character and not the character color.

I tried many things, i can't find a way to extract which part of my PDF is highlighted or not.

I have no more idea i can do...

I hope someone can help me !


问:
Computing 2¹²⁸ % uint64_t
How to efficiently compute 2¹²⁸ % n, where n is uint64_t (and non-zero)?

If I had access to a narrowing division like _udiv128 intrinsic of MSVC I could do:

```<code>uint64_t remainder;
_udiv128(1, 0, n, &remainder);
_udiv128(remainder, 0, n, &remainder);
</code>```

But that's two slow instructions, not to mention there are CPUs like ARM which do not have the narrowing division. Is there a better way?

Related: How to compute 2⁶⁴/n in C?

Title: Computing 2¹²⁸ % uint64_t

Body:
How to efficiently compute 2¹²⁸ % n, where n is uint64_t (and non-zero)?

If I had access to a narrowing division like _udiv128 intrinsic of MSVC I could do:

uint64_t remainder;
_udiv128(1, 0, n, &remainder);
_udiv128(remainder, 0, n, &remainder);

But that's two slow instructions, not to mention there are CPUs like ARM which do not have the narrowing division. Is there a better way?

Related: How to compute 2⁶⁴/n in C?


问:
Find Training/Validation Accuracy & Loss of Faster-RCNN PyTorch model
I am trying to find the training/validation accuracy and loss of my model for each epoch as I train it to find the best epoch to use from now on. I appreciate that there is lots of information on this now but this topic is very new to me, and I find it very difficult to find the right answer for my situation.

I assume that I need to add in one or two bits to the train_one_epoch() and evaluate() functions in order to do this?

My model setup is:

```<code>model = torchvision.models.detection.fasterrcnn_resnet50_fpn_v2(weights=models.detection.FasterRCNN_ResNet50_FPN_V2_Weights.DEFAULT)
in_features = model.roi_heads.box_predictor.cls_score.in_features
model.roi_heads.box_predictor = FastRCNNPredictor(in_features, num_classes)
model.to(device)

params = [p for p in model.parameters() if p.requires_grad]
optimizer = torch.optim.SGD(params, lr=0.02, momentum=0.9, weight_decay=0.0001)

lr_scheduler = torch.optim.lr_scheduler.MultiStepLR(optimizer, milestones=[20,40], gamma=0.1)
</code>```

And my training function is:

```<code>epochs = 50

for epoch in range(epochs):
    train_one_epoch(model, optimizer, train_data_loader, device, epoch, print_freq=20)
    lr_scheduler.step()
    evaluate(model, val_data_loader, device=device)
    print("\n\n")

torch.save(model, f'./Models/trained_{ds}_model_Epoch{epochs}_LR0_02.pt')
</code>```

I am using coco-like annotations, for example:

```<code>{'boxes': tensor([[316.9700, 242.5500, 464.1000, 442.1700], [ 39.2200, 172.6700, 169.8400, 430.9600]]), 'labels': tensor([2, 2]), 'image_id': tensor(1416), 'area': tensor([29370.1094, 33738.3789]), 'iscrowd': tensor([0, 0])}
</code>```

The train_one_epoch and evaluate functions are from 'engine.py' from Torchvision.
It seems like using Tensorboard is a good tool to use, but I don't really know how to use it.

The engine.py is:

```<code>def train_one_epoch(model, optimizer, data_loader, device, epoch, print_freq, scaler=None):
    model.train()
    metric_logger = utils.MetricLogger(delimiter="  ")
    metric_logger.add_meter("lr", utils.SmoothedValue(window_size=1, fmt="{value:.6f}"))
    header = f"Epoch: [{epoch}]"

    lr_scheduler = None
    if epoch == 0:
        warmup_factor = 1.0 / 1000
        warmup_iters = min(1000, len(data_loader) - 1)

        lr_scheduler = torch.optim.lr_scheduler.LinearLR(
            optimizer, start_factor=warmup_factor, total_iters=warmup_iters
        )

    for images, targets in metric_logger.log_every(data_loader, print_freq, header):
        images = list(image.to(device) for image in images)
        targets = [{k: v.to(device) for k, v in t.items()} for t in targets]
        with torch.cuda.amp.autocast(enabled=scaler is not None):
            loss_dict = model(images, targets)
            losses = sum(loss for loss in loss_dict.values())

        # reduce losses over all GPUs for logging purposes
        loss_dict_reduced = utils.reduce_dict(loss_dict)
        losses_reduced = sum(loss for loss in loss_dict_reduced.values())

        loss_value = losses_reduced.item()

        if not math.isfinite(loss_value):
            print(f"Loss is {loss_value}, stopping training")
            print(loss_dict_reduced)
            sys.exit(1)

        optimizer.zero_grad()
        if scaler is not None:
            scaler.scale(losses).backward()
            scaler.step(optimizer)
            scaler.update()
        else:
            losses.backward()
            optimizer.step()

        if lr_scheduler is not None:
            lr_scheduler.step()

        metric_logger.update(loss=losses_reduced, **loss_dict_reduced)
        metric_logger.update(lr=optimizer.param_groups[0]["lr"])

    return metric_logger
</code>```

The evaluate function is:

```<code>def evaluate(model, data_loader, device):
    n_threads = torch.get_num_threads()
    # FIXME remove this and make paste_masks_in_image run on the GPU
    torch.set_num_threads(1)
    cpu_device = torch.device("cpu")
    model.eval()
    metric_logger = utils.MetricLogger(delimiter="  ")
    header = "Test:"

    coco = get_coco_api_from_dataset(data_loader.dataset)
    iou_types = _get_iou_types(model)
    coco_evaluator = CocoEvaluator(coco, iou_types)

    for images, targets in metric_logger.log_every(data_loader, 100, header):
        images = list(img.to(device) for img in images)

        if torch.cuda.is_available():
            torch.cuda.synchronize()
        model_time = time.time()
        outputs = model(images)

        outputs = [{k: v.to(cpu_device) for k, v in t.items()} for t in outputs]
        model_time = time.time() - model_time

        res = {target["image_id"].item(): output for target, output in zip(targets, outputs)}
        evaluator_time = time.time()
        coco_evaluator.update(res)
        evaluator_time = time.time() - evaluator_time
        metric_logger.update(model_time=model_time, evaluator_time=evaluator_time)

    # gather the stats from all processes
    metric_logger.synchronize_between_processes()
    print("Averaged stats:", metric_logger)
    coco_evaluator.synchronize_between_processes()

    # accumulate predictions from all images
    coco_evaluator.accumulate()
    coco_evaluator.summarize()
    torch.set_num_threads(n_threads)
    return coco_evaluator
</code>```

Body:
I am trying to find the training/validation accuracy and loss of my model for each epoch as I train it to find the best epoch to use from now on. I appreciate that there is lots of information on this now but this topic is very new to me, and I find it very difficult to find the right answer for my situation.

I assume that I need to add in one or two bits to the train_one_epoch() and evaluate() functions in order to do this?

My model setup is:

model = torchvision.models.detection.fasterrcnn_resnet50_fpn_v2(weights=models.detection.FasterRCNN_ResNet50_FPN_V2_Weights.DEFAULT)
in_features = model.roi_heads.box_predictor.cls_score.in_features
model.roi_heads.box_predictor = FastRCNNPredictor(in_features, num_classes)
model.to(device)

params = [p for p in model.parameters() if p.requires_grad]
optimizer = torch.optim.SGD(params, lr=0.02, momentum=0.9, weight_decay=0.0001)

lr_scheduler = torch.optim.lr_scheduler.MultiStepLR(optimizer, milestones=[20,40], gamma=0.1)

And my training function is:

epochs = 50

for epoch in range(epochs):
    train_one_epoch(model, optimizer, train_data_loader, device, epoch, print_freq=20)
    lr_scheduler.step()
    evaluate(model, val_data_loader, device=device)
    print("\n\n")

torch.save(model, f'./Models/trained_{ds}_model_Epoch{epochs}_LR0_02.pt')

I am using coco-like annotations, for example:

{'boxes': tensor([[316.9700, 242.5500, 464.1000, 442.1700], [ 39.2200, 172.6700, 169.8400, 430.9600]]), 'labels': tensor([2, 2]), 'image_id': tensor(1416), 'area': tensor([29370.1094, 33738.3789]), 'iscrowd': tensor([0, 0])}

The train_one_epoch and evaluate functions are from 'engine.py' from Torchvision.
It seems like using Tensorboard is a good tool to use, but I don't really know how to use it.

The engine.py is:

def train_one_epoch(model, optimizer, data_loader, device, epoch, print_freq, scaler=None):
    model.train()
    metric_logger = utils.MetricLogger(delimiter="  ")
    metric_logger.add_meter("lr", utils.SmoothedValue(window_size=1, fmt="{value:.6f}"))
    header = f"Epoch: [{epoch}]"

    lr_scheduler = None
    if epoch == 0:
        warmup_factor = 1.0 / 1000
        warmup_iters = min(1000, len(data_loader) - 1)

        lr_scheduler = torch.optim.lr_scheduler.LinearLR(
            optimizer, start_factor=warmup_factor, total_iters=warmup_iters
        )

    for images, targets in metric_logger.log_every(data_loader, print_freq, header):
        images = list(image.to(device) for image in images)
        targets = [{k: v.to(device) for k, v in t.items()} for t in targets]
        with torch.cuda.amp.autocast(enabled=scaler is not None):
            loss_dict = model(images, targets)
            losses = sum(loss for loss in loss_dict.values())

        # reduce losses over all GPUs for logging purposes
        loss_dict_reduced = utils.reduce_dict(loss_dict)
        losses_reduced = sum(loss for loss in loss_dict_reduced.values())

        loss_value = losses_reduced.item()

        if not math.isfinite(loss_value):
            print(f"Loss is {loss_value}, stopping training")
            print(loss_dict_reduced)
            sys.exit(1)

        optimizer.zero_grad()
        if scaler is not None:
            scaler.scale(losses).backward()
            scaler.step(optimizer)
            scaler.update()
        else:
            losses.backward()
            optimizer.step()

        if lr_scheduler is not None:
            lr_scheduler.step()

        metric_logger.update(loss=losses_reduced, **loss_dict_reduced)
        metric_logger.update(lr=optimizer.param_groups[0]["lr"])

    return metric_logger

The evaluate function is:

def evaluate(model, data_loader, device):
    n_threads = torch.get_num_threads()
    # FIXME remove this and make paste_masks_in_image run on the GPU
    torch.set_num_threads(1)
    cpu_device = torch.device("cpu")
    model.eval()
    metric_logger = utils.MetricLogger(delimiter="  ")
    header = "Test:"

    coco = get_coco_api_from_dataset(data_loader.dataset)
    iou_types = _get_iou_types(model)
    coco_evaluator = CocoEvaluator(coco, iou_types)

    for images, targets in metric_logger.log_every(data_loader, 100, header):
        images = list(img.to(device) for img in images)

        if torch.cuda.is_available():
            torch.cuda.synchronize()
        model_time = time.time()
        outputs = model(images)

        outputs = [{k: v.to(cpu_device) for k, v in t.items()} for t in outputs]
        model_time = time.time() - model_time

        res = {target["image_id"].item(): output for target, output in zip(targets, outputs)}
        evaluator_time = time.time()
        coco_evaluator.update(res)
        evaluator_time = time.time() - evaluator_time
        metric_logger.update(model_time=model_time, evaluator_time=evaluator_time)

    # gather the stats from all processes
    metric_logger.synchronize_between_processes()
    print("Averaged stats:", metric_logger)
    coco_evaluator.synchronize_between_processes()

    # accumulate predictions from all images
    coco_evaluator.accumulate()
    coco_evaluator.summarize()
    torch.set_num_threads(n_threads)
    return coco_evaluator


问:
What is the point of using `MISSING` in hydra or pydantic?
I am creating a configuration management system in python and are exploring options between hydra/pydantic/both. I get a little confused over when to use MISSING versus just leaving it blank/optional. I will use an example of OmegaConf here since
the underlying structure of hydra uses it.

```<code>@dataclass
class User:
    # A simple user class with two missing fields
    name: str = MISSING
    height: Height = MISSING
</code>```

where it says that this MISSING field will convert to yaml's ??? equivalent. Can I just leave it blank?

Body:
I am creating a configuration management system in python and are exploring options between hydra/pydantic/both. I get a little confused over when to use MISSING versus just leaving it blank/optional. I will use an example of OmegaConf here since
the underlying structure of hydra uses it.

@dataclass
class User:
    # A simple user class with two missing fields
    name: str = MISSING
    height: Height = MISSING

where it says that this MISSING field will convert to yaml's ??? equivalent. Can I just leave it blank?


问:
DLL for Clave2 Basic is not supported by latest version of golang?
We are trying to use Clave2 Basic senselock dongle to authenticate software. The software was written in Go 1.12 but when we updated Go version to 1.19 the build detects the DLL but is unable to call the functions.

Verify password function is as below

var error_message = []string{"EP_SUCCESS", "EP_OPEN_DEVICE_FAILED", "EP_FIND_DEVICE_FAILED", "EP_INVALID_PARAMETER", "EP_INVALID_BLOCK_NUMBER", "EP_HARDWARE_COMMUNICATE_ERROR", "EP_INVALID_PASSWORD", "EP_ACCESS_DENIED", "EP_ALREADY_OPENED", "EP_ALLOCATE_MEMORY_FAILED", "EP_INVALID_UPDATE_PACKAGE", "EP_SYN_ERROR", "EP_OTHER_ERROR"}

func VerifyPassword(password_type int, password string) error {
    password_ptr := (*C.uchar)(unsafe.Pointer(C.CString(password)))
    var result = C.LC_passwd(handle, C.int(password_type), password_ptr)
    if result == 0 {
        return nil
    }
    return errors.New(error_message[result])
}
```

If I run this function in Go v1.12 it works and returns result = 0, but if i try to run this function with same parameters in golang v1.19 I get result = 3, so it returns 'EP_INVALID_PARAMETER' string.

How exactly do I overcome this problem?

Body:
We are trying to use Clave2 Basic senselock dongle to authenticate software. The software was written in Go 1.12 but when we updated Go version to 1.19 the build detects the DLL but is unable to call the functions.

Verify password function is as below

var error_message = []string{"EP_SUCCESS", "EP_OPEN_DEVICE_FAILED", "EP_FIND_DEVICE_FAILED", "EP_INVALID_PARAMETER", "EP_INVALID_BLOCK_NUMBER", "EP_HARDWARE_COMMUNICATE_ERROR", "EP_INVALID_PASSWORD", "EP_ACCESS_DENIED", "EP_ALREADY_OPENED", "EP_ALLOCATE_MEMORY_FAILED", "EP_INVALID_UPDATE_PACKAGE", "EP_SYN_ERROR", "EP_OTHER_ERROR"}

func VerifyPassword(password_type int, password string) error {
    password_ptr := (*C.uchar)(unsafe.Pointer(C.CString(password)))
    var result = C.LC_passwd(handle, C.int(password_type), password_ptr)
    if result == 0 {
        return nil
    }
    return errors.New(error_message[result])
}

If I run this function in Go v1.12 it works and returns result = 0, but if i try to run this function with same parameters in golang v1.19 I get result = 3, so it returns 'EP_INVALID_PARAMETER' string.

How exactly do I overcome this problem?


问:
Calculating complementary hue in CIELAB color space
I need to procedurally generate color palettes consisting of several swatches. For each swatch the luminance is given as input, while chroma and hue are chosen using some algorithm.

Since luminance needs to be perceptually fixed I opted for working in LAB color space. I implemented a small C++ LAB class that converts to/from RGB. It appears to be working fine.

In order to manipulate chroma and hue I covert A and B components into polar coordinates where the angle of AB vector represents hue, while its length represents chroma (so called CIEHLC model).

```<code>chroma = sqrt(a*a + b*b);
hue = atan2(b, a);
</code>```

Now rotating this vector shifts the hue while scaling it changes the chroma. So far so good.

The thing is now similar to HSL/HSV color wheel. However, it appears that rotating the AB vector by 180 degrees does not actually result in a complementary hue as it would in the HSL wheel.

So my question is how to go about calculating the correct complementary hue in the LAB color space?

Body:
I need to procedurally generate color palettes consisting of several swatches. For each swatch the luminance is given as input, while chroma and hue are chosen using some algorithm.

Since luminance needs to be perceptually fixed I opted for working in LAB color space. I implemented a small C++ LAB class that converts to/from RGB. It appears to be working fine.

In order to manipulate chroma and hue I covert A and B components into polar coordinates where the angle of AB vector represents hue, while its length represents chroma (so called CIEHLC model).

chroma = sqrt(a*a + b*b);
hue = atan2(b, a);

Now rotating this vector shifts the hue while scaling it changes the chroma. So far so good.

The thing is now similar to HSL/HSV color wheel. However, it appears that rotating the AB vector by 180 degrees does not actually result in a complementary hue as it would in the HSL wheel.

So my question is how to go about calculating the correct complementary hue in the LAB color space?


问:
How to create condition in logic app workflow to check that a container exists in a storage account through logic app workflow
I want to put a condition into our logic app workflow to check that a container exist in the storage account or not.
is there any possibility to check that?</p>


问:
Cookie not visible (HTTP Only false)
I have a express server settings cookies on a react frontend.

When I log in, the express server sets 3 cookies (access_token, refresh_token, logged_in). Here is the code of how I did it:

// option setup
const cookiesOptions: CookieOptions = {
  httpOnly: true,
  sameSite: 'lax',
  secure: false,
};

if (process.env.NODE_ENV === 'production') {
  cookiesOptions.sameSite = 'none';
  cookiesOptions.secure = true;
}

const accessTokenCookieOptions: CookieOptions = {
  ...cookiesOptions,
  expires: new Date(
    Date.now() + Number(config.tokens.access.longevity) * 60 * 1000,
  ),
};
const refreshTokenCookieOptions: CookieOptions = {
  ...cookiesOptions,
  expires: new Date(
    Date.now() + Number(config.tokens.refresh.longevity) * 60 * 1000,
  ),
};

// ...

// Response handling
ResponseEntity.cookie(
  {
    name: 'access_token',
    value: token.accessToken,
    opts: accessTokenCookieOptions,
  },
  res,
);

ResponseEntity.cookie(
  {
    name: 'refresh_token',
    value: token.refreshToken,
    opts: refreshTokenCookieOptions,
  },
  res,
);

ResponseEntity.cookie(
  {
    name: 'logged_in',
    value: 'true',
    opts: {
      ...accessTokenCookieOptions,
      httpOnly: false,
    },
  },
  res,
);
```

The ResponseEntity is just a wrapper on the default express response object.

The options for production are set with SameSite=none since the api and client are deployed in different instances.

Here we can see that the access_token and refresh_token are set as HTTP Only, so it makes sense they don't show in the browser nor are they available via javascript, but the cookie logged_in is not set to HTTP Only.

Here are some prints of the Dev Tools for the frontend after requesting to login:

It's possible to see that the front end receives both cookies as expected. Notice that the logged_in cookie is in fact not set to HTTPOnly, and still it does not show in the storage tab for the cookies for the page.

I've made sure the expires is set to a future datetime, also I've checked if the api is settings the Domain to the correct value, which it is.

Any idea why this might be happening? Thank you in advance!

PS: I noticed it shows the cookies in the browser when both the api and client are in localhost (which is expected).

PS2: Im using axios to make the requests from the client to the api. I made sure to also set the withCredentials option to true on every request.

PS3: Both api and client are deployed and using HTTPS.

I've tried playing with the cookie settings in order to make the logged_in show in the browser. I checked if the Domain and Expires options were set correctly.

Title: Cookie not visible (HTTP Only false)

Body:
I have a express server settings cookies on a react frontend.

When I log in, the express server sets 3 cookies (access_token, refresh_token, logged_in). Here is the code of how I did it:

// option setup
const cookiesOptions: CookieOptions = {
  httpOnly: true,
  sameSite: 'lax',
  secure: false,
};

if (process.env.NODE_ENV === 'production') {
  cookiesOptions.sameSite = 'none';
  cookiesOptions.secure = true;
}

const accessTokenCookieOptions: CookieOptions = {
  ...cookiesOptions,
  expires: new Date(
    Date.now() + Number(config.tokens.access.longevity) * 60 * 1000,
  ),
};
const refreshTokenCookieOptions: CookieOptions = {
  ...cookiesOptions,
  expires: new Date(
    Date.now() + Number(config.tokens.refresh.longevity) * 60 * 1000,
  ),
};

// ...

// Response handling
ResponseEntity.cookie(
  {
    name: 'access_token',
    value: token.accessToken,
    opts: accessTokenCookieOptions,
  },
  res,
);

ResponseEntity.cookie(
  {
    name: 'refresh_token',
    value: token.refreshToken,
    opts: refreshTokenCookieOptions,
  },
  res,
);

ResponseEntity.cookie(
  {
    name: 'logged_in',
    value: 'true',
    opts: {
      ...accessTokenCookieOptions,
      httpOnly: false,
    },
  },
  res,
);

The ResponseEntity is just a wrapper on the default express response object.

The options for production are set with SameSite=none since the api and client are deployed in different instances.

Here we can see that the access_token and refresh_token are set as HTTP Only, so it makes sense they don't show in the browser nor are they available via javascript, but the cookie logged_in is not set to HTTP Only.

Here are some prints of the Dev Tools for the frontend after requesting to login:

It's possible to see that the front end receives both cookies as expected. Notice that the logged_in cookie is in fact not set to HTTPOnly, and still it does not show in the storage tab for the cookies for the page.

I've made sure the expires is set to a future datetime, also I've checked if the api is settings the Domain to the correct value, which it is.

Any idea why this might be happening? Thank you in advance!

PS: I noticed it shows the cookies in the browser when both the api and client are in localhost (which is expected).

PS2: Im using axios to make the requests from the client to the api. I made sure to also set the withCredentials option to true on every request.

PS3: Both api and client are deployed and using HTTPS.

I've tried playing with the cookie settings in order to make the logged_in show in the browser. I checked if the Domain and Expires options were set correctly.


问:
Is there a way to directly convert dom to rich text format
The customer has a requirement to convert the current form report content into an editable form.

I tried to put the whole innerHTML of the entire dom into quill, but the css and images will be lost. I also tried contenteditale = true, it seems that the whole content can be edited, but it is obviously not as easy to use as a rich text editor. Is there any way to convert most of the content, styles, and pictures in the dom into rich text? Or is there another good way to make the content editable


问:
React-Native Android - Invariant Violation: "TheApp" has not been registered
After I upgrade a major part of all my packages, when I run react-native run-android, I got this error :

Invariant Violation: "TheApp" has not been registered. This can happen if:
* Metro (the local dev server) is running from the wrong folder. Check if Metro is running, stop it, and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
```
<p>I haven't had this problem with iOS, the app works fine.</p>
<p>After some research, I try some things.
React-Native <code>0.69</code> for both.</p>
<p><strong>MainApplication.java</strong></p>
<p>I modify these lines :</p>
<pre class="lang-js prettyprint-override"><code>...
@Override
protected String getJSMainModuleName() {
  return "src/index.mobile"; //this line
}
...
</code>```

MainActivity.java

I modify these lines too :

...
@Override
protected String getMainComponentName() {
  return "TheApp"; //change the name here
}
...
```
<p>In the file <strong>app.json</strong>, I put the same name :</p>
<pre class="lang-js prettyprint-override"><code>{
  "name": "TheApp",
  "displayName": "TheApp"
}
</code>```

Finally, in index.mobile.js, I do this :

import './Business/Config/ReactotronConfig'
import { AppRegistry } from 'react-native'
import App from './mobile/App/Containers/App'

AppRegistry.registerComponent("TheApp", () => App)
```

Everything work in iOS, but not in Android.
Don't know what to do.

Body:
After I upgrade a major part of all my packages, when I run react-native run-android, I got this error :

Invariant Violation: "TheApp" has not been registered. This can happen if:
* Metro (the local dev server) is running from the wrong folder. Check if Metro is running, stop it, and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

I haven't had this problem with iOS, the app works fine.

After some research, I try some things.
React-Native 0.69 for both.

MainApplication.java

I modify these lines :

...
@Override
protected String getJSMainModuleName() {
  return "src/index.mobile"; //this line
}
...

MainActivity.java

I modify these lines too :

...
@Override
protected String getMainComponentName() {
  return "TheApp"; //change the name here
}
...

In the file app.json, I put the same name :

{
  "name": "TheApp",
  "displayName": "TheApp"
}

Finally, in index.mobile.js, I do this :

import './Business/Config/ReactotronConfig'
import { AppRegistry } from 'react-native'
import App from './mobile/App/Containers/App'

AppRegistry.registerComponent("TheApp", () => App)

Everything work in iOS, but not in Android.
Don't know what to do.


问:
Loop inside IF and Run the macro with protcted sheet
I was trying to make invoice using Excel VBA. And what I did first is making an (Next Invoice) Function,
which I did using IF statement as shown, but the problem is that I want to loop this function every time I click on the button.
here is the code I used:

Sub NextAWB()
If IsEmpty(Range("C6,C8,C11,C13,D24,J27,B27,E27,C27,F27").Value) = True Then
   MsgBox "AWB Is Empty !"
ElseIf IsEmpty(Range("C6,C8,C11,C13,D24,J27,B27,E27,C27,F27").Value) = False Then
   Range("G3").Value = Range("G3").Value + 1
   Range("C6,C8,C11,C13,D24,J27,B27,E27,C27,F27").Value = ""
End If

End Sub
```

Another issue I faced that I can not run this macro on protected sheet. Is there any idea to bypass this issue?

Any help will be appreciated!

Thanks

For the first bit I could not figure out how to deal with it to be honest.

For the other issue I tried (Me.Protect UserInterfaceOnly := True) but no luck.

Body:
I was trying to make invoice using Excel VBA. And what I did first is making an (Next Invoice) Function,
which I did using IF statement as shown, but the problem is that I want to loop this function every time I click on the button.
here is the code I used:

Sub NextAWB()
If IsEmpty(Range("C6,C8,C11,C13,D24,J27,B27,E27,C27,F27").Value) = True Then
   MsgBox "AWB Is Empty !"
ElseIf IsEmpty(Range("C6,C8,C11,C13,D24,J27,B27,E27,C27,F27").Value) = False Then
   Range("G3").Value = Range("G3").Value + 1
   Range("C6,C8,C11,C13,D24,J27,B27,E27,C27,F27").Value = ""
End If

End Sub

Another issue I faced that I can not run this macro on protected sheet. Is there any idea to bypass this issue?

Any help will be appreciated!

Thanks

For the first bit I could not figure out how to deal with it to be honest.

For the other issue I tried (Me.Protect UserInterfaceOnly := True) but no luck.


问:
Trying to add NVIDIA packages on Yocto
By building the Yocto image I encountered this issue during populating Yocto SDK. Do somebody have any idea where and how to fix it?

But i'm getting the following error:

ERROR: python3-3.8.14-r0 do_package: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function:
0001:
*** 0002:do_package(d)
0003:
File: '/home/vkchlt0732/yocto-tegra5/poky/meta/classes/package.bbclass', lineno: 2306, function: do_package
2302:    # Setup PKGD (from D)
2303:    ###########################################################################
2304:
2305:    for f in (d.getVar('PACKAGEBUILDPKGD') or '').split():
*** 2306:        bb.build.exec_func(f, d)
2307:
2308:    ###########################################################################
2309:    # Split up PKGD into PKGDEST
2310:    ###########################################################################
File: '/home/vkchlt0732/yocto-tegra5/poky/bitbake/lib/bb/build.py', lineno: 192, function: exec_func
0188:    flags = d.getVarFlags(func)
0189:    cleandirs = flags.get('cleandirs') if flags else None
0190:    if cleandirs:
0191:        for cdir in d.expand(cleandirs).split():
*** 0192:            bb.utils.remove(cdir, True)
0193:            bb.utils.mkdirhier(cdir)
0194:
0195:    if flags and dirs is None:
0196:        dirs = flags.get('dirs')
File: '/home/vkchlt0732/yocto-tegra5/poky/bitbake/lib/bb/utils.py', lineno: 710, function: remove
0706:        # shutil.rmtree(name) would be ideal but its too slow
0707:        cmd = []
0708:        if ionice:
0709:            cmd = ['ionice', '-c', '3']
*** 0710:        subprocess.check_call(cmd + ['rm', '-rf'] + glob.glob(path))
0711:        return
0712:    for name in glob.glob(path):
0713:        try:
0714:            os.unlink(name)
File: '/usr/lib/python3.8/subprocess.py', lineno: 364, function: check_call
0360:    if retcode:
0361:        cmd = kwargs.get("args")
0362:        if cmd is None:
0363:            cmd = popenargs[0]
*** 0364:        raise CalledProcessError(retcode, cmd)
0365:    return 0
0366:
0367:
0368:def check_output(*popenargs, timeout=None, **kwargs):
Exception: subprocess.CalledProcessError: Command '['rm', '-rf', '/home/vkchlt0732/yocto-tegra5/build/tmp/work/aarch64-poky-linux/python3/3.8.14-r0/package']' died with <Signals.SIGABRT: 6>.

ERROR: Logfile of failure stored in: /home/vkchlt0732/yocto-tegra5/build/tmp/work/aarch64-poky-linux/python3/3.8.14-r0/temp/log.do_package.282323
ERROR: Task (/home/vkchlt0732/yocto-tegra5/poky/meta/recipes-devtools/python/python3_3.8.14.bb:do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4482 tasks of which 4473 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/vkchlt0732/yocto-tegra5/poky/meta/recipes-devtools/python/python3_3.8.14.bb:do_package
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Please let me know any solution for this error

Title: Trying to add NVIDIA packages on Yocto


问:
SwiftUI where to store and manage app specific files
Where do I store files, like 1k png files, specific to my app in SwiftUI? I do not want them accesable from outside the app and I want to be able to download and delete them. I don't think CoreData is the right place for them or user defaults because they are not key value pairs.

I also need to know how much storage is available to the app for these files and manage this.


问:
How to automat bodymovin in after effects?
I need to automate exporing of ae templates via bodymovin.
Can I invoke bodymovin with args from my CEP extension or can I run bodymovin via cli ?
or another other tool or library to export comps from aep files to lottie json.

I tried bodymovin and ae docs couldnt find any helpful stuff. I able to just open bodymovin from my script , but cant send parms.


问:
Why does the address of the container change when it is accessed directly or by domain name?
Good afternoon.

Practicing with docker on debian in windows LAN. I wanted to fasten the adminer so that you can contact him at http://site/adminer. I created a rule in the virtual host that would transfer to port 8085. He enters the adminer on server:8085 http://site:8085, but on http://site/adminer gives me 403, judging by the logs and ip changes. I can’t understand why, next to the same service (php_1) ip does not change regardless of how you access it (server:8080 or http://site)

docker compose up (log)

```<code>    // server:8080
    php_1      | NOTICE: PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: php:9003 (through xdebug.client_host/xdebug.client_port).
    php_1      | 172.27.0.5 -  12/Jan/2023:13:56:08 +0300 "GET /index.php" 200

    // http://server.local ip has not changed
    php_1      | NOTICE: PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: php:9003 (through xdebug.client_host/xdebug.client_port).
    php_1      | 172.27.0.5 -  12/Jan/2023:13:56:11 +0300 "GET /index.php" 200

    // server:8085 - can connect to mysql
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52144 Accepted
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52144 [200]: GET /?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52144 Closing
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52145 Accepted
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52145 [200]: GET /adminer.css?v=402244250
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52145 Closing

    // http://server.local/adminer - i can see fist page of adminer, but it refuses connect to mysql. and ip is changed!
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53368 Accepted
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53368 <b>[403]</b>: GET //?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53368 Closing
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53372 Accepted
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53372 [200]: GET //adminer.css?v=402244250
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53372 Closing
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53378 Accepted
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53378 [302]: POST //?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53378 Closing
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53382 Accepted
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53382 <b>[403]</b>: GET //?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53382 Closing
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53386 Accepted
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53386 [200]: GET //adminer.css?v=402244250
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53386 Closing
</code>```

apache VirtualHost:

```<code><VirtualHost *:80>
    ProxyPreserveHost On

    ServerName server.local

    ProxyPass /adminer http://127.0.0.1:8085/
    ProxyPassReverse /adminer http://127.0.0.1:8085/

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
</code>```

docker-compose.yml

```<code>version: '3'
services:
    web:
        image: nginx
        restart: always
        ports:
            - "8080:80"
        volumes:
            - ./nginx.conf:/etc/nginx/conf.d/default.conf
            - ./app:/www/app
            - ./log/:/var/log/nginx
        command: [nginx-debug, '-g', 'daemon off;']
    php:
        build:
            context: .
            dockerfile: PHP_Dockerfile
        ports:
            - 8443:8443
            - 9000:9000
        volumes:
            - ./code-server:/root/.config/code-server
            - ./app:/www/app
            - ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
        environment:
            PHP_IDE_CONFIG: "serverName=docker-test"
    mysql:
        image: mariadb
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: 'secret'
            MYSQL_USER: 'db_user'
            MYSQL_PASSWORD: 'secret'
            MYSQL_DATABASE: 'test'
        volumes:
            - mysqldata:/var/lib/mysql
        ports:
            - 8081:3306
    adminer:
        image: adminer:latest
        restart: always
        environment:
            ADMINER_DESIGN: ng9
            ADMINER_DEFAULT_SERVER: mysql
        ports:
            - 8085:8080
volumes:
    mysqldata: {}
</code>```

Any advise where to dig? I feel im messed up with networks.

Body:
Good afternoon.

Practicing with docker on debian in windows LAN. I wanted to fasten the adminer so that you can contact him at http://site/adminer. I created a rule in the virtual host that would transfer to port 8085. He enters the adminer on server:8085 http://site:8085, but on http://site/adminer gives me 403, judging by the logs and ip changes. I can’t understand why, next to the same service (php_1) ip does not change regardless of how you access it (server:8080 or http://site)

docker compose up (log)

    // server:8080
    php_1      | NOTICE: PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: php:9003 (through xdebug.client_host/xdebug.client_port).
    php_1      | 172.27.0.5 -  12/Jan/2023:13:56:08 +0300 "GET /index.php" 200

    // http://server.local ip has not changed
    php_1      | NOTICE: PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: php:9003 (through xdebug.client_host/xdebug.client_port).
    php_1      | 172.27.0.5 -  12/Jan/2023:13:56:11 +0300 "GET /index.php" 200

    // server:8085 - can connect to mysql
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52144 Accepted
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52144 [200]: GET /?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52144 Closing
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52145 Accepted
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52145 [200]: GET /adminer.css?v=402244250
    adminer_1  | [Thu Jan 12 10:56:18 2023] [::ffff:172.21.93.160]:52145 Closing

    // http://server.local/adminer - i can see fist page of adminer, but it refuses connect to mysql. and ip is changed!
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53368 Accepted
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53368 [403]: GET //?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53368 Closing
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53372 Accepted
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53372 [200]: GET //adminer.css?v=402244250
    adminer_1  | [Thu Jan 12 10:56:26 2023] [::ffff:172.27.0.1]:53372 Closing
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53378 Accepted
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53378 [302]: POST //?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53378 Closing
    adminer_1  | [Thu Jan 12 10:56:54 2023] [::ffff:172.27.0.1]:53382 Accepted
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53382 [403]: GET //?server=mysql&username=db_user
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53382 Closing
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53386 Accepted
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53386 [200]: GET //adminer.css?v=402244250
    adminer_1  | [Thu Jan 12 10:56:55 2023] [::ffff:172.27.0.1]:53386 Closing

apache VirtualHost:

<VirtualHost *:80>
    ProxyPreserveHost On

    ServerName server.local

    ProxyPass /adminer http://127.0.0.1:8085/
    ProxyPassReverse /adminer http://127.0.0.1:8085/

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

docker-compose.yml

version: '3'
services:
    web:
        image: nginx
        restart: always
        ports:
            - "8080:80"
        volumes:
            - ./nginx.conf:/etc/nginx/conf.d/default.conf
            - ./app:/www/app
            - ./log/:/var/log/nginx
        command: [nginx-debug, '-g', 'daemon off;']
    php:
        build:
            context: .
            dockerfile: PHP_Dockerfile
        ports:
            - 8443:8443
            - 9000:9000
        volumes:
            - ./code-server:/root/.config/code-server
            - ./app:/www/app
            - ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
        environment:
            PHP_IDE_CONFIG: "serverName=docker-test"
    mysql:
        image: mariadb
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: 'secret'
            MYSQL_USER: 'db_user'
            MYSQL_PASSWORD: 'secret'
            MYSQL_DATABASE: 'test'
        volumes:
            - mysqldata:/var/lib/mysql
        ports:
            - 8081:3306
    adminer:
        image: adminer:latest
        restart: always
        environment:
            ADMINER_DESIGN: ng9
            ADMINER_DEFAULT_SERVER: mysql
        ports:
            - 8085:8080
volumes:
    mysqldata: {}

Any advise where to dig? I feel im messed up with networks.


问:
How are requests and tests organized in postman?
I am investigating Postman but I can't find an optimal way to organize the requests. Let me give an example:
Let's imagine I'm working on testing two microservices and my goal is to automate the tests and create a report that informs us of the outcome. Each microservice has 10 possible requests to perform (either get, post, etc.).

The ideal solution would be to have a collection which contains two folders (one per microservice) and that each folder has 10 requests; and to be able to run that collection from newman with a CSV/JSON data file, generating a final report (with tools like htmlextra).

The problem comes with data and iterations. Regarding the iterations, some of the requests like for example some 'GET' need only 1 execution but others like for example some 'POST' need several executions to check the status(if it returns a 200, a 400, etc.). Regarding the data, having 10 requests in the same collection, and some of the requests occupy quite a few columns of the csv, the data file becomes unreadable and hard to maintain.

So what I get when I run the collection is an unreadable data file and many iterations on requests that don't need them. As an alternative, I could create 1 collection for each request, and a data file for each collection but in that case I could not get a report as a whole when executing from newman, since to execute several collections I must execute several newman instructions, generating a report file for each one. So I would get 20 html file as report, 1 for each request(also not readable).

Sorry if I am pointing in the wrong direction as I have no experience with the tool.
On the web I only see examples of reports and basic collections, but I'm left wanting to see something more 'real'.

Thanks a lot!!!

Summary of my notes:

Only 1 data file can be assigned to the collection runner.

There are many requests which have a lot of data, about 10 columns, so if we have one data file for several, it becomes unreadable. Ideally 1 file for each request.

This forces us to create a collection for each request, since only 1 file per collection is feasible.

Newman can only run 1 collection per command, if you want to launch more, you have to duplicate instruction. This forces to create a report per collection. If we have 1 collection per request, we would have 1 report for each one instead of a report with the status of all the requests, so it loses the sense.


问:
Wine on Linux Mint - too many "fixme" messages
I'm trying to run a windows app on Linux Mint 20.03.
Wine installed Mono to install the app since it uses .NET. When launching the app from the terminal, I've got all of these messages:

```<code>01a4:fixme:iphlpapi:NotifyAddrChange (Handle 000000000081F1E8, overlapped 0000019800034090): stub
01a4:fixme:win:GetPointerDevices (000000000081EB0C 0000000000000000): partial stub
01a4:fixme:system:QueryDisplayConfig (00000002 000000000081EB20 00000198047BFE20 000000000081EB10 00000198000BF100 0000000000000000): semi-stub
01a4:fixme:system:DisplayConfigGetDeviceInfo Unimplemented packet type: 11
01a4:fixme:win:GetPointerDevices (000000000081EB0C 0000000000000000): partial stub
01a4:fixme:system:QueryDisplayConfig (00000002 000000000081EB20 00000198047BFE20 000000000081EB10 00000198000BF100 0000000000000000): semi-stub
01a4:fixme:system:DisplayConfigGetDeviceInfo Unimplemented packet type: 11
01a4:fixme:win:GetPointerDevices (000000000081EB0C 0000000000000000): partial stub
01a4:fixme:system:QueryDisplayConfig (00000002 000000000081EB20 00000198047BFE20 000000000081EB10 00000198000BF100 0000000000000000): semi-stub
01a4:fixme:system:DisplayConfigGetDeviceInfo Unimplemented packet type: 11
021c:fixme:wtsapi:WTSRegisterSessionNotification Stub 0000000000020074 0x00000000
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497F0B0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
01a4:fixme:service:I_ScRegisterDeviceNotification Notification filters are not yet implemented.
01a4:fixme:wtsapi:WTSRegisterSessionNotification Stub 0000000000030042 0x00000000
0228:fixme:sync:NtSetInformationJobObject stub: 0x32c 4 0xfcff028 4
0230:fixme:file:ReplaceFileW Ignoring flags 2
01a4:fixme:combase:RoGetActivationFactory (L"Windows.Devices.Enumeration.DeviceAccessInformation", {574bd3d3-5f30-45cd-8a94-724fe5973084}, 000000000081CB00): semi-stub
01a4:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Devices.Enumeration.DeviceAccessInformation"
01a4:fixme:combase:RoGetActivationFactory (L"Windows.Devices.Enumeration.DeviceAccessInformation", {574bd3d3-5f30-45cd-8a94-724fe5973084}, 000000000081CB00): semi-stub
01a4:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Devices.Enumeration.DeviceAccessInformation"
01a4:fixme:system:EnableNonClientDpiScaling (0000000000030040): stub
01a4:fixme:win:RegisterTouchWindow (0000000000030040 00000002): stub
021c:fixme:wtsapi:WTSRegisterSessionNotification Stub 000000000002004E 0x00000000
01a4:fixme:dwmapi:DwmSetWindowAttribute (0000000000030040, 2, 000000000081C584, 4) stub
01a4:fixme:nls:RtlGetThreadPreferredUILanguages 00000038, 000000000081B94C, 0000000000000000 000000000081B948
01a4:fixme:nls:get_dummy_preferred_ui_language (0x38 000000000081B94C 0000000000000000 000000000081B948) returning a dummy value (current locale)
01a4:fixme:nls:RtlGetThreadPreferredUILanguages 00000038, 000000000081B94C, 000000000081B932 000000000081B948
01a4:fixme:nls:get_dummy_preferred_ui_language (0x38 000000000081B94C 000000000081B932 000000000081B948) returning a dummy value (current locale)
01a4:fixme:dwrite:dwritefontface5_HasVariations 0000000001775CE0: stub
01a4:fixme:win:RegisterPowerSettingNotification (000000000002004E,{2b84c20e-ad23-4ddf-93db-05ffbd7efca5},0): stub
0254:err:winediag:ntlm_check_version ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0254:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
0254:fixme:powrprof:PowerRegisterSuspendResumeNotification (0x00000002,000000000081FCF0,000000000081FCE8) stub!
0254:fixme:heap:RtlSetHeapInformation 0000000000000000 1 0000000000000000 0 stub
0254:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 00000212002410B0, 16) stub
027c:fixme:winsock:WSALookupServiceBeginW (0000000006ACDBE0 0x00000ff0 0000000006ACDC58) Stub!
027c:fixme:iphlpapi:NotifyAddrChange (Handle 0000000006ACDDB8, overlapped 0000021200310B10): stub
027c:fixme:wlanapi:WlanEnumInterfaces (0000000000000001, 0000000000000000, 0000000006ACCD88) semi-stub
027c:fixme:wlanapi:WlanEnumInterfaces (0000000000000001, 0000000000000000, 0000000006ACCD88) semi-stub
01a4:fixme:shcore:GetCurrentProcessExplicitAppUserModelID 000000000081BC90: stub
0298:fixme:file:NtLockFile I/O completion on lock not implemented yet
0298:fixme:heap:PrefetchVirtualMemory process FFFFFFFFFFFFFFFF, count 0000000000000001, addresses 000000000A3CF400, flags 0 stub.
027c:fixme:winsock:setsockopt Ignoring SO_RANDOMIZE_PORT
01a4:fixme:win:RegisterTouchWindow (0000000000020070 00000002): stub
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497EC00 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
027c:fixme:wlanapi:WlanEnumInterfaces (0000000000000001, 0000000000000000, 0000000006ACCA88) semi-stub
02a8:err:winediag:ntlm_check_version ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
02a8:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
02a8:fixme:powrprof:PowerRegisterSuspendResumeNotification (0x00000002,000000000081FCF0,000000000081FCE8) stub!
02a8:fixme:heap:RtlSetHeapInformation 0000000000000000 1 0000000000000000 0 stub
02a8:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 000002B6002410B0, 16) stub
02a8:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
02a8:fixme:thread:QueryThreadCycleTime (FFFFFFFFFFFFFFFE,000000000081EB48): stub!
02f8:fixme:kernelbase:AppPolicyGetThreadInitializationType FFFFFFFFFFFFFFFA, 000000000D48FE10
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497EED0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
027c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497E480 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497E270 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
027c:fixme:winsock:setsockopt Ignoring SO_RANDOMIZE_PORT
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000019804CB30C0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000019804B93260 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497EC60 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
02a8:fixme:dwrite:dwritefontface5_HasVariations 00000000016A40A0: stub
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000019804F197B0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
01f0:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
01dc:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFFFFFFFFFA, 000000000081FD40
</code>```

Am I missing something?

Body:
I'm trying to run a windows app on Linux Mint 20.03.
Wine installed Mono to install the app since it uses .NET. When launching the app from the terminal, I've got all of these messages:

01a4:fixme:iphlpapi:NotifyAddrChange (Handle 000000000081F1E8, overlapped 0000019800034090): stub
01a4:fixme:win:GetPointerDevices (000000000081EB0C 0000000000000000): partial stub
01a4:fixme:system:QueryDisplayConfig (00000002 000000000081EB20 00000198047BFE20 000000000081EB10 00000198000BF100 0000000000000000): semi-stub
01a4:fixme:system:DisplayConfigGetDeviceInfo Unimplemented packet type: 11
01a4:fixme:win:GetPointerDevices (000000000081EB0C 0000000000000000): partial stub
01a4:fixme:system:QueryDisplayConfig (00000002 000000000081EB20 00000198047BFE20 000000000081EB10 00000198000BF100 0000000000000000): semi-stub
01a4:fixme:system:DisplayConfigGetDeviceInfo Unimplemented packet type: 11
01a4:fixme:win:GetPointerDevices (000000000081EB0C 0000000000000000): partial stub
01a4:fixme:system:QueryDisplayConfig (00000002 000000000081EB20 00000198047BFE20 000000000081EB10 00000198000BF100 0000000000000000): semi-stub
01a4:fixme:system:DisplayConfigGetDeviceInfo Unimplemented packet type: 11
021c:fixme:wtsapi:WTSRegisterSessionNotification Stub 0000000000020074 0x00000000
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497F0B0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
01a4:fixme:service:I_ScRegisterDeviceNotification Notification filters are not yet implemented.
01a4:fixme:wtsapi:WTSRegisterSessionNotification Stub 0000000000030042 0x00000000
0228:fixme:sync:NtSetInformationJobObject stub: 0x32c 4 0xfcff028 4
0230:fixme:file:ReplaceFileW Ignoring flags 2
01a4:fixme:combase:RoGetActivationFactory (L"Windows.Devices.Enumeration.DeviceAccessInformation", {574bd3d3-5f30-45cd-8a94-724fe5973084}, 000000000081CB00): semi-stub
01a4:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Devices.Enumeration.DeviceAccessInformation"
01a4:fixme:combase:RoGetActivationFactory (L"Windows.Devices.Enumeration.DeviceAccessInformation", {574bd3d3-5f30-45cd-8a94-724fe5973084}, 000000000081CB00): semi-stub
01a4:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Devices.Enumeration.DeviceAccessInformation"
01a4:fixme:system:EnableNonClientDpiScaling (0000000000030040): stub
01a4:fixme:win:RegisterTouchWindow (0000000000030040 00000002): stub
021c:fixme:wtsapi:WTSRegisterSessionNotification Stub 000000000002004E 0x00000000
01a4:fixme:dwmapi:DwmSetWindowAttribute (0000000000030040, 2, 000000000081C584, 4) stub
01a4:fixme:nls:RtlGetThreadPreferredUILanguages 00000038, 000000000081B94C, 0000000000000000 000000000081B948
01a4:fixme:nls:get_dummy_preferred_ui_language (0x38 000000000081B94C 0000000000000000 000000000081B948) returning a dummy value (current locale)
01a4:fixme:nls:RtlGetThreadPreferredUILanguages 00000038, 000000000081B94C, 000000000081B932 000000000081B948
01a4:fixme:nls:get_dummy_preferred_ui_language (0x38 000000000081B94C 000000000081B932 000000000081B948) returning a dummy value (current locale)
01a4:fixme:dwrite:dwritefontface5_HasVariations 0000000001775CE0: stub
01a4:fixme:win:RegisterPowerSettingNotification (000000000002004E,{2b84c20e-ad23-4ddf-93db-05ffbd7efca5},0): stub
0254:err:winediag:ntlm_check_version ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0254:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
0254:fixme:powrprof:PowerRegisterSuspendResumeNotification (0x00000002,000000000081FCF0,000000000081FCE8) stub!
0254:fixme:heap:RtlSetHeapInformation 0000000000000000 1 0000000000000000 0 stub
0254:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 00000212002410B0, 16) stub
027c:fixme:winsock:WSALookupServiceBeginW (0000000006ACDBE0 0x00000ff0 0000000006ACDC58) Stub!
027c:fixme:iphlpapi:NotifyAddrChange (Handle 0000000006ACDDB8, overlapped 0000021200310B10): stub
027c:fixme:wlanapi:WlanEnumInterfaces (0000000000000001, 0000000000000000, 0000000006ACCD88) semi-stub
027c:fixme:wlanapi:WlanEnumInterfaces (0000000000000001, 0000000000000000, 0000000006ACCD88) semi-stub
01a4:fixme:shcore:GetCurrentProcessExplicitAppUserModelID 000000000081BC90: stub
0298:fixme:file:NtLockFile I/O completion on lock not implemented yet
0298:fixme:heap:PrefetchVirtualMemory process FFFFFFFFFFFFFFFF, count 0000000000000001, addresses 000000000A3CF400, flags 0 stub.
027c:fixme:winsock:setsockopt Ignoring SO_RANDOMIZE_PORT
01a4:fixme:win:RegisterTouchWindow (0000000000020070 00000002): stub
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497EC00 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
027c:fixme:wlanapi:WlanEnumInterfaces (0000000000000001, 0000000000000000, 0000000006ACCA88) semi-stub
02a8:err:winediag:ntlm_check_version ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
02a8:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
02a8:fixme:powrprof:PowerRegisterSuspendResumeNotification (0x00000002,000000000081FCF0,000000000081FCE8) stub!
02a8:fixme:heap:RtlSetHeapInformation 0000000000000000 1 0000000000000000 0 stub
02a8:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 000002B6002410B0, 16) stub
02a8:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
02a8:fixme:thread:QueryThreadCycleTime (FFFFFFFFFFFFFFFE,000000000081EB48): stub!
02f8:fixme:kernelbase:AppPolicyGetThreadInitializationType FFFFFFFFFFFFFFFA, 000000000D48FE10
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497EED0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
027c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497E480 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497E270 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
027c:fixme:winsock:setsockopt Ignoring SO_RANDOMIZE_PORT
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000019804CB30C0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000019804B93260 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 000001980497EC60 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
02a8:fixme:dwrite:dwritefontface5_HasVariations 00000000016A40A0: stub
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000000000000000 len=0 000000000FCFEF2C),stub!
0228:fixme:winstation:GetUserObjectSecurity (0000000000000008 000000000FCFEF28 0000019804F197B0 len=40 000000000FCFEF2C),stub!
0228:fixme:ntdll:NtSetInformationToken TokenIntegrityLevel stub!
0228:fixme:ntdll:NtFilterToken flags 0x1 unsupported
0228:fixme:ntdll:NtFilterToken support for restricting sids not yet implemented
01f0:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
01dc:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFFFFFFFFFA, 000000000081FD40

Am I missing something?


问:
Get a list of pushed files from a python script, while GitHub Action on push
I'm trying to get the list of last commit pushed files whereas a pushed commit is triggering a GitHub Action. The most difficult, is that I need to get this files from a subprocess.getoutput() method of/in Python. Here is my problematic command.

```<code>git_diff = subprocess.getoutput('git diff-tree --no-commit-id --name-only -r $GITHUB_SHA')
</code>```

The Ubuntu server on GitHubActions is correctly installed and every needed libraries are setup, but when I use a debug code to print('git_diff :' + git_diff), it returns, as a result:

```<code>git_diff: fatal: ambiguous argument 'zag2b54s': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
</code>```

While it works perfectly locally, my git command doesn't work on GitHub Actions, perhaps it depends of my mastering of Git, or maybe it is a problem with GitHub Actions. I really don't know.

Does someone know which git command to enter, in order to get the list of the last commit pushed files, from a Python script, on a GitHub Actions server?

I tried many times the code locally, and it works very well, but some strange things made commit hash unknown.
Maybe it is a problem of read/write inside yml github action file.
I don't exactly know where to search.

Please found attached some relevant parts of my yaml workflow file :

name: Automation for csv, py and diagrams files of Sequel pushed files

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

permissions: write-all

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Set up Python 3.11
      uses: actions/setup-python@v3
      with:
        python-version: "3.11"
    - name: Install dependencies
      run: |
        sudo apt-get update -y \
            && sudo apt-get upgrade -y \
            && sudo apt-get install graphviz git -y \
            && python -m pip install --upgrade pip \
            && pip install pandas sql-metadata diagrams
    - name: App with Automation for csv and diagrams
      run: |
        # stop the build if there are Python syntax errors or undefined names
        python automation_csv_diagram.py --last_commit
```
<p>Then, the same thing for my python script (it works either locally or on GitHub Actions) :</p>
<pre class="lang-py prettyprint-override"><code>import subprocess
import sys
from glob import glob
from re import findall, IGNORECASE, match, MULTILINE, search, S, sub

global REQUEST_DIR
REQUEST_DIR = "bq"

def pickup(lastcommit_fct: bool) -> List[str]:
    """
    :param lastcommit_fct: bool
    Récupère la liste des fichiers sql dans les sous répertoires
    :return: List[str]
    """
    global REQUEST_DIR
    if lastcommit_fct:
        if not os.name == "nt":  # Test que le système utilisé n'est pas Windows mais ubuntu dans GitHub Actions
            git_diff = subprocess.getoutput('git diff-tree --no-commit-id --name-only -r $GITHUB_SHA')
        else:
            git_diff = subprocess.getoutput('git diff-tree --no-commit-id --name-only -r HEAD')
        files = findall("(.*\.sql)", git_diff, MULTILINE | IGNORECASE)
##DEBUG MODE###############################
        mode = True
        if mode:
            var_githubsha = subprocess.getoutput("echo $GITHUB_SHA")
            sys.exit('github sha: ' + var_githubsha + "\ngit_diff: " + git_diff + '\nfiles: ' + str(files))
###########################################
        if len(files) > 0:
            files = [y for y in [x.strip() for x in files] if match(r".*\.sql", y, IGNORECASE)]
        else:
            sys.exit("Pas de fichier SQL dans le dernier commit git_diff" + git_diff)

    if not lastcommit_fct:
        files: list = glob(f'{REQUEST_DIR}/**/*.sql')
    return sorted(files)

def main(lastcommit_fct):
    files = pickup(lastcommit_fct)

if __name__ == '__main__':
    option = str(sys.argv[1])
    if option == "--all_directories":
        main(False)  # Pour générer tous les documents SQL du répertoire ./bq
    elif option == "--last_commit":
        main(True)  # Pour ne générer que les documents SQL du dernier commit
    else:
        print("""Lancer le script pour tous les fichiers Sequel du répertoire ./bq:
$python automation_csv_diagram --all_directories

Lancer le script pour tous les derniers fichiers Sequel venant d'être poussés
$python automation_csv_diagram --last_commit""")
</code>```

Sorry for not-French speakers, all commentaries are not in English.

Body:
I'm trying to get the list of last commit pushed files whereas a pushed commit is triggering a GitHub Action. The most difficult, is that I need to get this files from a subprocess.getoutput() method of/in Python. Here is my problematic command.

git_diff = subprocess.getoutput('git diff-tree --no-commit-id --name-only -r $GITHUB_SHA')

The Ubuntu server on GitHubActions is correctly installed and every needed libraries are setup, but when I use a debug code to print('git_diff :' + git_diff), it returns, as a result:

git_diff: fatal: ambiguous argument 'zag2b54s': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

While it works perfectly locally, my git command doesn't work on GitHub Actions, perhaps it depends of my mastering of Git, or maybe it is a problem with GitHub Actions. I really don't know.

Does someone know which git command to enter, in order to get the list of the last commit pushed files, from a Python script, on a GitHub Actions server?

I tried many times the code locally, and it works very well, but some strange things made commit hash unknown.
Maybe it is a problem of read/write inside yml github action file.
I don't exactly know where to search.

Please found attached some relevant parts of my yaml workflow file :

name: Automation for csv, py and diagrams files of Sequel pushed files

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

permissions: write-all

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Set up Python 3.11
      uses: actions/setup-python@v3
      with:
        python-version: "3.11"
    - name: Install dependencies
      run: |
        sudo apt-get update -y \
            && sudo apt-get upgrade -y \
            && sudo apt-get install graphviz git -y \
            && python -m pip install --upgrade pip \
            && pip install pandas sql-metadata diagrams
    - name: App with Automation for csv and diagrams
      run: |
        # stop the build if there are Python syntax errors or undefined names
        python automation_csv_diagram.py --last_commit

Then, the same thing for my python script (it works either locally or on GitHub Actions) :

import subprocess
import sys
from glob import glob
from re import findall, IGNORECASE, match, MULTILINE, search, S, sub

global REQUEST_DIR
REQUEST_DIR = "bq"

def pickup(lastcommit_fct: bool) -> List[str]:
    """
    :param lastcommit_fct: bool
    Récupère la liste des fichiers sql dans les sous répertoires
    :return: List[str]
    """
    global REQUEST_DIR
    if lastcommit_fct:
        if not os.name == "nt":  # Test que le système utilisé n'est pas Windows mais ubuntu dans GitHub Actions
            git_diff = subprocess.getoutput('git diff-tree --no-commit-id --name-only -r $GITHUB_SHA')
        else:
            git_diff = subprocess.getoutput('git diff-tree --no-commit-id --name-only -r HEAD')
        files = findall("(.*\.sql)", git_diff, MULTILINE | IGNORECASE)
##DEBUG MODE###############################
        mode = True
        if mode:
            var_githubsha = subprocess.getoutput("echo $GITHUB_SHA")
            sys.exit('github sha: ' + var_githubsha + "\ngit_diff: " + git_diff + '\nfiles: ' + str(files))
###########################################
        if len(files) > 0:
            files = [y for y in [x.strip() for x in files] if match(r".*\.sql", y, IGNORECASE)]
        else:
            sys.exit("Pas de fichier SQL dans le dernier commit git_diff" + git_diff)

    if not lastcommit_fct:
        files: list = glob(f'{REQUEST_DIR}/**/*.sql')
    return sorted(files)

def main(lastcommit_fct):
    files = pickup(lastcommit_fct)

if __name__ == '__main__':
    option = str(sys.argv[1])
    if option == "--all_directories":
        main(False)  # Pour générer tous les documents SQL du répertoire ./bq
    elif option == "--last_commit":
        main(True)  # Pour ne générer que les documents SQL du dernier commit
    else:
        print("""Lancer le script pour tous les fichiers Sequel du répertoire ./bq:
$python automation_csv_diagram --all_directories

Lancer le script pour tous les derniers fichiers Sequel venant d'être poussés
$python automation_csv_diagram --last_commit""")

Sorry for not-French speakers, all commentaries are not in English.


问:
Run sequential jobs/functions in Kotlin Coroutines with livedata
```<code>fun viewDidLoad() {
    observeViewModel()

    initializeUI()
    getVideos()
    getQuestions()
}

fun initializeUI() {
    /*
    1 - Create a list as;
    VideosTitleRow("Videos"),
    VideosBodyRow(null),
    QuestionTitleRow("Questions"),
    QuestionsBodyRow(null),
    ...."

    Note: The bodies are null right now. There will fill with correct values after.

    ---

    2 - Call updateUI functions for update ui with initialize list.
    */
}

fun getVideos() {
    viewModel.getVideos()
}

fun getQuestions() {
    viewModel.getQuestions()
}

fun observeViewModel() {
    // Videos
    CoroutineScope(Dispatchers.IO).launch {
        when (flow) {
            // ...
            is VideosFlow.DataReceived -> {
                val row = SectionVideosBodyData(flow.videos)
                updateUI(1, row)
            }
        }
    }

    // Questions
    CoroutineScope(Dispatchers.IO).launch {
        when (flow) {
            // ...
            is QuestionsFlow.DataReceived -> {
                val row = SectionQuestionsBodyData(flow.questions)
                updateUI(3, row)
            }
        }
    }

    // And others LiveDatas under observing ....
}

fun updateUI(indexAt: Int? = null, row: BaseAdapterData = null) {
    /*
    If indexAt and row parameters are not null;
    edit the global row list then created new row list from this (global list) and send the new list to adapter for update ui.

    If parameters are null; send the global list to adapter for update ui.
    */
}
</code>```

This is the current structure.

Let me try to explain what is problem;

When i start the initializeUI() function i know when it will finish the job. Because this is a synchronous function.

getVideos() or getQuestions() functions are a synchronous functions too but they start to api call, send request, take response, convert to ui model, bla bla operations. And we have to observe the results. So, we don't know when this job will finish!

getVideos() function just like says to viewModel.getVideos; "Let me know when you see the red car" but we can't know when is the red car pass on street.

In this case; although getQuestions() function is called before getVideos(), it may finish before it. In fact, both can end at the same time.

Here is i need;

I want to use kotlin coroutines scopes in getVideos(), getQuestions(), ... functions run as asynchronous but every job must wait for finished updateUI() function.

1-  initializeUI() function runs, create a list, send to adapter, update the ui,

2- getVideos() or getQuestions() runs as asynchronous,

let say; livedata(getVideos) finish the their work but livedata (getQuestions) still working.

getQuestion() when call the updateUI() function, getVideos() can not call until updateUI() function finished called from getQuestion()

I know this is a complicated case :)

But the LiveData is messing up my mind.

I tried Mutex but although getVideos() or getQuestions() functions are synchronous, they starts an asynchronous job.

(Kotlin Coroutines sequential execution)

Body:
fun viewDidLoad() {
    observeViewModel()

    initializeUI()
    getVideos()
    getQuestions()
}

fun initializeUI() {
    /*
    1 - Create a list as;
    VideosTitleRow("Videos"),
    VideosBodyRow(null),
    QuestionTitleRow("Questions"),
    QuestionsBodyRow(null),
    ...."

    Note: The bodies are null right now. There will fill with correct values after.

    ---

    2 - Call updateUI functions for update ui with initialize list.
    */
}

fun getVideos() {
    viewModel.getVideos()
}

fun getQuestions() {
    viewModel.getQuestions()
}

fun observeViewModel() {
    // Videos
    CoroutineScope(Dispatchers.IO).launch {
        when (flow) {
            // ...
            is VideosFlow.DataReceived -> {
                val row = SectionVideosBodyData(flow.videos)
                updateUI(1, row)
            }
        }
    }

    // Questions
    CoroutineScope(Dispatchers.IO).launch {
        when (flow) {
            // ...
            is QuestionsFlow.DataReceived -> {
                val row = SectionQuestionsBodyData(flow.questions)
                updateUI(3, row)
            }
        }
    }

    // And others LiveDatas under observing ....
}

fun updateUI(indexAt: Int? = null, row: BaseAdapterData = null) {
    /*
    If indexAt and row parameters are not null;
    edit the global row list then created new row list from this (global list) and send the new list to adapter for update ui.

    If parameters are null; send the global list to adapter for update ui.
    */
}

This is the current structure.

Let me try to explain what is problem;

When i start the initializeUI() function i know when it will finish the job. Because this is a synchronous function.

getVideos() or getQuestions() functions are a synchronous functions too but they start to api call, send request, take response, convert to ui model, bla bla operations. And we have to observe the results. So, we don't know when this job will finish!

getVideos() function just like says to viewModel.getVideos; "Let me know when you see the red car" but we can't know when is the red car pass on street.

In this case; although getQuestions() function is called before getVideos(), it may finish before it. In fact, both can end at the same time.

Here is i need;

I want to use kotlin coroutines scopes in getVideos(), getQuestions(), ... functions run as asynchronous but every job must wait for finished updateUI() function.

1-  initializeUI() function runs, create a list, send to adapter, update the ui,

2- getVideos() or getQuestions() runs as asynchronous,

let say; livedata(getVideos) finish the their work but livedata (getQuestions) still working.

getQuestion() when call the updateUI() function, getVideos() can not call until updateUI() function finished called from getQuestion()

I know this is a complicated case :)

But the LiveData is messing up my mind.

I tried Mutex but although getVideos() or getQuestions() functions are synchronous, they starts an asynchronous job.

(Kotlin Coroutines sequential execution)


问:
Is there a smart way to merge two existing next.js projects with different material UI settings?
We have two different next.js projects with their own material UI settings and different project structures and should merge them as one, I was wondering if it is wise to do so and is there a less ugly way to achieve that?

We tried to merge the smaller and less complicated one into the other and then deal with the incoming errors caused by different material UI settings, but the amount of the errors were huge, and came to this existential question.


问:
Warning: Each child in a list should have a unique "key" prop. Check the render method of `Cart`. Teact.js
I'm making E-commerce website just I want to add to cart .  when I click add to cart button then add Product on my cart but its showing error , and I use a lot of method but I did not solve. can you explain cleanly

getting this error I tried to fixed but I could not , where  I am making mistake

```<code>react_devtools_backend.js:4012 Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Cart`. See https://reactjs.org/link/warning-keys for more information.
    at div
    at Cart (http://localhost:3000/main.f51a13b4a1752c213b98.hot-update.js:34:71)
    at RenderedRoute (http://localhost:3000/static/js/bundle.js:49574:5)
    at Routes (http://localhost:3000/static/js/bundle.js:49997:5)
    at div
    at App
    at CartContext (http://localhost:3000/static/js/bundle.js:713:5)
    at ProductContext (http://localhost:3000/static/js/bundle.js:806:5)
    at Router (http://localhost:3000/static/js/bundle.js:49935:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:48282:5)
</code>```

Home page

```<code>import React from 'react';
import { CartState } from "../Context/ProductContext";
import Navbar from "../Components/Navbar/Navbar";
import SingleProduct from "../Components/Products/SingleProduct";
import "../Components/Products/SingleProduct.css";
import { CartStatus } from "../Context/CartContext";

const Home = () => {
  //custom hook useContext
  const { Product} = CartState();
  console.log("Product:", Product);

  return (
     <>
      <Navbar/>

      <div className="Product_wrapper">
      {Product?.map((products, i) => (
            <SingleProduct key={products.id} products={products}/>
      )
         )}

      </div>
     </>
  )
}

</code>```

Single Product

```<code>import React from 'react';
import "../Products/SingleProduct.css";
import { CartStatus } from "../../Context/CartContext";

//Add to product using Dispatch

const SingleProduct = ({ products }) => {
     const {Cart , dispatch} =  CartStatus()
      //  console.log("DEMON:", Cart);

      const addToCart = (products)=>{
         dispatch({ type:"ADD_CART", playload:products})
      }
  return (
    <div className="product_container">
         <img src={products.image}    className="img" alt={products.name} />
          <h1>{products.title}</h1>
          <span>₹{products.price}</span>
           <button
             onClick={(products) =>{
              addToCart(products)
             }}
           className="btn">Add</button>
    </div>
  )
}

export default SingleProduct;

</code>```

Cart

```<code>import React from 'react';
import AddToCart from "../Components/Cart/AddToCart";
import { CartStatus } from "../Context/CartContext";
import "../Components/Products/SingleProduct.css";
// import { CartState } from "../Context/ProductContext";

const Cart = () => {
const {Cart, dispatch} = CartStatus();
        console.log("LLL:" ,Cart);

  return (
    <div className="Product_wrapper">
       {Cart.map((products,i) =>(
          <div className="product_container" key={products.id}>
            <img src={products.image}  className="img" alt={products.name} />
             <h1>{products.title}</h1>
          </div>

       ))}
    </div>

  )
}

export default Cart;

</code>```

I'm using UseContext and UseReducer for make

Body:
I'm making E-commerce website just I want to add to cart .  when I click add to cart button then add Product on my cart but its showing error , and I use a lot of method but I did not solve. can you explain cleanly

getting this error I tried to fixed but I could not , where  I am making mistake

react_devtools_backend.js:4012 Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Cart`. See https://reactjs.org/link/warning-keys for more information.
    at div
    at Cart (http://localhost:3000/main.f51a13b4a1752c213b98.hot-update.js:34:71)
    at RenderedRoute (http://localhost:3000/static/js/bundle.js:49574:5)
    at Routes (http://localhost:3000/static/js/bundle.js:49997:5)
    at div
    at App
    at CartContext (http://localhost:3000/static/js/bundle.js:713:5)
    at ProductContext (http://localhost:3000/static/js/bundle.js:806:5)
    at Router (http://localhost:3000/static/js/bundle.js:49935:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:48282:5)

Home page

import React from 'react';
import { CartState } from "../Context/ProductContext";
import Navbar from "../Components/Navbar/Navbar";
import SingleProduct from "../Components/Products/SingleProduct";
import "../Components/Products/SingleProduct.css";
import { CartStatus } from "../Context/CartContext";

const Home = () => {
  //custom hook useContext
  const { Product} = CartState();
  console.log("Product:", Product);

  return (
     <>
      <Navbar/>

      {Product?.map((products, i) => (
            <SingleProduct key={products.id} products={products}/>
      )
         )}

     </>
  )
}

Single Product

import React from 'react';
import "../Products/SingleProduct.css";
import { CartStatus } from "../../Context/CartContext";

//Add to product using Dispatch

const SingleProduct = ({ products }) => {
     const {Cart , dispatch} =  CartStatus()
      //  console.log("DEMON:", Cart);

      const addToCart = (products)=>{
         dispatch({ type:"ADD_CART", playload:products})
      }
  return (

{products.title}

          ₹{products.price}
           <button
             onClick={(products) =>{
              addToCart(products)
             }}
           className="btn">Add</button>

  )
}

export default SingleProduct;

Cart

import React from 'react';
import AddToCart from "../Components/Cart/AddToCart";
import { CartStatus } from "../Context/CartContext";
import "../Components/Products/SingleProduct.css";
// import { CartState } from "../Context/ProductContext";

const Cart = () => {
const {Cart, dispatch} = CartStatus();
        console.log("LLL:" ,Cart);

  return (

       {Cart.map((products,i) =>(

{products.title}

       ))}

  )
}

export default Cart;

I'm using UseContext and UseReducer for make