问:
cielo__WEBPACK_IMPORTED_MODULE_3___default() is not a constructor
I'm creating an application in Vue CLI 3 to receive subscription payments using this node library solution for Cielo integration https://github.com/banzeh/cielo.

When I try to access the payment form page route, I get this error in the console.

cielo__WEBPACK_IMPORTED_MODULE_3___default() is not a constructor

Does anyone have an idea how to solve?

Here is the code I used in my component.

```<code>import firebase from 'firebase/app';
import 'firebase/database';
import Cielo from 'cielo';

const cieloParams = {
 merchantId: 'XXXXXXXXXXXX',
 merchantKey: 'XXXXXXXXXXXX',
 sandbox: true,
};

const cielo = new Cielo(cieloParams);

export default {
 name: 'SubscriptionForm',
 data() {
   return {
     name: '',
     email: '',
     creditCardNumber: '',
     expirationDate: '',
     securityCode: '',
   };
 },
 methods: {
   async handleSubmit() {
     try {
       // Utilize a API da Cielo para processar o pagamento recorrente
       let createRecurrencyParams = {
       merchantOrderId: '2014113245231706',
       customer: {
         name: 'Comprador rec programada'
       },
       payment: {
         type: EnumCardType,
         amount: 1500,
         installments: 1,
         softDescriptor: '123456789ABCD',
         currency: 'BRL',
         country: 'BRA',
         recurrentPayment: {
           authorizeNow: true,
           endDate: '2022-12-01',
           interval: EnumRecurrentPaymentInterval.SEMIANNUAL
         },
         creditCard: {
           cardNumber: '4024007197692931',
           holder: 'Teste Holder',
           expirationDate: '12/2030',
           securityCode: '262',
           saveCard: false,
           brand: 'Visa'
         }
       }
     }

     cielo.recurrent.create(createRecurrencyParams)
       .then((data) => {
         return console.log(data);
       })
       .catch((err) => {
         return console.error('ERRO', err);
       })

       // Salve os detalhes da assinatura no Firebase
       await firebase.database().ref('subscriptions').push({
         name: this.name,
         email: this.email,
         paymentId: paymentResponse.payment.paymentId,
         recurrentPaymentId: paymentResponse.payment.recurrentPayment.recurrentPaymentId,
       });

       // Limpe o formulário
       this.name = '';
       this.email = '';
       this.creditCardNumber = '';
       this.expirationDate = '';
       this.securityCode = '';

       // Exiba uma mensagem de sucesso
       alert('Assinatura criada com sucesso!');
     } catch (error) {
       console.error(error);
       alert('Erro ao criar assinatura. Verifique os dados inseridos e tente novamente.');
     }
   },
 },
};
</code>```

Body:
I'm creating an application in Vue CLI 3 to receive subscription payments using this node library solution for Cielo integration https://github.com/banzeh/cielo.

When I try to access the payment form page route, I get this error in the console.

cielo__WEBPACK_IMPORTED_MODULE_3___default() is not a constructor

Does anyone have an idea how to solve?

Here is the code I used in my component.

import firebase from 'firebase/app';
import 'firebase/database';
import Cielo from 'cielo';

const cieloParams = {
 merchantId: 'XXXXXXXXXXXX',
 merchantKey: 'XXXXXXXXXXXX',
 sandbox: true,
};

const cielo = new Cielo(cieloParams);

export default {
 name: 'SubscriptionForm',
 data() {
   return {
     name: '',
     email: '',
     creditCardNumber: '',
     expirationDate: '',
     securityCode: '',
   };
 },
 methods: {
   async handleSubmit() {
     try {
       // Utilize a API da Cielo para processar o pagamento recorrente
       let createRecurrencyParams = {
       merchantOrderId: '2014113245231706',
       customer: {
         name: 'Comprador rec programada'
       },
       payment: {
         type: EnumCardType,
         amount: 1500,
         installments: 1,
         softDescriptor: '123456789ABCD',
         currency: 'BRL',
         country: 'BRA',
         recurrentPayment: {
           authorizeNow: true,
           endDate: '2022-12-01',
           interval: EnumRecurrentPaymentInterval.SEMIANNUAL
         },
         creditCard: {
           cardNumber: '4024007197692931',
           holder: 'Teste Holder',
           expirationDate: '12/2030',
           securityCode: '262',
           saveCard: false,
           brand: 'Visa'
         }
       }
     }

     cielo.recurrent.create(createRecurrencyParams)
       .then((data) => {
         return console.log(data);
       })
       .catch((err) => {
         return console.error('ERRO', err);
       })

       // Salve os detalhes da assinatura no Firebase
       await firebase.database().ref('subscriptions').push({
         name: this.name,
         email: this.email,
         paymentId: paymentResponse.payment.paymentId,
         recurrentPaymentId: paymentResponse.payment.recurrentPayment.recurrentPaymentId,
       });

       // Limpe o formulário
       this.name = '';
       this.email = '';
       this.creditCardNumber = '';
       this.expirationDate = '';
       this.securityCode = '';

       // Exiba uma mensagem de sucesso
       alert('Assinatura criada com sucesso!');
     } catch (error) {
       console.error(error);
       alert('Erro ao criar assinatura. Verifique os dados inseridos e tente novamente.');
     }
   },
 },
};


来源: stackexchange

问:
popperJS: Multiple popups on element
I would like to place a variable number of popups on an element and I considered using PopperJS to manage the placement of the popups, however I have only ever seen popperJS used with a single popup.

PopperJS does have an offset modifier which accepts a function, so maybe I could use this?

I would like the popups placed around the element, like petals on a flowers, but I would like a reusable function that can work with any number of items.

I have created a little test on CodeSandbox - I will keep working on it and tidy it up.

Do you understand what I am trying to do? Is PopperJS the right approach for this?

Thanks

ContentLicense: CC BY-SA 4.0

Title: popperJS: Multiple popups on element


问:
django.db.utils.IntegrityError: FOREIGN KEY constraint failed - Django
First, I know there are a lot of answers regarding this error, but I can't understand why this is erroring out in my case. I am learning Django and any help would be highly appreciated.

I have a Ticket model with ForeignKey reference to Category, Type & GHDUser as below

models.py
`

```<code># from accounts/models.py
class GHDUser(AbstractBaseUser, PermissionsMixin):
    emp_id = models.IntegerField(primary_key=True)
    email = models.EmailField(_('email address'),unique=True)
    username = models.CharField(max_length=150, unique=True)

# from ticket/models.py
class Category(models.Model):
    name = models.CharField(max_length=100)

    class Meta:
        verbose_name = 'Category'
        verbose_name_plural = 'Categories'

    def __str__(self):
        return self.name

class Type(models.Model):
    category = models.ForeignKey(Category, on_delete=models.CASCADE)
    name = models.CharField(max_length=100)

    class Meta:
        verbose_name = 'Type'
        verbose_name_plural = 'Types'

    def __str__(self):
        return self.name

class Ticket(models.Model):

    status_options = (
        ('open', 'Open'),
        ('pending', 'Pending'),
        ('closed', 'Closed')
    )

    priority_options = (
        ('high','High'),
        ('medium','Medium'),
        ('low','Low')
    )

    ticket_no = models.CharField(max_length=10, blank=True)
    title = models.CharField(max_length=100)
    description = models.TextField(max_length=1000)
    category = models.ForeignKey(Category, on_delete=models.PROTECT, default=1)
    type = models.ForeignKey(Type, on_delete=models.PROTECT, default=1)
    file = models.FileField(upload_to=user_directory_path, blank=True, default='files/Default_Avatar.png')
    raised_by_user = models.ForeignKey(GHDUser, on_delete=models.CASCADE, related_name='raised_ticket')
</code>```

`

Now, I am able to create an instance for Ticket model from Admin Panel, but when I try to do the same via shell / using data from front end, I am getting the below error.

django.db.utils.IntegrityError: FOREIGN KEY constraint failed

Can you please help me understand what I am doing wrong ?

Body:
First, I know there are a lot of answers regarding this error, but I can't understand why this is erroring out in my case. I am learning Django and any help would be highly appreciated.

I have a Ticket model with ForeignKey reference to Category, Type & GHDUser as below

