问:
Preprocessing in Recommender systems with apriori/fpgrowth algorithms
I am trying to implement the apriori and fpgrowth algorithm to some characterisation data that I have. The data I have are already binarised and it is composed of 1's (passes), 0's (fails) and Null values.

I want to clarify with my preprocessing pipeline if it would be good enough in practise. I have already removed rows/columns from the dataset that have the ENTIRE row/column with Null values and now I am still left with some Null values.

I was thinking of applying categorical PCA to decrease the size of the dataset even more, but I believe that wouldn't good enough practise as it requires to impute and fill the missing values with something else, and I don't need that as it will affect final results.

So, what I am actually doing to address the issue of the Null values, is to fill them up with a 0. I do this, because the algorithms above try to measure the frequency of items that exist in a database. And I guess, the 1's are the datapoints that are keeping count of that frequency. Hence, the rest should be 0.

But, I am still not sure if it's good enough practise because it looks like I am filling up the Null values with a 0 (failure) as if it has been measured.

Any help on this, if I am tackling my problem correctly or if I should try something else would be very much appreciated. :)


来源: stackexchange

问:
Is there a full list on LED behavior for Google Coral USB accelerator?
In the official datasheet for the Google Coral USB accelerator (https://coral.ai/docs/accelerator/datasheet/), they mention two LED behaviors - LED on (solid) and LED pulse (breathe).
However, apparently, there are more LED modes.

For example:

https://github.com/google-coral/edgetpu/issues/675

https://github.com/google-coral/edgetpu/issues/476

So, does someone know and have a complete list of these different blinking modes with their meaning?

ContentLicense: CC BY-SA 4.0


问:
Python pywin32 Adding Excel Object, IconLabel not displaying
I am using pywin32 module to add an excel file as an object in another excel file, I need to get the label added to it as Europe in the object. Even after adding the parameter IconLabel in code, I don't see any caption in the object attached to Excel, can anyone please let me know what is wrong in the code?

Here is the following Code I have used:

```<code>import win32com.client as win32
import sys
Filename=str(sys.argv[1])
Sheetname=str(sys.argv[2])
Filename2=str(sys.argv[3])
xl = win32.gencache.EnsureDispatch('Excel.Application')
wb=xl.Workbooks.Open(Filename)
ws=wb.Worksheets(Sheetname)
dest_cell=ws.Range("A1")
obj = ws.OLEObjects()
obj.Add(Filename=Filename2,Link=False,DisplayAsIcon=True,IconLabel="Europe",Left=dest_cell.Left,Top=dest_cell.Top)
wb.Save()
xl.Application.Quit()

</code>```

Body:
I am using pywin32 module to add an excel file as an object in another excel file, I need to get the label added to it as Europe in the object. Even after adding the parameter IconLabel in code, I don't see any caption in the object attached to Excel, can anyone please let me know what is wrong in the code?

Here is the following Code I have used:

import win32com.client as win32
import sys
Filename=str(sys.argv[1])
Sheetname=str(sys.argv[2])
Filename2=str(sys.argv[3])
xl = win32.gencache.EnsureDispatch('Excel.Application')
wb=xl.Workbooks.Open(Filename)
ws=wb.Worksheets(Sheetname)
dest_cell=ws.Range("A1")
obj = ws.OLEObjects()
obj.Add(Filename=Filename2,Link=False,DisplayAsIcon=True,IconLabel="Europe",Left=dest_cell.Left,Top=dest_cell.Top)
wb.Save()
xl.Application.Quit()


问:
Jodit-pro editor: How to determine if jodit-pro is running on license or trial mode?
I have purchased an OEM license for my project, and when I try to use it with the license, it doesnt say if its accepting and running on license or on trial mode. There is no indication.

I tried to check the config returned from jodit instance, and I can see it shows the entered license, but it can run on trial as well, if its invalid, so no way to understand this.


问:
unable to read file data, getting request payload as {} with 400 error code
getting 400 status code, can anyone explain why
I've searched everywhere but I can't seem to get it working

```<code>    handleBulkUpload() {
        alert("Bulk upload submitted")
        const file = this.state.csvFile;
        console.log("csv file: ", file)

        let data = new FormData();
        data.append('file', file)

        post("/uploadOCFile", data)
            .then((response) => {
                console.log({response})
            }).catch((error) => console.error({error}))

    }
</code>```
```<code>               <div className='attribute-selector'>
                    <h3>Bulk Upload</h3>
                    <div>
                        <p>You can upload a file to bulk upload </p>
                        <div>
                            <label style={{ marginRight: "2px", paddingTop: "8px", paddingBottom: "40px"  }}> File: </label>
                            <input id="csvUpload" name="file" type="file" onChange={this.handleFileChange} />
                        </div>
                        <label style={{ color: "red" }} >{this.state.errorMsg}</label>
                        <div className='submit-button'>
                            <button type='submit' className='btn btn-primary' onClick={this.handleBulkUpload} disabled={this.isBulkUploadDisabled()}>
                                Upload
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
</code>```

I'm getting 400 code, can you please how to append file so that contents will be displayed in front end, I'm seeing 400 code in console and request payload as {}

```<code>@RequestMapping(value = "/oc")
public class OCFileUploadController {

    @RequestMapping(value = "/uploadOCFile", method = RequestMethod.POST)
    @ResponseBody
    public FileUploadStatus uploadOCFileContent(final @RequestParam MultipartFile file) {
        log.info("OCFileUploadController : file: ", file);

        FileUploadStatus status = null;

        try {
            // validation
            // service call

            status = new FileUploadStatus();
            status.setMessage("File uploaded successfully");
            status.setStatus(true);
        } catch (Exception e) {
            status = new FileUploadStatus();
            status.setMessage("File upload failed");
            status.setStatus(false);
        }
        return status;
    }
</code>```

Body:
getting 400 status code, can anyone explain why
I've searched everywhere but I can't seem to get it working

    handleBulkUpload() {
        alert("Bulk upload submitted")
        const file = this.state.csvFile;
        console.log("csv file: ", file)

        let data = new FormData();
        data.append('file', file)

        post("/uploadOCFile", data)
            .then((response) => {
                console.log({response})
            }).catch((error) => console.error({error}))

    }

Bulk Upload

You can upload a file to bulk upload

                             File:
                            <input id="csvUpload" name="file" type="file" onChange={this.handleFileChange} />

                        {this.state.errorMsg}

                            <button type='submit' className='btn btn-primary' onClick={this.handleBulkUpload} disabled={this.isBulkUploadDisabled()}>
                                Upload
                            </button>

        )
    }

I'm getting 400 code, can you please how to append file so that contents will be displayed in front end, I'm seeing 400 code in console and request payload as {}

@RequestMapping(value = "/oc")
public class OCFileUploadController {

    @RequestMapping(value = "/uploadOCFile", method = RequestMethod.POST)
    @ResponseBody
    public FileUploadStatus uploadOCFileContent(final @RequestParam MultipartFile file) {
        log.info("OCFileUploadController : file: ", file);

        FileUploadStatus status = null;

        try {
            // validation
            // service call

            status = new FileUploadStatus();
            status.setMessage("File uploaded successfully");
            status.setStatus(true);
        } catch (Exception e) {
            status = new FileUploadStatus();
            status.setMessage("File upload failed");
            status.setStatus(false);
        }
        return status;
    }


问:
Windows Update search - remote commands not working
Since end of October 2022 some of your windows servers (OS: 2012/R2, 2016) haven't searched for any windows updates, the status I see in the windows update GUI looks like this:

enter image description here

The updates are deployed via Windows Update Server (WSUS, OS: 2012 R2).

When I click on search then Windows Updates can be found, are downloaded and installed properly. This only works when I click on the search button manually. If I use remote commands like this it does NOT work (either I get an error code [OS 2016] or nothing happens [OS 2012]):

Remote commands:

Attempt:

```<code>$item = Servername

$s = New-PSSession -computername $item

Invoke-Command -Session $s -ScriptBlock {

net stop Bits
net stop WuAuServ
net stop CryptSvc
Remove-Item -Path C:\Windows\SoftwareDistribution -Recurse
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientIdValidation /f
net start Bits
net start WuAuServ
net start CryptSvc

#OS 2012/R2
wuauclt /resetauthorization /detectnow

#OS 2016
usoclient StartScan

#OS 2019
usoclient StartInteractiveScan

 }
}
</code>```

Attempt:

```<code>$item = Servername

if (schtasks /create /S $item /RU 'NT AUTHORITY\SYSTEM' /RL 'HIGHEST' /SC ONEVENT /EC Application /f /tn 'cmd' /tr 'usoclient StartScan'){
schtasks /Run /S $item /TN 'cmd'
Start-Sleep -Seconds 2
schtasks /Delete /S $item /TN 'cmd' /F
}
</code>```

Results:

enter image description here

It can't be a solution to connect via RDP to every single server and search for windows updates manually, there must be a fix to run the windows update search remotely.

Body:
Since end of October 2022 some of your windows servers (OS: 2012/R2, 2016) haven't searched for any windows updates, the status I see in the windows update GUI looks like this:

enter image description here

The updates are deployed via Windows Update Server (WSUS, OS: 2012 R2).

When I click on search then Windows Updates can be found, are downloaded and installed properly. This only works when I click on the search button manually. If I use remote commands like this it does NOT work (either I get an error code [OS 2016] or nothing happens [OS 2012]):

Remote commands:

Attempt:

$item = Servername

$s = New-PSSession -computername $item

Invoke-Command -Session $s -ScriptBlock {

net stop Bits
net stop WuAuServ
net stop CryptSvc
Remove-Item -Path C:\Windows\SoftwareDistribution -Recurse
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientIdValidation /f
net start Bits
net start WuAuServ
net start CryptSvc

#OS 2012/R2
wuauclt /resetauthorization /detectnow

#OS 2016
usoclient StartScan

#OS 2019
usoclient StartInteractiveScan

 }
}