models.py
`

# from accounts/models.py
class GHDUser(AbstractBaseUser, PermissionsMixin):
    emp_id = models.IntegerField(primary_key=True)
    email = models.EmailField(_('email address'),unique=True)
    username = models.CharField(max_length=150, unique=True)

# from ticket/models.py
class Category(models.Model):
    name = models.CharField(max_length=100)

    class Meta:
        verbose_name = 'Category'
        verbose_name_plural = 'Categories'

    def __str__(self):
        return self.name

class Type(models.Model):
    category = models.ForeignKey(Category, on_delete=models.CASCADE)
    name = models.CharField(max_length=100)

    class Meta:
        verbose_name = 'Type'
        verbose_name_plural = 'Types'

    def __str__(self):
        return self.name

class Ticket(models.Model):

    status_options = (
        ('open', 'Open'),
        ('pending', 'Pending'),
        ('closed', 'Closed')
    )

    priority_options = (
        ('high','High'),
        ('medium','Medium'),
        ('low','Low')
    )

    ticket_no = models.CharField(max_length=10, blank=True)
    title = models.CharField(max_length=100)
    description = models.TextField(max_length=1000)
    category = models.ForeignKey(Category, on_delete=models.PROTECT, default=1)
    type = models.ForeignKey(Type, on_delete=models.PROTECT, default=1)
    file = models.FileField(upload_to=user_directory_path, blank=True, default='files/Default_Avatar.png')
    raised_by_user = models.ForeignKey(GHDUser, on_delete=models.CASCADE, related_name='raised_ticket')

`

Now, I am able to create an instance for Ticket model from Admin Panel, but when I try to do the same via shell / using data from front end, I am getting the below error.

django.db.utils.IntegrityError: FOREIGN KEY constraint failed

Can you please help me understand what I am doing wrong ?


问:
i installed pyqt on thonny but i'cant installe pyqt5-tools
```<code>Collecting pyqt5-tools
  Using cached pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)
  Using cached pyqt5_tools-5.15.4.3.1-py3-none-any.whl (28 kB)
Collecting click
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Requirement already satisfied: pyqt5==5.15.4 in /Users/ahmed/Library/Python/3.10/lib/python/site-packages (from pyqt5-tools) (5.15.4)

The conflict is caused by:
    pyqt5-tools 5.15.4.3.2 depends on pyqt5-plugins<5.15.4.3 and >=5.15.4.2.2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Process returned with code 1
</code>```

i understood that it failed on downloading pyqt-plugins so i tried to download it first then pyqt5-tools , i can't figure it out. i'm using macos
when i click installer on pyqt5-tools this erreur show up , i found out that it failed on installing pyqt-plugins !!!!

Body:
Collecting pyqt5-tools
  Using cached pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)
  Using cached pyqt5_tools-5.15.4.3.1-py3-none-any.whl (28 kB)
Collecting click
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Requirement already satisfied: pyqt5==5.15.4 in /Users/ahmed/Library/Python/3.10/lib/python/site-packages (from pyqt5-tools) (5.15.4)

The conflict is caused by:
    pyqt5-tools 5.15.4.3.2 depends on pyqt5-plugins<5.15.4.3 and >=5.15.4.2.2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Process returned with code 1

i understood that it failed on downloading pyqt-plugins so i tried to download it first then pyqt5-tools , i can't figure it out. i'm using macos
when i click installer on pyqt5-tools this erreur show up , i found out that it failed on installing pyqt-plugins !!!!


问:
How to handle errors in Shadertoy React
Is there a way to detect if the fragment shader you pass to the component has any errors? By default, the component renders black and logs the error, but I would like to be able to detect that in code so I can render something else.</p>

Title: How to handle errors in Shadertoy React


问:
SAS proc mixed model: NO difference observed when changing the variable in the left side of the model
I run a mixed model according to the PROC MIXED step in SAS. My code is like this below:

```<code>proc mixed data=inds;
   class subject arm(ref='C') ;
   model aval =base arm avisitn arm*avisitn /s ;
   random subject ;
   repeated /  subject=subject ;
   lsmeans arm / diff cl at avisitn=0;
   lsmeans arm / diff cl at avisitn=1;
   lsmeans arm / diff cl at avisitn=2;
   ods output  diffs=diff ;
run;
</code>```

Then I change the variable in the model option at the left side of the equation like this:

```<code>proc mixed data=inds;
   class subject arm(ref='C') ;
   model chg =base arm avisitn arm*avisitn /s;
   random subject ;
   repeated / subject=subject ;
/*   lsmeans arm / pdiff cl at avisitn=0;*/
   lsmeans arm / pdiff cl at avisitn=1;
   lsmeans arm / pdiff cl at avisitn=2;
   ods output  diffs=diff1 ;
run;
</code>```

I just change the variable from the value at each time point to the change from baseline.
Then I find that the Differences of Least Squares Means is the same.
I do not know how this works.
Can anyone tell me why?

A explanation from the model and a suggestion from the code so that I can see why I get the same results.

Body:
I run a mixed model according to the PROC MIXED step in SAS. My code is like this below:

proc mixed data=inds;
   class subject arm(ref='C') ;
   model aval =base arm avisitn arm*avisitn /s ;
   random subject ;
   repeated /  subject=subject ;
   lsmeans arm / diff cl at avisitn=0;
   lsmeans arm / diff cl at avisitn=1;
   lsmeans arm / diff cl at avisitn=2;
   ods output  diffs=diff ;
run;

Then I change the variable in the model option at the left side of the equation like this:

proc mixed data=inds;
   class subject arm(ref='C') ;
   model chg =base arm avisitn arm*avisitn /s;
   random subject ;
   repeated / subject=subject ;
/*   lsmeans arm / pdiff cl at avisitn=0;*/
   lsmeans arm / pdiff cl at avisitn=1;
   lsmeans arm / pdiff cl at avisitn=2;
   ods output  diffs=diff1 ;
run;

I just change the variable from the value at each time point to the change from baseline.
Then I find that the Differences of Least Squares Means is the same.
I do not know how this works.
Can anyone tell me why?

A explanation from the model and a suggestion from the code so that I can see why I get the same results.


问:
capacitor app log local ip address in offline request
I would like to log the ip address in some requests. For this i would like to get the info from the network-interface in my app. As it is a offline app that replicates to couchdb and not server requests this is proving to be difficult.

i was thinking of using @capacitor/network but this plugin only tells me if there is a network connection and no infos.

Then i tried cordova-plugin-networkinterface but i could not get this plugin to work properly because it does not show in cordova.plugins like cordova-plugin-badge.It does show up in the window object as window.networkinterface.getIPAddress() but it returns "undefined".

Can someone please tell me why cordova-plugin-networkinterface does not work in capacitor (not using ionic) or a different approach.


问:
OCR using custom font in python
I am trying to detect text from a video game. The game uses a custom font, and I have the font files available to me. The text characters in the game are not distorted and are clearly visible. I am aware that similar questions have been asked already, but it seems to me that the previously presented solutions might be outdated.

What would be the 2023 way of detecting the text and bounding boxes in images using python?

I tried to do it in Tesseract, but the font is not included in the pre-trained model, hence Tesseract performs poorly.

In principle, I could train Tesseract to use the custom font. The problem seems quite straightforward to me: create a custom .traineddata file and tell tesseract to use it when detecting. However, it seems like the Tesseract trainer by Anyline is not available anymore and the  Qt-box-editor used in some tutorials to do it manually is not maintained anymore.

The fact that my search for something that in my mind should be quite straightforward and fully automated (use custom font file to create labeled text images, train tesseract on them, use the trained model) only leads to outdated and quite lengthy instructions that involve many manual steps, indicates to me that either I am trying to use Tesseract for something it was not meant to do or that I am missing some tool that everyone else is using.

Title: OCR using custom font in python


问:
Where object will contained if it will be local
If i create a new object in any Method, so it will be local, will it be contained in heap? or it will be contained on stack, cuz it is local

i try googling, but i have no results


问:
How to prevent my code to count `\0` as one character?
I'm attempting to make strlen in C standard library on my own.

Following is my code and the strlen func I made is given the name mystrlen in the script below.

```<code>   #include <stdio.h>

   //int mystrlen(const char* str);

   int mystrlen(const char* str){
           int i;
           for (i=0;str[i]!='\0';i++);
           return i;
  }

  int main(void){
          char input[100];
          fgets(input,sizeof input, stdin);
          printf("The length of your string : %d\n", mystrlen(input));
          return 0;
  }
</code>```

However, when I executed the compiled code, the output always shows the length of input string one greater than its actual size.

Example: (input is abc)

```<code>abc
The length of your string : 4
</code>```

I think this is because my code counts '\0', the last character in the string as one character.
I have searched for the Internet about how to avoid count the NULL character, but I didn't find any useful info.

Could you please tell me how to solve this problem? Thank you.

Body:
I'm attempting to make strlen in C standard library on my own.

Following is my code and the strlen func I made is given the name mystrlen in the script below.

   #include <stdio.h>

   //int mystrlen(const char* str);

   int mystrlen(const char* str){
           int i;
           for (i=0;str[i]!='\0';i++);
           return i;
  }

  int main(void){
          char input[100];
          fgets(input,sizeof input, stdin);
          printf("The length of your string : %d\n", mystrlen(input));
          return 0;
  }

However, when I executed the compiled code, the output always shows the length of input string one greater than its actual size.

Example: (input is abc)

abc
The length of your string : 4

I think this is because my code counts '\0', the last character in the string as one character.
I have searched for the Internet about how to avoid count the NULL character, but I didn't find any useful info.

Could you please tell me how to solve this problem? Thank you.


问:
Building a PEP517 package with MinGW
I am a package maintainer for a Python package that provides an interface to an academic project.  The main code is written in C and there are some Python scripts to add some extra functionality.  The core C code is relatively portable (for C) but does not currently build using the MS Visual Studio Compiler.  I do not have enough Windows users that this is a problem right now, and I am fine with simply telling them that they need to do some extra work to use MinGW to install the Python package (as they need to do to use the core package).

The package uses PEP517 because deprecation warnings from prior standards gave me the impression that I needed to migrate.  However, I have now discovered that the --global-option flag (specified by this post) is unavailable for PEP517 packages meaning there is no clear way to specify MinGW as the compiler.

I discovered that there is a --config-settings flag for PEP517 packages, but trying the obvious settings (compiler=mingw64) did not change anything.

How can I tell pip to use mingw64 as the compiler for my package on Windows?  If there was a way to put this information in the package itself, that would be even better, but I am happy with just being able to install it with some extra command-line parameters.

Title: Building a PEP517 package with MinGW


问:
Unable to Switch Appium Context
We have different WebView workflows for our App. I'm able to switch context for the Workflows which has contexts NATIVE_APP, WEBVIEW_com.bluebird.mobile and WEBVIEW_Terrace (3 contexts),
And not able to switch context for the workflows which has only two context  NATIVE_APP and WEBVIEW_Terrace. While switching the context I get the following error:

```<code>Appium error: An unknown server-side error occurred while processing the command.
Original error: An unknown server-side error occurred while processing the command.
Original error: unknown error: Failed to get sockets matching: @weblayer_devtools_remote_.*14722

  (make sure the app has its WebView/WebLayer configured for debugging)

  (Driver info: chromedriver=105.0.5195.52 (412c95e518836d8a7d97250d62b29c2ae6a26a85-refs/branch-heads/5195@{#853}), platform=Linux 5.16.7-200.fc35.x86_64 x86_64)
</code>```

When I look on the internet for the error "make sure the app has its WebView/WebLayer configured for debugging", I see solution to set setWebContentsDebuggingEnabled to true and we already set this  configuration because some of the workflows are working.

Please let me know what  I need to do here? OR what can I ask my DEV team to fix this.

Title: Unable to Switch Appium Context

Body:
We have different WebView workflows for our App. I'm able to switch context for the Workflows which has contexts NATIVE_APP, WEBVIEW_com.bluebird.mobile and WEBVIEW_Terrace (3 contexts),
And not able to switch context for the workflows which has only two context  NATIVE_APP and WEBVIEW_Terrace. While switching the context I get the following error:

Appium error: An unknown server-side error occurred while processing the command.
Original error: An unknown server-side error occurred while processing the command.
Original error: unknown error: Failed to get sockets matching: @weblayer_devtools_remote_.*14722

  (make sure the app has its WebView/WebLayer configured for debugging)

  (Driver info: chromedriver=105.0.5195.52 (412c95e518836d8a7d97250d62b29c2ae6a26a85-refs/branch-heads/5195@{#853}), platform=Linux 5.16.7-200.fc35.x86_64 x86_64)

When I look on the internet for the error "make sure the app has its WebView/WebLayer configured for debugging", I see solution to set setWebContentsDebuggingEnabled to true and we already set this  configuration because some of the workflows are working.

Please let me know what  I need to do here? OR what can I ask my DEV team to fix this.


问:
R: Error: Error in intI(j, n = d[2L], dn[[2L]], give.dn = FALSE) : ungültige Zeichenindexierung
R is very new to me.
I try to make a DotPlot.
Here is my code:
...

```<code>Idents(immune.combined) <- factor(Idents(immune.combined), levels = c("HSPC", "Mono/Mk Doublets",
                                                                      "pDC", "Eryth", "Mk", "DC", "CD14 Mono",
                                                                      "CD16 Mono", "B Activated", "B",
                                                                      "CD8 T", "NK", "T activated",
                                                                      "CD4 Naive T", "CD4 Memory T"))
Idents(immune.combined)

markers.to.plot <- c("CD3D", "CREM", "HSPH1", "SELL", "GIMAP5", "CACYBP", "GNLY", "NKG7", "CCL5",
                     "CD8A", "MS4A1", "CD79A", "MIR155HG", "NME1", "FCGR3A", "VMO1", "CCL2", "S100A9", "HLA-DQA1",
                     "GPR183", "PPBP", "GNG11", "HBA2", "HBB", "TSPAN13", "IL3RA", "IGJ", "PRSS57")
DotPlot(immune.combined, features = markers.to.plot, cols = c("blue", "red"), dot.scale = 8, split.by = "condition") + RotatedAxis()
</code>```

Than I got this error/ warnings:
Warning: Found the following features in more than one assay, excluding the default. We will not include these in the final data frame: CD3D, HSPH1, GNLY, NKG7, CCL5, CD8A, MS4A1, CD79A, NME1, FCGR3A, VMO1, S100A9, HLA-DQA1, GPR183, PPBP, GNG11, HBB, TSPAN13, IL3RA, PRSS57
Warning: Could not find CREM in the default search locations, found in RNA assay instead
Error in intI(j, n = d[2L], dn[[2L]], give.dn = FALSE) :
ungültige Zeichenindexierung
In addition: Warning message:
In cells.idents["NA"] <- names(x = which(x = is.na(x = Idents(object = object)[cells]))) :
number of items to replace is not a multiple of replacement length

can anybody help me? I really would appreciate this.
Greets

I tried to google this problem and try with chatGPT, but this wasn´t helpful.

Body:
R is very new to me.
I try to make a DotPlot.
Here is my code:
...

Idents(immune.combined) <- factor(Idents(immune.combined), levels = c("HSPC", "Mono/Mk Doublets",
                                                                      "pDC", "Eryth", "Mk", "DC", "CD14 Mono",
                                                                      "CD16 Mono", "B Activated", "B",
                                                                      "CD8 T", "NK", "T activated",
                                                                      "CD4 Naive T", "CD4 Memory T"))
Idents(immune.combined)

markers.to.plot <- c("CD3D", "CREM", "HSPH1", "SELL", "GIMAP5", "CACYBP", "GNLY", "NKG7", "CCL5",
                     "CD8A", "MS4A1", "CD79A", "MIR155HG", "NME1", "FCGR3A", "VMO1", "CCL2", "S100A9", "HLA-DQA1",
                     "GPR183", "PPBP", "GNG11", "HBA2", "HBB", "TSPAN13", "IL3RA", "IGJ", "PRSS57")
DotPlot(immune.combined, features = markers.to.plot, cols = c("blue", "red"), dot.scale = 8, split.by = "condition") + RotatedAxis()

Than I got this error/ warnings:
Warning: Found the following features in more than one assay, excluding the default. We will not include these in the final data frame: CD3D, HSPH1, GNLY, NKG7, CCL5, CD8A, MS4A1, CD79A, NME1, FCGR3A, VMO1, S100A9, HLA-DQA1, GPR183, PPBP, GNG11, HBB, TSPAN13, IL3RA, PRSS57
Warning: Could not find CREM in the default search locations, found in RNA assay instead
Error in intI(j, n = d[2L], dn[[2L]], give.dn = FALSE) :
ungültige Zeichenindexierung
In addition: Warning message:
In cells.idents["NA"] <- names(x = which(x = is.na(x = Idents(object = object)[cells]))) :
number of items to replace is not a multiple of replacement length

can anybody help me? I really would appreciate this.
Greets

I tried to google this problem and try with chatGPT, but this wasn´t helpful.


问:
InitialAdminPassword file not present inside var/jenkins_home/secret folder
Hi All I am trying to run a Jenkins on my machine(linux) using docker container.
When I'm running a  Jenkins docker container it's  running successfully,

But It's not showing the initialAdminPassword in the console.

So I tried checking the password in the initialAdminPassword file inside
Jenkins container using docker exec command but couldn't found the file.

I even tried with super user but the result was same.


问:
How to fetch the citation history of an articles using its DOIs in R?
I was wondering if it is possible to extract the citation history of articles using DOIs. I found the package scholar is helpful for getting the citation history of an individual from Google Scholar.

```<code>library(scholar)
get_citation_history(id="bg0BZ-QAAAAJ&hl")
  year cites
1 2017    25
2 2018    39
3 2019   114
4 2020   377
5 2021  1195
6 2022  2070
</code>```

In my case, however, I do have only DOI and don't need the citation of an individual. I need the citation history of articles. For example, if I use doi=10.1111/j.1365-2486.2008.01617.x instead of id, I get an error. Any help is highly appreciated!

Body:
I was wondering if it is possible to extract the citation history of articles using DOIs. I found the package scholar is helpful for getting the citation history of an individual from Google Scholar.

library(scholar)
get_citation_history(id="bg0BZ-QAAAAJ&hl")
  year cites
1 2017    25
2 2018    39
3 2019   114
4 2020   377
5 2021  1195
6 2022  2070

In my case, however, I do have only DOI and don't need the citation of an individual. I need the citation history of articles. For example, if I use doi=10.1111/j.1365-2486.2008.01617.x instead of id, I get an error. Any help is highly appreciated!


问:
Workaround for circular references between C++ classes
Right now I have two classes which both have pointers to each other. When I try to compile it has an error because the program cannot compile one class without already having compiled the other.

It works like this

Main.cpp includes class A

Header guard for class A

Class A includes class B

Class B includes class A

Class A already got included so the header guard prevents loading it again

Class B has no idea what class A is

I just need to be able to reference one class from the other. I'm not incredibly skilled with C++ so this may be obvious but help would be appreciated.


问:
How can I hide my source code in HuggingFace spaces?
I've been trying to figure out how to hide my source code in public HuggingFace spaces, but I wasn't able to find a solution for this. Here is what I've read and tried:

Using Google Actions to rely on tokens, but the code is synced of course to the HuggingFace space, so it is visible.

In the documentation it is said that Git LFS can be used to make the models hidden, but this cannot be applied to source code.

I've also read about using secrets, but this applies to API keys, not app functions.

Note: I've searched for a more relevant community to post this question and already asked the question in HuggingFace community, but no help yet.


问:
Combine models in Prisma Schema
I have a Prisma Schema like below. That works fine for sure. But I have a lot of code duplication in RegionsPermissions and RolesPermissions. Is it possible to combine both in one single model?</p>
```<code>model Roles {
  id               String             @id @default(uuid())
  name             String
  canCreateRegions RegionsPermissions @relation(fields: [createRegionsId], references: [id])
  canCreateRoles   RolesPermissions   @relation(fields: [createRolesId], references: [id])
  createRegionsId  String             @unique
  createRolesId    String             @unique
}

model RegionsPermissions {
  id     String  @id @default(uuid())
  create Boolean
  read   Boolean
  update Boolean
  delete Boolean
  role   Roles?
}

model RolesPermissions {
  id     String  @id @default(uuid())
  create Boolean
  read   Boolean
  update Boolean
  delete Boolean
  role   Roles?
}

</code>```

Title: Combine models in Prisma Schema

Body:
I have a Prisma Schema like below. That works fine for sure. But I have a lot of code duplication in RegionsPermissions and RolesPermissions. Is it possible to combine both in one single model?

model Roles {
  id               String             @id @default(uuid())
  name             String
  canCreateRegions RegionsPermissions @relation(fields: [createRegionsId], references: [id])
  canCreateRoles   RolesPermissions   @relation(fields: [createRolesId], references: [id])
  createRegionsId  String             @unique
  createRolesId    String             @unique
}

model RegionsPermissions {
  id     String  @id @default(uuid())
  create Boolean
  read   Boolean
  update Boolean
  delete Boolean
  role   Roles?
}

model RolesPermissions {
  id     String  @id @default(uuid())
  create Boolean
  read   Boolean
  update Boolean
  delete Boolean
  role   Roles?
}


问:
Xbox Live Authentication Request Returns Code "400 Bad Request" When Using Access Token Obtained Using MSAL (Swift)
I am trying to authenticate with Xbox Live using an access token obtained using the MSAL authentication library for Swift.

All I am getting as a response is Response Code 400, instead of the expected JSON response containing an Xbox Live token.

I am sending the following request:

```<code>{
  "Properties": {
      "AuthMethod": "RPS",
      "SiteName": "user.auth.xboxlive.com",
      "RpsTicket": "d=(access token)"
  },
  "RelyingParty": "http://auth.xboxlive.com",
  "TokenType": "JWT"
}
</code>```

It is a POST request to https://user.auth.xboxlive.com/user/authenticate

It has these headers: Content-Type: application/json and Accept: application/json.

I am using the Swift MSAL library: https://github.com/AzureAD/microsoft-authentication-library-for-objc

My code for getting the access token looks like this:

```<code>let MSConfig = MSALPublicClientApplicationConfig(clientId: AppGlobals.clientID)
let MSApplication = try? MSALPublicClientApplication(configuration: MSConfig)
let MSScopes = ["User.Read"]

let MSWebviewParameters = MSALWebviewParameters()

let MSInteractiveParameters = MSALInteractiveTokenParameters(scopes: MSScopes, webviewParameters: MSWebviewParameters)
MSApplication?.acquireToken(with: MSInteractiveParameters, completionBlock: { (result, error) in
       guard let MSAuthResult = result, error == nil else {
             print("Error while authing: \(error!.localizedDescription)")
             return
       }

       let receivedMSAccessToken = MSAuthResult.accessToken
       let receivedMSAccountIdentifier = MSAuthResult.account.identifier
})
</code>```

The code for obtaining an access token works as expected, and I get an access token once I log in using Microsoft. I am then using the access token obtained on line let receivedMSAccessToken = MSAuthResult.accessToken as the access token on the request line "RpsTicket": "d=(access token)". However, I am still getting error 400 (Bad Request).

What can I do to fix this?

Body:
I am trying to authenticate with Xbox Live using an access token obtained using the MSAL authentication library for Swift.

All I am getting as a response is Response Code 400, instead of the expected JSON response containing an Xbox Live token.

I am sending the following request:

{
  "Properties": {
      "AuthMethod": "RPS",
      "SiteName": "user.auth.xboxlive.com",
      "RpsTicket": "d=(access token)"
  },
  "RelyingParty": "http://auth.xboxlive.com",
  "TokenType": "JWT"
}

It is a POST request to https://user.auth.xboxlive.com/user/authenticate

It has these headers: Content-Type: application/json and Accept: application/json.

I am using the Swift MSAL library: https://github.com/AzureAD/microsoft-authentication-library-for-objc

My code for getting the access token looks like this:

let MSConfig = MSALPublicClientApplicationConfig(clientId: AppGlobals.clientID)
let MSApplication = try? MSALPublicClientApplication(configuration: MSConfig)
let MSScopes = ["User.Read"]

let MSWebviewParameters = MSALWebviewParameters()

let MSInteractiveParameters = MSALInteractiveTokenParameters(scopes: MSScopes, webviewParameters: MSWebviewParameters)
MSApplication?.acquireToken(with: MSInteractiveParameters, completionBlock: { (result, error) in
       guard let MSAuthResult = result, error == nil else {
             print("Error while authing: \(error!.localizedDescription)")
             return
       }

       let receivedMSAccessToken = MSAuthResult.accessToken
       let receivedMSAccountIdentifier = MSAuthResult.account.identifier
})

The code for obtaining an access token works as expected, and I get an access token once I log in using Microsoft. I am then using the access token obtained on line let receivedMSAccessToken = MSAuthResult.accessToken as the access token on the request line "RpsTicket": "d=(access token)". However, I am still getting error 400 (Bad Request).

What can I do to fix this?


问:
How to convert the doc file to docx correctly in PHP?
I can't convert a doc file to docx with PHPWord library. My goal is to read and modify existing .doc file but can't get any solution for doing operation on .doc file so i am converting into .docx format by using below code. It gave me an empty file. So what should I do in this case please?

Here is my code:

```<code><?php
require_once 'includes/init.php';
require_once 'vendor/autoload.php';

$filePath = 'test/example.doc';

// Creating the new document...
$phpWord = new \PhpOffice\PhpWord\PhpWord();

$docPath = $filePath;
$phpWord = new \PhpOffice\PhpWord\PhpWord();
// $document = $phpWord->loadTemplate($docPath);
$document = \PhpOffice\PhpWord\IOFactory::load($docPath,'MsDoc');

// When we use this getting unfomated document
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord,'Word2007');
$docxPath = 'abc.docx';
$objWriter->save($docxPath);

?>
</code>```

Body:
I can't convert a doc file to docx with PHPWord library. My goal is to read and modify existing .doc file but can't get any solution for doing operation on .doc file so i am converting into .docx format by using below code. It gave me an empty file. So what should I do in this case please?

Here is my code:

<?php
require_once 'includes/init.php';
require_once 'vendor/autoload.php';

$filePath = 'test/example.doc';

// Creating the new document...
$phpWord = new \PhpOffice\PhpWord\PhpWord();

$docPath = $filePath;
$phpWord = new \PhpOffice\PhpWord\PhpWord();
// $document = $phpWord->loadTemplate($docPath);
$document = \PhpOffice\PhpWord\IOFactory::load($docPath,'MsDoc');

// When we use this getting unfomated document
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord,'Word2007');
$docxPath = 'abc.docx';
$objWriter->save($docxPath);

?>


问:
Noob question about .lower issues and why they fail when ran in certain ways
I tried entering in a .lower into my if statement and discovered that for some reason it killed one of the responses I was using in the if blocks.  Not sure why that happened, but sure someone can explain it a little better. Thanks

I tried to set the .lower after the if statement as well. I expected the code to use all lower case letters in the answers and instead it did not use lower case letters as a correct response and also eliminated one of the responses. So I eliminated the .lower and the code ran fine. Problem is that never actually functioned correctly.


问:
pandas 'df.convert_dtypes()' function not working
So I have this problem where there's a pd.DataFrame that is made of numeric values in strings.
I have the following DataFrame:

import pandas as pd

df = pd.DataFrame({"A":["1","2"], "B":["abc","bcd"]})
```
<pre class="lang-py prettyprint-override"><code>   A    B
0  1  abc
1  2  bcd
</code>```

What I tried to do is convert the dtype of the A column using a pandas function that converts dtypes to the best possible format. So, before I used the function, I got this:

print(df.dtypes)
```
```A    object
B    object
dtype: object
```
<p>This is expected as the DataFrame was created with quotes outside the numbers. But when I tried to use <code>df.convert_dtypes()</code>, the result didn't change even though both values of 'A' are <code>int</code>s:</p>
<pre class="lang-py prettyprint-override"><code>print(df.convert_dtypes().dtypes)
</code>```
```<code>A    string
B    string
dtype: object
</code>```

I was expecting:

```<code>A    Int32
B    string
dtype: object
</code>```

I have also tried pandas.api.types.infer_dtype, but that also doesn't work.

What I want is a function that can change dtypes into the many possibilites (below) but do it not manually. Any help would be appreciated!

string, bytes, floating, integer, mixed-integer, mixed-integer-float, decimal, complex, categorical, boolean, datetime64, datetime, date, timedelta64, timedelta, time, period, mixed, unknown-array

Body:
So I have this problem where there's a pd.DataFrame that is made of numeric values in strings.
I have the following DataFrame:

import pandas as pd

df = pd.DataFrame({"A":["1","2"], "B":["abc","bcd"]})

   A    B
0  1  abc
1  2  bcd

What I tried to do is convert the dtype of the A column using a pandas function that converts dtypes to the best possible format. So, before I used the function, I got this:

print(df.dtypes)

A    object
B    object
dtype: object

This is expected as the DataFrame was created with quotes outside the numbers. But when I tried to use df.convert_dtypes(), the result didn't change even though both values of 'A' are ints:

print(df.convert_dtypes().dtypes)

A    string
B    string
dtype: object

I was expecting:

A    Int32
B    string
dtype: object

I have also tried pandas.api.types.infer_dtype, but that also doesn't work.

What I want is a function that can change dtypes into the many possibilites (below) but do it not manually. Any help would be appreciated!

string, bytes, floating, integer, mixed-integer, mixed-integer-float, decimal, complex, categorical, boolean, datetime64, datetime, date, timedelta64, timedelta, time, period, mixed, unknown-array


问:
How to delete elements Before and After a specific index in Array
I have two arrays of numbers. First one contains N numbers, imagine it's a field. The second one contains 2 elements, first is a special number (bomb number), the second one is the power of the bomb number.
My task is to remove n numbers (where n = power of the bomb number) before and after the bomb number and the bomb number itself.

What's the best approach to take?

I found the index of the bomb number using .indexOf() and .splice() to remove the elements before the occurrences of the bomb number, but after that all indexes are shifted and that's broke my logic.

This is my logic at this point:

```<code>function bombNumbers(numbersSequance, bombNumberInfo) {
    const bombNumber = bombNumberInfo[0];
    const bombNumberPower = bombNumberInfo[1];

    while (numbersSequance.includes(bombNumber)) {
        let bombNumberIndex = numbersSequance.indexOf(bombNumber);
        let startingIndex = bombNumberIndex - bombNumberPower;
        let endIndex = bombNumberIndex + bombNumberPower;
        numbersSequance.splice(startingIndex, bombNumberPower);
    }
}

bombNumbers([1, 2, 2, 4, 2, 2, 2, 9],
    [4, 2]);
</code>```

Body:
I have two arrays of numbers. First one contains N numbers, imagine it's a field. The second one contains 2 elements, first is a special number (bomb number), the second one is the power of the bomb number.
My task is to remove n numbers (where n = power of the bomb number) before and after the bomb number and the bomb number itself.

What's the best approach to take?

I found the index of the bomb number using .indexOf() and .splice() to remove the elements before the occurrences of the bomb number, but after that all indexes are shifted and that's broke my logic.

This is my logic at this point:

function bombNumbers(numbersSequance, bombNumberInfo) {
    const bombNumber = bombNumberInfo[0];
    const bombNumberPower = bombNumberInfo[1];

    while (numbersSequance.includes(bombNumber)) {
        let bombNumberIndex = numbersSequance.indexOf(bombNumber);
        let startingIndex = bombNumberIndex - bombNumberPower;
        let endIndex = bombNumberIndex + bombNumberPower;
        numbersSequance.splice(startingIndex, bombNumberPower);
    }
}

bombNumbers([1, 2, 2, 4, 2, 2, 2, 9],
    [4, 2]);


问:
Need a Prisma GroupBy with select
I have a relationship between PostAward and Coin that I am trying to do a GroupBy on PostAward that pulls information from Coin to identify some values. Apparently GroupBy does not support select so I keep trying with findMany and have had no luck in figuring out how to group queries then orderBy their count.

Here is what I want:

```<code>{"awards":[{"count":12,"awardTitle":"Bronze","image":"/awards/bronze.gif"},{"count":10,"awardTitle":"Silver","image":"/awards/silver.gif"},{"count":8,"awardTitle":"Gold","image":"/awards/gold.gif"},{"count":5,"awardTitle":"Platinum","image":"/awards/platinum.gif"},{"count":1,"awardTitle":"Diamond","image":"/awards/diamond.gif"}]}
</code>```

Here is my schema:

```<code>model Coin {
  id               Int               @id @default(autoincrement())
  awardTitle       String
  image            String
  postAwards       PostAward[]
}

model PostAward {
  id        Int      @id @default(autoincrement())
  post      Post     @relation(fields: [postId], references: [id])
  postId    Int
  coin      Coin     @relation(fields: [coinId], references: [id])
  coinId    Int
}

model Post {
  id                   Int               @id @default(autoincrement())
  content              String
  postAwards           PostAward[]
}
</code>```

Here I can get the coinId to come out wiht the count, but I cannot figure out how to select the coin relatsip in order to get the associated image/awardTitle:

```<code>  const checkAwards = await prisma.postAward.groupBy({
    by: ["coinId"],
    where: {
      postId: post.id,
    },
    _count: {
      coinId: true,
    },
    orderBy: {
      _count: {
        coinId: "desc",
      },
    },
  });
  const awards = checkAwards.map((x) => {
    return {
      id: x.coinId,
      count: x._count.coinId,
    };
  });
</code>```

Title: Need a Prisma GroupBy with select

Body:
I have a relationship between PostAward and Coin that I am trying to do a GroupBy on PostAward that pulls information from Coin to identify some values. Apparently GroupBy does not support select so I keep trying with findMany and have had no luck in figuring out how to group queries then orderBy their count.

Here is what I want:

{"awards":[{"count":12,"awardTitle":"Bronze","image":"/awards/bronze.gif"},{"count":10,"awardTitle":"Silver","image":"/awards/silver.gif"},{"count":8,"awardTitle":"Gold","image":"/awards/gold.gif"},{"count":5,"awardTitle":"Platinum","image":"/awards/platinum.gif"},{"count":1,"awardTitle":"Diamond","image":"/awards/diamond.gif"}]}

Here is my schema:

model Coin {
  id               Int               @id @default(autoincrement())
  awardTitle       String
  image            String
  postAwards       PostAward[]
}

model PostAward {
  id        Int      @id @default(autoincrement())
  post      Post     @relation(fields: [postId], references: [id])
  postId    Int
  coin      Coin     @relation(fields: [coinId], references: [id])
  coinId    Int
}

model Post {
  id                   Int               @id @default(autoincrement())
  content              String
  postAwards           PostAward[]
}

Here I can get the coinId to come out wiht the count, but I cannot figure out how to select the coin relatsip in order to get the associated image/awardTitle:

  const checkAwards = await prisma.postAward.groupBy({
    by: ["coinId"],
    where: {
      postId: post.id,
    },
    _count: {
      coinId: true,
    },
    orderBy: {
      _count: {
        coinId: "desc",
      },
    },
  });
  const awards = checkAwards.map((x) => {
    return {
      id: x.coinId,
      count: x._count.coinId,
    };
  });


问:
Reproduction in R of the Linear trends models of Stata 17
recently Stata has introduced an interesting feature for the Difference-in-Difference Analysis which introduces a linear trend model to compare the Parallel trend assumptions prior to an intervention established in the command "estat trendplots"  (See more here https://sciexperts.com/difference-in-differences-did-and-ddd-models/ and here https://www.stata.com/manuals/tedidregresspostestimation.pdf)

I am mostly interested in this graphic

Since it shows an interesting representation of the trends (if they're linear) of the control and treatment groups. But I can't figure out how to carry out such a model in R, my intuition states that a single linear model having as a year in the dependent variable would be enough for each group, then average it and plot it. But when I do it I face some errors.

Here's a Data that I generated to work with it.

```<code>library(data.table)
library("fixest")

## Panel Data DiD for trends models

df <- data.table(ID=rep(1:1000, each=10),
                 year = rep(2001:2010,1000),
                 y = rnorm(10000),
                 treatment=rep(c(1,0), each=5000))

# Define the treatment intervention in 2005
df[treatment == 1 & year== 2005, y := y + 0.3]
df[treatment == 1 & year== 2006, y := y - 0.1]

# Event Study
df[, distance := year -2005]

eventstudy <- feols(y ~ i(as.factor(distance), treatment, -1) | ID + year, data = df)
iplot(eventstudy)

# means by group

df[treatment==1 , y_mean := mean(y), by=year]
df[treatment==0 , y_mean := mean(y), by=year]

# graph
ggplot(df, aes(x=year, y=y_mean)) +
  geom_line(aes(x=year, y=y_mean, group=treatment, color=treatment))
</code>```

I'm not interested in the tests followed in Stata as the example I do of the Event Study DiD is enough in the pre-trends hypothesis testing, but I would like to enhance my analysis (as some reviewers asked me this plot) using the linear-trends model.

With regards,

John

Body:
recently Stata has introduced an interesting feature for the Difference-in-Difference Analysis which introduces a linear trend model to compare the Parallel trend assumptions prior to an intervention established in the command "estat trendplots"  (See more here https://sciexperts.com/difference-in-differences-did-and-ddd-models/ and here https://www.stata.com/manuals/tedidregresspostestimation.pdf)

I am mostly interested in this graphic

Since it shows an interesting representation of the trends (if they're linear) of the control and treatment groups. But I can't figure out how to carry out such a model in R, my intuition states that a single linear model having as a year in the dependent variable would be enough for each group, then average it and plot it. But when I do it I face some errors.

Here's a Data that I generated to work with it.

library(data.table)
library("fixest")

## Panel Data DiD for trends models

df <- data.table(ID=rep(1:1000, each=10),
                 year = rep(2001:2010,1000),
                 y = rnorm(10000),
                 treatment=rep(c(1,0), each=5000))

# Define the treatment intervention in 2005
df[treatment == 1 & year== 2005, y := y + 0.3]
df[treatment == 1 & year== 2006, y := y - 0.1]

# Event Study
df[, distance := year -2005]

eventstudy <- feols(y ~ i(as.factor(distance), treatment, -1) | ID + year, data = df)
iplot(eventstudy)

# means by group

df[treatment==1 , y_mean := mean(y), by=year]
df[treatment==0 , y_mean := mean(y), by=year]

# graph
ggplot(df, aes(x=year, y=y_mean)) +
  geom_line(aes(x=year, y=y_mean, group=treatment, color=treatment))

I'm not interested in the tests followed in Stata as the example I do of the Event Study DiD is enough in the pre-trends hypothesis testing, but I would like to enhance my analysis (as some reviewers asked me this plot) using the linear-trends model.

With regards,

John


问:
How to get Index for Treeview item in tkinter python?
I write the code which search the item from TreeView, but I need to find index for the searchable item.
I dident wont index from data list. The index from treeviw I expect.

```<code>noneRow=0
maxRow=0
exVal1=0
wb=load_workbook("database.xlsx")
ws=wb['partList']
totalRowLength=len(ws['A'])
for col in ws['A']:
    if col.value == None:
        noneRow+=1
        maxRow = totalRowLength - noneRow
l1=ws.iter_rows(min_row=1,max_row=1,max_col=3,values_only=True)
r_set=ws.iter_rows(min_row=2,max_row=maxRow,max_col=3,values_only=True)
column=[r for r in l1]
datas=[d for d in r_set]
###data for treeView
data=list(datas)

for record in data:
        if count % 2 == 0:
            my_tree.insert(parent='', index='end',iid=count, text='Parent', values=(record[0], record[1], record[2]), tags='evenrow')
        else:
            my_tree.insert(parent='', index='end', iid=count, text='Parent', values=(record[0], record[1], record[2]), tags='oddrow')
        count+=1
###
###
###search index of treeview item

for child in my_tree.get_children():
     sentenceSTRING = 'Any text or string'
     if sentenceSTRING in my_tree.item(child)['values']:
            treeitem = (my_tree.item(child)['values'])  #this search item name in treeview
            indexoftreeitem = ?

</code>```

I tried this method.

```<code>for child in my_tree.get_children():
     sentenceSTRING = 'Any text or string'
     if sentenceSTRING in my_tree.item(child)['values']:
            treeitem = (my_tree.item(child)['values'])  #this search item name in treeview
            indexoftreeitem = ?
</code>```

Body:
I write the code which search the item from TreeView, but I need to find index for the searchable item.
I dident wont index from data list. The index from treeviw I expect.

noneRow=0
maxRow=0
exVal1=0
wb=load_workbook("database.xlsx")
ws=wb['partList']
totalRowLength=len(ws['A'])
for col in ws['A']:
    if col.value == None:
        noneRow+=1
        maxRow = totalRowLength - noneRow
l1=ws.iter_rows(min_row=1,max_row=1,max_col=3,values_only=True)
r_set=ws.iter_rows(min_row=2,max_row=maxRow,max_col=3,values_only=True)
column=[r for r in l1]
datas=[d for d in r_set]
###data for treeView
data=list(datas)

for record in data:
        if count % 2 == 0:
            my_tree.insert(parent='', index='end',iid=count, text='Parent', values=(record[0], record[1], record[2]), tags='evenrow')
        else:
            my_tree.insert(parent='', index='end', iid=count, text='Parent', values=(record[0], record[1], record[2]), tags='oddrow')
        count+=1
###
###
###search index of treeview item

for child in my_tree.get_children():
     sentenceSTRING = 'Any text or string'
     if sentenceSTRING in my_tree.item(child)['values']:
            treeitem = (my_tree.item(child)['values'])  #this search item name in treeview
            indexoftreeitem = ?

I tried this method.

for child in my_tree.get_children():
     sentenceSTRING = 'Any text or string'
     if sentenceSTRING in my_tree.item(child)['values']:
            treeitem = (my_tree.item(child)['values'])  #this search item name in treeview
            indexoftreeitem = ?


问:
gpg No such file or directory
I'm trying to run gpg from a Bash script designed to backup a website.  The command that fails is

```<code>gpg --homedir /home/backupuser/.gnupg --verbose --no-tty --recipient {group-name} --trust-model always --output /home/backupuser/backup/{tar-file}.gpg --encrypt /mnt/ramdir/site-backup-backupuser/{tar-file}

</code>```

It fails with return code 127.  The gpg home directory exists, as does the {tar-file}. The output directory exists but the output file does not.

If I repeat the gpg command in the script it fails in exactly the same way. But if I execute it in shell immediately after it has failed in the script it works as expected.  The output is:

```<code>gpg: using subkey {hhhhhhhhhhhhhhhh} instead of primary key {hhhhhhhhhhhhhhhh}
gpg: automatically retrieved '{email address1}' via Local
gpg: No trust check due to '--trust-model always' option
gpg: using subkey {hhhhhhhhhhhhhhhh} instead of primary key {hhhhhhhhhhhhhhhh}
gpg: automatically retrieved '{email address2}' via Local
gpg: No trust check due to '--trust-model always' option
gpg: reading from '/mnt/ramdir/site-backup-backupuser/{tar-file}'
gpg: writing to '/home/backupuser/backup/{tar-file}.gpg'
gpg: '/mnt/ramdir/site-backup-backupuser/{tar-file}' already compressed
gpg: RSA/AES256 encrypted for: "{hhhhhhhhhhhhhhhh} {Comment} <{email address1}>"
gpg: RSA/AES256 encrypted for: "{hhhhhhhhhhhhhhhh} {Comment} <{email address2}>"
</code>```

This is Debian "bullseye" 11.6, gpg 2.2.27 and libgcrypt 1.8.8.

I have tried numerous combinations of parameters, always with the above result.  With or without --homedir, with or without sudo (I was getting desperate), from a file on disk rather than in RAM, with or without --verbose and several others.

Title: gpg No such file or directory

Body:
I'm trying to run gpg from a Bash script designed to backup a website.  The command that fails is

gpg --homedir /home/backupuser/.gnupg --verbose --no-tty --recipient {group-name} --trust-model always --output /home/backupuser/backup/{tar-file}.gpg --encrypt /mnt/ramdir/site-backup-backupuser/{tar-file}

It fails with return code 127.  The gpg home directory exists, as does the {tar-file}. The output directory exists but the output file does not.

If I repeat the gpg command in the script it fails in exactly the same way. But if I execute it in shell immediately after it has failed in the script it works as expected.  The output is:

gpg: using subkey {hhhhhhhhhhhhhhhh} instead of primary key {hhhhhhhhhhhhhhhh}
gpg: automatically retrieved '{email address1}' via Local
gpg: No trust check due to '--trust-model always' option
gpg: using subkey {hhhhhhhhhhhhhhhh} instead of primary key {hhhhhhhhhhhhhhhh}
gpg: automatically retrieved '{email address2}' via Local
gpg: No trust check due to '--trust-model always' option
gpg: reading from '/mnt/ramdir/site-backup-backupuser/{tar-file}'
gpg: writing to '/home/backupuser/backup/{tar-file}.gpg'
gpg: '/mnt/ramdir/site-backup-backupuser/{tar-file}' already compressed
gpg: RSA/AES256 encrypted for: "{hhhhhhhhhhhhhhhh} {Comment} <{email address1}>"
gpg: RSA/AES256 encrypted for: "{hhhhhhhhhhhhhhhh} {Comment} <{email address2}>"

This is Debian "bullseye" 11.6, gpg 2.2.27 and libgcrypt 1.8.8.

I have tried numerous combinations of parameters, always with the above result.  With or without --homedir, with or without sudo (I was getting desperate), from a file on disk rather than in RAM, with or without --verbose and several others.


问:
how to create a define that will check if the compiler supports std::execution?
I found that the android NDK still does not support std::execution yet.

I need a code snippet to detect this during compile time to enable alternative code.

Kindly help.


问:
Glob pattern condition in if statement
I have a simple for-loop that iterates over a glob-pattern and enters an if condition, for when the directory path is not equal to */venv then print the file. How can I get this working in the if statement?

For example:

```<code>for file in ML*/*; do if [ "$file" != */venv ]; then echo $file ; fi; done
</code>```

Is what I have tried, but it prints out:

```<code>[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
...
...
</code>```

The following implementation works for */venv:

```<code>for file in ML*/*; do if [[ "$file" != */venv]]; then find $file ; fi; done
</code>```

And if I wanted to exclude multiple paths:

```<code>for file in ML*/*; do if [[ "$file" != */venv && "$file" != */ENV_DIR ]]; then find $file ; fi; done
</code>```

However, this assumes only the inner directory. If I wanted to exclude all sub-directories that may have venv or ENV_DIR so */*/venv, */*/*/venv etc ..., how do I take this into consideration?

I have attempted the above with the following:

```<code>for file in ML*/*;
do for innerFile in $file*/*;
 do if [[ "$innerFile" != */venv && "$innerFile" != */ENV_DIR && "$file" != */venv && "$file" != */ENV_DIR ]];
  then find $innerFile ; fi;  done; done
</code>```

However, the nested loop only return inner-subdirectories, therefore $file is skipped and we only get $file*/* paths, but for further nested files like ML/plot/something/distant/venv this won't be captured and I'd have to nest even further. What is the most effective way to capture this nested exclusion?

The below solution does not work and still will include venv, or other directories that I want excluded. I found that the following works:

```<code>find ML*/* -not -path "*/venv/**"  -not -path "*/ENV_DIR/**" -print0 | while read -d $'\0' file; do if [[ "$file" != */venv && "$file" != */ENV_DIR ]]; then echo $file; fi; done
</code>```

This will only return the subdirectories and those files which do not contain venv or ENV_DIR, therefore, completing my previous proposal.

However, when I change echo $file to find $file the excluded directory path appears for ENV_DIR and I am not sure why because the IF condition should of removed it.

Title: Glob pattern condition in if statement

Body:
I have a simple for-loop that iterates over a glob-pattern and enters an if condition, for when the directory path is not equal to */venv then print the file. How can I get this working in the if statement?

For example:

for file in ML*/*; do if [ "$file" != */venv ]; then echo $file ; fi; done

Is what I have tried, but it prints out:

[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
[: too many arguments
...
...

The following implementation works for */venv:

for file in ML*/*; do if [[ "$file" != */venv]]; then find $file ; fi; done

And if I wanted to exclude multiple paths:

for file in ML*/*; do if [[ "$file" != */venv && "$file" != */ENV_DIR ]]; then find $file ; fi; done

However, this assumes only the inner directory. If I wanted to exclude all sub-directories that may have venv or ENV_DIR so */*/venv, */*/*/venv etc ..., how do I take this into consideration?

I have attempted the above with the following:

for file in ML*/*;
do for innerFile in $file*/*;
 do if [[ "$innerFile" != */venv && "$innerFile" != */ENV_DIR && "$file" != */venv && "$file" != */ENV_DIR ]];
  then find $innerFile ; fi;  done; done

However, the nested loop only return inner-subdirectories, therefore $file is skipped and we only get $file*/* paths, but for further nested files like ML/plot/something/distant/venv this won't be captured and I'd have to nest even further. What is the most effective way to capture this nested exclusion?

The below solution does not work and still will include venv, or other directories that I want excluded. I found that the following works:

find ML*/* -not -path "*/venv/**"  -not -path "*/ENV_DIR/**" -print0 | while read -d $'\0' file; do if [[ "$file" != */venv && "$file" != */ENV_DIR ]]; then echo $file; fi; done

This will only return the subdirectories and those files which do not contain venv or ENV_DIR, therefore, completing my previous proposal.

However, when I change echo $file to find $file the excluded directory path appears for ENV_DIR and I am not sure why because the IF condition should of removed it.


问:
jest.spyOn "Number of calls: 0", but actual implementation still called
I want to spy on the hashPassword function in authController to see if it's called with the correct arguments from the user model, while keeping it's implementation.

number of calls 0

The mock function is being set but is not being called, meanwhile the original hashPassword function is being called. It seems that it can be tricky to make jest.spyOn work, but I think it should work as I am using 2 separate files.

logged controller and user

test

```<code>const request = require('supertest')
const app = require('../src/app.js')
const db = require('./db.js')()
const authController = require('../src/controllers/authController')

//in memory database
beforeAll(async () => await db.connect())
afterEach(async () => await db.clear())
afterAll(async () => await db.disconnect())

it('hashes the password', async () => {
  const hashPassword = jest.spyOn(authController, 'hashPassword')

  console.log(require('../src/controllers/authController'))
  const user = await request(app)
    .post('/auth/signup')
    .send({ name: 'User', password: 'password', confirmPassword: 'password' })
  console.log(user.body)
  expect(hashPassword).toHaveBeenCalledWith('password')
})
</code>```

controller

```<code>const bcrypt = require('bcrypt')

async function hashPassword(password) {
  return await bcrypt.hash(password, 12)
}

function test() {
  return 'not mocked'
}

module.exports = { hashPassword, test }
</code>```

model

```<code>const mongoose = require('mongoose')
const { isEmail } = require('validator')
const { hashPassword } = require('../controllers/authController')

const userSchema = mongoose.Schema({
  name: {
    type: String,
    unique: true,
    required: [true, 'Username required'],
    minLength: [4, 'Username should have at least 4 characters'],
  },
  email: {
    type: String,
    unique: true,
    sparse: true, //ignore documents without the email field when determining uniqueness
    validate: [isEmail, 'Please enter a valid email.'],
  },
  password: {
    type: String,
    required: [true, 'Password required'],
    minLength: [6, 'Password should have at least 6 characters'],
  },
  confirmPassword: {
    type: String,
    required: true,
    validate: [matches, 'The passwords do not match'],
  },
  hashedPassword: {
    type: String,
    select: false,
  },
})

function matches() {
  const { password, confirmPassword } = this
  return password === confirmPassword
}

userSchema.post('validate', async function (doc) {
  //hash password
  this.hashedPassword = await hashPassword(this.password)

  //remove plain password before saving
  doc.password = undefined
  doc.confirmPassword = undefined
})

const User = mongoose.model('User', userSchema)
module.exports = User
</code>```

I am guessing the model file isn't using the mock version of hashPassword for some reason. However, if I simply use mock, it works as expected.

```<code>const request = require('supertest')
const app = require('../src/app.js')
const db = require('./db.js')()
const authController = require('../src/controllers/authController')

//in memory database
beforeAll(async () => await db.connect())
afterEach(async () => await db.clear())
afterAll(async () => await db.disconnect())

jest.mock('../src/controllers/authController')

it('hashes the password', async () => {
  console.log(require('../src/controllers/authController'))
  const user = await request(app)
    .post('/auth/signup')
    .send({ name: 'User', password: 'password', confirmPassword: 'password' })
  console.log(user.body)
  expect(authController.hashPassword).toHaveBeenCalled()
})
</code>```

(Is it relevant that it says "[Function: hashPassword]" instead of "[Function: mockConstructor]")

logged controller

(no hashed password, meaning the model is using the mocked version of the function)

logged response

I am confused by why jest.mock works while jest.spyOn doesn't. I found many similar questions, but I haven't really found an answer.

Body:
I want to spy on the hashPassword function in authController to see if it's called with the correct arguments from the user model, while keeping it's implementation.

number of calls 0

The mock function is being set but is not being called, meanwhile the original hashPassword function is being called. It seems that it can be tricky to make jest.spyOn work, but I think it should work as I am using 2 separate files.

logged controller and user

test

const request = require('supertest')
const app = require('../src/app.js')
const db = require('./db.js')()
const authController = require('../src/controllers/authController')

//in memory database
beforeAll(async () => await db.connect())
afterEach(async () => await db.clear())
afterAll(async () => await db.disconnect())

it('hashes the password', async () => {
  const hashPassword = jest.spyOn(authController, 'hashPassword')

  console.log(require('../src/controllers/authController'))
  const user = await request(app)
    .post('/auth/signup')
    .send({ name: 'User', password: 'password', confirmPassword: 'password' })
  console.log(user.body)
  expect(hashPassword).toHaveBeenCalledWith('password')
})

controller

const bcrypt = require('bcrypt')

async function hashPassword(password) {
  return await bcrypt.hash(password, 12)
}

function test() {
  return 'not mocked'
}

module.exports = { hashPassword, test }

model

const mongoose = require('mongoose')
const { isEmail } = require('validator')
const { hashPassword } = require('../controllers/authController')

const userSchema = mongoose.Schema({
  name: {
    type: String,
    unique: true,
    required: [true, 'Username required'],
    minLength: [4, 'Username should have at least 4 characters'],
  },
  email: {
    type: String,
    unique: true,
    sparse: true, //ignore documents without the email field when determining uniqueness
    validate: [isEmail, 'Please enter a valid email.'],
  },
  password: {
    type: String,
    required: [true, 'Password required'],
    minLength: [6, 'Password should have at least 6 characters'],
  },
  confirmPassword: {
    type: String,
    required: true,
    validate: [matches, 'The passwords do not match'],
  },
  hashedPassword: {
    type: String,
    select: false,
  },
})

function matches() {
  const { password, confirmPassword } = this
  return password === confirmPassword
}

userSchema.post('validate', async function (doc) {
  //hash password
  this.hashedPassword = await hashPassword(this.password)

  //remove plain password before saving
  doc.password = undefined
  doc.confirmPassword = undefined
})

const User = mongoose.model('User', userSchema)
module.exports = User

I am guessing the model file isn't using the mock version of hashPassword for some reason. However, if I simply use mock, it works as expected.

const request = require('supertest')
const app = require('../src/app.js')
const db = require('./db.js')()
const authController = require('../src/controllers/authController')

//in memory database
beforeAll(async () => await db.connect())
afterEach(async () => await db.clear())
afterAll(async () => await db.disconnect())

jest.mock('../src/controllers/authController')

it('hashes the password', async () => {
  console.log(require('../src/controllers/authController'))
  const user = await request(app)
    .post('/auth/signup')
    .send({ name: 'User', password: 'password', confirmPassword: 'password' })
  console.log(user.body)
  expect(authController.hashPassword).toHaveBeenCalled()
})

(Is it relevant that it says "[Function: hashPassword]" instead of "[Function: mockConstructor]")

logged controller

(no hashed password, meaning the model is using the mocked version of the function)

logged response

I am confused by why jest.mock works while jest.spyOn doesn't. I found many similar questions, but I haven't really found an answer.


问:
Php is limiting the amount of input I can put in columns help please
I have 18 columns in the database and when I insert 15 it works fine but when I try to add 3 more it doesn't insert anymore. It stops working. When separate the code to make it insert those 3 in a different code into the same table it only inserts those 3 but leaves the others blank. Does phpmyadmin have a limit to the outside input being put into the database? And why is that??? I should be able to input all data from html to php into the database with no problem since I can put that amount of columns in the table.

Here is my php code

```<code>if(isset($_POST['submit'])) {
    $host = "";
    $username = "";
    $password = "";
    $dbname ="";
    $conn = mysqli_connect($host, $username, $password, $dbname);
    $nck = $_POST['nck'];
    $CTB = $_POST['ctbn'];
    $CBB = $_POST['ctrbn'];
   if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO personal_information (first, last,nickname,dob,id,gender,mar_sts,address,country,province,zip_code,city_born,country_born,citzen_sts,position,q,phone,email) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = mysqli_stmt_init($conn);
mysqli_stmt_prepare($stmt, $sql);
mysqli_stmt_bind_param($stmt, "ssssssssssssssssss", $FN,$LN,$nck,$dte,$ID,$OP,$MS,$AD,$CT,$PF,$ZC,$CTB,$CBB,$CK,$PA,$q,$P,$EL);
mysqli_stmt_execute($stmt);
mysqli_close($conn);
}
</code>```

When I put this code into the database it goes blank, but when I remove 3 items for example if I removed q phone and email off it would work. only 15 of these work. The rest 3 refuse to work.

Body:
I have 18 columns in the database and when I insert 15 it works fine but when I try to add 3 more it doesn't insert anymore. It stops working. When separate the code to make it insert those 3 in a different code into the same table it only inserts those 3 but leaves the others blank. Does phpmyadmin have a limit to the outside input being put into the database? And why is that??? I should be able to input all data from html to php into the database with no problem since I can put that amount of columns in the table.

Here is my php code

if(isset($_POST['submit'])) {
    $host = "";
    $username = "";
    $password = "";
    $dbname ="";
    $conn = mysqli_connect($host, $username, $password, $dbname);
    $nck = $_POST['nck'];
    $CTB = $_POST['ctbn'];
    $CBB = $_POST['ctrbn'];
   if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO personal_information (first, last,nickname,dob,id,gender,mar_sts,address,country,province,zip_code,city_born,country_born,citzen_sts,position,q,phone,email) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = mysqli_stmt_init($conn);
mysqli_stmt_prepare($stmt, $sql);
mysqli_stmt_bind_param($stmt, "ssssssssssssssssss", $FN,$LN,$nck,$dte,$ID,$OP,$MS,$AD,$CT,$PF,$ZC,$CTB,$CBB,$CK,$PA,$q,$P,$EL);
mysqli_stmt_execute($stmt);
mysqli_close($conn);
}

When I put this code into the database it goes blank, but when I remove 3 items for example if I removed q phone and email off it would work. only 15 of these work. The rest 3 refuse to work.


问:
Custom fonts not working on tailwindcss in nextjs
I'm testing fonts in a nextjs proyect with tailwindcss and the fonts do not work, it renders the default font.

globals.css

```<code>@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
  font-family: 'JetBrainsMono';
  src: url(/assets/fonts/JetBrainsMono.ttf);
}

@font-face {
  font-family: 'Iosevka';
  src: url(/assets/fonts/Iosevka.ttf);
}

</code>```

tailwindcss.config.js

```<code>module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
</code>```

index.tsx

```<code>
import { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'

const Home: NextPage = () => {
  return (
    <>
      <Head>
        <title>test</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="icon" href="/favicon.ico" />
      </Head>
      <main>
        <div>
          <h1 className='Iosevka'>
            Iosevka
          </h1>
          <h1 className='JetBrainsMono'>
            Iosevka
          </h1>
       </div>
      </main>
    </>
  )
}

export default Home
</code>```

I have other proyects where this way to apply a custom font works, but in this test i can't get it work!

Body:
I'm testing fonts in a nextjs proyect with tailwindcss and the fonts do not work, it renders the default font.

globals.css

@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
  font-family: 'JetBrainsMono';
  src: url(/assets/fonts/JetBrainsMono.ttf);
}

@font-face {
  font-family: 'Iosevka';
  src: url(/assets/fonts/Iosevka.ttf);
}

tailwindcss.config.js

module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

index.tsx

import { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'

const Home: NextPage = () => {
  return (
    <>

        <title>test</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="icon" href="/favicon.ico" />

            Iosevka

            Iosevka

    </>
  )
}

export default Home

I have other proyects where this way to apply a custom font works, but in this test i can't get it work!