Attempt:

$item = Servername

if (schtasks /create /S $item /RU 'NT AUTHORITY\SYSTEM' /RL 'HIGHEST' /SC ONEVENT /EC Application /f /tn 'cmd' /tr 'usoclient StartScan'){
schtasks /Run /S $item /TN 'cmd'
Start-Sleep -Seconds 2
schtasks /Delete /S $item /TN 'cmd' /F
}

Results:

enter image description here

It can't be a solution to connect via RDP to every single server and search for windows updates manually, there must be a fix to run the windows update search remotely.


问:
Kafka Stream and Spring Cloud : java.lang.IllegalArgumentException: The class '[B' is not in the trusted packages: If you believe this class is safe

java.lang.IllegalArgumentException: The class '[B' is not in the trusted packages: [java.util, java.lang, com.trisha.clients.collection, com.trisha.clients.collection.]. If you believe this class is safe to deserialize, please provide its name. If the serialization is only done by a trusted source, you can also enable trust all ().

Seems it does not like this. please help with right config file

.yml file

```<code>server:
  port: 8787

spring.kafka.consumer.properties.spring.json.trusted.packages=*:
spring:
  application:
    name: message-processor
  cloud:
    function:
      definition: messageProcessor
    stream:
      kafka:
        streams:
          binder:
            brokers:
              - localhost:9092
              - localhost:36161
              - localhost :40237
#            auto-create-topics: true
#            consumer-properties:

#      default-binder: kafka
</code>```
```<code>spring.cloud.stream:
  bindings:
    messageProcessor-in-0:
      destination: first-topic
    messageProcessor-out-0:
      destination: first-topic.web-domains
  kafka:
    default:
      consumer:
        properties:
          spring.json.trusted.packages: com.trisha.clients.collection
    bindings:
      messageProcessor-in-0:
        consumer:
          configuration:
            key:
              deserializer: org.apache.kafka.common.serialization.StringDeserializer
            value:
              deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
      messageProcessor-out-0:
        producer:
          configuration:
            key:
              serializer: org.apache.kafka.common.serialization.StringSerializer
            value:
              serializer: org.springframework.kafka.support.serializer.JsonSerializer

</code>```

Body:
java.lang.IllegalArgumentException: The class '[B' is not in the trusted packages: [java.util, java.lang, com.trisha.clients.collection, com.trisha.clients.collection.]. If you believe this class is safe to deserialize, please provide its name. If the serialization is only done by a trusted source, you can also enable trust all ().

Seems it does not like this. please help with right config file

.yml file

server:
  port: 8787

spring.kafka.consumer.properties.spring.json.trusted.packages=*:
spring:
  application:
    name: message-processor
  cloud:
    function:
      definition: messageProcessor
    stream:
      kafka:
        streams:
          binder:
            brokers:
              - localhost:9092
              - localhost:36161
              - localhost :40237
#            auto-create-topics: true
#            consumer-properties:

#      default-binder: kafka

spring.cloud.stream:
  bindings:
    messageProcessor-in-0:
      destination: first-topic
    messageProcessor-out-0:
      destination: first-topic.web-domains
  kafka:
    default:
      consumer:
        properties:
          spring.json.trusted.packages: com.trisha.clients.collection
    bindings:
      messageProcessor-in-0:
        consumer:
          configuration:
            key:
              deserializer: org.apache.kafka.common.serialization.StringDeserializer
            value:
              deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
      messageProcessor-out-0:
        producer:
          configuration:
            key:
              serializer: org.apache.kafka.common.serialization.StringSerializer
            value:
              serializer: org.springframework.kafka.support.serializer.JsonSerializer


问:
how to calculate the Flops of conv2d.init about pytorch
```<code>class Conv2d_init(nn.Conv2d):
    def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode="zeros"):
        super(Conv2d_init, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, padding_mode)

    def reset_parameters(self):
        init.xavier_normal_(self.weight)
        if self.bias is not None:
            fan_in, _ = init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / math.sqrt(fan_in)
            init.uniform_(self.bias, -bound, bound)
</code>```
```<code>class SegDecNet(nn.Module):
    def __init__(self, device, input_width, input_height, input_channels):
        super(SegDecNet, self).__init__()
        self.vo=Conv2d_init(in_channels=3, out_channels=256,kernel_size=5, padding=2, bias=False)
        self.vo2=Conv2d_init(in_channels=256, out_channels=512,kernel_size=5, padding=2, bias=False)
        #self.vo=nn.Conv2d(3,256,kernel_size=5,stride=1,padding=2)
        #self.vo2=nn.Conv2d(256,512,kernel_size=5,stride=1,padding=2)
    def forward(self, input):
        x=self.vo(input)
        x=self.vo2(x)
        return x
</code>```
```<code>
</code>```

from torch import nn as nn
import torch
from torch.nn import init
from ptflops import get_model_complexity_info

```<code>
if __name__ == '__main__':
    model = SegDecNet(1,640,232,3)
    model = model.cuda(0)
    input= torch.rand(1, 3, 640, 232 ).cuda(0)
    model_name="aaa"
    flops, params = get_model_complexity_info(model, (3,640,232),as_strings=True,print_per_layer_stat=True)
    print("%s |%s |%s" % (model_name,flops,params))
    '''time_sum_all=0
</code>```
```<code>when i use the above code,i found use conv2d.init,the Flops is zero.use nn.conv2d Flops is 500 GMac.
</code>```

how do i calculate the Flops of conv2d.init, or the Flops is zero is true?

Body:
class Conv2d_init(nn.Conv2d):
    def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode="zeros"):
        super(Conv2d_init, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, padding_mode)

    def reset_parameters(self):
        init.xavier_normal_(self.weight)
        if self.bias is not None:
            fan_in, _ = init._calculate_fan_in_and_fan_out(self.weight)
            bound = 1 / math.sqrt(fan_in)
            init.uniform_(self.bias, -bound, bound)

class SegDecNet(nn.Module):
    def __init__(self, device, input_width, input_height, input_channels):
        super(SegDecNet, self).__init__()
        self.vo=Conv2d_init(in_channels=3, out_channels=256,kernel_size=5, padding=2, bias=False)
        self.vo2=Conv2d_init(in_channels=256, out_channels=512,kernel_size=5, padding=2, bias=False)
        #self.vo=nn.Conv2d(3,256,kernel_size=5,stride=1,padding=2)
        #self.vo2=nn.Conv2d(256,512,kernel_size=5,stride=1,padding=2)
    def forward(self, input):
        x=self.vo(input)
        x=self.vo2(x)
        return x

from torch import nn as nn
import torch
from torch.nn import init
from ptflops import get_model_complexity_info

if __name__ == '__main__':
    model = SegDecNet(1,640,232,3)
    model = model.cuda(0)
    input= torch.rand(1, 3, 640, 232 ).cuda(0)
    model_name="aaa"
    flops, params = get_model_complexity_info(model, (3,640,232),as_strings=True,print_per_layer_stat=True)
    print("%s |%s |%s" % (model_name,flops,params))
    '''time_sum_all=0

when i use the above code,i found use conv2d.init,the Flops is zero.use nn.conv2d Flops is 500 GMac.

how do i calculate the Flops of conv2d.init, or the Flops is zero is true?


问:
how to print base64 docx file javascript
I get encoded to base64 docx file from server and I want to print it. So far I found only this solution:

```<code>export const base64ToArrayBuffer = (data: string) => {
  const bString = window.atob(data);
  const bLength = bString.length;
  let bytes = new Uint8Array(bLength);
  for (let i = 0; i < bLength; i++) {
    const ascii = bString.charCodeAt(i);
    bytes[i] = ascii;
  }
  return bytes;
};

export const printBase64Contract = (base64: string) => {
  const content = base64ToArrayBuffer(base64);
  const blob = new Blob([content], {
    type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  });

  const url = window.URL.createObjectURL(blob);

  const iframe = document.createElement("iframe");
  iframe.style.display = "none";
  iframe.src = url;
  iframe.className = "contract-to-print";
  document.body.appendChild(iframe);
  iframe.contentWindow?.print();
  document.body.removeChild(iframe);
};
</code>```

But it prints only empty file. I've been searching on web for this problem but there is not much information on printing docx files

Body:
I get encoded to base64 docx file from server and I want to print it. So far I found only this solution:

export const base64ToArrayBuffer = (data: string) => {
  const bString = window.atob(data);
  const bLength = bString.length;
  let bytes = new Uint8Array(bLength);
  for (let i = 0; i < bLength; i++) {
    const ascii = bString.charCodeAt(i);
    bytes[i] = ascii;
  }
  return bytes;
};

export const printBase64Contract = (base64: string) => {
  const content = base64ToArrayBuffer(base64);
  const blob = new Blob([content], {
    type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  });

  const url = window.URL.createObjectURL(blob);

  const iframe = document.createElement("iframe");
  iframe.style.display = "none";
  iframe.src = url;
  iframe.className = "contract-to-print";
  document.body.appendChild(iframe);
  iframe.contentWindow?.print();
  document.body.removeChild(iframe);
};

But it prints only empty file. I've been searching on web for this problem but there is not much information on printing docx files


问:
Pandas-I want to break a line based on a specific character

en
ko

Other specified bursopathies, toes
기타 명시된 윤활낭병증, 발가락

Other specified bursopathies, ankle joint
기타 명시된 윤활낭병증, 발목관절

=>

en
ko

Other specified bursopathies
기타 명시된 윤활낭병증

toes
발가락

Other specified bursopathies
기타 명시된 윤활낭병증

ankle joint
발목관절

I haven't been able to solve it for 2 days. Help!


问:
Innodb not supported in mariadb Wamp
I installed wamp v3.2.6
having mariadb 10.6.5 I am unable to enable innodb even from my.ini file.

Title: Innodb not supported in mariadb Wamp


问:
Is it problematic to use a user ID as an array index when looping in VueJS where multiple points of user input are associated by that ID?
A couple of times, I've designed systems where I need multiple inputs generated in a loop, which will take data stored against that entity's records. Hence, I use the entity's ID as an array key for the referencing.

In example:

    ...

            @{{ member.name }}
            @{{ member.email }}

                <input type="text" v-model="emp_codes[member.id]" />

                <input type="text" v-model="emp_cats[member.id]" />

```

This creates arrays with user ID indexes ([member.id]). This works, but I could see issues arising from this over time & database growth (large IDs as array index causing memory issues in browsers?).

It seems hacky, I'd like to know if there's a better way. Thanks!

Body:
A couple of times, I've designed systems where I need multiple inputs generated in a loop, which will take data stored against that entity's records. Hence, I use the entity's ID as an array key for the referencing.

In example:

    ...

            @{{ member.name }}
            @{{ member.email }}

                <input type="text" v-model="emp_codes[member.id]" />

                <input type="text" v-model="emp_cats[member.id]" />

This creates arrays with user ID indexes ([member.id]). This works, but I could see issues arising from this over time & database growth (large IDs as array index causing memory issues in browsers?).

It seems hacky, I'd like to know if there's a better way. Thanks!


问:
Repeated column in mapping for collection: Model.DebitAccount.transactions column: idTransaction
I am working on a small project and I encountered the following error:
Repeated column in mapping for collection: Model.DebitAccount.transactions column: idTransaction

Here is my Account class:

```<code>@MappedSuperclass
public abstract class Account implements AccountTransaction {
    //@Transient
    private String ownerCNP;
    @Id
    private String IBAN;
    private double currentBalance;
    private LocalDate expirationDate;
    @ManyToMany(mappedBy = "idTransaction")
    private List<Transaction> transactions;
    public Account(String ownerCNP, String IBAN) {
        this.ownerCNP = ownerCNP;
        this.IBAN = IBAN;
        this.currentBalance = 0;
        this.expirationDate = LocalDate.now().plusYears(4);
        this.transactions = new ArrayList<>();

</code>```

Here is my DebitAccount:

```<code>@Entity
public class DebitAccount extends Account {

    @ManyToOne
    @JoinColumn(name = "currency_currency_name")
    private Currency currency;
    protected static final String ANSI_YELLOW_FONT = "\u001B[33m";
    protected static final String ANSI_RESET = "\u001B[0m";

    public DebitAccount(String ownerCNP, String IBAN, Currency currency) {
        super(ownerCNP, IBAN);
        this.currency = currency;
    }

    public DebitAccount() {
        super();
    }
</code>```

I understand the meaning of the error, the DebitAccount class is creating the idTransaction field again, but i cant seem to figure out a way to stop this from happening

Body:
I am working on a small project and I encountered the following error:
Repeated column in mapping for collection: Model.DebitAccount.transactions column: idTransaction

Here is my Account class:

@MappedSuperclass
public abstract class Account implements AccountTransaction {
    //@Transient
    private String ownerCNP;
    @Id
    private String IBAN;
    private double currentBalance;
    private LocalDate expirationDate;
    @ManyToMany(mappedBy = "idTransaction")
    private List<Transaction> transactions;
    public Account(String ownerCNP, String IBAN) {
        this.ownerCNP = ownerCNP;
        this.IBAN = IBAN;
        this.currentBalance = 0;
        this.expirationDate = LocalDate.now().plusYears(4);
        this.transactions = new ArrayList<>();

Here is my DebitAccount:

@Entity
public class DebitAccount extends Account {

    @ManyToOne
    @JoinColumn(name = "currency_currency_name")
    private Currency currency;
    protected static final String ANSI_YELLOW_FONT = "\u001B[33m";
    protected static final String ANSI_RESET = "\u001B[0m";

    public DebitAccount(String ownerCNP, String IBAN, Currency currency) {
        super(ownerCNP, IBAN);
        this.currency = currency;
    }

    public DebitAccount() {
        super();
    }

I understand the meaning of the error, the DebitAccount class is creating the idTransaction field again, but i cant seem to figure out a way to stop this from happening


问:
How to use docker to create a two-stage virtual network on a host
I want to use docker to simulate the network attack and defense on one host. My network needs several switches and they connect as a ring. Then some nodes (use docker container) are connected to each switch. The node can communicate via the switch. A topology is illustrated as bellow. In addition, I need to scan the ports or grab data packets when communicating and so on.
I don't if use docker can't achieve this and if it can, how can I do it?

Docker network command seems to be useful but I never see similar example to create a such a "complex" network.


问:
Undesired links between different instances of a shiny app
I have a shiny app running in a docker container deployed at https://fz-mapme.test.sixmarkets.net/ . So far, it is just a prototype, so don't look to closely at the app. :-)

My problem: If I open an instance A of the app and a second instance B, then data selection in A affects B which is not a desired behavior.

The app is built using the golem package and shares objects between modules by using global.R and reactiveValues(). So far, I thought that wouldn't be a problem because each running app would get an own environment. But that seems not to be correct. Any ideas?

Why does such an behavior arise? How can I solve my problem? What is best practice for sharing data between modules?


问:
OAuth and integration with the G suite
I have a DRF and Vue web application that uses OAuth for authentication via the drf-social-oauth2 package.

Essentially, authentication goes like this:

the user logs in with their Google account and gets a token from Google

the frontend application issues a request to the convert-token token of my backend, which validates the Google token and issues an in-house token, which is also saved to my database

from then on, the frontend application will include that in-house token in each subsequent request to my backend

if that's the first time the user authenticates, a new account is created on my backend. This means that my backend, understandably, manages its own set of user accounts, which conceptually are twins of the Google accounts used to log-in.

I'm now looking to integrate some Google applications into my webapp. To give a very simple example, I'd like to include a functionality that allows accessing Google slides and docs from the frontend of my app. Integration with those services is  based, so essentially I'd be embedding some iframes to access the resources on the G suite.

Here's the issue: since, like I explained, requests to my backend are authenticated using an in-house token and not a Google token, what could happen is a user might be accessing my website using as a certain user X (which, in reality, would just be my "twin" of X as an in-house user account, but that's transparent to the user, who will think they are logged in "with their Google account"), but they might've logged in to Google with another account, resulting in them accessing the embedded resource with a different identity than the one they're using for my website.

This could have pretty bad consequences if, for example, the publisher of that content on my website only allowed certain accounts to access it: an authorized user might fail to be able to access the content and not understand why, since they'd seemingly be using the correct identity.

Is there a better alternative to have a more "uniform" management of authentication and keep in sync what account the user is logged in with Google and what they're using for my website?

Title: OAuth and integration with the G suite


问:
java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available,[Spring Boot 2 jdbctemplate)
I have a small web app based on spring boot 2 with jdbctempalate for mysql connection. I do have jpa but there is a specific controller that uses the autowired jdbctemplate (within service component). When the controller is invoked from view a number of times, the jdbcconnections are timing out due to unavailable connections from the pool. I think Hikari pool connections are running out and a new connection could not be made.

Do you have any suggestions as to how can I close the jdbctemplate connections effectively (I don't see an explicit method to do this within the service component).
autowired jt invoked as below:
Map<String, Object> queryResult = jt.queryForMap(Sql,
new Object[] { list1.get(k).getS() });

Thanks.

Edit: After doing the investigation, I have understood that this issue is caused by entityManager connection (and not by jdbctemplate). EMF is an autowired object and em is a local variable create to execute the native query. You might ask why can't I use jpa repo methods to execute the sql. The reason why do that is to understand how emf can be used to execute the queries on tables that do not map to an entity within my app.

Does anyone know why the entity manager initiated connections are not closed by spring automatically? I ran the trace and found the leak on the em connections. I think the connection is managed by the spring container and not by the app. any thoughts on this?

If anyone suggest that em connections are not supported to execute the native sqls, then I'm OK with that. I can move to jdbctemplate for this purpose but I want to understand why can't EM be used for this purpose. thanks.


问:
Magento 2 - UI Component doesn't pass parameter to mui/index/render when rendering InsertListing component
I have a form that in one of fieldsets contains insertListing component.

```<code><fieldset name="invoice">
        <settings>
            <label translate="true">Invoices</label>
        </settings>
        <insertListing name="invoice_listing">
            <settings>
                <dataLinks>
                    <exports>true</exports>
                    <imports>false</imports>
                </dataLinks>
                <externalProvider>invoice_listing.invoice_listing_data_source</externalProvider>
                <autoRender>true</autoRender>
                <dataScope>invoice_listing</dataScope>
                <ns>invoice_listing</ns>
            </settings>
        </insertListing>
    </fieldset>
</code>```

I want to pass param suborder_id that exists in form DataProvider to this insertListing component. I've done with adding filterUrlParams to listing dataSource but request doesn't contain suborder_id in its params.

Could you show me what am I doing wrong?

Body:
I have a form that in one of fieldsets contains insertListing component.

<fieldset name="invoice">
        <settings>
            Invoices
        </settings>
        <insertListing name="invoice_listing">
            <settings>
                <dataLinks>
                    <exports>true</exports>
                    <imports>false</imports>
                </dataLinks>
                <externalProvider>invoice_listing.invoice_listing_data_source</externalProvider>
                <autoRender>true</autoRender>
                <dataScope>invoice_listing</dataScope>
                <ns>invoice_listing</ns>
            </settings>
        </insertListing>
    </fieldset>

I want to pass param suborder_id that exists in form DataProvider to this insertListing component. I've done with adding filterUrlParams to listing dataSource but request doesn't contain suborder_id in its params.

Could you show me what am I doing wrong?


问:
Is it possible to programmatically trigger the microphone button on a mobile keyboard?
My problem is that I need to implement speech recognition with continuous listening. Hence, the Speech Recognition API is not an option because continuous listening with it on a mobile device is is generally not supported as the microphone constantly turns on and off.

Also tried to work around this by initiating it with continuous:false and turning it back on as soon as it ends:

```<code>const recognition = new SpeechRecognition();
recognition.continuous = false;
recognition.onend= (event) => {recognition.start();}
recognition.start();
</code>```

But it's no use.

Been wondering if it's possible to turn the microphone on a mobile keyboard on as soon as the keyboard opens.

Body:
My problem is that I need to implement speech recognition with continuous listening. Hence, the Speech Recognition API is not an option because continuous listening with it on a mobile device is is generally not supported as the microphone constantly turns on and off.

Also tried to work around this by initiating it with continuous:false and turning it back on as soon as it ends:

const recognition = new SpeechRecognition();
recognition.continuous = false;
recognition.onend= (event) => {recognition.start();}
recognition.start();

But it's no use.

Been wondering if it's possible to turn the microphone on a mobile keyboard on as soon as the keyboard opens.


问:
How to insert some layers into functional Resnet34 tensorflow model to create a new functional model?
I loaded pretrained Resnet34 model in tensorflow. I want to insert a rescaling layer after the input layer and before the batch normalization layer.

resnet34 summary architecture is as bellow (My Tensorflow version is 2.9.0):

I did that with this part of code, but the new model is not functional model.
I need a new functional model, because after inserting rescaling layer, Also, I want to add some branches in the last convolutional layer of resnet34. I want to see which layer is connected to another layer.

```<code>import tensorflow as tf
tfk = tf.keras
tfkl = tf.keras.layers

from classification_models.tfkeras import Classifiers

resnet_34, preprocess_input = Classifiers.get('resnet34')
resnet_model = resnet_34(include_top=False,
                         weights='imagenet',
                         input_shape=(512, 512, 3))

rescaling_layer = tfkl.experimental.preprocessing.Rescaling(1/255, "rescaling")

for layer in resnet_model.layers:
    layer.trainable = False

seqmodel = tf.keras.Sequential()
seqmodel.add(rescaling_layer)
seqmodel.add(resnet_model)

input_shape = (None, 512, 512, 3)
seqmodel.build(input_shape)
seqmodel.summary()
</code>```

the output of my new model summary is as below which doesn't show me the resnet_model layers detail. Moreover the Connected to column is missed in my new sequential model. I want to see which layer is connected to another layer.

Although, there are some solutions in other stack overflow pages close to my my case, But Those suggestions did not work, the final model of them still was a new sequential model which I don't want.

I will be grateful to see a python gist code as a solution.

Thanks in advance.

Body:
I loaded pretrained Resnet34 model in tensorflow. I want to insert a rescaling layer after the input layer and before the batch normalization layer.

resnet34 summary architecture is as bellow (My Tensorflow version is 2.9.0):

I did that with this part of code, but the new model is not functional model.
I need a new functional model, because after inserting rescaling layer, Also, I want to add some branches in the last convolutional layer of resnet34. I want to see which layer is connected to another layer.

import tensorflow as tf
tfk = tf.keras
tfkl = tf.keras.layers

from classification_models.tfkeras import Classifiers

resnet_34, preprocess_input = Classifiers.get('resnet34')
resnet_model = resnet_34(include_top=False,
                         weights='imagenet',
                         input_shape=(512, 512, 3))

rescaling_layer = tfkl.experimental.preprocessing.Rescaling(1/255, "rescaling")

for layer in resnet_model.layers:
    layer.trainable = False

seqmodel = tf.keras.Sequential()
seqmodel.add(rescaling_layer)
seqmodel.add(resnet_model)

input_shape = (None, 512, 512, 3)
seqmodel.build(input_shape)
seqmodel.summary()

the output of my new model summary is as below which doesn't show me the resnet_model layers detail. Moreover the Connected to column is missed in my new sequential model. I want to see which layer is connected to another layer.

Although, there are some solutions in other stack overflow pages close to my my case, But Those suggestions did not work, the final model of them still was a new sequential model which I don't want.

I will be grateful to see a python gist code as a solution.

Thanks in advance.


问:
Spring Boot - How to disable auto create unused threads when start pod
As the below setting.
When start the service. The server will create 900 threads as max limit.
But all created threads is sleep.

How can I set the server not auto create unused threads? I want it create thread when really have needs and keep using minimum resources.

```<code>spring-open-session-in-view=false
spring.datasource.max-lifetime=10000
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-idle=100
spring.datasource.hikari.idle-timeout=10000
spring.datasource.hikari.maximum-pool-size=900
spring.datasource.hikari.connection-timeout=10000
</code>```

Body:
As the below setting.
When start the service. The server will create 900 threads as max limit.
But all created threads is sleep.

How can I set the server not auto create unused threads? I want it create thread when really have needs and keep using minimum resources.

spring-open-session-in-view=false
spring.datasource.max-lifetime=10000
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-idle=100
spring.datasource.hikari.idle-timeout=10000
spring.datasource.hikari.maximum-pool-size=900
spring.datasource.hikari.connection-timeout=10000


问:
To Add Junit tests in SonarQube
I am not able to view Junit tests in Sonarqube coverage report. We are running the pipeline in bitbucket and  project is based on SAP hybris.

bit-bucket-pipeline.yml

```<code>mage: atlassian/default-image:3
clone:
  lfs: true
pipelines:
  custom:
    qg-sonarqube-main:
      - step:
          name: 'sq init'
          image: atlassian/default-image:3
          script:
            - |
              echo "start notification"
              echo "install java"
              apt update
              apt install -y --no-install-recommends openjdk-11-jdk rsync tree
              java --version
              echo "sonarqube scan of current branch; build dir $BITBUCKET_CLONE_DIR"
              # assembly first
              echo "download scanner-cli"
              wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-     4.7.0.2747.zip -O $BITBUCKET_CLONE_DIR/sonarcli.zip
              unzip -q $BITBUCKET_CLONE_DIR/sonarcli.zip -d $BITBUCKET_CLONE_DIR
              ln -s $BITBUCKET_CLONE_DIR/sonar-scanner-4.7.0.2747/bin/sonar-scanner /bin/sonar-scanner
              /bin/sonar-scanner -v
              echo "hybris ootb assembly"
              unzip -q ootb/CXCOM200500P_27-70004955.ZIP -d $BITBUCKET_CLONE_DIR
              echo "unzip and copy modules"
              unzip -q ootb/modules.zip -d $BITBUCKET_CLONE_DIR/hybris/bin/
              echo "move sonar project configuration"
              mv sonar-project.properties hybris/sonar-project.properties
              echo "node version"
              node -v
              echo "move the customcode"
              mv bin/custom hybris/bin/
              echo "build the box"
              cd hybris/bin/platform
              . ./setantenv.sh
              echo | ant clean
              cd $BITBUCKET_CLONE_DIR
              rsync -vau config/ hybris/config/
              echo "check config dir"
              cd hybris/bin/platform
              ant customize
              echo "copy valid props and localextensions taken from valid assembly"
              ant build all
              echo "scan"
              cd $BITBUCKET_CLONE_DIR/hybris/
              TODAY=$(date +'%d%m%Y')
              echo "code version $BITBUCKET_BUILD_NUMBER.$TODAY"
              /bin/sonar-scanner -Dsonar.login="$SONAR_LOGIN" -Dsonar.projectKey=alcon-"$BITBUCKET_BRANCH" -Dsonar.projectName=alcon-"$BITBUCKET_BRANCH" -Dsonar.projectVersion="$BITBUCKET_BUILD_NUMBER.$TODAY"
              echo "waiting for CE"
              # get ceTaskUrl var
              source .scannerwork/report-task.txt
              # up to 30 min
              for _ in {0..60}; do
              status=$(curl -s -H "Accept: application/json" -u "$SONAR_LOGIN:" $ceTaskUrl | jq -r .task.status)
              case $status in
              SUCCESS)
                  echo "notification about success"
                  echo "Task finished"
                  echo "Project dashboard: $dashboardUrl"
                  exit 0
                  ;;
              PENDING | IN_PROGRESS)
                  echo "Task still in progress"
                  sleep 30
                  ;;
              FAILED)
                  echo "notification about fail"
                  echo Got FAILED task status, exit
                  exit 1
                  ;;
              *)
                  echo "Unsupported task status: $status"
                  sleep 30
                  ;;
              esac
              done
              echo "Project dashboard: $dashboardUrl"
</code>```

====================

Sonar-project.properties:

```<code>sonar.sources=bin/custom/
sonar.sourceEncoding=UTF-8
sonar.pdf.skip=true
sonar.language=java
sonar.java.source=1.8
sonar.java.binaries=bin/custom/
sonar.host.url=https://b2bint.sonarqube.alconcloud.com
</code>```

Title: To Add Junit tests in SonarQube

Body:
I am not able to view Junit tests in Sonarqube coverage report. We are running the pipeline in bitbucket and  project is based on SAP hybris.

bit-bucket-pipeline.yml

mage: atlassian/default-image:3
clone:
  lfs: true
pipelines:
  custom:
    qg-sonarqube-main:
      - step:
          name: 'sq init'
          image: atlassian/default-image:3
          script:
            - |
              echo "start notification"
              echo "install java"
              apt update
              apt install -y --no-install-recommends openjdk-11-jdk rsync tree
              java --version
              echo "sonarqube scan of current branch; build dir $BITBUCKET_CLONE_DIR"
              # assembly first
              echo "download scanner-cli"
              wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-     4.7.0.2747.zip -O $BITBUCKET_CLONE_DIR/sonarcli.zip
              unzip -q $BITBUCKET_CLONE_DIR/sonarcli.zip -d $BITBUCKET_CLONE_DIR
              ln -s $BITBUCKET_CLONE_DIR/sonar-scanner-4.7.0.2747/bin/sonar-scanner /bin/sonar-scanner
              /bin/sonar-scanner -v
              echo "hybris ootb assembly"
              unzip -q ootb/CXCOM200500P_27-70004955.ZIP -d $BITBUCKET_CLONE_DIR
              echo "unzip and copy modules"
              unzip -q ootb/modules.zip -d $BITBUCKET_CLONE_DIR/hybris/bin/
              echo "move sonar project configuration"
              mv sonar-project.properties hybris/sonar-project.properties
              echo "node version"
              node -v
              echo "move the customcode"
              mv bin/custom hybris/bin/
              echo "build the box"
              cd hybris/bin/platform
              . ./setantenv.sh
              echo | ant clean
              cd $BITBUCKET_CLONE_DIR
              rsync -vau config/ hybris/config/
              echo "check config dir"
              cd hybris/bin/platform
              ant customize
              echo "copy valid props and localextensions taken from valid assembly"
              ant build all
              echo "scan"
              cd $BITBUCKET_CLONE_DIR/hybris/
              TODAY=$(date +'%d%m%Y')
              echo "code version $BITBUCKET_BUILD_NUMBER.$TODAY"
              /bin/sonar-scanner -Dsonar.login="$SONAR_LOGIN" -Dsonar.projectKey=alcon-"$BITBUCKET_BRANCH" -Dsonar.projectName=alcon-"$BITBUCKET_BRANCH" -Dsonar.projectVersion="$BITBUCKET_BUILD_NUMBER.$TODAY"
              echo "waiting for CE"
              # get ceTaskUrl var
              source .scannerwork/report-task.txt
              # up to 30 min
              for _ in {0..60}; do
              status=$(curl -s -H "Accept: application/json" -u "$SONAR_LOGIN:" $ceTaskUrl | jq -r .task.status)
              case $status in
              SUCCESS)
                  echo "notification about success"
                  echo "Task finished"
                  echo "Project dashboard: $dashboardUrl"
                  exit 0
                  ;;
              PENDING | IN_PROGRESS)
                  echo "Task still in progress"
                  sleep 30
                  ;;
              FAILED)
                  echo "notification about fail"
                  echo Got FAILED task status, exit
                  exit 1
                  ;;
              *)
                  echo "Unsupported task status: $status"
                  sleep 30
                  ;;
              esac
              done
              echo "Project dashboard: $dashboardUrl"

====================

Sonar-project.properties:

sonar.sources=bin/custom/
sonar.sourceEncoding=UTF-8
sonar.pdf.skip=true
sonar.language=java
sonar.java.source=1.8
sonar.java.binaries=bin/custom/
sonar.host.url=https://b2bint.sonarqube.alconcloud.com


问:
Couldn't connect to mongo DB server (Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error)
I've tried to connect to Mongo for Freecodecamp Back End Development and APIs course. I tried several methods like checking dbPath and removing .sock file, but it keeps showing. Therefore, I investigated more and tried to change the permission but I still couldn't and Im out of idea now. Please checkout how I tried to solve this issue.

Cannot connect to Mongo

Check mongo status. Found 3584 error

Check dbPath

Remove .sock file

5.It reappears when I start mongo

So I checked permission and tried to change it

tried mongod

Please let me know if there's any other way that I can resolve this issue. Thank you for your time.


问:
cann't make Chart when convertting View MVC to PDF
I am trying to convert the output of MVC view to PDF. I could do that by Rotativa pretty good by using this video

https://www.youtube.com/watch?v=VkHcG24nM8U

but there is still a problem. in the view I am creating a radar chart dynamically. which when  the pdf is created it is missing. is it possible to make chart when converting view to PDF file?

This is the code for making Rotativa viewTo PDF

```<code>  public async Task<IActionResult> PrintPDF(long wId, long cId, long pId, long aId, short no)
    {
        var result = await _accessmentFacad.GetAssessmentResultForUserByIdService.Execute(wId, cId, pId, aId, no);

        return new ViewAsPdf("PrintPDF", result)
        {
            FileName ="sample.pdf",
            PageOrientation = Rotativa.AspNetCore.Options.Orientation.Portrait,
            PageSize = Rotativa.AspNetCore.Options.Size.A4,
        };
    }
</code>```

and using this jquery radarchart code for creating the chart

```<code>   <script>

         var BeforeWorkshop = []; //these are javascript array variables
        var AfterWorkshop = [];

        @if(Model.ResultCategoriesDtos.Count>0)
        {
            foreach(var item in Model.ResultCategoriesDtos)
            {
                @:BeforeWorkshop.push(@item.Answer3_1);
                @:AfterWorkshop.push(@item.Answer3_2);
            }
        }

         var RadarChart = document.getElementById('radarchart').getContext('2d');
        var chart = new Chart(RadarChart, {
            type: 'radar',

            data: {
                labels: ["1Lesson", "2Lesson","3Lesson", "4Lesson", "5Lesson"],//x axis labels
                datasets: [{
                    label: "First",
                    data: BeforeWorkshop,
                    fill: true,
                    backgroundColor: 'rgba(255, 99, 132, 0.2)',
                    borderColor: 'rgb(255, 99, 255)',
                    pointBackgroundColor: 'rgb(255, 99, 132)',
                    pointBorderColor: '#fff',
                    pointHoverBackgroundColor: '#fff',
                    pointHoverBorderColor: 'rgb(255, 99, 132)',

                }
                , {
                    label: "Second",
                        data: AfterWorkshop,
                    fill: true,
                    backgroundColor: 'rgba(54, 162, 235, 0.2)',
                    borderColor: 'rgb(54, 162, 235)',
                    pointBackgroundColor: 'rgb(54, 162, 235)',
                    pointBorderColor: '#fff',
                    pointHoverBackgroundColor: '#fff',
                    pointHoverBorderColor: 'rgb(54, 162, 235)'
                }

                ]
            },

            // Configuration options
            options: {
                tooltips: {
                    callbacks: {
                        label: function (tooltipItem, data) {
                            return data.datasets[tooltipItem.datasetIndex].label + ": " + tooltipItem.yLabel;
                        }
                    }
                }
            }
        });
    </script>
</code>```

Body:
I am trying to convert the output of MVC view to PDF. I could do that by Rotativa pretty good by using this video

https://www.youtube.com/watch?v=VkHcG24nM8U

but there is still a problem. in the view I am creating a radar chart dynamically. which when  the pdf is created it is missing. is it possible to make chart when converting view to PDF file?

This is the code for making Rotativa viewTo PDF

  public async Task<IActionResult> PrintPDF(long wId, long cId, long pId, long aId, short no)
    {
        var result = await _accessmentFacad.GetAssessmentResultForUserByIdService.Execute(wId, cId, pId, aId, no);

        return new ViewAsPdf("PrintPDF", result)
        {
            FileName ="sample.pdf",
            PageOrientation = Rotativa.AspNetCore.Options.Orientation.Portrait,
            PageSize = Rotativa.AspNetCore.Options.Size.A4,
        };
    }

and using this jquery radarchart code for creating the chart


问:
VS Code Debugger for Java Dropwizard App throws Class not found error
I have the following dropwizard app: https://github.com/open-metadata/OpenMetadata, which I am trying to run in debug mode in VS Code. I have tried a few setup of my launch.json file including the recommendation from this SO post How to debug a java dropwizard app using Visual Studio Code.

My launch.json file is configured as show below.

{
    "type": "java",
    "name": "Debug (Launch)-OpenMetadataApplication<openmetadata-service>",
    "request": "launch",
    "cwd": "${workspaceFolder}",
    "console": "internalConsole",
    "stopOnEntry": false,
    "mainClass": "org.openmetadata.service.OpenMetadataApplication",
    "classPaths": [
        "path/to/OpenMetadata/openmetadata-dist",
    ],
    "projectName": "openmetadata-service",
    "args": ""
},
{
    "type": "java",
    "name": "Debug (Attach)",
    "request": "attach",
    "hostName": "localhost",
    "port": 8000
},
```
<p>I have also tried a simpler config specifying just the classpath and the main class and  trying to launch the app directly from the debugger (vs launching it first with the mvn debugger and then attaching to it through VS Code debugger). This yields the same error.</p>
<pre class="lang-json prettyprint-override"><code>{
    "type": "java",
    "name": "Debug (Launch)-OpenMetadataApplication<openmetadata-service>",
    "request": "launch",
    "cwd": "${workspaceFolder}",
    "mainClass": "org.openmetadata.service.OpenMetadataApplication",
    "classPaths": [
        "/path/to/OpenMetadata/openmetadata-dist",
    ],
    "projectName": "openmetadata-service",
    "args": ""
},
</code>```

When running the debugger I get a OpenMetadataApplication class not found error. As comparison I am able to successfully run the app in debug mode using IntelliJ -- see screenshot below for IntelliJ config.

Body:
I have the following dropwizard app: https://github.com/open-metadata/OpenMetadata, which I am trying to run in debug mode in VS Code. I have tried a few setup of my launch.json file including the recommendation from this SO post How to debug a java dropwizard app using Visual Studio Code.

My launch.json file is configured as show below.

{
    "type": "java",
    "name": "Debug (Launch)-OpenMetadataApplication<openmetadata-service>",
    "request": "launch",
    "cwd": "${workspaceFolder}",
    "console": "internalConsole",
    "stopOnEntry": false,
    "mainClass": "org.openmetadata.service.OpenMetadataApplication",
    "classPaths": [
        "path/to/OpenMetadata/openmetadata-dist",
    ],
    "projectName": "openmetadata-service",
    "args": ""
},
{
    "type": "java",
    "name": "Debug (Attach)",
    "request": "attach",
    "hostName": "localhost",
    "port": 8000
},

I have also tried a simpler config specifying just the classpath and the main class and  trying to launch the app directly from the debugger (vs launching it first with the mvn debugger and then attaching to it through VS Code debugger). This yields the same error.

{
    "type": "java",
    "name": "Debug (Launch)-OpenMetadataApplication<openmetadata-service>",
    "request": "launch",
    "cwd": "${workspaceFolder}",
    "mainClass": "org.openmetadata.service.OpenMetadataApplication",
    "classPaths": [
        "/path/to/OpenMetadata/openmetadata-dist",
    ],
    "projectName": "openmetadata-service",
    "args": ""
},

When running the debugger I get a OpenMetadataApplication class not found error. As comparison I am able to successfully run the app in debug mode using IntelliJ -- see screenshot below for IntelliJ config.


问:
call DjangoRestFramework DetailAPIView() from another view
solution from @brian-destura below

The DRF test client does not work, but the django.test.client does. Odd (?) because it's a DRF APIView being called.

```<code>    from django.test import Client
    client = Client()
    result = client.get('/api/place/6873947')
    print(result.json)
</code>```

I have a DRF DetailAPIView() that returns a complex serializer json response to external API queries, so in the browser, and via curl etc. http://localhost:8000/api/place/6873947/ returns a big JSON object. All good. The url entry in the 'api' app looks like this

path('place/<int:pk>/', views.PlaceDetailAPIView.as_view(), name='place-detail'),

I need to use that in another, function-based view, so first I tried using both django.test.Client and rest_framework.test.APIClient, e.g.

```<code>from rest_framework.test import APIClient
from django.urls import reverse
client = APIClient()
url = '/api/place/6873947/'
res = client.get(url)
</code>```

That gets an empty result. With django Client:

```<code>from django.test import Client
c=Client()
</code>```

Then

res = c.get('/api/place?pk=6873947')
and

res = c.get('/api/place/', {'pk': 6873947})

Both return "as_view() takes 1 positional argument but 2 were given"

I've tried other approaches in my IDE, picked up in StackOverflow, starting with

```<code>from api.views import PlaceDetailAPIView
pid = 6873947
from django.test import Client
from django.http import HttpRequest
from places.models import Place
request = HttpRequest()
request.method='GET'
request.GET = {"pk": pid}
</code>```

Then

res = PlaceDetailAPIView.as_view({"pk": pid})

"as_view() takes 1 positional argument but 2 were given"

res = PlaceDetailAPIView.as_view()(request=request)

"Expected view PlaceDetailAPIView to be called with a URL keyword argument named "pk". Fix your URL conf, or set the .lookup_field attribute on the view correctly"

res = PlaceDetailAPIView.as_view()(request=request._request)

"HttpRequest' object has no attribute '_request"

I must be missing something basic, but hours of thrashing has gotten me nowhere - ideas?

Body:
solution from @brian-destura below

The DRF test client does not work, but the django.test.client does. Odd (?) because it's a DRF APIView being called.

    from django.test import Client
    client = Client()
    result = client.get('/api/place/6873947')
    print(result.json)

I have a DRF DetailAPIView() that returns a complex serializer json response to external API queries, so in the browser, and via curl etc. http://localhost:8000/api/place/6873947/ returns a big JSON object. All good. The url entry in the 'api' app looks like this

path('place/<int:pk>/', views.PlaceDetailAPIView.as_view(), name='place-detail'),

I need to use that in another, function-based view, so first I tried using both django.test.Client and rest_framework.test.APIClient, e.g.

from rest_framework.test import APIClient
from django.urls import reverse
client = APIClient()
url = '/api/place/6873947/'
res = client.get(url)

That gets an empty result. With django Client:

from django.test import Client
c=Client()

Then

res = c.get('/api/place?pk=6873947')
and

res = c.get('/api/place/', {'pk': 6873947})

Both return "as_view() takes 1 positional argument but 2 were given"

I've tried other approaches in my IDE, picked up in StackOverflow, starting with

from api.views import PlaceDetailAPIView
pid = 6873947
from django.test import Client
from django.http import HttpRequest
from places.models import Place
request = HttpRequest()
request.method='GET'
request.GET = {"pk": pid}

Then

res = PlaceDetailAPIView.as_view({"pk": pid})

"as_view() takes 1 positional argument but 2 were given"

res = PlaceDetailAPIView.as_view()(request=request)

"Expected view PlaceDetailAPIView to be called with a URL keyword argument named "pk". Fix your URL conf, or set the .lookup_field attribute on the view correctly"

res = PlaceDetailAPIView.as_view()(request=request._request)

"HttpRequest' object has no attribute '_request"

I must be missing something basic, but hours of thrashing has gotten me nowhere - ideas?


问:
Question regarding Arabic on Google Mlkit
I have a question about harakah on Arabic language, the result that i get from MLKIT doesn't provide arabic with harakah in its text, only arabic without it.

I tried making a feature for my flutter app, and it needs to recognize arabic words from gesture that user paint. So I use google_mlkit_digital_ink_recognition, The example works great, i downloaded arabic model but the problem is it cannot read arabic word with harakah that i input (paint) in the screen. I tried reading documentation and search about this but no dice.

The result that i get is only arabic without harakah, and the feature i plan to make need it. Backend will send a text (1 to 4 arabic alphabet with or without harakah) and user need to paint it on the screen, MLKIT will recognize the strokes user made and then the app will decide if what user paint is correct or not, this is what i plan to make. Is there a way for MLKIT digital ink to input and output arabic with harakah with this plugin? Is there alternative or a better way to handle this? or do i need to make and train a custom modal for this? or am i missing something that needs to be done first?

There are some app that i see in google play that's a bit similiar, i think i can achieve similiar result like the apps i see with clipper and path but they don't have harakah on it, the app need to know if it's correct or not, and the text that i need to match comes from backend which may vary and more complicated. There's other alternatives that i thought, instead of text backend send me an image, use scribble to generate image on what user paint, then match it with image from backend with image_compare, but i'm not sure since i haven't tried it yet. The chance of getting them right when matching might be low and this will burden other team since they need to make the image one by one instead of just text. Right now, the fastest way i can think of is using MLKIT since i need to work on this feature this late month or early next month. I hope you guys can help, Thanks.


问:
Maven multimodule project - parallel run of unit tests
I have a multi-module Maven project that consists of ~30 modules. 4 of these modules contains a large number of junit tests in separate testcases, so when I'm running tests all modules except these are executed quickly, but each of these modules running separately could take several minutes. What I want to achieve is

When project is compiled I want to use as much threads as CPUs available (-T1C)

When tests are running I want to use as much threads as CPUs available, and I want to run testcases in all modules as parallel as possible, but not more than number of CPUs. If I just run tests with -T1C it assign thread per module, so tests inside long-running modules are not running in parallel. But if I set forkCount=1C in long-running modules each of them occupies as many threads as CPUs are, so when all of them are running CPUs are overused. I know that I can set up something like forkCount=0.5C but in this case it will be required to manually adjust these numbers.

So is it a way to specify some build-level limitation having everything else as parallel as possible?

Thanks.


问:
Flutter, using Streambuilder inside endDrawer?
I have some challanges getting my data from Firestore inside my endDrawer.
I am using a StreamBuilder to fetch my data, and this is working outside of my endDrawer. It returns the text 'No alerts', so it returns null.

Here is my code:

```<code>endDrawer: Container(
          padding: EdgeInsets.only(top: appBarHeight + 1),
          child: Drawer(
            child: Column(
              children: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: const Text('Alerts',
                    style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),),
                ),
                Divider(),
                SingleChildScrollView(
                  child: StreamBuilder(
                      stream: _notifications,
                      builder: (BuildContext context,
                          AsyncSnapshot<QuerySnapshot> snapshot) {
                        if (!snapshot.hasData) {
                          return const Text ('No alerts');
                        }
                        if (snapshot.connectionState ==
                            ConnectionState.waiting) {
                          return const Text('Please wait...');
                        }

                        return ListView.builder(
                          padding: const EdgeInsets.only(bottom: 50),
                          physics: const NeverScrollableScrollPhysics(),
                          shrinkWrap: true,
                          itemCount: snapshot.data!.docs.length,
                          itemBuilder: (context, index) {
                            DocumentSnapshot documentsnapshot = snapshot.data!
                                .docs[index];

                            var details  = documentsnapshot['Details'];

                            return GestureDetector(
                              onTap: () {
                                print(documentsnapshot['Name']);

                              },
                              child: Card(
                                child: Padding(
                                  padding: const EdgeInsets.all(8.0),
                                  child: Column(
                                    children: [
                                      if (details == 'Service') Row(

                                        children: [
                                          Text(documentsnapshot['Info'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                          Text(' '),
                                          Text(documentsnapshot['Name'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                        ],
                                      ),
                                      if(details == 'Error') Row(
                                        children: [
                                          Text(documentsnapshot['Info'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                          Text(' '),
                                          Text(documentsnapshot['Name'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                        ],
                                      ),
                                      if(details == 'Broken') Row(
                                        children: [
                                          Text(documentsnapshot['Name'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                          Text(' '),
                                          Text(documentsnapshot['Info'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                        ],
                                      )
                                    ],
                                  ),
                                ),
                              ),
                            );
                          },

                        );
                      }
                  ),
                ),
              ],
            ),

          ),
        ),
</code>```

Here is my stream:

```<code>final Stream<QuerySnapshot> _notifications = FirebaseFirestore.instance
  .collection('notifications').snapshots();
</code>```

Body:
I have some challanges getting my data from Firestore inside my endDrawer.
I am using a StreamBuilder to fetch my data, and this is working outside of my endDrawer. It returns the text 'No alerts', so it returns null.

Here is my code:

endDrawer: Container(
          padding: EdgeInsets.only(top: appBarHeight + 1),
          child: Drawer(
            child: Column(
              children: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: const Text('Alerts',
                    style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),),
                ),
                Divider(),
                SingleChildScrollView(
                  child: StreamBuilder(
                      stream: _notifications,
                      builder: (BuildContext context,
                          AsyncSnapshot<QuerySnapshot> snapshot) {
                        if (!snapshot.hasData) {
                          return const Text ('No alerts');
                        }
                        if (snapshot.connectionState ==
                            ConnectionState.waiting) {
                          return const Text('Please wait...');
                        }

                        return ListView.builder(
                          padding: const EdgeInsets.only(bottom: 50),
                          physics: const NeverScrollableScrollPhysics(),
                          shrinkWrap: true,
                          itemCount: snapshot.data!.docs.length,
                          itemBuilder: (context, index) {
                            DocumentSnapshot documentsnapshot = snapshot.data!
                                .docs[index];

                            var details  = documentsnapshot['Details'];

                            return GestureDetector(
                              onTap: () {
                                print(documentsnapshot['Name']);

                              },
                              child: Card(
                                child: Padding(
                                  padding: const EdgeInsets.all(8.0),
                                  child: Column(
                                    children: [
                                      if (details == 'Service') Row(

                                        children: [
                                          Text(documentsnapshot['Info'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                          Text(' '),
                                          Text(documentsnapshot['Name'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                        ],
                                      ),
                                      if(details == 'Error') Row(
                                        children: [
                                          Text(documentsnapshot['Info'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                          Text(' '),
                                          Text(documentsnapshot['Name'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                        ],
                                      ),
                                      if(details == 'Broken') Row(
                                        children: [
                                          Text(documentsnapshot['Name'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                          Text(' '),
                                          Text(documentsnapshot['Info'], style: TextStyle(
                                            fontSize: 10,
                                          ),),
                                        ],
                                      )
                                    ],
                                  ),
                                ),
                              ),
                            );
                          },

                        );
                      }
                  ),
                ),
              ],
            ),

          ),
        ),

Here is my stream:

final Stream<QuerySnapshot> _notifications = FirebaseFirestore.instance
  .collection('notifications').snapshots();


问:
How to remove tooltip on mouse hover in Wordpress website?
How I can remove the tooltip text on mouse hover. Here is a screenshot of the problem.

The website URL: https://zsgamings.com/

any help would be great.


问:
How to create a login/sign up page in WordPress as the front page

Essentially, what I am trying to do is to have a login/sign-up page at the front of my website. This means someone has to either log in or sign-up first before accessing the rest of the website. Exactly like how Facebook has done it on its website.

The login and sign-up forms work, however, the user's account is not displayed at the top bar navigation even after signing up.

I am using the Forminator plugin and can't figure out how to do this. I have already created the forms. I also do not want to pay for any pro version of a plugin at the moment.
I also tried to look for a solution to try and display the user's account profile on the top bar navigation but have found no solution as well.
I am willing to use any different plugins if they will help me solve the issue.


问:
Algolia disjunctiveFacets routing
I have been looking at this example of disjunctiveFacets https://l7tzs.csb.app/ and the code

https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/vue-instantsearch/query-suggestions?file=/src/App.vue

According to the docs you can define the facet like this

instantsearch.widgets.refinementList({
  container: '#brand-list',
  attribute: 'brand',
  limit: 10,
  showMore: true,
  searchable: true,
  searchablePlaceholder: 'Search for a brand',
  searchableIsAlwaysActive: true,
  disjunctiveFacets: ['Appliances', 'Cell Phones'],
})
```

I have dedicated pages for various categories for Appliances and Cell Phones so when a search result looks like this

i want to be able to navigate to the Appliances category url for instance. How can i do that and also pass the drop down data to my dedicated page?

Title: Algolia disjunctiveFacets routing

Body:
I have been looking at this example of disjunctiveFacets https://l7tzs.csb.app/ and the code

https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/vue-instantsearch/query-suggestions?file=/src/App.vue

According to the docs you can define the facet like this

instantsearch.widgets.refinementList({
  container: '#brand-list',
  attribute: 'brand',
  limit: 10,
  showMore: true,
  searchable: true,
  searchablePlaceholder: 'Search for a brand',
  searchableIsAlwaysActive: true,
  disjunctiveFacets: ['Appliances', 'Cell Phones'],
})

I have dedicated pages for various categories for Appliances and Cell Phones so when a search result looks like this

i want to be able to navigate to the Appliances category url for instance. How can i do that and also pass the drop down data to my dedicated page?


问:
How to close and transfer all SOL balance programatically without reserving the rent?
I have a Solana account A which is a fee payer, and another Solana account B with some SOL balance, I want to close and transfer all account B's SOL balance to another account C. How do I do that?

I saw the following error:

```<code>SendTransactionError: failed to send transaction: Transaction simulation failed: Transaction results in an account (1) without insufficient funds for rent
</code>```

The code:

```<code>const lamports = await connection.getBalance(account_b_public_key);
const transaction = new solana.Transaction();
transaction.add(solana.SystemProgram.transfer({
    fromPubkey: account_b_public_key,
    toPubkey: account_c_public_key,
    lamports: lamports,
}));
transaction.feePayer = account_a_public_key;
const signature = await solana.sendAndConfirmTransaction(connection, transaction, [account_a_signer, account_b_signer]);

</code>```

I know something is missing there, but I cannot find an interface to close account B and send all SOL balances to another account.

Body:
I have a Solana account A which is a fee payer, and another Solana account B with some SOL balance, I want to close and transfer all account B's SOL balance to another account C. How do I do that?

I saw the following error:

SendTransactionError: failed to send transaction: Transaction simulation failed: Transaction results in an account (1) without insufficient funds for rent

The code:

const lamports = await connection.getBalance(account_b_public_key);
const transaction = new solana.Transaction();
transaction.add(solana.SystemProgram.transfer({
    fromPubkey: account_b_public_key,
    toPubkey: account_c_public_key,
    lamports: lamports,
}));
transaction.feePayer = account_a_public_key;
const signature = await solana.sendAndConfirmTransaction(connection, transaction, [account_a_signer, account_b_signer]);

I know something is missing there, but I cannot find an interface to close account B and send all SOL balances to another account.


问:
Why does my regex not work in iOS for quote marks?
```<code>var regExp = /[\{\}\[\]\/|~`^\+┼<>@\$&\‘\"\'\“\=]/gi;
</code>```

When entering double and single quotation marks in the ios environment, regular expressions are not accepted.

Is there something wrong with my regular expression?

Example:

```<code>$(".chkspchar").keyup(function(){
                    var regExp = /[\{\}\[\]\/|~`^\+┼<>@\$&\‘\"\'\“\=]/gi;
                    var spaceExp = /\s{2,}/gi;
                    var ipt = this;
                    if(regExp.test($(ipt).val()) || spaceExp.test($(ipt).val())){
                        $(".chkspchar").blur();
                        UI.msg.alert("; : , . ? ! - _ ( ) * % # " ,function() {
                            var inputStr = $(ipt).val().substring(0, $(ipt).val().length-1);
                            $(ipt).val(inputStr);
                            UI.msg.close();
                        });

                    }
                });
</code>```

Body:
var regExp = /[\{\}\[\]\/|~`^\+┼<>@\$&\‘\"\'\“\=]/gi;

When entering double and single quotation marks in the ios environment, regular expressions are not accepted.

Is there something wrong with my regular expression?

Example:

$(".chkspchar").keyup(function(){
                    var regExp = /[\{\}\[\]\/|~`^\+┼<>@\$&\‘\"\'\“\=]/gi;
                    var spaceExp = /\s{2,}/gi;
                    var ipt = this;
                    if(regExp.test($(ipt).val()) || spaceExp.test($(ipt).val())){
                        $(".chkspchar").blur();
                        UI.msg.alert("; : , . ? ! - _ ( ) * % # " ,function() {
                            var inputStr = $(ipt).val().substring(0, $(ipt).val().length-1);
                            $(ipt).val(inputStr);
                            UI.msg.close();
                        });

                    }
                });


问:
xjc - Error resolving component 'xsi:type'
I am writing an XSD file to automatically generate Java classes to parse an XML file like this:

<pipeline:Pipeline
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:pipeline="http://www.intershop.de/pipeline/2010"
    name="ViewCheckoutReview" type="view"
>
  <nodes xsi:type="pipeline:Text" nodeID="Text0"/>
</pipeline:Pipeline>
```
<p>I'm having issues when unmarshalling the <code>xsi:type</code> attribute on the <code><nodes></code> element.</p>
<p>These are my XSD files:</p>
<p><code>schema0.xsd</code>:</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8"?>
<xs:schema
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:pipeline="http://www.intershop.de/pipeline/2010"
    attributeFormDefault="unqualified"
    elementFormDefault="qualified"
    targetNamespace="http://www.intershop.de/pipeline/2010"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
    <xs:import schemaLocation="schema1.xsd" />
    <xs:element name="Pipeline">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="nodes" />
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="type" type="xs:string" use="required" />
        </xs:complexType>
    </xs:element>
</xs:schema>
</code>```

schema1.xsd:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
    attributeFormDefault="unqualified"
    elementFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
    <xs:element name="nodes">
        <xs:complexType>
            <xs:attribute name="nodeID" type="xs:string" use="required" />
            <xs:attribute ref="xsi:type" use="required" />
        </xs:complexType>
    </xs:element>
</xs:schema>
```
<p>When I execute <code>xjc</code> using these XSD I get this error:</p>
```[ant:jaxb] parsing a schema...
[ant:jaxb] [ERROR] src-resolve.4.2: Error resolving component 'xsi:type'. It was detected that 'xsi:type' is in namespace 'http://www.w3.org/2001/XMLSchema-instance', but components from this namespace are not referenceable from schema document 'file:/C:/Projects/test/xsd/schema1.xsd'. If this is the incorrect namespace, perhaps the prefix of 'xsi:type' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/C:/Projects/test/xsd/schema1.xsd'.
[ant:jaxb]   line 12 of file:/C:/Projects/test/xsd/schema1.xsd
[ant:jaxb]
[ant:jaxb] [ERROR] src-resolve: Cannot resolve the name 'xsi:type' to a(n) 'attribute declaration' component.
[ant:jaxb]   line 12 of file:/C:/Projects/test/xsd/schema1.xsd
[ant:jaxb]
[ant:jaxb] Failed to parse a schema.
```
<p>I have found a possible solution here on StackOverflow, which consists in adding the <code>namespace</code> attribute in the <code>@XmlAttribute</code> annotation of the generated Java class' field:</p>
<pre class="lang-java prettyprint-override"><code>@XmlAttribute(name = "type", required = true, namespace = "http://www.w3.org/2001/XMLSchema-instance")
protected String type;
</code>```

and changing schema1.xsd like this:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
        attributeFormDefault="unqualified"
        elementFormDefault="qualified"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
    <xs:element name="nodes">
        <xs:complexType>
            <xs:attribute name="nodeID" type="xs:string" use="required" />

            <xs:attribute name="type" type="xs:string" use="required" />
        </xs:complexType>
    </xs:element>
</xs:schema>
```
<p>This solution works but I don't like it, because I would need to change <strong>manually, every time I run <code>xjc</code></strong>, the generated Java classes to add that <code>namespace</code> attribute.</p>
<p>What I would like instead is to put something in the XSD file (or in a XJB file maybe?) which adds that <code>namespace</code> attribute automatically when I run <code>xjc</code>.</p>
<p>If I don't add that <code>namespace</code> attribute on the <code>@XmlAttribute</code> annotation, value of <code>type</code> attribute is always <code>null</code>:</p>
<pre class="lang-java prettyprint-override"><code>public static void main(String[] args) throws JAXBException
{
    File xmlFile = new File("D:\\temp\\test.xml");
    JAXBContext jaxbContext = JAXBContext.newInstance(Pipeline.class);
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    Pipeline pipeline = (Pipeline) unmarshaller.unmarshal(xmlFile);
    Nodes node = pipeline.getNodes();

    System.out.println(node.getType()); // prints null
}
</code>```

Body:
I am writing an XSD file to automatically generate Java classes to parse an XML file like this:

<pipeline:Pipeline
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:pipeline="http://www.intershop.de/pipeline/2010"
    name="ViewCheckoutReview" type="view"
>
  <nodes xsi:type="pipeline:Text" nodeID="Text0"/>
</pipeline:Pipeline>

I'm having issues when unmarshalling the xsi:type attribute on the <nodes> element.

These are my XSD files:

schema0.xsd:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:pipeline="http://www.intershop.de/pipeline/2010"
    attributeFormDefault="unqualified"
    elementFormDefault="qualified"
    targetNamespace="http://www.intershop.de/pipeline/2010"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
    <xs:import schemaLocation="schema1.xsd" />
    <xs:element name="Pipeline">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="nodes" />
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="type" type="xs:string" use="required" />
        </xs:complexType>
    </xs:element>
</xs:schema>

schema1.xsd:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
    attributeFormDefault="unqualified"
    elementFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
    <xs:element name="nodes">
        <xs:complexType>
            <xs:attribute name="nodeID" type="xs:string" use="required" />
            <xs:attribute ref="xsi:type" use="required" />
        </xs:complexType>
    </xs:element>
</xs:schema>

When I execute xjc using these XSD I get this error:

[ant:jaxb] parsing a schema...
[ant:jaxb] [ERROR] src-resolve.4.2: Error resolving component 'xsi:type'. It was detected that 'xsi:type' is in namespace 'http://www.w3.org/2001/XMLSchema-instance', but components from this namespace are not referenceable from schema document 'file:/C:/Projects/test/xsd/schema1.xsd'. If this is the incorrect namespace, perhaps the prefix of 'xsi:type' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/C:/Projects/test/xsd/schema1.xsd'.
[ant:jaxb]   line 12 of file:/C:/Projects/test/xsd/schema1.xsd
[ant:jaxb]
[ant:jaxb] [ERROR] src-resolve: Cannot resolve the name 'xsi:type' to a(n) 'attribute declaration' component.
[ant:jaxb]   line 12 of file:/C:/Projects/test/xsd/schema1.xsd
[ant:jaxb]
[ant:jaxb] Failed to parse a schema.

I have found a possible solution here on StackOverflow, which consists in adding the namespace attribute in the @XmlAttribute annotation of the generated Java class' field:

@XmlAttribute(name = "type", required = true, namespace = "http://www.w3.org/2001/XMLSchema-instance")
protected String type;

and changing schema1.xsd like this:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
        attributeFormDefault="unqualified"
        elementFormDefault="qualified"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
    <xs:element name="nodes">
        <xs:complexType>
            <xs:attribute name="nodeID" type="xs:string" use="required" />

            <xs:attribute name="type" type="xs:string" use="required" />
        </xs:complexType>
    </xs:element>
</xs:schema>

This solution works but I don't like it, because I would need to change manually, every time I run xjc, the generated Java classes to add that namespace attribute.

What I would like instead is to put something in the XSD file (or in a XJB file maybe?) which adds that namespace attribute automatically when I run xjc.

If I don't add that namespace attribute on the @XmlAttribute annotation, value of type attribute is always null:

public static void main(String[] args) throws JAXBException
{
    File xmlFile = new File("D:\\temp\\test.xml");
    JAXBContext jaxbContext = JAXBContext.newInstance(Pipeline.class);
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    Pipeline pipeline = (Pipeline) unmarshaller.unmarshal(xmlFile);
    Nodes node = pipeline.getNodes();

    System.out.println(node.getType()); // prints null
}


问:
Issue with stack.navigator and scrollview
So I am using a scroll view on my home screen and the issue I am having is when the user scrolls down about a couple of swipes and clicks an item. They will be brought to a new screen, but now let's say within that screen there is another item and takes them to a different screen. Now, if the user were to return back and back once more to main screen. It will take the user back to the very top of the home screen and not back to the initial point they have left off.

I believe I know why this happening but I am unsure how to fix this problem. So I am using a stack.navigator which are layers stacking on top of each other.

Here's what I have set up for my stack navigator:

```<code>const UserIsSignedIn = () => {

  const navigation = useNavigation();
  const Stack = createSharedElementStackNavigator();

  return (
      <Stack.Navigator
        screenOptions={{
        headerShown: false
        }}
      >

      {/* Bottom Tabs */}
      <Stack.Screen name={name}  component= {MyTabs} options={{headerShown: false}}/>

       //Popular now section (Screen 1)
      <Stack.Screen name= 'PopularNow' component={PopularNow}/>

      //Game Preview Screen (Screen 2)
      <Stack.Screen
      name="GamePreview"
      component={GamePreviewScreen}

      sharedElements={(route, otherRoute, showing) => {
        if (otherRoute.name === 'GameDetails') {
          return [
           {

           }
          ]
        }
        const { item } = route.params;
          return [
            {
            id: `item.${item.id}.game`,
            animation: 'move',
            resize: 'clip',
        // align: ''left-top'
        },
      ];
      }}
      />

      //Game Details (Screen 3)
      <Stack.Screen name='GameDetails' component={GameDetails}/>

      </Stack.Navigator>

  )
}

export default UserIsSignedIn;
</code>```

video clip example:
https://drive.google.com/file/d/1NiKHrUfoXANB97zWE9yeAgd0yytpYjOd/view?usp=sharing

Body:
So I am using a scroll view on my home screen and the issue I am having is when the user scrolls down about a couple of swipes and clicks an item. They will be brought to a new screen, but now let's say within that screen there is another item and takes them to a different screen. Now, if the user were to return back and back once more to main screen. It will take the user back to the very top of the home screen and not back to the initial point they have left off.

I believe I know why this happening but I am unsure how to fix this problem. So I am using a stack.navigator which are layers stacking on top of each other.

Here's what I have set up for my stack navigator:

const UserIsSignedIn = () => {

  const navigation = useNavigation();
  const Stack = createSharedElementStackNavigator();

  return (
      <Stack.Navigator
        screenOptions={{
        headerShown: false
        }}
      >

      {/* Bottom Tabs */}
      <Stack.Screen name={name}  component= {MyTabs} options={{headerShown: false}}/>

       //Popular now section (Screen 1)
      <Stack.Screen name= 'PopularNow' component={PopularNow}/>

      //Game Preview Screen (Screen 2)
      <Stack.Screen
      name="GamePreview"
      component={GamePreviewScreen}

      sharedElements={(route, otherRoute, showing) => {
        if (otherRoute.name === 'GameDetails') {
          return [
           {

           }
          ]
        }
        const { item } = route.params;
          return [
            {
            id: `item.${item.id}.game`,
            animation: 'move',
            resize: 'clip',
        // align: ''left-top'
        },
      ];
      }}
      />

      //Game Details (Screen 3)
      <Stack.Screen name='GameDetails' component={GameDetails}/>

      </Stack.Navigator>

  )
}

export default UserIsSignedIn;

video clip example:
https://drive.google.com/file/d/1NiKHrUfoXANB97zWE9yeAgd0yytpYjOd/view?usp=sharing


问:
Populate dimensional restrictions in Settings_overload.ini
I'm trying to populate the height, weight and length in the sygic application by using the Settings_overload.ini
With m_arrDimensionalRestrictions= I can fill the total weight and the total axle weight by adding =16000,200000  but not the other 3 values (weight, length, height). The customization documentation doesn't specify what values needed to be used here.

I've tried all sorts of different values like ,**Space**, ; and adding .0 after each value. But so far I've only managed to always change the values back to zero when the app launches.

Does someone have an example what this should look like?